7_9:Typical program skeleton for command processing
来源:互联网 发布:plc编程sfc和梯形图 编辑:程序博客网 时间:2024/06/05 09:35
1 #include "apue.h"
2 #define TOKEN 5
3 void do_line (char *ptr);
4 void cmd_add (void);
5 int get_token(void);
6 #define MAXLINE 1024
7
8 char *tok_ptr;
9
10 int main()
11 {
12 char line[MAXLINE];
13 while (fgets(line,MAXLINE,stdin) != NULL){
14 do_line(line);
15 }
16 exit(0);
17 }
18
19 char *tok_ptr;
20
21 void do_line(char *ptr)
22 {
23 // tok_ptr = ptr;
24 // tok_ptr = ptr;
25 int cmd;
26 while ( (cmd = get_token()) > 0){
27 switch (cmd){
28 case TOKEN:
29 cmd_add();
30 break;
31 }
32 }
33
34 }
35
36 int get_token(void)
37 {
38 /* fetch the next token from the line pointed to by tok_ptr;*/
39 }
40
41 void cmd_add(void)
42 {
2 #define TOKEN 5
3 void do_line (char *ptr);
4 void cmd_add (void);
5 int get_token(void);
6 #define MAXLINE 1024
7
8 char *tok_ptr;
9
10 int main()
11 {
12 char line[MAXLINE];
13 while (fgets(line,MAXLINE,stdin) != NULL){
14 do_line(line);
15 }
16 exit(0);
17 }
18
19 char *tok_ptr;
20
21 void do_line(char *ptr)
22 {
23 // tok_ptr = ptr;
24 // tok_ptr = ptr;
25 int cmd;
26 while ( (cmd = get_token()) > 0){
27 switch (cmd){
28 case TOKEN:
29 cmd_add();
30 break;
31 }
32 }
33
34 }
35
36 int get_token(void)
37 {
38 /* fetch the next token from the line pointed to by tok_ptr;*/
39 }
40
41 void cmd_add(void)
42 {
43 int token;
44 token = get_token;
45 /* rest of processing for this commad */
46 }
0 0
- 7_9:Typical program skeleton for command processing
- 30 Examples For Awk Command In Text Processing
- Scripts for skeleton copy
- skeleton for gre argument
- program processing status disaplay
- A skeleton of a C# program
- IE program - Command Identifiers
- IE program - Command Identifiers
- Typical start-up process for x86 Linux
- one typical kickstart file for FC16
- Typical memory usage for objects in java
- Skeleton
- Fragments for background processing
- Advice for developing program
- Program for Fibonacci numbers
- Write a program to pratice ATA command
- ios开发(十一): command line program
- Security Update for JPEG Processing
- TextField 知识点(三)
- fullpage自动执行
- 成员变量初始化顺序-
- 在eclipse中增加配置文件方式
- linux 查看linux 版本
- 7_9:Typical program skeleton for command processing
- Java异常处理
- Html学习,使用AmazeUI实现的一些效果
- 计算器
- cvNameWindow("examples",CV_WINDOW_AUTOSIZE)鼠标控制图像大小
- c++计算网络延迟毫秒数
- Surface Pro4/Surface Pro3/MacBook Air/iPad Pro咋选?看完这篇就知道
- git 错误
- C#操作Access通用类实例