source.c File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int cmd_source (int argc, char **argv)
 mycmd_init (source, cmd_source,"source","source filename")


Function Documentation

int cmd_source ( int  argc,
char **  argv 
)

Definition at line 5 of file source.c.

References _do_cmd(), and fd.

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 }

Here is the call graph for this function:

mycmd_init ( source  ,
cmd_source  ,
"source"  ,
"source filename"   
)


Generated on Fri Nov 5 07:24:50 2010 for ejtag debug tools for loongson 232 cpu by  doxygen 1.5.6