void main(int argc, char *args[]) { if (0 == proc_arg(NULL, SHORT, LONG)) { DBG("gateway: %s\n", gateway); DBG("port: %s\n", port); DBG("tid: %d, rwt: %d\n", tid, rwt); } }
int main(int ac, char **av) { char *path = NULL; int so = -1; int nslot; int i; if (proc_arg(ac, av) < 0) goto out; if ((so = connect_to_pccardd(&path)) < 0) goto out; if ((nslot = get_slot_number(so)) < 0) goto out; if (slot_map == 0) { printf("%d\n", nslot); } else { for (i = 0; i < nslot; i++) { if ((slot_map & (1 << i))) { char *manuf; char *version; char *device; int state; if (get_slot_info(so, i, &manuf, &version, &device, &state) < 0) goto out; if (manuf == NULL || version == NULL || device == NULL) goto out; printf("%d~%s~%s~%s~%s\n", i, manuf, version, device, strstate(state)); free(manuf); free(version); free(device); } } } out: if (path) { unlink(path); free(path); } if (so >= 0) close(so); exit(0); }
void proc_cmd() { if(check_cmd(cmd)) proc_arg(); else fputs("@INV", COM_A); }
int main(int argc,char *argv[]) { csPrintf("maya2spr version 0.1\n" "A Maya Ascii (.MA) convertor for Crystal Space.\n" "By Keith Fulton\n\n"); if (argc < 6) fatal_usage(); else { int parm = 3; while (parm < argc-1) { parm = proc_arg(argc,argv,parm); if (!parm) fatal_usage(); } } if (!anims.GetSize() ) // no anims means we need to specify a default one { csPrintf("Warning: Only default action being generated!\n"); Animation *anim = new Animation; anim->name = "default"; anim->startframe = 1; DisplacementGroup dg; dg.startframe=0; dg.stopframe =0; dg.vertex=0; anim->displacements.Push(dg); // dummy displacement group anims.Push(anim); } const char* mdlfile = argv[1]; MayaModel* mdl = 0; if (Maya4Model::IsFileMayaModel(mdlfile)) mdl = new Maya4Model(mdlfile); else { csFPrintf(stderr, "Not a recognized Maya 4.0 Ascii model file: %s\n", mdlfile); exit(-1); } if (mdl->getError()) { csFPrintf(stderr, "\nError: %s\n", mdl->getErrorString()); delete mdl; exit(-1); } mdl->dumpstats(stdout); putchar('\n'); mdl->WriteSPR(argv[2],anims); delete mdl; csPrintf("maya2spr completed successfully.\n"); return 0; }