view test/simp0.c @ 935:7672a37e7545 default tip

Raspbery PI ARM support begin
author kono
date Sat, 24 Dec 2016 03:02:57 +0000
parents c2c709727221
children
line wrap: on
line source

int printf(const char *format, ...);

#define LBUFSIZE 10
static char current_file_dir[LBUFSIZE];   // keep track include file directory

void
copy_current_file_dir(char *name)
{
    char *s = name;
    char *d = current_file_dir;
    char *p;
    for(p = d;d<current_file_dir+LBUFSIZE && *s; ) {
        if (*s=='/') p = d+1;
        *d++ = *s++;
    }
    *p = 0;
}


main(int ac,char *av[])
{
    printf("#0021:%d %d %d %s\n",1,2,3,&av[ac-1][3]);
    copy_current_file_dir("test/hoge");
    printf("#0023:%s\n",current_file_dir);

    return 0;
}