Annotation of libelwix/example/test.c, revision 1.2

1.1       misho       1: #include <stdio.h>
                      2: #include <string.h>
                      3: #include <elwix.h>
                      4: 
                      5: 
                      6: int main(int argc, char **argv)
                      7: {
                      8:        int ret;
                      9:        char str[256], *s, s0[2][256];
                     10:        ait_val_t *v;
                     11: 
1.2     ! misho      12:        printf("ELWIX byte order is %d == %s endian\n", elwix_byteOrder(), 
        !            13:                        elwix_byteOrder() ? "little" : "big");
        !            14: 
1.1       misho      15:        if (argc < 2) {
                     16:                printf("regex:: regex_Verify([0-9]+) -> %s\n", 
                     17:                                regex_Verify("[0-9]+", "shmink132sdf09", NULL, NULL));
                     18:                printf("regex:: %s regex_Get([0-9]+) -> %d\n", str, 
                     19:                                regex_Get("[0-9]+", "shmink132sdf09", str, sizeof str));
                     20:                printf("regex:: %s not match regex_Get([ab]+) -> %d\n", str, 
                     21:                                regex_Get("[ab]+", "shmink132sdf09", str, sizeof str));
                     22: 
                     23:                s = regex_Replace("[0-9]+", "0shmink132sdf09", "XXX");
                     24:                printf("regex:: regex_Replace([0-9]+) -> %s with XXX\n", s);
                     25:                e_free(s);
                     26:                s = regex_Replace("[0-9]+", "shmink132sdf09", NULL);
                     27:                printf("regex:: regex_Replace([0-9]+) -> %s clear!\n", s);
                     28:                e_free(s);
                     29:        }
                     30: 
                     31:        if (argc > 2) {
                     32:                char *s2;
                     33: 
                     34:                v = str_Hex2Dig("PIUK_GN IAH");
                     35:                printf("S1=%s\n", AIT_GET_LIKE(v, char*));
                     36:                ait_freeVar(&v);
                     37:                v = str_Hex2Dig(argv[1]);
                     38:                printf("%s S1=%s\n", argv[1], AIT_GET_LIKE(v, char*));
                     39:                s2 = str_Dig2Hex(v);
                     40:                printf("S2=%s\n", s2);
                     41:                if (s2)
                     42:                        e_free(s2);
                     43:                ait_freeVar(&v);
                     44: 
                     45:                printf( "1=%d\n", str_LTrim(argv[1]));
                     46:                printf( "2=%d\n", str_RTrim(argv[2]));
                     47:                printf( "3=%d\n", str_Trim(argv[3]));
                     48:                printf("'%s' '%s' '%s'\n", argv[1], argv[2], argv[3]);
                     49:                printf("test p=%s f=%s path2file=%d\n", s0[0], s0[1], 
                     50:                                av_Path2File(argv[2], s0[0], 256, s0[1], 256));
                     51:                return 0;
                     52:        }
                     53: 
                     54:        return 0;
                     55: }

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