int rle_to(const char *file_in, const char *file_out) { int ret; int fd_in, fd_out; fd_in = file_open_ro(file_in); if (fd_in < 0) { print_error("open input file \"%s\" failed", file_in); return -1; } fd_out = file_open_wo(file_out); if (fd_out < 0) { print_error("open output file \"%s\" failed", file_out); ret = -1; goto out_close_in; } ret = frle_to(fd_in, fd_out); close(fd_out); out_close_in: close(fd_in); return ret; }
void ulinux_start(l argc,void **argv) { u8 _dprintf_buf[DPRINTF_BUF_SZ]; dprintf_buf=&_dprintf_buf[0]; if(argc!=2){ PERR("args:error:missing path name argument for conf file(argc=%d)\n",argc); exit(-1); } struct ctx_mysection cm; cm.c.fd=-1; cm.c.m=0; cm.c.sz=0; s8 r=file_open_ro(&cm.c,argv[1]); if(r==CONF_INI_ERR) exit(-1); s64 mysection_start=mysection_lookup(&cm); if(mysection_start>=0){ mysection_mycategory_properties_get(&cm,mysection_start); //here you can add other property categories } file_close(&cm.c);//ignore errors exit(0); }