void ChannelTriggerEnableMask (char *yytext, ConfObject * mioconfig) { char *punt; int channel_trigger_enable_mask; punt = FindPointer (yytext); mioconfig->self_trigger_enable_mask = strtoul (punt, NULL, 16); punt = FindPointer (yytext); if (reg_matches (punt, "[aA][cC][qQ][uU][iI][sS][iI][tT][iI][oO][nN]_[oO][nN][lL][yY]")) { mioconfig->self_trigger_enable_mask_mode = 0; } else if (reg_matches (punt, "[aA][cC][qQ][uU][iI][sS][iI][tT][iI][oO][nN]_[aA][nN][dD]_[tT][rR][gG][oO][uU][tT]")) { mioconfig->self_trigger_enable_mask_mode = 1; } else if (reg_matches (punt, "[dD][iI][sS][aA][bB][lL][eE][dD]")) { mioconfig->self_trigger_enable_mask_mode = 2; } }
void GetOpenInformation (char *yytext, ConfObject * mioconfig) { char *punt; int Type; int LinkNumber; int NodeNumber; int BaseAddress; punt = FindPointer (yytext); if (reg_matches (punt, "[Uu][Ss][Bb]")) Type = 0; else if (reg_matches (punt, "[Pp][Cc][Ii]")) Type = 1; else Type = -1; LinkNumber = FindIntegerValue (punt); punt = FindPointer (punt); NodeNumber = FindIntegerValue (punt); punt = FindPointer (punt); punt = FindPointer (punt); BaseAddress = strtoul (punt, NULL, 16); mioconfig->LinkType = Type; mioconfig->LinkNumber = LinkNumber; mioconfig->ConetNode = NodeNumber; mioconfig->VMEBaseAddress = BaseAddress; //printf ("%d %d %d %d\n", Type, LinkNumber, NodeNumber, BaseAddress); }
int OutputNIMTTL (char *yytext) { char *punt; punt = FindPointer (yytext); if (reg_matches (punt, "[Nn][Ii][Mm]")) return 0; else if (reg_matches (punt, "[Tt][Tt][Ll]")) return 1; else return -1; }
int OutputRisingFalling (char *yytext) { char *punt; punt = FindPointer (yytext); if (reg_matches (punt, "[rR][iI][sS][iI][nN][gG]")) return 0; else if (reg_matches (punt, "[fF][aA][lL][lL][iI][nN][gG]")) return 1; else return -1; }
int OutputFileFormat (char *yytext) { char *punt; punt = FindPointer (yytext); if (reg_matches (punt, "[Bb][Ii][Nn][Aa][Rr][Yy]")) return 0; else if (reg_matches (punt, "[Aa][Ss][Cc][Ii][Ii]")) return 1; else return -1; }
int YesNoAnswer (char *yytext) { char *punt; punt = FindPointer (yytext); if (reg_matches (punt, "[Yy][Ee][Ss]")) return 1; else if (reg_matches (punt, "[Nn][Oo]")) return 0; else return -1; }
void AllInformation (char *yytext, ConfObject * mioconfig) { char *punt; int mod; int yes_no; punt = FindPointer (yytext); if (reg_matches (punt, "[Ee][Nn][Aa][Bb][Ll][Ee]_[iI][nN][pP][uU][tT]")) mod = 0; else if (reg_matches (punt, "[dD][cC]_[oO][fF][fF][sS][eE][tT]")) mod = 1; else if (reg_matches (punt, "[tT][rR][iI][gG][gG][eE][rR]_[tT][hH][rR][eE][sS][hH][oO][lL][dD]")) mod = 2; else mod = -1; if (mod == 0) { //ENABLE_INPUT punt = FindPointer (punt); if (reg_matches (punt, "[Yy][Ee][Ss]")) { yes_no = 1; mioconfig->enable_input = yes_no; } else if (reg_matches (punt, "[Nn][Oo]")) { yes_no = 0; mioconfig->enable_input = yes_no; } } else if (mod == 1) { //DC_OFFSET punt = FindPointer (punt); int dc_offset = strtoul (punt, NULL, 16); mioconfig->dc_offset = dc_offset; } else if (mod == 2) { //TRIGGER_THRESHOLD punt = FindPointer (punt); int trigger_threshold = strtoul (punt, NULL, 16); mioconfig->trigger_threshold = trigger_threshold; } } //END_FUNCTION
static bool arg_is_valid(struct flag *pflag, char *arg) { switch(pflag->arg) { case ARG_NONE: return arg == NULL; case ARG_REGEX: case ARG_STRING: return true; case ARG_POSINTEGER: return reg_matches(POS_NUMBER, arg) && strtoul(arg, NULL, 0) <= INT_MAX; case ARG_IPV4: return reg_matches(IPV4_ADDR, arg); case ARG_IPV6: return reg_matches(IPV6_ADDR, arg); } return false; }
int GetAcquisitionMode (char *yytext) { char *punt; punt = FindPointer (yytext); if (reg_matches (punt, "[aA][cC][qQ][uU][iI][sS][iI][tT][iI][oO][nN]_[oO][nN][lL][yY]")) return 0; else if (reg_matches (punt, "[aA][cC][qQ][uU][iI][sS][iI][tT][iI][oO][nN]_[aA][nN][dD]_[tT][rR][gG][oO][uU][tT]")) return 1; else if (reg_matches (punt, "[dD][iI][sS][aA][bB][lL][eE][dD]")) return 2; else return -1; }
void FastInformation (char *yytext, ConfObject * mioconfig) { char *punt; int mod; //int yes_no; int fast; fast = FindIntegerValue (yytext); if (fast < MAXFASTOBJECT) { mioconfig->fasts[fast].set = 1; mioconfig->fasts[fast].numFast = fast + 1; punt = FindPointer (yytext); punt = FindPointer (punt); if (reg_matches (punt, "[dD][cC]_[oO][fF][fF][sS][eE][tT]")) mod = 0; else if (reg_matches (punt, "[tT][rR][iI][gG][gG][eE][rR]_[tT][hH][rR][eE][sS][hH][oO][lL][dD]")) mod = 1; else mod = -1; if (mod == 0) { //DC_OFFSET punt = FindPointer (punt); int dc_offset = strtoul (punt, NULL, 16); mioconfig->fasts[fast].dc_offset = dc_offset; } else if (mod == 1) { //TRIGGER_THRESHOLD punt = FindPointer (punt); int trigger_threshold = strtoul (punt, NULL, 16); mioconfig->fasts[fast].trigger_threshold = trigger_threshold; } } // if (fast < MAXFASTOBJECT) } //END_FUNCTION
void GroupInformation (char *yytext, ConfObject * mioconfig) { char *punt; int mod; int yes_no; int group; //int group_mask; group = FindIntegerValue (yytext); if (group < MAXGROUPOBJECT) { mioconfig->groups[group].set = 1; mioconfig->groups[group].numGroup = group; punt = FindPointer (yytext); punt = FindPointer (punt); if (reg_matches (punt, "[Ee][Nn][Aa][Bb][Ll][Ee]_[iI][nN][pP][uU][tT]")) mod = 0; else if (reg_matches (punt, "[dD][cC]_[oO][fF][fF][sS][eE][tT]")) mod = 1; else if (reg_matches (punt, "[tT][rR][iI][gG][gG][eE][rR]_[tT][hH][rR][eE][sS][hH][oO][lL][dD]")) mod = 2; else if (reg_matches (punt, "[gG][rR][oO][uU][pP]_[tT][rR][gG]_[eE][nN][aA][bB][lL][eE]_[mM][aA][sS][kK]")) mod = 3; else mod = -1; if (mod == 0) { //ENABLE_INPUT punt = FindPointer (punt); if (reg_matches (punt, "[Yy][Ee][Ss]")) { yes_no = 1; mioconfig->groups[group].enable_input = yes_no; } else if (reg_matches (punt, "[Nn][Oo]")) { yes_no = 0; mioconfig->groups[group].enable_input = yes_no; } } else if (mod == 1) { //DC_OFFSET punt = FindPointer (punt); int dc_offset = strtoul (punt, NULL, 16); mioconfig->groups[group].dc_offset = dc_offset; } else if (mod == 2) { //TRIGGER_THRESHOLD punt = FindPointer (punt); int trigger_threshold = strtoul (punt, NULL, 16); mioconfig->groups[group].trigger_threshold = trigger_threshold; } else if (mod == 3) { //GROUP_TRG_ENABLE_MASK punt = FindPointer (punt); int group_mask = strtoul (punt, NULL, 16); mioconfig->groups[group].group_trg_enable_mask = group_mask; } // else if (mod == 3) } // if (group < MAXGROUPOBJECT) } //END_FUNCTION
void ChInformation (char *yytext, ConfObject * mioconfig) { char *punt; int mod; int yes_no; int channel; int channel_trigger; channel = FindIntegerValue (yytext); if (channel < MAXCHANNELOBJECT) { mioconfig->channels[channel].set = 1; mioconfig->channels[channel].numChannel = channel; punt = FindPointer (yytext); punt = FindPointer (punt); if (reg_matches (punt, "[Ee][Nn][Aa][Bb][Ll][Ee]_[iI][nN][pP][uU][tT]")) mod = 0; else if (reg_matches (punt, "[dD][cC]_[oO][fF][fF][sS][eE][tT]")) mod = 1; else if (reg_matches (punt, "[tT][rR][iI][gG][gG][eE][rR]_[tT][hH][rR][eE][sS][hH][oO][lL][dD]")) mod = 2; else if (reg_matches (punt, "[cC][hH][aA][nN][nN][eE][lL]_[tT][rR][iI][gG][gG][eE][rR]")) mod = 3; else mod = -1; if (mod == 0) { //ENABLE_INPUT punt = FindPointer (punt); if (reg_matches (punt, "[Yy][Ee][Ss]")) { yes_no = 1; mioconfig->channels[channel].enable_input = yes_no; } else if (reg_matches (punt, "[Nn][Oo]")) { yes_no = 0; mioconfig->channels[channel].enable_input = yes_no; } } else if (mod == 1) { //DC_OFFSET punt = FindPointer (punt); int dc_offset = strtoul (punt, NULL, 16); mioconfig->channels[channel].dc_offset = dc_offset; } else if (mod == 2) { //TRIGGER_THRESHOLD punt = FindPointer (punt); int trigger_threshold = strtoul (punt, NULL, 16); mioconfig->channels[channel].trigger_threshold = trigger_threshold; //mioconfig->channels[channel].trigger_threshold; } else if (mod == 3) { //CHANNEL_TRIGGER punt = FindPointer (punt); if (reg_matches (punt, "[aA][cC][qQ][uU][iI][sS][iI][tT][iI][oO][nN]_[oO][nN][lL][yY]")) { channel_trigger = 0; mioconfig->channels[channel].channel_trigger = channel_trigger; } else if (reg_matches (punt, "[aA][cC][qQ][uU][iI][sS][iI][tT][iI][oO][nN]_[aA][nN][dD]_[tT][rR][gG][oO][uU][tT]")) { channel_trigger = 1; mioconfig->channels[channel].channel_trigger = channel_trigger; } else if (reg_matches (punt, "[dD][iI][sS][aA][bB][lL][eE][dD]")) { channel_trigger = 2; mioconfig->channels[channel].channel_trigger = channel_trigger; } } // else if (mod == 3) } //if (channel < MAXCHANNELOBJECT) } //END_FUNCTION