/* ------- code automatically created by ../scripts/adms_build_object.pl -------------- */ #include #include inline void adms_probe_free(p_probe myprobe) { if(!myprobe) return; adms_enumeration_free(myprobe->_subexpression._math._dependency); free(myprobe->_subexpression._math._value); adms_enumeration_free(myprobe->_seen); adms_enumeration_free(myprobe->_grounded); adms_global_increment_nbprobedestroy(); free(myprobe); } int adms_probe_cmp (p_probe myprobe,p_probe refprobe) { int status; status = ( (adms_probe_valueof_module (myprobe) != adms_probe_valueof_module (refprobe)) || (adms_probe_valueof_branch (myprobe) != adms_probe_valueof_branch (refprobe)) || (adms_probe_valueof_nature (myprobe) != adms_probe_valueof_nature (refprobe)) ); return status; } p_probe adms_probe_new(p_module mymodule,p_branch mybranch,p_nature mynature) { p_probe mynewprobe=(p_probe) calloc(1,(size_t)sizeof(t_probe)); adms_global_increment_nbprobenew(); mynewprobe->_subexpression._math._adms._datatypename=adms_adms_enumeration_datatypename_probe; mynewprobe->_subexpression._math._adms._seen=adms_adms_enumeration_seen_no; (mynewprobe->_subexpression._math)._value=adms_real_new(adms_NAN); (mynewprobe->_subexpression._math)._static=adms_enumeration_new(adms_math_enumeration_static_no,adms_math_fromstring_static_impl,adms_math_tostring_static_impl); (mynewprobe->_subexpression._math)._dynamic=adms_enumeration_new(adms_math_enumeration_dynamic_no,adms_math_fromstring_dynamic_impl,adms_math_tostring_dynamic_impl); (mynewprobe->_subexpression._math)._dependency=adms_enumeration_new(adms_math_enumeration_dependency_constant,adms_math_fromstring_dependency_impl,adms_math_tostring_dependency_impl); mynewprobe->_module_isdefault=-1; adms_probe_valueto_module (mynewprobe,mymodule); mynewprobe->_module_isdefault=1; mynewprobe->_branch_isdefault=-1; adms_probe_valueto_branch (mynewprobe,mybranch); mynewprobe->_branch_isdefault=1; mynewprobe->_nature_isdefault=-1; adms_probe_valueto_nature (mynewprobe,mynature); mynewprobe->_nature_isdefault=1; mynewprobe->_seen_isdefault=-1; adms_probe_valueto_seen(mynewprobe,adms_enumeration_new(adms_probe_enumeration_seen_no,adms_probe_fromstring_seen_impl,adms_probe_tostring_seen_impl)); mynewprobe->_seen_isdefault=1; mynewprobe->_discipline_isdefault=-1; mynewprobe->_grounded_isdefault=-1; adms_probe_valueto_grounded(mynewprobe,adms_enumeration_new(adms_probe_enumeration_grounded_no,adms_probe_fromstring_grounded_impl,adms_probe_tostring_grounded_impl)); mynewprobe->_grounded_isdefault=1; mynewprobe->_source_isdefault=-1; return mynewprobe; } p_adms adms_probe_new_impl (p_adms arguments[]) { p_probe mynewprobe; p_module mymodule=(p_module)arguments[0]; p_branch mybranch=(p_branch)arguments[1]; p_nature mynature=(p_nature)arguments[2]; mynewprobe=adms_probe_new(mymodule,mybranch,mynature); return adms_adms(mynewprobe); } /*$3($2)*/ char*adms_probe_uid (p_probe mynewprobe) { char*myuid=NULL; char*myuid0=adms_nature_uid(mynewprobe->_nature); char*myuid1=adms_branch_uid(mynewprobe->_branch); adms_strconcat(&myuid,myuid0); adms_strconcat2(&myuid,"("); adms_strconcat(&myuid,myuid1); adms_strconcat2(&myuid,")"); return myuid; } inline void adms_probe_valueto_module (p_probe myprobe,p_module _module) { myprobe->_module=_module; myprobe->_module_isdefault=0; } inline void adms_probe_valueto_branch (p_probe myprobe,p_branch _branch) { myprobe->_branch=_branch; myprobe->_branch_isdefault=0; } inline void adms_probe_valueto_nature (p_probe myprobe,p_nature _nature) { myprobe->_nature=_nature; myprobe->_nature_isdefault=0; } inline void adms_probe_valueto_seen (p_probe myprobe,p_enumeration _seen) { myprobe->_seen=_seen; myprobe->_seen_isdefault=0; } inline void adms_probe_valueto_discipline (p_probe myprobe,p_discipline _discipline) { myprobe->_discipline=_discipline; myprobe->_discipline_isdefault=0; } inline void adms_probe_valueto_grounded (p_probe myprobe,p_enumeration _grounded) { myprobe->_grounded=_grounded; myprobe->_grounded_isdefault=0; } inline void adms_probe_valueto_source (p_probe myprobe,p_source _source) { myprobe->_source=_source; myprobe->_source_isdefault=0; } e_probe_seen adms_probe_fromstring_seen_impl (p_admsttransform myadmsttransform,char*token) { if(!strcmp(token,"no")) return adms_probe_enumeration_seen_no; if(!strcmp(token,"yes")) return adms_probe_enumeration_seen_yes; adms_message_fatal_continue(("select='probe/seen': possible values:\n")) adms_message_fatal_continue(("no|yes\n")) adms_message_fatal(("see %s\n",adms_admsttransform_uid(myadmsttransform))) return 0; } char* adms_probe_tostring_seen_impl (p_admsttransform myadmsttransform,p_enumeration myenumeration) { e_probe_seen e=myenumeration->_value; if(e==adms_probe_enumeration_seen_no) return "no"; if(e==adms_probe_enumeration_seen_yes) return "yes"; adms_message_fatal_continue(("select='probe/seen': possible values:\n")) adms_message_fatal_continue(("no|yes\n")) adms_message_fatal(("see %s\n",adms_admsttransform_uid(myadmsttransform))) return NULL; } e_probe_grounded adms_probe_fromstring_grounded_impl (p_admsttransform myadmsttransform,char*token) { if(!strcmp(token,"no")) return adms_probe_enumeration_grounded_no; if(!strcmp(token,"yes")) return adms_probe_enumeration_grounded_yes; adms_message_fatal_continue(("select='probe/grounded': possible values:\n")) adms_message_fatal_continue(("no|yes\n")) adms_message_fatal(("see %s\n",adms_admsttransform_uid(myadmsttransform))) return 0; } char* adms_probe_tostring_grounded_impl (p_admsttransform myadmsttransform,p_enumeration myenumeration) { e_probe_grounded e=myenumeration->_value; if(e==adms_probe_enumeration_grounded_no) return "no"; if(e==adms_probe_enumeration_grounded_yes) return "yes"; adms_message_fatal_continue(("select='probe/grounded': possible values:\n")) adms_message_fatal_continue(("no|yes\n")) adms_message_fatal(("see %s\n",adms_admsttransform_uid(myadmsttransform))) return NULL; }