Go to the source code of this file.
Functions | |
| int | cmd_source (int argc, char **argv) |
| mycmd_init (source, cmd_source,"source","source filename") | |
| int cmd_source | ( | int | argc, | |
| char ** | argv | |||
| ) |
Definition at line 5 of file source.c.
00006 { 00007 unsigned long download_addr; 00008 struct stat statbuf; 00009 char *buf; 00010 int fd; 00011 if(stat(argv[1],&statbuf)!=0) 00012 { 00013 printf("error read file %s\n",argv[1]); 00014 exit(-1); 00015 } 00016 printf("open file %s,size %d\n",argv[1],statbuf.st_size); 00017 buf=malloc(statbuf.st_size); 00018 if(!buf)printf("error allocate memory\n"); 00019 fd=open(argv[1],O_RDONLY); 00020 read(fd,(buf),statbuf.st_size); 00021 close(fd); 00022 _do_cmd(buf,0); 00023 free(buf); 00024 00025 return 0; 00026 }
| mycmd_init | ( | source | , | |
| cmd_source | , | |||
| "source" | , | |||
| "source filename" | ||||
| ) |
1.5.6