/* #Specification: crossref / principle The crossref program walks some html file in seach for entry point. All entry point generated by nadoc are surrounded by ---. They are easy to spot. crossref reads html file and output line like this # file entry-point # Note that the entry-point (which generally correspond to a function is stripped from its surrounding ---. The output is sent on stdout. nadoc can reuse this output when generating sgml file to place cross-references. */ #include #include #include #include #include #include "nadoc.m" #define CROSSREF_VERSION 1 #define CROSSREF_RELEASE 1 static void showver() { fprintf (stderr,"crossref %d.%d (linuxconf-tools %d.%d)\n" ,CROSSREF_VERSION,CROSSREF_RELEASE ,TOOLS_VERSION,TOOLS_RELEASE); } static void usage() { showver(); fprintf (stderr,"%s\n",MSG_U(I_CROSSREF ,"crossref -pprefixe fichiers_html ...\n" "\n" "Ce programme extrait les points d'entrée des fichiers html\n" "pour permettre à nadoc de produire de références vers ces points\n" "d'entrée.\n" "\n" " -p Cet option insère un préfixe devant le path du fichier html.\n" " On utilise cet option lorsqu'on balaye une hiérarchie\n" " HTML complexe pour s'assurer que les hyperliens sont\n" " consistent. Par exemple, pour le projet linuxconf où\n" " tous les documents produits sont stocké dans le\n" " sous-répertoire /linuxconf/tech/api, la ligne de commande\n" " de crossref est:\n" "\n" " cd /home/httpd/html/linuxconf/tech/api\n" " crossref -p/linuxconf/tech/api */*.html\n") ); exit (-1); } int main (int argc, char *argv[]) { etc_loadmsg(); ARGP argp[26]; argc = anlparm(argc,argv,argp,"pv"); if (argp['v'-'a'].ptr != NULL){ showver(); }else if (argc < 2){ usage(); }else{ const char *prefix = ""; if (argp['p'-'a'].ptr != NULL) prefix = argp['p'-'a'].ptr; for (int i=1; i