CodeBus
www.codebus.net
Search
Sign in
Sign up
Hot Search :
Source
embeded
web
remote control
p2p
game
More...
Location :
Home
Search - MemSet
Main Category
SourceCode
Documents
Books
WEB Code
Develop Tools
Other resource
Search - MemSet - List
[
Linux-Unix
]
justforfun
DL : 1
srand[getpid[]] /* initialize some of the memory */ memset[heightmap, 0, MAPSIZE*MAPSIZE] memset[vpage, 0, RENDERWIDTH * RENDERHEIGHT] printf["Creating dx d fractal terrain\n", MAPSIZE, MAPSIZE] heightmap[0] = [rand[] 128] + 64 // initialize starting point on map CreateFractalMap[0, 0, MAPSIZE, MAPSIZE] printf["Smoothing terrain\n"] for [i = 0 i < 5 i++] SmoothMap[] MakeColorMap[] - srand[getpid[]] /* initialize some of the memory*/ memset[heightmap, 0, MAPSIZE*MAPSIZE] memset[vpage, 0, RENDERWIDTH* RENDERHEIGHT] printf["Creating dx d fractal terrain\n", MAPSIZE, MAPSIZE] heightmap[0] = [rand[] 128]+ 64 // initialize starting point on map CreateFractalMap[0, 0, MAPSIZE, MAPSIZE] printf["Smoothing terrain\n"] for [i = 0 i < 5 i++] SmoothMap[] MakeColorMap[]
Date
: 2025-12-31
Size
: 4kb
User
:
xrgj
[
Linux-Unix
]
yacc
DL : 0
srand[getpid[]] /* initialize some of the memory */ memset[heightmap, 0, MAPSIZE*MAPSIZE] memset[vpage, 0, RENDERWIDTH * RENDERHEIGHT] printf["Creating dx d fractal terrain\n", MAPSIZE, MAPSIZE] heightmap[0] = [rand[] 128] + 64 // initialize starting point on map CreateFractalMap[0, 0, MAPSIZE, MAPSIZE] printf["Smoothing terrain\n"] for [i = 0 i < 5 i++] SmoothMap[] MakeColorMap[] - srand[getpid[]] /* initialize some of the memory*/ memset[heightmap, 0, MAPSIZE*MAPSIZE] memset[vpage, 0, RENDERWIDTH* RENDERHEIGHT] printf["Creating dx d fractal terrain\n", MAPSIZE, MAPSIZE] heightmap[0] = [rand[] 128]+ 64 // initialize starting point on map CreateFractalMap[0, 0, MAPSIZE, MAPSIZE] printf["Smoothing terrain\n"] for [i = 0 i < 5 i++] SmoothMap[] MakeColorMap[]
Date
: 2025-12-31
Size
: 11kb
User
:
xrgj
[
Linux-Unix
]
taoqianzimulu
DL : 0
linux下如果目录为空目录,则只有.和.这两个也是属于目录类型的本代码使用递归来判断目录及其子目录是否为空目录 /*判断目录是否为空目录*/int IsEmptyDir(char*pszDir){DIR*pstDirp=NULL;struct dirent*pstDirStru=NULL;int ulFileNum=0;int ret=1;char szDir[100];memset(szDir,0,100);pstDirp=opendir(pszDir);if(NULL==pstDirp){printf("open dir error\n");return 0;}while(pstDirStru=readdir(pstDirp)){strcpy(szDir,pszDir);if(DT_DIR==pstDirStru-d_type){if(strcmp(pstDirStru-d_name,".")&&strcmp(pstDirStru-d_name,"."{ret=0;memset(szDir,0,100);sprintf(szDir,"s/s",pszDir,pstDirStru-d_name);IsEmptyDir(szDir);}}else{ret=0;}}closedir(pstDirp);if(ret==1){printf("s is empty dir\n",szDir);}else{printf("is not empty dir\n",szDir);}return ret;}经自己在dedora9下测试通过,希望代码能对大家有点帮助 本文来自: 高校自动化网(Www.zdh1909.com) 详细出处参考(转载请保留本链接):http://www.zdh1909.com/html/linux/12177.html-int IsEmptyDir(char*pszDir){DIR*pstDirp=NULL;struct dirent*pstDirStru=NULL;int ulFileNum=0;int ret=1;char szDir[100];memset(szDir,0,100);pstDirp=opendir(pszDir);if(NULL==pstDirp){printf("open dir error\n");return 0;}while(pstDirStru=readdir(pstDirp)){strcpy(szDir,pszDir);if(DT_DIR==pstDirStru-d_type){if(strcmp(pstDirStru-d_name,".")&&strcmp(pstDirStru-d_name,"."{ret=0;memset(szDir,0,100);sprintf(szDir,"s/s",pszDir,pstDirStru-d_name);IsEmptyDir(szDir);}}else{ret=0;}}closedir(pstDirp);if(ret==1){printf("s is empty dir\n",szDir);}else{printf("is not empty dir\n",szDir);}return ret;}
Date
: 2025-12-31
Size
: 58kb
User
:
tianwang
[
Linux-Unix
]
mem
DL : 0
包含几个内存管理函数和字符串函数的简单实现,memcpy,memcmp,memset,strsrim等-Simple realization of the memory management functions
Date
: 2025-12-31
Size
: 2kb
User
:
ytfeng
[
Linux-Unix
]
memset
DL : 0
Slight modifications for pa-risc linux.
Date
: 2025-12-31
Size
: 1kb
User
:
puihepiu
[
Linux-Unix
]
mem-memset-x86-64-asm-def
DL : 0
low level stuff for the following AVM cards:.
Date
: 2025-12-31
Size
: 2kb
User
:
muijiken
[
Linux-Unix
]
mem-memset
DL : 0
memset: Simple memory set in various ways for Linux v2.13.6.
Date
: 2025-12-31
Size
: 2kb
User
:
dingherrai
[
Linux-Unix
]
memset
DL : 0
Ceph constants and data types to share between kernel and user space.
Date
: 2025-12-31
Size
: 8kb
User
:
hanfvsun
[
Linux-Unix
]
mem-memset-arch
DL : 0
DC21285 registers for Linux v2.13.6.
Date
: 2025-12-31
Size
: 2kb
User
:
henpxker
[
Linux-Unix
]
memset
DL : 0
Slight modifications for pa-risc linux - Paul Bame.
Date
: 2025-12-31
Size
: 1kb
User
:
gkwuedp
[
Linux-Unix
]
mem-memset-x86-64-asm
DL : 0
Exception codes returned by the ACPI subsystem.
Date
: 2025-12-31
Size
: 5kb
User
:
naqxhu
[
Linux-Unix
]
ev6-memset
DL : 0
Much of the information about 21264 scheduling coding.
Date
: 2025-12-31
Size
: 3kb
User
:
pxvmfy
[
Linux-Unix
]
mem-memset-arch
DL : 0
UE Status Low CSR for Linux v2.13.6.
Date
: 2025-12-31
Size
: 12kb
User
:
gehutao
[
Linux-Unix
]
memset-sh4
DL : 0
align the dst to the cache block size if necessary.
Date
: 2025-12-31
Size
: 1kb
User
:
paliufao
[
Linux-Unix
]
NGbzero
DL : 0
NGbzero.S: Niagara optimized memset clear_user.
Date
: 2025-12-31
Size
: 1kb
User
:
magaocn
[
Linux-Unix
]
mem-memset-x86-64-asm-def
DL : 0
Adjust path mask to use next path and reset retry count. Return resulting path mask.
Date
: 2025-12-31
Size
: 3kb
User
:
doumlron
[
Linux-Unix
]
pinctrl-imx6sl
DL : 0
ANSI C standard library function memset.
Date
: 2025-12-31
Size
: 4kb
User
:
lellxd
[
Linux-Unix
]
pinctrl-coh901
DL : 0
NG4memset.S: Niagara-4 optimized memset bzero.
Date
: 2025-12-31
Size
: 6kb
User
:
jzqorv
[
Linux-Unix
]
SkUtils_opts_arm
DL : 0
FIXME: memset.arm.S is using syntax incompatible with XCode.
Date
: 2025-12-31
Size
: 2kb
User
:
ronmizer
[
Linux-Unix
]
memset
DL : 0
Most apps use memset sanely. Memsetting about 3.4 bytes or less get penalized here compared to the generic implementation Source Code for Linux.
Date
: 2025-12-31
Size
: 3kb
User
:
puiwivd
«
1
2
»
CodeBus
is one of the largest source code repositories on the Internet!
Contact us :
1999-2046
CodeBus
All Rights Reserved.