[Dda-cvs] modec/src couplepoint.c, 1.2, 1.3 ddaml.c, 1.2, 1.3 geomddaml.c, 1.24, 1.25
Status: Beta
Brought to you by:
doolin
From: David M. D. <do...@us...> - 2008-04-10 02:30:01
|
Update of /cvsroot/dda/modec/src In directory sc8-pr-cvs12.sourceforge.net:/tmp/cvs-serv28199/src Modified Files: couplepoint.c ddaml.c geomddaml.c Log Message: Fresh build with vs2005. Index: ddaml.c =================================================================== RCS file: /cvsroot/dda/modec/src/ddaml.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ddaml.c 1 Jul 2006 01:23:34 -0000 1.2 --- ddaml.c 10 Apr 2008 02:29:54 -0000 1.3 *************** *** 18,32 **** #include "ddaml.h" ! ! //#if (_MSC_VER >= 1300) && (WINVER < 0x0500) ! //VC7 or later, building with pre-VC7 runtime libraries ! //extern "C" ! long _ftol( double ); //defined by VC6 C libs ! //extern "C" ! long _ftol2( double dblSource ) { return _ftol( dblSource ); ! } ! //#endif ! ! void --- 18,32 ---- #include "ddaml.h" ! ! //#if (_MSC_VER >= 1300) && (WINVER < 0x0500) ! //VC7 or later, building with pre-VC7 runtime libraries ! //extern "C" ! long _ftol( double ); //defined by VC6 C libs ! //extern "C" ! //long _ftol2( double dblSource ) { return _ftol( dblSource ); ! //} ! //#endif ! ! void *************** *** 65,69 **** exit (0); } ! #endif } --- 65,69 ---- exit (0); } ! #endif } Index: couplepoint.c =================================================================== RCS file: /cvsroot/dda/modec/src/couplepoint.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** couplepoint.c 4 Jul 2006 16:06:14 -0000 1.2 --- couplepoint.c 10 Apr 2008 02:29:54 -0000 1.3 *************** *** 22,31 **** Couplepoint * couplepoint_new() { - - Couplepoint * cp; cp = (Couplepoint *)calloc(1,sizeof(Couplepoint)); return cp; - } --- 22,28 ---- Index: geomddaml.c =================================================================== RCS file: /cvsroot/dda/modec/src/geomddaml.c,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** geomddaml.c 1 Jul 2006 01:23:35 -0000 1.24 --- geomddaml.c 10 Apr 2008 02:29:54 -0000 1.25 *************** *** 33,48 **** #include "ddamemory.h" #include "geometrydata.h" - - #include "rb.h" ! #include "point.h" ! #include "fpoint.h" #include "loadpoint.h" #include "bolt.h" ! #include "joint.h" ! #include "couplepoint.h" ! ! // Used for setting max_value and numticks. ! #include "postscript.h" --- 33,48 ---- #include "ddamemory.h" #include "geometrydata.h" ! #include "rb.h" ! ! #include "point.h" ! #include "fpoint.h" #include "loadpoint.h" #include "bolt.h" ! #include "joint.h" ! #include "couplepoint.h" ! ! // Used for setting max_value and numticks. ! #include "postscript.h" *************** *** 63,68 **** static xmlNsPtr nspace; ! ! Rb_node rb_tree; --- 63,68 ---- static xmlNsPtr nspace; ! ! Rb_node rb_tree; *************** *** 76,80 **** ! static DDALine * --- 76,80 ---- ! static DDALine * *************** *** 107,128 **** } ! ! void ! parseBarscale(void * userdata, xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur) { ! ! char * temp; ! ! if (temp = xmlGetProp(cur,"max_value")) { ! ps_set_max_value(atof(temp)); ! } else { ! } ! ! if (temp = xmlGetProp(cur,"numticks")) { ! ps_set_numticks(atoi(temp)); ! } else { ! } ! ! } ! --- 107,128 ---- } ! ! void ! parseBarscale(void * userdata, xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur) { ! ! char * temp; ! ! if (temp = xmlGetProp(cur,"max_value")) { ! ps_set_max_value(atof(temp)); ! } else { ! } ! ! if (temp = xmlGetProp(cur,"numticks")) { ! ps_set_numticks(atoi(temp)); ! } else { ! } ! ! } ! *************** *** 206,210 **** } ! static void --- 206,210 ---- } ! static void *************** *** 280,284 **** FPoint * fp = fpoint_new(); tempstring = xmlNodeListGetString(doc, cur->children, 1); ! parse_a_line((Point*)fp,tempstring); pointlist_append_point(gd->fpointlist,(Point*)fp); --- 280,284 ---- FPoint * fp = fpoint_new(); tempstring = xmlNodeListGetString(doc, cur->children, 1); ! parse_a_line((Point*)fp,tempstring); pointlist_append_point(gd->fpointlist,(Point*)fp); *************** *** 290,306 **** pointlist_append_point(gd->fpointlist,(Point*)fp); ! } else if ((!strcmp(cur->name, "FPoint")) ) { ! ! double rotation,p1,p2; ! FPoint * fp = fpoint_new(); ! rotation = atof(xmlGetProp(cur, "rotation")); ! fpoint_set_rotation(fp,rotation); ! p1 = atof(xmlGetProp(cur, "p1")); ! p2 = atof(xmlGetProp(cur, "p2")); ! fpoint_set_pfactor(fp,p1,p2); ! tempstring = xmlNodeListGetString(doc, cur->children, 1); ! parse_a_point(tempstring,(Point*)fp); ! pointlist_append_point(gd->fpointlist,(Point*)fp); ! } else { --- 290,306 ---- pointlist_append_point(gd->fpointlist,(Point*)fp); ! } else if ((!strcmp(cur->name, "FPoint")) ) { ! ! double rotation,p1,p2; ! FPoint * fp = fpoint_new(); ! rotation = atof(xmlGetProp(cur, "rotation")); ! fpoint_set_rotation(fp,rotation); ! p1 = atof(xmlGetProp(cur, "p1")); ! p2 = atof(xmlGetProp(cur, "p2")); ! fpoint_set_pfactor(fp,p1,p2); ! tempstring = xmlNodeListGetString(doc, cur->children, 1); ! parse_a_point(tempstring,(Point*)fp); ! pointlist_append_point(gd->fpointlist,(Point*)fp); ! } else { *************** *** 334,340 **** Point * p = point_new(); tempstring = xmlNodeListGetString(doc, cur->children, 1); ! parse_a_point(tempstring,p); ! /** @todo Figure out a new way of handling errors from bad ddaml ! * input. */ if (p == NULL) { --- 334,340 ---- Point * p = point_new(); tempstring = xmlNodeListGetString(doc, cur->children, 1); ! parse_a_point(tempstring,p); ! /** @todo Figure out a new way of handling errors from bad ddaml ! * input. */ if (p == NULL) { *************** *** 408,482 **** while (cur != NULL) { ! ! if ((!strcmp(cur->name, "Point"))) { ! ! Loadpoint * lp = loadpoint_new(); ! tempstring = xmlNodeListGetString(doc, cur->children, 1); ! parse_a_point(tempstring,(Point*)lp); ! if (lp == NULL) { ! ddaml_display_error(error_string); ! } else { ! pointlist_append_point(gd->lpointlist,(Point*)lp); ! } ! } else { ! // Need to check for comment element in the xml before ! // deciding that we have an error ! //ddaml_display_error(error_string); ! } cur = cur->next; ! } } /* close parseLoadpointlist() */ ! ! //===== ! ! static void ! parse_couple_list(void * userdata, xmlDocPtr doc, ! xmlNsPtr ns, xmlNodePtr cur) { ! ! Geometrydata * gd = (Geometrydata*)userdata; ! ! //DDAPoint * point; ! /* Make the compiler link the floating point libraries. */ ! double temp[2] = {0.0}; ! char * tempstring; ! char * error_string = "Couple point failure, contact author"; ! ! //int checkval; ! ! //ddaml_display_error(error_string); ! ! /* Don't care about parent */ ! cur = cur->children; ! ! while (cur != NULL) { ! ! if ((!strcmp(cur->name, "Point"))) { ! ! Couplepoint * cp = couplepoint_new(); ! tempstring = xmlNodeListGetString(doc, cur->children, 1); ! parse_a_point(tempstring,(Point*)cp); ! if (cp == NULL) { ! ddaml_display_error(error_string); ! } else { ! pointlist_append_point(gd->cpointlist,(Point*)cp); ! } ! } else { ! // Need to check for comment element in the xml before ! // deciding that we have an error ! //ddaml_display_error(error_string); ! } ! ! cur = cur->next; ! } ! ! } /* close parse_couple_list() */ ! //===== ! ! static void parseHolepointlist(void * userdata, xmlDocPtr doc, --- 408,482 ---- while (cur != NULL) { ! ! if ((!strcmp(cur->name, "Point"))) { ! ! Loadpoint * lp = loadpoint_new(); ! tempstring = xmlNodeListGetString(doc, cur->children, 1); ! parse_a_point(tempstring,(Point*)lp); ! if (lp == NULL) { ! ddaml_display_error(error_string); ! } else { ! pointlist_append_point(gd->lpointlist,(Point*)lp); ! } ! } else { ! // Need to check for comment element in the xml before ! // deciding that we have an error ! //ddaml_display_error(error_string); ! } cur = cur->next; ! } } /* close parseLoadpointlist() */ ! //===== ! ! static void ! parse_couple_list(void * userdata, xmlDocPtr doc, ! xmlNsPtr ns, xmlNodePtr cur) { ! ! Geometrydata * gd = (Geometrydata*)userdata; ! ! //DDAPoint * point; ! /* Make the compiler link the floating point libraries. */ ! double temp[2] = {0.0}; ! char * tempstring; ! char * error_string = "Couple point failure, contact author"; ! ! //int checkval; ! ! //ddaml_display_error(error_string); ! ! /* Don't care about parent */ ! cur = cur->children; ! ! while (cur != NULL) { ! ! if ((!strcmp(cur->name, "Point"))) { ! ! Couplepoint * cp = couplepoint_new(); ! tempstring = xmlNodeListGetString(doc, cur->children, 1); ! parse_a_point(tempstring,(Point*)cp); ! if (cp == NULL) { ! ddaml_display_error(error_string); ! } else { ! pointlist_append_point(gd->cpointlist,(Point*)cp); ! } ! } else { ! // Need to check for comment element in the xml before ! // deciding that we have an error ! //ddaml_display_error(error_string); ! } ! ! cur = cur->next; ! } ! ! } /* close parse_couple_list() */ ! ! //===== ! ! static void parseHolepointlist(void * userdata, xmlDocPtr doc, *************** *** 701,705 **** ! /* FIXME: Move this code into geometrydata.c so that it can * called from anywhere. */ --- 701,705 ---- ! /* FIXME: Move this code into geometrydata.c so that it can * called from anywhere. */ *************** *** 791,818 **** {"Matlinelist", 0, *parseMatlinelist }, {"Boundlist", 0, *parseBoundlist }, ! {"Barscale", 0, *parseBarscale }, {NULL, 0, 0 } }; ! ! KWDTAB * ! kwdtab_new() { ! ! KWDTAB * kt = (KWDTAB*)malloc(sizeof(KWDTAB)); ! memset(kt,0xda,sizeof(KWDTAB)); ! return kt; ! } ! ! void ! ddaml_register_parsefn(Rb_node rb, char * el_name, int ktok, NodeParser nodeparse) { ! ! KWDTAB * kt = kwdtab_new(); ! kt->kwd = el_name; ! kt->ktok = ktok; ! kt->parsefn.nodeparse = nodeparse; ! ! rb_insert(rb,kt->kwd,kt); ! } ! static void --- 791,818 ---- {"Matlinelist", 0, *parseMatlinelist }, {"Boundlist", 0, *parseBoundlist }, ! {"Barscale", 0, *parseBarscale }, {NULL, 0, 0 } }; ! ! KWDTAB * ! kwdtab_new() { ! ! KWDTAB * kt = (KWDTAB*)malloc(sizeof(KWDTAB)); ! memset(kt,0xda,sizeof(KWDTAB)); ! return kt; ! } ! ! void ! ddaml_register_parsefn(Rb_node rb, char * el_name, int ktok, NodeParser nodeparse) { ! ! KWDTAB * kt = kwdtab_new(); ! kt->kwd = el_name; ! kt->ktok = ktok; ! kt->parsefn.nodeparse = nodeparse; ! ! rb_insert(rb,kt->kwd,kt); ! } ! static void *************** *** 820,830 **** xmlNsPtr ns, xmlNodePtr cur) { ! int i = 0; ! int found; ! ! // Experiment with ststic members. ! //KWDTAB kwt; ! KWDTAB * handler; ! Rb_node tmp; if (cur == NULL) { --- 820,830 ---- xmlNsPtr ns, xmlNodePtr cur) { ! int i = 0; ! int found; ! ! // Experiment with ststic members. ! //KWDTAB kwt; ! KWDTAB * handler; ! Rb_node rb_tmp; if (cur == NULL) { *************** *** 840,849 **** * be used in the main code. */ ! initializeGLists(); ! rb_tree = rb_new(); ! ! ddaml_register_parsefn(rb_tree,"Fixedpointlist",0,parseFixedpointlist); ! ddaml_register_parsefn(rb_tree,"Measuredpointlist",0,parseMeasuredpointlist); ! ddaml_register_parsefn(rb_tree,"Couplelist",0,parse_couple_list); /** This is global and not thread safe. */ --- 840,849 ---- * be used in the main code. */ ! initializeGLists(); ! rb_tree = rb_new(); ! ! ddaml_register_parsefn(rb_tree,"Fixedpointlist",0,parseFixedpointlist); ! ddaml_register_parsefn(rb_tree,"Measuredpointlist",0,parseMeasuredpointlist); ! ddaml_register_parsefn(rb_tree,"Couplelist",0,parse_couple_list); /** This is global and not thread safe. */ *************** *** 878,892 **** } i++; ! } ! ! ! #if 1 ! tmp = rb_find_key_n(rb_tree, (char*)cur->name, &found); ! if (found) { ! handler = (KWDTAB*)tmp->v.val; ! handler->parsefn.nodeparse((void*)gd,doc,ns,cur); ! } ! #endif ! cur = cur->next; } --- 878,892 ---- } i++; ! } ! ! ! #if 1 ! rb_tmp = rb_find_key_n(rb_tree, (char*)cur->name, &found); ! if (found) { ! handler = (KWDTAB*)rb_tmp->v.val; ! handler->parsefn.nodeparse((void*)gd,doc,ns,cur); ! } ! #endif ! cur = cur->next; } *************** *** 902,909 **** xmlDocPtr doc; xmlNsPtr ns; ! xmlNodePtr cur; ! xmlNode *root_element = NULL; ! ! Geometrydata * gd = (Geometrydata *)userdata; --- 902,909 ---- xmlDocPtr doc; xmlNsPtr ns; ! xmlNodePtr cur; ! xmlNode *root_element = NULL; ! ! Geometrydata * gd = (Geometrydata *)userdata; *************** *** 925,935 **** //cur = doc->root; //ns = nspace; ! ! ! root_element = xmlDocGetRootElement(doc); ! cur = root_element; ! ns = nspace; ! ! /* Here, we not only do not want the parent, we want to --- 925,935 ---- //cur = doc->root; //ns = nspace; ! ! ! root_element = xmlDocGetRootElement(doc); ! cur = root_element; ! ns = nspace; ! ! /* Here, we not only do not want the parent, we want to |