File:  [ELWIX - Embedded LightWeight unIX -] / libaitio / example / test.c
Revision 1.8.6.1: download - view: text, annotated - select for diffs - revision graph
Tue Jun 4 12:38:08 2013 UTC (11 years, 1 month ago) by misho
Branches: io5_3
Diff to: branchpoint 1.8: preferred, unified
patch stat check

    1: #include <stdio.h>
    2: #include <string.h>
    3: #include <aitio.h>
    4: 
    5: 
    6: int main(int argc, char **argv)
    7: {
    8: 	int ret;
    9: 	char str[256], *s, s0[2][256];
   10: 
   11: 	if (argc < 2) {
   12: 		printf("std:: %s ioPromptRead(NULL) -> %d\n", str, ioPromptRead(NULL, NULL, str, 256));
   13: 		printf("std:: %s ioPromptRead(PIUK> ) -> %d\n", str, (ret = ioPromptRead(NULL, "PIUK> ", str, 256)));
   14: 		printf("geterror:: #%d - %s\n", io_GetErrno(), io_GetError());
   15: 
   16: 		printf("std:: %s w/o confirm ioPromptPassword(NULL) -> %d\n", str, 
   17: 				ioPromptPassword(NULL, NULL, str, 256, 0));
   18: 		printf("std:: %s ioPromptPassword(NULL) -> %d\n", str, 
   19: 				ioPromptPassword(NULL, NULL, str, 256, 1));
   20: 		printf("std:: %s w/o confirm ioPromptPassword(PIUK> ) -> %d\n", str, 
   21: 				(ret = ioPromptPassword(NULL, "PIUK pass: ", str, 256, 0)));
   22: 		printf("geterror:: #%d - %s\n", io_GetErrno(), io_GetError());
   23: 
   24: 		printf("std:: %s ioPromptRead(FLIUP: ) -> %d\n", str, (ret = ioPromptRead(NULL, "FLIUP: ", str, 256)));
   25: 	} else {
   26: 		strlcpy(str, argv[1], sizeof str);
   27: 		printf("%s real filename is %s\n", str, ioRealFileName(str));
   28: 		printf("err: #%d - %s\n", io_GetErrno(), io_GetError());
   29: 	}
   30: 
   31: 	return 0;
   32: }

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