Exemple #1
0
/* Output startup string. */
void
set_init(void)
{
	const char *bp;
	int settle;

#ifdef TAB3
	if (oldmode.c_oflag & (TAB3 | ONLCR | OCRNL | ONLRET)) {
		oldmode.c_oflag &= (TAB3 | ONLCR | OCRNL | ONLRET);
		tcsetattr(STDERR_FILENO, TCSADRAIN, &oldmode);
	}
#endif
	settle = set_tabs();

	if (isreset) {
		if (reset_1string) {
			tputs(reset_1string, 0, outc);
			settle = 1;
		}
		if (reset_2string) {
			tputs(reset_2string, 0, outc);
			settle = 1;
		}
		if ((bp = reset_file) || (bp = init_file)) {
			tset_cat(bp);
			settle = 1;
		}
	}

	if (settle) {
		(void)putc('\r', stderr);
		(void)fflush(stderr);
		(void)sleep(1);			/* Settle the terminal. */
	}
}
BOOL CErrorAnal_dlg::OnInitDialog()
{
  m_separam=error_info.separam;
  m_peak_data=error_info.peak_data;
  m_peak_data.filter.rec_filter.align(document.data);
  m_sadl_data=error_info.sadl_data;
  m_sadl_data.filter.rec_filter.align(document.data);
  m_sigma_cal=error_info.sigma_cal;
  m_sigma_app=error_info.sigma_app;

  CDialog::OnInitDialog();

  set_tabs();

  return TRUE;  // return TRUE unless you set the focus to a control
}
Exemple #3
0
void print_class_d(CLASS *oclass, int tabdepth){
	PROPERTY *prop;
	FUNCTION *func;
	char tabs[33];

	set_tabs(tabs, tabdepth);

	printf("%sclass %s {\n", tabs, oclass->name);
	if (oclass->parent){
		printf("%s\tparent %s;\n", tabs, oclass->parent->name);
		print_class_d(oclass->parent, tabdepth+1);
	}
	for (func=oclass->fmap; func!=NULL && func->oclass==oclass; func=func->next)
		printf( "%s\tfunction %s();\n", tabs, func->name);
	for (prop=oclass->pmap; prop!=NULL && prop->oclass==oclass; prop=prop->next)
	{
		char *propname = class_get_property_typename(prop->ptype);
		if (propname!=NULL){
			if(PA_HIDDEN == (prop->access & PA_HIDDEN) ){
				continue;
			}
			if(prop->unit != NULL)
			{
				printf("%s\t%s %s[%s];", tabs, propname, prop->name, prop->unit->name);
			}
			else if (prop->ptype==PT_set || prop->ptype==PT_enumeration)
			{
				KEYWORD *key;
				printf("%s\t%s {", tabs, propname);
				for (key=prop->keywords; key!=NULL; key=key->next)
					printf("%s=%"FMT_INT64"u%s", key->name, (int64)key->value, key->next==NULL?"":", ");
				printf("} %s;", prop->name);
			} 
			else 
			{
				printf("%s\t%s %s;", tabs, propname, prop->name);
			}
			if (prop->description!=NULL)
				printf(" // %s%s",prop->flags&PF_DEPRECATED?"(DEPRECATED) ":"",prop->description);
			printf("\n");
		}
	}
	printf("%s}\n\n", tabs);
}
Exemple #4
0
/* Output startup string. */
static void
set_init(void)
{
    char *p;
    bool settle;

#ifdef __OBSOLETE__
    if (pad_char != (char *) 0)	/* Get/set pad character. */
	PC = pad_char[0];
#endif /* OBSOLETE */

#ifdef TAB3
    if (oldmode.c_oflag & (TAB3 | ONLCR | OCRNL | ONLRET)) {
	oldmode.c_oflag &= (TAB3 | ONLCR | OCRNL | ONLRET);
	SET_TTY(STDERR_FILENO, &oldmode);
    }
#endif
    settle = set_tabs();

    if (isreset) {
	if ((p = reset_1string) != 0) {
	    tputs(p, 0, outc);
	    settle = TRUE;
	}
	if ((p = reset_2string) != 0) {
	    tputs(p, 0, outc);
	    settle = TRUE;
	}
	/* What about rf, rs3, as per terminfo man page? */
	/* also might be nice to send rmacs, rmul, rmm */
	if ((p = reset_file) != 0
	    || (p = init_file) != 0) {
	    cat(p);
	    settle = TRUE;
	}
    }

    if (settle) {
	(void) putc('\r', stderr);
	(void) fflush(stderr);
	(void) napms(1000);	/* Settle the terminal. */
    }
}
void	interprete_command(t_users *user, char *command, char *args,
			   t_datas *datas)
{
  char	*commands[CMDS_END];
  void	(*fcnts[CMDS_END])(t_users *, t_datas *, char *);
  int	i = -1;

  set_tabs(commands, fcnts);
  to_lower(command);
  while (++i < CMDS_END)
    if (strcmp(commands[i], command) == 0)
      {
	pthread_mutex_lock(&datas->mutex);
	fcnts[i](user, datas, args);
	pthread_mutex_unlock(&datas->mutex);
	return ;
      }
  sendmessage(user->state, "ERROR 0 Command not found!");
}
Exemple #6
0
/* Output startup string. */
void
set_init(void)
{
	char *bp, buf[1024];
	int settle;

	bp = buf;
	if (tgetstr("pc", &bp) != 0)		/* Get/set pad character. */
		PC = buf[0];

#ifdef TAB3
	if (oldmode.c_oflag & (TAB3 | ONLCR | OCRNL | ONLRET)) {
		oldmode.c_oflag &= (TAB3 | ONLCR | OCRNL | ONLRET);
		tcsetattr(STDERR_FILENO, TCSADRAIN, &oldmode);
	}
#endif
	settle = set_tabs();

	if (isreset) {
		bp = buf;
		if (tgetstr("rs", &bp) != 0 || tgetstr("is", &bp) != 0) {
			tputs(buf, 0, outc);
			settle = 1;
		}
		bp = buf;
		if (tgetstr("rf", &bp) != 0 || tgetstr("if", &bp) != 0) {
			cat(buf);
			settle = 1;
		}
	}

	if (settle) {
		(void)putc('\r', stderr);
		(void)fflush(stderr);
		(void)sleep(1);			/* Settle the terminal. */
	}
}
void CErrorAnal_dlg::OnSeparam()
{
  DDX_Check(&CDataExchange(this,TRUE),IDC_SEPARAM,m_separam);
  set_tabs();
}
Exemple #8
0
/* BIN_FILE
 * --------
 * Input parameters:
 *   dataCol   - the column with the channel data
 *   numChans  - number of channels in groupCol and qualCol
 *   groupCol  - the GROUPING column
 *   qualCol   - the QUALITY column
 *   tabStops  - array giving channels with tabs or stops
 *   fDataCol  - the data column from template file
 *   fNumChans - number of channels from template file
 *   fGroupCol - the grouping column from template file
 *   fQualCol  - the quality column from template file
 */
int grp_do_bin_file(double *dataCol, long numChans, short *groupCol,
                    short *qualCol, short *tabStops, double *fDataCol,
                    long fNumChans, short *fGroupCol, short *fQualCol, 
		    int isColReal, dsErrList *errList){

    short isError = GRP_FALSE;
    double *binLow, *binHigh, *tBinLow, *tBinHigh;
    long groupBegin = -1, tabBegin = -1;
    long ii, index = 0, tIndex = 0;

    /* Check for obviously bad inputs */
    if(!dataCol || (numChans <= 0) || !groupCol || !qualCol
       || !tabStops || !fDataCol || (fNumChans <= 0) || !fGroupCol
       || !fQualCol){
        if(errList)
            dsErrAdd(errList, dsDMGROUPBADPARAMERR, Accumulation,
                     Generic);
        else
            err_msg("ERROR: At least one input parameter has an "
                    "invalid value.\n");
        return(GRP_ERROR);
    }
      
    binLow = (double *) calloc(fNumChans, sizeof(double));
    binHigh = (double *) calloc(fNumChans, sizeof(double));
    tBinLow = (double *) calloc(fNumChans, sizeof(double));
    tBinHigh = (double *) calloc(fNumChans, sizeof(double));

    /* Fill in tabStops */
    for(ii = 0; ii < fNumChans; ii++){
        if((fQualCol[ii] == GRP_TABBED)
           || (fGroupCol[ii] == GRP_UNUSED))
            tabStops[ii] = GRP_TRUE;
        else
            tabStops[ii] = GRP_FALSE;
    }
    
    /* Need to determine binLow, binHigh, numBins, tabStops */
    for(ii = 0; ii < (fNumChans - 1); ii++){
        
        /* Are we starting a group? */
        if((groupBegin < 0) && (fGroupCol[ii] == GRP_BEGIN))
            groupBegin = ii;

        /* Are we starting a tab? */
        if((tabBegin < 0) && (fQualCol[ii] == GRP_TABBED))
            tabBegin = ii;
        
        /* Are we at the end of a group? */
        if((groupBegin >= 0) && ((fGroupCol[ii + 1] == GRP_BEGIN) ||
                          (fQualCol[ii + 1] == GRP_TABBED))){
            /* Make group */
            binLow[index] = fDataCol[groupBegin];
            binHigh[index] = fDataCol[ii + 1];
            groupBegin = -1;
            index++;
        }
        
        /* Are we at the end of a tab? */
        if((tabBegin >= 0) && (fQualCol[ii + 1] != GRP_TABBED)){
            /* Make tab */
            tBinLow[tIndex] = fDataCol[tabBegin];
            tBinHigh[tIndex] = fDataCol[ii + 1];
            tabBegin = -1;
            tIndex++;
        }
        
        /* Are we at the end of the table? Handle grouping. */
        if((ii == (fNumChans - 2)) && (fQualCol[ii] != GRP_TABBED)){
            if((groupBegin < 0) && (fGroupCol[ii + 1] == GRP_BEGIN)){
                binLow[index] = fDataCol[ii + 1];
                binHigh[index] = fDataCol[ii + 1];
                index++;
            }
            else if((groupBegin >= 0) &&
                    (fGroupCol[ii + 1] != GRP_BEGIN)){
                binLow[index] = fDataCol[groupBegin];
                binHigh[index] = fDataCol[ii + 1];
                index++;
            }
        }
        
        /* Are we at the end of the table? Handle tabs. */
        if(ii == (fNumChans - 2)){
            if((tabBegin < 0) && (fQualCol[ii + 1] == GRP_TABBED)){
                tBinLow[tIndex] = fDataCol[ii + 1];
                tBinHigh[tIndex] = fDataCol[ii + 1];
                tIndex++;
            }
            else if(tabBegin >= 0){
                tBinLow[tIndex] = fDataCol[tabBegin];
                tBinHigh[tIndex] = fDataCol[ii + 1];
                tIndex++;
            }
        }
    } /* end for(ii) */
   
    isError = grp_do_bin(dataCol, numChans, binLow, binHigh, 
			 index, groupCol, qualCol, tabStops, 
			 errList, 0, isColReal);
    if(isError)
        return(GRP_ERROR);

    isError = set_tabs(dataCol, groupCol, qualCol, numChans, tBinLow,
                       tBinHigh, tIndex, 1, isColReal, errList);
    if(isError){
        err_msg("Error setting tabs in method BIN_FILE\n");
        return(GRP_ERROR);
    }

    free(binLow);
    free(binHigh);
    free(tBinLow);
    free(tBinHigh);
    
    return(GRP_SUCCESS);
}