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

Annotation of OpenXM/src/util/test.c, Revision 1.6

1.6     ! takayama    1: /* $OpenXM: OpenXM/src/util/test.c,v 1.5 2003/12/03 03:21:16 takayama Exp $ */
1.1       takayama    2: #include <stdio.h>
                      3: #include "ox_pathfinder.h"
                      4:
                      5: sGC_malloc(int a) {
                      6:   return GC_malloc(a);
                      7: }
                      8:
                      9: /* which command */
                     10: main(int argc,char *argv[]) {
1.4       takayama   11:   char *s;
1.6     ! takayama   12:   char **a;
        !            13:   int i;
        !            14:
        !            15:   printf("hello\n"); fflush(NULL);
        !            16:   a = getServerEnv("bin/ox_sm1");
        !            17:   i = 0;
        !            18:   if (a == NULL) {fprintf(stderr,"Not found.\n"); exit(10);}
        !            19:   while (a[i] != NULL) {
        !            20:        printf("i=%d,  %s\n",i,a[i++]);
        !            21:   }
        !            22:   exit(0);
        !            23:
1.1       takayama   24:   if (argc != 2) {
1.5       takayama   25:        fprintf(stderr,"test cmdname\n\n");
1.1       takayama   26:   }
1.5       takayama   27:   printf("%s\n",generateTMPfileName2("hoge","poly",0,0));
                     28:   printf("%s\n",generateTMPfileName2("hoge","poly",1,0));
                     29:   printf("%s\n",generateTMPfileName2("hoge","poly",0,1));
                     30:   printf("%s\n",generateTMPfileName2("hoge","poly",1,1));
                     31:   printf("---------------- getCommandPath ----------------\n");
1.1       takayama   32:   printf("%s\n",getCommandPath(argv[1]));
1.3       takayama   33:
                     34:   printf("%s (cyg) ==> %s (win)\n",argv[1],cygwinPathToWinPath(argv[1]));
                     35:   printf("%s (win) ==> %s (cyg)\n",argv[1],winPathToCygwinPath(argv[1]));
1.4       takayama   36:
                     37:   printf("------------------  oxEvalEnvVar ---------------\n");
                     38:   s = "/hoge/afo:${PATH}";
                     39:   printf("%s ==> %s\n",s,oxEvalEnvVar(s));
                     40:   s = "${PATH}:/hoge/afo";
                     41:   printf("%s ==> %s\n",s,oxEvalEnvVar(s));
                     42:   s = "/hoge/afo:${PATH";
                     43:   printf("%s ==> %s\n",s,oxEvalEnvVar(s));
                     44:   s = "/hoge/afo:$PATH}";
                     45:   printf("%s ==> %s\n",s,oxEvalEnvVar(s));
                     46:   s = "${HOME}:${PATH}:/hoge/afo";
                     47:   printf("%s ==> %s\n",s,oxEvalEnvVar(s));
1.1       takayama   48: }
                     49:
                     50:
                     51:

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