摘要: http://hi.baidu.com/scoundrelgg/item/d4083f8412eea05d26ebd97fLinux getopt()函数 getopt_long()函数get_opt()函数:函数原型::#include int getopt(int argc, char * const argv[], const char *optstring);extern char *optarg;extern int optind, opterr, optopt;用法见右边栏1.参数说明:optstring:选项字母组成的字串。如果该字串里的任一字符后面有冒号,那么这个选项就要求有选 阅读全文
posted @ 2014-02-11 15:43 一天不进步,就是退步 阅读(557) 评论(0) 推荐(0) 编辑
摘要: http://blog.sina.com.cn/s/blog_52deb9d50100ml6y.html在C语言中,修饰符extern用在变量或者函数的声明前,用来说明“此变量/函数是在别处定义的,要在此处引用”。1. extern修饰变量的声明。举例来说,如果文件a.c需要引用b.c中变量int v,就可以在a.c中声明extern int v,然后就可以引用变量v。这里需要注意的是,被引用的变量v的链接属性必须是外链接(external)的,也就是说a.c要引用到v,不只是取决于在a.c中声明extern int v,还取决于变量v本身是能够被引用到的。这涉及到c语言的另外一个话题--变量 阅读全文
posted @ 2014-02-11 10:37 一天不进步,就是退步 阅读(3630) 评论(0) 推荐(0) 编辑
摘要: 1. 线程的定义1.1 线程定义在scheduler.h文件中,其定义如下所示/* Thread itself. */typedef struct _thread { unsigned long id; /*identify*/ unsigned char type; /* thread type */ struct _thread *next; /* next pointer of the thread */ struct _thread *prev; /* previous pointer of the t... 阅读全文
posted @ 2014-02-11 10:33 一天不进步,就是退步 阅读(1436) 评论(0) 推荐(0) 编辑