const char *const ncd_short_options="f:l:Lp:t:d:w:gDo:v";
const char *const ncd_short_options="f:l:Lp:t:d:w:gDo:";
int main(int argc, char **argv){  struct NCDConfig *ncdcfg;  int next_option, whichLongOpt;  void testGSoapReq(void);  const char *const ncd_short_options="f:l:Lp:t:d:w:gDo:v";  struct option ncd_long_options[] = {      { "file-mode", 1, NULL, 'f' },      { "literal-mode", 1, NULL, 'l' },  /* also can be called "quoted mode" */      { "list", 0, NULL, 'L' },         /* list compressors */      { "plainlist-mode", 1, NULL, 'p' },      { "termlist-mode", 1, NULL, 't' },      { "directory-mode", 1, NULL, 'd' },      { "windowed-mode", 1, NULL, 'w' },      { "google", 0, NULL, 'g' },      { "delcache", 0, NULL, 'D' }, /* clear the google cache */      { "outfile", 1, NULL, 'o' },   /* distmatrix output file <filename> */      { NULL, 0, NULL, 0 },  };  cur = loadNCDEnvironment();  ncdcfg = (struct NCDConfig *) cur->vptr;#if CSOAP_RDY//  testGSoapReq();#endif  whichLongOpt = 1;  if (ncdcfg->da.dbf == NULL) /* must init */ {    ncdcfg->da.desize = 0;    ncdcfg->da.dbf = newDBEFactory();  }  while (1) {    next_option = complearn_getopt_long(argc, argv, ncd_short_options, ncd_long_options, &whichLongOpt, cur);    if (next_option == -1) /* options done */      break;    switch (next_option) {      case 'o':        gfreeifpresent(ncdcfg->output_distmat_fname);        ncdcfg->output_distmat_fname = gstrdup(optarg);        break;      case 'f':        dbef_setMode(ncdcfg->da.dbf, DBF_MODE_FILE);        ncdcfg->da.de[ncdcfg->da.desize++] =  dbef_convertStr(ncdcfg->da.dbf, optarg);        break;      case 't':        dbef_setMode(ncdcfg->da.dbf, DBF_MODE_STRINGLIST);        ncdcfg->da.de[ncdcfg->da.desize++] =  dbef_convertStr(ncdcfg->da.dbf, optarg);        cur->fUsingFilenames = 1;        break;      case 'p':        dbef_setMode(ncdcfg->da.dbf, DBF_MODE_FILELIST);        ncdcfg->da.de[ncdcfg->da.desize++] =  dbef_convertStr(ncdcfg->da.dbf, optarg);        break;      case 'l':        dbef_setMode(ncdcfg->da.dbf, DBF_MODE_QUOTED);        ncdcfg->da.de[ncdcfg->da.desize++] =  dbef_convertStr(ncdcfg->da.dbf, optarg);        break;      case 'L':        printBuiltinCompressors();//        cleanupBeforeExit();        exit(0);        break;      case 'd':        dbef_setMode(ncdcfg->da.dbf, DBF_MODE_DIRECTORY);        ncdcfg->da.de[ncdcfg->da.desize++] =  dbef_convertStr(ncdcfg->da.dbf, optarg);        break;      case 'w':        dbef_setMode(ncdcfg->da.dbf, DBF_MODE_WINDOWED);        ncdcfg->da.de[ncdcfg->da.desize++] =  dbef_convertStr(ncdcfg->da.dbf, optarg);        break;      case 'g':        dbef_setMode(ncdcfg->da.dbf, DBF_MODE_QUOTED);        cur->compressor_name = gstrdup("google");        break;      case 'D':        deleteSavedGC();        printf("Cache deleted.\n");//        cleanupBeforeExit();        exit(0);        break;      default:        printf("Unrecognized option, in case %d\n", next_option);    }  }  if (strcmp(cur->compressor_name, "google") == 0 ||      (cur->ca != NULL && strcmp(shortNameCA(cur->ca),"google") == 0)) {    ncdcfg->fUsingGoogle = 1;  }  //cur->fAddNL = cur->fUsingGoogle && !cur->fUsingFilenames; // cur->fAddNLAtString = cur->fUsingGoogle && cur->fUsingFilenames;  cur->fAddNLAtString = ncdcfg->fUsingGoogle;  if (optind < argc) {    while (optind < argc) {      char *op, *goodop;      op = argv[optind++];      if (cur->fAddNL) {        goodop = addNL(op);      }      else        goodop = gstrdup(op);      ncdcfg->da.de[ncdcfg->da.desize++] =  dbef_convertStr(ncdcfg->da.dbf, goodop);    }  }#if 1//  printf("Got %d DataBlock enumerations.\n", da.desize);  if (cur->fJustSize) {    if (ncdcfg->da.desize == 1) {      loadCompressor(cur);      printCounts(ncdcfg->da.de[0]);      exit(0);    }  }  if (ncdcfg->da.desize == 2) {    loadCompressor(cur);    printProduct(ncdcfg->da.de[0], ncdcfg->da.de[1], cur);  }#endif//  cleanupBeforeExit();  return 0;}