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

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

1.7     ! takayama    1: /* $OpenXM: OpenXM/src/util/test.c,v 1.6 2004/03/02 06:23:34 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:
1.7     ! takayama    9: main() {
        !            10:   int n;
        !            11:   /*
        !            12:   n = oxpSendStringAsFile((char *)getenv("USER"),
        !            13:                                                  "localhost", "t.t", "test\n");
        !            14:   */
        !            15:   n = oxpSendStringAsFile("taka",
        !            16:                                                  "lemon2.math.kobe-u.ac.jp", "t.t", "test\n");
        !            17:   printf("%d\n",n);
        !            18: }
1.1       takayama   19: /* which command */
1.7     ! takayama   20: main_1(int argc,char *argv[]) {
1.4       takayama   21:   char *s;
1.6       takayama   22:   char **a;
                     23:   int i;
                     24:
                     25:   printf("hello\n"); fflush(NULL);
                     26:   a = getServerEnv("bin/ox_sm1");
                     27:   i = 0;
                     28:   if (a == NULL) {fprintf(stderr,"Not found.\n"); exit(10);}
                     29:   while (a[i] != NULL) {
                     30:        printf("i=%d,  %s\n",i,a[i++]);
                     31:   }
                     32:   exit(0);
                     33:
1.1       takayama   34:   if (argc != 2) {
1.5       takayama   35:        fprintf(stderr,"test cmdname\n\n");
1.1       takayama   36:   }
1.5       takayama   37:   printf("%s\n",generateTMPfileName2("hoge","poly",0,0));
                     38:   printf("%s\n",generateTMPfileName2("hoge","poly",1,0));
                     39:   printf("%s\n",generateTMPfileName2("hoge","poly",0,1));
                     40:   printf("%s\n",generateTMPfileName2("hoge","poly",1,1));
                     41:   printf("---------------- getCommandPath ----------------\n");
1.1       takayama   42:   printf("%s\n",getCommandPath(argv[1]));
1.3       takayama   43:
                     44:   printf("%s (cyg) ==> %s (win)\n",argv[1],cygwinPathToWinPath(argv[1]));
                     45:   printf("%s (win) ==> %s (cyg)\n",argv[1],winPathToCygwinPath(argv[1]));
1.4       takayama   46:
                     47:   printf("------------------  oxEvalEnvVar ---------------\n");
                     48:   s = "/hoge/afo:${PATH}";
                     49:   printf("%s ==> %s\n",s,oxEvalEnvVar(s));
                     50:   s = "${PATH}:/hoge/afo";
                     51:   printf("%s ==> %s\n",s,oxEvalEnvVar(s));
                     52:   s = "/hoge/afo:${PATH";
                     53:   printf("%s ==> %s\n",s,oxEvalEnvVar(s));
                     54:   s = "/hoge/afo:$PATH}";
                     55:   printf("%s ==> %s\n",s,oxEvalEnvVar(s));
                     56:   s = "${HOME}:${PATH}:/hoge/afo";
                     57:   printf("%s ==> %s\n",s,oxEvalEnvVar(s));
1.1       takayama   58: }
                     59:
                     60:
                     61:

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