[BACK]Return to oxhtmlhelp.c CVS log [TXT][DIR] Up to [local] / OpenXM / src / util

Annotation of OpenXM/src/util/oxhtmlhelp.c, Revision 1.2

1.1       takayama    1: #include <stdio.h>
                      2: #include <stdlib.h>
                      3: #include <string.h>
                      4: #define BUFSIZE 1024
                      5: /* BUG:  it is only for knoppix/math */
                      6:
1.2     ! takayama    7: int main(int argc, char *argv[]) {
1.1       takayama    8:   char *oxhome;
                      9:   char browser[BUFSIZE];
                     10:   char fname[BUFSIZE];
                     11:   char comm[BUFSIZE];
                     12:   int i;
1.2     ! takayama   13:   int r;
1.1       takayama   14:
                     15:   fname[0] = 0;
                     16:   oxhome = getenv("OpenXM_HOME");
                     17:   if (oxhome == NULL) oxhome="/usr/local/OpenXM";
                     18:   for (i=1; i<argc; i++) {
                     19:     strcpy(fname,argv[i]);
                     20:   }
                     21:   if (getenv("BROWSER") == NULL) {
                     22:     strcpy(browser,"firefox");
                     23:   }else{
                     24:     strcpy(browser,getenv("BROWSER"));
                     25:   }
                     26:
                     27:   if (fname[0] == 0) {
                     28:     strcpy(fname,oxhome);
                     29:     strcat(fname,"/doc");
                     30:   }
                     31:
                     32:   sprintf(comm,"%s %s",browser,fname);
1.2     ! takayama   33:   r=system(comm);
1.1       takayama   34:
                     35:   return 0;
                     36:
                     37: }

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>