#include #include #include #include "permut.h" #include "nadoc.m" #define CROSSFIX_VERSION 1 #define CROSSFIX_RELEASE 7 static void showver() { fprintf (stderr,"crossfix %d.%d (linuxconf-tools %d.%d)\n" ,CROSSFIX_VERSION,CROSSFIX_RELEASE ,TOOLS_VERSION,TOOLS_RELEASE); } static void near usage (const char *argv0) { showver(); const char *msg = MSG_U(I_USAGEFIX, "Usage : crossfix -ddir -xcrossref_file [ -x...] html_files\n" "\n" "\"html_files\" will be copied to the destination directory\n" "and the keyword in cross-reference files will be used\n" "to insert HREF statement in the HTML files\n" "\n" "Those crossref are produced by nadoc and crossref utilities\n"); fputs (msg,stderr); } static void crossfix_url ( const char *file, const char *entry, FILE *fout) { fprintf (fout,"%s",file,entry,entry); } static void crossfix_putc (char car, FILE *fout, bool) { fputc (car,fout); } int main (int argc, char *argv[]) { etc_loadmsg(); int ret = -1; ARGP_MULTI argp[26]; argc = anlparm_multi(argc,argv,argp,"dx*v"); const char *dst = argp['d'-'a'].ptr; if (argp['v'-'a'].ptr != NULL){ showver(); }else if (argc < 2){ usage(argv[0]); }else if (dst == NULL){ fprintf (stderr,MSG_U(E_DSTDIR ,"You must specify the destination directory\n")); }else{ ARGP_MULTI *arg = &argp['x'-'a']; if (arg->ptr != NULL){ // Chargement des références croisées for (int i=0; inbptr; i++){ char *ptr = arg->ptrs[i]; crosstbl_load (ptr); } }else{ fprintf (stderr,MSG_U(E_ONEXREF ,"At least one cross reference file needed\n")); } for (int i=1; i