資源簡介
一個基于s3c2440的嵌入式OS,支持字符設備模型,塊設備模型,并實現了tcp/ip協議棧

代碼片段和文件信息
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#define?error_exit(_errmsg_) error(EXIT_FAILURE?errno?_errmsg_)
#define?PATH_LEN 1024
int?total;
int?process_dir(void);
int?process_file(const?char?*filename);
int?main()
{
process_dir();
printf(“total:?%d\n“?total);
return?0;
}
int?process_dir(void)
{
DIR?*dp?=?NULL;
char?*path?=?NULL;
struct?stat?statbuff;
struct?dirent?*?dirbuf?=?NULL;
int?namlen?=?0;
path?=?getcwd(NULL?0);
if?(NULL?==?(dp?=?opendir(path)))
error_exit(“opendir“);
while?(NULL?!=?(dirbuf?=?readdir(dp)))?{
/*?get?file?stat?*/
if?(-1?==?stat(dirbuf->d_name?&statbuff))
error_exit(dirbuf->d_name);
if?(‘.‘?==?dirbuf->d_name[0])
continue;
if?(S_ISDIR(statbuff.st_mode))?{
/*?if?dir?then?recursion?*/
if?(-1?==?chdir(dirbuf->d_name))
error_exit(dirbuf->d_name);
process_dir();
}?else?{
/*regular?file?comput?line*/
namlen?=?strlen(dirbuf->d_name);
#if?1
if?(strcmp(“.c“?dirbuf->d_name+namlen-2)?
&&?strcmp(“.h“?dirbuf->d_name+namlen-2)
&&?strcmp(“.sh“?dirbuf->d_name+namlen-3)
&&?strcmp(“Makefile“?dirbuf->d_name)
)?
continue;
#endif
namlen?=?process_file(dirbuf->d_name);
/*?exclude?sqlite3?*/
if?(namlen?4000)?{
printf(“%-30s?%d\n“?dirbuf->d_name?namlen);
total?+=?namlen;
}
}
}
closedir(dp);
chdir(“..“);
return?0;
}
int?process_file(const?char?*filename)
{
FILE?*fp?=?NULL;
char?tmp[1024];
int?line?=?0;
if?(NULL?==?(fp?=?fopen(filename?“r“)))
error_exit(filename);
while?(NULL?!=?fgets(tmp?1024?fp))
line?++;
return?line;
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2019-01-06?02:18??yap-master\
?????文件?????????200??2019-01-06?02:18??yap-master\.gitignore
?????文件????????2772??2019-01-06?02:18??yap-master\Ext_RAM.ini
?????文件?????????248??2019-01-06?02:18??yap-master\Jli
?????文件?????????248??2019-01-06?02:18??yap-master\Jli
?????文件????????1643??2019-01-06?02:18??yap-master\README.md
?????目錄???????????0??2019-01-06?02:18??yap-master\arch\
?????目錄???????????0??2019-01-06?02:18??yap-master\arch\arm\
?????文件????????7314??2019-01-06?02:18??yap-master\arch\arm\2440slib.s
?????文件????????7352??2019-01-06?02:18??yap-master\arch\arm\head.S
?????文件????????9759??2019-01-06?02:18??yap-master\arch\arm\init_system.c
?????文件????????1324??2019-01-06?02:18??yap-master\arch\arm\mach-s3c24xx.c
?????文件??????????98??2019-01-06?02:18??yap-master\arch\arm\mach-s3c24xx.h
?????文件????????3591??2019-01-06?02:18??yap-master\arch\arm\s3c24xx_irq.c
?????文件?????????640??2019-01-06?02:18??yap-master\arch\arm\s3c24xx_irqs.h
?????文件????????2326??2019-01-06?02:18??yap-master\cpsr_reg
?????目錄???????????0??2019-01-06?02:18??yap-master\driver\
?????文件????????5408??2019-01-06?02:18??yap-master\driver\block_dev.c
?????文件????????2592??2019-01-06?02:18??yap-master\driver\char_dev.c
?????文件????????8071??2019-01-06?02:18??yap-master\driver\device.c
?????文件????????2424??2019-01-06?02:18??yap-master\driver\key.c
?????文件????????1684??2019-01-06?02:18??yap-master\driver\led.c
?????文件????????2572??2019-01-06?02:18??yap-master\driver\led_device.c
?????文件????????2911??2019-01-06?02:18??yap-master\driver\led_driver.c
?????文件????????8847??2019-01-06?02:18??yap-master\driver\nand.c
?????目錄???????????0??2019-01-06?02:18??yap-master\driver\net\
?????文件???????15046??2019-01-06?02:18??yap-master\driver\net\DM9000.c
?????文件????????2870??2019-01-06?02:18??yap-master\driver\net\arp.c
?????文件???????15819??2019-01-06?02:18??yap-master\driver\net\dm9000_new.c
?????文件????????2264??2019-01-06?02:18??yap-master\driver\net\dm9000_new.h
?????文件?????????506??2019-01-06?02:18??yap-master\driver\net\net_dev.c
............此處省略105個文件信息
- 上一篇:集成運放恒流源電路+附電路講解
- 下一篇:K43SV維修過程
評論
共有 條評論