Diff for /libaitio/example/test.c between versions 1.1 and 1.9

version 1.1, 2010/02/23 22:54:52 version 1.9, 2013/06/04 12:44:46
Line 1 Line 1
 #include <stdio.h>  #include <stdio.h>
   #include <string.h>
 #include <aitio.h>  #include <aitio.h>
   
   
int main()int main(int argc, char **argv)
 {  {
         int ret;          int ret;
        char str[256], *s;        char str[256], *s, s0[2][256];
   
        printf("std:: %s ioPromptRead(NULL) -> %d\n", str, ioPromptRead(NULL, NULL, str, 256));        if (argc < 2) {
        printf("std:: %s ioPromptRead(PIUK> ) -> %d\n", str, (ret = ioPromptRead(NULL, "PIUK> ", str, 256)));                printf("std:: %s ioPromptRead(NULL) -> %d\n", str, ioPromptRead(NULL, NULL, str, 256));
        printf("geterror:: #%d - %s\n", io_GetErrno(), io_GetError());                printf("std:: %s ioPromptRead(PIUK> ) -> %d\n", str, (ret = ioPromptRead(NULL, "PIUK> ", str, 256)));
                 printf("geterror:: #%d - %s\n", io_GetErrno(), io_GetError());
   
        printf("std:: %s w/o confirm ioPromptPassword(NULL) -> %d\n", str,                 printf("std:: %s w/o confirm ioPromptPassword(NULL) -> %d\n", str, 
                        ioPromptPassword(NULL, NULL, str, 256, 0));                                ioPromptPassword(NULL, NULL, str, 256, 0));
        printf("std:: %s ioPromptPassword(NULL) -> %d\n", str,                 printf("std:: %s ioPromptPassword(NULL) -> %d\n", str, 
                        ioPromptPassword(NULL, NULL, str, 256, 1));                                ioPromptPassword(NULL, NULL, str, 256, 1));
        printf("std:: %s w/o confirm ioPromptPassword(PIUK> ) -> %d\n", str,                 printf("std:: %s w/o confirm ioPromptPassword(PIUK> ) -> %d\n", str, 
                        (ret = ioPromptPassword(NULL, "PIUK pass: ", str, 256, 0)));                                (ret = ioPromptPassword(NULL, "PIUK pass: ", str, 256, 0)));
        printf("geterror:: #%d - %s\n", io_GetErrno(), io_GetError());                printf("geterror:: #%d - %s\n", io_GetErrno(), io_GetError());
   
        printf("std:: %s ioPromptRead(FLIUP: ) -> %d\n", str, (ret = ioPromptRead(NULL, "FLIUP: ", str, 256)));                printf("std:: %s ioPromptRead(FLIUP: ) -> %d\n", str, (ret = ioPromptRead(NULL, "FLIUP: ", str, 256)));
        } else {
        printf("regex:: %s ioRegexVerify([0-9]+) -> %s\n", str, ioRegexVerify("[0-9]+", "shmink132sdf09", NULL, NULL));                strlcpy(str, argv[1], sizeof str);
        printf("regex:: %s ioRegexGet([0-9]+) -> %d\n", str, ioRegexGet("[0-9]+", "shmink132sdf09", str, 256));                printf("%s real filename is %s\n", str, ioRealFileName(str));
        printf("regex:: %s not match ioRegexGet([ab]+) -> %d\n", str, ioRegexGet("[ab]+", "shmink132sdf09", str, 256));                printf("err: #%d - %s\n", io_GetErrno(), io_GetError());
        }
        s = ioRegexReplace("[0-9]+", "0shmink132sdf09", "XXX"); 
        printf("regex:: ioRegexReplace([0-9]+) -> %s with XXX\n", s); 
        free(s); 
        s = ioRegexReplace("[0-9]+", "shmink132sdf09", NULL); 
        printf("regex:: ioRegexReplace([0-9]+) -> %s clear!\n", s); 
        free(s); 
   
         return 0;          return 0;
 }  }

Removed from v.1.1  
changed lines
  Added in v.1.9


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