File:  [ELWIX - Embedded LightWeight unIX -] / libaitio / example / test.c
Revision 1.9: download - view: text, annotated - select for diffs - revision graph
Tue Jun 4 12:44:46 2013 UTC (10 years, 11 months ago) by misho
Branches: MAIN
CVS tags: io7_4, io7_3, io7_2, io7_1, io7_0, io6_9, io6_8, io6_7, io6_6, io6_5, io6_4, io6_3, io6_2, io6_1, io6_0, io5_9, io5_8, io5_7, io5_6, io5_5, io5_4, IO7_3, IO7_2, IO7_1, IO7_0, IO6_9, IO6_8, IO6_7, IO6_6, IO6_5, IO6_4, IO6_3, IO6_2, IO6_1, IO6_0, IO5_9, IO5_8, IO5_7, IO5_6, IO5_5, IO5_4, IO5_3, HEAD
version 5.3

#include <stdio.h>
#include <string.h>
#include <aitio.h>


int main(int argc, char **argv)
{
	int ret;
	char str[256], *s, s0[2][256];

	if (argc < 2) {
		printf("std:: %s ioPromptRead(NULL) -> %d\n", str, ioPromptRead(NULL, NULL, str, 256));
		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, 
				ioPromptPassword(NULL, NULL, str, 256, 0));
		printf("std:: %s ioPromptPassword(NULL) -> %d\n", str, 
				ioPromptPassword(NULL, NULL, str, 256, 1));
		printf("std:: %s w/o confirm ioPromptPassword(PIUK> ) -> %d\n", str, 
				(ret = ioPromptPassword(NULL, "PIUK pass: ", str, 256, 0)));
		printf("geterror:: #%d - %s\n", io_GetErrno(), io_GetError());

		printf("std:: %s ioPromptRead(FLIUP: ) -> %d\n", str, (ret = ioPromptRead(NULL, "FLIUP: ", str, 256)));
	} else {
		strlcpy(str, argv[1], sizeof str);
		printf("%s real filename is %s\n", str, ioRealFileName(str));
		printf("err: #%d - %s\n", io_GetErrno(), io_GetError());
	}

	return 0;
}

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