Esempio n. 1
0
void main(void)
{
 char *res;
 res=GetProcess("\0");
 printf("GetProcess %s\n",res);
 free(res);

 res=ReadSet("TEMP","\0");
 printf("ReadSet %s\n",res);
 free(res);     
}
Esempio n. 2
0
//----------------------------------------------------------------------------------------------
SetDetector::SetDetector(QSqlDatabase  &i_ocConnect)
{
	m_pocConnect = &i_ocConnect ;
	m_u16CountSet = ReadSet() ;
	if ( m_u16CountSet == 0 )
	{
		LastErrorCode = 2 ;
		return ;
	}
	if ( ReadCrcMatch() == false ) 
	{
		LastErrorCode = 3 ;
	}
	m_pocBuffer = NULL ;
}
Esempio n. 3
0
int
main(int argc, char **argv)
{
	struct dataset *ds[7];
	int nds;
	double a;
	const char *delim = " \t";
	char *p;
	int c, i, ci;
	int column = 1;
	int flag_s = 0;
	int flag_n = 0;
	int termwidth = 74;
	int suppress_plot = 0;

	if (isatty(STDOUT_FILENO)) {
		struct winsize wsz;

		if ((p = getenv("COLUMNS")) != NULL && *p != '\0')
			termwidth = atoi(p);
		else if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &wsz) != -1 &&
			 wsz.ws_col > 0)
			termwidth = wsz.ws_col - 2;
	}

	ci = -1;
	while ((c = getopt(argc, argv, "AC:c:d:snw:")) != -1)
		switch (c) {
		case 'A':
			suppress_plot = 1;
			break;
		case 'C':
			column = strtol(optarg, &p, 10);
			if (p != NULL && *p != '\0')
				usage("Invalid column number.");
			if (column <= 0)
				usage("Column number should be positive.");
			break;
		case 'c':
			a = strtod(optarg, &p);
			if (p != NULL && *p != '\0')
				usage("Not a floating point number");
			for (i = 0; i < NCONF; i++)
				if (a == studentpct[i])
					ci = i;
			if (ci == -1)
				usage("No support for confidence level");
			break;
		case 'd':
			if (*optarg == '\0')
				usage("Can't use empty delimiter string");
			delim = optarg;
			break;
		case 'n':
			flag_n = 1;
			break;
		case 's':
			flag_s = 1;
			break;
		case 'w':
			termwidth = strtol(optarg, &p, 10);
			if (p != NULL && *p != '\0')
				usage("Invalid width, not a number.");
			if (termwidth < 0)
				usage("Unable to move beyond left margin.");
			break;
		default:
			usage("Unknown option");
			break;
		}
	if (ci == -1)
		ci = 2;
	argc -= optind;
	argv += optind;

	if (argc == 0) {
		ds[0] = ReadSet("-", column, delim);
		nds = 1;
	} else {
		if (argc > (MAX_DS - 1))
			usage("Too many datasets.");
		nds = argc;
		for (i = 0; i < nds; i++)
			ds[i] = ReadSet(argv[i], column, delim);
	}

	for (i = 0; i < nds; i++) 
		printf("%c %s\n", symbol[i+1], ds[i]->name);

	if (!flag_n && !suppress_plot) {
		SetupPlot(termwidth, flag_s, nds);
		for (i = 0; i < nds; i++)
			DimPlot(ds[i]);
		for (i = 0; i < nds; i++)
			PlotSet(ds[i], i + 1);
		DumpPlot();
	}
	VitalsHead();
	Vitals(ds[0], 1);
	for (i = 1; i < nds; i++) {
		Vitals(ds[i], i + 1);
		if (!flag_n)
			Relative(ds[i], ds[0], ci);
	}
	exit(0);
}
Esempio n. 4
0
 printf("At3:%s:\n",ptr);
 free(ptr);

 ptr=Proper("HERVE thouzard 123","\0");
 printf("Proper:%s:\n",ptr);
 free(ptr);

 ptr=Proper(" ","\0");
 printf("Proper:%s:\n",ptr);
 free(ptr);
 
 ptr=Proper("","\0");
 printf("Proper:%s:\n",ptr);
 free(ptr);

 ptr=ReadSet("TEMP","\0");
 printf("ReadSet:%s:\n",ptr);
 free(ptr);
 
 ptr=ReadSet("herv�","\0");
 printf("ReadSet introuvable:%s:\n",ptr);
 free(ptr);

 ptr=CopieAt("LIGNE DE TEXTE","DE","\0");
 printf("CopieAt:%s:\n",ptr);
 free(ptr);
 
 ptr=CopieAt("LIGNE DE TEXTE","de","\0");
 printf("CopieAt MAJ/MIN:%s:\n",ptr);
 free(ptr);