From fdb4e4cd363323829ebf0fd12172e4e5c6755652 Mon Sep 17 00:00:00 2001 From: agibert Date: Wed, 12 Nov 2008 02:25:22 +0000 Subject: [PATCH] Initial creation. --- GNU-FDL.txt | 355 + GNU-GPL.txt | 340 + ReadMe.txt | 52 + ReleaseNotes.txt | 17 + ToDo.txt | 12 + doc/IMR-Architecture_Generale.odp | Bin 0 -> 27201 bytes doc/IMR-Architecture_Generale.odt | Bin 0 -> 64035 bytes doc/IMR-DCT-Mapping_Manager.odt | Bin 0 -> 131414 bytes doc/IMR-DCT-Static_Data_Manager.odt | Bin 0 -> 38072 bytes doc/IMR-MCD.pdf | Bin 0 -> 25733 bytes doc/IMR-MPD.pdf | Bin 0 -> 22422 bytes src/Makefile | 179 + src/Makefile_rule.mk | 280 + src/Makefile_template.mk | 65 + src/Makefile_var.mk | 497 + src/imrc/src/Makefile | 59 + src/imrd/src/Makefile | 65 + src/imrd/src/imrd.c | 1140 + src/imrd/src/imrd.h | 415 + src/include/imr.h | 702 + src/libio_mng/include/io_mng.h | 459 + src/libio_mng/src/Makefile | 74 + src/libio_mng/src/io_hdl_file.c | 541 + src/libio_mng/src/io_hdl_file.h | 149 + src/libio_mng/src/io_hdl_mqs.c | 433 + src/libio_mng/src/io_hdl_mqs.h | 149 + src/libio_mng/src/io_hdl_tux.c | 595 + src/libio_mng/src/io_hdl_tux.h | 171 + src/libio_mng/src/libio_mng.c | 542 + src/libio_mng/src/libio_mng.h | 194 + src/liblog_mng/include/log_mng.h | 397 + src/liblog_mng/src/Makefile | 65 + src/liblog_mng/src/liblog_mng.c | 362 + src/liblog_mng/src/liblog_mng.h | 141 + src/libmapping_mng/include/mapping_mng.h | 159 + src/libmapping_mng/src/Makefile | 81 + src/libmapping_mng/src/buffer_mng.c | 1276 + src/libmapping_mng/src/buffer_mng.h | 175 + src/libmapping_mng/src/cnv_hdl_cut_right.c | 113 + src/libmapping_mng/src/cnv_hdl_cut_right.h | 59 + src/libmapping_mng/src/cnv_hdl_pad_left.c | 111 + src/libmapping_mng/src/cnv_hdl_pad_left.h | 59 + src/libmapping_mng/src/cnv_hdl_pad_num.c | 81 + src/libmapping_mng/src/cnv_hdl_pad_num.h | 59 + src/libmapping_mng/src/cnv_hdl_pad_right.c | 100 + src/libmapping_mng/src/cnv_hdl_pad_right.h | 59 + src/libmapping_mng/src/cnv_hdl_strip_left.c | 128 + src/libmapping_mng/src/cnv_hdl_strip_left.h | 59 + src/libmapping_mng/src/cnv_hdl_strip_num.c | 80 + src/libmapping_mng/src/cnv_hdl_strip_num.h | 59 + src/libmapping_mng/src/cnv_hdl_strip_right.c | 105 + src/libmapping_mng/src/cnv_hdl_strip_right.h | 59 + src/libmapping_mng/src/field.tbls.h | 31 + src/libmapping_mng/src/fmt_hdl_dltd.c | 1079 + src/libmapping_mng/src/fmt_hdl_dltd.h | 115 + src/libmapping_mng/src/fmt_hdl_fixed.c | 744 + src/libmapping_mng/src/fmt_hdl_fixed.h | 104 + src/libmapping_mng/src/fmt_hdl_fml.c | 835 + src/libmapping_mng/src/fmt_hdl_fml.h | 108 + src/libmapping_mng/src/fmt_hdl_xml.c | 1260 + src/libmapping_mng/src/fmt_hdl_xml.h | 135 + src/libmapping_mng/src/libmapping_mng.c | 259 + src/libmapping_mng/src/libmapping_mng.h | 142 + src/libmapping_mng/src/map_scheduler.c | 484 + src/libmapping_mng/src/map_scheduler.h | 88 + src/libmsg_router/include/msg_router.h | 132 + src/libmsg_router/src/Makefile | 65 + src/libmsg_router/src/libmsg_router.c | 544 + src/libmsg_router/src/libmsg_router.h | 146 + src/libnode/GNU-FDL.txt | 355 + src/libnode/GNU-GPL.txt | 340 + src/libnode/GNU-LGPL.txt | 504 + src/libnode/ReadMe.txt | 44 + src/libnode/ReleaseNotes.txt | 220 + src/libnode/ToDo.txt | 14 + src/libnode/demo/nddemo0.c | 686 + src/libnode/demo/nddemo0.dat | 15 + src/libnode/include/node.h | 926 + src/libnode/src/Makefile | 42 + src/libnode/src/libnode.c | 5819 +++++ src/libnode/src/libnode.h | 356 + src/libnode/util/ndbench.c | 1602 ++ src/libnode/util/test-10-s.ndb | 10 + src/libnode/util/test-10.ndb | 10 + src/libnode/util/test-100K-s.ndb | 10 + src/libnode/util/test-100K.ndb | 10 + src/libnode/util/test-10K-s.ndb | 10 + src/libnode/util/test-10K.ndb | 10 + src/libnode/util/test-1M-s.ndb | 10 + src/libnode/util/test-1M.ndb | 10 + src/libnode/util/test-all.ndb | 9 + src/libnode/util/test-error.ndb | 15 + .../include/static_data_mng.h | 420 + src/libstatic_data_mng/src/Makefile | 79 + src/libstatic_data_mng/src/arc_hdl_sql.h | 101 + src/libstatic_data_mng/src/arc_hdl_sql.pc | 185 + src/libstatic_data_mng/src/arc_hdl_xml.c | 76 + src/libstatic_data_mng/src/arc_hdl_xml.h | 113 + src/libstatic_data_mng/src/buffer_info_mng.c | 2909 +++ src/libstatic_data_mng/src/buffer_info_mng.h | 258 + src/libstatic_data_mng/src/buffer_info_sql.h | 113 + src/libstatic_data_mng/src/buffer_info_sql.pc | 1476 ++ src/libstatic_data_mng/src/buffer_info_xml.c | 1837 ++ src/libstatic_data_mng/src/buffer_info_xml.h | 426 + .../src/libstatic_data_mng.c | 527 + .../src/libstatic_data_mng.h | 319 + src/libstatic_data_mng/src/mapping_info_mng.c | 843 + src/libstatic_data_mng/src/mapping_info_mng.h | 118 + src/libstatic_data_mng/src/mapping_info_sql.h | 79 + .../src/mapping_info_sql.pc | 402 + src/libstatic_data_mng/src/mapping_info_xml.c | 547 + src/libstatic_data_mng/src/mapping_info_xml.h | 202 + src/libstatic_data_mng/src/struct_info_mng.c | 1684 ++ src/libstatic_data_mng/src/struct_info_mng.h | 170 + src/libstatic_data_mng/src/struct_info_sql.h | 87 + src/libstatic_data_mng/src/struct_info_sql.pc | 825 + src/libstatic_data_mng/src/struct_info_xml.c | 943 + src/libstatic_data_mng/src/struct_info_xml.h | 277 + src/libxml/AUTHORS | 5 + src/libxml/COPYING | 27 + src/libxml/ChangeLog | 20389 ++++++++++++++++ src/libxml/Copyright | 27 + src/libxml/INSTALL | 69 + src/libxml/NEWS | 1227 + src/libxml/README | 24 + src/libxml/TODO | 327 + src/libxml/TODO_SCHEMAS | 31 + src/libxml/include/Makefile | 530 + src/libxml/include/Makefile.am | 55 + src/libxml/include/Makefile.in | 530 + src/libxml/include/libxml/DOCBparser.h | 90 + src/libxml/include/libxml/HTMLparser.h | 295 + src/libxml/include/libxml/HTMLtree.h | 139 + src/libxml/include/libxml/SAX.h | 165 + src/libxml/include/libxml/SAX2.h | 188 + src/libxml/include/libxml/c14n.h | 103 + src/libxml/include/libxml/catalog.h | 181 + src/libxml/include/libxml/chvalid.h | 230 + src/libxml/include/libxml/debugXML.h | 196 + src/libxml/include/libxml/dict.h | 58 + src/libxml/include/libxml/encoding.h | 224 + src/libxml/include/libxml/entities.h | 131 + src/libxml/include/libxml/globals.h | 422 + src/libxml/include/libxml/hash.h | 206 + src/libxml/include/libxml/list.h | 137 + src/libxml/include/libxml/nanoftp.h | 143 + src/libxml/include/libxml/nanohttp.h | 79 + src/libxml/include/libxml/parser.h | 1131 + src/libxml/include/libxml/parserInternals.h | 576 + src/libxml/include/libxml/pattern.h | 48 + src/libxml/include/libxml/relaxng.h | 179 + src/libxml/include/libxml/schemasInternals.h | 416 + src/libxml/include/libxml/threads.h | 81 + src/libxml/include/libxml/tree.h | 1094 + src/libxml/include/libxml/uri.h | 81 + src/libxml/include/libxml/valid.h | 408 + src/libxml/include/libxml/xinclude.h | 116 + src/libxml/include/libxml/xlink.h | 183 + src/libxml/include/libxml/xmlIO.h | 335 + src/libxml/include/libxml/xmlautomata.h | 117 + src/libxml/include/libxml/xmlerror.h | 700 + src/libxml/include/libxml/xmlexports.h | 138 + src/libxml/include/libxml/xmlmemory.h | 220 + src/libxml/include/libxml/xmlreader.h | 320 + src/libxml/include/libxml/xmlregexp.h | 95 + src/libxml/include/libxml/xmlsave.h | 61 + src/libxml/include/libxml/xmlschemas.h | 125 + src/libxml/include/libxml/xmlschemastypes.h | 67 + src/libxml/include/libxml/xmlstring.h | 141 + src/libxml/include/libxml/xmlunicode.h | 197 + src/libxml/include/libxml/xmlversion.h | 347 + src/libxml/include/libxml/xmlwriter.h | 452 + src/libxml/include/libxml/xpath.h | 467 + src/libxml/include/libxml/xpathInternals.h | 653 + src/libxml/include/libxml/xpointer.h | 109 + src/libxml/include/xmlversion.h.in | 347 + src/libxml/src/DOCBparser.c | 303 + src/libxml/src/HTMLparser.c | 5927 +++++ src/libxml/src/HTMLtree.c | 1177 + src/libxml/src/Makefile | 83 + src/libxml/src/SAX.c | 175 + src/libxml/src/SAX2.c | 2736 +++ src/libxml/src/acconfig.h | 17 + src/libxml/src/c14n.c | 1974 ++ src/libxml/src/catalog.c | 3589 +++ src/libxml/src/chvalid.c | 329 + src/libxml/src/config.h | 285 + src/libxml/src/debugXML.c | 2578 ++ src/libxml/src/dict.c | 738 + src/libxml/src/encoding.c | 3237 +++ src/libxml/src/entities.c | 897 + src/libxml/src/error.c | 937 + src/libxml/src/globals.c | 983 + src/libxml/src/hash.c | 949 + src/libxml/src/legacy.c | 1340 + src/libxml/src/libxml.c | 19 + src/libxml/src/libxml.h | 52 + src/libxml/src/list.c | 720 + src/libxml/src/nanoftp.c | 2276 ++ src/libxml/src/nanohttp.c | 1789 ++ src/libxml/src/parser.c | 12409 ++++++++++ src/libxml/src/parserInternals.c | 2036 ++ src/libxml/src/pattern.c | 933 + src/libxml/src/relaxng.c | 10677 ++++++++ src/libxml/src/testAutomata.c | 307 + src/libxml/src/testC14N.c | 357 + src/libxml/src/testHTML.c | 868 + src/libxml/src/testReader.c | 139 + src/libxml/src/testRegexp.c | 158 + src/libxml/src/testRelax.c | 194 + src/libxml/src/testSAX.c | 1180 + src/libxml/src/testSchemas.c | 185 + src/libxml/src/testThreads.c | 201 + src/libxml/src/testThreadsWin32.c | 150 + src/libxml/src/testURI.c | 105 + src/libxml/src/testXPath.c | 227 + src/libxml/src/threads.c | 759 + src/libxml/src/tree.c | 7026 ++++++ src/libxml/src/trio.c | 6855 ++++++ src/libxml/src/trio.h | 216 + src/libxml/src/triodef.h | 220 + src/libxml/src/trionan.c | 910 + src/libxml/src/trionan.h | 84 + src/libxml/src/triop.h | 150 + src/libxml/src/triostr.c | 2102 ++ src/libxml/src/triostr.h | 140 + src/libxml/src/uri.c | 2030 ++ src/libxml/src/valid.c | 6712 +++++ src/libxml/src/xinclude.c | 2388 ++ src/libxml/src/xlink.c | 181 + src/libxml/src/xmlIO.c | 3372 +++ src/libxml/src/xmlcatalog.c | 594 + src/libxml/src/xmllint.c | 2015 ++ src/libxml/src/xmlmemory.c | 950 + src/libxml/src/xmlreader.c | 4854 ++++ src/libxml/src/xmlregexp.c | 4615 ++++ src/libxml/src/xmlsave.c | 2011 ++ src/libxml/src/xmlschemas.c | 6616 +++++ src/libxml/src/xmlschemastypes.c | 3597 +++ src/libxml/src/xmlstring.c | 956 + src/libxml/src/xmlunicode.c | 3172 +++ src/libxml/src/xmlwriter.c | 4504 ++++ src/libxml/src/xpath.c | 11391 +++++++++ src/libxml/src/xpointer.c | 2999 +++ src/libz/include/zconf.h | 279 + src/libz/include/zlib.h | 893 + src/libz/src/Makefile | 54 + src/libz/src/adler32.c | 48 + src/libz/src/compress.c | 68 + src/libz/src/crc32.c | 162 + src/libz/src/deflate.c | 1350 + src/libz/src/deflate.h | 318 + src/libz/src/example.c | 556 + src/libz/src/gzio.c | 875 + src/libz/src/infblock.c | 403 + src/libz/src/infblock.h | 39 + src/libz/src/infcodes.c | 251 + src/libz/src/infcodes.h | 27 + src/libz/src/inffast.c | 183 + src/libz/src/inffast.h | 17 + src/libz/src/inffixed.h | 151 + src/libz/src/inflate.c | 366 + src/libz/src/inftrees.c | 454 + src/libz/src/inftrees.h | 58 + src/libz/src/infutil.c | 87 + src/libz/src/infutil.h | 98 + src/libz/src/libz.c | 19 + src/libz/src/maketree.c | 85 + src/libz/src/minigzip.c | 320 + src/libz/src/trees.c | 1214 + src/libz/src/trees.h | 128 + src/libz/src/uncompr.c | 58 + src/libz/src/zlib.h | 893 + src/libz/src/zutil.c | 225 + src/libz/src/zutil.h | 220 + src/sd_appl_struct/src/Makefile | 65 + src/sd_appl_struct/src/appl_commun.xml.m4 | 58 + src/sd_appl_struct/src/sd_appl_struct.xml.m4 | 20 + src/sd_cnv_struct/src/Makefile | 65 + src/sd_cnv_struct/src/cnv_commun.xml.m4 | 58 + src/sd_cnv_struct/src/sd_cnv_struct.xml.m4 | 19 + src/sd_fmt_struct/src/Makefile | 65 + src/sd_fmt_struct/src/fmt_commun.xml.m4 | 142 + src/sd_fmt_struct/src/sd_fmt_struct.xml.m4 | 534 + src/sd_fmtattr_struct/src/Makefile | 65 + .../src/fmtattr_commun.xml.m4 | 60 + .../src/sd_fmtattr_struct.xml.m4 | 18 + src/sd_mappath_struct/src/Makefile | 66 + src/sd_mappath_struct/src/fixed_xml.xml.m4 | 290 + .../src/fixed_xml_cre.xml.m4 | 357 + src/sd_mappath_struct/src/mappath_cmd.xml.m4 | 200 + .../src/mappath_commun.xml.m4 | 212 + .../src/sd_mappath_struct.xml.m4 | 289 + src/sd_mappath_struct/src/xml_fixed.xml.m4 | 293 + .../src/xml_fixed_cre.xml.m4 | 517 + src/sd_msg_struct/src/Makefile | 66 + .../src/crt_cre_flux_ident.xml.m4 | 182 + src/sd_msg_struct/src/crt_cre_flux_or.xml.m4 | 87 + .../src/crt_cre_flux_stlm.xml.m4 | 52 + .../src/crt_cre_flux_stlm_bk.xml.m4 | 70 + .../src/crt_cre_flux_stlm_cus.xml.m4 | 145 + .../src/crt_cre_flux_stlm_cus_end.xml.m4 | 99 + .../src/crt_cre_flux_stlm_header.xml.m4 | 226 + src/sd_msg_struct/src/crt_cre_header.xml.m4 | 379 + src/sd_msg_struct/src/crt_cre_ident.xml.m4 | 372 + src/sd_msg_struct/src/crt_flux_ident.xml.m4 | 148 + src/sd_msg_struct/src/crt_flux_or.xml.m4 | 115 + src/sd_msg_struct/src/crt_flux_stlm.xml.m4 | 81 + src/sd_msg_struct/src/crt_flux_stlm_bk.xml.m4 | 69 + .../src/crt_flux_stlm_cus.xml.m4 | 144 + .../src/crt_flux_stlm_cus_end.xml.m4 | 98 + .../src/crt_flux_stlm_header.xml.m4 | 224 + src/sd_msg_struct/src/cut_end_msg.xml.m4 | 12 + src/sd_msg_struct/src/dltd_end_msg.xml.m4 | 7 + src/sd_msg_struct/src/msg_commun.xml.m4 | 222 + .../src/msg_delimited_fixed.xml.m4 | 6 + src/sd_msg_struct/src/msg_fixed_fml.xml.m4 | 6 + src/sd_msg_struct/src/msg_unknown.xml.m4 | 7 + src/sd_msg_struct/src/sd_msg_struct.xml.m4 | 84 + src/sd_msg_struct/src/strip_end_msg.xml.m4 | 7 + .../src/swf_cre_field_13c.xml.m4 | 37 + .../src/swf_cre_field_50_ident.xml.m4 | 20 + .../src/swf_cre_field_50k_comp.xml.m4 | 28 + .../src/swf_cre_field_50x.xml.m4 | 30 + .../src/swf_cre_field_52_ident.xml.m4 | 20 + .../src/swf_cre_field_52d_comp.xml.m4 | 28 + .../src/swf_cre_field_52x.xml.m4 | 30 + .../src/swf_cre_field_55_ident.xml.m4 | 26 + .../src/swf_cre_field_55d_comp.xml.m4 | 28 + .../src/swf_cre_field_55x.xml.m4 | 30 + .../src/swf_cre_field_56_ident.xml.m4 | 20 + .../src/swf_cre_field_56d_comp.xml.m4 | 28 + .../src/swf_cre_field_56x.xml.m4 | 30 + .../src/swf_cre_field_57_ident.xml.m4 | 26 + .../src/swf_cre_field_57d_comp.xml.m4 | 28 + .../src/swf_cre_field_57x.xml.m4 | 30 + .../src/swf_cre_field_58_ident.xml.m4 | 26 + .../src/swf_cre_field_58d_comp.xml.m4 | 28 + .../src/swf_cre_field_58x.xml.m4 | 30 + .../src/swf_cre_field_59_ident.xml.m4 | 13 + .../src/swf_cre_field_59blanc_comp.xml.m4 | 28 + .../src/swf_cre_field_59x.xml.m4 | 30 + src/sd_msg_struct/src/swf_cre_field_70.xml.m4 | 28 + src/sd_msg_struct/src/swf_cre_field_72.xml.m4 | 74 + .../src/swf_cre_field_72_autres_lignes.xml.m4 | 38 + src/sd_msg_struct/src/swf_cre_field_77.xml.m4 | 23 + src/sd_msg_struct/src/swf_field_13c.xml.m4 | 37 + .../src/swf_field_50_ident.xml.m4 | 20 + .../src/swf_field_50k_comp.xml.m4 | 28 + src/sd_msg_struct/src/swf_field_50x.xml.m4 | 30 + .../src/swf_field_52_ident.xml.m4 | 20 + .../src/swf_field_52d_comp.xml.m4 | 28 + src/sd_msg_struct/src/swf_field_52x.xml.m4 | 30 + .../src/swf_field_55_ident.xml.m4 | 26 + .../src/swf_field_55d_comp.xml.m4 | 28 + src/sd_msg_struct/src/swf_field_55x.xml.m4 | 30 + .../src/swf_field_56_ident.xml.m4 | 20 + .../src/swf_field_56d_comp.xml.m4 | 28 + src/sd_msg_struct/src/swf_field_56x.xml.m4 | 30 + .../src/swf_field_57_ident.xml.m4 | 26 + .../src/swf_field_57d_comp.xml.m4 | 28 + src/sd_msg_struct/src/swf_field_57x.xml.m4 | 30 + .../src/swf_field_58_ident.xml.m4 | 26 + .../src/swf_field_58d_comp.xml.m4 | 28 + src/sd_msg_struct/src/swf_field_58x.xml.m4 | 30 + .../src/swf_field_59_ident.xml.m4 | 13 + .../src/swf_field_59blanc_comp.xml.m4 | 28 + src/sd_msg_struct/src/swf_field_59x.xml.m4 | 30 + src/sd_msg_struct/src/swf_field_70.xml.m4 | 28 + src/sd_msg_struct/src/swf_field_72.xml.m4 | 74 + .../src/swf_field_72_autres_lignes.xml.m4 | 38 + src/sd_msg_struct/src/swf_field_77.xml.m4 | 23 + src/sd_msgmap_struct/src/Makefile | 65 + src/sd_msgmap_struct/src/cre.xml.m4 | 127 + src/sd_msgmap_struct/src/cre_field_13c.xml.m4 | 37 + src/sd_msgmap_struct/src/cre_field_50.xml.m4 | 23 + src/sd_msgmap_struct/src/cre_field_52.xml.m4 | 26 + src/sd_msgmap_struct/src/cre_field_55.xml.m4 | 23 + src/sd_msgmap_struct/src/cre_field_56.xml.m4 | 26 + src/sd_msgmap_struct/src/cre_field_57.xml.m4 | 26 + src/sd_msgmap_struct/src/cre_field_58.xml.m4 | 24 + src/sd_msgmap_struct/src/cre_field_59.xml.m4 | 23 + src/sd_msgmap_struct/src/cre_field_70.xml.m4 | 9 + src/sd_msgmap_struct/src/cre_field_72.xml.m4 | 31 + src/sd_msgmap_struct/src/cre_field_77.xml.m4 | 9 + src/sd_msgmap_struct/src/cre_or.xml.m4 | 24 + src/sd_msgmap_struct/src/cre_stlm.xml.m4 | 64 + src/sd_msgmap_struct/src/cut_end_msg.xml.m4 | 5 + src/sd_msgmap_struct/src/dltd_end_msg.xml.m4 | 3 + src/sd_msgmap_struct/src/field_13c.xml.m4 | 26 + src/sd_msgmap_struct/src/field_50.xml.m4 | 30 + src/sd_msgmap_struct/src/field_52.xml.m4 | 35 + src/sd_msgmap_struct/src/field_55.xml.m4 | 30 + src/sd_msgmap_struct/src/field_56.xml.m4 | 35 + src/sd_msgmap_struct/src/field_57.xml.m4 | 35 + src/sd_msgmap_struct/src/field_58.xml.m4 | 30 + src/sd_msgmap_struct/src/field_59.xml.m4 | 30 + src/sd_msgmap_struct/src/field_70.xml.m4 | 13 + src/sd_msgmap_struct/src/field_72.xml.m4 | 40 + src/sd_msgmap_struct/src/field_77.xml.m4 | 12 + src/sd_msgmap_struct/src/msgmap_commun.xml.m4 | 104 + .../src/msgmap_delimited_fixed.xml.m4 | 4 + .../src/msgmap_fixed_fml.xml.m4 | 2 + src/sd_msgmap_struct/src/or.xml.m4 | 46 + .../src/sd_msgmap_struct.xml.m4 | 42 + src/sd_msgmap_struct/src/stlm.xml.m4 | 148 + src/sd_msgmap_struct/src/strip_end_msg.xml.m4 | 3 + tst/in-1.txt.bz2 | Bin 0 -> 414 bytes tst/in-10k.txt.bz2 | Bin 0 -> 9457 bytes tst/in-1k.txt.bz2 | Bin 0 -> 1143 bytes tst/in-50k.txt.bz2 | Bin 0 -> 45266 bytes 411 files changed, 242597 insertions(+) create mode 100644 GNU-FDL.txt create mode 100644 GNU-GPL.txt create mode 100644 ReadMe.txt create mode 100644 ReleaseNotes.txt create mode 100644 ToDo.txt create mode 100644 doc/IMR-Architecture_Generale.odp create mode 100644 doc/IMR-Architecture_Generale.odt create mode 100644 doc/IMR-DCT-Mapping_Manager.odt create mode 100644 doc/IMR-DCT-Static_Data_Manager.odt create mode 100755 doc/IMR-MCD.pdf create mode 100755 doc/IMR-MPD.pdf create mode 100644 src/Makefile create mode 100644 src/Makefile_rule.mk create mode 100644 src/Makefile_template.mk create mode 100644 src/Makefile_var.mk create mode 100644 src/imrc/src/Makefile create mode 100644 src/imrd/src/Makefile create mode 100644 src/imrd/src/imrd.c create mode 100644 src/imrd/src/imrd.h create mode 100644 src/include/imr.h create mode 100644 src/libio_mng/include/io_mng.h create mode 100644 src/libio_mng/src/Makefile create mode 100644 src/libio_mng/src/io_hdl_file.c create mode 100644 src/libio_mng/src/io_hdl_file.h create mode 100644 src/libio_mng/src/io_hdl_mqs.c create mode 100644 src/libio_mng/src/io_hdl_mqs.h create mode 100644 src/libio_mng/src/io_hdl_tux.c create mode 100644 src/libio_mng/src/io_hdl_tux.h create mode 100644 src/libio_mng/src/libio_mng.c create mode 100644 src/libio_mng/src/libio_mng.h create mode 100644 src/liblog_mng/include/log_mng.h create mode 100644 src/liblog_mng/src/Makefile create mode 100644 src/liblog_mng/src/liblog_mng.c create mode 100644 src/liblog_mng/src/liblog_mng.h create mode 100644 src/libmapping_mng/include/mapping_mng.h create mode 100644 src/libmapping_mng/src/Makefile create mode 100644 src/libmapping_mng/src/buffer_mng.c create mode 100644 src/libmapping_mng/src/buffer_mng.h create mode 100644 src/libmapping_mng/src/cnv_hdl_cut_right.c create mode 100644 src/libmapping_mng/src/cnv_hdl_cut_right.h create mode 100644 src/libmapping_mng/src/cnv_hdl_pad_left.c create mode 100644 src/libmapping_mng/src/cnv_hdl_pad_left.h create mode 100644 src/libmapping_mng/src/cnv_hdl_pad_num.c create mode 100644 src/libmapping_mng/src/cnv_hdl_pad_num.h create mode 100644 src/libmapping_mng/src/cnv_hdl_pad_right.c create mode 100644 src/libmapping_mng/src/cnv_hdl_pad_right.h create mode 100644 src/libmapping_mng/src/cnv_hdl_strip_left.c create mode 100644 src/libmapping_mng/src/cnv_hdl_strip_left.h create mode 100644 src/libmapping_mng/src/cnv_hdl_strip_num.c create mode 100644 src/libmapping_mng/src/cnv_hdl_strip_num.h create mode 100644 src/libmapping_mng/src/cnv_hdl_strip_right.c create mode 100644 src/libmapping_mng/src/cnv_hdl_strip_right.h create mode 100644 src/libmapping_mng/src/field.tbls.h create mode 100644 src/libmapping_mng/src/fmt_hdl_dltd.c create mode 100644 src/libmapping_mng/src/fmt_hdl_dltd.h create mode 100644 src/libmapping_mng/src/fmt_hdl_fixed.c create mode 100644 src/libmapping_mng/src/fmt_hdl_fixed.h create mode 100644 src/libmapping_mng/src/fmt_hdl_fml.c create mode 100644 src/libmapping_mng/src/fmt_hdl_fml.h create mode 100644 src/libmapping_mng/src/fmt_hdl_xml.c create mode 100644 src/libmapping_mng/src/fmt_hdl_xml.h create mode 100644 src/libmapping_mng/src/libmapping_mng.c create mode 100644 src/libmapping_mng/src/libmapping_mng.h create mode 100644 src/libmapping_mng/src/map_scheduler.c create mode 100644 src/libmapping_mng/src/map_scheduler.h create mode 100644 src/libmsg_router/include/msg_router.h create mode 100644 src/libmsg_router/src/Makefile create mode 100644 src/libmsg_router/src/libmsg_router.c create mode 100644 src/libmsg_router/src/libmsg_router.h create mode 100644 src/libnode/GNU-FDL.txt create mode 100644 src/libnode/GNU-GPL.txt create mode 100644 src/libnode/GNU-LGPL.txt create mode 100644 src/libnode/ReadMe.txt create mode 100644 src/libnode/ReleaseNotes.txt create mode 100644 src/libnode/ToDo.txt create mode 100644 src/libnode/demo/nddemo0.c create mode 100644 src/libnode/demo/nddemo0.dat create mode 100644 src/libnode/include/node.h create mode 100644 src/libnode/src/Makefile create mode 100644 src/libnode/src/libnode.c create mode 100644 src/libnode/src/libnode.h create mode 100644 src/libnode/util/ndbench.c create mode 100644 src/libnode/util/test-10-s.ndb create mode 100644 src/libnode/util/test-10.ndb create mode 100644 src/libnode/util/test-100K-s.ndb create mode 100644 src/libnode/util/test-100K.ndb create mode 100644 src/libnode/util/test-10K-s.ndb create mode 100644 src/libnode/util/test-10K.ndb create mode 100644 src/libnode/util/test-1M-s.ndb create mode 100644 src/libnode/util/test-1M.ndb create mode 100644 src/libnode/util/test-all.ndb create mode 100644 src/libnode/util/test-error.ndb create mode 100644 src/libstatic_data_mng/include/static_data_mng.h create mode 100644 src/libstatic_data_mng/src/Makefile create mode 100644 src/libstatic_data_mng/src/arc_hdl_sql.h create mode 100644 src/libstatic_data_mng/src/arc_hdl_sql.pc create mode 100644 src/libstatic_data_mng/src/arc_hdl_xml.c create mode 100644 src/libstatic_data_mng/src/arc_hdl_xml.h create mode 100644 src/libstatic_data_mng/src/buffer_info_mng.c create mode 100644 src/libstatic_data_mng/src/buffer_info_mng.h create mode 100644 src/libstatic_data_mng/src/buffer_info_sql.h create mode 100644 src/libstatic_data_mng/src/buffer_info_sql.pc create mode 100644 src/libstatic_data_mng/src/buffer_info_xml.c create mode 100644 src/libstatic_data_mng/src/buffer_info_xml.h create mode 100644 src/libstatic_data_mng/src/libstatic_data_mng.c create mode 100644 src/libstatic_data_mng/src/libstatic_data_mng.h create mode 100644 src/libstatic_data_mng/src/mapping_info_mng.c create mode 100644 src/libstatic_data_mng/src/mapping_info_mng.h create mode 100644 src/libstatic_data_mng/src/mapping_info_sql.h create mode 100644 src/libstatic_data_mng/src/mapping_info_sql.pc create mode 100644 src/libstatic_data_mng/src/mapping_info_xml.c create mode 100644 src/libstatic_data_mng/src/mapping_info_xml.h create mode 100644 src/libstatic_data_mng/src/struct_info_mng.c create mode 100644 src/libstatic_data_mng/src/struct_info_mng.h create mode 100644 src/libstatic_data_mng/src/struct_info_sql.h create mode 100644 src/libstatic_data_mng/src/struct_info_sql.pc create mode 100644 src/libstatic_data_mng/src/struct_info_xml.c create mode 100644 src/libstatic_data_mng/src/struct_info_xml.h create mode 100644 src/libxml/AUTHORS create mode 100644 src/libxml/COPYING create mode 100644 src/libxml/ChangeLog create mode 100644 src/libxml/Copyright create mode 100644 src/libxml/INSTALL create mode 100644 src/libxml/NEWS create mode 100644 src/libxml/README create mode 100644 src/libxml/TODO create mode 100644 src/libxml/TODO_SCHEMAS create mode 100644 src/libxml/include/Makefile create mode 100644 src/libxml/include/Makefile.am create mode 100644 src/libxml/include/Makefile.in create mode 100644 src/libxml/include/libxml/DOCBparser.h create mode 100644 src/libxml/include/libxml/HTMLparser.h create mode 100644 src/libxml/include/libxml/HTMLtree.h create mode 100644 src/libxml/include/libxml/SAX.h create mode 100644 src/libxml/include/libxml/SAX2.h create mode 100644 src/libxml/include/libxml/c14n.h create mode 100644 src/libxml/include/libxml/catalog.h create mode 100644 src/libxml/include/libxml/chvalid.h create mode 100644 src/libxml/include/libxml/debugXML.h create mode 100644 src/libxml/include/libxml/dict.h create mode 100644 src/libxml/include/libxml/encoding.h create mode 100644 src/libxml/include/libxml/entities.h create mode 100644 src/libxml/include/libxml/globals.h create mode 100644 src/libxml/include/libxml/hash.h create mode 100644 src/libxml/include/libxml/list.h create mode 100644 src/libxml/include/libxml/nanoftp.h create mode 100644 src/libxml/include/libxml/nanohttp.h create mode 100644 src/libxml/include/libxml/parser.h create mode 100644 src/libxml/include/libxml/parserInternals.h create mode 100644 src/libxml/include/libxml/pattern.h create mode 100644 src/libxml/include/libxml/relaxng.h create mode 100644 src/libxml/include/libxml/schemasInternals.h create mode 100644 src/libxml/include/libxml/threads.h create mode 100644 src/libxml/include/libxml/tree.h create mode 100644 src/libxml/include/libxml/uri.h create mode 100644 src/libxml/include/libxml/valid.h create mode 100644 src/libxml/include/libxml/xinclude.h create mode 100644 src/libxml/include/libxml/xlink.h create mode 100644 src/libxml/include/libxml/xmlIO.h create mode 100644 src/libxml/include/libxml/xmlautomata.h create mode 100644 src/libxml/include/libxml/xmlerror.h create mode 100644 src/libxml/include/libxml/xmlexports.h create mode 100644 src/libxml/include/libxml/xmlmemory.h create mode 100644 src/libxml/include/libxml/xmlreader.h create mode 100644 src/libxml/include/libxml/xmlregexp.h create mode 100644 src/libxml/include/libxml/xmlsave.h create mode 100644 src/libxml/include/libxml/xmlschemas.h create mode 100644 src/libxml/include/libxml/xmlschemastypes.h create mode 100644 src/libxml/include/libxml/xmlstring.h create mode 100644 src/libxml/include/libxml/xmlunicode.h create mode 100644 src/libxml/include/libxml/xmlversion.h create mode 100644 src/libxml/include/libxml/xmlwriter.h create mode 100644 src/libxml/include/libxml/xpath.h create mode 100644 src/libxml/include/libxml/xpathInternals.h create mode 100644 src/libxml/include/libxml/xpointer.h create mode 100644 src/libxml/include/xmlversion.h.in create mode 100644 src/libxml/src/DOCBparser.c create mode 100644 src/libxml/src/HTMLparser.c create mode 100644 src/libxml/src/HTMLtree.c create mode 100644 src/libxml/src/Makefile create mode 100644 src/libxml/src/SAX.c create mode 100644 src/libxml/src/SAX2.c create mode 100644 src/libxml/src/acconfig.h create mode 100644 src/libxml/src/c14n.c create mode 100644 src/libxml/src/catalog.c create mode 100644 src/libxml/src/chvalid.c create mode 100644 src/libxml/src/config.h create mode 100644 src/libxml/src/debugXML.c create mode 100644 src/libxml/src/dict.c create mode 100644 src/libxml/src/encoding.c create mode 100644 src/libxml/src/entities.c create mode 100644 src/libxml/src/error.c create mode 100644 src/libxml/src/globals.c create mode 100644 src/libxml/src/hash.c create mode 100644 src/libxml/src/legacy.c create mode 100644 src/libxml/src/libxml.c create mode 100644 src/libxml/src/libxml.h create mode 100644 src/libxml/src/list.c create mode 100644 src/libxml/src/nanoftp.c create mode 100644 src/libxml/src/nanohttp.c create mode 100644 src/libxml/src/parser.c create mode 100644 src/libxml/src/parserInternals.c create mode 100644 src/libxml/src/pattern.c create mode 100644 src/libxml/src/relaxng.c create mode 100644 src/libxml/src/testAutomata.c create mode 100644 src/libxml/src/testC14N.c create mode 100644 src/libxml/src/testHTML.c create mode 100644 src/libxml/src/testReader.c create mode 100644 src/libxml/src/testRegexp.c create mode 100644 src/libxml/src/testRelax.c create mode 100644 src/libxml/src/testSAX.c create mode 100644 src/libxml/src/testSchemas.c create mode 100644 src/libxml/src/testThreads.c create mode 100644 src/libxml/src/testThreadsWin32.c create mode 100644 src/libxml/src/testURI.c create mode 100644 src/libxml/src/testXPath.c create mode 100644 src/libxml/src/threads.c create mode 100644 src/libxml/src/tree.c create mode 100644 src/libxml/src/trio.c create mode 100644 src/libxml/src/trio.h create mode 100644 src/libxml/src/triodef.h create mode 100644 src/libxml/src/trionan.c create mode 100644 src/libxml/src/trionan.h create mode 100644 src/libxml/src/triop.h create mode 100644 src/libxml/src/triostr.c create mode 100644 src/libxml/src/triostr.h create mode 100644 src/libxml/src/uri.c create mode 100644 src/libxml/src/valid.c create mode 100644 src/libxml/src/xinclude.c create mode 100644 src/libxml/src/xlink.c create mode 100644 src/libxml/src/xmlIO.c create mode 100644 src/libxml/src/xmlcatalog.c create mode 100644 src/libxml/src/xmllint.c create mode 100644 src/libxml/src/xmlmemory.c create mode 100644 src/libxml/src/xmlreader.c create mode 100644 src/libxml/src/xmlregexp.c create mode 100644 src/libxml/src/xmlsave.c create mode 100644 src/libxml/src/xmlschemas.c create mode 100644 src/libxml/src/xmlschemastypes.c create mode 100644 src/libxml/src/xmlstring.c create mode 100644 src/libxml/src/xmlunicode.c create mode 100644 src/libxml/src/xmlwriter.c create mode 100644 src/libxml/src/xpath.c create mode 100644 src/libxml/src/xpointer.c create mode 100644 src/libz/include/zconf.h create mode 100644 src/libz/include/zlib.h create mode 100644 src/libz/src/Makefile create mode 100644 src/libz/src/adler32.c create mode 100644 src/libz/src/compress.c create mode 100644 src/libz/src/crc32.c create mode 100644 src/libz/src/deflate.c create mode 100644 src/libz/src/deflate.h create mode 100644 src/libz/src/example.c create mode 100644 src/libz/src/gzio.c create mode 100644 src/libz/src/infblock.c create mode 100644 src/libz/src/infblock.h create mode 100644 src/libz/src/infcodes.c create mode 100644 src/libz/src/infcodes.h create mode 100644 src/libz/src/inffast.c create mode 100644 src/libz/src/inffast.h create mode 100644 src/libz/src/inffixed.h create mode 100644 src/libz/src/inflate.c create mode 100644 src/libz/src/inftrees.c create mode 100644 src/libz/src/inftrees.h create mode 100644 src/libz/src/infutil.c create mode 100644 src/libz/src/infutil.h create mode 100644 src/libz/src/libz.c create mode 100644 src/libz/src/maketree.c create mode 100644 src/libz/src/minigzip.c create mode 100644 src/libz/src/trees.c create mode 100644 src/libz/src/trees.h create mode 100644 src/libz/src/uncompr.c create mode 100644 src/libz/src/zlib.h create mode 100644 src/libz/src/zutil.c create mode 100644 src/libz/src/zutil.h create mode 100644 src/sd_appl_struct/src/Makefile create mode 100644 src/sd_appl_struct/src/appl_commun.xml.m4 create mode 100644 src/sd_appl_struct/src/sd_appl_struct.xml.m4 create mode 100644 src/sd_cnv_struct/src/Makefile create mode 100644 src/sd_cnv_struct/src/cnv_commun.xml.m4 create mode 100644 src/sd_cnv_struct/src/sd_cnv_struct.xml.m4 create mode 100644 src/sd_fmt_struct/src/Makefile create mode 100644 src/sd_fmt_struct/src/fmt_commun.xml.m4 create mode 100644 src/sd_fmt_struct/src/sd_fmt_struct.xml.m4 create mode 100644 src/sd_fmtattr_struct/src/Makefile create mode 100644 src/sd_fmtattr_struct/src/fmtattr_commun.xml.m4 create mode 100644 src/sd_fmtattr_struct/src/sd_fmtattr_struct.xml.m4 create mode 100644 src/sd_mappath_struct/src/Makefile create mode 100644 src/sd_mappath_struct/src/fixed_xml.xml.m4 create mode 100644 src/sd_mappath_struct/src/fixed_xml_cre.xml.m4 create mode 100644 src/sd_mappath_struct/src/mappath_cmd.xml.m4 create mode 100644 src/sd_mappath_struct/src/mappath_commun.xml.m4 create mode 100644 src/sd_mappath_struct/src/sd_mappath_struct.xml.m4 create mode 100644 src/sd_mappath_struct/src/xml_fixed.xml.m4 create mode 100644 src/sd_mappath_struct/src/xml_fixed_cre.xml.m4 create mode 100644 src/sd_msg_struct/src/Makefile create mode 100644 src/sd_msg_struct/src/crt_cre_flux_ident.xml.m4 create mode 100644 src/sd_msg_struct/src/crt_cre_flux_or.xml.m4 create mode 100644 src/sd_msg_struct/src/crt_cre_flux_stlm.xml.m4 create mode 100644 src/sd_msg_struct/src/crt_cre_flux_stlm_bk.xml.m4 create mode 100644 src/sd_msg_struct/src/crt_cre_flux_stlm_cus.xml.m4 create mode 100644 src/sd_msg_struct/src/crt_cre_flux_stlm_cus_end.xml.m4 create mode 100644 src/sd_msg_struct/src/crt_cre_flux_stlm_header.xml.m4 create mode 100644 src/sd_msg_struct/src/crt_cre_header.xml.m4 create mode 100644 src/sd_msg_struct/src/crt_cre_ident.xml.m4 create mode 100644 src/sd_msg_struct/src/crt_flux_ident.xml.m4 create mode 100644 src/sd_msg_struct/src/crt_flux_or.xml.m4 create mode 100644 src/sd_msg_struct/src/crt_flux_stlm.xml.m4 create mode 100644 src/sd_msg_struct/src/crt_flux_stlm_bk.xml.m4 create mode 100644 src/sd_msg_struct/src/crt_flux_stlm_cus.xml.m4 create mode 100644 src/sd_msg_struct/src/crt_flux_stlm_cus_end.xml.m4 create mode 100644 src/sd_msg_struct/src/crt_flux_stlm_header.xml.m4 create mode 100644 src/sd_msg_struct/src/cut_end_msg.xml.m4 create mode 100644 src/sd_msg_struct/src/dltd_end_msg.xml.m4 create mode 100644 src/sd_msg_struct/src/msg_commun.xml.m4 create mode 100644 src/sd_msg_struct/src/msg_delimited_fixed.xml.m4 create mode 100644 src/sd_msg_struct/src/msg_fixed_fml.xml.m4 create mode 100644 src/sd_msg_struct/src/msg_unknown.xml.m4 create mode 100644 src/sd_msg_struct/src/sd_msg_struct.xml.m4 create mode 100644 src/sd_msg_struct/src/strip_end_msg.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_cre_field_13c.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_cre_field_50_ident.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_cre_field_50k_comp.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_cre_field_50x.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_cre_field_52_ident.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_cre_field_52d_comp.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_cre_field_52x.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_cre_field_55_ident.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_cre_field_55d_comp.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_cre_field_55x.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_cre_field_56_ident.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_cre_field_56d_comp.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_cre_field_56x.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_cre_field_57_ident.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_cre_field_57d_comp.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_cre_field_57x.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_cre_field_58_ident.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_cre_field_58d_comp.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_cre_field_58x.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_cre_field_59_ident.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_cre_field_59blanc_comp.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_cre_field_59x.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_cre_field_70.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_cre_field_72.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_cre_field_72_autres_lignes.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_cre_field_77.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_field_13c.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_field_50_ident.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_field_50k_comp.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_field_50x.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_field_52_ident.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_field_52d_comp.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_field_52x.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_field_55_ident.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_field_55d_comp.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_field_55x.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_field_56_ident.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_field_56d_comp.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_field_56x.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_field_57_ident.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_field_57d_comp.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_field_57x.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_field_58_ident.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_field_58d_comp.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_field_58x.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_field_59_ident.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_field_59blanc_comp.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_field_59x.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_field_70.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_field_72.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_field_72_autres_lignes.xml.m4 create mode 100644 src/sd_msg_struct/src/swf_field_77.xml.m4 create mode 100644 src/sd_msgmap_struct/src/Makefile create mode 100644 src/sd_msgmap_struct/src/cre.xml.m4 create mode 100644 src/sd_msgmap_struct/src/cre_field_13c.xml.m4 create mode 100644 src/sd_msgmap_struct/src/cre_field_50.xml.m4 create mode 100644 src/sd_msgmap_struct/src/cre_field_52.xml.m4 create mode 100644 src/sd_msgmap_struct/src/cre_field_55.xml.m4 create mode 100644 src/sd_msgmap_struct/src/cre_field_56.xml.m4 create mode 100644 src/sd_msgmap_struct/src/cre_field_57.xml.m4 create mode 100644 src/sd_msgmap_struct/src/cre_field_58.xml.m4 create mode 100644 src/sd_msgmap_struct/src/cre_field_59.xml.m4 create mode 100644 src/sd_msgmap_struct/src/cre_field_70.xml.m4 create mode 100644 src/sd_msgmap_struct/src/cre_field_72.xml.m4 create mode 100644 src/sd_msgmap_struct/src/cre_field_77.xml.m4 create mode 100644 src/sd_msgmap_struct/src/cre_or.xml.m4 create mode 100644 src/sd_msgmap_struct/src/cre_stlm.xml.m4 create mode 100644 src/sd_msgmap_struct/src/cut_end_msg.xml.m4 create mode 100644 src/sd_msgmap_struct/src/dltd_end_msg.xml.m4 create mode 100644 src/sd_msgmap_struct/src/field_13c.xml.m4 create mode 100644 src/sd_msgmap_struct/src/field_50.xml.m4 create mode 100644 src/sd_msgmap_struct/src/field_52.xml.m4 create mode 100644 src/sd_msgmap_struct/src/field_55.xml.m4 create mode 100644 src/sd_msgmap_struct/src/field_56.xml.m4 create mode 100644 src/sd_msgmap_struct/src/field_57.xml.m4 create mode 100644 src/sd_msgmap_struct/src/field_58.xml.m4 create mode 100644 src/sd_msgmap_struct/src/field_59.xml.m4 create mode 100644 src/sd_msgmap_struct/src/field_70.xml.m4 create mode 100644 src/sd_msgmap_struct/src/field_72.xml.m4 create mode 100644 src/sd_msgmap_struct/src/field_77.xml.m4 create mode 100644 src/sd_msgmap_struct/src/msgmap_commun.xml.m4 create mode 100644 src/sd_msgmap_struct/src/msgmap_delimited_fixed.xml.m4 create mode 100644 src/sd_msgmap_struct/src/msgmap_fixed_fml.xml.m4 create mode 100644 src/sd_msgmap_struct/src/or.xml.m4 create mode 100644 src/sd_msgmap_struct/src/sd_msgmap_struct.xml.m4 create mode 100644 src/sd_msgmap_struct/src/stlm.xml.m4 create mode 100644 src/sd_msgmap_struct/src/strip_end_msg.xml.m4 create mode 100644 tst/in-1.txt.bz2 create mode 100644 tst/in-10k.txt.bz2 create mode 100644 tst/in-1k.txt.bz2 create mode 100644 tst/in-50k.txt.bz2 diff --git a/GNU-FDL.txt b/GNU-FDL.txt new file mode 100644 index 0000000..b42936b --- /dev/null +++ b/GNU-FDL.txt @@ -0,0 +1,355 @@ + GNU Free Documentation License + Version 1.1, March 2000 + + Copyright (C) 2000 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + +0. PREAMBLE + +The purpose of this License is to make a manual, textbook, or other +written document "free" in the sense of freedom: to assure everyone +the effective freedom to copy and redistribute it, with or without +modifying it, either commercially or noncommercially. Secondarily, +this License preserves for the author and publisher a way to get +credit for their work, while not being considered responsible for +modifications made by others. + +This License is a kind of "copyleft", which means that derivative +works of the document must themselves be free in the same sense. It +complements the GNU General Public License, which is a copyleft +license designed for free software. + +We have designed this License in order to use it for manuals for free +software, because free software needs free documentation: a free +program should come with manuals providing the same freedoms that the +software does. But this License is not limited to software manuals; +it can be used for any textual work, regardless of subject matter or +whether it is published as a printed book. We recommend this License +principally for works whose purpose is instruction or reference. + + +1. APPLICABILITY AND DEFINITIONS + +This License applies to any manual or other work that contains a +notice placed by the copyright holder saying it can be distributed +under the terms of this License. The "Document", below, refers to any +such manual or work. Any member of the public is a licensee, and is +addressed as "you". + +A "Modified Version" of the Document means any work containing the +Document or a portion of it, either copied verbatim, or with +modifications and/or translated into another language. + +A "Secondary Section" is a named appendix or a front-matter section of +the Document that deals exclusively with the relationship of the +publishers or authors of the Document to the Document's overall subject +(or to related matters) and contains nothing that could fall directly +within that overall subject. (For example, if the Document is in part a +textbook of mathematics, a Secondary Section may not explain any +mathematics.) The relationship could be a matter of historical +connection with the subject or with related matters, or of legal, +commercial, philosophical, ethical or political position regarding +them. + +The "Invariant Sections" are certain Secondary Sections whose titles +are designated, as being those of Invariant Sections, in the notice +that says that the Document is released under this License. + +The "Cover Texts" are certain short passages of text that are listed, +as Front-Cover Texts or Back-Cover Texts, in the notice that says that +the Document is released under this License. + +A "Transparent" copy of the Document means a machine-readable copy, +represented in a format whose specification is available to the +general public, whose contents can be viewed and edited directly and +straightforwardly with generic text editors or (for images composed of +pixels) generic paint programs or (for drawings) some widely available +drawing editor, and that is suitable for input to text formatters or +for automatic translation to a variety of formats suitable for input +to text formatters. A copy made in an otherwise Transparent file +format whose markup has been designed to thwart or discourage +subsequent modification by readers is not Transparent. A copy that is +not "Transparent" is called "Opaque". + +Examples of suitable formats for Transparent copies include plain +ASCII without markup, Texinfo input format, LaTeX input format, SGML +or XML using a publicly available DTD, and standard-conforming simple +HTML designed for human modification. Opaque formats include +PostScript, PDF, proprietary formats that can be read and edited only +by proprietary word processors, SGML or XML for which the DTD and/or +processing tools are not generally available, and the +machine-generated HTML produced by some word processors for output +purposes only. + +The "Title Page" means, for a printed book, the title page itself, +plus such following pages as are needed to hold, legibly, the material +this License requires to appear in the title page. For works in +formats which do not have any title page as such, "Title Page" means +the text near the most prominent appearance of the work's title, +preceding the beginning of the body of the text. + + +2. VERBATIM COPYING + +You may copy and distribute the Document in any medium, either +commercially or noncommercially, provided that this License, the +copyright notices, and the license notice saying this License applies +to the Document are reproduced in all copies, and that you add no other +conditions whatsoever to those of this License. You may not use +technical measures to obstruct or control the reading or further +copying of the copies you make or distribute. However, you may accept +compensation in exchange for copies. If you distribute a large enough +number of copies you must also follow the conditions in section 3. + +You may also lend copies, under the same conditions stated above, and +you may publicly display copies. + + +3. COPYING IN QUANTITY + +If you publish printed copies of the Document numbering more than 100, +and the Document's license notice requires Cover Texts, you must enclose +the copies in covers that carry, clearly and legibly, all these Cover +Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on +the back cover. Both covers must also clearly and legibly identify +you as the publisher of these copies. The front cover must present +the full title with all words of the title equally prominent and +visible. You may add other material on the covers in addition. +Copying with changes limited to the covers, as long as they preserve +the title of the Document and satisfy these conditions, can be treated +as verbatim copying in other respects. + +If the required texts for either cover are too voluminous to fit +legibly, you should put the first ones listed (as many as fit +reasonably) on the actual cover, and continue the rest onto adjacent +pages. + +If you publish or distribute Opaque copies of the Document numbering +more than 100, you must either include a machine-readable Transparent +copy along with each Opaque copy, or state in or with each Opaque copy +a publicly-accessible computer-network location containing a complete +Transparent copy of the Document, free of added material, which the +general network-using public has access to download anonymously at no +charge using public-standard network protocols. If you use the latter +option, you must take reasonably prudent steps, when you begin +distribution of Opaque copies in quantity, to ensure that this +Transparent copy will remain thus accessible at the stated location +until at least one year after the last time you distribute an Opaque +copy (directly or through your agents or retailers) of that edition to +the public. + +It is requested, but not required, that you contact the authors of the +Document well before redistributing any large number of copies, to give +them a chance to provide you with an updated version of the Document. + + +4. MODIFICATIONS + +You may copy and distribute a Modified Version of the Document under +the conditions of sections 2 and 3 above, provided that you release +the Modified Version under precisely this License, with the Modified +Version filling the role of the Document, thus licensing distribution +and modification of the Modified Version to whoever possesses a copy +of it. In addition, you must do these things in the Modified Version: + +A. Use in the Title Page (and on the covers, if any) a title distinct + from that of the Document, and from those of previous versions + (which should, if there were any, be listed in the History section + of the Document). You may use the same title as a previous version + if the original publisher of that version gives permission. +B. List on the Title Page, as authors, one or more persons or entities + responsible for authorship of the modifications in the Modified + Version, together with at least five of the principal authors of the + Document (all of its principal authors, if it has less than five). +C. State on the Title page the name of the publisher of the + Modified Version, as the publisher. +D. Preserve all the copyright notices of the Document. +E. Add an appropriate copyright notice for your modifications + adjacent to the other copyright notices. +F. Include, immediately after the copyright notices, a license notice + giving the public permission to use the Modified Version under the + terms of this License, in the form shown in the Addendum below. +G. Preserve in that license notice the full lists of Invariant Sections + and required Cover Texts given in the Document's license notice. +H. Include an unaltered copy of this License. +I. Preserve the section entitled "History", and its title, and add to + it an item stating at least the title, year, new authors, and + publisher of the Modified Version as given on the Title Page. If + there is no section entitled "History" in the Document, create one + stating the title, year, authors, and publisher of the Document as + given on its Title Page, then add an item describing the Modified + Version as stated in the previous sentence. +J. Preserve the network location, if any, given in the Document for + public access to a Transparent copy of the Document, and likewise + the network locations given in the Document for previous versions + it was based on. These may be placed in the "History" section. + You may omit a network location for a work that was published at + least four years before the Document itself, or if the original + publisher of the version it refers to gives permission. +K. In any section entitled "Acknowledgements" or "Dedications", + preserve the section's title, and preserve in the section all the + substance and tone of each of the contributor acknowledgements + and/or dedications given therein. +L. Preserve all the Invariant Sections of the Document, + unaltered in their text and in their titles. Section numbers + or the equivalent are not considered part of the section titles. +M. Delete any section entitled "Endorsements". Such a section + may not be included in the Modified Version. +N. Do not retitle any existing section as "Endorsements" + or to conflict in title with any Invariant Section. + +If the Modified Version includes new front-matter sections or +appendices that qualify as Secondary Sections and contain no material +copied from the Document, you may at your option designate some or all +of these sections as invariant. To do this, add their titles to the +list of Invariant Sections in the Modified Version's license notice. +These titles must be distinct from any other section titles. + +You may add a section entitled "Endorsements", provided it contains +nothing but endorsements of your Modified Version by various +parties--for example, statements of peer review or that the text has +been approved by an organization as the authoritative definition of a +standard. + +You may add a passage of up to five words as a Front-Cover Text, and a +passage of up to 25 words as a Back-Cover Text, to the end of the list +of Cover Texts in the Modified Version. Only one passage of +Front-Cover Text and one of Back-Cover Text may be added by (or +through arrangements made by) any one entity. If the Document already +includes a cover text for the same cover, previously added by you or +by arrangement made by the same entity you are acting on behalf of, +you may not add another; but you may replace the old one, on explicit +permission from the previous publisher that added the old one. + +The author(s) and publisher(s) of the Document do not by this License +give permission to use their names for publicity for or to assert or +imply endorsement of any Modified Version. + + +5. COMBINING DOCUMENTS + +You may combine the Document with other documents released under this +License, under the terms defined in section 4 above for modified +versions, provided that you include in the combination all of the +Invariant Sections of all of the original documents, unmodified, and +list them all as Invariant Sections of your combined work in its +license notice. + +The combined work need only contain one copy of this License, and +multiple identical Invariant Sections may be replaced with a single +copy. If there are multiple Invariant Sections with the same name but +different contents, make the title of each such section unique by +adding at the end of it, in parentheses, the name of the original +author or publisher of that section if known, or else a unique number. +Make the same adjustment to the section titles in the list of +Invariant Sections in the license notice of the combined work. + +In the combination, you must combine any sections entitled "History" +in the various original documents, forming one section entitled +"History"; likewise combine any sections entitled "Acknowledgements", +and any sections entitled "Dedications". You must delete all sections +entitled "Endorsements." + + +6. COLLECTIONS OF DOCUMENTS + +You may make a collection consisting of the Document and other documents +released under this License, and replace the individual copies of this +License in the various documents with a single copy that is included in +the collection, provided that you follow the rules of this License for +verbatim copying of each of the documents in all other respects. + +You may extract a single document from such a collection, and distribute +it individually under this License, provided you insert a copy of this +License into the extracted document, and follow this License in all +other respects regarding verbatim copying of that document. + + +7. AGGREGATION WITH INDEPENDENT WORKS + +A compilation of the Document or its derivatives with other separate +and independent documents or works, in or on a volume of a storage or +distribution medium, does not as a whole count as a Modified Version +of the Document, provided no compilation copyright is claimed for the +compilation. Such a compilation is called an "aggregate", and this +License does not apply to the other self-contained works thus compiled +with the Document, on account of their being thus compiled, if they +are not themselves derivative works of the Document. + +If the Cover Text requirement of section 3 is applicable to these +copies of the Document, then if the Document is less than one quarter +of the entire aggregate, the Document's Cover Texts may be placed on +covers that surround only the Document within the aggregate. +Otherwise they must appear on covers around the whole aggregate. + + +8. TRANSLATION + +Translation is considered a kind of modification, so you may +distribute translations of the Document under the terms of section 4. +Replacing Invariant Sections with translations requires special +permission from their copyright holders, but you may include +translations of some or all Invariant Sections in addition to the +original versions of these Invariant Sections. You may include a +translation of this License provided that you also include the +original English version of this License. In case of a disagreement +between the translation and the original English version of this +License, the original English version will prevail. + + +9. TERMINATION + +You may not copy, modify, sublicense, or distribute the Document except +as expressly provided for under this License. Any other attempt to +copy, modify, sublicense or distribute the Document is void, and will +automatically terminate your rights under this License. However, +parties who have received copies, or rights, from you under this +License will not have their licenses terminated so long as such +parties remain in full compliance. + + +10. FUTURE REVISIONS OF THIS LICENSE + +The Free Software Foundation may publish new, revised versions +of the GNU Free Documentation License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. See +http://www.gnu.org/copyleft/. + +Each version of the License is given a distinguishing version number. +If the Document specifies that a particular numbered version of this +License "or any later version" applies to it, you have the option of +following the terms and conditions either of that specified version or +of any later version that has been published (not as a draft) by the +Free Software Foundation. If the Document does not specify a version +number of this License, you may choose any version ever published (not +as a draft) by the Free Software Foundation. + + +ADDENDUM: How to use this License for your documents + +To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and +license notices just after the title page: + + Copyright (c) YEAR YOUR NAME. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.1 + or any later version published by the Free Software Foundation; + with the Invariant Sections being LIST THEIR TITLES, with the + Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. + A copy of the license is included in the section entitled "GNU + Free Documentation License". + +If you have no Invariant Sections, write "with no Invariant Sections" +instead of saying which ones are invariant. If you have no +Front-Cover Texts, write "no Front-Cover Texts" instead of +"Front-Cover Texts being LIST"; likewise for Back-Cover Texts. + +If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of +free software license, such as the GNU General Public License, +to permit their use in free software. diff --git a/GNU-GPL.txt b/GNU-GPL.txt new file mode 100644 index 0000000..5b6e7c6 --- /dev/null +++ b/GNU-GPL.txt @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/ReadMe.txt b/ReadMe.txt new file mode 100644 index 0000000..43659dd --- /dev/null +++ b/ReadMe.txt @@ -0,0 +1,52 @@ +# $RCSfile: ReadMe.txt,v $ +# $Revision: 1.1 $ +# $Name: $ +# $Date: 2008/11/12 02:25:22 $ +# $Author: agibert $ + + + + + +Welcome to IMR (Interlinking Message Router) ! + + + +This program is DIAMIS Cristal message transformer. It can convert XML Cristal messages to old flat message format and vice versa. +Thanks to its fully configurability, IMR can virtually convert any file format. +Message are read from and writen to different media: file, MQSeries ans Tuxedo Queues. + +This is the initial and origianal release of IMR. +This version has been in production between April 2005 and February 2008 and no bug has been detected ! + + +This release of IMR supports the following OS: + - Mandriva Linux 2005 (Developement), + - HP UX (Production). + + + +Authors: + - Architecture and team leading : A. Gibert + - Conception, Development and Tests: A. Gibert, H. Moussaid, D. Olivon, E. Renaud (Coignet) + + + +IMR is now licensed under the GPL GNU Licenses. +For more information, please read the corresponding source file headers. +The license details can be found in the GNU-GPL.txt and GNU-FDL.txt files. + +IMR depend on: + - libnode V2.1.0-1 (http://www.rx3.org/dvp/?dvp=libnode), + - libxml2 V2.6.9 (http://www.xmlsoft.org/), + - libz V1.1.4 ((C) 1995-2002 Jean-loup Gailly and Mark Adler). +These libraries are currently distributed with IMR. Please check their corresponding licenses. + + + +Enjoy it! + +Your IMR Team. + +arnaud@rx3.net +http://www.rx3.org/dvp/?dvp=imr diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt new file mode 100644 index 0000000..38addd7 --- /dev/null +++ b/ReleaseNotes.txt @@ -0,0 +1,17 @@ +# $RCSfile: ReleaseNotes.txt,v $ +# $Revision: 1.1 $ +# $Name: $ +# $Date: 2008/11/12 02:25:22 $ +# $Author: agibert $ + + + + + +------------------------------------------------------------------------------------------------------------------------------------ +IMR V 1.0.0-1 - A. Gibert / H. Moussaid / D. Olivon / E. Renaud (Coignet) - 01/04/05 +------------------------------------------------------------------------------------------------------------------------------------ + +- Intial Version, released for MICOT/Target project (Banque de France - Paris), +- This version has been in production between April 2005 and February 2008. +- GPL Release. diff --git a/ToDo.txt b/ToDo.txt new file mode 100644 index 0000000..fb711f7 --- /dev/null +++ b/ToDo.txt @@ -0,0 +1,12 @@ +# $RCSfile: ToDo.txt,v $ +# $Revision: 1.1 $ +# $Name: $ +# $Date: 2008/11/12 02:25:22 $ +# $Author: agibert $ + + + + + +- Remove libnode and libxml from source and use them externally, +- Support the forth comming libnode in order to support C99 standards... diff --git a/doc/IMR-Architecture_Generale.odp b/doc/IMR-Architecture_Generale.odp new file mode 100644 index 0000000000000000000000000000000000000000..983cb0f899668c136e6bbaf163bfb83398ec61f6 GIT binary patch literal 27201 zcmbUIbx)czJC-RT%ythwPD$9XGV1WF0L^ay*uu;}jGJWI!PMGi0&dScr)yvV$$kEZ(%EZXk z%E6w=-QJYZ!N|qRh0(#$%-+<&#Ldpk-j&hO+05np`af-y|A!Rjo8mvxZ=V160soCm z9PC~H>)~lk=ger#@g85Nux*4?jOs>UFOY@9B9h<7dArJpOv&8ou{he|wD0?BR{wLTD2s6UjGXF`}TOEDnDBFU&=`0njYT7 zC*U8SvQ-l`C!Kgk8kLX<0bo>_@JBAbHo89__j9;>b>8khS`t2_wzt+Q}UGUI7| zv50=Pp?g_2O&Nlf=&`0SkXY9ky!|MNwaP@=GLANT53BU$h=lnOkH}TH{_ZT{tIH+$ z`j>bsKv!TOK}DhKlv3Z`eVBc1F_%ZszNNb?&Zw=fofScq`X zRLnlMMJpuoJ{v==J-S~;r1tE ztLf^t#OF4|a4Xk2co$7iTTID^)rrRgIv6>DzQb%+J&MG~aF>qLx`UcaFEz%xkP<1U;*x>*CA$C=~oB z&n$bQaf5-H&N8iqA*RxJ1B&bjZXJ)VRdW4LLDbYk!6+o;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wxcqz1Upvuj@=2Iq=Z+g@@R9Vw^r@-rGLKz4HRp#@>2SF5gj~ zYx`PkfxIt}6Ddoa#0eR;AZzxES@ML? zDG(;luq5NgOF@n2&5&nW(NelKw59k9k?-%&h=~;)2d_%WF5bWo#x#;$D8_WvdL>s1 zM~Z)lsl%_x^~X!~Xbwiekx0!6`;5l>s8i>$>}%u$-_JA6Dc#j($3#6DDUZ1(XUDv2 zF@bSpX~Rr8GdE8#cAX>-UQjlI1!t24mK)`zh^NtMa+bvNPrRjRoG*n&^L2^J#=Q}3 zp5pVl>I`SgF!6I1?OTg{h%2}{Q_es-#twFki?G-H|R1c&P<_6`fc@iK`s%kXM%f`qb#%74bYyXX2{|`-DeP$?L)PLZqN$ zybVqG>Pk1GGpHg(R`fV3Zsd0GzS0=NfEk5r?|@Su$zr?y}=^ zHWc~mUe$c_iP_wO*=?*!ls;5R7bFLU*#(?7C&)Nc9r&`87HD;jQdDKritf$ zC(oLYp^BmqTUuX!tt#&ZNQ1%Io1!HZKPB5-tVQBPdKArsTPUHDu+$GnCQi=e48e4WpD;i_vhz8QynN36)fhP6h9Pm@+z`1Mb#|mv)cnof zhc>GKQumvGMmwWuc-CqCQ?24bbfTyrMZ(uJ+Z|7S4K>bkjSNrYODEgUjW&Zue z=s#I*Q9sPJTU+mEa?trtL+f8GzaONx;NMw#KS>9EL;82S@9!=66A1_R_nSn~{ZI9N z+JXPha%(94OhUh5`PDA`cb>m%WB(hTpLXK^%98&ZmY;Uxzq8z0jz81lZ&?1rj{JAB zzgN%$z5lG{U+v28JU{y6uS4UlW%)Cy!FYbPGk)^hdj}3q2z-0?f4_adEC2ui literal 0 HcmV?d00001 diff --git a/doc/IMR-Architecture_Generale.odt b/doc/IMR-Architecture_Generale.odt new file mode 100644 index 0000000000000000000000000000000000000000..be5b115a9f0ac2e22527714ec63ced62552d4e13 GIT binary patch literal 64035 zcmb4qcQl;Q*RB#I(WCc>M2p_*h!#W=y+n=PdmYAzE@}{+K@cTM5WS4v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i_-TZFigUbEr{?O@@SK&$;i)kkc9O$ULj4Yw@|1&4&ZqF^VE?UM|v^0jF%5uokL+fU{RiRC*+!G{pRb{>?0ZNo(YrTBrSRWlj z$ZvGGaSSyMP;rJGzqoDz4O7--v+3>g>kJl8NWJ2--bf{hZ)y3mWbfkKpt71ak8bx+ zNP;f-wC73N9TTfC#x)@o1o+^=aFG`pvSrb*VDyjxJ|+>cR8#T(1ymvwV82)(Ae~IT zRxl3IXGOk|bF9AxOEX|1#l;%--RgUb{Oli#{T^7&7$%N_!u*Sg9B`y)2DNtpJX2O+ zQV$5CqR3AU5pLu^Hg;|h1OgJ}1c4x2$X&^Phjy}Q>cJ-g$mRbIZ4GP|@+&k*lmiLL z34!pOLyPjTu>*5T;-VrFe}aD974XCp_yKLc`W<={`J4NNH878R4$Usfbq>wWCIVpx zgTZ1PB7cG&BZ}q5z(YYX5&a#yocniZFjyRb1Vco*kp%-1Wfu_<7v%u{*g5|M-4Vjl z7Kq#@h4FXjYtp|%gU)w=`vn@<0*(vB0s15KwV>4|Az-XFG2&>|C6pU>-3ZF>!9lpP+x< z9`9G^2={+L|L|8(8uhn?d1kE<}>t-hZVejXnq2c17c z>h!OB9q} zGa38`q#xt#e@8(MM1O>aKcM_P?*4b2U)k*a0q4g!{J)|wFa5K0evHfi9R)cu{}G^n zK>5cw{olcUEui#2fc-pf|AzCuP5$gt{rcM(0&spF$A51!-z|UcGm$>mkD#&nFCLiU WeRRNmLqQ<}UfP%_D5YPKNB<8efc)A3 literal 0 HcmV?d00001 diff --git a/doc/IMR-DCT-Mapping_Manager.odt b/doc/IMR-DCT-Mapping_Manager.odt new file mode 100644 index 0000000000000000000000000000000000000000..116e1d15369bd55e0f1b613998311021894f829e GIT binary patch literal 131414 zcmb5V1yG#9vp7f+f@>hS1W1tJ?gV#-Ai)yc7lJIZSa5fDcL?q*?y$J~;VALpR=^7M{TfuDsx343?szr(-};Z!uJl_2xS2>BE# z8XkmKz>_7}gAGq|Q0qS-FK3n`o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?d00001 diff --git a/doc/IMR-DCT-Static_Data_Manager.odt b/doc/IMR-DCT-Static_Data_Manager.odt new file mode 100644 index 0000000000000000000000000000000000000000..b19978bbf72c4ef43627d3902a8c144f3906049c GIT binary patch literal 38072 zcmV)`Kz_eaO9KQH0000001yFeIbOyx3?~2p04D$d00;m80Bvb)WpsIPWnpk|Y-wX* zbZKvHFLrKZE^lFTX>%@baAj^}Z)0_BWo~pXbY*ySP)h>@6aWYS2mlZPY&ie`00000 z00000000XB003ieZggdCbS`*pZ0)_xj@(F+FnHgmAabw+38-Z9|3}l(K$TK;Yayw$ zB~^FNVgP{|!N_D+L@=6Uq@+F#u%|um>ATfw(V79iZ?B8Fm9Q@|FR-t$X6{bX-AP7} zK{6v!Vs}+mCh2rHH#al4KR5r~KYv^;mD?~$qj>%JOjortC0x(qd9=QMeD?FZAI`nA ze}3{m{VrZCqFMN89?!O`aGjmc;&lf9Rp9G&`iQ=Le6~&2kK!PW(nsrH6{e4}*`s(9 zuJf-R@vR?`vFMXD`?PHRIcdy)orNE>wjX0#;oIP<{m7&-|MffxKD7N9+X7Pg&lhpq zk3Xi%^F<6;Uu}XclA!pwjMl$AKD)`X&7+Hp43bUXseAt!;X}w)tg-L7F1X)m7)%5ndHAUQBH=t&A6C|x^ zgESVG*PORsUUSZWy9%<#$MB4Cy zaY0`fjnjE!*MENX^6l&i z3mR`8aUD?lVIOn*hjI2K-z+Ghr5DA61#BAUi(nR>&%@a=eeyfX^u=R^{*9nKKKm00 zOWcKE0fE2sMyqJ~Nqkp!v5B%7@Z4>XL@20*cgWjm2+Q;FJpHt~ikD{>yN7>ETUEy{ zUhp5|tMlt{4afsxPvTXu9uKr<;a`G3Zk4yeI@N0c{KsGur~kw?q7QmPya%S25y*Rx zzwugm3tcW6;gTEP1#qw4?g1)qa2LS51NKUl*Wm}{C)QOxOj5hM0PQI>t0VdRdGpZe zhbZ06j2-9)NVXOEv?J}_puG!jV%!-j5EU;*9Gqk0fml8LlxE>-A50fbBAY!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$@c;yYz~ZrWo2#cN?J|AFzqJL?R}LB9Y}(UtS4nx|lBqdi!QVP1EKVL|HkIayj(06w zePpR5|CL{Rx1PBz&geF8o)5>9%1y;Tf84zCL(W~;_#dMu!(|T#6Dt#zjk7j2goN`= zdaAJ}euC>J&h}nqHs0(%M&Xu8n$ZVlDZKr9_I1(RseR`)Cz@&q2p?s9=r;dw!-_+F zw;aAl8yc#fTax)_aoXI4*&CP^`TO6wXk}WpZzs!(&ZwLh4KMU{TmJ8O^7}p4BO521 z_1y1R*nLIX6gHZOzu&m8!mp_G@dxWTe{Z)?kx3IIGE|rDdApmpvZ8N;)P)yQf5lzU{%P&D4_v)8{@M_&7bVn=a`aB?&wa8Mf9 zObqa5WD;Qz0mcNRH5YfxhzHa-1YvNa4>4G()K>>^a;cb}BUmWdmn4uue=*>P*`x^n) zVKEf7HI5qh2%QWJsGfX*#Uw=Q9JeW;<|_iowPSh`xwVel98}kYVKE2MdMDPD9xSFH zTJyL~0k!85;1Cv5Fk1Jx4MPo}|5yw|ZtX+Nfu%|0LKZden0KJI{$WW5rW3gU02RUr baHkJPksRR73M|ioDGmrVfKygg6F@uwa1zfz literal 0 HcmV?d00001 diff --git a/doc/IMR-MCD.pdf b/doc/IMR-MCD.pdf new file mode 100755 index 0000000000000000000000000000000000000000..ed301172fcf644a3150b4946ac3d1bf0105b0dcb GIT binary patch literal 25733 zcmZs?1CZ`ay9GM7J$r21wr%XOZQHhOTYGHVw)fcPo$tpz=hi)y>LgG1gHd*Zd_!Cc;YHXepy-4gjP;$&ZEb}0os99x5&a4aF7b@Lv6Cyz_85)P zzxO4Bz+MF?pm=$qjBSj5>OisluX@tPHl|Ky4ET)nY)q_BbpJN-8JO7^=%MID&8?h% zp!}v2wfe~|Y;0(2WUT#9B1fm6n$}P&Y?rx2dUnZac3J*F3Oq7?k5o~AdJD-#ym{ps zAJ9}EiHfoNWHak?-cB<+Kag0lASEeju?mev65@Y5a@%KFJ*N>^(QM1|PFKrMuW}BQrL3q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&eZk=?-LwEkuTf#nZ#{D%z+C&LiG+vGs9 zfBDJDAA&J|_(33l{}&1)7xxc81=wGHa0U54V*|lqf9F6J3jHfySq1oCHjpgr&v?lw z*5T0l?Onhi`Cp&w>upDdue_NKxe^oSAjiWRozeBc;($NLIejkoH9*K4F!ZcNDBg2P|#G+)Rcv5LskB@$A7o5we$A< SF;2iB7(|XqL`2&N!Sr9;vBF*e literal 0 HcmV?d00001 diff --git a/src/Makefile b/src/Makefile new file mode 100644 index 0000000..4a58285 --- /dev/null +++ b/src/Makefile @@ -0,0 +1,179 @@ +#------------------------------------------------------------------------------ +# General Makefile +#------------------------------------------------------------------------------ +# $Author: agibert $ +# $Date: 2008/11/12 02:25:22 $ +# $Revision: 1.1 $ +# $Label: $ +#------------------------------------------------------------------------------ +# Makefile Target: clean all install uninstall clean-lib clean-bin +# lib bin install-lib install-bin uninstall-lib +# uninstall-bin +# Default Makefile Target: all +# Makefile Support Switches: ORACLE_SUPPORT TUX_SUPPORT MQS_SUPPORT +# Makefile Switches: VERBOSE WARNING DEBUG OPTIMIZE STATIC DYNAMIC +# Makefile Switches: PROFILE STRIP DOTI DOLINT EFENCE DMALLOC PURIFY +# Default Makefile Switches: STATIC=1 DEBUG=1 +# Makefile Variables: CC SUBDIR +# Default Makefile Variables: SQLCHECK=FULL +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# IMR - Interlinking Message Router +# Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) +# mailto:arnaud@rx3.net +# http://www.rx3.org/dvp/?dvp=imr +#------------------------------------------------------------------------------ +# This file is part of IMR +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# Constants +#------------------------------------------------------------------------------ + +MAKE = make +SHELL = bash + + + + + +#------------------------------------------------------------------------------ +# Variables +#------------------------------------------------------------------------------ + +ifdef VERBOSE + QUIET= + SILENT= +else + QUIET=@ + SILENT=-s +endif + + + +LIB= libz \ + libnode \ + libxml \ + liblog_mng \ + libstatic_data_mng \ + libio_mng \ + libmapping_mng \ + libmsg_router \ + sd_appl_struct \ + sd_cnv_struct \ + sd_fmtattr_struct \ + sd_fmt_struct \ + sd_mappath_struct \ + sd_msg_struct \ + sd_msgmap_struct + +BIN= imrd \ +# imrc + +SUBDIR= $(LIB) $(BIN) + + + + + +#------------------------------------------------------------------------------ +# External targets +#------------------------------------------------------------------------------ + +all: + + + +clean all install uninstall: + $(QUIET)$(MAKE) $(SILENT) $(MAKEOVERRIDES) make-$@ + + + +lib: + $(QUIET)$(MAKE) $(SILENT) SUBDIR="$(LIB)" $(MAKEOVERRIDES) all + +bin: + $(QUIET)$(MAKE) $(SILENT) SUBDIR="$(BIN)" $(MAKEOVERRIDES) all + +clean-lib install-lib uninstall-lib: + $(QUIET)$(MAKE) $(SILENT) SUBDIR="$(LIB)" $(MAKEOVERRIDES) $(patsubst %-lib, %, $@) + +clean-bin install-bin uninstall-bin: + $(QUIET)$(MAKE) $(SILENT) SUBDIR="$(BIN)" $(MAKEOVERRIDES) $(patsubst %-bin, %, $@) + + + + + +#------------------------------------------------------------------------------ +# Internal targets +#------------------------------------------------------------------------------ + +make-clean make-all make-install make-uninstall: $(SUBDIR) + + + + + +#------------------------------------------------------------------------------ +# Rules +#------------------------------------------------------------------------------ + +$(SUBDIR): + @echo Making $(patsubst make-%, %, $(MAKECMDGOALS)) into $@... + $(QUIET)$(MAKE) $(SILENT) -C $@/src ECHO_HEAD="\t$@: " $(MAKEOVERRIDES) $(patsubst make-%, %, $(MAKECMDGOALS)) + @echo Completed $(patsubst make-%, %, $(MAKECMDGOALS)) into $@ ! + + + + + +#------------------------------------------------------------------------------ +# Suffixes +#------------------------------------------------------------------------------ + +.PHONY: clean clean-lib clean-bin make-clean all make-all lib bin install install-lib install-bin make-install uninstall uninstall-lib uninstall-bin make-uninstall $(SUBDIR) +ifdef PURIFY + .NOTPARALLEL: +endif + + + + + +#------------------------------------------------------------------------------ +# Dependencies +#------------------------------------------------------------------------------ + +$(BIN): $(LIB) + + + +ifneq (,$(findstring clean,$(MAKECMDGOALS))) +all: clean +install: clean +endif + +ifneq (,$(findstring uninstall,$(MAKECMDGOALS))) +all: uninstall +install: uninstall +endif diff --git a/src/Makefile_rule.mk b/src/Makefile_rule.mk new file mode 100644 index 0000000..aa7f68a --- /dev/null +++ b/src/Makefile_rule.mk @@ -0,0 +1,280 @@ +#------------------------------------------------------------------------------ +# Makefile Rule Definitions +#------------------------------------------------------------------------------ +# $Author: agibert $ +# $Date: 2008/11/12 02:25:22 $ +# $Revision: 1.1 $ +# $Label: $ +#------------------------------------------------------------------------------ +# Makefile Target: clean all dep install uninstall +# Default Makefile Target: all +# Makefile Support Switches: ORACLE_SUPPORT TUX_SUPPORT MQS_SUPPORT +# Makefile Switches: VERBOSE WARNING DEBUG OPTIMIZE STATIC DYNAMIC +# Makefile Switches: PROFILE STRIP DOTI DOLINT EFENCE DMALLOC PURIFY +# Default Makefile Switches: STATIC=1 DEBUG=1 +# Makefile Variables: CC SQLCHECK +# Default Makefile Variables: SQLCHECK=FULL +# Tuxedo Server Tag: TXSERVICE_NAME TXSERVICE_TYPE +# Tuxedo Service Type: NONE TX_SERVER_OXA TX_CLIENT_ORA +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# IMR - Interlinking Message Router +# Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) +# mailto:arnaud@rx3.net +# http://www.rx3.org/dvp/?dvp=imr +#------------------------------------------------------------------------------ +# This file is part of IMR +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# Variables +#------------------------------------------------------------------------------ + +TARGET_FILES= $(TARGET) +INSTALL_FILES= $(TARGET) +UNINSTALL_FILES= $(TARGET) + +ifeq ($(suffix $(TARGET)),$(SHLIB_SUFFIX)) + INSTALL_DIR= $(GLOBAL_LIB_DIR) + TARGET_FILES+= $(TARGET:$(SHLIB_SUFFIX)=.a) + INSTALL_FILES+= $(TARGET:$(SHLIB_SUFFIX)=.a) + UNINSTALL_FILES+= $(TARGET:$(SHLIB_SUFFIX)=.a) .pure $(TARGET:$(SHLIB_SUFFIX)=_pure_*$(SHLIB_SUFFIX)) $(TARGET:$(SHLIB_SUFFIX)=_pure_*.a) + + ifdef DOLINT + LINT_TARGET= llib-l$(subst lib,,$(basename $(TARGET))).ln + LINT_LIB= $(LINT_TARGET) + TARGET_FILES+= $(LINT_TARGET) + INSTALL_FILES+= $(LINT_TARGET) + UNINSTALL_FILES+= $(LINT_TARGET) + endif +else + ifeq ($(suffix $(TARGET)),.xml) + INSTALL_DIR= $(GLOBAL_LIB_DIR)/imr + else + INSTALL_DIR= $(GLOBAL_BIN_DIR) + + ifdef DOLINT + LINT_FILE= $(basename $(TARGET)).lint + LINT_LIB= + TARGET_FILES+= $(LINT_FILE) + endif + endif +endif + +ifdef DOTI + TARGET_FILES+= $(OBJ:.o=.i) +endif + + + + + +#------------------------------------------------------------------------------ +# External targets +#------------------------------------------------------------------------------ + +all: dep + $(QUIET)$(MAKE) $(SILENT) $(MAKEOVERRIDES) build + +clean: + @echo -e '$(ECHO_HEAD)Cleaning up...' + $(QUIET)$(RM) -f \ + $(shell for file in $(OBJ:.o=); \ + do \ + if [ -f $$file.pc ]; \ + then \ + echo $$file.c $$file.lis; \ + fi; \ + done) \ + $(OBJ:.o=.dep) \ + $(OBJ:.o=.i) \ + $(OBJ:.o=.ln) \ + $(OBJ:.o=.sublint) \ + $(OBJ:.o=_pure_*) \ + $(OBJ) \ + $(TARGET_FILES) \ + llib-l$(subst lib,,$(basename $(TARGET))).ln \ + llib-l$(subst lib,,$(basename $(TARGET))).sublint \ + BS-*.c BS-*.o \ + BS-*_pure_* \ + BC-*.c BC-*.o \ + BC-*_pure_* \ + logfile* \ + .pure + +install: $(patsubst %,$(INSTALL_DIR)/%,$(INSTALL_FILES)) + +uninstall: + $(QUIET)for file in $(UNINSTALL_FILES); \ + do \ + echo -e "$(ECHO_HEAD)Uninstalling $$file from $(INSTALL_DIR)..."; \ + $(RM) -f $(INSTALL_DIR)/$$file; \ + done + +dep: + $(QUIET)$(MAKE) $(SILENT) $(MAKEOVERRIDES) depend + + + + + +#------------------------------------------------------------------------------ +# Internal targets +#------------------------------------------------------------------------------ + +depend: $(OBJ:.o=.dep) + +build: $(TARGET_FILES) + + + + + +#------------------------------------------------------------------------------ +# Rules +#------------------------------------------------------------------------------ + +%.dep : %.c + @echo -e '$(ECHO_HEAD)Dependencing $<...' + $(QUIET)$(MAKEDEP) $(MAKEDEP_FLAGS) -o.o $< >$@ + $(QUIET)$(MAKEDEP) $(MAKEDEP_FLAGS) -o.i $< >>$@ + +%.c : %.pc + @echo -e '$(ECHO_HEAD)Procing $<...' + $(QUIET)$(PROC) $(DEVNULL) $(PROC_FLAGS) oname=$@ iname=$< $(PROC_FILTER) + +%.i : %.c + @echo -e '$(ECHO_HEAD)Precompilling $<...' + $(QUIET)$(CPP) $(CPPFLAGS) $(INCLUDE) -o $@ $< + +%.ln : %.c + @echo -e '$(ECHO_HEAD)Linting $<...' + $(QUIET)$(LINT) $(LINTFLAGS) $(INCLUDE) -c > $(<:.c=.sublint) $< + +%.o : %.c + @echo -e '$(ECHO_HEAD)Compilling $<...' + $(QUIET)$(CC) $(CFLAGS) $(INCLUDE) -o $@ $< + +$(LINT_LIB): $(OBJ:.o=.ln) + @echo -e '$(ECHO_HEAD)Lib Linting $@...' + $(QUIET)$(LINT) $(LINTFLAGS) -o $(subst lib,,$(basename $(TARGET))) > $(@:.ln=.sublint) $(OBJ:.o=.ln) + +%$(SHLIB_SUFFIX): %.o + @echo -e '$(ECHO_HEAD)Linking $@...' + $(QUIET)$(LD) $(LDFLAGS) -o $@ $(OBJ) + +%.a : %.o + @echo -e '$(ECHO_HEAD)Linking $@...' + $(QUIET)$(AR) $(ARFLAGS) $@ $(OBJ) + +%.lint : %.ln + @echo -e '$(ECHO_HEAD)Link Linting $@...' + $(QUIET)$(LINT) $(LINTFLAGS) $(LINTLIBS) $< >$@ + +% : %.o +ifeq ($(TXSERVICE_TYPE),TX_SERVER_OXA) + @echo -e '$(ECHO_HEAD)Building Tuxedo server $@... ' + $(QUIET)$(PRELINK) $(TXBLDSRV) $(TXBLD_FLAGS) -o $@ -f "$(OBJ)" $(TXBLD_LIB) -s "$(TXSERVICE_NAME)" $(PRELINK_FILTER) +else + ifeq ($(TXSERVICE_TYPE),TX_CLIENT_ORA) + @echo -e '$(ECHO_HEAD)Building Tuxedo client $@...' + $(QUIET)$(PRELINK) $(TXBLDCLN) $(TXBLD_FLAGS) -o $@ -f "$(OBJ)" $(TXBLD_LIB) $(PRELINK_FILTER) + ifndef DEBUG + $(QUIET)$(RM) BC-*.c + endif + else + @echo -e '$(ECHO_HEAD)Linking $@...' + ifdef PURIFY + @echo -e '$(ECHO_HEAD)Purifing $@... ' + $(PURIFIER) $(PURIFIER_FLAGS) $(CC) $(LINK_FLAGS) -o $@ $(OBJ) $(LIB) $(PRELINK_FILTER) + else + $(QUIET)$(CC) $(LINK_FLAGS) -o $@ $(OBJ) $(LIB) + endif + endif +endif +ifdef DEBUG + ifeq ($(OS),HP-UX) + @echo -e '$(ECHO_HEAD)Pxdbing $@...' + $(QUIET)$(PXDB) $(PXDBFLAGS) $@ + endif +else + ifdef STRIP + @echo -e '$(ECHO_HEAD)Striping $@...' + $(QUIET)$(STRIPPER) $@ + endif +endif + +%.xml : %.xml.m4 + @echo -e '$(ECHO_HEAD)M4ing $@... ' + $(QUIET)$(M4) $(M4_FLAGS) > $@ $< + +$(INSTALL_DIR)/%: $(INSTALL_DIR) all + @echo -e '$(ECHO_HEAD)Installing $(subst $(INSTALL_DIR)/,,$@) into $(INSTALL_DIR)...' + $(QUIET)$(CP) $(subst $(INSTALL_DIR)/,,$@) $(INSTALL_DIR) + +$(INSTALL_DIR): + @echo -e '$(ECHO_HEAD)Creatinging $(INSTALL_DIR)...' + $(QUIET)$(MKDIR) $(INSTALL_DIR) + + + + + +#------------------------------------------------------------------------------ +# Suffixes +#------------------------------------------------------------------------------ + +.SECONDARY: $(OBJ:.o=.c) $(OBJ:.o=.dep) $(OBJ:.o=.ln) $(OBJ:.o=.sublint) +.SUFFIXES: .pc .c .h .dep .i .ln .sublint .o $(SHLIB_SUFFIX) .a .lint +.PHONY: clean all dep install uninstall build depend +.DELETE_ON_ERROR: + + + + + +#------------------------------------------------------------------------------ +# Dependencies +#------------------------------------------------------------------------------ + +$(OBJ): Makefile $(MAKEFILE_GLOB) $(MAKEFILE_PATH) +$(TARGET_FILES): $(OBJ) $(OBJ_RAW) Makefile $(MAKEFILE_GLOB) $(MAKEFILE_PATH) + +ifneq ($(suffix $(TARGET)),$(SHLIB_SUFFIX)) + ifneq ($(suffix $(TARGET)),.xml) + $(TARGET): $(patsubst %,$(GLOBAL_LIB_DIR)/lib%$(SHLIB_SUFFIX),$(LIB_LIST)) + endif +endif + +ifneq (,$(findstring clean,$(MAKECMDGOALS))) +dep: clean +endif + +ifneq (,$(findstring uninstall,$(MAKECMDGOALS))) +dep: uninstall +endif + +ifeq ($(MAKECMDGOALS),build) + ifneq (,$(OBJ)) + -include $(OBJ:.o=.dep) + endif +endif diff --git a/src/Makefile_template.mk b/src/Makefile_template.mk new file mode 100644 index 0000000..90c00da --- /dev/null +++ b/src/Makefile_template.mk @@ -0,0 +1,65 @@ +#------------------------------------------------------------------------------ +# Local Makefile +#------------------------------------------------------------------------------ +# $Author: agibert $ +# $Date: 2008/11/12 02:25:22 $ +# $Revision: 1.1 $ +# $Label: $ +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# IMR - Interlinking Message Router +# Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) +# mailto:arnaud@rx3.net +# http://www.rx3.org/dvp/?dvp=imr +#------------------------------------------------------------------------------ +# This file is part of IMR +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# Var include +#------------------------------------------------------------------------------ + +include ../../Makefile_var.mk + + + +#------------------------------------------------------------------------------ +# Variables +#------------------------------------------------------------------------------ + +TARGET= lib_xxx$(SHLIB_SUFFIX) + +OBJ= module1.o \ + module2.o \ + lib_xxx.o + +EXTRA_INC= ../zzz + +EXTRA_LIB= -lzzz + + + +#------------------------------------------------------------------------------ +# Rule include +#------------------------------------------------------------------------------ + +include ../../Makefile_rule.mk diff --git a/src/Makefile_var.mk b/src/Makefile_var.mk new file mode 100644 index 0000000..aead75b --- /dev/null +++ b/src/Makefile_var.mk @@ -0,0 +1,497 @@ +#------------------------------------------------------------------------------ +# Makefile Var Definitions +#------------------------------------------------------------------------------ +# $Author: agibert $ +# $Date: 2008/11/12 02:25:22 $ +# $Revision: 1.1 $ +# $Label: $ +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# IMR - Interlinking Message Router +# Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) +# mailto:arnaud@rx3.net +# http://www.rx3.org/dvp/?dvp=imr +#------------------------------------------------------------------------------ +# This file is part of IMR +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# Curent Module Dir +#------------------------------------------------------------------------------ + +LOCAL_INC_DIR= ../include + + + +#------------------------------------------------------------------------------ +# Global Dir +#------------------------------------------------------------------------------ + +GLOBAL_INC_DIR= ../../include +GLOBAL_BIN_DIR= ../../../bin +GLOBAL_LIB_DIR= ../../../lib + +LIB_LIST= msg_router mapping_mng io_mng static_data_mng log_mng xml node z + + + +#------------------------------------------------------------------------------ +# Constants +#------------------------------------------------------------------------------ + +MAKE = make +MAKEDEP = makedepend +SHELL = bash +RM = rm +MKDIR = mkdir -p +CP = cp +CAT = cat +M4 = m4 +PROC = proc +CC = +#CC = cc +#CC = gcc +CPP = $(CC) +LD = +#LD = ld +#LD = $(CC) +AR = ar +TXBLDSRV = buildserver +TXBLDCLN = buildclient +TXMKFML = mkfldhdr +TXMKVIEW = viewc +PXDB = pxdb +LINT = lint +STRIPPER = strip +PURIFIER = purify + +COMMA = , + + + + + +#------------------------------------------------------------------------------ +# Variables +#------------------------------------------------------------------------------ + +OS = $(shell uname) + +ifndef CC + ifeq ($(OS),HP-UX) + CC= cc + LD= ld + else + CC= gcc + LD= gcc + endif +endif + +ifdef VERBOSE + QUIET= + SILENT= + PROC_FILTER= + PRELINK_FILTER= + TXBLDSRV+= -v + TXBLDCLN+= -v +else + QUIET=@ + SILENT=-s + PROC_FILTER=| grep -v -e '^$$' -e '^Pro' -e '^(c)' \ + -e '^Copyright' -e '^System default option'; \ + [[ $${PIPESTATUS[0]} = 0 ]] + PRELINK_FILTER=2>&1 | grep -v -e '^Purify' \ + -e '^Instrumenting: '; \ + [[ $${PIPESTATUS[0]} = 0 ]] +endif + +ifdef DYNAMIC + STATIC= +else + STATIC=1 +endif + +ifdef OPTIMIZE + DEBUG= +else + DEBUG=1 +endif + +ifdef DEBUG + TXBLDSRV+= -k +endif + +ifndef SQLCHECK + SQLCHECK=FULL +endif + +ifndef ORACLE_SUPPORT + ifndef ORACLE_HOME + ORACLE_SUPPORT = 0 + else + ORACLE_SUPPORT = 1 + endif +endif + +ifndef TUX_SUPPORT + ifndef TUXDIR + TUX_SUPPORT = 0 + else + TUX_SUPPORT = 1 + endif +endif + +ifndef MQS_SUPPORT + ifndef MQM_HOME + MQS_SUPPORT = 0 + else + MQS_SUPPORT = 1 + endif +endif + + + +# Flags Init +INCLUDE= +LIB_cc= +LIB_gcc= +LIB= +M4_FLAGS= +MAKEDEP_FLAGS= +PROC_FLAGS= +CPPFLAGS= +CPPFLAGS_cc= +CPPFLAGS_gcc= +CFLAGS= +CFLAGS_cc= +CFLAGS_gcc= +LDFLAGS= +TXBLD_FLAGS= +TXBLD_FLAGS_cc= +TXBLD_FLAGS_gcc= +LDFLAGS= +LDFLAGS_cc= +LDFLAGS_gcc= +LINK_FLAGS= +LINK_FLAGS_cc= +LINK_FLAGS_gcc= +ARFLAGS= + + + + +PURIFIER_FLAGS= -user-path=$(shell echo "$(patsubst %,lib%/src,$(LIB_LIST)) imrd/src" | sed 's/ /\:/g') + +ifdef PURIFY + PRELINK=echo -e '$(ECHO_HEAD)Purifing $@... '; \ + export CC="$(PURIFIER) $(PURIFIER_FLAGS) $(CC)"; +endif + + + +ifeq ($(ORACLE_SUPPORT),1) + INCLUDE+= -I$(ORACLE_HOME)/precomp/public + LIB+= -L$(ORACLE_HOME)/lib -lclntsh + M4_FLAGS+= -DORACLE_SUPPORT + MAKEDEP_FLAGS+= -DORACLE_SUPPORT + PROC_FLAGS+= DEFINE=ORACLE_SUPPORT + CPPFLAGS+= -DORACLE_SUPPORT + CFLAGS+= -DORACLE_SUPPORT +endif + +ifeq ($(TUX_SUPPORT),1) + INCLUDE+= -I$(TUXDIR)/include + LIB+= -L$(TUXDIR)/lib -lfml -lfml32 -ltux + M4_FLAGS+= -DTUX_SUPPORT + MAKEDEP_FLAGS+= -DTUX_SUPPORT + PROC_FLAGS+= DEFINE=TUX_SUPPORT + CPPFLAGS+= -DTUX_SUPPORT + CFLAGS+= -DTUX_SUPPORT +endif + +ifeq ($(MQS_SUPPORT),1) + INCLUDE+= -I$(MQM_HOME)/inc + LIB+= -L$(MQM_HOME)/lib64 -lmqic + M4_FLAGS+= -DMQS_SUPPORT + MAKEDEP_FLAGS+= -DMQS_SUPPORT + PROC_FLAGS+= DEFINE=MQS_SUPPORT + CPPFLAGS+= -DMQS_SUPPORT + CFLAGS+= -DMQS_SUPPORT +endif + + + +# OS Dependant Flags + +ifeq ($(OS),HP-UX) + SHLIB_SUFFIX= .sl + M4_FLAGS:= -B100000 -S100000 $(M4_FLAGS) + MAKEDEP_FLAGS+= -z -D _HPUX_SOURCE -D __hpux + PROC_FLAGS+= DEFINE=_PA_RISC2_0 + CPPFLAGS+= -D _HPUX_SOURCE -D __hpux + CFLAGS+= -D _HPUX_SOURCE -D __hpux + LDFLAGS+= -b + LDFLAGS+= + + ifeq ($(ARCH),32BITS) + MAKEDEP_FLAGS+= + CPPFLAGS_cc+= +DD32 + CPPFLAGS_gcc+= + CFLAGS_cc+= +DD32 + CFLAGS_gcc+= + TXBLD_FLAGS_cc+= +DD32 + TXBLD_FLAGS_gcc+= + LINK_FLAGS_cc+= +DD32 + LINK_FLAGS_gcc+= + LDFLAGS_cc+= + LDFLAGS_gcc+= + endif + + ifeq ($(ARCH),64BITS) + MAKEDEP_FLAGS+= -D__LP64__ + CPPFLAGS_cc+= +DD64 + CPPFLAGS_gcc+= + CFLAGS_cc+= +DD64 + CFLAGS_gcc+= + TXBLD_FLAGS_cc+= +DD64 + TXBLD_FLAGS_gcc+= + LINK_FLAGS_cc+= +DD64 + LINK_FLAGS_gcc+= + LDFLAGS_cc+= + LDFLAGS_gcc+= + endif +else + SHLIB_SUFFIX= .so + M4_FLAGS+= + MAKEDEP_FLAGS+= + PROC_FLAGS+= + CPPFLAGS+= + CFLAGS+= + LDFLAGS+= -shared +endif + + + +# Compiler Dependant Flags + +INCLUDE+= -I. \ + $(patsubst %,-I../../lib%/include,$(LIB_LIST)) \ + -I$(GLOBAL_INC_DIR) \ + $(shell for inc in $(EXTRA_INC); \ + do \ + echo "-I$$inc "; \ + done) + + + +ifeq ($(SQLCHECK),FULL) +PROC_FLAGS+= USERID=$(USR_IMRMGR)/$(PWD_IMRMGR) +endif + +PROC_FLAGS+= SQLCHECK=$(SQLCHECK) \ + RELEASE_CURSOR=NO \ + HOLD_CURSOR=YES \ + MAXOPENCURSOR=100 \ + DBMS=V7 \ + MODE=ORACLE \ + CODE=ANSI_C \ + $(patsubst -I%,INCLUDE=%,$(INCLUDE)) + + + + +CPPFLAGS_cc+= -P -C -Ae -w +CPPFLAGS_gcc+= -E -C + +CFLAGS_cc+= -c -Ae +z +CFLAGS_gcc+= -c -fpic -pipe + +TXBLD_FLAGS_cc+= -Wl,+s,-Bimmediate +TXBLD_FLAGS_gcc+= + +LDFLAGS_cc+= +LDFLAGS_gcc+= + +LINK_FLAGS_cc+= +LINK_FLAGS_gcc+= + + + +ifdef DEBUG + CFLAGS_cc+= -g + CFLAGS_gcc+= -g + TXBLD_FLAGS_cc+= -g + TXBLD_FLAGS_gcc+= -g + LDFLAGS_cc+= + LDFLAGS_gcc+= + LINK_FLAGS_cc+= -g + LINK_FLAGS_gcc+= -g +endif + +ifdef OPTIMIZE + CFLAGS_cc+= -O + CFLAGS_gcc+= -O3 + TXBLD_FLAGS_cc+= -O + TXBLD_FLAGS_gcc+= -O3 + LDFLAGS_cc+= + LDFLAGS_gcc+= -O3 + LINK_FLAGS_cc+= -O + LINK_FLAGS_gcc+= -Wl,-O3 +endif + +ifdef PROFILE + CFLAGS_cc+= -pg + CFLAGS_gcc+= -pg + TXBLD_FLAGS_cc+= -pg + TXBLD_FLAGS_gcc+= -pg +endif + + + +ifdef WARNING + CFLAGS_cc+=+w1 +M2 + CFLAGS_gcc+=-Wformat -Wnonnull -Wimplicit -Wmain -Wmissing-braces \ + -Wparentheses -Wsequence-point -Wreturn-type -Wswitch \ + -Wswitch-default -Wswitch-enum -Wtrigraphs -Wunused \ + -Wuninitialized -Wunknown-pragmas -Wstrict-aliasing -W \ + -Wfloat-equal -Wundef -Wendif-labels -Wshadow \ + -Wpointer-arith -Wbad-function-cast -Wcast-qual \ + -Wcast-align -Wwrite-strings -Wconversion \ + -Wsign-compare -Waggregate-return -Wstrict-prototypes \ + -Wmissing-prototypes -Wmissing-declarations \ + -Wmissing-noreturn -Wmissing-format-attribute -Wpacked \ + -Wredundant-decls -Wnested-externs -Wunreachable-code \ + -Winline -Wlong-long -Wdisabled-optimization + TXBLD_FLAGS_cc+=+w1 +M2 + TXBLD_FLAGS_gcc+=-Wformat -Wnonnull -Wimplicit -Wmain -Wmissing-braces \ + -Wparentheses -Wsequence-point -Wreturn-type -Wswitch \ + -Wswitch-default -Wswitch-enum -Wtrigraphs -Wunused \ + -Wuninitialized -Wunknown-pragmas -Wstrict-aliasing -W \ + -Wfloat-equal -Wundef -Wendif-labels -Wshadow \ + -Wpointer-arith -Wbad-function-cast -Wcast-qual \ + -Wcast-align -Wwrite-strings -Wconversion \ + -Wsign-compare -Waggregate-return -Wstrict-prototypes \ + -Wmissing-prototypes -Wmissing-declarations \ + -Wmissing-noreturn -Wmissing-format-attribute -Wpacked \ + -Wredundant-decls -Wnested-externs -Wunreachable-code \ + -Winline -Wlong-long -Wdisabled-optimization +endif + + + +ifdef EFENCE +else + ifdef DMALLOC + CFLAGS+= -DDMALLOC + endif +endif + + + +ifdef STATIC + ifeq ($(CC),cc) + LIB+= -Wl,-a,archive_shared + + ifeq ($(ARCH),64BITS) + LIB+= -Wl,+forceload + else + LIB+= -Wl,-E + endif + else + LIB+= -Wl,-export-dynamic,-whole-archive,-Bstatic + endif +endif + +LIB+= -L$(GLOBAL_LIB_DIR) \ + $(patsubst %,-l%,$(LIB_LIST)) + +ifdef STATIC + ifeq ($(CC),cc) + ifeq ($(ARCH),64BITS) + LIB+= -Wl,+noforceload + endif + + LIB+= -Wl,-a,shared_archive + else + LIB+= -Wl,-no-whole-archive,-Bdynamic + endif +endif + +ifdef EFENCE + LIB+= -lefence -lrt +else + ifdef DMALLOC + LIB+= -ldmalloc + endif +endif + +LIB_cc+= -lnsl -lm -lpthread + +LIB_gcc+= -lpthread -lm -ldl + + + +TXBLD_LIB= -f "$(LIB) -ltmib" + + + +TXSERVICE_NAME= $(shell if [ -f $(TARGET).c ]; \ + then \ + grep TXSERVICE_NAME $(TARGET).c | \ + sed "s/.*: //"; \ + fi) +TXSERVICE_TYPE= $(shell if [ -f $(TARGET).c ]; \ + then \ + grep TXSERVICE_TYPE $(TARGET).c | \ + sed "s/.*: //"; \ + fi) + + + +PXDBFLAGS= -s on $(EXTRA_PXDBFLAGS) + + + +LINTFLAGS= $(EXTRA_LINTFLAGS) + +LINTLIBS= $(GLOBAL_LIB_DIR)/*.ln + + + +# Flags Merging + +MAKEDEP_FLAGS+= $(INCLUDE) -f- $(EXTRA_MAKEDEP_FLAGS) +PROC_FLAGS+= $(EXTRA_PROC_FLAGS) +CPPFLAGS+= $(CPPFLAGS_$(CPP)) $(EXTRA_CPPFLAGS) +CFLAGS+= $(CFLAGS_$(CC)) $(EXTRA_CFLAGS) +LINK_FLAGS+= $(LINK_FLAGS_$(CC)) $(EXTRA_LINK_FLAGS) +LDFLAGS+= $(LDFLAGS_$(CC)) $(EXTRA_LDFLAGS) +LIB+= $(LIB_$(CC)) $(EXTRA_LIB) +ARFLAGS+= -cr $(EXTRA_ARFLAGS) +TXBLD_FLAGS+= -f "$(TXBLD_FLAGS_$(CC))" -r $(ORACLE_RM) $(EXTRA_TXBLD_FLAGS) + + + +ifeq ($(CC),gcc) + TXBLDSRV:=CC=cc.gcc; $(TXBLDSRV) + TXBLDCLN:=CC=cc.gcc; $(TXBLDCLN) +endif diff --git a/src/imrc/src/Makefile b/src/imrc/src/Makefile new file mode 100644 index 0000000..4c685d0 --- /dev/null +++ b/src/imrc/src/Makefile @@ -0,0 +1,59 @@ +#------------------------------------------------------------------------------ +# Local Makefile +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# IMR - Interlinking Message Router +# Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) +# mailto:arnaud@rx3.net +# http://www.rx3.org/dvp/?dvp=imr +#------------------------------------------------------------------------------ +# This file is part of IMR +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +#------------------------------------------------------------------------------ + + + +#------------------------------------------------------------------------------ +# Constants +#------------------------------------------------------------------------------ + +MAKEFILE_GLOB= ../../Makefile_glob.mk +MAKEFILE_PATH= ../../Makefile_path.mk + + + +#------------------------------------------------------------------------------ +# Variables +#------------------------------------------------------------------------------ + +TARGET= lib_xxx.sl + +OBJ= module1.o \ + module2.o \ + lib_xxx.o + +EXTRA_INC= ../zzz + +EXTRA_LIB= -lzzz + + + +#------------------------------------------------------------------------------ +# Include +#------------------------------------------------------------------------------ + +include $(MAKEFILE_GLOB) diff --git a/src/imrd/src/Makefile b/src/imrd/src/Makefile new file mode 100644 index 0000000..193f269 --- /dev/null +++ b/src/imrd/src/Makefile @@ -0,0 +1,65 @@ +#------------------------------------------------------------------------------ +# Local Makefile +#------------------------------------------------------------------------------ +# $Workfile: Makefile $ +#------------------------------------------------------------------------------ +# $Author: agibert $ +# $Date: 2008/11/12 02:25:22 $ +# $Revision: 1.1 $ +# $Label: $ +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# IMR - Interlinking Message Router +# Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) +# mailto:arnaud@rx3.net +# http://www.rx3.org/dvp/?dvp=imr +#------------------------------------------------------------------------------ +# This file is part of IMR +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# Var include +#------------------------------------------------------------------------------ + +include ../../Makefile_var.mk + + + +#------------------------------------------------------------------------------ +# Variables +#------------------------------------------------------------------------------ + +TARGET= imrd + +OBJ= imrd.o + +EXTRA_INC= + +EXTRA_LIB= + + + +#------------------------------------------------------------------------------ +# Rule include +#------------------------------------------------------------------------------ + +include ../../Makefile_rule.mk diff --git a/src/imrd/src/imrd.c b/src/imrd/src/imrd.c new file mode 100644 index 0000000..30a2a32 --- /dev/null +++ b/src/imrd/src/imrd.c @@ -0,0 +1,1140 @@ +/*----------------------------------------------------------------------------*/ +/* $Workfile: imrd.c $ */ +/*----------------------------------------------------------------------------*/ +/* $Author: agibert $ */ +/* $Date: 2008/11/12 02:25:22 $ */ +/* $Revision: 1.1 $ */ +/* $Label: $ */ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#define _IMRD_C_ + +#include "imrd.h" + + + + + + + +/*----------------------------------------------------------------------------*/ +/* Config_Init */ +/*----------------------------------------------------------------------------*/ +/* Config_Ptr: Config structure to initialize */ +/* ArgC: Argument number */ +/* ArgV: Argument tab */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status Config_Init( IMRT_Config *Config_Ptr, int ArgC, char **ArgV) +{ + struct stat stat_buf; + IMRT_Module_Id module_id; + + + /* LM Init */ + + strcpy( Config_Ptr->LM.Log_File, "-"); + + Config_Ptr->LM.Module_Nb = IMRD_MODULE_NB; + + for( module_id = 0; module_id < IMRD_MODULE_NB; module_id++) + { + if( module_id == IMRD_MODULE_ID_UNKNOWN) + { + Config_Ptr->LM.Level_Tab[ IMRD_LOG_TYPE_ID_TRACE][ module_id] = IMRD_LOG_LEVEL_UNSET; + + Config_Ptr->LM.Level_Tab[ IMRD_LOG_TYPE_ID_TRACE][ module_id] = IMRD_LOG_LEVEL_UNSET; + Config_Ptr->LM.Level_Tab[ IMRD_LOG_TYPE_ID_INFO][ module_id] = IMRD_LOG_LEVEL_DEFAULT; + Config_Ptr->LM.Level_Tab[ IMRD_LOG_TYPE_ID_WARNING][ module_id] = IMRD_LOG_LEVEL_DEFAULT; + Config_Ptr->LM.Level_Tab[ IMRD_LOG_TYPE_ID_ERROR][ module_id] = IMRD_LOG_LEVEL_DEFAULT; + } + else + { + Config_Ptr->LM.Level_Tab[ IMRD_LOG_TYPE_ID_TRACE][ module_id] = IMRD_LOG_LEVEL_UNSET; + Config_Ptr->LM.Level_Tab[ IMRD_LOG_TYPE_ID_INFO][ module_id] = IMRD_LOG_LEVEL_UNSET; + Config_Ptr->LM.Level_Tab[ IMRD_LOG_TYPE_ID_WARNING][ module_id] = IMRD_LOG_LEVEL_UNSET; + Config_Ptr->LM.Level_Tab[ IMRD_LOG_TYPE_ID_ERROR][ module_id] = IMRD_LOG_LEVEL_UNSET; + } + } + + + + /* SDM Init */ + + Config_Ptr->SDM.Flag = IMRD_SDM_FLAG_XML; + + strncpy( Config_Ptr->SDM.Lib_Path, dirname( ArgV[0]), IMRD_PATH_LEN); + strncat( Config_Ptr->SDM.Lib_Path, "/../lib/imr", IMRD_PATH_LEN); + + if( ( stat( Config_Ptr->SDM.Lib_Path, &stat_buf) == -1) || ( ! S_ISDIR( stat_buf.st_mode))) + { + strcpy( Config_Ptr->SDM.Lib_Path, "."); + } + + + + /* MM Init */ + + Config_Ptr->MM.XML_Format = IMRD_FALSE; + + + + /* MR Init */ + + Config_Ptr->MR.Mapping_Forced = IMRD_FALSE; + Config_Ptr->MR.Continue_Forced = IMRD_FALSE; + Config_Ptr->MR.Read_Mode = IMRD_READ_MODE_WAIT; + Config_Ptr->MR.Log_Id_Struct_Input.Bit_Nb = 0; + Config_Ptr->MR.Log_Id_Struct_Input.Log_Size = 0; + Config_Ptr->MR.Log_Id_Struct_Input.Log_Id_Bit_Ptr = NULL; + Config_Ptr->MR.Log_Id_Struct_Output.Bit_Nb = 0; + Config_Ptr->MR.Log_Id_Struct_Output.Log_Size = 0; + Config_Ptr->MR.Log_Id_Struct_Output.Log_Id_Bit_Ptr = NULL; + + + + /* IMRD Init */ + + strcpy( Config_Ptr->IMRD.Medium_URL_Input, "file://\\nMSG_BREAK\\n@in.txt"); + strcpy( Config_Ptr->IMRD.Appl_Name_Input, "bo_raw"); + Config_Ptr->IMRD.Appl_Id_Input = IMRD_APPL_ID_UNDEFINEDED; + + strcpy( Config_Ptr->IMRD.Medium_URL_Output, "file://\\nMSG_BREAK\\n@out.txt"); + strcpy( Config_Ptr->IMRD.Appl_Name_Output, "cristal_raw"); + Config_Ptr->IMRD.Appl_Id_Output = IMRD_APPL_ID_UNDEFINEDED; + + strcpy( Config_Ptr->IMRD.Medium_URL_Trash, "file://\\nMSG_BREAK\\n@trash.txt"); + + Config_Ptr->IMRD.Version_Mode = IMRD_FALSE; + Config_Ptr->IMRD.Help_Mode = IMRD_FALSE; + Config_Ptr->IMRD.Dump_Mode = IMRD_SDM_FLAG_UNKNOWN; + Config_Ptr->IMRD.Core_Dump = IMRD_FALSE; + + + + return( IMRS_OK); +} + + + + + +/*----------------------------------------------------------------------------*/ +/* Config_Deinit */ +/*----------------------------------------------------------------------------*/ +/* Config_Ptr: Config structure to deinitialize */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status Config_Deinit( IMRT_Config *Config_Ptr) +{ + if( Config_Ptr->MR.Log_Id_Struct_Input.Log_Id_Bit_Ptr != NULL) + { + free( Config_Ptr->MR.Log_Id_Struct_Input.Log_Id_Bit_Ptr); + } + + if( Config_Ptr->MR.Log_Id_Struct_Output.Log_Id_Bit_Ptr) + { + free( Config_Ptr->MR.Log_Id_Struct_Output.Log_Id_Bit_Ptr); + } + + return( IMRS_OK); +} + + + + + +/*----------------------------------------------------------------------------*/ +/* Args_Parse */ +/*----------------------------------------------------------------------------*/ +/* Config_Ptr: Configuration structure to update */ +/* ArgC: Argument number */ +/* ArgV: Argument tab */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status Args_Parse( IMRT_Config *Config_Ptr, int ArgC, char **ArgV) +{ + int arg_cur, i, j; + char value_tmp[ IMRD_ARG_NAME_SIZE]; + IMRT_Module_Id module_id; + + + for( arg_cur = 1; arg_cur < ArgC; arg_cur++) + { + for( i = 0; + ( i < IMRD_ARG_NB) && ( strcmp( IMRG_Arg_Tab[i].Name_Short, ArgV[arg_cur]) != 0) && ( strcmp( IMRG_Arg_Tab[i].Name_Long, ArgV[arg_cur]) != 0); + i++); + + + + if( ( i > 0) && ( i < IMRD_ARG_NB)) + { + + switch( i) + { + case IMRD_ARG_VERSION: + { + Config_Ptr->IMRD.Version_Mode = IMRD_TRUE; + + break; + } + + case IMRD_ARG_HELP: + { + Config_Ptr->IMRD.Help_Mode = IMRD_TRUE; + + break; + } + + case IMRD_ARG_VERBOSE_LEVEL_DEFAULT: + { + if( ( arg_cur + 1) < ArgC) + { + strncpy( value_tmp, ArgV[ ++arg_cur], IMRD_ARG_NAME_LEN); + + Config_Ptr->LM.Level_Tab[ IMRD_LOG_TYPE_ID_TRACE][ IMRD_MODULE_ID_UNKNOWN] = atoi( value_tmp); + } + else + { + IMRD_LM_LOG_ERROR_1( "Missing argument value [%s] !", IMRG_Arg_Tab[ i].Name_Short); + + return( IMRS_KO); + } + + break; + } + + case IMRD_ARG_VERBOSE_LEVEL_MODULE: + { + if( ( arg_cur + 2) < ArgC ) + { + strncpy( value_tmp, ArgV[ ++arg_cur], IMRD_ARG_NAME_LEN); + j = atoi( value_tmp); + + strncpy( value_tmp, ArgV[ ++arg_cur], IMRD_ARG_NAME_LEN); + + for( module_id = 1; + ( module_id < IMRD_MODULE_NB) && ( strcmp( value_tmp, IMRG_IMRD_Base.Module_Entry_Tab[ module_id].Module_Ptr->Name) != 0); + module_id++); + + if( module_id == IMRD_MODULE_NB) + { + IMRD_LM_LOG_ERROR_1( "Module not found [%s] !", value_tmp); + + return( IMRS_KO); + } + + Config_Ptr->LM.Level_Tab[ IMRD_LOG_TYPE_ID_TRACE][ module_id] = j; + } + else + { + IMRD_LM_LOG_ERROR_1( "Missing argument value [%s] !", IMRG_Arg_Tab[ i].Name_Short); + + return( IMRS_KO); + } + + break; + } + + case IMRD_ARG_LOG_FILE: + { + if( ( arg_cur + 1) < ArgC) + { + strncpy( ( char *) Config_Ptr->LM.Log_File, ArgV[ ++arg_cur], IMRD_PATH_LEN); + } + else + { + IMRD_LM_LOG_ERROR_1( "Missing argument value [%s] !", IMRG_Arg_Tab[ i].Name_Short); + + return( IMRS_KO); + } + + break; + } + + case IMRD_ARG_SD_READ_XML: + { + Config_Ptr->SDM.Flag = IMRD_SDM_FLAG_XML; + + break; + } + + case IMRD_ARG_SD_READ_SQL: + { + Config_Ptr->SDM.Flag = IMRD_SDM_FLAG_SQL; + + break; + } + + case IMRD_ARG_SD_WRITE_XML: + { + Config_Ptr->IMRD.Dump_Mode = IMRD_SDM_FLAG_XML; + + break; + } + + case IMRD_ARG_SD_WRITE_SQL: + { + Config_Ptr->IMRD.Dump_Mode = IMRD_SDM_FLAG_SQL; + + break; + } + + case IMRD_ARG_LIBRARY_DIR: + { + if( ( arg_cur + 1) < ArgC) + { + strncpy( ( char *) Config_Ptr->SDM.Lib_Path, ArgV[ ++arg_cur], IMRD_PATH_LEN); + } + else + { + IMRD_LM_LOG_ERROR_1( "Missing argument value [%s] !", IMRG_Arg_Tab[ i].Name_Short); + + return( IMRS_KO); + } + + break; + } + + case IMRD_ARG_MEDIUM_URL_INPUT: + { + if( ( arg_cur + 1) < ArgC) + { + strncpy( ( char *) Config_Ptr->IMRD.Medium_URL_Input, ArgV[ ++arg_cur], IMRD_MEDIUM_URL_LEN); + } + else + { + IMRD_LM_LOG_ERROR_1( "Missing argument value [%s] !", IMRG_Arg_Tab[ i].Name_Short); + + return( IMRS_KO); + } + + break; + } + + case IMRD_ARG_APPL_NAME_INPUT: + { + if( ( arg_cur + 1) < ArgC) + { + strncpy( ( char *) Config_Ptr->IMRD.Appl_Name_Input, ArgV[ ++arg_cur], IMRD_APPL_NAME_LEN); + } + else + { + IMRD_LM_LOG_ERROR_1( "Missing argument value [%s] !", IMRG_Arg_Tab[i].Name_Short); + + return( IMRS_KO); + } + + break; + } + + case IMRD_ARG_APPL_ID_INPUT: + { + if( ( arg_cur + 1) < ArgC) + { + strncpy( value_tmp, ArgV[++arg_cur], IMRD_ARG_NAME_LEN); + + Config_Ptr->IMRD.Appl_Id_Input = atoi( value_tmp); + Config_Ptr->IMRD.Appl_Name_Input[0] = '\0'; + } + else + { + IMRD_LM_LOG_ERROR_1( "Missing argument value [%s] !", IMRG_Arg_Tab[i].Name_Short); + + return( IMRS_KO); + } + + break; + } + + case IMRD_ARG_MEDIUM_URL_OUTPUT: + { + if( ( arg_cur + 1) < ArgC) + { + strncpy( ( char *) Config_Ptr->IMRD.Medium_URL_Output, ArgV[ ++arg_cur], IMRD_MEDIUM_URL_LEN); + } + else + { + IMRD_LM_LOG_ERROR_1( "Missing argument value [%s] !", IMRG_Arg_Tab[ i].Name_Short); + + return( IMRS_KO); + } + + break; + } + + case IMRD_ARG_APPL_NAME_OUTPUT: + { + if( ( arg_cur + 1) < ArgC) + { + strncpy( ( char *) Config_Ptr->IMRD.Appl_Name_Output, ArgV[ ++arg_cur], IMRD_APPL_NAME_LEN); + } + else + { + IMRD_LM_LOG_ERROR_1( "Missing argument value [%s] !", IMRG_Arg_Tab[i].Name_Short); + + return( IMRS_KO); + } + + break; + } + + case IMRD_ARG_APPL_ID_OUTPUT: + { + if( ( arg_cur + 1) < ArgC) + { + strncpy( value_tmp, ArgV[ ++arg_cur], IMRD_ARG_NAME_LEN); + + Config_Ptr->IMRD.Appl_Id_Output = atoi( value_tmp); + Config_Ptr->IMRD.Appl_Name_Output[0] = '\0'; + } + else + { + IMRD_LM_LOG_ERROR_1( "Missing argument value [%s] !", IMRG_Arg_Tab[i].Name_Short); + + return( IMRS_KO); + } + + break; + } + + case IMRD_ARG_MEDIUM_URL_TRASH: + { + if( ( arg_cur + 1) < ArgC) + { + strncpy( ( char *) Config_Ptr->IMRD.Medium_URL_Trash, ArgV[ ++arg_cur], IMRD_MEDIUM_URL_LEN); + } + else + { + IMRD_LM_LOG_ERROR_1( "Missing argument value [%s] !", IMRG_Arg_Tab[ i].Name_Short); + + return( IMRS_KO); + } + + break; + } + + case IMRD_ARG_MAPPING_FORCED: + { + Config_Ptr->MR.Mapping_Forced = IMRD_TRUE; + + break; + } + + case IMRD_ARG_CONTINUE_FORCED: + { + Config_Ptr->MR.Continue_Forced = IMRD_TRUE; + + break; + } + + case IMRD_ARG_NO_WAIT: + { + Config_Ptr->MR.Read_Mode = IMRD_READ_MODE_NO_WAIT; + + break; + } + + case IMRD_ARG_XML_FORMAT: + { + Config_Ptr->MM.XML_Format = IMRD_TRUE; + + break; + } + + case IMRD_ARG_CORE_DUMP: + { + Config_Ptr->IMRD.Core_Dump = IMRD_TRUE; + + break; + } + + case IMRD_ARG_LOG_ID_INPUT_MSG : + { + if( ( arg_cur + 2) < ArgC) + { + if( atoi( ArgV[ arg_cur + 1]) < 0) + { + IMRD_LM_LOG_ERROR_1( "Invalid Log_Id_Offset: [%s] !", ArgV[ arg_cur + 1]); + + return( IMRS_KO); + } + + if( atoi( ArgV[ arg_cur + 2]) <= 0) + { + IMRD_LM_LOG_ERROR_1( "Invalid Log_Id_Size: [%d] !", ArgV[ arg_cur + 2]); + + return( IMRS_KO); + } + + if( ( Config_Ptr->MR.Log_Id_Struct_Input.Log_Id_Bit_Ptr = + realloc( Config_Ptr->MR.Log_Id_Struct_Input.Log_Id_Bit_Ptr, + ( ( Config_Ptr->MR.Log_Id_Struct_Input.Bit_Nb + 1)) * sizeof( IMRT_Log_Id_Bit))) == NULL) + { + IMRD_LM_LOG_ERROR_1( "Can't allocate Input Log_Id_Bit_Ptr (%d) !", errno); + + return( IMRS_KO); + } + + Config_Ptr->MR.Log_Id_Struct_Input.Log_Id_Bit_Ptr[ Config_Ptr->MR.Log_Id_Struct_Input.Bit_Nb].Offset = atoi( ArgV[ ++arg_cur]); + Config_Ptr->MR.Log_Id_Struct_Input.Log_Id_Bit_Ptr[ Config_Ptr->MR.Log_Id_Struct_Input.Bit_Nb].Size = atoi( ArgV[ ++arg_cur]); + Config_Ptr->MR.Log_Id_Struct_Input.Log_Size += atoi( ArgV[ arg_cur]); + Config_Ptr->MR.Log_Id_Struct_Input.Bit_Nb++; + } + else + { + IMRD_LM_LOG_ERROR_1( "Missing argument value [%s] !", IMRG_Arg_Tab[ i].Name_Short); + return( IMRS_KO); + } + + break; + } + + case IMRD_ARG_LOG_ID_OUTPUT_MSG : + { + if( ( arg_cur + 2) < ArgC) + { + if( atoi( ArgV[ arg_cur + 1]) < 0) + { + IMRD_LM_LOG_ERROR_1( "Invalid Log_Id_Offset: [%s] !", ArgV[ arg_cur + 1]); + + return( IMRS_KO); + } + + if( atoi( ArgV[ arg_cur + 2]) <= 0) + { + IMRD_LM_LOG_ERROR_1( "Invalid Log_Id_Size: [%d] !", ArgV[ arg_cur + 2]); + + return( IMRS_KO); + } + + if( ( Config_Ptr->MR.Log_Id_Struct_Output.Log_Id_Bit_Ptr = + realloc( Config_Ptr->MR.Log_Id_Struct_Output.Log_Id_Bit_Ptr, + ( ( Config_Ptr->MR.Log_Id_Struct_Output.Bit_Nb + 1)) * sizeof( IMRT_Log_Id_Bit))) == NULL) + { + IMRD_LM_LOG_ERROR_1( "Can't allocate Output Log_Id_Bit_Ptr (%d) !", errno); + + return( IMRS_KO); + } + + Config_Ptr->MR.Log_Id_Struct_Output.Log_Id_Bit_Ptr[ Config_Ptr->MR.Log_Id_Struct_Output.Bit_Nb].Offset = atoi( ArgV[ ++arg_cur]); + Config_Ptr->MR.Log_Id_Struct_Output.Log_Id_Bit_Ptr[ Config_Ptr->MR.Log_Id_Struct_Output.Bit_Nb].Size = atoi( ArgV[ ++arg_cur]); + Config_Ptr->MR.Log_Id_Struct_Output.Log_Size += atoi( ArgV[ arg_cur]); + Config_Ptr->MR.Log_Id_Struct_Output.Bit_Nb++; + } + else + { + IMRD_LM_LOG_ERROR_1( "Missing argument value [%s] !", IMRG_Arg_Tab[ i].Name_Short); + return( IMRS_KO); + } + + break; + } + + + default: + { + IMRD_LM_LOG_ERROR_1( "Internal parse error [%d] !", i); + + return( IMRS_KO); + } + } + } + else + { + IMRD_LM_LOG_ERROR_1( "Unreconized argument: (%s) !", ArgV[arg_cur]); + + return( IMRS_KO); + } + } + + return( IMRS_OK); +} + + + + + +/*----------------------------------------------------------------------------*/ +/* Args_Log */ +/*----------------------------------------------------------------------------*/ +/* Config_Ptr: Configuration structure to dump */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status Args_Log( IMRT_Config *Config_Ptr) +{ + IMRT_Module_Id module_id; + int idx; + + + IMRD_LM_LOG_INFO_3( "Lib_Dir: [%s] Static_Data_Read: [%s] Static_Data_Write: [%s]", + Config_Ptr->SDM.Lib_Path, + ( ( Config_Ptr->SDM.Flag == IMRD_SDM_FLAG_XML) ? "XML" : ( ( Config_Ptr->SDM.Flag == IMRD_SDM_FLAG_SQL) ? "SQL" : "Unknown")), + ( ( Config_Ptr->IMRD.Dump_Mode == IMRD_SDM_FLAG_XML) ? "XML" : ( ( Config_Ptr->IMRD.Dump_Mode == IMRD_SDM_FLAG_SQL) ? "SQL" : "Unknown"))); + IMRD_LM_LOG_INFO_3( "Mapping_Forced: [%s] Continue_Forced: [%s] Read_Mode: [%s]", + ( ( Config_Ptr->MR.Mapping_Forced == IMRD_TRUE) ? "True" : "False"), + ( ( Config_Ptr->MR.Continue_Forced == IMRD_TRUE) ? "True" : "False"), + ( ( Config_Ptr->MR.Read_Mode == IMRD_READ_MODE_WAIT) ? "Wait" : ( ( Config_Ptr->MR.Read_Mode == IMRD_READ_MODE_NO_WAIT) ? "No Wait" : "Unknown"))); + IMRD_LM_LOG_INFO_2( "XML_Format: [%s] Core_Dump: [%s]", ( ( Config_Ptr->MM.XML_Format == IMRD_TRUE) ? "True" : "False"), ( ( Config_Ptr->IMRD.Core_Dump == IMRD_TRUE) ? "True" : "False")); + IMRD_LM_LOG_INFO_1( "Medium_URL_Input: [%s]", Config_Ptr->IMRD.Medium_URL_Input); + IMRD_LM_LOG_INFO_1( "Medium_URL_Output: [%s]", Config_Ptr->IMRD.Medium_URL_Output); + IMRD_LM_LOG_INFO_1( "Medium_URL_Trash: [%s]", Config_Ptr->IMRD.Medium_URL_Trash); + IMRD_LM_LOG_INFO_0( "Log Level Tab: Module Id Trace Info Warning Error"); + + for( module_id = 0; module_id < IMRD_MODULE_NB; module_id++) + { + IMRD_LM_LOG_INFO_5( "Log Level tab: [%-34s]: (%3d) (%3d) (%3d) (%3d)", + ( ( IMRG_IMRD_Base.Module_Entry_Tab[ module_id].Module_Ptr == NULL) ? "Default" : IMRG_IMRD_Base.Module_Entry_Tab[ module_id].Module_Ptr->Name_Long), + Config_Ptr->LM.Level_Tab[ IMRD_LOG_TYPE_ID_TRACE][ module_id], + Config_Ptr->LM.Level_Tab[ IMRD_LOG_TYPE_ID_INFO][ module_id], + Config_Ptr->LM.Level_Tab[ IMRD_LOG_TYPE_ID_WARNING][ module_id], + Config_Ptr->LM.Level_Tab[ IMRD_LOG_TYPE_ID_ERROR][ module_id]); + } + + for( idx = 0 ; idx < Config_Ptr->MR.Log_Id_Struct_Input.Bit_Nb; idx++) + { + IMRD_LM_LOG_INFO_2( "Log_Id_Bit_Input: Offset: (%5d) Size: (%5d)", + Config_Ptr->MR.Log_Id_Struct_Input.Log_Id_Bit_Ptr[ idx].Offset, + Config_Ptr->MR.Log_Id_Struct_Input.Log_Id_Bit_Ptr[ idx].Size); + } + + for( idx = 0 ; idx < Config_Ptr->MR.Log_Id_Struct_Output.Bit_Nb; idx++) + { + IMRD_LM_LOG_INFO_2( "Log_Id_Bit_Output: Offset: (%5d) Size: (%5d)", + Config_Ptr->MR.Log_Id_Struct_Output.Log_Id_Bit_Ptr[ idx].Offset, + Config_Ptr->MR.Log_Id_Struct_Output.Log_Id_Bit_Ptr[ idx].Size); + } + + return( IMRS_OK); +} + + + + + +/*----------------------------------------------------------------------------*/ +/* Version_Log */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status Version_Log() +{ + IMRT_Module_Id module_id; + + + for( module_id = 0; module_id < IMRD_MODULE_NB; module_id++) + { + if( IMRG_IMRD_Base.Module_Entry_Tab[ module_id].Module_Ptr != NULL) + { + IMRD_LM_LOG_INFO_2( "[%-4s]: [%s]", IMRG_IMRD_Base.Module_Entry_Tab[ module_id].Module_Ptr->Name, IMRG_IMRD_Base.Module_Entry_Tab[ module_id].Module_Ptr->Version); + } + } + + return( IMRS_OK); +} + + + + + +/*----------------------------------------------------------------------------*/ +/* Version_Print */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status Version_Print() +{ + IMRT_Module_Id module_id; + + + for( module_id = 0; module_id < IMRD_MODULE_NB; module_id++) + { + if( IMRG_IMRD_Base.Module_Entry_Tab[ module_id].Module_Ptr != NULL) + { + fprintf( stderr, "[%-4s]: [%s]\n", IMRG_IMRD_Base.Module_Entry_Tab[ module_id].Module_Ptr->Name, IMRG_IMRD_Base.Module_Entry_Tab[ module_id].Module_Ptr->Version); + } + } + + return( IMRS_OK); +} + + + + + +/*----------------------------------------------------------------------------*/ +/* Help_Print */ +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status Help_Print( void) +{ + int i; + + + for( i = 0; i < IMRD_ARG_NB; i++) + { + if( IMRG_Arg_Tab[i].Name_Short[0] != '\0') + fprintf( stderr, "%-6s%-25s%s\n", IMRG_Arg_Tab[i].Name_Short, IMRG_Arg_Tab[i].Name_Long, IMRG_Arg_Tab[i].Help); + } + + return( IMRS_OK); +} + + + + + + +/*----------------------------------------------------------------------------*/ +/* Lib_Open */ +/*----------------------------------------------------------------------------*/ +/* Module_Entry_Ptr: Module to open */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status Lib_Open( IMRT_Module_Entry *Module_Entry_Ptr) +{ + IMRT_Status status; + + + if( Module_Entry_Ptr->Module_Ptr->Lib.Open_Ptr != NULL) + { + IMRD_LM_LOG_TRACE_1( IMRD_LOG_LEVEL_VERBOSE_0, "Opening %s library...", Module_Entry_Ptr->Module_Ptr->Name_Long); + + if( ( status = Module_Entry_Ptr->Module_Ptr->Lib.Open_Ptr( Module_Entry_Ptr->Config_Ptr)) != IMRS_OK) + { + Module_Entry_Ptr->Status = IMRD_LIB_STATUS_ERROR; + + IMRD_LM_LOG_ERROR_1( "Can't open %s library !", Module_Entry_Ptr->Module_Ptr->Name_Long); + } + else + { + Module_Entry_Ptr->Status = IMRD_LIB_STATUS_OPENED; + + IMRD_LM_LOG_TRACE_1( IMRD_LOG_LEVEL_VERBOSE_0, "%s library opened !", Module_Entry_Ptr->Module_Ptr->Name_Long); + } + } + + return( status); +} + + + + + +/*----------------------------------------------------------------------------*/ +/* Libs_Open */ +/*----------------------------------------------------------------------------*/ +/* Module_Entry_Tab: Module tab */ +/* Module_Nb: Number of module */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status Libs_Open( IMRT_Module_Entry *Module_Entry_Tab, IMRT_Module_Id Module_Nb) +{ + IMRT_Status status; + IMRT_Module_Id i; + + + for( i = 0, status = IMRS_OK; ( i < Module_Nb) && ( status == IMRS_OK); i++) + { + if( ( Module_Entry_Tab[i].Module_Ptr != NULL) + && ( Module_Entry_Tab[i].Module_Ptr->Type == IMRD_MODULE_TYPE_LIBRARY) + && ( Module_Entry_Tab[i].Module_Ptr->Lib.Open_Ptr != NULL) + && ( Module_Entry_Tab[i].Status == IMRD_LIB_STATUS_CLOSED)) + { + status = Lib_Open( &( Module_Entry_Tab[i])); + } + } + + return( status); +} + + + + + +/*----------------------------------------------------------------------------*/ +/* Lib_Close */ +/*----------------------------------------------------------------------------*/ +/* Module_Entry_Ptr: Module to close */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status Lib_Close( IMRT_Module_Entry *Module_Entry_Ptr) +{ + IMRT_Status status; + + + IMRD_LM_LOG_TRACE_1( IMRD_LOG_LEVEL_VERBOSE_0, "Closinging %s library...", Module_Entry_Ptr->Module_Ptr->Name_Long); + + if( ( status = Module_Entry_Ptr->Module_Ptr->Lib.Close_Ptr()) != IMRS_OK) + { + Module_Entry_Ptr->Status = IMRD_LIB_STATUS_ERROR; + + IMRD_LM_LOG_ERROR_1( "Can't close %s library !", Module_Entry_Ptr->Module_Ptr->Name_Long); + } + else + { + Module_Entry_Ptr->Status = IMRD_LIB_STATUS_CLOSED; + + IMRD_LM_LOG_TRACE_1( IMRD_LOG_LEVEL_VERBOSE_0, "%s library closed !", Module_Entry_Ptr->Module_Ptr->Name_Long); + } + + return( status); +} + + + + + +/*----------------------------------------------------------------------------*/ +/* Libs_Close */ +/*----------------------------------------------------------------------------*/ +/* Module_Entry_Tab: Module tab */ +/* Module_Nb: Number of module */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status Libs_Close( IMRT_Module_Entry *Module_Entry_Tab, IMRT_Module_Id Module_Nb) +{ + IMRT_Status status; + IMRT_Module_Id i; + + + for( i = ( Module_Nb - 1), status = IMRS_OK; ( i > -1) && ( status == IMRS_OK); i--) + { + if( ( Module_Entry_Tab[i].Module_Ptr != NULL) && ( Module_Entry_Tab[i].Module_Ptr->Lib.Open_Ptr != NULL)) + { + if( Module_Entry_Tab[i].Status == IMRD_LIB_STATUS_OPENED) + { + status = Lib_Close( &( Module_Entry_Tab[i])); + } + else + { + IMRD_LM_LOG_TRACE_1( IMRD_LOG_LEVEL_VERBOSE_0, "%s library not opened !", Module_Entry_Tab[i].Module_Ptr->Name_Long); + } + } + } + + return( status); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Signal_Trap */ +/*------------------------------------------------------------------------------*/ + +void Signal_Trap( int Sig_Num) +{ + + fprintf( stderr, "Signal: (%d) !\n", Sig_Num); + + switch( Sig_Num) + { + case SIGBUS: + case SIGSEGV: + { + if( ( IMRG_Base.Sig_Trapped == SIGBUS) || ( IMRG_Base.Sig_Trapped == SIGSEGV)) + { + fprintf( stderr, "Imediate exit !!!\n"); + exit( -1); + } + else + { + fprintf( stderr, "Long Jumping...\n"); + IMRG_Base.Sig_Trapped = Sig_Num; + + siglongjmp( IMRG_Base.SigLongJmp_Env, 1); + } + + break; + } + + case SIGINT: + case SIGQUIT: + case SIGTERM: + default: + { + if( IMRG_Base.Sig_Trapped != 0) + { + fprintf( stderr, "Signal rejected: (%d) !\n", Sig_Num); + } + else + { + IMRG_Base.Sig_Trapped = Sig_Num; + } + + break; + } + } +} + + + + + +/*----------------------------------------------------------------------------*/ +/* Signal_Init */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status Signal_Init() +{ + int rc; + struct sigaction act = {0}; + + act.sa_handler = Signal_Trap; + + + if( ( rc = sigaction( SIGINT, &act, &( IMRG_IMRD_Base.OAct_Int))) != 0) + { + IMRD_LM_LOG_ERROR_2( "Can't trap signal (%d) errno: (%d) !", SIGINT, errno); + + return( IMRS_KO); + } + + if( ( rc = sigaction( SIGQUIT, &act, &( IMRG_IMRD_Base.OAct_Quit))) != 0) + { + IMRD_LM_LOG_ERROR_2( "Can't trap signal (%d) errno: (%d) !", SIGQUIT, errno); + + return( IMRS_KO); + } + + if( ( rc = sigaction( SIGTERM, &act, &( IMRG_IMRD_Base.OAct_Int))) != 0) + { + IMRD_LM_LOG_ERROR_2( "Can't trap signal (%d) errno: (%d) !", SIGTERM, errno); + + return( IMRS_KO); + } + + if( IMRG_IMRD_Base.Config.IMRD.Core_Dump == IMRD_FALSE) + { + if( ( rc = sigaction( SIGBUS, &act, &( IMRG_IMRD_Base.OAct_Bus))) != 0) + { + IMRD_LM_LOG_ERROR_2( "Can't trap signal (%d) errno: (%d) !", SIGBUS, errno); + + return( IMRS_KO); + } + + if( ( rc = sigaction( SIGSEGV, &act, &( IMRG_IMRD_Base.OAct_SegV))) != 0) + { + IMRD_LM_LOG_ERROR_2( "Can't trap signal (%d) errno: (%d) !", SIGSEGV, errno); + + return( IMRS_KO); + } + } + + return( IMRS_OK); +} + + + + + +/*----------------------------------------------------------------------------*/ +/* main */ +/*----------------------------------------------------------------------------*/ +/* ArgC: Argument number */ +/* ArgV: Argument tab */ +/*----------------------------------------------------------------------------*/ + +int main( int ArgC, char **ArgV) +{ + IMRT_Status status; + NDT_Status nd_status; + int exit_status; + IMRT_Config *config_ptr = &( IMRG_IMRD_Base.Config); + IMRT_Module_Id module_id; + + + if( sigsetjmp( IMRG_Base.SigLongJmp_Env, 1) != 0 ) + { + IMRD_LM_LOG_TRACE_1( IMRD_LOG_LEVEL_VERBOSE_0, "Exiting on signal (%d)...", IMRG_Base.Sig_Trapped); + + ND_Library_StdErr_Set( NULL); + exit_status = 0; + } + else + { + if( ( status = Config_Init( config_ptr, ArgC, ArgV)) != IMRS_OK) + { + IMRD_LM_LOG_ERROR_0( "Can't init config !"); + + exit( -1); + } + + if( ( status = Args_Parse( config_ptr, ArgC, ArgV)) != IMRS_OK) + { + IMRD_LM_LOG_ERROR_0( "Can't parse args !"); + + exit( -1); + } + + if( ( status = Signal_Init()) != IMRS_OK) + { + IMRD_LM_LOG_ERROR_0( "Can't init signals !"); + + exit( -1); + } + + if( config_ptr->IMRD.Version_Mode == IMRD_TRUE) + { + Version_Print(); + exit( 0); + } + + if( config_ptr->IMRD.Help_Mode == IMRD_TRUE) + { + Help_Print(); + exit( 0); + } + + if( ( status = Lib_Open( &( IMRG_IMRD_Base.Module_Entry_Tab[1]))) != IMRS_OK) + { + exit( -1); + } + + if( ( status = Version_Log()) != IMRS_OK) + { + IMRD_LM_LOG_ERROR_0( "Can't log versions !"); + + exit( -1); + } + + if( ( nd_status = ND_Library_Open( NDD_TRUE)) != NDS_OK) + { + IMRD_LM_LOG_ERROR_1( "Can't open node library (%d) !", nd_status); + + exit( -1); + } + + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_0, "Node library opened !"); + + if( ( status = Libs_Open( IMRG_IMRD_Base.Module_Entry_Tab, IMRD_MODULE_NB)) != IMRS_OK) + { + exit_status = -1; + } + else + { + if( ( status = Args_Log( config_ptr)) != IMRS_OK) + { + exit_status = -1; + } + else + { + switch( config_ptr->IMRD.Dump_Mode) + { + case IMRD_SDM_FLAG_XML: + { + if( IMR_SDM_XML_Dump() != IMRS_OK) + { + exit_status = -1; + } + else + { + exit_status = 0; + } + + break; + } + + case IMRD_SDM_FLAG_SQL: + { + if( IMR_SDM_SQL_Dump() != IMRS_OK) + { + exit_status = -1; + } + else + { + exit_status = 0; + } + + break; + } + + default: + { + if( ( config_ptr->IMRD.Appl_Id_Input == IMRD_APPL_ID_UNDEFINEDED) && ( IMR_SDM_Appl_Id_Get( &( config_ptr->IMRD.Appl_Id_Input), config_ptr->IMRD.Appl_Name_Input) != IMRS_OK)) + { + IMRD_LM_LOG_ERROR_1( "Can't get Appl_Id from [%s] !", config_ptr->IMRD.Appl_Name_Input); + + exit_status = -1; + } + else + { + if( ( config_ptr->IMRD.Appl_Id_Output == IMRD_APPL_ID_UNDEFINEDED) && ( IMR_SDM_Appl_Id_Get( &( config_ptr->IMRD.Appl_Id_Output), config_ptr->IMRD.Appl_Name_Output) != IMRS_OK)) + { + IMRD_LM_LOG_ERROR_1( "Can't get Appl_Id from [%s] !", config_ptr->IMRD.Appl_Name_Output); + + exit_status = -1; + } + else + { + IMRD_LM_LOG_INFO_2( "Appl_Name_Input: [%s] Appl_Id_Input: (%d)", config_ptr->IMRD.Appl_Name_Input, config_ptr->IMRD.Appl_Id_Input); + IMRD_LM_LOG_INFO_2( "Appl_Name_Output: [%s] Appl_Id_Output: (%d)", config_ptr->IMRD.Appl_Name_Output, config_ptr->IMRD.Appl_Id_Output); + + if( ( status = IMR_MR_Proceed( config_ptr->IMRD.Medium_URL_Output, config_ptr->IMRD.Appl_Id_Output, config_ptr->IMRD.Medium_URL_Trash, config_ptr->IMRD.Medium_URL_Input, config_ptr->IMRD.Appl_Id_Input)) != IMRS_OK) + { + exit_status = -1; + } + else + { + exit_status = 0; + } + } + } + + break; + } + } + } + } + } + + if( ( status = Libs_Close( IMRG_IMRD_Base.Module_Entry_Tab, IMRD_MODULE_NB)) != IMRS_OK) + { + exit_status = -1; + } + + if( ( nd_status = ND_Library_Close()) != NDS_OK) + { + IMRD_LM_LOG_ERROR_1( "Can't close node library (%d)", nd_status); + + exit_status = -1; + } + else + { + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_0, "Node library closed !"); + } + + if( ( status = Config_Deinit( config_ptr)) != IMRS_OK) + { + IMRD_LM_LOG_ERROR_0( "Can't deinit config !"); + + exit_status = -1; + } + + exit( exit_status); +} diff --git a/src/imrd/src/imrd.h b/src/imrd/src/imrd.h new file mode 100644 index 0000000..837cdb4 --- /dev/null +++ b/src/imrd/src/imrd.h @@ -0,0 +1,415 @@ +/*----------------------------------------------------------------------------*/ +/* File: imrd.h */ +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#ifndef _IMRD_H_ +#define _IMRD_H_ + + + +#include + + + + + + + +/*----------------------------------------------------------------------------*/ +/* Local Return Status */ +/*----------------------------------------------------------------------------*/ + + + + + +/*----------------------------------------------------------------------------*/ +/* Module Definitions */ +/*----------------------------------------------------------------------------*/ + +#define IMRD_IMRD_MODULE_ID ( IMRT_Module_Id) 6 +#define IMRD_IMRD_MODULE_NAME ( IMRT_Module_Name) "imrd" +#define IMRD_IMRD_MODULE_NAME_LONG ( IMRT_Module_Name_Long) "Interlinking Message Router Daemon" +#define IMRD_IMRD_MODULE_VERSION ( IMRT_Module_Version) "@(#) VERSIONIMR: $Label: $ $Date: 2008/11/12 02:25:22 $ $Workfile: imrd.h $" + +#define IMRD_MODULE_PTR &IMRG_IMRD_Module + + + + + +/*----------------------------------------------------------------------------*/ +/* Local Definitions */ +/*----------------------------------------------------------------------------*/ + +typedef struct IMRT_Module_Entry +{ + IMRT_Module *Module_Ptr; + IMRT_Lib_Status Status; + IMRT_Lib_Config *Config_Ptr; +} IMRT_Module_Entry; + + + +typedef struct IMRT_IMRD_Config +{ + IMRT_Medium_URL Medium_URL_Input, Medium_URL_Output, Medium_URL_Trash; + IMRT_Appl_Name Appl_Name_Input, Appl_Name_Output; + IMRT_Appl_Id Appl_Id_Input, Appl_Id_Output; + IMRT_Boolean Version_Mode, Help_Mode; + IMRT_SDM_Flag Dump_Mode; + IMRT_Boolean Core_Dump; +} IMRT_IMRD_Config; + + + +typedef struct IMRT_Config +{ + IMRT_LM_Config LM; + IMRT_SDM_Config SDM; + IMRT_IOM_Config IOM; + IMRT_MM_Config MM; + IMRT_MR_Config MR; + IMRT_IMRD_Config IMRD; +} IMRT_Config; + + + +#define IMRD_MODULE_NB ( IMRT_Module_Id) 7 + + + +typedef struct IMRT_IMRD_Base +{ +// IMRT_Module_Nb Module_Nb; + IMRT_Module_Entry Module_Entry_Tab[ IMRD_MODULE_NB]; + IMRT_Config Config; + int Sig_Trapped; + sigjmp_buf SigLongJmp_Env; + struct sigaction OAct_Int, OAct_Quit, OAct_Term, OAct_Bus, OAct_SegV; + +} IMRT_IMRD_Base; + + + + + +/*----------------------------------------------------------------------------*/ +/* Global Variables */ +/*----------------------------------------------------------------------------*/ + +IMRT_Module IMRG_IMRD_Module = +{ + IMRD_IMRD_MODULE_ID, + IMRD_IMRD_MODULE_NAME, + IMRD_IMRD_MODULE_NAME_LONG, + IMRD_IMRD_MODULE_VERSION, + IMRD_MODULE_TYPE_OBJECT, + { + IMRD_LIB_STATUS_UNKNOWN, + NULL, + NULL + } +}; + + + +IMRT_IMRD_Base IMRG_IMRD_Base = +{ +// IMRD_LIB_NB, + { + { NULL, IMRD_LIB_STATUS_UNKNOWN, NULL}, + { &IMRG_LM_Module, IMRD_LIB_STATUS_CLOSED, (IMRT_Lib_Config *) &( IMRG_IMRD_Base.Config.LM)}, + { &IMRG_SDM_Module, IMRD_LIB_STATUS_CLOSED, (IMRT_Lib_Config *) &( IMRG_IMRD_Base.Config.SDM)}, + { &IMRG_IOM_Module, IMRD_LIB_STATUS_CLOSED, (IMRT_Lib_Config *) &( IMRG_IMRD_Base.Config.IOM)}, + { &IMRG_MM_Module, IMRD_LIB_STATUS_CLOSED, (IMRT_Lib_Config *) &( IMRG_IMRD_Base.Config.MM)}, + { &IMRG_MR_Module, IMRD_LIB_STATUS_CLOSED, (IMRT_Lib_Config *) &( IMRG_IMRD_Base.Config.MR)}, + { &IMRG_IMRD_Module, IMRD_LIB_STATUS_UNKNOWN, (IMRT_Lib_Config *) &( IMRG_IMRD_Base.Config.IMRD)} + }, + { + { "", 0, { 0 } }, + { IMRD_SDM_FLAG_UNKNOWN, ""}, + { NULL}, + { IMRD_FALSE}, + { IMRD_FALSE, IMRD_READ_MODE_WAIT}, + { "", "", "", "", "", 0, 0, IMRD_FALSE, IMRD_FALSE, IMRD_SDM_FLAG_UNKNOWN, IMRD_FALSE} + } +}; + + + +IMRT_Base IMRG_Base = +{ + 0, + {0} +}; + + + +#define IMRD_ARG_NAME_LEN ( short) 63 +#define IMRD_ARG_NAME_SIZE ( short) (IMRD_ARG_NAME_LEN + 1) + +typedef char IMRT_Arg_Name[ IMRD_ARG_NAME_SIZE]; + + + +#define IMRD_ARG_HELP_LEN ( short) 128 +#define IMRD_ARG_HELP_SIZE ( short) 128 + +typedef char IMRT_Arg_Help[ IMRD_ARG_HELP_SIZE]; + + + +typedef short IMRT_ARG_ID; + +#define IMRD_ARG_NB ( IMRT_ARG_ID) 25 + +#define IMRD_ARG_UNKNOWN ( IMRT_ARG_ID) 0 +#define IMRD_ARG_VERSION ( IMRT_ARG_ID) 1 +#define IMRD_ARG_HELP ( IMRT_ARG_ID) 2 +#define IMRD_ARG_VERBOSE_LEVEL_DEFAULT ( IMRT_ARG_ID) 3 +#define IMRD_ARG_VERBOSE_LEVEL_MODULE ( IMRT_ARG_ID) 4 +#define IMRD_ARG_LOG_FILE ( IMRT_ARG_ID) 5 +#define IMRD_ARG_SD_READ_XML ( IMRT_ARG_ID) 6 +#define IMRD_ARG_SD_READ_SQL ( IMRT_ARG_ID) 7 +#define IMRD_ARG_SD_WRITE_XML ( IMRT_ARG_ID) 8 +#define IMRD_ARG_SD_WRITE_SQL ( IMRT_ARG_ID) 9 +#define IMRD_ARG_LIBRARY_DIR ( IMRT_ARG_ID) 10 +#define IMRD_ARG_MEDIUM_URL_INPUT ( IMRT_ARG_ID) 11 +#define IMRD_ARG_MEDIUM_URL_OUTPUT ( IMRT_ARG_ID) 12 +#define IMRD_ARG_MEDIUM_URL_TRASH ( IMRT_ARG_ID) 13 +#define IMRD_ARG_APPL_NAME_INPUT ( IMRT_ARG_ID) 14 +#define IMRD_ARG_APPL_NAME_OUTPUT ( IMRT_ARG_ID) 15 +#define IMRD_ARG_APPL_ID_INPUT ( IMRT_ARG_ID) 16 +#define IMRD_ARG_APPL_ID_OUTPUT ( IMRT_ARG_ID) 17 +#define IMRD_ARG_MAPPING_FORCED ( IMRT_ARG_ID) 18 +#define IMRD_ARG_CONTINUE_FORCED ( IMRT_ARG_ID) 19 +#define IMRD_ARG_NO_WAIT ( IMRT_ARG_ID) 20 +#define IMRD_ARG_XML_FORMAT ( IMRT_ARG_ID) 21 +#define IMRD_ARG_CORE_DUMP ( IMRT_ARG_ID) 22 +#define IMRD_ARG_LOG_ID_INPUT_MSG ( IMRT_ARG_ID) 23 +#define IMRD_ARG_LOG_ID_OUTPUT_MSG ( IMRT_ARG_ID) 24 + + +typedef struct IMRT_Arg +{ + IMRT_Arg_Name Name_Short; + IMRT_Arg_Name Name_Long; + IMRT_Arg_Help Help; +} IMRT_Arg; + + + +IMRT_Arg IMRG_Arg_Tab[ IMRD_ARG_NB] = +{ + { "", "", "Unknown"}, + { "-V", "--version", "Print version"}, + { "-h", "--help", "Print this help"}, + { "-vld", "--verbose_level_default", "Set the genral verbose level"}, + { "-vlm", "--verbose_level_module", "Set the module verbose level"}, + { "-lf", "--log_file", "Set log file"}, +#ifdef ORACLE_SUPPORT + { "-sdrx", "--static_data_read_xml", "Read static data from xml repository"}, + { "-sdrs", "--static_data_read_sql", "Read static data from sql repository"}, + { "-sdwx", "--static_data_write_xml", "Write static data to xml repository"}, + { "-sdws", "--static_data_write_sql", "Write static data to sql repository"}, +#else + { "", "", "None"}, + { "", "", "None"}, + { "", "", "None"}, + { "", "", "None"}, +#endif /* ORACLE_SUPPORT */ + { "-ld", "--library_dir", "Set imr library dir"}, + { "-mui", "--medium_url_input", "Set input medium url"}, + { "-muo", "--medium_url_output", "Set output medium url"}, + { "-mut", "--medium_url_trash", "Set trash medium url"}, + { "-ani", "--appl_name_input", "Set input appl name"}, + { "-ano", "--appl_name_output", "Set output appl name"}, + { "-aii", "--appl_id_input", "Set input appl id"}, + { "-aio", "--appl_id_output", "Set output appl id"}, + { "-mf", "--mapping_forced", "Output bad mapped buffer"}, + { "-cf", "--continue_forced", "Continue on mapping error"}, + { "-nw", "--no_wait", "Don't wait if nothing to read"}, + { "-xf", "--xml_format", "Format xml output buffer"}, + { "-cd", "--core_dump", "Dump core on SIGSEGV and SIGBUS"}, + { "-iim", "--id_input_message", "Log Id input message"}, + { "-iom", "--id_output_message", "Log Id output message"} +}; + + + + + +/*----------------------------------------------------------------------------*/ +/* Prototypes */ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* Config_Init */ +/*----------------------------------------------------------------------------*/ +/* Config_Ptr: Config structure to initialize */ +/* ArgC: Argument number */ +/* ArgV: Argument tab */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status Config_Init( IMRT_Config *, int, char **); + + + +/*----------------------------------------------------------------------------*/ +/* Config_Deinit */ +/*----------------------------------------------------------------------------*/ +/* Config_Ptr: Config structure to deinitialize */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status Config_Deinit( IMRT_Config *); + + + +/*----------------------------------------------------------------------------*/ +/* Args_Parse */ +/*----------------------------------------------------------------------------*/ +/* Config_Ptr: Configuration structure to update */ +/* ArgC: Argument number */ +/* ArgV: Argument tab */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status Args_Parse( IMRT_Config *, int, char **); + + + +/*----------------------------------------------------------------------------*/ +/* Args_Log */ +/*----------------------------------------------------------------------------*/ +/* Config_Ptr: Configuration structure to dump */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status Args_Log( IMRT_Config *); + + + +/*----------------------------------------------------------------------------*/ +/* Version_Log */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status Version_Log( void); + + + +/*----------------------------------------------------------------------------*/ +/* Version_Print */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status Version_Print( void); + + + +/*----------------------------------------------------------------------------*/ +/* Help_Print */ +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status Help_Print( void); + + + +/*----------------------------------------------------------------------------*/ +/* Lib_Open */ +/*----------------------------------------------------------------------------*/ +/* Module_Entry_Ptr: Module to open */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status Lib_Open( IMRT_Module_Entry *); + + + +/*----------------------------------------------------------------------------*/ +/* Libs_Open */ +/*----------------------------------------------------------------------------*/ +/* Module_Entry_Tab: Module tab */ +/* Module_Nb: Number of module */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status Libs_Open( IMRT_Module_Entry *, IMRT_Module_Id); + + + +/*----------------------------------------------------------------------------*/ +/* Lib_Close */ +/*----------------------------------------------------------------------------*/ +/* Module_Entry_Ptr: Module to close */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status Lib_Close( IMRT_Module_Entry *); + + + +/*----------------------------------------------------------------------------*/ +/* Libs_Close */ +/*----------------------------------------------------------------------------*/ +/* Module_Entry_Tab: Module tab */ +/* Module_Nb: Number of module */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status Libs_Close( IMRT_Module_Entry *, IMRT_Module_Id); + + + +/*------------------------------------------------------------------------------*/ +/* Signal_Trap */ +/*------------------------------------------------------------------------------*/ + +void Signal_Trap( int); + + + +/*----------------------------------------------------------------------------*/ +/* Signal_Init */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status Signal_Init(); + + + +/*----------------------------------------------------------------------------*/ +/* main */ +/*----------------------------------------------------------------------------*/ +/* ArgC: argument number */ +/* ArgV: Argument tab */ +/*----------------------------------------------------------------------------*/ + +int main( int, char **); + + + + + +/*----------------------------------------------------------------------------*/ + +#endif diff --git a/src/include/imr.h b/src/include/imr.h new file mode 100644 index 0000000..d62c6c7 --- /dev/null +++ b/src/include/imr.h @@ -0,0 +1,702 @@ +/*----------------------------------------------------------------------------*/ +/* File: imr.h */ +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#ifndef _IMR_H_ +#define _IMR_H_ + + + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + + + + + + +#define TRACE 1 + + + +/*----------------------------------------------------------------------------*/ +/* Global definitions */ +/*----------------------------------------------------------------------------*/ + +typedef short IMRT_Boolean; + +#define IMRD_FALSE ( IMRT_Boolean) 0 +#define IMRD_TRUE ( IMRT_Boolean) 1 + +#define IMRD_NO 'n' +#define IMRD_YES 'y' + +#define IMRD_MAX(A,B) (((A) < (B)) ? (B) : (A)) +#define IMRD_MIN(A,B) (((A) > (B)) ? (B) : (A)) + + + + + +/*----------------------------------------------------------------------------*/ +/* Status definition */ +/*----------------------------------------------------------------------------*/ + +typedef short IMRT_Status; + +#define IMRS_OK ( IMRT_Status) 0 + +#define IMRS_KO ( IMRT_Status) 1 +#define IMRS_NO_IDENT ( IMRT_Status) -2 +#define IMRS_BAD_FORMAT ( IMRT_Status) -3 +#define IMRS_ROLLBACK ( IMRT_Status) -4 + +#define IMRS_NO_DATA ( IMRT_Status) 3 +#define IMRS_SIGNAL ( IMRT_Status) 4 + + + +/*----------------------------------------------------------------------------*/ +/* Module and Lib definitions */ +/*----------------------------------------------------------------------------*/ + +typedef short IMRT_Module_Id; + +#define IMRD_MODULE_ID_UNKNOWN (IMRT_Module_Id) 0 + +#define IMRD_MODULE_NB_MAX (IMRT_Module_Id) 10 + + + +typedef char *IMRT_Module_Name; + + +typedef char *IMRT_Module_Name_Long; + + + +typedef char *IMRT_Module_Version; + + + +typedef short IMRT_Module_Type; + +#define IMRD_MODULE_TYPE_UNKNOWN ( IMRT_Module_Type) 0 +#define IMRD_MODULE_TYPE_OBJECT ( IMRT_Module_Type) 1 +#define IMRD_MODULE_TYPE_LIBRARY ( IMRT_Module_Type) 2 + + + +typedef short IMRT_Lib_Status; + +#define IMRD_LIB_STATUS_UNKNOWN ( IMRT_Lib_Status) 0 +#define IMRD_LIB_STATUS_CLOSED ( IMRT_Lib_Status) 1 +#define IMRD_LIB_STATUS_OPENED ( IMRT_Lib_Status) 2 +#define IMRD_LIB_STATUS_ERROR ( IMRT_Lib_Status) 3 + + + +typedef struct IMRT_Lib_Config +{ + char *dummy; +} IMRT_Lib_Config; + + + +typedef IMRT_Status ( IMRT_Lib_Open)( IMRT_Lib_Config *); +typedef IMRT_Status ( IMRT_Lib_Close)( void); + + + +typedef struct IMRT_Lib +{ + IMRT_Lib_Status Status; + IMRT_Lib_Open *Open_Ptr; + IMRT_Lib_Close *Close_Ptr; +} IMRT_Lib; + + + +typedef struct IMRT_Module +{ + IMRT_Module_Id Id; + IMRT_Module_Name Name; + IMRT_Module_Name_Long Name_Long; + IMRT_Module_Version Version; + IMRT_Module_Type Type; + IMRT_Lib Lib; +} IMRT_Module; + + + + + +/*----------------------------------------------------------------------------*/ +/* IMRT_Path definition */ +/*----------------------------------------------------------------------------*/ + +#define IMRD_PATH_LEN ( short) 255 +#define IMRD_PATH_SIZE ( short) ( IMRD_PATH_LEN + 1) + +typedef char IMRT_Path[ IMRD_PATH_SIZE]; + +typedef short IMRT_Lib_Flag; +#define IRMD_LIB_FLAG_SDM_XML (IMRT_Lib_Flag)0 +#define IRMD_LIB_FLAG_SDM_SQL (IMRT_Lib_Flag)1 + + + + + +/*----------------------------------------------------------------------------*/ +/* IMRT_Tag definition */ +/*----------------------------------------------------------------------------*/ + +#define IMRD_TAG_LEN ( short) 100 +#define IMRD_TAG_SIZE ( short) ( IMRD_TAG_LEN + 1) + +typedef char IMRT_Tag[ IMRD_TAG_SIZE]; + + + + + +/*----------------------------------------------------------------------------*/ +/* IMRT_Cnv_Id definition */ +/*----------------------------------------------------------------------------*/ + +typedef short IMRT_Cnv_Id; + +#define IMRD_CNV_ID_UNKNOWN ( IMRT_Cnv_Id) 0 + + + + + +/*----------------------------------------------------------------------------*/ +/* IMRT_Cnv_Name definition */ +/*----------------------------------------------------------------------------*/ + +#define IMRD_CNV_NAME_LEN ( short) 65 +#define IMRD_CNV_NAME_SIZE ( short) ( IMRD_CNV_NAME_LEN + 1) + +typedef char IMRT_Cnv_Name[ IMRD_CNV_NAME_SIZE]; + +#define IMRD_CNV_NAME_UNKNOWN "Unknown" + + + + + +/*----------------------------------------------------------------------------*/ +/* IMRT_Cnv_Attr definition */ +/*----------------------------------------------------------------------------*/ + +#define IMRD_CNV_ATTR_LEN ( short) 20 +#define IMRD_CNV_ATTR_SIZE ( short) ( IMRD_CNV_ATTR_LEN + 1) + +typedef char IMRT_Cnv_Attr[ IMRD_CNV_ATTR_SIZE]; + +#define IMRD_CNV_ATTR_UNKNOWN "UNKNOWN" + + + + + +/*----------------------------------------------------------------------------*/ +/* IMRT_Cnv definition */ +/*----------------------------------------------------------------------------*/ + +typedef struct IMRT_Cnv +{ + IMRT_Cnv_Id Id; + IMRT_Cnv_Name Name; +} IMRT_Cnv; + + + + +/*----------------------------------------------------------------------------*/ +/* IMRT_Field definition */ +/*----------------------------------------------------------------------------*/ + +#define IMRD_FIXED_SIZE_UNKNOWN ( size_t) -1 + + + +#define IMRD_NAME_LEN ( short) 255 +#define IMRD_NAME_SIZE ( short) ( IMRD_NAME_LEN + 1) + +typedef char IMRT_Field_Name[ IMRD_NAME_SIZE]; + + + +#define IMRD_VALUE_ID_LEN ( short) 20 +#define IMRD_VALUE_ID_SIZE ( short) ( IMRD_VALUE_ID_LEN + 1) + +typedef char IMRT_Field_Value_Id[ IMRD_VALUE_ID_SIZE]; + + +#define IMRD_EXIST_LEN ( short) 1 +#define IMRD_EXIST_SIZE ( short) ( IMRD_EXIST_LEN + 1) + +typedef char IMRT_Field_Exist[ IMRD_EXIST_SIZE]; + + +#define IMRD_VALUE_LEN ( short) 150 +#define IMRD_VALUE_SIZE ( short) ( IMRD_VALUE_LEN + 1) + +typedef char IMRT_Value[ IMRD_VALUE_SIZE]; + + + +typedef struct IMRT_Field_Fixed +{ + size_t Offset; + size_t Size; + IMRT_Value Def_Val; + IMRT_Cnv *Cnv_Ptr; + IMRT_Cnv_Attr Cnv_Attr; +} IMRT_Field_Fixed; + + + +#define IMRD_FML_TAG_LEN ( short) 50 +#define IMRD_FML_TAG_SIZE ( short) ( IMRD_FML_TAG_LEN + 1) + +typedef char IMRT_FML_Tag[ IMRD_FML_TAG_SIZE]; + + +#define IMRD_FML_TAG_UNKNOWN "" + + + + + +typedef struct IMRT_Field_FML +{ + IMRT_FML_Tag Tag; + IMRT_Value Def_Val; + IMRT_Cnv *Cnv_Ptr; + IMRT_Cnv_Attr Cnv_Attr; +} IMRT_Field_FML; + + + +#define IMRD_XML_TAG_LEN ( short) 150 +#define IMRD_XML_TAG_SIZE ( short) ( IMRD_XML_TAG_LEN + 1) + +typedef char IMRT_XML_Tag[ IMRD_XML_TAG_SIZE]; + +#define IMRD_XML_TAG_UNKNOWN "" + + + +typedef struct IMRT_Field_XML +{ + IMRT_XML_Tag Tag; + IMRT_Value Def_Val; + IMRT_Cnv *Cnv_Ptr; + IMRT_Cnv_Attr Cnv_Attr; +} IMRT_Field_XML; + + + +#define IMRD_TAGGED_TAG_LEN ( short) 20 +#define IMRD_TAGGED_TAG_SIZE ( short) ( IMRD_TAGGED_TAG_LEN + 1) + +typedef char IMRT_Tagged_Tag[ IMRD_TAGGED_TAG_SIZE]; + +#define IMRD_TAGGED_TAG_UNKNOWN "" + + + + +typedef struct IMRT_Field_Tagged +{ + IMRT_Tagged_Tag Tag; + IMRT_Value Def_Val; + IMRT_Cnv *Cnv_Ptr; + IMRT_Cnv_Attr Cnv_Attr; +} IMRT_Field_Tagged; + + + +#define IMRD_INTERNAL_TAG_LEN ( short) 20 +#define IMRD_INTERNAL_TAG_SIZE ( short) ( IMRD_INTERNAL_TAG_LEN + 1) + +typedef char IMRT_Internal_Tag[ IMRD_INTERNAL_TAG_SIZE]; + +#define IMRD_INTERNAL_TAG_UNKNOWN "" + + + + +typedef struct IMRT_Field_Internal +{ + IMRT_Internal_Tag Tag; + IMRT_Value Def_Val; + IMRT_Cnv *Cnv_Ptr; + IMRT_Cnv_Attr Cnv_Attr; +} IMRT_Field_Internal; + + + + +typedef short IMRT_Delimited_Id; + +#define IMRD_DELIMITED_ID_UNKNOWN ( IMRT_Delimited_Id) -1 + + + +typedef struct IMRT_Field_Delimited +{ + IMRT_Delimited_Id Id; + IMRT_Value Def_Val; + IMRT_Cnv *Cnv_Ptr; + IMRT_Cnv_Attr Cnv_Attr; +} IMRT_Field_Delimited; + + + +/*----------------------------------------------------------------------------*/ +/* IMRT_Field_Id definition */ +/*----------------------------------------------------------------------------*/ + +typedef int IMRT_Field_Id; + +#define IMRD_FIELD_ID_UNKNOWN ( IMRT_Field_Id) 0 + + + +typedef struct IMRT_Field +{ + IMRT_Field_Id Id; + IMRT_Field_Name Name; + IMRT_Field_Value_Id Value_Id; + IMRT_Boolean Exist; + IMRT_Field_Fixed Fixed; + IMRT_Field_FML FML; + IMRT_Field_XML XML; + IMRT_Field_Tagged Tagged; + IMRT_Field_Internal Internal; + IMRT_Field_Delimited Delimited; +} IMRT_Field; + + + + + +/*----------------------------------------------------------------------------*/ +/* IMRT_FieldMap_Id definition */ +/*----------------------------------------------------------------------------*/ + +typedef int IMRT_FieldMap_Id; + +#define IMRD_FIELDMAP_ID_UNKNOWN ( IMRT_FieldMap_Id) 0 + + + +/*----------------------------------------------------------------------------*/ +/* IMRT_FieldMap definition */ +/*----------------------------------------------------------------------------*/ + +typedef struct IMRT_FieldMap +{ + IMRT_FieldMap_Id Id; + IMRT_Field *Field_Input_Ptr; + IMRT_Field *Field_Output_Ptr; +} IMRT_FieldMap; + + + + + +/*----------------------------------------------------------------------------*/ +/* IMRT_Msg definition */ +/*----------------------------------------------------------------------------*/ + +typedef short IMRT_Msg_Id; + +#define IMRD_MSG_ID_UNKNOWN ( IMRT_Msg_Id ) 0 + + + +typedef char IMRT_Msg_Name[ IMRD_NAME_SIZE]; + +#define IMRD_MSG_NAME_UNKNOWN "UNKNOWN" + + + +typedef struct IMRT_Msg +{ + IMRT_Msg_Id Id; + IMRT_Msg_Name Name; + size_t Size; + NDT_Root *Field_Struct_Ptr; +} IMRT_Msg; + + + + + +/*----------------------------------------------------------------------------*/ +/* IMRT_Fmt definition */ +/*----------------------------------------------------------------------------*/ + + + +/* #define IMRT_LG_MESSAGE_TYPE 60 */ + + + +typedef int IMRT_Fmt_Id; + +#define IMRD_FMT_ID_UNKNOWN ( IMRT_Fmt_Id) 0 + + + +#define IMRD_FMT_NAME_LEN ( short) 20 +#define IMRD_FMT_NAME_SIZE ( short) ( IMRD_FMT_NAME_LEN + 1) + +typedef char IMRT_Fmt_Name[ IMRD_FMT_NAME_SIZE]; + +#define IMRD_FMT_NAME_UNKNOWN "Unknown" + + + + +typedef short IMRT_Branche_Id; + +#define IMRD_BRANCHE_ID_UNKNOWN ( IMRT_Branche_Id ) 0 + + + +typedef short IMRT_FmtAttr_Id; + +#define IMRD_FMTATTR_ID_UNKNOWN ( IMRT_FmtAttr_Id) 0 + + + +#define IMRD_FMTATTR_NAME_LEN ( short) 65 +#define IMRD_FMTATTR_NAME_SIZE ( short) ( IMRD_FMTATTR_NAME_LEN + 1) + +typedef char IMRT_FmtAttr_Name[ IMRD_FMTATTR_NAME_SIZE]; + +#define IMRD_FMTATTR_NAME_UNKNOWN "unknown" + + + + +#define IMRD_FMTATTR_VALUE_LEN ( short) 20 +#define IMRD_FMTATTR_VALUE_SIZE ( short) ( IMRD_FMTATTR_VALUE_LEN + 1) + +typedef char IMRT_FmtAttr_Value[ IMRD_FMTATTR_VALUE_SIZE]; + + + + +/*----------------------------------------------------------------------------*/ +/* IMRT_FmtAttr definition */ +/*----------------------------------------------------------------------------*/ + +typedef struct IMRT_FmtAttr +{ + IMRT_FmtAttr_Id Id; + IMRT_FmtAttr_Name Name; + IMRT_FmtAttr_Value Value; +} IMRT_FmtAttr; + + + + +/*----------------------------------------------------------------------------*/ +/* IMRT_FmtMsg definition */ +/*----------------------------------------------------------------------------*/ + +typedef struct IMRT_FmtMsg +{ + IMRT_Msg *Msg_Ptr; + IMRT_Branche_Id Branche_Id; + IMRT_FmtAttr *FmtAttr_Ptr; +} IMRT_FmtMsg; + + + + +typedef struct IMRT_Fmt +{ + IMRT_Fmt_Id Id; + IMRT_Fmt_Name Name; + NDT_Root *FmtMsg_Struct_Ptr; +} IMRT_Fmt; + + + + + +/*----------------------------------------------------------------------------*/ +/* IMRT_Appl_Id definition */ +/*----------------------------------------------------------------------------*/ + +typedef short IMRT_Appl_Id; + +#define IMRD_APPL_ID_UNKNOWN ( IMRT_Appl_Id) 0 + +#define IMRD_APPL_ID_UNDEFINEDED ( IMRT_Appl_Id) -1 + + + + +/*----------------------------------------------------------------------------*/ +/* IMRT_Appl_Name definition */ +/*----------------------------------------------------------------------------*/ + +#define IMRD_APPL_NAME_LEN ( short) 30 +#define IMRD_APPL_NAME_SIZE ( short) ( IMRD_APPL_NAME_LEN + 1) + +typedef char IMRT_Appl_Name[ IMRD_APPL_NAME_SIZE]; + +#define IMRD_APPL_NAME_UNKNOWN "UNKNOWN" + + + + + +/*----------------------------------------------------------------------------*/ +/* IMRT_Buffer definition */ +/*----------------------------------------------------------------------------*/ + +typedef short IMRT_Dir_Id; + +#define IMRD_DIR_ID_UNKNOWN ( IMRT_Dir_Id) 0 +#define IMRD_DIR_ID_IN ( IMRT_Dir_Id) 1 +#define IMRD_DIR_ID_OUT ( IMRT_Dir_Id) 2 + + + +typedef short IMRT_Buffer_Status; + +#define IMRD_BUFFER_STATUS_UNKNOWN ( IMRT_Buffer_Status) 0 +#define IMRD_BUFFER_STATUS_ALLOCATED ( IMRT_Buffer_Status) 1 +#define IMRD_BUFFER_STATUS_FREED ( IMRT_Buffer_Status) 2 + + + +typedef short IMRT_Buffer_Flag; + +#define IMRD_BUFFER_FLAG_UNKNOWN ( IMRT_Buffer_Flag) 0 +#define IMRD_BUFFER_FLAG_OPENED ( IMRT_Buffer_Flag) 1 +#define IMRD_BUFFER_FLAG_CLOSED ( IMRT_Buffer_Flag) 2 + + + +typedef char IMRT_Buffer_Data; + + + +typedef struct IMRT_Buffer +{ + IMRT_Msg_Id Msg_Id; + IMRT_Appl_Id Appl_Id_Input; + IMRT_Appl_Id Appl_Id_Output; + IMRT_Dir_Id Dir_Id; + IMRT_Fmt_Id Fmt_Id; + IMRT_FmtAttr_Value FmtAttr_Value; + IMRT_Buffer_Status Status; + IMRT_Buffer_Flag Flag; + size_t Data_Buf_Len; + size_t Data_Buf_Size; + IMRT_Buffer_Data *Data_Buf_Ptr; + IMRT_Boolean Data_Tmp_Changed; + IMRT_Buffer_Data *Data_Tmp_Ptr; +} IMRT_Buffer; + + + +typedef short IMRT_Buffer_Id; + +#define IMRT_BUFFER_ID_MAX_NB ( IMRT_Buffer_Id) 50 + + + +/*----------------------------------------------------------------------------*/ +/* IMRT_IOM_Read_Mode definition */ +/*----------------------------------------------------------------------------*/ + +typedef short IMRT_Read_Mode; + +#define IMRD_READ_MODE_UNKNOWN ( IMRT_Read_Mode) 0 +#define IMRD_READ_MODE_WAIT ( IMRT_Read_Mode) 1 +#define IMRD_READ_MODE_NO_WAIT ( IMRT_Read_Mode) 2 + + + +/*----------------------------------------------------------------------------*/ +/* IMRT_Base */ +/*----------------------------------------------------------------------------*/ + +typedef struct IMRT_Base +{ + int Sig_Trapped; + sigjmp_buf SigLongJmp_Env; +} IMRT_Base; + + + +# ifdef _IMRD_C_ + +# else + +extern IMRT_Base IMRG_Base; + +# endif + + + + +/*----------------------------------------------------------------------------*/ +/* IMR libraries */ +/*----------------------------------------------------------------------------*/ + +#include +#include +#include +#include +#include + +#endif diff --git a/src/libio_mng/include/io_mng.h b/src/libio_mng/include/io_mng.h new file mode 100644 index 0000000..8f0441e --- /dev/null +++ b/src/libio_mng/include/io_mng.h @@ -0,0 +1,459 @@ +/*----------------------------------------------------------------------------*/ +/* $Workfile: io_mng.h $ */ +/*----------------------------------------------------------------------------*/ +/* $Author: agibert $ */ +/* $Date: 2008/11/12 02:25:22 $ */ +/* $Revision: 1.1 $ */ +/* $Label: $ */ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#ifndef _IO_MNG_H_ +#define _IO_MNG_H_ + + + +#include + +#ifdef TUX_SUPPORT +# include +# include +# include +#endif + +#ifdef MQS_SUPPORT +# include +#endif + + + + +/*----------------------------------------------------------------------------*/ +/* IMRD_IOM_API definition */ +/*----------------------------------------------------------------------------*/ + +# ifdef _LIBIO_MNG_ +# define IMRD_IOM_API +# else +# define IMRD_IOM_API extern +# endif + + + + + +/*----------------------------------------------------------------------------*/ +/* IOM_Config definition */ +/*----------------------------------------------------------------------------*/ + +typedef struct IMRT_IOM_Config +{ + char *dummy; + +} IMRT_IOM_Config; + + + + + +/*----------------------------------------------------------------------------*/ +/* IMRT_File_Delim definition */ +/*----------------------------------------------------------------------------*/ + +#define IMRD_FILE_DELIM_LEN (short) 32 +#define IMRD_FILE_DELIM_SIZE (short) ( IMRD_FILE_DELIM_LEN + 1) + +typedef char IMRT_File_Delim[ IMRD_FILE_DELIM_SIZE]; + + + +/*----------------------------------------------------------------------------*/ +/* IMRT_File_Buffer definition */ +/*----------------------------------------------------------------------------*/ + +#define IMRD_FILE_BUFFER_LEN (size_t) 4096 +#define IMRD_FILE_BUFFER_SIZE (size_t) ( IMRD_FILE_BUFFER_LEN + 1) + +typedef char IMRT_File_Buffer; + + + +/*----------------------------------------------------------------------------*/ +/* IMRT_Medium_File definition */ +/*----------------------------------------------------------------------------*/ + +typedef struct IMRT_Medium_File +{ + IMRT_File_Delim Delim; + size_t Delim_Len; + size_t Msg_Len; + IMRT_Path Path; + FILE *Handle_Ptr; + IMRT_File_Buffer *Buffer_Ptr; + size_t Buffer_Len; + IMRT_File_Buffer *Cur_Ptr; + +} IMRT_Medium_File; + + + +#ifdef TUX_SUPPORT +/*----------------------------------------------------------------------------*/ +/* IMRT_Tux_Queue_Name definition */ +/*----------------------------------------------------------------------------*/ + +#define IMRD_TUX_QUEUE_NAME_LEN ( short) 255 +#define IMRD_TUX_QUEUE_NAME_SIZE ( short) ( IMRD_TUX_QUEUE_NAME_LEN + 1) + +typedef char IMRT_Tux_Queue_Name[ IMRD_TUX_QUEUE_NAME_SIZE]; + + + +/*----------------------------------------------------------------------------*/ +/* IMRT_Tux_Queue_Space definition */ +/*----------------------------------------------------------------------------*/ + +#define IMRD_TUX_QUEUE_SPACE_LEN ( short) 255 +#define IMRD_TUX_QUEUE_SPACE_SIZE ( short) ( IMRD_TUX_QUEUE_SPACE_LEN + 1) + +typedef char IMRT_Tux_Queue_Space[ IMRD_TUX_QUEUE_SPACE_SIZE]; + + + +/*----------------------------------------------------------------------------*/ +/* IMRT_Tux_Open_Info definition */ +/*----------------------------------------------------------------------------*/ + +#define IMRD_TUX_OPEN_INFO_LEN ( short) 255 +#define IMRD_TUX_OPEN_INFO_SIZE ( short) ( IMRD_TUX_OPEN_INFO_LEN + 1) + +typedef char IMRT_Tux_Open_Info[ IMRD_TUX_OPEN_INFO_SIZE]; + + + +/*----------------------------------------------------------------------------*/ +/* IMRT_Tux_Lmid definition */ +/*----------------------------------------------------------------------------*/ + +#define IMRD_TUX_LMID_LEN ( short) 255 +#define IMRD_TUX_LMID_SIZE ( short) ( IMRD_TUX_LMID_LEN + 1) + +typedef char IMRT_Tux_Lmid[ IMRD_TUX_LMID_SIZE]; + + + +#define IMRD_TUX_BUFFER_SIZE ( size_t) 10000 + +typedef FBFR32 IMRT_Tux_Buffer; + + + +/*----------------------------------------------------------------------------*/ +/* IMRT_Medium_Tux definition */ +/*----------------------------------------------------------------------------*/ + +typedef struct IMRT_Medium_Tux +{ + IMRT_Tux_Queue_Space Queue_Space; + IMRT_Tux_Queue_Name Queue_Name; + +} IMRT_Medium_Tux; +#endif /* MQS_SUPPORT */ + + + +#ifdef MQS_SUPPORT +/*----------------------------------------------------------------------------*/ +/* IMRT_MQS_Queue_Manager definition */ +/*----------------------------------------------------------------------------*/ + +#define IMRD_MQS_QUEUE_MNG_LEN ( short) 255 +#define IMRD_MQS_QUEUE_MNG_SIZE ( short) ( IMRD_MQS_QUEUE_MNG_LEN + 1) + +typedef char IMRT_MQS_Queue_Mng[ IMRD_MQS_QUEUE_MNG_SIZE]; + + + +/*----------------------------------------------------------------------------*/ +/* IMRT_MQS_Queue_Name definition */ +/*----------------------------------------------------------------------------*/ + +#define IMRD_MQS_QUEUE_NAME_LEN ( short) 255 +#define IMRD_MQS_QUEUE_NAME_SIZE ( short) ( IMRD_MQS_QUEUE_NAME_LEN + 1) + +typedef char IMRT_MQS_Queue_Name[ IMRD_MQS_QUEUE_NAME_SIZE]; + + + + +#define IMRD_MQS_BUFFER_LEN (size_t) 4096 +#define IMRD_MQS_BUFFER_SIZE (size_t) ( IMRD_MQS_BUFFER_LEN + 1) + +typedef MQBYTE IMRT_MQS_Buffer; + + + +/*----------------------------------------------------------------------------*/ +/* IMRT_Mediul_MQS definition */ +/*----------------------------------------------------------------------------*/ + +typedef struct IMRT_Medium_MQS +{ + IMRT_MQS_Queue_Mng Queue_Mng; + IMRT_MQS_Queue_Name Queue_Name; + MQHCONN Conn_Hdl; + MQHOBJ Obj_Hdl; + +} IMRT_Medium_MQS; +#endif /* MQS_SUPPORT */ + + + +/*----------------------------------------------------------------------------*/ +/* IMRT_Medium definitions */ +/*----------------------------------------------------------------------------*/ + +#define IMRD_MEDIUM_NAME_LEN ( short) 64 +#define IMRD_MEDIUM_NAME_SIZE ( short) ( IMRD_MEDIUM_NAME_LEN + 1) + +typedef char IMRT_Medium_Name[ IMRD_MEDIUM_NAME_SIZE]; + + + +typedef short IMRT_Medium_Type; + +#define IMRD_MEDIUM_TYPE_UNKNOWN ( IMRT_Medium_Type) 0 +#define IMRD_MEDIUM_TYPE_FILE ( IMRT_Medium_Type) 1 + +#ifdef MQS_SUPPORT +# define IMRD_MEDIUM_TYPE_TUX ( IMRT_Medium_Type) 2 +#endif /* TUX_SUPPORT */ + +#ifdef MQS_SUPPORT +# define IMRD_MEDIUM_TYPE_MQS ( IMRT_Medium_Type) 3 +#endif /* MQS_SUPPORT */ + + + +typedef short IMRT_Medium_Status; + +#define IMRD_MEDIUM_STATUS_UNKNOWN ( IMRT_Medium_Status) 0 +#define IMRD_MEDIUM_STATUS_OPENED ( IMRT_Medium_Status) 1 +#define IMRD_MEDIUM_STATUS_CLOSED ( IMRT_Medium_Status) 2 + + + +#define IMRD_MEDIUM_URL_LEN ( short) 255 +#define IMRD_MEDIUM_URL_SIZE ( short) ( IMRD_MEDIUM_URL_LEN + 1) + +typedef char IMRT_Medium_URL[ IMRD_MEDIUM_URL_SIZE]; + + + +#define IMRD_MEDIUM_PATH_LEN ( short) 255 +#define IMRD_MEDIUM_PATH_SIZE ( short) ( IMRD_MEDIUM_PATH_LEN + 1) + +typedef char IMRT_Medium_Path[ IMRD_MEDIUM_PATH_SIZE]; + +typedef short IMRT_Medium_Tran_Flag; + +#define IMRD_MEDIUM_TRAN_FLAG_UNKNOWN ( IMRT_Medium_Tran_Flag) 0 +#define IMRD_MEDIUM_TRAN_FLAG_IN ( IMRT_Medium_Tran_Flag) 1 +#define IMRD_MEDIUM_TRAN_FLAG_OUT ( IMRT_Medium_Tran_Flag) 2 + + +typedef struct IMRT_Medium +{ + IMRT_Medium_Name Name; + IMRT_Medium_Type Type; + IMRT_Medium_Status Status; + IMRT_Medium_URL URL; + IMRT_Appl_Id Appl_Id_Input; + IMRT_Appl_Id Appl_Id_Output; + IMRT_Dir_Id Dir_Id; + IMRT_Medium_Tran_Flag Tran_Flag; + size_t Byte_Nb; + size_t Msg_Nb; + + IMRT_Medium_File File; + +#ifdef TUX_SUPPORT + IMRT_Medium_Tux Tux; +#endif /* TUX_SUPPORT */ + +#ifdef MQS_SUPPORT + IMRT_Medium_MQS MQS; +#endif /* MQS_SUPPORT */ + +} IMRT_Medium; + + + +/*----------------------------------------------------------------------------*/ +/* IMRT_Tran definitions */ +/*----------------------------------------------------------------------------*/ + +typedef int IMRT_Medium_Nb; + +typedef struct IMRT_Tran +{ + IMRT_Medium **Medium_Ptr_Tab; + IMRT_Medium_Nb Medium_Nb; + +} IMRT_Tran; + + + + + + +/*----------------------------------------------------------------------------*/ +/* Global Variables */ +/*----------------------------------------------------------------------------*/ + +# ifdef _LIBIO_MNG_ + +# else + +extern IMRT_Module IMRG_IOM_Module; + +# endif + + + + + + + +/******************************************************************************/ +/*IO Manager API */ +/******************************************************************************/ + + + +/*----------------------------------------------------------------------------*/ +/* Open IO Manager */ +/*----------------------------------------------------------------------------*/ +/* IOM_Config_Ptr: Setup IOM init mode */ +/*----------------------------------------------------------------------------*/ + +IMRD_IOM_API IMRT_Status IMR_IOM_Library_Open( IMRT_IOM_Config *); + + + +/*----------------------------------------------------------------------------*/ +/* Close IO Manager */ +/*----------------------------------------------------------------------------*/ + +IMRD_IOM_API IMRT_Status IMR_IOM_Library_Close( void); + + + +/*----------------------------------------------------------------------------*/ +/* Open Medium */ +/*----------------------------------------------------------------------------*/ +/* Medium_Ptr_Ptr: Reference to the Pointer to the opened medium */ +/* Medium_Name: Name of the medium */ +/* Medium_URL: Medium URL to open */ +/* Appl_Id_Input: Input application Id link with the medium */ +/* Appl_Id_Output: Output application Id link with the medium */ +/* Dir_Id: Medium open direction */ +/*----------------------------------------------------------------------------*/ + +IMRD_IOM_API IMRT_Status IMR_IOM_Medium_Open( IMRT_Medium **, IMRT_Medium_Name, IMRT_Medium_URL, IMRT_Appl_Id, IMRT_Appl_Id, IMRT_Dir_Id); + + + +/*----------------------------------------------------------------------------*/ +/* Close Medium */ +/*----------------------------------------------------------------------------*/ +/* Medium_Ptr: Pointer to the medium to close */ +/*----------------------------------------------------------------------------*/ + +IMRD_IOM_API IMRT_Status IMR_IOM_Medium_Close( IMRT_Medium *); + + + +/*----------------------------------------------------------------------------*/ +/* Read Medium */ +/*----------------------------------------------------------------------------*/ +/* Buffer_Ptr: Pointer to the buffer to write */ +/* Medium_Ptr: Pointer to the medium to read */ +/* Read_Mode: Read mode */ +/*----------------------------------------------------------------------------*/ + +IMRD_IOM_API IMRT_Status IMR_IOM_Medium_Read( IMRT_Buffer *, IMRT_Medium *, IMRT_Read_Mode); + + + +/*----------------------------------------------------------------------------*/ +/* Write Medium */ +/*----------------------------------------------------------------------------*/ +/* Medium_Ptr: Pointer to the medium to write */ +/* Buffer_Ptr: Pointer to the buffer to read */ +/*----------------------------------------------------------------------------*/ + +IMRD_IOM_API IMRT_Status IMR_IOM_Medium_Write( IMRT_Medium *, IMRT_Buffer *); + + + +/*----------------------------------------------------------------------------*/ +/* Tran Begin */ +/*----------------------------------------------------------------------------*/ +/* Tran_Ptr_Ptr: Reference to the pointer of the transaction to begin */ +/* Medium_Count: Number of medium to enclose into the transaction */ +/* Medium_1_Ptr: Pointer to the first medium */ +/* ... */ +/*----------------------------------------------------------------------------*/ + +IMRD_IOM_API IMRT_Status IMR_IOM_Tran_Begin( IMRT_Tran **, IMRT_Medium_Nb, IMRT_Medium *, ...); + + + +/*----------------------------------------------------------------------------*/ +/* Tran Commit */ +/*----------------------------------------------------------------------------*/ +/* Tran_Ptr: Pointer to the transaction to commit */ +/*----------------------------------------------------------------------------*/ + +IMRD_IOM_API IMRT_Status IMR_IOM_Tran_Commit( IMRT_Tran *); + + + +/*----------------------------------------------------------------------------*/ +/* Tran Rollback */ +/*----------------------------------------------------------------------------*/ +/* Tran_Ptr: Pointer to the transaction to rollback */ +/*----------------------------------------------------------------------------*/ + +IMRD_IOM_API IMRT_Status IMR_IOM_Tran_Rollback( IMRT_Tran *); + + + + + +/*----------------------------------------------------------------------------*/ + +#endif diff --git a/src/libio_mng/src/Makefile b/src/libio_mng/src/Makefile new file mode 100644 index 0000000..2f00a10 --- /dev/null +++ b/src/libio_mng/src/Makefile @@ -0,0 +1,74 @@ +#------------------------------------------------------------------------------ +# Local Makefile +#------------------------------------------------------------------------------ +# $Workfile: Makefile $ +#------------------------------------------------------------------------------ +# $Author: agibert $ +# $Date: 2008/11/12 02:25:22 $ +# $Revision: 1.1 $ +# $Label: $ +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# IMR - Interlinking Message Router +# Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) +# mailto:arnaud@rx3.net +# http://www.rx3.org/dvp/?dvp=imr +#------------------------------------------------------------------------------ +# This file is part of IMR +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# Var include +#------------------------------------------------------------------------------ + +include ../../Makefile_var.mk + + + +#------------------------------------------------------------------------------ +# Variables +#------------------------------------------------------------------------------ + +TARGET= libio_mng$(SHLIB_SUFFIX) + +OBJ= libio_mng.o \ + io_hdl_file.o + +ifeq ($(TUX_SUPPORT),1) + OBJ+= io_hdl_tux.o +endif + +ifeq ($(MQS_SUPPORT),1) + OBJ+= io_hdl_mqs.o +endif + +EXTRA_INC= + +EXTRA_LIB= + + + +#------------------------------------------------------------------------------ +# Rule include +#------------------------------------------------------------------------------ + +include ../../Makefile_rule.mk diff --git a/src/libio_mng/src/io_hdl_file.c b/src/libio_mng/src/io_hdl_file.c new file mode 100644 index 0000000..cd15384 --- /dev/null +++ b/src/libio_mng/src/io_hdl_file.c @@ -0,0 +1,541 @@ +/*----------------------------------------------------------------------------*/ +/* File: io_hdl_file.c */ +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#define _LIBIO_MNG_ +#define _IO_HDL_FILE_C_ + + + +#include "io_hdl_file.h" + + + + + +/*----------------------------------------------------------------------------*/ +/* IO_Hdl_File_Open */ +/*----------------------------------------------------------------------------*/ +/* Medium_Ptr: Pointer to the medium to open */ +/* Medium_Path: Medium Path to open */ +/* Dir_Id: Medium open direction */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IO_Hdl_File_Open( IMRT_Medium *Medium_Ptr, IMRT_Medium_Path Medium_Path, IMRT_Dir_Id Dir_Id) +{ + char *type_ptr, *path_ptr, *read_ptr, *write_ptr; + + + if( Dir_Id == IMRD_DIR_ID_IN) + { + type_ptr = "r"; + } + else + { + if( Dir_Id == IMRD_DIR_ID_OUT) + { + type_ptr = "w"; + } + else + { + IMRD_LM_LOG_ERROR_1( "Invalid Dir_Id (%d) !", Dir_Id); + + return( IMRS_KO); + } + } + + if( ( path_ptr = strstr( Medium_Path, "@")) != NULL) + { + if( ( path_ptr == Medium_Path) || ( ( path_ptr - Medium_Path + 1) == strlen( Medium_Path))) + { + IMRD_LM_LOG_ERROR_1( "Invalid file path [%s] !", Medium_Path); + + return( IMRS_KO); + } + + for( read_ptr = Medium_Path, write_ptr = Medium_Ptr->File.Delim; read_ptr < path_ptr; read_ptr++, write_ptr++) + { + if( ( *read_ptr == '\\') && ( read_ptr < ( path_ptr - 1))) + { + switch( *( read_ptr + 1)) + { + case 'n': + { + *write_ptr = '\n'; + break; + } + + case 't': + { + *write_ptr = '\t'; + break; + } + + case '\\': + { + *write_ptr = '\n'; + break; + } + + default: + { + *write_ptr = '?'; + break; + } + } + + read_ptr++; + } + else + { + *write_ptr = *read_ptr; + } + } + + *write_ptr = '\0'; + + Medium_Ptr->File.Delim_Len = write_ptr - Medium_Ptr->File.Delim; + Medium_Ptr->File.Msg_Len = 0; + + strcpy( Medium_Ptr->File.Path, ( path_ptr + 1)); + } + else + { + if( ( path_ptr = strstr( Medium_Path, "#")) != NULL) + { + if( ( path_ptr == Medium_Path) || ( ( path_ptr - Medium_Path + 1) == strlen( Medium_Path))) + { + IMRD_LM_LOG_ERROR_1( "Invalid file path [%s] !", Medium_Path); + + return( IMRS_KO); + } + + Medium_Ptr->File.Delim_Len = 0; + Medium_Ptr->File.Delim[ Medium_Ptr->File.Delim_Len] = '\0'; + + Medium_Ptr->File.Msg_Len = atoi( Medium_Path); + + if( Medium_Ptr->File.Msg_Len <= 0) + { + IMRD_LM_LOG_ERROR_1( "Invalid message len [%s] !", Medium_Path); + + return( IMRS_KO); + } + + strcpy( Medium_Ptr->File.Path, ( path_ptr + 1)); + } + else + { + Medium_Ptr->File.Delim_Len = 0; + Medium_Ptr->File.Delim[ Medium_Ptr->File.Delim_Len] = '\0'; + + Medium_Ptr->File.Msg_Len = 0; + + strcpy( Medium_Ptr->File.Path, Medium_Path); + } + } + + if( ( Medium_Ptr->File.Handle_Ptr = fopen( Medium_Ptr->File.Path, type_ptr)) == NULL) + { + IMRD_LM_LOG_ERROR_2( "Can't open file [%s] (%d) !", Medium_Ptr->File.Path, errno); + + return( IMRS_KO); + } + + if( ( Medium_Ptr->File.Buffer_Ptr = malloc( IMRD_FILE_BUFFER_SIZE)) == NULL) + { + IMRD_LM_LOG_ERROR_1( "Can't allocate File_Buffer (%d) !", errno); + + return( IMRS_KO); + } + + Medium_Ptr->File.Buffer_Len = 0; + Medium_Ptr->File.Cur_Ptr = Medium_Ptr->File.Buffer_Ptr + IMRD_FILE_BUFFER_LEN; + + IMRD_LM_LOG_TRACE_4( IMRD_LOG_LEVEL_VERBOSE_1, "File: [%s] mode: [%s] delim: [%s] len: [%ld] opened !", Medium_Ptr->File.Path, type_ptr, Medium_Ptr->File.Delim, Medium_Ptr->File.Msg_Len); + + return( IMRS_OK); +} + + + + + +/*----------------------------------------------------------------------------*/ +/* IO_Hdl_File_Close */ +/*----------------------------------------------------------------------------*/ +/* Medium_Ptr: Pointer to the medium to close */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IO_Hdl_File_Close( IMRT_Medium *Medium_Ptr) +{ + if( Medium_Ptr->File.Buffer_Ptr != NULL) + { + free( Medium_Ptr->File.Buffer_Ptr); + } + + if( fclose( Medium_Ptr->File.Handle_Ptr) == EOF) + { + IMRD_LM_LOG_ERROR_2( "Can't close file [%s] (%d) !", Medium_Ptr->File.Path, errno); + + return( IMRS_KO); + } + + IMRD_LM_LOG_TRACE_1( IMRD_LOG_LEVEL_VERBOSE_1, "File: [%s] closed !", Medium_Ptr->File.Path); + + return( IMRS_OK); +} + + + +/*----------------------------------------------------------------------------*/ +/* IO_Hdl_File_Mem_Str */ +/*----------------------------------------------------------------------------*/ +/* Occur_Ptr_Ptr: Pointer to the first occurrence */ +/* Area_Ptr: Memory Area */ +/* Area_Size: Size of the Area_Ptr */ +/* Search_Ptr: Area to search in Area_Ptr */ +/* Search_Size: Size of the Search_Ptr */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IO_Hdl_File_Mem_Str( char **Occur_Ptr_Ptr, const char *Area_Ptr, size_t Area_Size, const char *Search_Ptr, size_t Search_Size) +{ + + char * Pos = (char *)Area_Ptr; + + *Occur_Ptr_Ptr = NULL; + + while((Pos != NULL) && (*Occur_Ptr_Ptr == NULL)) + { + Pos = memchr(Pos, Search_Ptr[0], Area_Size - (Pos - Area_Ptr)); + if ((Area_Size - (Pos - Area_Ptr)) < Search_Size) + { + Pos = NULL; + } + else + { + if (Pos != NULL) + { + if (memcmp(Pos, Search_Ptr, Search_Size) == 0) + { + *Occur_Ptr_Ptr = Pos; + } + else + { + Pos += 1; + } + } + } + } + + return( IMRS_OK); +} + + +/*----------------------------------------------------------------------------*/ +/* IO_Hdl_File_Read */ +/*----------------------------------------------------------------------------*/ +/* Buffer_Ptr: Buffer to write data in */ +/* Read_Len_Ptr: Number of byte readen */ +/* Medium_Path: Medium to read */ +/* Read_Mode: Read mode */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IO_Hdl_File_Read( IMRT_Buffer *Buffer_Ptr, size_t *Read_Len_Ptr, IMRT_Medium *Medium_Ptr, IMRT_Read_Mode Read_Mode) +{ + IMRT_Buffer_Data *next_ptr; + IMRT_Buffer_Data *delim_ptr; + IMRT_Buffer_Data *buffer_data_ptr = NULL; + size_t buffer_data_size = 1; + size_t copy_data_size = 0; + size_t read_buffer_len = IMRD_FILE_BUFFER_LEN - Medium_Ptr->File.Delim_Len; + IMRT_Status status_tmp; + + *Read_Len_Ptr = 0; + + if( Medium_Ptr->File.Msg_Len > 0) /* Msg_Len split mode */ + { + do + { + if( Medium_Ptr->File.Cur_Ptr >= ( Medium_Ptr->File.Buffer_Ptr + Medium_Ptr->File.Buffer_Len)) /* File needs to be read */ + { + Medium_Ptr->File.Cur_Ptr = Medium_Ptr->File.Buffer_Ptr; + + Medium_Ptr->File.Buffer_Len = fread( Medium_Ptr->File.Buffer_Ptr, sizeof( char), IMRD_FILE_BUFFER_LEN, Medium_Ptr->File.Handle_Ptr); + + if( ferror( Medium_Ptr->File.Handle_Ptr) != 0) + { + IMRD_LM_LOG_ERROR_2( "Can't read file [%s] (%d) !", Medium_Ptr->File.Path, ferror( Medium_Ptr->File.Handle_Ptr)); + + return( IMRS_KO); + } + } + + copy_data_size = IMRD_MIN( ( Medium_Ptr->File.Buffer_Len - ( Medium_Ptr->File.Cur_Ptr - Medium_Ptr->File.Buffer_Ptr)), + ( Medium_Ptr->File.Msg_Len - buffer_data_size + 1)); + + if( copy_data_size != 0) + { + if( ( buffer_data_ptr = realloc( buffer_data_ptr, ( buffer_data_size + copy_data_size))) == NULL) + { + IMRD_LM_LOG_ERROR_1( "Can't allocate Buffer_Data (%d) !", errno); + + return( IMRS_KO); + } + + memcpy( ( buffer_data_ptr + buffer_data_size - 1), Medium_Ptr->File.Cur_Ptr, copy_data_size); /* Copy data from read buffer to copy buffer */ + buffer_data_size += copy_data_size; + + Medium_Ptr->File.Cur_Ptr += copy_data_size; + } + } + while( ( buffer_data_size < Medium_Ptr->File.Msg_Len) && ( Medium_Ptr->File.Buffer_Len > 0)); + } + else /* Delimitor split mode */ + { + do + { + if( Medium_Ptr->File.Cur_Ptr >= ( Medium_Ptr->File.Buffer_Ptr + read_buffer_len)) /* File needs to be read */ + { + if( Medium_Ptr->File.Cur_Ptr < ( Medium_Ptr->File.Buffer_Ptr + IMRD_FILE_BUFFER_LEN)) /* Footer needs to be moved to header */ + { + Medium_Ptr->File.Buffer_Len += Medium_Ptr->File.Buffer_Ptr - Medium_Ptr->File.Cur_Ptr; + memcpy( Medium_Ptr->File.Buffer_Ptr, Medium_Ptr->File.Cur_Ptr, Medium_Ptr->File.Buffer_Len); + } + else + { + Medium_Ptr->File.Buffer_Len = 0; /* Buffer is empty */ + } + + Medium_Ptr->File.Cur_Ptr = Medium_Ptr->File.Buffer_Ptr; + + Medium_Ptr->File.Buffer_Len += fread( ( Medium_Ptr->File.Buffer_Ptr + Medium_Ptr->File.Buffer_Len), + sizeof( char), ( IMRD_FILE_BUFFER_LEN - Medium_Ptr->File.Buffer_Len), + Medium_Ptr->File.Handle_Ptr); + + if( ferror( Medium_Ptr->File.Handle_Ptr) != 0) + { + IMRD_LM_LOG_ERROR_2( "Can't read file [%s] (%d) !", Medium_Ptr->File.Path, ferror( Medium_Ptr->File.Handle_Ptr)); + + return( IMRS_KO); + } + } + + status_tmp = IO_Hdl_File_Mem_Str(&delim_ptr, Medium_Ptr->File.Cur_Ptr, Medium_Ptr->File.Buffer_Len - (Medium_Ptr->File.Cur_Ptr - Medium_Ptr->File.Buffer_Ptr), Medium_Ptr->File.Delim, Medium_Ptr->File.Delim_Len); + + if( ( Medium_Ptr->File.Delim_Len == 0) || ( delim_ptr == NULL)) /* Seek delim. */ + { + delim_ptr = Medium_Ptr->File.Buffer_Ptr + IMRD_MIN( Medium_Ptr->File.Buffer_Len, read_buffer_len); /* No delimitor */ + next_ptr = delim_ptr; + } + else + { + next_ptr = delim_ptr + Medium_Ptr->File.Delim_Len; /* Delimitor found */ + *Read_Len_Ptr = *Read_Len_Ptr + Medium_Ptr->File.Delim_Len; + } + + copy_data_size = delim_ptr - Medium_Ptr->File.Cur_Ptr; + + if( copy_data_size != 0) + { + if( ( buffer_data_ptr = realloc( buffer_data_ptr, ( buffer_data_size + copy_data_size))) == NULL) + { + IMRD_LM_LOG_ERROR_1( "Can't allocate Buffer_Data (%d) !", errno); + + return( IMRS_KO); + } + + memcpy( ( buffer_data_ptr + buffer_data_size - 1), Medium_Ptr->File.Cur_Ptr, copy_data_size); /* Copy data from read buffer to copy buffer */ + buffer_data_size += copy_data_size; + + Medium_Ptr->File.Cur_Ptr = next_ptr; + } + } + while( ( next_ptr == delim_ptr) && ( Medium_Ptr->File.Buffer_Len >= read_buffer_len)); + } + + if( IMR_SDM_Fmt_Id_Get( &( Buffer_Ptr->Fmt_Id), "Fixed") != IMRS_OK) + { + IMRD_LM_LOG_ERROR_1( "Can't get FmtId: (%d) !", Buffer_Ptr->Fmt_Id); + + return( IMRS_KO); + } + + if( buffer_data_size <= 1) + { + IMRD_LM_LOG_TRACE_1( IMRD_LOG_LEVEL_VERBOSE_1, "No more data to read from file: [%s] !", Medium_Ptr->File.Path); + + return( IMRS_NO_DATA); + } + else + { + buffer_data_ptr[ ( buffer_data_size - 1)] = '\0'; + + Buffer_Ptr->Data_Buf_Ptr = buffer_data_ptr; + Buffer_Ptr->Data_Buf_Len = buffer_data_size - 1; + Buffer_Ptr->Data_Buf_Size = buffer_data_size; + Buffer_Ptr->Status = IMRD_BUFFER_STATUS_ALLOCATED; + + *Read_Len_Ptr = *Read_Len_Ptr + buffer_data_size - 1; + + IMRD_LM_LOG_TRACE_2( IMRD_LOG_LEVEL_VERBOSE_1, "Read (%d) bytes from file: [%s] ", Buffer_Ptr->Data_Buf_Len, Medium_Ptr->File.Path); + + return( IMRS_OK); + } +} + + + + + +/*----------------------------------------------------------------------------*/ +/* IO_Hdl_File_Write */ +/*----------------------------------------------------------------------------*/ +/* Medium_Ptr: Pointer to the medium to write data to */ +/* Write_Len_Ptr: Number of byte writen */ +/* Buffer_Ptr: Buffer to read */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IO_Hdl_File_Write( IMRT_Medium *Medium_Ptr, size_t *Write_Len_Ptr, IMRT_Buffer *Buffer_Ptr) +{ + char *padding_buffer_ptr; + long padding_len; + + + *Write_Len_Ptr = 0; + + if( ( Medium_Ptr->File.Delim_Len != 0) && ( Medium_Ptr->Msg_Nb > 0)) + { + *Write_Len_Ptr = fwrite( Medium_Ptr->File.Delim, sizeof( char), Medium_Ptr->File.Delim_Len, Medium_Ptr->File.Handle_Ptr); + + if( ferror( Medium_Ptr->File.Handle_Ptr) != 0) + { + IMRD_LM_LOG_ERROR_2( "Can't write file [%s] (%d) !", Medium_Ptr->URL, ferror( Medium_Ptr->File.Handle_Ptr)); + + return( IMRS_KO); + } + } + + padding_len = Medium_Ptr->File.Msg_Len - Buffer_Ptr->Data_Buf_Len; + + if( Medium_Ptr->File.Msg_Len != 0 ) + { + if( padding_len < 2) + { + IMRD_LM_LOG_ERROR_2( "Buffer size: (%d) too big for message split size: (%d) !", Buffer_Ptr->Data_Buf_Len, Medium_Ptr->File.Msg_Len); + + return( IMRS_KO); + } + + if( ( padding_buffer_ptr = malloc( padding_len)) == NULL) + { + IMRD_LM_LOG_ERROR_1( "Can't allocate padding_buffer (%d) !", errno); + + return( IMRS_KO); + } + + memset( padding_buffer_ptr, ' ', padding_len); + + padding_buffer_ptr[0] = '\0'; + padding_buffer_ptr[1] = '\0'; + } + + *Write_Len_Ptr += fwrite( Buffer_Ptr->Data_Buf_Ptr, sizeof( char), Buffer_Ptr->Data_Buf_Len, Medium_Ptr->File.Handle_Ptr); + + if( ferror( Medium_Ptr->File.Handle_Ptr) != 0) + { + IMRD_LM_LOG_ERROR_2( "Can't write data in file [%s] (%d) !", Medium_Ptr->URL, ferror( Medium_Ptr->File.Handle_Ptr)); + + return( IMRS_KO); + } + + if( Medium_Ptr->File.Msg_Len != 0 ) + { + *Write_Len_Ptr += fwrite( padding_buffer_ptr, sizeof( char), padding_len, Medium_Ptr->File.Handle_Ptr); + + free( padding_buffer_ptr); + + if( ferror( Medium_Ptr->File.Handle_Ptr) != 0) + { + IMRD_LM_LOG_ERROR_2( "Can't write padding in file [%s] (%d) !", Medium_Ptr->URL, ferror( Medium_Ptr->File.Handle_Ptr)); + + return( IMRS_KO); + } + } + + fflush( Medium_Ptr->File.Handle_Ptr); + + IMRD_LM_LOG_TRACE_2( IMRD_LOG_LEVEL_VERBOSE_1, "Wrote (%d) bytes to file: [%s] ", *Write_Len_Ptr, Medium_Ptr->File.Path); + + return( IMRS_OK); +} + + + + + +/*----------------------------------------------------------------------------*/ +/* IO_Hdl_File_Begin */ +/*----------------------------------------------------------------------------*/ +/* IMRT_Medium *Medium_Ptr */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IO_Hdl_File_Begin( IMRT_Medium *Medium_Ptr) +{ + return(IMRS_OK); +} + + + + + +/*----------------------------------------------------------------------------*/ +/* IO_Hdl_File_Commit */ +/*----------------------------------------------------------------------------*/ +/* IMRT_Medium *Medium_Ptr */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IO_Hdl_File_Commit( IMRT_Medium *Medium_Ptr) +{ + return(IMRS_OK); +} + + + + + +/*----------------------------------------------------------------------------*/ +/* IO_Hdl_File_Rollback */ +/*----------------------------------------------------------------------------*/ +/* IMRT_Medium *Medium_Ptr */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IO_Hdl_File_Rollback( IMRT_Medium *Medium_Ptr) +{ + return(IMRS_OK); +} diff --git a/src/libio_mng/src/io_hdl_file.h b/src/libio_mng/src/io_hdl_file.h new file mode 100644 index 0000000..264d5e6 --- /dev/null +++ b/src/libio_mng/src/io_hdl_file.h @@ -0,0 +1,149 @@ +/*----------------------------------------------------------------------------*/ +/* File: libio_mng.h */ +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#ifndef _IO_HDL_FILE_H_ +#define _IO_HDL_FILE_H_ + + + +/*----------------------------------------------------------------------------*/ +/* Global Include */ +/*----------------------------------------------------------------------------*/ + +#include + + + + + +/*----------------------------------------------------------------------------*/ +/* Defines */ +/*----------------------------------------------------------------------------*/ + + + + + +/*----------------------------------------------------------------------------*/ +/* Prototypes */ +/*----------------------------------------------------------------------------*/ + +# ifdef _IO_HDL_FILE_C_ + +IMRT_Status IO_Hdl_File_Open( IMRT_Medium *, IMRT_Medium_Path, IMRT_Dir_Id); +IMRT_Status IO_Hdl_File_Close( IMRT_Medium *); +IMRT_Status IO_Hdl_File_Mem_Str( char **, const char *, size_t, const char *, size_t); +IMRT_Status IO_Hdl_File_Read( IMRT_Buffer *, size_t *, IMRT_Medium *, IMRT_Read_Mode); +IMRT_Status IO_Hdl_File_Write( IMRT_Medium *, size_t *, IMRT_Buffer *); +IMRT_Status IO_Hdl_File_Begin( IMRT_Medium *Medium_Ptr); +IMRT_Status IO_Hdl_File_Commit( IMRT_Medium *Medium_Ptr); +IMRT_Status IO_Hdl_File_Rollback( IMRT_Medium *Medium_Ptr); + + +# else + +/*----------------------------------------------------------------------------*/ +/* IO_Hdl_File_Open */ +/*----------------------------------------------------------------------------*/ +/* Medium_Ptr: Pointer to the medium to open */ +/* Medium_Path: Medium Path to open */ +/* Dir_Id: Medium open direction */ +/*----------------------------------------------------------------------------*/ + +extern IMRT_Status IO_Hdl_File_Open( IMRT_Medium *, IMRT_Medium_Path, IMRT_Dir_Id); + + + +/*----------------------------------------------------------------------------*/ +/* IO_Hdl_File_Close */ +/*----------------------------------------------------------------------------*/ +/* Medium_Ptr: Pointer to the medium to close */ +/*----------------------------------------------------------------------------*/ + +extern IMRT_Status IO_Hdl_File_Close( IMRT_Medium *); + + + +/*----------------------------------------------------------------------------*/ +/* IO_Hdl_File_Read */ +/*----------------------------------------------------------------------------*/ +/* Buffer_Ptr: Buffer to write data in */ +/* Read_Len_Ptr: Number of byte readen */ +/* Medium_Path: Medium to read */ +/* Read_Mode: Read mode */ +/*----------------------------------------------------------------------------*/ + +extern IMRT_Status IO_Hdl_File_Read( IMRT_Buffer *, size_t *, IMRT_Medium *, IMRT_Read_Mode); + + + +/*----------------------------------------------------------------------------*/ +/* IO_Hdl_File_Write */ +/*----------------------------------------------------------------------------*/ +/* Medium_Ptr: Pointer to the medium towrite data to */ +/* Write_Len_Ptr: Number of byte writen */ +/* Buffer_Ptr: Buffer to read */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IO_Hdl_File_Write( IMRT_Medium *, size_t *, IMRT_Buffer *); + + + +/*----------------------------------------------------------------------------*/ +/* IO_Hdl_File_Begin */ +/*----------------------------------------------------------------------------*/ +/* IMRT_Medium *Medium_Ptr */ +/*----------------------------------------------------------------------------*/ +extern IMRT_Status IO_Hdl_File_Begin( IMRT_Medium *Medium_Ptr); + + +/*----------------------------------------------------------------------------*/ +/* IO_Hdl_File_Commit */ +/*----------------------------------------------------------------------------*/ +/* IMRT_Medium *Medium_Ptr */ +/*----------------------------------------------------------------------------*/ +extern IMRT_Status IO_Hdl_File_Commit( IMRT_Medium *Medium_Ptr); + + +/*----------------------------------------------------------------------------*/ +/* IO_Hdl_File_Rollback */ +/*----------------------------------------------------------------------------*/ +/* IMRT_Medium *Medium_Ptr */ +/*----------------------------------------------------------------------------*/ +extern IMRT_Status IO_Hdl_File_Rollback( IMRT_Medium *Medium_Ptr); + +# endif + + + + + +/*----------------------------------------------------------------------------*/ + +#endif diff --git a/src/libio_mng/src/io_hdl_mqs.c b/src/libio_mng/src/io_hdl_mqs.c new file mode 100644 index 0000000..63fcd69 --- /dev/null +++ b/src/libio_mng/src/io_hdl_mqs.c @@ -0,0 +1,433 @@ +/*----------------------------------------------------------------------------*/ +/* File: io_hdl_mqs.c */ +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#define _LIBIO_MNG_ +#define _IO_HDL_MQS_C_ + + + +#include "io_hdl_mqs.h" + + + + + +/*----------------------------------------------------------------------------*/ +/* IO_Hdl_MQS_Open */ +/*----------------------------------------------------------------------------*/ +/* Medium_Ptr: Pointer to the medium to open */ +/* Medium_Path: Medium Path to open */ +/* Dir_Id: Medium open direction */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IO_Hdl_MQS_Open( IMRT_Medium *Medium_Ptr, IMRT_Medium_Path Medium_Path, IMRT_Dir_Id Dir_Id) +{ + MQLONG comp_code; /* completion code */ + MQLONG reason_code; /* reason code */ + char *pos_slash_ptr; + MQOD od = {MQOD_DEFAULT}; /* Object Descriptor */ + MQLONG options; /* MQOPEN/MQCLOSE options */ + + + if( Dir_Id == IMRD_DIR_ID_IN) + { + /*positionnenment des option d'ouverture du de la Queue*/ + options = MQOO_INPUT_AS_Q_DEF | MQOO_FAIL_IF_QUIESCING; /* open queue for input but not if MQM stopping */ + } + else + { + if( Dir_Id == IMRD_DIR_ID_OUT) + { + /*positionnenment des option d'ouverture du de la Queue*/ + options = MQOO_OUTPUT | MQOO_FAIL_IF_QUIESCING; /* open queue for output but not if MQM stopping */ + } + else + { + IMRD_LM_LOG_ERROR_1( "Invalid Dir_Id (%d) !", Dir_Id); + + return( IMRS_KO); + } + } + + pos_slash_ptr = strstr( Medium_Path, "/"); + + if( pos_slash_ptr == NULL) + { + IMRD_LM_LOG_ERROR_1( "Invalid mqs path [%s] !", Medium_Path); + return( IMRS_KO); + } + + strncpy( Medium_Ptr->MQS.Queue_Mng, Medium_Path, strlen( Medium_Path) - strlen( pos_slash_ptr)); + Medium_Ptr->MQS.Queue_Mng[ strlen( Medium_Path) - strlen( pos_slash_ptr)] = '\0'; + + strcpy( Medium_Ptr->MQS.Queue_Name, ( pos_slash_ptr + 1)); + + /*queue manager connection*/ + MQCONN( Medium_Ptr->MQS.Queue_Mng, &( Medium_Ptr->MQS.Conn_Hdl), &comp_code, &reason_code); + + if( comp_code == MQCC_FAILED) + { + IMRD_LM_LOG_ERROR_2( "MQCONN ended with reason code (%d) for this path [%s] !", reason_code, Medium_Path); + + return( IMRS_KO); + } + + strcpy( od.ObjectName, Medium_Ptr->MQS.Queue_Name); + + /*open the queue*/ + MQOPEN( Medium_Ptr->MQS.Conn_Hdl, &od, options, &( Medium_Ptr->MQS.Obj_Hdl), &comp_code, &reason_code); + + /* report reason, if any; stop if failed */ + if( reason_code != MQRC_NONE) + { + IMRD_LM_LOG_ERROR_2( "MQOPEN ended with reason code (%d) for this path [%s] !", reason_code, Medium_Path); + + return( IMRS_KO); + } + + if( comp_code == MQCC_FAILED) + { + IMRD_LM_LOG_ERROR_1( "Unable to open queue for this path [%s] !", Medium_Path); + + return( IMRS_KO); + } + else + { + IMRD_LM_LOG_TRACE_3( IMRD_LOG_LEVEL_VERBOSE_1, "Queue_Mng: [%s] Queue: [%s] Dir: [%s] opened !", Medium_Ptr->MQS.Queue_Mng, Medium_Ptr->MQS.Queue_Name, ( ( Dir_Id == IMRD_DIR_ID_IN) ? "in" : ( ( Dir_Id == IMRD_DIR_ID_OUT) ? "out" : "unknown"))); + + return( IMRS_OK); + } +} + + + + + +/*----------------------------------------------------------------------------*/ +/* IO_Hdl_MQS_Close */ +/*----------------------------------------------------------------------------*/ +/* Medium_Ptr: Pointer to the medium to close */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IO_Hdl_MQS_Close( IMRT_Medium *Medium_Ptr) +{ + MQLONG comp_code; /* completion code */ + MQLONG reason_code; /* reason code */ + char *pos_slash_ptr; + MQOD od = {MQOD_DEFAULT}; /* Object Descriptor */ + + + MQCLOSE( Medium_Ptr->MQS.Conn_Hdl, &( Medium_Ptr->MQS.Obj_Hdl), MQCO_NONE, &comp_code, &reason_code); + + if( reason_code != MQRC_NONE) + { + IMRD_LM_LOG_ERROR_2( "MQCLOSE ended with reason code [%d] for queue: [%s] !", reason_code, Medium_Ptr->MQS.Queue_Name); + + return( IMRS_KO); + } + + MQDISC( &Medium_Ptr->MQS.Conn_Hdl, &comp_code, &reason_code); + + /* report reason, if any */ + if( reason_code != MQRC_NONE) + { + IMRD_LM_LOG_ERROR_2( "MQCLOSE ended with reason code [%d] for queue: [%s] !", reason_code, Medium_Ptr->MQS.Queue_Name); + + return( IMRS_KO); + } + else + { + IMRD_LM_LOG_TRACE_2( IMRD_LOG_LEVEL_VERBOSE_1, "Queue_Mng: [%s] Queue: [%s] closed !", Medium_Ptr->MQS.Queue_Mng, Medium_Ptr->MQS.Queue_Name); + + return( IMRS_OK); + } +} + + + + + +/*----------------------------------------------------------------------------*/ +/* IO_Hdl_MQS_Read */ +/*----------------------------------------------------------------------------*/ +/* Buffer_Ptr: Buffer to write data in */ +/* Read_Len_Ptr: Number of byte writen */ +/* Medium_Path: Medium to read */ +/* Read_Mode: Read mode */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IO_Hdl_MQS_Read( IMRT_Buffer *Buffer_Ptr, size_t *Read_Len_Ptr, IMRT_Medium *Medium_Ptr, IMRT_Read_Mode Read_Mode) +{ + MQLONG comp_code; /* completion code */ + MQLONG reason_code; /* reason code */ + IMRT_MQS_Buffer *buffer_ptr; + MQLONG buffer_len; + MQGMO gmo = {MQGMO_DEFAULT}; /* get message options */ + MQMD md = {MQMD_DEFAULT}; /* Message Descriptor */ + + + + + switch( Read_Mode) + { + case IMRD_READ_MODE_WAIT: + { + gmo.Options = MQGMO_WAIT ; + break; + } + + case IMRD_READ_MODE_NO_WAIT: + { + gmo.Options = MQGMO_NO_WAIT ; + break; + } + + default: + { + IMRD_LM_LOG_ERROR_1( "Unknown Read_Mode: (%d) !", Read_Mode); + + return( IMRS_KO); + } + } + + gmo.Options |= MQGMO_CONVERT; + + if( Medium_Ptr->Tran_Flag == IMRD_MEDIUM_TRAN_FLAG_IN) + { + gmo.Options |= MQGMO_SYNCPOINT; + } + +// gmo.WaitInterval = MQWI_UNLIMITED; + gmo.WaitInterval = 10000; + + if( ( buffer_ptr = malloc( IMRD_MQS_BUFFER_SIZE)) == NULL) + { + IMRD_LM_LOG_ERROR_1( "Can't allocate MQS Buffer (%d) !", errno); + + return( IMRS_KO); + } + + memcpy( md.MsgId, MQMI_NONE, sizeof(md.MsgId)); + memcpy( md.CorrelId, MQCI_NONE, sizeof(md.CorrelId)); + md.Encoding = MQENC_NATIVE; + md.CodedCharSetId = MQCCSI_Q_MGR; + + do + { + + MQGET( Medium_Ptr->MQS.Conn_Hdl, Medium_Ptr->MQS.Obj_Hdl, &md, &gmo, IMRD_MQS_BUFFER_SIZE, buffer_ptr, &buffer_len, &comp_code, &reason_code); + + } while( ( Read_Mode == IMRD_READ_MODE_WAIT) && ( reason_code == MQRC_NO_MSG_AVAILABLE) && ( IMRG_Base.Sig_Trapped == 0)); + + if( reason_code != MQRC_NONE) + { + if( reason_code == MQRC_NO_MSG_AVAILABLE) + { + free( buffer_ptr); + + if( IMRG_Base.Sig_Trapped == 0) + { + IMRD_LM_LOG_TRACE_2( IMRD_LOG_LEVEL_VERBOSE_1, "No more data to read from Queue_Mng: [%s] Queue: [%s] !", Medium_Ptr->MQS.Queue_Mng, Medium_Ptr->MQS.Queue_Name); + + return( IMRS_NO_DATA); + } + else + { + IMRD_LM_LOG_TRACE_2( IMRD_LOG_LEVEL_VERBOSE_1, "Signal received during reading from Queue_Mng: [%s] Queue: [%s] !", Medium_Ptr->MQS.Queue_Mng, Medium_Ptr->MQS.Queue_Name); + + return( IMRS_SIGNAL); + } + } + else + { + if( reason_code == MQRC_TRUNCATED_MSG_FAILED) + { + IMRD_LM_LOG_ERROR_2( "MQGET failed: truncated message rc: [%d] for queue: [%s] !", reason_code, Medium_Ptr->MQS.Queue_Name); + + return( IMRS_KO); + } + else + { + IMRD_LM_LOG_ERROR_2( "MQGET failed: rc: [%d] for queue: [%s] !", reason_code, Medium_Ptr->MQS.Queue_Name); + + return( IMRS_KO); + } + } + } + else + { + if( comp_code == MQCC_FAILED) + { + IMRD_LM_LOG_ERROR_2( "MQGET failed: ??? rc: [%d] for queue: [%s] !", reason_code, Medium_Ptr->MQS.Queue_Name); + + return( IMRS_KO); + } + else + { + + buffer_ptr[ buffer_len] = '\0'; /* add terminator */ + + Buffer_Ptr->Data_Buf_Ptr = (IMRT_Buffer_Data *)buffer_ptr; + Buffer_Ptr->Data_Buf_Len = (size_t)buffer_len; + Buffer_Ptr->Data_Buf_Size = IMRD_MQS_BUFFER_SIZE; + Buffer_Ptr->Status = IMRD_BUFFER_STATUS_ALLOCATED; + + *Read_Len_Ptr = Buffer_Ptr->Data_Buf_Len; + + if( IMR_SDM_Fmt_Id_Get( &( Buffer_Ptr->Fmt_Id), "Fixed") != IMRS_OK) + { + IMRD_LM_LOG_ERROR_1( "Can't get FmtId: (%d) !", Buffer_Ptr->Fmt_Id); + + return( IMRS_KO); + } + else + { + IMRD_LM_LOG_TRACE_3( IMRD_LOG_LEVEL_VERBOSE_1, "Read (%d) bytes from Queue_Mng: [%s] Queue: [%s] !", Buffer_Ptr->Data_Buf_Len, Medium_Ptr->MQS.Queue_Mng, Medium_Ptr->MQS.Queue_Name); + + return( IMRS_OK); + } + } + } +} + + + + +/*----------------------------------------------------------------------------*/ +/* IO_Hdl_MQS_Write */ +/*----------------------------------------------------------------------------*/ +/* Medium_Ptr: Pointer to the medium to write data to */ +/* Write_Len_Ptr: Number of byte writen */ +/* Buffer_Ptr: Buffer to read */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IO_Hdl_MQS_Write( IMRT_Medium *Medium_Ptr, size_t *Write_Len_Ptr, IMRT_Buffer *Buffer_Ptr) +{ + MQLONG comp_code; /* completion code */ + MQLONG reason_code; /* reason code */ + MQPMO pmo = {MQPMO_DEFAULT}; /* put message options */ + MQMD md = {MQMD_DEFAULT}; /* Message Descriptor */ + + + memcpy( md.Format, MQFMT_STRING, (size_t)MQ_FORMAT_LENGTH); + + pmo.Options |= MQPMO_NEW_MSG_ID | MQPMO_NEW_CORREL_ID; + + if( Medium_Ptr->Tran_Flag == IMRD_MEDIUM_TRAN_FLAG_IN) + { + pmo.Options |= MQPMO_SYNCPOINT; + } + + MQPUT( Medium_Ptr->MQS.Conn_Hdl, Medium_Ptr->MQS.Obj_Hdl, &md, &pmo, (MQLONG)( Buffer_Ptr->Data_Buf_Len), Buffer_Ptr->Data_Buf_Ptr, &comp_code, &reason_code); + + if( reason_code != MQRC_NONE) + { + IMRD_LM_LOG_ERROR_2( "MQPUT failed: (%d) for queue: [%s] !", reason_code, Medium_Ptr->MQS.Queue_Name); + + return( IMRS_KO); + } + else + { + *Write_Len_Ptr = Buffer_Ptr->Data_Buf_Len; + IMRD_LM_LOG_TRACE_3( IMRD_LOG_LEVEL_VERBOSE_1, "Wrote (%d) bytes to Queue_Mng: [%s] Queue: [%s]!", *Write_Len_Ptr, Medium_Ptr->MQS.Queue_Mng, Medium_Ptr->MQS.Queue_Name); + + return( IMRS_OK); + } +} + + + +/*----------------------------------------------------------------------------*/ +/* IO_Hdl_MQS_Begin */ +/*----------------------------------------------------------------------------*/ +/* Medium_Ptr: Pointer to the medium */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IO_Hdl_MQS_Begin( IMRT_Medium *Medium_Ptr) +{ + + return(IMRS_OK); + +} + + + +/*----------------------------------------------------------------------------*/ +/* IO_Hdl_MQS_Commit */ +/*----------------------------------------------------------------------------*/ +/* Medium_Ptr: Pointer to the medium */ +/*----------------------------------------------------------------------------*/ + + +IMRT_Status IO_Hdl_MQS_Commit( IMRT_Medium *Medium_Ptr) +{ + MQLONG comp_code; /* completion code */ + MQLONG reason_code; /* reason code */ + IMRT_Status status; + + status = IMRS_OK; + + MQCMIT(Medium_Ptr->MQS.Conn_Hdl, + &comp_code, + &reason_code); + if( reason_code != MQRC_NONE) + { + IMRD_LM_LOG_ERROR_2( "MQCMIT failed: (%d) for queue: [%s] !", reason_code, Medium_Ptr->MQS.Queue_Name); + status = IMRS_KO; + } + return(status); + +} + +/*----------------------------------------------------------------------------*/ +/* IO_Hdl_MQS_Rollback */ +/*----------------------------------------------------------------------------*/ +/* Medium_Ptr: Pointer to the medium */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IO_Hdl_MQS_Rollback( IMRT_Medium *Medium_Ptr) +{ + MQLONG comp_code; /* completion code */ + MQLONG reason_code; /* reason code */ + IMRT_Status status; + + status = IMRS_OK; + + MQBACK(Medium_Ptr->MQS.Conn_Hdl, + &comp_code, + &reason_code); + if( reason_code != MQRC_NONE) + { + IMRD_LM_LOG_ERROR_2( "MQBACK failed: (%d) for queue: [%s] !", reason_code, Medium_Ptr->MQS.Queue_Name); + status = IMRS_KO; + } + + return(status); + +} diff --git a/src/libio_mng/src/io_hdl_mqs.h b/src/libio_mng/src/io_hdl_mqs.h new file mode 100644 index 0000000..53a4167 --- /dev/null +++ b/src/libio_mng/src/io_hdl_mqs.h @@ -0,0 +1,149 @@ +/*----------------------------------------------------------------------------*/ +/* File: io_hdl_mqs.h */ +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#ifndef _IO_HDL_MQS_H_ +#define _IO_HDL_MQS_H_ + + + +/*----------------------------------------------------------------------------*/ +/* Global Include */ +/*----------------------------------------------------------------------------*/ + +#include + + + + + +/*----------------------------------------------------------------------------*/ +/* Defines */ +/*----------------------------------------------------------------------------*/ + + + + + +/*----------------------------------------------------------------------------*/ +/* Prototypes */ +/*----------------------------------------------------------------------------*/ + +# ifdef _IO_HDL_MQS_C_ + +IMRT_Status IO_Hdl_MQS_Open( IMRT_Medium *, IMRT_Medium_Path, IMRT_Dir_Id); +IMRT_Status IO_Hdl_MQS_Close( IMRT_Medium *); +IMRT_Status IO_Hdl_MQS_Read( IMRT_Buffer *, size_t *, IMRT_Medium *, IMRT_Read_Mode); +IMRT_Status IO_Hdl_MQS_Write( IMRT_Medium *, size_t *, IMRT_Buffer *); +IMRT_Status IO_Hdl_MQS_Commit( IMRT_Medium *); +IMRT_Status IO_Hdl_MQS_Rollback( IMRT_Medium *); +IMRT_Status IO_Hdl_MQS_Begin( IMRT_Medium *); + +# else + +/*----------------------------------------------------------------------------*/ +/* IO_Hdl_MQS_Open */ +/*----------------------------------------------------------------------------*/ +/* Medium_Ptr: Pointer to the medium to open */ +/* Medium_Path: Medium Path to open */ +/* Dir_Id: Medium open direction */ +/*----------------------------------------------------------------------------*/ + +extern IMRT_Status IO_Hdl_MQS_Open( IMRT_Medium *, IMRT_Medium_Path, IMRT_Dir_Id); + + + +/*----------------------------------------------------------------------------*/ +/* IO_Hdl_MQS_Close */ +/*----------------------------------------------------------------------------*/ +/* Medium_Ptr: Pointer to the medium to close */ +/*----------------------------------------------------------------------------*/ + +extern IMRT_Status IO_Hdl_MQS_Close( IMRT_Medium *); + + + +/*----------------------------------------------------------------------------*/ +/* IO_Hdl_MQS_Read */ +/*----------------------------------------------------------------------------*/ +/* Buffer_Ptr: Buffer to write data in */ +/* Read_Len_Ptr: Number of byte writen */ +/* Medium_Path: Medium to read */ +/* Read_Mode: Read mode */ +/*----------------------------------------------------------------------------*/ + +extern IMRT_Status IO_Hdl_MQS_Read( IMRT_Buffer *, size_t *, IMRT_Medium *, IMRT_Read_Mode); + + + +/*----------------------------------------------------------------------------*/ +/* IO_Hdl_MQS_Write */ +/*----------------------------------------------------------------------------*/ +/* Medium_Ptr: Pointer to the medium towrite data to */ +/* Write_Len_Ptr: Number of byte writen */ +/* Buffer_Ptr: Buffer to read */ +/*----------------------------------------------------------------------------*/ + +extern IMRT_Status IO_Hdl_MQS_Write( IMRT_Medium *, size_t *, IMRT_Buffer *); + + +/*----------------------------------------------------------------------------*/ +/* IO_Hdl_MQS_Commit */ +/*----------------------------------------------------------------------------*/ +/* Medium_Ptr: Pointer to the medium */ +/*----------------------------------------------------------------------------*/ + +extern IMRT_Status IO_Hdl_MQS_Commit( IMRT_Medium *); + +/*----------------------------------------------------------------------------*/ +/* IO_Hdl_MQS_Rollback */ +/*----------------------------------------------------------------------------*/ +/* Medium_Ptr: Pointer to the medium */ +/*----------------------------------------------------------------------------*/ + +extern IMRT_Status IO_Hdl_MQS_Rollback( IMRT_Medium *); + +/*----------------------------------------------------------------------------*/ +/* IO_Hdl_MQS_Begin */ +/*----------------------------------------------------------------------------*/ +/* Medium_Ptr: Pointer to the medium */ +/*----------------------------------------------------------------------------*/ + +extern IMRT_Status IO_Hdl_MQS_Begin( IMRT_Medium *); + + + +# endif + + + + + +/*----------------------------------------------------------------------------*/ + +#endif diff --git a/src/libio_mng/src/io_hdl_tux.c b/src/libio_mng/src/io_hdl_tux.c new file mode 100644 index 0000000..089ff16 --- /dev/null +++ b/src/libio_mng/src/io_hdl_tux.c @@ -0,0 +1,595 @@ +/*----------------------------------------------------------------------------*/ +/* File: io_hdl_tux.c */ +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#define _LIBIO_MNG_ +#define _IO_HDL_TUX_C_ + + + +#include "io_hdl_tux.h" + + + + + +/*----------------------------------------------------------------------------*/ +/* IO_Hdl_Tux_Open */ +/*----------------------------------------------------------------------------*/ +/* Medium_Ptr: Pointer to the medium to open */ +/* Medium_Path: Medium Path to open */ +/* Dir_Id: Medium open direction */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IO_Hdl_Tux_Open( IMRT_Medium *Medium_Ptr, IMRT_Medium_Path Medium_Path, IMRT_Dir_Id Dir_Id) +{ + char *Pos_Slash_Ptr; + + + Pos_Slash_Ptr = strstr(Medium_Path, "/"); + + if(Pos_Slash_Ptr == NULL) + { + IMRD_LM_LOG_ERROR_1( "Invalid tux path [%s] !", Medium_Path); + + return( IMRS_KO); + } + else + { + strncpy(Medium_Ptr->Tux.Queue_Space, Medium_Path, strlen(Medium_Path) - strlen(Pos_Slash_Ptr)); + Medium_Ptr->Tux.Queue_Space[strlen(Medium_Path) - strlen(Pos_Slash_Ptr)] = '\0'; + + strcpy(Medium_Ptr->Tux.Queue_Name, (Pos_Slash_Ptr + 1)); + + if( Queue_Exist( Medium_Ptr->Tux.Queue_Space, Medium_Ptr->Tux.Queue_Name) != IMRS_OK) + { + IMRD_LM_LOG_ERROR_2( "Tux Queue doesn't exist: Queue_Space: [%s] Queue: [%s] !", Medium_Ptr->Tux.Queue_Space, Medium_Ptr->Tux.Queue_Name); + return( IMRS_KO); + } + else + { + IMRD_LM_LOG_TRACE_2( IMRD_LOG_LEVEL_VERBOSE_1, "Queue_Space: [%s] Queue: [%s] opened !", Medium_Ptr->Tux.Queue_Space, Medium_Ptr->Tux.Queue_Name); + + return( IMRS_OK); + } + } +} + + + + + +/*----------------------------------------------------------------------------*/ +/* IO_Hdl_Tux_Close */ +/*----------------------------------------------------------------------------*/ +/* Medium_Ptr: Pointer to the medium to close */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IO_Hdl_Tux_Close( IMRT_Medium *Medium_Ptr) +{ + IMRD_LM_LOG_TRACE_2( IMRD_LOG_LEVEL_VERBOSE_1, "Queue_Space: [%s] Queue: [%s] closed !", Medium_Ptr->Tux.Queue_Space, Medium_Ptr->Tux.Queue_Name); + + return( IMRS_OK); +} + + + + + +/*----------------------------------------------------------------------------*/ +/* IO_Hdl_Tux_Read */ +/*----------------------------------------------------------------------------*/ +/* Buffer_Ptr: Buffer to write data in */ +/* Read_Len_Ptr: Number of byte writen */ +/* Medium_Path: Medium to read */ +/* Read_Mode: Read mode */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IO_Hdl_Tux_Read( IMRT_Buffer *Buffer_Ptr, size_t *Read_Len_Ptr, IMRT_Medium *Medium_Ptr, IMRT_Read_Mode Read_Mode) +{ + IMRT_Tux_Buffer *Tux_Buffer_Ptr = NULL; + TPQCTL queue_param; + long len; + long flags; + + + memset(queue_param.corrid, '\0', sizeof(queue_param.corrid)); + + switch( Read_Mode) + { + case IMRD_READ_MODE_WAIT: + { + queue_param.flags = TPQWAIT; + break; + } + + case IMRD_READ_MODE_NO_WAIT: + { + break; + } + + + default: + { + IMRD_LM_LOG_ERROR_1( "Unknown Read_Mode: (%d) !", Read_Mode); + + return( IMRS_KO); + } + } + + queue_param.diagnostic = 0L; + + if( ( Tux_Buffer_Ptr = (IMRT_Tux_Buffer *)tpalloc(IMRD_FML_TYPE_32, NULL, IMRD_TUX_BUFFER_SIZE)) == NULL) + { + IMRD_LM_LOG_ERROR_1( "Can't allocate Tux_Buffer_Ptr [%s] !", tpstrerror(tperrno)); + + return( IMRS_KO); + } + + if( Finit32( (IMRT_Tux_Buffer *)Tux_Buffer_Ptr, (FLDLEN32)IMRD_TUX_BUFFER_SIZE) == -1) + { + IMRD_LM_LOG_ERROR_1( "Can't initialize Tux_Buffer_Ptr [%s] !", Fstrerror32(Ferror32)); + + return( IMRS_KO); + } + + + if( tpdequeue( Medium_Ptr->Tux.Queue_Space, Medium_Ptr->Tux.Queue_Name, &queue_param, (char **)&Tux_Buffer_Ptr, &len, TPNOTIME) == -1) + { + switch( tperrno) + { + case TPGOTSIG: + { + IMRD_LM_LOG_TRACE_2( IMRD_LOG_LEVEL_VERBOSE_1, "Signal received during reading from QSpace [%s] QueueName [%s] !", Medium_Ptr->Tux.Queue_Space, Medium_Ptr->Tux.Queue_Name); + + return( IMRS_SIGNAL); + } + + default: + { + switch( queue_param.diagnostic) + { + case QMENOMSG: + { + IMRD_LM_LOG_TRACE_2( IMRD_LOG_LEVEL_VERBOSE_1, "No more data to read from QSpace [%s] QueueName [%s] !", Medium_Ptr->Tux.Queue_Space, Medium_Ptr->Tux.Queue_Name); + + return( IMRS_NO_DATA); + } + + default: + { + IMRD_LM_LOG_ERROR_4( "Can't read buffer from QSpace [%s] QueueName [%s] : [%s] [%d] !", Medium_Ptr->Tux.Queue_Space, Medium_Ptr->Tux.Queue_Name, tpstrerror(tperrno), queue_param.diagnostic); + + return( IMRS_KO); + } + } + } + } + } + else + { + Buffer_Ptr->Data_Buf_Ptr = (IMRT_Buffer_Data *)Tux_Buffer_Ptr; + Buffer_Ptr->Data_Buf_Len = Fused32( Tux_Buffer_Ptr); + Buffer_Ptr->Data_Buf_Size = Fsizeof32( Tux_Buffer_Ptr); + Buffer_Ptr->Status = IMRD_BUFFER_STATUS_ALLOCATED; + + *Read_Len_Ptr = Buffer_Ptr->Data_Buf_Len; + + if( IMR_SDM_Fmt_Id_Get( &( Buffer_Ptr->Fmt_Id), "FML") != IMRS_OK) + { + IMRD_LM_LOG_ERROR_0( "Can't get FmtId !"); + + return( IMRS_KO); + } + else + { + IMRD_LM_LOG_TRACE_3( IMRD_LOG_LEVEL_VERBOSE_1, "Read (%d) bytes from Queue_Space: [%s] Queue: [%s] !", Buffer_Ptr->Data_Buf_Len, Medium_Ptr->Tux.Queue_Space, Medium_Ptr->Tux.Queue_Name); + + return( IMRS_OK); + } + } +} + + + + + +/*----------------------------------------------------------------------------*/ +/* IO_Hdl_Tux_Write */ +/*----------------------------------------------------------------------------*/ +/* Medium_Ptr: Pointer to the medium to write data to */ +/* Write_Len_Ptr: Number of byte writen */ +/* Buffer_Ptr: Buffer to read */ +/* Write_Len_Ptr: Number of byte writen */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IO_Hdl_Tux_Write( IMRT_Medium *Medium_Ptr, size_t *Write_Len_Ptr, IMRT_Buffer *Buffer_Ptr) +{ + TPQCTL queue_param; + + memset( queue_param.corrid, '\0', sizeof( queue_param.corrid)); + queue_param.flags = 0L; + queue_param.diagnostic = 0L; + + if( tpenqueue( Medium_Ptr->Tux.Queue_Space, Medium_Ptr->Tux.Queue_Name, &queue_param, Buffer_Ptr->Data_Buf_Ptr, 0, TPNOFLAGS) == -1) + { + IMRD_LM_LOG_ERROR_3( "Can't write buffer to QSpace [%s] QueueName [%s] : [%s] !", Medium_Ptr->Tux.Queue_Space, Medium_Ptr->Tux.Queue_Name, tpstrerror(tperrno) ); + + + return( IMRS_KO); + } + else + { + *Write_Len_Ptr = Buffer_Ptr->Data_Buf_Len; + IMRD_LM_LOG_TRACE_3( IMRD_LOG_LEVEL_VERBOSE_1, "Wrote (%d) bytes to Queue_Space: [%s] Queue: [%s]!", *Write_Len_Ptr, Medium_Ptr->Tux.Queue_Space, Medium_Ptr->Tux.Queue_Name); + + return( IMRS_OK); + } +} + + + + + +/*----------------------------------------------------------------------------*/ +/* Queue_Alloc */ +/*----------------------------------------------------------------------------*/ +/* Buf_Ptr_Ptr: Tuxedo Buffer */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status Queue_Alloc( IMRT_Tux_Buffer **Buf_Ptr_Ptr) +{ + if( ( *Buf_Ptr_Ptr = (IMRT_Tux_Buffer *)tpalloc( IMRD_FML_TYPE_32, NULL, IMRD_TUX_BUFFER_SIZE)) == NULL) + { + IMRD_LM_LOG_ERROR_1( "Can't tpalloc Buffer: [%s] !", tpstrerror( tperrno)); + + return( IMRS_KO); + } + + if( Finit32( (IMRT_Tux_Buffer *)*Buf_Ptr_Ptr, (FLDLEN32)IMRD_TUX_BUFFER_SIZE) == -1) + { + IMRD_LM_LOG_ERROR_1( "Can't Finit32 Buffer: [%s] !", Fstrerror32( Ferror32)); + + return( IMRS_KO); + } + + return( IMRS_OK); +} + + + + + +/*----------------------------------------------------------------------------*/ +/* Queue_Free */ +/*----------------------------------------------------------------------------*/ +/* Buf_Ptr: Tuxedo Buffer */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status Queue_Free( IMRT_Tux_Buffer *Buf_Ptr) +{ + if( Buf_Ptr != NULL) + { + tpfree( (char *)Buf_Ptr); + } +} + + + + + +/*----------------------------------------------------------------------------*/ +/* Queue_Exist_Mib */ +/*----------------------------------------------------------------------------*/ +/* Queue_Space: Queue Space Name */ +/* Queue_Name: Queue Name */ +/* Request_Buf_Ptr: Request Tuxedo Buffer */ +/* Response_Buf_Ptr: Response Tuxedo Buffer */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status Queue_Exist_Mib( IMRT_Tux_Queue_Space Queue_Space, IMRT_Tux_Queue_Name Queue_Name, IMRT_Tux_Buffer *Request_Buf_Ptr, IMRT_Tux_Buffer *Response_Buf_Ptr) +{ + IMRT_Tux_Lmid lmid; + long fldid1, fldid2; + long nb_occurs = 0L; + long rlen = 0L; + IMRT_Tux_Open_Info open_info; + char *qmconfig, *appqspacename; + int i; + + + if( Fchg32( Request_Buf_Ptr, TA_OPERATION, 0, "GET", 0) == -1) + { + IMRD_LM_LOG_ERROR_1( "Fchg32 TA_OPERATION: [%s] !", Fstrerror32( Ferror32)); + return( IMRS_KO); + } + + if( Fchg32( Request_Buf_Ptr, TA_CLASS, 0, "T_GROUP", 0) == -1) + { + IMRD_LM_LOG_ERROR_1( "Fchg32 TA_CLASS: [%s] !", Fstrerror32( Ferror32)); + return( IMRS_KO); + } + + if( Fchg32( Request_Buf_Ptr, TA_TMSNAME, 0, "TMS_QM", 0) == -1) + { + IMRD_LM_LOG_ERROR_1( "Fchg32 TA_TMSNAME: [%s] !", Fstrerror32( Ferror32)); + return( IMRS_KO); + } + + fldid1 = TA_OPENINFO; + if( Fchg32( Request_Buf_Ptr, TA_FILTER, 0, (char *)&fldid1, 0) == -1) + { + IMRD_LM_LOG_ERROR_1( "Fchg32 TA_FILTER: [%s] !", Fstrerror32( Ferror32)); + return( IMRS_KO); + } + + fldid2 = TA_LMID; + if( Fchg32( Request_Buf_Ptr, TA_FILTER, 1, (char *)&fldid2, 0) == -1) + { + IMRD_LM_LOG_ERROR_1( "Fchg32 TA_FILTER: [%s] !", Fstrerror32( Ferror32)); + return( IMRS_KO); + } + + if( tpcall( IMRD_TMIB_SERVICE, (void *)Request_Buf_Ptr,0, (char**)&Response_Buf_Ptr, &rlen, 0L) < 0) + { + IMRD_LM_LOG_ERROR_1( "Error tpcall: [%s] !", tpstrerror( tperrno)); + return( IMRS_KO); + } + + if( Fget32( Response_Buf_Ptr, TA_OCCURS, 0, (char *)&nb_occurs, NULL) == -1 ) + { + IMRD_LM_LOG_ERROR_1( "Fget32 TA_OCCURS: [%s] !", Fstrerror32( Ferror32)); + return( IMRS_KO); + } + + for( i=0; i < nb_occurs; i++) + { + if( Fget32( Response_Buf_Ptr, TA_OPENINFO, i, open_info, NULL) == -1) + { + IMRD_LM_LOG_ERROR_1( "Fget32 TA_OPENINFO: [%s] !", Fstrerror32( Ferror32)); + return( IMRS_KO); + } + + qmconfig = (char *)strchr(open_info, ':')+1; + appqspacename = (char *)strchr(qmconfig, ':'); + appqspacename[0] = 0; + appqspacename++; + + if( strcmp( appqspacename, Queue_Space) == 0) + { + i = nb_occurs; + } + } + + if( Fget32( Response_Buf_Ptr, TA_LMID, 0, lmid, NULL) == -1) + { + IMRD_LM_LOG_ERROR_1( "Fget32 TA_LMID: [%s] !", Fstrerror32( Ferror32)); + return( IMRS_KO); + } + + if( Finit32( (FBFR32 *)Request_Buf_Ptr, (FLDLEN32)IMRD_TUX_BUFFER_SIZE) == -1 ) + { + IMRD_LM_LOG_ERROR_1( "Finit32 Buffer1: [%s] !", Fstrerror32( Ferror32)); + return( IMRS_KO); + } + + if( Finit32( (FBFR32 *)Response_Buf_Ptr, (FLDLEN32)IMRD_TUX_BUFFER_SIZE) == -1 ) + { + IMRD_LM_LOG_ERROR_1( "Finit32 Buffer2: [%s] !", Fstrerror32( Ferror32)); + return( IMRS_KO); + } + + if( Fchg32( Request_Buf_Ptr, TA_OPERATION, 0, "GET", 0) == -1) + { + IMRD_LM_LOG_ERROR_1( "Fchg32 TA_OPERATION: [%s] !", Fstrerror32( Ferror32)); + return( IMRS_KO); + } + + if( Fchg32( Request_Buf_Ptr, TA_CLASS, 0, "T_APPQ", 0) == -1) + { + IMRD_LM_LOG_ERROR_1( "Fchg32 TA_CLASS: [%s] !", Fstrerror32( Ferror32)); + return( IMRS_KO); + } + + if( Fchg32( Request_Buf_Ptr, TA_APPQSPACENAME, 0, Queue_Space, 0) == -1) + { + IMRD_LM_LOG_ERROR_1( "Fchg32 TA_APPQSPACENAME: [%s] !", Fstrerror32( Ferror32)); + return( IMRS_KO); + } + + if( Fchg32( Request_Buf_Ptr, TA_APPQNAME, 0, Queue_Name, 0) == -1) + { + IMRD_LM_LOG_ERROR_1( "Fchg32 TA_APPQNAME: [%s] !", Fstrerror32( Ferror32)); + return( IMRS_KO); + } + + if( Fchg32( Request_Buf_Ptr, TA_QMCONFIG, 0, qmconfig, 0) == -1) + { + IMRD_LM_LOG_ERROR_1( "Fchg32 TA_QMCONFIG: [%s] !", Fstrerror32( Ferror32)); + return( IMRS_KO); + } + + if( Fchg32( Request_Buf_Ptr, TA_LMID, 0, lmid, 0) == -1) + { + IMRD_LM_LOG_ERROR_1( "Fchg32 TA_LMID: [%s] !", Fstrerror32( Ferror32)); + return( IMRS_KO); + } + + fldid1 = TA_APPQNAME; + if( Fchg32( Request_Buf_Ptr, TA_FILTER, 0, (char *)&fldid1, 0) == -1) + { + IMRD_LM_LOG_ERROR_1( "Fchg32 TA_FILTER: [%s] !", Fstrerror32( Ferror32)); + return( IMRS_KO); + } + + if( tpcall( IMRD_TMIB_SERVICE, (void *)Request_Buf_Ptr, 0, (char**)&Response_Buf_Ptr, &rlen, 0L) < 0) + { + IMRD_LM_LOG_ERROR_1( "Error tpcall: [%s] !", tpstrerror( tperrno)); + return( IMRS_KO); + } + + if( Fget32( Response_Buf_Ptr, TA_OCCURS, 0, (char *)&nb_occurs, NULL) == -1) + { + IMRD_LM_LOG_ERROR_1( "Fget32 TA_OCCURS: [%s] !", Fstrerror32( Ferror32)); + return( IMRS_KO); + } + + if( nb_occurs != 0) + { + return( IMRS_OK); + } + else + { + return( IMRS_KO); + } +} + + + + + +/*----------------------------------------------------------------------------*/ +/* IO_Hdl_Tux_Exist_Queue */ +/*----------------------------------------------------------------------------*/ +/* Queue_Space: Queue Space Name */ +/* Queue_Name: Queue Name */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status Queue_Exist( IMRT_Tux_Queue_Space Queue_Space, IMRT_Tux_Queue_Name Queue_Name) +{ + IMRT_Status status; + IMRT_Tux_Buffer *Request_Buffer_Ptr, *Response_Buffer_Ptr; + + + if( ( status = Queue_Alloc( &Request_Buffer_Ptr)) == IMRS_OK) + { + if( ( status = Queue_Alloc( &Response_Buffer_Ptr)) == IMRS_OK) + { + status = Queue_Exist_Mib( Queue_Space, Queue_Name, Request_Buffer_Ptr, Response_Buffer_Ptr); + + Queue_Free( Response_Buffer_Ptr); + } + + Queue_Free( Request_Buffer_Ptr); + } + + return( status); +} + + +/*----------------------------------------------------------------------------*/ +/* IO_Hdl_Tux_Begin */ +/*----------------------------------------------------------------------------*/ +/* IMRT_Medium *Medium_Ptr */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IO_Hdl_Tux_Begin( IMRT_Medium *Medium_Ptr) +{ + long flags ; + IMRT_Status status; + + flags = 0; + status = IMRS_OK; + + + if(IMRG_HDL_TUX_MODE == IMRD_HDL_TUX_NOT_IN_TRANS) + { + if( tpbegin(IMRD_HDL_TUX_TIME_OUT,flags) == -1) + { + IMRD_LM_LOG_ERROR_1( "Tpbegin error: [%s] !", tpstrerror(tperrno)); + status = IMRS_KO; + } + else + { + IMRG_HDL_TUX_MODE = IMRD_HDL_TUX_IN_TRANS; + } + } + return(status); + + +} + + +/*----------------------------------------------------------------------------*/ +/* IO_Hdl_Tux_Commit */ +/*----------------------------------------------------------------------------*/ +/* IMRT_Medium *Medium_Ptr */ +/*----------------------------------------------------------------------------*/ +IMRT_Status IO_Hdl_Tux_Commit( IMRT_Medium *Medium_Ptr) +{ + long flags ; + IMRT_Status status; + + flags = 0; + status = IMRS_OK; + + if(IMRG_HDL_TUX_MODE == IMRD_HDL_TUX_IN_TRANS) + { + if( tpcommit(flags) == -1) + { + IMRD_LM_LOG_ERROR_1( "Tpcommit error: [%s] !", tpstrerror(tperrno)); + status = IMRS_KO; + } + else + { + IMRG_HDL_TUX_MODE = IMRD_HDL_TUX_NOT_IN_TRANS; + } + } + return(status); + +} + +/*----------------------------------------------------------------------------*/ +/* IO_Hdl_Tux_Rollback */ +/*----------------------------------------------------------------------------*/ +/* IMRT_Medium *Medium_Ptr */ +/*----------------------------------------------------------------------------*/ +IMRT_Status IO_Hdl_Tux_Rollback( IMRT_Medium *Medium_Ptr) +{ + long flags ; + IMRT_Status status; + + flags = 0; + status = IMRS_OK; + + if(IMRG_HDL_TUX_MODE == IMRD_HDL_TUX_IN_TRANS) + { + if( tpabort(flags) == -1) + { + IMRD_LM_LOG_ERROR_1( "Tabort error: [%s] !", tpstrerror(tperrno)); + status = IMRS_KO; + } + else + { + IMRG_HDL_TUX_MODE = IMRD_HDL_TUX_NOT_IN_TRANS; + } + } + + return(status); + +} diff --git a/src/libio_mng/src/io_hdl_tux.h b/src/libio_mng/src/io_hdl_tux.h new file mode 100644 index 0000000..b26092c --- /dev/null +++ b/src/libio_mng/src/io_hdl_tux.h @@ -0,0 +1,171 @@ +/*----------------------------------------------------------------------------*/ +/* File: io_hdl_tux.h */ +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#ifndef _IO_HDL_TUX_H_ +#define _IO_HDL_TUX_H_ + + + +/*----------------------------------------------------------------------------*/ +/* Global Include */ +/*----------------------------------------------------------------------------*/ + +#include + + + + + +/*----------------------------------------------------------------------------*/ +/* Defines */ +/*----------------------------------------------------------------------------*/ + +#define IMRD_FML_TYPE_32 "FML32" +#define IMRD_TMIB_SERVICE ".TMIB" +#define IMRD_HDL_TUX_TIME_OUT 0 + + + +typedef short IMRT_HDL_TUX_TRAN_MODE ; + +#define IMRD_HDL_TUX_IN_TRANS (IMRT_HDL_TUX_TRAN_MODE)1 +#define IMRD_HDL_TUX_NOT_IN_TRANS (IMRT_HDL_TUX_TRAN_MODE)0 + +# ifdef _IO_HDL_TUX_C_ + +IMRT_HDL_TUX_TRAN_MODE IMRG_HDL_TUX_MODE = IMRD_HDL_TUX_NOT_IN_TRANS ; + +# endif /* _IO_HDL_TUX_C_ */ + + + + + +/*----------------------------------------------------------------------------*/ +/* Prototypes */ +/*----------------------------------------------------------------------------*/ + +# ifdef _IO_HDL_TUX_C_ + +IMRT_Status IO_Hdl_Tux_Open( IMRT_Medium *, IMRT_Medium_Path, IMRT_Dir_Id); +IMRT_Status IO_Hdl_Tux_Close( IMRT_Medium *); +IMRT_Status IO_Hdl_Tux_Read( IMRT_Buffer *, size_t *, IMRT_Medium *, IMRT_Read_Mode); +IMRT_Status IO_Hdl_Tux_Write( IMRT_Medium *, size_t *, IMRT_Buffer *); +IMRT_Status Queue_Alloc( IMRT_Tux_Buffer **); +IMRT_Status Queue_Free( IMRT_Tux_Buffer *); +IMRT_Status Queue_Exist_Mib( IMRT_Tux_Queue_Space , IMRT_Tux_Queue_Name , IMRT_Tux_Buffer *, IMRT_Tux_Buffer *); +IMRT_Status Queue_Exist( IMRT_Tux_Queue_Space , IMRT_Tux_Queue_Name); +IMRT_Status IO_Hdl_Tux_Begin( IMRT_Medium *Medium_Ptr); +IMRT_Status IO_Hdl_Tux_Commit( IMRT_Medium *Medium_Ptr); +IMRT_Status IO_Hdl_Tux_Rollback( IMRT_Medium *Medium_Ptr); + +# else + +/*----------------------------------------------------------------------------*/ +/* IO_Hdl_Tux_Open */ +/*----------------------------------------------------------------------------*/ +/* Medium_Ptr: Pointer to the medium to open */ +/* Medium_Path: Medium Path to open */ +/* Dir_Id: Medium open direction */ +/*----------------------------------------------------------------------------*/ + +extern IMRT_Status IO_Hdl_Tux_Open( IMRT_Medium *, IMRT_Medium_Path, IMRT_Dir_Id); + + + +/*----------------------------------------------------------------------------*/ +/* IO_Hdl_Tux_Close */ +/*----------------------------------------------------------------------------*/ +/* Medium_Ptr: Pointer to the medium to close */ +/*----------------------------------------------------------------------------*/ + +extern IMRT_Status IO_Hdl_Tux_Close( IMRT_Medium *); + + + +/*----------------------------------------------------------------------------*/ +/* IO_Hdl_Tux_Read */ +/*----------------------------------------------------------------------------*/ +/* Buffer_Ptr: Buffer to write data in */ +/* Read_Len_Ptr: Number of byte writen */ +/* Medium_Path: Medium to read */ +/* Read_Mode: Read mode */ +/*----------------------------------------------------------------------------*/ + +extern IMRT_Status IO_Hdl_Tux_Read( IMRT_Buffer *, size_t *, IMRT_Medium *, IMRT_Read_Mode); + + + +/*----------------------------------------------------------------------------*/ +/* IO_Hdl_Tux_Write */ +/*----------------------------------------------------------------------------*/ +/* Medium_Ptr: Pointer to the medium towrite data to */ +/* Write_Len_Ptr: Number of byte writen */ +/* Buffer_Ptr: Buffer to read */ +/*----------------------------------------------------------------------------*/ + +extern IMRT_Status IO_Hdl_Tux_Write( IMRT_Medium *, size_t *, IMRT_Buffer *); + + +/*----------------------------------------------------------------------------*/ +/* IO_Hdl_Tux_Begin */ +/*----------------------------------------------------------------------------*/ +/* IMRT_Medium *Medium_Ptr */ +/*----------------------------------------------------------------------------*/ +extern IMRT_Status IO_Hdl_Tux_Begin( IMRT_Medium *Medium_Ptr); + + +/*----------------------------------------------------------------------------*/ +/* IO_Hdl_Tux_Commit */ +/*----------------------------------------------------------------------------*/ +/* IMRT_Medium *Medium_Ptr */ +/*----------------------------------------------------------------------------*/ +extern IMRT_Status IO_Hdl_Tux_Commit( IMRT_Medium *Medium_Ptr); + +/*----------------------------------------------------------------------------*/ +/* IO_Hdl_Tux_Rollback */ +/*----------------------------------------------------------------------------*/ +/* IMRT_Medium *Medium_Ptr */ +/*----------------------------------------------------------------------------*/ +extern IMRT_Status IO_Hdl_Tux_Rollback( IMRT_Medium *Medium_Ptr); + + +# endif + + + + + +/*----------------------------------------------------------------------------*/ + +#endif + + + + diff --git a/src/libio_mng/src/libio_mng.c b/src/libio_mng/src/libio_mng.c new file mode 100644 index 0000000..4e59803 --- /dev/null +++ b/src/libio_mng/src/libio_mng.c @@ -0,0 +1,542 @@ +/*----------------------------------------------------------------------------*/ +/* $Workfile: libio_mng.c $ */ +/*----------------------------------------------------------------------------*/ +/* $Author: agibert $ */ +/* $Date: 2008/11/12 02:25:22 $ */ +/* $Revision: 1.1 $ */ +/* $Label: $ */ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#define _LIBIO_MNG_ +#define _LIBIO_MNG_C_ + +#include "libio_mng.h" + + + + + + + +/******************************************************************************/ +/* IO Manager API */ +/******************************************************************************/ + + + +/*----------------------------------------------------------------------------*/ +/* Open IO Manager */ +/*----------------------------------------------------------------------------*/ +/* Lib_Flag: Setup IOM init mode */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IMR_IOM_Library_Open( IMRT_IOM_Config *Config_Ptr) +{ + if( IMRG_IOM_Module.Lib.Status != IMRD_LIB_STATUS_CLOSED) + { + IMRD_LM_LOG_ERROR_0( "Library not closed !"); + + return( IMRS_KO); + } + else + { + IMRG_IOM_Module.Lib.Status = IMRD_LIB_STATUS_OPENED; + + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_1, "Library opened !"); + + return( IMRS_OK); + } +} + + + + + +/*----------------------------------------------------------------------------*/ +/* Close IO Manager */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IMR_IOM_Library_Close() +{ + if( IMRG_IOM_Module.Lib.Status != IMRD_LIB_STATUS_OPENED) + { + IMRD_LM_LOG_ERROR_0( "Library not opened !"); + + return( IMRS_KO); + } + else + { + IMRG_IOM_Module.Lib.Status = IMRD_LIB_STATUS_CLOSED; + + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_1, "Library closed !"); + + return( IMRS_OK); + } +} + + + + + +/*----------------------------------------------------------------------------*/ +/* Parse Medium URL */ +/*----------------------------------------------------------------------------*/ +/* Hdl_Name: Handler name parsed */ +/* Medium_Path: Medium path parsed */ +/* Medium_URL: Medium URL to parse */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IOM_URL_Parse( IMRT_IO_Hdl_Name Hdl_Name, IMRT_Medium_Path Medium_Path, IMRT_Medium_URL Medium_URL) +{ + char *ptr; + + + if( ( ( ptr = strstr( Medium_URL, "://")) == NULL) || ( ptr == Medium_URL) || ( ( ptr - Medium_URL + 3) == strlen( Medium_URL))) + { + return( IMRS_KO); + } + + strncpy( Hdl_Name, Medium_URL, ( ptr - Medium_URL)); + Hdl_Name[ ptr - Medium_URL] = '\0'; + + strcpy( Medium_Path, ( ptr + 3)); + + return( IMRS_OK); +} + + + + + +/*----------------------------------------------------------------------------*/ +/* Get Medium Type from Handler Name */ +/*----------------------------------------------------------------------------*/ +/* Medium_Type_Ptr: Medium type to return */ +/* Handler_Name: IO Handler Name */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IOM_Medium_Type_Get( IMRT_Medium_Type *Medium_Type_Ptr, IMRT_IO_Hdl_Name Hdl_Name) +{ + IMRT_Medium_Type i; + + + for( i = 0; ( i < IMRD_IO_HDL_NB) && ( strcmp( IMRG_IOM_Base.IO_Hdl_Tab[i].Name, Hdl_Name) != 0) ; i++); + + if( i < IMRD_IO_HDL_NB) + { + *Medium_Type_Ptr = i; + return( IMRS_OK); + } + else + { + return( IMRS_KO); + } +} + + + + + +/*----------------------------------------------------------------------------*/ +/* Open Medium */ +/*----------------------------------------------------------------------------*/ +/* Medium_Ptr_Ptr: Reference to the Pointer to the opened medium */ +/* Medium_Name: Name of the medium */ +/* Medium_URL: Medium URL to open */ +/* Appl_Id_Input: Input application Id link with the medium */ +/* Appl_Id_Output: Output application Id link with the medium */ +/* Dir_Id: Medium open direction */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IMR_IOM_Medium_Open( IMRT_Medium **Medium_Ptr_Ptr, IMRT_Medium_Name Medium_Name, IMRT_Medium_URL Medium_URL, IMRT_Appl_Id Appl_Id_Input, IMRT_Appl_Id Appl_Id_Output, IMRT_Dir_Id Dir_Id) +{ + IMRT_Status status; + IMRT_IO_Hdl_Name hdl_name; + IMRT_Medium_Path medium_path; + IMRT_Medium_Type medium_type; + + + if( ( status = IOM_URL_Parse( hdl_name, medium_path, Medium_URL)) != IMRS_OK) + { + IMRD_LM_LOG_ERROR_1( "Can't parse URL [%s] !", Medium_URL); + + return( IMRS_KO); + } + + if( ( status = IOM_Medium_Type_Get( &medium_type, hdl_name)) != IMRS_OK) + { + IMRD_LM_LOG_ERROR_1( "Can't get medium type [%s] !", hdl_name); + + return( IMRS_KO); + } + + if( ( *Medium_Ptr_Ptr = malloc( sizeof( IMRT_Medium))) == NULL) + { + IMRD_LM_LOG_ERROR_2( "Can't allocate Medium [%s]: (%d) !", Medium_Name, errno); + + return( IMRS_KO); + } + + strcpy( ( *Medium_Ptr_Ptr)->Name, Medium_Name); + ( *Medium_Ptr_Ptr)->Type = medium_type; + ( *Medium_Ptr_Ptr)->Status = IMRD_MEDIUM_STATUS_CLOSED; + strcpy( ( *Medium_Ptr_Ptr)->URL, Medium_URL); + ( *Medium_Ptr_Ptr)->Appl_Id_Input = Appl_Id_Input; + ( *Medium_Ptr_Ptr)->Appl_Id_Output = Appl_Id_Output; + ( *Medium_Ptr_Ptr)->Dir_Id = Dir_Id; + ( *Medium_Ptr_Ptr)->Tran_Flag = IMRD_MEDIUM_TRAN_FLAG_OUT; + ( *Medium_Ptr_Ptr)->Byte_Nb = 0; + ( *Medium_Ptr_Ptr)->Msg_Nb = 0; + + + if( IMRG_IOM_Base.IO_Hdl_Tab[ medium_type].Open_Ptr( *Medium_Ptr_Ptr, medium_path, Dir_Id) != IMRS_OK) + { + IMRD_LM_LOG_ERROR_1( "Can't open Medium [%s] !", Medium_Name); + free( *Medium_Ptr_Ptr); + + return( IMRS_KO); + } + else + { + ( *Medium_Ptr_Ptr)->Status = IMRD_MEDIUM_STATUS_OPENED; + + return( IMRS_OK); + } +} + + + + + +/*----------------------------------------------------------------------------*/ +/* Close Medium */ +/*----------------------------------------------------------------------------*/ +/* Medium_Ptr: Pointer to the medium to close */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IMR_IOM_Medium_Close( IMRT_Medium *Medium_Ptr) +{ + if( Medium_Ptr->Status == IMRD_MEDIUM_STATUS_OPENED) + { + if( IMRG_IOM_Base.IO_Hdl_Tab[ Medium_Ptr->Type].Close_Ptr( Medium_Ptr) != IMRS_OK) + { + IMRD_LM_LOG_ERROR_0( "Can't close Medium !"); + + return( IMRS_KO); + } + } + + IMRD_LM_LOG_INFO_4( "Medium [%s]: (%d) bytes %s in (%d) messages.", Medium_Ptr->Name, Medium_Ptr->Byte_Nb, ( ( Medium_Ptr->Dir_Id == IMRD_DIR_ID_IN) ? "read" : "writen"), Medium_Ptr->Msg_Nb); + + free( Medium_Ptr); + + return( IMRS_OK); +} + + + + + +/*----------------------------------------------------------------------------*/ +/* Read Medium */ +/*----------------------------------------------------------------------------*/ +/* Buffer_Ptr: Pointer to the buffer to write */ +/* Medium_Ptr: Pointer to the medium to read */ +/* Read_Mode: Read mode */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IMR_IOM_Medium_Read( IMRT_Buffer *Buffer_Ptr, IMRT_Medium *Medium_Ptr, IMRT_Read_Mode Read_Mode) +{ + size_t read_len; + IMRT_Status status; + + + if( Medium_Ptr->Status == IMRD_MEDIUM_STATUS_OPENED) + { + if( ( status = IMRG_IOM_Base.IO_Hdl_Tab[ Medium_Ptr->Type].Read_Ptr( Buffer_Ptr, &read_len, Medium_Ptr, Read_Mode)) == IMRS_KO) + { + IMRD_LM_LOG_ERROR_1( "Can't read Medium [%s] !", Medium_Ptr->Name); + + return( IMRS_KO); + } + + if( status == IMRS_OK) + { + Medium_Ptr->Byte_Nb += read_len; + Medium_Ptr->Msg_Nb++; + + Buffer_Ptr->Appl_Id_Input = Medium_Ptr->Appl_Id_Input; + Buffer_Ptr->Appl_Id_Output = Medium_Ptr->Appl_Id_Output; + Buffer_Ptr->Dir_Id = Medium_Ptr->Dir_Id; + Buffer_Ptr->Flag = IMRD_BUFFER_FLAG_CLOSED; + } + } + else + { + IMRD_LM_LOG_ERROR_1( "Can't read closed Medium [%s] !", Medium_Ptr->Name); + + return( IMRS_KO); + } + + return( status); +} + + + + + +/*----------------------------------------------------------------------------*/ +/* Write Medium */ +/*----------------------------------------------------------------------------*/ +/* Medium_Ptr: Pointer to the medium to write */ +/* Buffer_Ptr: Pointer to the buffer to read */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IMR_IOM_Medium_Write( IMRT_Medium *Medium_Ptr, IMRT_Buffer *Buffer_Ptr) +{ + size_t write_len; + + + if( Medium_Ptr->Status == IMRD_MEDIUM_STATUS_OPENED) + { + if( IMRG_IOM_Base.IO_Hdl_Tab[ Medium_Ptr->Type].Write_Ptr( Medium_Ptr, &write_len, Buffer_Ptr) != IMRS_OK) + { + IMRD_LM_LOG_ERROR_1( "Can't write Medium [%s]!", Medium_Ptr->Name); + + return( IMRS_KO); + } + + Medium_Ptr->Byte_Nb += write_len; + Medium_Ptr->Msg_Nb++; + } + else + { + IMRD_LM_LOG_ERROR_1( "Can't write closed Medium [%s]!", Medium_Ptr->Name); + + return( IMRS_KO); + } + + return( IMRS_OK); +} + + + + + + +/*----------------------------------------------------------------------------*/ +/* Tran Begin */ +/*----------------------------------------------------------------------------*/ +/* Tran_Ptr_Ptr: Reference to the pointer of the transaction to begin */ +/* Medium_Count: Number of medium to enclose into the transaction */ +/* Medium_1_Ptr: Pointer to the first medium */ +/* ... */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IMR_IOM_Tran_Begin( IMRT_Tran **Tran_Ptr_Ptr, IMRT_Medium_Nb Medium_Nb, IMRT_Medium *Medium_1_Ptr, ...) +{ + int index; + va_list medium_list; + IMRT_Medium *medium_ptr; + IMRT_Status status; + + + status = IMRS_OK; + medium_ptr = NULL; + + if( Medium_Nb != 0) + { + va_start( medium_list, Medium_1_Ptr); + + + if( ( *Tran_Ptr_Ptr = (IMRT_Tran *)malloc( sizeof( IMRT_Tran))) == NULL) + { + IMRD_LM_LOG_ERROR_1( "Can't malloc Tran: (%d) !", errno); + return( IMRS_KO); + } + + if( ( (*Tran_Ptr_Ptr)->Medium_Ptr_Tab = (IMRT_Medium **)malloc( sizeof(IMRT_Medium **) * Medium_Nb)) == NULL) + { + IMRD_LM_LOG_ERROR_1( "Can't malloc Tran Medium_Ptr_Tab: (%d) !", errno); + return( IMRS_KO); + } + + (*Tran_Ptr_Ptr)->Medium_Nb = Medium_Nb; + + for( index = 0; index < Medium_Nb; index++) + { + if( index == 0) + { + ( ( *Tran_Ptr_Ptr)->Medium_Ptr_Tab)[index] = Medium_1_Ptr; + + medium_ptr = Medium_1_Ptr; + } + else + { + medium_ptr = (IMRT_Medium *)va_arg( medium_list, IMRT_Medium *); + if( medium_ptr != NULL) + { + (*Tran_Ptr_Ptr)->Medium_Ptr_Tab[index] = medium_ptr; + } + else + { + IMRD_LM_LOG_ERROR_0( "Can't get medium !"); + status = IMRS_KO; + } + } + + if( status == IMRS_OK) + { + status = IMRG_IOM_Base.IO_Hdl_Tab[medium_ptr->Type].Begin_Ptr( medium_ptr); + + if( status != IMRS_OK) + { + IMRD_LM_LOG_ERROR_1( "Begin failed for Medium [%s] !", medium_ptr->Name); + } + else + { + (*Tran_Ptr_Ptr)->Medium_Ptr_Tab[index]->Tran_Flag = IMRD_MEDIUM_TRAN_FLAG_IN; + } + } + + } + va_end( medium_list); + } + else + { + IMRD_LM_LOG_ERROR_1( "BEGIN : Invalid number of medium (%d) !",Medium_Nb ); + status = IMRS_KO ; + } + + return( status); +} + + + + + +/*----------------------------------------------------------------------------*/ +/* Tran Commit */ +/*----------------------------------------------------------------------------*/ +/* Tran_Ptr: Pointer to the transaction to commit */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IMR_IOM_Tran_Commit( IMRT_Tran *Tran_Ptr) +{ + IMRT_Status status; + int index; + + + status = IMRS_OK; + + IMRD_LM_LOG_TRACE_1( IMRD_LOG_LEVEL_VERBOSE_1, "Medium Nb to commit: (%d)", Tran_Ptr->Medium_Nb ); + + for( index = 0; index < Tran_Ptr->Medium_Nb; index++) + { + IMRD_LM_LOG_TRACE_2( IMRD_LOG_LEVEL_VERBOSE_1, "Medium [%s] Tran_Flag: (%d)", Tran_Ptr->Medium_Ptr_Tab[index]->Name, Tran_Ptr->Medium_Ptr_Tab[index]->Tran_Flag); + + if( Tran_Ptr->Medium_Ptr_Tab[index]->Tran_Flag == IMRD_MEDIUM_TRAN_FLAG_IN) + { + IMRD_LM_LOG_TRACE_1( IMRD_LOG_LEVEL_VERBOSE_1, "Commiting medium [%s]...",Tran_Ptr->Medium_Ptr_Tab[index]->Name); + + status = IMRG_IOM_Base.IO_Hdl_Tab[Tran_Ptr->Medium_Ptr_Tab[index]->Type].Commit_Ptr(Tran_Ptr->Medium_Ptr_Tab[index]); + + if( status == IMRS_OK) + { + Tran_Ptr->Medium_Ptr_Tab[index]->Tran_Flag = IMRD_MEDIUM_TRAN_FLAG_OUT; + } + else + { + IMRD_LM_LOG_ERROR_1( "Commit failed for medium [%s] !", Tran_Ptr->Medium_Ptr_Tab[index]->Name); + } + } + + } + + if( Tran_Ptr->Medium_Ptr_Tab != NULL) + { + free( Tran_Ptr->Medium_Ptr_Tab); + } + + free( Tran_Ptr); + + return( status); +} + + + + + +/*----------------------------------------------------------------------------*/ +/* Tran Rollback */ +/*----------------------------------------------------------------------------*/ +/* Tran_Ptr: Pointer to the transaction to rollback */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IMR_IOM_Tran_Rollback( IMRT_Tran *Tran_Ptr) +{ + + IMRT_Status status; + int index; + + + status = IMRS_OK; + + IMRD_LM_LOG_TRACE_1( IMRD_LOG_LEVEL_VERBOSE_1, "Medium Nb to rollback: (%d)", Tran_Ptr->Medium_Nb ); + + for( index = 0; index < Tran_Ptr->Medium_Nb; index++) + { + IMRD_LM_LOG_TRACE_2( IMRD_LOG_LEVEL_VERBOSE_1, "Medium [%s] Tran_Flag: (%d)", Tran_Ptr->Medium_Ptr_Tab[index]->Name, Tran_Ptr->Medium_Ptr_Tab[index]->Tran_Flag); + + if( Tran_Ptr->Medium_Ptr_Tab[index]->Tran_Flag == IMRD_MEDIUM_TRAN_FLAG_IN) + { + status = IMRG_IOM_Base.IO_Hdl_Tab[Tran_Ptr->Medium_Ptr_Tab[index]->Type].Rollback_Ptr(Tran_Ptr->Medium_Ptr_Tab[index]); + + if(status == IMRS_OK) + { + Tran_Ptr->Medium_Ptr_Tab[index]->Tran_Flag = IMRD_MEDIUM_TRAN_FLAG_OUT; + } + else + { + IMRD_LM_LOG_ERROR_1( "Rollback failed for medium [%s] !", Tran_Ptr->Medium_Ptr_Tab[index]->Name); + } + } + } + + if( Tran_Ptr->Medium_Ptr_Tab != NULL) + { + free( Tran_Ptr->Medium_Ptr_Tab); + } + + free( Tran_Ptr); + + return( status); +} + + + + + diff --git a/src/libio_mng/src/libio_mng.h b/src/libio_mng/src/libio_mng.h new file mode 100644 index 0000000..de0cd6b --- /dev/null +++ b/src/libio_mng/src/libio_mng.h @@ -0,0 +1,194 @@ +/*----------------------------------------------------------------------------*/ +/* File: libio_mng.h */ +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#ifndef _LIBIO_MNG_H_ +#define _LIBIO_MNG_H_ + + + +/*----------------------------------------------------------------------------*/ +/* Global Include */ +/*----------------------------------------------------------------------------*/ + +#include + + + + + +/*----------------------------------------------------------------------------*/ +/* Lib Definitions */ +/*----------------------------------------------------------------------------*/ + +#define IMRD_IOM_MODULE_ID ( IMRT_Module_Id) 3 +#define IMRD_IOM_MODULE_NAME ( IMRT_Module_Name) "iom" +#define IMRD_IOM_MODULE_NAME_LONG ( IMRT_Module_Name_Long) "IO Manager" +#define IMRD_IOM_MODULE_VERSION ( IMRT_Module_Version) "@(#) VERSIONIMR: $Label: $ $Date: 2008/11/12 02:25:22 $ $Workfile: libio_mng.h $" + +#define IMRD_MODULE_PTR &IMRG_IOM_Module + + + + + +/*----------------------------------------------------------------------------*/ +/* Local Definitions */ +/*----------------------------------------------------------------------------*/ + +#define IMRD_IO_HDL_NAME_LEN (short) 255 +#define IMRD_IO_HDL_NAME_SIZE (short) ( IMRD_IO_HDL_NAME_LEN + 1) + +typedef char IMRT_IO_Hdl_Name[ IMRD_IO_HDL_NAME_SIZE]; + + + +typedef IMRT_Status ( IMRT_IO_Hdl_Open) ( IMRT_Medium *, IMRT_Medium_Path, IMRT_Dir_Id); +typedef IMRT_Status ( IMRT_IO_Hdl_Close)( IMRT_Medium *); +typedef IMRT_Status ( IMRT_IO_Hdl_Read) ( IMRT_Buffer *, size_t *, IMRT_Medium *, IMRT_Read_Mode); +typedef IMRT_Status ( IMRT_IO_Hdl_Write)( IMRT_Medium *, size_t *, IMRT_Buffer *); +typedef IMRT_Status ( IMRT_IO_Hdl_Begin) ( IMRT_Medium *); +typedef IMRT_Status ( IMRT_IO_Hdl_Commit) ( IMRT_Medium *); +typedef IMRT_Status ( IMRT_IO_Hdl_Rollback)( IMRT_Medium *); + + + +typedef struct IMRT_IO_Hdl +{ + IMRT_IO_Hdl_Name Name; + IMRT_IO_Hdl_Open *Open_Ptr; + IMRT_IO_Hdl_Close *Close_Ptr; + IMRT_IO_Hdl_Read *Read_Ptr; + IMRT_IO_Hdl_Write *Write_Ptr; + IMRT_IO_Hdl_Begin *Begin_Ptr; + IMRT_IO_Hdl_Commit *Commit_Ptr; + IMRT_IO_Hdl_Rollback *Rollback_Ptr; + + +} IMRT_IO_Hdl; + + + +typedef short IMRT_IO_Hdl_Nb; + +#define IMRD_IO_HDL_NB ( IMRT_IO_Hdl_Nb) 4 + + + +typedef struct IMRT_IO_Base +{ + IMRT_IO_Hdl IO_Hdl_Tab[ IMRD_IO_HDL_NB]; +} IMRT_IO_Base; + + + + + +/*----------------------------------------------------------------------------*/ +/* Prototypes */ +/*----------------------------------------------------------------------------*/ + +# ifdef _LIBIO_MNG_C_ + +IMRT_Status IOM_URL_Parse( IMRT_IO_Hdl_Name, IMRT_Medium_Path, IMRT_Medium_URL); +IMRT_Status IOM_Medium_Type_Get( IMRT_Medium_Type *, IMRT_IO_Hdl_Name); + +# endif + + + + + +/*----------------------------------------------------------------------------*/ +/* Local Includes */ +/*----------------------------------------------------------------------------*/ + +#include "io_hdl_file.h" + +#ifdef TUX_SUPPORT +# include "io_hdl_tux.h" +#endif /* TUX_SUPPORT */ + +#ifdef MQS_SUPPORT +# include "io_hdl_mqs.h" +#endif /* MQS_SUPPORT */ + + + +/*----------------------------------------------------------------------------*/ +/* Global Variables */ +/*----------------------------------------------------------------------------*/ + +# ifdef _LIBIO_MNG_C_ + +IMRT_IO_Base IMRG_IOM_Base = +{ + { + { "Unknown", NULL, NULL, NULL, NULL, NULL, NULL, NULL}, + { "file", IO_Hdl_File_Open, IO_Hdl_File_Close, IO_Hdl_File_Read, IO_Hdl_File_Write,IO_Hdl_File_Begin,IO_Hdl_File_Commit,IO_Hdl_File_Rollback }, + +#ifdef TUX_SUPPORT + { "tux", IO_Hdl_Tux_Open, IO_Hdl_Tux_Close, IO_Hdl_Tux_Read, IO_Hdl_Tux_Write, IO_Hdl_Tux_Begin, IO_Hdl_Tux_Commit, IO_Hdl_Tux_Rollback}, +#endif /* TUX_SUPPORT */ + +#ifdef MQS_SUPPORT + { "mqs", IO_Hdl_MQS_Open, IO_Hdl_MQS_Close, IO_Hdl_MQS_Read, IO_Hdl_MQS_Write, IO_Hdl_MQS_Begin, IO_Hdl_MQS_Commit, IO_Hdl_MQS_Rollback}, +#endif /* MQS_SUPPORT */ + } +}; + + + +IMRT_Module IMRG_IOM_Module = +{ + IMRD_IOM_MODULE_ID, + IMRD_IOM_MODULE_NAME, + IMRD_IOM_MODULE_NAME_LONG, + IMRD_IOM_MODULE_VERSION, + IMRD_MODULE_TYPE_LIBRARY, + { + IMRD_LIB_STATUS_CLOSED, + ( IMRT_Lib_Open *) &IMR_IOM_Library_Open, + ( IMRT_Lib_Close *) &IMR_IOM_Library_Close + } +}; + +# else + +extern IMRT_IO_Base IMRG_IOM_Base; +extern IMRT_Module IMRG_IOM_Module; + +# endif + + + + + +/*----------------------------------------------------------------------------*/ + +#endif diff --git a/src/liblog_mng/include/log_mng.h b/src/liblog_mng/include/log_mng.h new file mode 100644 index 0000000..bd9e98d --- /dev/null +++ b/src/liblog_mng/include/log_mng.h @@ -0,0 +1,397 @@ +/*----------------------------------------------------------------------------*/ +/* File: log_mng.h */ +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#ifndef _LOG_MNG_H_ +#define _LOG_MNG_H_ + + + +#include + + + + + +/*----------------------------------------------------------------------------*/ +/* IMRD_LM_API definition */ +/*----------------------------------------------------------------------------*/ + +# ifdef _LIBLOG_MNG_ +# define IMRD_LM_API +# else +# define IMRD_LM_API extern +# endif + + + + + +/*----------------------------------------------------------------------------*/ +/* Status definition */ +/*----------------------------------------------------------------------------*/ + +#define IMRS_LM_LOG (IMRT_Status) 2 + + + +/*----------------------------------------------------------------------------*/ +/* Log Type definition */ +/*----------------------------------------------------------------------------*/ + +#define IMRD_LOG_TYPE_NB (short) 5 + + + +typedef short IMRT_Log_Type_Id; + +#define IMRD_LOG_TYPE_ID_UNKNOWN (IMRT_Log_Type_Id) 0 +#define IMRD_LOG_TYPE_ID_TRACE (IMRT_Log_Type_Id) 1 +#define IMRD_LOG_TYPE_ID_INFO (IMRT_Log_Type_Id) 2 +#define IMRD_LOG_TYPE_ID_WARNING (IMRT_Log_Type_Id) 3 +#define IMRD_LOG_TYPE_ID_ERROR (IMRT_Log_Type_Id) 4 + + + +typedef char *IMRT_Log_Type_Name; + +#define IMRD_LOG_TYPE_NAME_UNKNOWN (IMRT_Log_Type_Name) "???" +#define IMRD_LOG_TYPE_NAME_TRACE (IMRT_Log_Type_Name) "TRA" +#define IMRD_LOG_TYPE_NAME_INFO (IMRT_Log_Type_Name) "INF" +#define IMRD_LOG_TYPE_NAME_WARNING (IMRT_Log_Type_Name) "WRN" +#define IMRD_LOG_TYPE_NAME_ERROR (IMRT_Log_Type_Name) "ERR" + + + + + +/*----------------------------------------------------------------------------*/ +/* Log Level definition */ +/*----------------------------------------------------------------------------*/ + +typedef short IMRT_Log_Level; + +#define IMRD_LOG_LEVEL_UNSET ( IMRT_Log_Level) -1 + +#define IMRD_LOG_LEVEL_MIN ( IMRT_Log_Level) 0 +#define IMRD_LOG_LEVEL_MAX ( IMRT_Log_Level) 999 + +#define IMRD_LOG_LEVEL_VERBOSE_0 ( IMRT_Log_Level) 10 +#define IMRD_LOG_LEVEL_VERBOSE_1 ( IMRT_Log_Level) 20 +#define IMRD_LOG_LEVEL_VERBOSE_2 ( IMRT_Log_Level) 30 + +#define IMRD_LOG_LEVEL_DEFAULT ( IMRT_Log_Level) 10 + + + + + +/*----------------------------------------------------------------------------*/ +/* IMRT_File_Name definition */ +/*----------------------------------------------------------------------------*/ + +typedef char *IMRT_File_Name; + + + + + +/*----------------------------------------------------------------------------*/ +/* IMRT_Line_Id definition */ +/*----------------------------------------------------------------------------*/ + +typedef long IMRT_Line_Id; + + + + + +/*----------------------------------------------------------------------------*/ +/* Log Fmt definition */ +/*----------------------------------------------------------------------------*/ + +typedef char *IMRT_Log_Fmt; + + + + + +/*----------------------------------------------------------------------------*/ +/* IMRT_Log_Id_Bit definition */ +/*----------------------------------------------------------------------------*/ + +typedef size_t IMRT_Log_Id_Bit_Offset; +typedef size_t IMRT_Log_Id_Bit_Size; + + + +typedef struct IMRT_Log_Id_Bit +{ + IMRT_Log_Id_Bit_Offset Offset; + IMRT_Log_Id_Bit_Size Size; +} IMRT_Log_Id_Bit; + + + + + +/*----------------------------------------------------------------------------*/ +/* IMRT_Log_Id_Struct definition */ +/*----------------------------------------------------------------------------*/ + +typedef short IMRT_Bit_Nb; +typedef size_t IMRT_Log_Size; + + + +typedef struct IMRT_Log_Id_Struct +{ + IMRT_Bit_Nb Bit_Nb; + IMRT_Log_Size Log_Size; + IMRT_Log_Id_Bit *Log_Id_Bit_Ptr; +} IMRT_Log_Id_Struct; + + + + + +/*----------------------------------------------------------------------------*/ +/* IMRT_Log_Msg_Header definition */ +/*----------------------------------------------------------------------------*/ + +typedef char *IMRT_Log_Id_Header; + + + + + +/*----------------------------------------------------------------------------*/ +/* LM_Config definition */ +/*----------------------------------------------------------------------------*/ + +typedef struct IMRT_LM_Config +{ + IMRT_Path Log_File; + IMRT_Module_Id Module_Nb; + IMRT_Log_Level Level_Tab[ IMRD_LOG_TYPE_NB][ IMRD_MODULE_NB_MAX]; +} IMRT_LM_Config; + + + + + + + +/*----------------------------------------------------------------------------*/ +/* Global Variables */ +/*----------------------------------------------------------------------------*/ + +# ifdef _LIBLOG_MNG_ + +# else + +extern IMRT_Module IMRG_LM_Module; + +# endif + + + + + + + +/******************************************************************************/ +/* Log Manager API */ +/******************************************************************************/ + +/*----------------------------------------------------------------------------*/ +/* Log Trace Macros */ +/*----------------------------------------------------------------------------*/ + +#define IMRD_LM_LOG_TRACE_0( Level, Fmt) if( IMR_LM_Log_Write( IMRD_LOG_TYPE_ID_TRACE, (Level), IMRD_MODULE_PTR, __FILE__, __LINE__, IMRD_TRUE, (Fmt)) != IMRS_OK) return( IMRS_KO); +#define IMRD_LM_LOG_TRACE_1( Level, Fmt, Arg1) if( IMR_LM_Log_Write( IMRD_LOG_TYPE_ID_TRACE, (Level), IMRD_MODULE_PTR, __FILE__, __LINE__, IMRD_TRUE, (Fmt), (Arg1)) != IMRS_OK) return(IMRS_KO); +#define IMRD_LM_LOG_TRACE_2( Level, Fmt, Arg1, Arg2) if( IMR_LM_Log_Write( IMRD_LOG_TYPE_ID_TRACE, (Level), IMRD_MODULE_PTR, __FILE__, __LINE__, IMRD_TRUE, (Fmt), (Arg1), (Arg2)) != IMRS_OK) return(IMRS_KO); +#define IMRD_LM_LOG_TRACE_3( Level, Fmt, Arg1, Arg2, Arg3) if( IMR_LM_Log_Write( IMRD_LOG_TYPE_ID_TRACE, (Level), IMRD_MODULE_PTR, __FILE__, __LINE__, IMRD_TRUE, (Fmt), (Arg1), (Arg2), (Arg3)) != IMRS_OK) return(IMRS_KO); +#define IMRD_LM_LOG_TRACE_4( Level, Fmt, Arg1, Arg2, Arg3, Arg4) if( IMR_LM_Log_Write( IMRD_LOG_TYPE_ID_TRACE, (Level), IMRD_MODULE_PTR, __FILE__, __LINE__, IMRD_TRUE, (Fmt), (Arg1), (Arg2), (Arg3), (Arg4)) != IMRS_OK) return(IMRS_KO); +#define IMRD_LM_LOG_TRACE_5( Level, Fmt, Arg1, Arg2, Arg3, Arg4, Arg5) if( IMR_LM_Log_Write( IMRD_LOG_TYPE_ID_TRACE, (Level), IMRD_MODULE_PTR, __FILE__, __LINE__, IMRD_TRUE, (Fmt), (Arg1), (Arg2), (Arg3), (Arg4), (Arg5)) != IMRS_OK) return(IMRS_KO); + + + +/*----------------------------------------------------------------------------*/ +/* Log Info Macros */ +/*----------------------------------------------------------------------------*/ + +#define IMRD_LM_LOG_INFO_0( Fmt) if(IMR_LM_Log_Write( IMRD_LOG_TYPE_ID_INFO, IMRD_LOG_LEVEL_DEFAULT, IMRD_MODULE_PTR, __FILE__, __LINE__, IMRD_TRUE, (Fmt)) != IMRS_OK ) return(IMRS_KO); +#define IMRD_LM_LOG_INFO_1( Fmt, Arg1) if( IMR_LM_Log_Write( IMRD_LOG_TYPE_ID_INFO, IMRD_LOG_LEVEL_DEFAULT, IMRD_MODULE_PTR, __FILE__, __LINE__, IMRD_TRUE, (Fmt), (Arg1)) != IMRS_OK) return(IMRS_KO) ; +#define IMRD_LM_LOG_INFO_2( Fmt, Arg1, Arg2) if( IMR_LM_Log_Write( IMRD_LOG_TYPE_ID_INFO, IMRD_LOG_LEVEL_DEFAULT, IMRD_MODULE_PTR, __FILE__, __LINE__, IMRD_TRUE, (Fmt), (Arg1), (Arg2)) != IMRS_OK) return(IMRS_KO); +#define IMRD_LM_LOG_INFO_3( Fmt, Arg1, Arg2, Arg3) if( IMR_LM_Log_Write( IMRD_LOG_TYPE_ID_INFO, IMRD_LOG_LEVEL_DEFAULT, IMRD_MODULE_PTR, __FILE__, __LINE__, IMRD_TRUE, (Fmt), (Arg1), (Arg2), (Arg3)) != IMRS_OK) return(IMRS_KO); +#define IMRD_LM_LOG_INFO_4( Fmt, Arg1, Arg2, Arg3, Arg4) if( IMR_LM_Log_Write( IMRD_LOG_TYPE_ID_INFO, IMRD_LOG_LEVEL_DEFAULT, IMRD_MODULE_PTR, __FILE__, __LINE__, IMRD_TRUE, (Fmt), (Arg1), (Arg2), (Arg3), (Arg4)) != IMRS_OK) return(IMRS_KO); +#define IMRD_LM_LOG_INFO_5( Fmt, Arg1, Arg2, Arg3, Arg4, Arg5) if( IMR_LM_Log_Write( IMRD_LOG_TYPE_ID_INFO, IMRD_LOG_LEVEL_DEFAULT, IMRD_MODULE_PTR, __FILE__, __LINE__, IMRD_TRUE, (Fmt), (Arg1), (Arg2), (Arg3), (Arg4), (Arg5)) != IMRS_OK) return(IMRS_KO); + + + +/*----------------------------------------------------------------------------*/ +/* Log Warning Macros */ +/*----------------------------------------------------------------------------*/ + +#define IMRD_LM_LOG_WARNING_0( Fmt) if(IMR_LM_Log_Write( IMRD_LOG_TYPE_ID_WARNING, IMRD_LOG_LEVEL_DEFAULT, IMRD_MODULE_PTR, __FILE__, __LINE__, IMRD_TRUE, (Fmt)) != IMRS_OK) return(IMRS_KO); +#define IMRD_LM_LOG_WARNING_1( Fmt, Arg1) if(IMR_LM_Log_Write( IMRD_LOG_TYPE_ID_WARNING, IMRD_LOG_LEVEL_DEFAULT, IMRD_MODULE_PTR, __FILE__, __LINE__, IMRD_TRUE, (Fmt), (Arg1)) != IMRS_OK) return(IMRS_KO); +#define IMRD_LM_LOG_WARNING_2( Fmt, Arg1, Arg2) if( IMR_LM_Log_Write( IMRD_LOG_TYPE_ID_WARNING, IMRD_LOG_LEVEL_DEFAULT, IMRD_MODULE_PTR, __FILE__, __LINE__, IMRD_TRUE, (Fmt), (Arg1), (Arg2)) != IMRS_OK) return(IMRS_KO); +#define IMRD_LM_LOG_WARNING_3( Fmt, Arg1, Arg2, Arg3) if( IMR_LM_Log_Write( IMRD_LOG_TYPE_ID_WARNING, IMRD_LOG_LEVEL_DEFAULT, IMRD_MODULE_PTR, __FILE__, __LINE__, IMRD_TRUE, (Fmt), (Arg1), (Arg2), (Arg3)) != IMRS_OK) return(IMRS_KO); +#define IMRD_LM_LOG_WARNING_4( Fmt, Arg1, Arg2, Arg3, Arg4) if( IMR_LM_Log_Write( IMRD_LOG_TYPE_ID_WARNING, IMRD_LOG_LEVEL_DEFAULT, IMRD_MODULE_PTR, __FILE__, __LINE__, IMRD_TRUE, (Fmt), (Arg1), (Arg2), (Arg3), (Arg4)) != IMRS_OK) return(IMRS_KO); +#define IMRD_LM_LOG_WARNING_5( Fmt, Arg1, Arg2, Arg3, Arg4, Arg5) if( IMR_LM_Log_Write( IMRD_LOG_TYPE_ID_WARNING, IMRD_LOG_LEVEL_DEFAULT, IMRD_MODULE_PTR, __FILE__, __LINE__, IMRD_TRUE, (Fmt), (Arg1), (Arg2), (Arg3), (Arg4), (Arg5)) != IMRS_OK) return(IMRS_KO); + + + +/*----------------------------------------------------------------------------*/ +/* Log Error Macros */ +/*----------------------------------------------------------------------------*/ + +#define IMRD_LM_LOG_ERROR_0( Fmt) if( IMR_LM_Log_Write( IMRD_LOG_TYPE_ID_ERROR, IMRD_LOG_LEVEL_DEFAULT, IMRD_MODULE_PTR, __FILE__, __LINE__, IMRD_TRUE, (Fmt)) != IMRS_OK) return(IMRS_KO); +#define IMRD_LM_LOG_ERROR_1( Fmt, Arg1) if(IMR_LM_Log_Write( IMRD_LOG_TYPE_ID_ERROR, IMRD_LOG_LEVEL_DEFAULT, IMRD_MODULE_PTR, __FILE__, __LINE__, IMRD_TRUE, (Fmt), (Arg1)) != IMRS_OK) return(IMRS_KO) ; +#define IMRD_LM_LOG_ERROR_2( Fmt, Arg1, Arg2) if( IMR_LM_Log_Write( IMRD_LOG_TYPE_ID_ERROR, IMRD_LOG_LEVEL_DEFAULT, IMRD_MODULE_PTR, __FILE__, __LINE__, IMRD_TRUE, (Fmt), (Arg1), (Arg2)) != IMRS_OK) return(IMRS_KO); +#define IMRD_LM_LOG_ERROR_3( Fmt, Arg1, Arg2, Arg3) if( IMR_LM_Log_Write( IMRD_LOG_TYPE_ID_ERROR, IMRD_LOG_LEVEL_DEFAULT, IMRD_MODULE_PTR, __FILE__, __LINE__, IMRD_TRUE, (Fmt), (Arg1), (Arg2), (Arg3)) != IMRS_OK) return(IMRS_KO); +#define IMRD_LM_LOG_ERROR_4( Fmt, Arg1, Arg2, Arg3, Arg4) if(IMR_LM_Log_Write( IMRD_LOG_TYPE_ID_ERROR, IMRD_LOG_LEVEL_DEFAULT, IMRD_MODULE_PTR, __FILE__, __LINE__, IMRD_TRUE, (Fmt), (Arg1), (Arg2), (Arg3), (Arg4)) != IMRS_OK) return(IMRS_KO); +#define IMRD_LM_LOG_ERROR_5( Fmt, Arg1, Arg2, Arg3, Arg4, Arg5) if( IMR_LM_Log_Write( IMRD_LOG_TYPE_ID_ERROR, IMRD_LOG_LEVEL_DEFAULT, IMRD_MODULE_PTR, __FILE__, __LINE__, IMRD_TRUE, (Fmt), (Arg1), (Arg2), (Arg3), (Arg4), (Arg5)) != IMRS_OK ) return(IMRS_KO); + + + +/*----------------------------------------------------------------------------*/ +/* Exec Trace Macros */ +/*----------------------------------------------------------------------------*/ + +#define IMRD_LM_STREAM_OUT stream_out + +#define IMRD_LM_EXEC_TRACE( Level, Msg_Pre, Func, Msg_Post) \ + { \ + FILE *stream_out; \ + \ + \ + if( IMR_LM_Log_Trigger( IMRD_LOG_TYPE_ID_TRACE, (Level), IMRD_MODULE_PTR) == IMRS_LM_LOG) \ + { \ + stream_out = IMR_LM_Stream_Out_Get(); \ + \ + IMR_LM_Log_Write( IMRD_LOG_TYPE_ID_TRACE, (Level), IMRD_MODULE_PTR, __FILE__, __LINE__, IMRD_FALSE, (Msg_Pre)); \ + (Func); \ + fprintf( stream_out, "%s%s", (Msg_Post), "\n"); \ + fflush( stream_out); \ + } \ + } + + + +/*----------------------------------------------------------------------------*/ +/* Log Buffer Id Macro */ +/*----------------------------------------------------------------------------*/ + +#define IMRD_LM_LOG_BUFFER_ID( Buffer_Ptr, Log_Id_Struct_Ptr, Log_Id_Header) if( IMR_LM_Log_Buffer_Id( (Buffer_Ptr), (Log_Id_Struct_Ptr), (Log_Id_Header), IMRD_LOG_TYPE_ID_INFO, IMRD_LOG_LEVEL_DEFAULT, IMRD_MODULE_PTR, __FILE__, __LINE__, IMRD_TRUE) != IMRS_OK) return(IMRS_KO); + + + + + +/*----------------------------------------------------------------------------*/ +/* Open Log Manager */ +/*----------------------------------------------------------------------------*/ +/* LM_Config_Ptr: Setup LM init mode */ +/*----------------------------------------------------------------------------*/ + +IMRD_LM_API IMRT_Status IMR_LM_Library_Open( IMRT_LM_Config *); + + + +/*----------------------------------------------------------------------------*/ +/* Close Log Manager */ +/*----------------------------------------------------------------------------*/ + +IMRD_LM_API IMRT_Status IMR_LM_Library_Close( void); + + + +/*----------------------------------------------------------------------------*/ +/* LM_Stream_Out_Get */ +/*----------------------------------------------------------------------------*/ + +IMRD_LM_API FILE *IMR_LM_Stream_Out_Get( void); + + + +/*----------------------------------------------------------------------------*/ +/* LM_Log_Trigger */ +/*----------------------------------------------------------------------------*/ +/* Log_Type_Id: Type id of log */ +/* Log_Level: Level of log */ +/* Module_Ptr: Loger module pointer */ +/*----------------------------------------------------------------------------*/ + +IMRD_LM_API IMRT_Status IMR_LM_Log_Trigger( IMRT_Log_Type_Id, IMRT_Log_Level, IMRT_Module *); + + + +/*----------------------------------------------------------------------------*/ +/* LM_Log_Write */ +/*----------------------------------------------------------------------------*/ +/* Log_Type_Id: Type id of log */ +/* Log_Level: Level of log */ +/* Module_Ptr: Loger module pointer */ +/* File_Name: Loger file name */ +/* Line_Id: Loger line id */ +/* LF_Flag: Add or not a LF at EOF */ +/* Log_Fmt: Format string a la printf */ +/* ...: Optional args */ +/*----------------------------------------------------------------------------*/ + +IMRD_LM_API IMRT_Status IMR_LM_Log_Write( IMRT_Log_Type_Id, IMRT_Log_Level, IMRT_Module *, IMRT_File_Name, IMRT_Line_Id, IMRT_Boolean, IMRT_Log_Fmt, ...); + + + +/*----------------------------------------------------------------------------*/ +/* Log_Buffer_Id */ +/*----------------------------------------------------------------------------*/ +/* Buffer_Ptr: buffer to identify */ +/* Log_Id_Struct_Ptr: Log_Id_Heap to use */ +/* Log_Id_Header_Ptr: message to log as header */ +/* Log_Type_Id: Type id of log */ +/* Log_Level: Level of log */ +/* Module_Ptr: Loger module pointer */ +/* File_Name: Loger file name */ +/* Line_Id: Loger line id */ +/* LF_Flag: Add or not a LF at EOF */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IMR_LM_Log_Buffer_Id( IMRT_Buffer *, IMRT_Log_Id_Struct *, IMRT_Log_Id_Header, IMRT_Log_Type_Id, IMRT_Log_Level, IMRT_Module *, IMRT_File_Name, IMRT_Line_Id, IMRT_Boolean); + + + + + + + +/*----------------------------------------------------------------------------*/ + +#endif diff --git a/src/liblog_mng/src/Makefile b/src/liblog_mng/src/Makefile new file mode 100644 index 0000000..a1889b4 --- /dev/null +++ b/src/liblog_mng/src/Makefile @@ -0,0 +1,65 @@ +#------------------------------------------------------------------------------ +# Local Makefile +#------------------------------------------------------------------------------ +# $Workfile: Makefile $ +#------------------------------------------------------------------------------ +# $Author: agibert $ +# $Date: 2008/11/12 02:25:22 $ +# $Revision: 1.1 $ +# $Label: $ +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# IMR - Interlinking Message Router +# Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) +# mailto:arnaud@rx3.net +# http://www.rx3.org/dvp/?dvp=imr +#------------------------------------------------------------------------------ +# This file is part of IMR +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# Var include +#------------------------------------------------------------------------------ + +include ../../Makefile_var.mk + + + +#------------------------------------------------------------------------------ +# Variables +#------------------------------------------------------------------------------ + +TARGET= liblog_mng$(SHLIB_SUFFIX) + +OBJ= liblog_mng.o + +EXTRA_INC= + +EXTRA_LIB= + + + +#------------------------------------------------------------------------------ +# Rule include +#------------------------------------------------------------------------------ + +include ../../Makefile_rule.mk diff --git a/src/liblog_mng/src/liblog_mng.c b/src/liblog_mng/src/liblog_mng.c new file mode 100644 index 0000000..3b68757 --- /dev/null +++ b/src/liblog_mng/src/liblog_mng.c @@ -0,0 +1,362 @@ +/*----------------------------------------------------------------------------*/ +/* $Workfile: liblog_mng.c $ */ +/*----------------------------------------------------------------------------*/ +/* $Author: agibert $ */ +/* $Date: 2008/11/12 02:25:22 $ */ +/* $Revision: 1.1 $ */ +/* $Label: $ */ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#define _LIBLOG_MNG_ +#define _LIBLOG_MNG_C_ + +#include "liblog_mng.h" + + + + + + + +/*----------------------------------------------------------------------------*/ +/* Open Log Manager */ +/*----------------------------------------------------------------------------*/ +/* Lib_Flag: Setup IOM init mode */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IMR_LM_Library_Open( IMRT_LM_Config *Config_Ptr) +{ + IMRT_Module_Id module_id; + IMRT_Log_Type_Id log_type_id; + + + if( IMRG_LM_Module.Lib.Status != IMRD_LIB_STATUS_CLOSED) + { + IMRD_LM_LOG_ERROR_0( "Library not closed !"); + + return( IMRS_KO); + } + else + { + strcpy( IMRG_LM_Base.Config.Log_File, Config_Ptr->Log_File); + + if( strcmp( Config_Ptr->Log_File, "-") == 0) + { + IMRG_LM_Base.Stream_Out = stderr; + } + else + { + if( ( IMRG_LM_Base.Stream_Out = fopen( Config_Ptr->Log_File, "a")) == NULL) + { + IMRD_LM_LOG_ERROR_2( "Can't open log file [%s] (%d) !", IMRG_LM_Base.Config.Log_File, errno); + + return( IMRS_KO); + } + } + + + + IMRG_LM_Base.Config.Module_Nb = Config_Ptr->Module_Nb; + + for( module_id = 0; module_id < IMRG_LM_Base.Config.Module_Nb; module_id++) + { + for( log_type_id = 0; log_type_id < IMRD_LOG_TYPE_NB; log_type_id++) + { + IMRG_LM_Base.Config.Level_Tab[ log_type_id][ module_id] = Config_Ptr->Level_Tab[ log_type_id][ module_id]; + } + } + + IMRG_LM_Module.Lib.Status = IMRD_LIB_STATUS_OPENED; + + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_1, "Library opened !"); + + return( IMRS_OK); + } +} + + + + + +/*----------------------------------------------------------------------------*/ +/* Close Log Manager */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IMR_LM_Library_Close() +{ + if( IMRG_LM_Module.Lib.Status != IMRD_LIB_STATUS_OPENED) + { + IMRD_LM_LOG_ERROR_0( "Library not opened !"); + + return( IMRS_KO); + } + else + { + if( ( IMRG_LM_Base.Stream_Out != stderr) && ( fclose( IMRG_LM_Base.Stream_Out) == EOF)) + { + IMRD_LM_LOG_ERROR_2( "Can't close log file [%s] (%d) !", IMRG_LM_Base.Config.Log_File, errno); + + return( IMRS_KO); + } + + IMRG_LM_Module.Lib.Status = IMRD_LIB_STATUS_CLOSED; + + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_1, "Library closed !"); + + return( IMRS_OK); + } +} + + + + + +/*----------------------------------------------------------------------------*/ +/* LM_Stream_Out_Get */ +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ + +FILE *IMR_LM_Stream_Out_Get( void) +{ + if( IMRG_LM_Base.Stream_Out == NULL) + { + return( stderr); + } + else + { + return( IMRG_LM_Base.Stream_Out); + } +} + + + + + +/*----------------------------------------------------------------------------*/ +/* LM_Log_Trigger */ +/*----------------------------------------------------------------------------*/ +/* Log_Type_Id: Type id of log */ +/* Log_Level: Level of log */ +/* Module_Ptr: Loger module pointer */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IMR_LM_Log_Trigger( IMRT_Log_Type_Id Log_Type_Id, IMRT_Log_Level Log_Level, IMRT_Module *Module_Ptr) +{ + FILE *Stream_Out; + + + Stream_Out = IMR_LM_Stream_Out_Get(); + + if( ( Log_Type_Id < 0) || ( Log_Type_Id >= IMRD_LOG_TYPE_NB)) + { + fprintf( Stream_Out, "liblog_mng: %s: Invalid Log_Type_Id (%d) !\n", __FILE__, errno); + + return( IMRS_KO); + } + + if( IMRG_LM_Module.Lib.Status == IMRD_LIB_STATUS_OPENED) + { + if ( IMRG_LM_Base.Config.Level_Tab[ Log_Type_Id][ Module_Ptr->Id] != IMRD_LOG_LEVEL_UNSET) + { + if( Log_Level > IMRG_LM_Base.Config.Level_Tab[ Log_Type_Id][ Module_Ptr->Id]) + { + return( IMRS_OK); + } + } + else + { + if( Log_Level > IMRG_LM_Base.Config.Level_Tab[ Log_Type_Id][ IMRD_MODULE_ID_UNKNOWN]) + { + return( IMRS_OK); + } + } + } + else + { + if( Log_Type_Id == IMRD_LOG_TYPE_ID_TRACE) + { + return( IMRS_OK); + } + } + + return( IMRS_LM_LOG); +} + + + + + +/*----------------------------------------------------------------------------*/ +/* LM_Log_Write */ +/*----------------------------------------------------------------------------*/ +/* Log_Type_Id: Type id of log */ +/* Log_Level: Level of log */ +/* Module_Ptr: Loger module pointer */ +/* File_Name: Loger file name */ +/* Line_Id: Loger line id */ +/* LF_Flag: Add or not a LF at EOF */ +/* Log_Fmt: Format string a la printf */ +/* ...: Optional args */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IMR_LM_Log_Write( IMRT_Log_Type_Id Log_Type_Id, IMRT_Log_Level Log_Level, IMRT_Module *Module_Ptr, IMRT_File_Name File_Name, IMRT_Line_Id Line_Id, IMRT_Boolean LF_Flag, IMRT_Log_Fmt Log_Fmt, ...) +{ + va_list args; + FILE *Stream_Out; + IMRT_Status status; + char fmt[255]; + struct timeval cur_timeval; + struct tm *tm_ptr; + int rc; + + + Stream_Out = IMR_LM_Stream_Out_Get(); + + if( ( status = IMR_LM_Log_Trigger( Log_Type_Id, Log_Level, Module_Ptr)) != IMRS_LM_LOG) + { + return( status); + } + + gettimeofday( &cur_timeval, NULL); + + if( ( tm_ptr = localtime( &( cur_timeval.tv_sec))) == NULL) + { + fprintf( Stream_Out, "liblog_mng: %s: can't convert localtime (%d) !\n", __FILE__, errno); + + return( IMRS_KO); + } + + va_start( args, Log_Fmt); + + sprintf( fmt, "%02d/%02d/%02d %02d:%02d:%02d.%04d %3s %03d %-4s %-21s %-4d %s%s", + ( tm_ptr->tm_year - 100), tm_ptr->tm_mon, tm_ptr->tm_mday, tm_ptr->tm_hour, tm_ptr->tm_min, tm_ptr->tm_sec, ( cur_timeval.tv_usec / 100), + IMRG_LM_Base.Log_Type_Tab[ Log_Type_Id], Log_Level, Module_Ptr->Name, File_Name, Line_Id, + Log_Fmt, + ( ( LF_Flag == IMRD_TRUE) ? "\n" : "")); + + rc = vfprintf( Stream_Out, fmt, args); + + if( rc < 0) + { + fprintf(stderr, "liblog_mng: Can't log messages (%d) !!!\n", errno); + ND_Library_StdErr_Set( NULL); + return(IMRS_KO); + } + + fflush( Stream_Out); + + va_end( args); + + return( IMRS_OK); +} + + + + + +/*----------------------------------------------------------------------------*/ +/* Log_Buffer_Id */ +/*----------------------------------------------------------------------------*/ +/* Buffer_Ptr: buffer to identify */ +/* Log_Id_Struct_Ptr: Log_Id_Heap to use */ +/* Log_Id_Header_Ptr: message to log as header */ +/* Log_Type_Id: Type id of log */ +/* Log_Level: Level of log */ +/* Module_Ptr: Loger module pointer */ +/* File_Name: Loger file name */ +/* Line_Id: Loger line id */ +/* LF_Flag: Add or not a LF at EOF */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IMR_LM_Log_Buffer_Id( IMRT_Buffer *Buffer_Ptr, IMRT_Log_Id_Struct *Log_Id_Struct_Ptr, IMRT_Log_Id_Header Log_Id_Header, IMRT_Log_Type_Id Log_Type_Id, IMRT_Log_Level Log_Level, IMRT_Module *Module_Ptr, IMRT_File_Name File_Name, IMRT_Line_Id Line_Id, IMRT_Boolean LF_Flag) +{ + IMRT_Status status; + char *log_string, *log_ptr, *buf_ptr; + int idx; + + + if( Log_Id_Struct_Ptr->Bit_Nb > 0 ) + { + if( Log_Id_Struct_Ptr->Log_Id_Bit_Ptr != NULL) + { + if( Buffer_Ptr->Data_Buf_Ptr != NULL) + { + /* allocation = taille total des Id + ( deux crochets + un espace entre chaque id ) * le nombre d'Id */ + + if( ( log_string = malloc( Log_Id_Struct_Ptr->Log_Size + ( 3 * Log_Id_Struct_Ptr->Bit_Nb) + 1)) != NULL) + { + for( idx = 0, log_ptr = log_string; idx < Log_Id_Struct_Ptr->Bit_Nb; idx++) + { + *(log_ptr++) = ' '; + *(log_ptr++) = '['; + + for( buf_ptr = Buffer_Ptr->Data_Buf_Ptr + Log_Id_Struct_Ptr->Log_Id_Bit_Ptr[ idx].Offset; + ( *buf_ptr != '\0') && ( buf_ptr < ( Buffer_Ptr->Data_Buf_Ptr + + Log_Id_Struct_Ptr->Log_Id_Bit_Ptr[ idx].Offset + + Log_Id_Struct_Ptr->Log_Id_Bit_Ptr[ idx].Size)); + buf_ptr++) + { + *(log_ptr++) = isprint( *buf_ptr) ? *buf_ptr : '.'; + } + + *(log_ptr++) = ']'; + } + + *log_ptr = '\0'; + + IMR_LM_Log_Write( Log_Type_Id, Log_Level, Module_Ptr, File_Name, Line_Id, LF_Flag, "%s%s", Log_Id_Header, log_string); + + free( log_string); + + status = IMRS_OK; + } + else + { + IMRD_LM_LOG_ERROR_1( "Allocation error ! (%d)", errno); + status = IMRS_KO; + } + + } + else + { + IMRD_LM_LOG_ERROR_0( "Buffer data NULL !"); + status = IMRS_KO; + } + } + else + { + IMRD_LM_LOG_ERROR_0( "Log_Id_Bit_Ptr Null !"); + status = IMRS_KO; + } + } + else + { + status = IMRS_OK; + } + + return( status); +} diff --git a/src/liblog_mng/src/liblog_mng.h b/src/liblog_mng/src/liblog_mng.h new file mode 100644 index 0000000..9874633 --- /dev/null +++ b/src/liblog_mng/src/liblog_mng.h @@ -0,0 +1,141 @@ +/*----------------------------------------------------------------------------*/ +/* File: liblog_mng.h */ +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#ifndef _LIBLOG_MNG_H_ +#define _LIBLOG_MNG_H_ + + + + + +/*----------------------------------------------------------------------------*/ +/* Global Include */ +/*----------------------------------------------------------------------------*/ + +#include +#include + + + + +/*----------------------------------------------------------------------------*/ +/* Lib Definition */ +/*----------------------------------------------------------------------------*/ + +#define IMRD_LM_MODULE_ID ( IMRT_Module_Id) 1 +#define IMRD_LM_MODULE_NAME ( IMRT_Module_Name) "lm" +#define IMRD_LM_MODULE_NAME_LONG ( IMRT_Module_Name_Long) "Log Manager" +#define IMRD_LM_MODULE_VERSION ( IMRT_Module_Version) "@(#) VERSIONIMR: $Label: $ $Date: 2008/11/12 02:25:22 $ $Workfile: liblog_mng.h $" + +#define IMRD_MODULE_PTR &IMRG_LM_Module + + + + + +/*----------------------------------------------------------------------------*/ +/* Local Definitions */ +/*----------------------------------------------------------------------------*/ + +typedef struct IMRT_LM_Base +{ + IMRT_Log_Type_Name Log_Type_Tab[ IMRD_LOG_TYPE_NB]; + IMRT_LM_Config Config; + FILE *Stream_Out; +} IMRT_LM_Base; + + + + + +/*----------------------------------------------------------------------------*/ +/* Prototypes */ +/*----------------------------------------------------------------------------*/ + +# ifdef _LIBLOG_MNG_C_ + +# endif + + + + + +/*----------------------------------------------------------------------------*/ +/* Local Includes */ +/*----------------------------------------------------------------------------*/ + + + + + +/*----------------------------------------------------------------------------*/ +/* Global Variables */ +/*----------------------------------------------------------------------------*/ + +# ifdef _LIBLOG_MNG_C_ + +IMRT_LM_Base IMRG_LM_Base = +{ + { IMRD_LOG_TYPE_NAME_UNKNOWN, IMRD_LOG_TYPE_NAME_TRACE, IMRD_LOG_TYPE_NAME_INFO, IMRD_LOG_TYPE_NAME_WARNING, IMRD_LOG_TYPE_NAME_ERROR}, + { "", 0, { 0 } }, + NULL +}; + + + +IMRT_Module IMRG_LM_Module = +{ + IMRD_LM_MODULE_ID, + IMRD_LM_MODULE_NAME, + IMRD_LM_MODULE_NAME_LONG, + IMRD_LM_MODULE_VERSION, + IMRD_MODULE_TYPE_LIBRARY, + { + IMRD_LIB_STATUS_CLOSED, + ( IMRT_Lib_Open *) &IMR_LM_Library_Open, + ( IMRT_Lib_Close *) &IMR_LM_Library_Close + } +}; + +# else + +extern IMRT_LM_Base IMRG_LM_Base; +extern IMRT_Module IMRG_LM_Module; + +# endif + + + + + + + +/*----------------------------------------------------------------------------*/ + +#endif diff --git a/src/libmapping_mng/include/mapping_mng.h b/src/libmapping_mng/include/mapping_mng.h new file mode 100644 index 0000000..ed53e79 --- /dev/null +++ b/src/libmapping_mng/include/mapping_mng.h @@ -0,0 +1,159 @@ +/*----------------------------------------------------------------------------*/ +/* File: mapping_mng.h */ +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#ifndef _MAPPING_MNG_H_ +#define _MAPPING_MNG_H_ + + + +#include + + + + + +/*----------------------------------------------------------------------------*/ +/* IMRD_MM_API definition */ +/*----------------------------------------------------------------------------*/ + +# ifdef _LIBMAPPING_MNG_C_ +# define IMRD_MM_API +# else +# define IMRD_MM_API extern +# endif + + + + + + + +/*----------------------------------------------------------------------------*/ +/* MM_Config definition */ +/*----------------------------------------------------------------------------*/ + +typedef struct IMRT_MM_Config +{ + IMRT_Boolean XML_Format; +} IMRT_MM_Config; + + + + + +/*----------------------------------------------------------------------------*/ +/* Global Variables */ +/*----------------------------------------------------------------------------*/ + +# ifdef _LIBMAPPING_MNG_ + +# else + +extern IMRT_Module IMRG_MM_Module; + +# endif + + + + + + + +/******************************************************************************/ +/* Mapping Manager API */ +/******************************************************************************/ + + + +/*----------------------------------------------------------------------------*/ +/* Open Mapping Manager */ +/*----------------------------------------------------------------------------*/ + +IMRD_MM_API IMRT_Status IMR_MM_Library_Open( IMRT_MM_Config *); + + + +/*----------------------------------------------------------------------------*/ +/* Close Mapping Manager */ +/*----------------------------------------------------------------------------*/ + +IMRD_MM_API IMRT_Status IMR_MM_Library_Close( void); + + + +/*----------------------------------------------------------------------------*/ +/* Buffer allocation */ +/*----------------------------------------------------------------------------*/ +/* (O) Buffer_Ptr_Ptr : Buffer pointer pointer */ +/*----------------------------------------------------------------------------*/ + +IMRD_MM_API IMRT_Status IMR_MM_Buffer_Alloc( IMRT_Buffer **); + + +/*----------------------------------------------------------------------------*/ +/* Buffer free */ +/*----------------------------------------------------------------------------*/ +/* (IO) Buffer_Ptr_Ptr : Buffer pointer pointer */ +/*----------------------------------------------------------------------------*/ + +IMRD_MM_API IMRT_Status IMR_MM_Buffer_Free( IMRT_Buffer **); + + +/*----------------------------------------------------------------------------*/ +/* Buffer check */ +/*----------------------------------------------------------------------------*/ +/* (I) Buffer_Ptr : Buffer pointer */ +/*----------------------------------------------------------------------------*/ + +IMRD_MM_API IMRT_Status IMR_MM_Buffer_Check (IMRT_Buffer *); + + +/*----------------------------------------------------------------------------*/ +/* Buffer list */ +/*----------------------------------------------------------------------------*/ +/* (I) Buffer_Ptr : Buffer pointer */ +/* (I) texte : Text to print */ +/*----------------------------------------------------------------------------*/ + +IMRD_MM_API IMRT_Status IMR_MM_Buffer_List( IMRT_Buffer *, char *); + + +/*----------------------------------------------------------------------------*/ +/* Buffer mapping */ +/*----------------------------------------------------------------------------*/ +/* (I) Output_Buffer_Ptr : Output buffer pointer */ +/* (I) Input_Buffer_Ptr : Input buffer pointer */ +/*----------------------------------------------------------------------------*/ + +IMRD_MM_API IMRT_Status IMR_MM_Buffer_Map( IMRT_Buffer *, IMRT_Buffer *); + + +/*----------------------------------------------------------------------------*/ + +#endif diff --git a/src/libmapping_mng/src/Makefile b/src/libmapping_mng/src/Makefile new file mode 100644 index 0000000..8be00f1 --- /dev/null +++ b/src/libmapping_mng/src/Makefile @@ -0,0 +1,81 @@ +#------------------------------------------------------------------------------ +# Local Makefile +#------------------------------------------------------------------------------ +# $Workfile: Makefile $ +#------------------------------------------------------------------------------ +# $Author: agibert $ +# $Date: 2008/11/12 02:25:22 $ +# $Revision: 1.1 $ +# $Label: $ +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# IMR - Interlinking Message Router +# Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) +# mailto:arnaud@rx3.net +# http://www.rx3.org/dvp/?dvp=imr +#------------------------------------------------------------------------------ +# This file is part of IMR +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# Var include +#------------------------------------------------------------------------------ + +include ../../Makefile_var.mk + + + +#------------------------------------------------------------------------------ +# Variables +#------------------------------------------------------------------------------ + +TARGET= libmapping_mng$(SHLIB_SUFFIX) + +OBJ= libmapping_mng.o \ + map_scheduler.o \ + buffer_mng.o \ + cnv_hdl_pad_right.o \ + cnv_hdl_pad_left.o \ + cnv_hdl_pad_num.o \ + cnv_hdl_strip_right.o \ + cnv_hdl_strip_left.o \ + cnv_hdl_cut_right.o \ + cnv_hdl_strip_num.o \ + fmt_hdl_fixed.o \ + fmt_hdl_xml.o \ + fmt_hdl_dltd.o + +ifeq ($(TUX_SUPPORT),1) + OBJ+= fmt_hdl_fml.o +endif + +EXTRA_INC= + +EXTRA_LIB= + + + +#------------------------------------------------------------------------------ +# Rule include +#------------------------------------------------------------------------------ + +include ../../Makefile_rule.mk diff --git a/src/libmapping_mng/src/buffer_mng.c b/src/libmapping_mng/src/buffer_mng.c new file mode 100644 index 0000000..ed79e5f --- /dev/null +++ b/src/libmapping_mng/src/buffer_mng.c @@ -0,0 +1,1276 @@ +/*----------------------------------------------------------------------------*/ +/* File: buffer_mng.c */ +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#define _LIBMAPPING_MNG_ +#define _BUFFER_MNG_C_ + +#include "buffer_mng.h" + + +IMRT_Status MM_Buffer_DeInit() +{ + IMRT_Status status; + char *func_name = "MM_Buffer_DeInit"; + int indice; + IMRT_StrHdl_Fmt_Func *StrHdl_Fmt_dynamic_ptr; + IMRT_StrHdl_Cnv_Func *StrHdl_Cnv_dynamic_ptr; + + + status = IMRS_OK; + indice = 0; + StrHdl_Fmt_dynamic_ptr = NULL; + StrHdl_Cnv_dynamic_ptr = NULL; + + if ((IMRG_MM_StrHdl_Fmt_Func_Tab != NULL) && (IMRG_MM_StrHdl_Cnv_Func_Tab != NULL)) + { + while ( (status == IMRS_OK) + && (indice < IMRG_Taille_Fmt_Max) ) + { + StrHdl_Fmt_dynamic_ptr = &(IMRG_MM_StrHdl_Fmt_Func_Tab[indice]); + + if (( StrHdl_Fmt_dynamic_ptr != NULL) && (StrHdl_Fmt_dynamic_ptr->DeInit_Ptr != NULL)) + { + status = StrHdl_Fmt_dynamic_ptr->DeInit_Ptr(); + } + indice++; + } + + + indice = 0; + + while ( (status == IMRS_OK) + && (indice < IMRG_Taille_Cnv_Max) ) + { + StrHdl_Cnv_dynamic_ptr = &(IMRG_MM_StrHdl_Cnv_Func_Tab[indice]); + + if ((StrHdl_Cnv_dynamic_ptr != NULL) && (StrHdl_Cnv_dynamic_ptr->DeInit_Ptr != NULL)) + { + status = StrHdl_Cnv_dynamic_ptr->DeInit_Ptr(); + } + indice++; + } + } + + if ( IMRG_MM_StrHdl_Fmt_Func_Tab != NULL) + { + free( IMRG_MM_StrHdl_Fmt_Func_Tab ); + } + + if ( IMRG_MM_StrHdl_Cnv_Func_Tab != NULL) + { + free( IMRG_MM_StrHdl_Cnv_Func_Tab ); + } + + IMRG_Input_Buffer_Ptr = NULL; + IMRG_Output_Buffer_Ptr = NULL; + IMRG_Taille_Fmt_Max = 0; + IMRG_Taille_Cnv_Max = 0; + + + return ( status ); +} + +IMRT_Status MM_Buffer_Init() +{ + + IMRT_Status status; + char *func_name = "MM_Buffer_Init"; + + + status = IMRS_OK; + IMRG_Input_Buffer_Ptr = NULL; + IMRG_Output_Buffer_Ptr = NULL; + IMRG_Taille_Fmt_Max = 0; + IMRG_Taille_Cnv_Max = 0; + IMRG_MM_StrHdl_Fmt_Func_Tab = NULL; + IMRG_MM_StrHdl_Cnv_Func_Tab = NULL; + + handle = dlopen (NULL , RTLD_LAZY); + if (handle == NULL) + { + IMRD_LM_LOG_ERROR_1("dlopen failed [%s]" , dlerror()); + status = IMRS_KO; + } + + + status = IMR_SDM_Fmt_Proceed(IMR_MM_Fmt_Add); + + if ( status != IMRS_OK) + { + IMRD_LM_LOG_ERROR_1("Format proceed ended with status (%d)" , status); + } + else + { + status = IMR_SDM_Cnv_Proceed(IMR_MM_Cnv_Add); + if ( status != IMRS_OK) + { + IMRD_LM_LOG_ERROR_1("Conversion functions proceed ended with status (%d)" , status); + } + + } + + + return ( status ); + +} + + +IMRT_Status IMR_MM_Fmt_Add(IMRT_Fmt_Id Format_Id , IMRT_Fmt_Name Format_Name , IMRT_Fmt_Id Fmt_Id_Nb) +{ + IMRT_Status status; + char *func_name = "IMR_MM_Fmt_Add"; + size_t tableau_size; + IMRT_StrHdl_Fmt_Func *StrHdl_Fmt_dynamic_ptr; + char func_ptr_name[100]; + char ptr_name[100]; + IMRT_Boolean fmt_is_unknown; + IMRT_Boolean it_is_OK; + + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_2 , "============================================================================") + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_2 , "Initialisation format demand : Begin"); + IMRD_LM_LOG_TRACE_2(IMRD_LOG_LEVEL_VERBOSE_2 , "Format Id : (%d) name : (%s)" , Format_Id , Format_Name); + + fmt_is_unknown = IMRD_FALSE; + it_is_OK = IMRD_TRUE; + status = IMRS_OK; + StrHdl_Fmt_dynamic_ptr = NULL; + + memset( func_ptr_name, '\0', sizeof(func_ptr_name) ); + memset( ptr_name, '\0', sizeof(ptr_name) ); + + if (strcmp(Format_Name,IMRD_FMT_NAME_UNKNOWN) == 0) + fmt_is_unknown = IMRD_TRUE; + + if (IMRG_MM_StrHdl_Fmt_Func_Tab == NULL) + { + IMRD_LM_LOG_TRACE_1(IMRD_LOG_LEVEL_VERBOSE_2 , "Format_Id Max : (%d)" , Fmt_Id_Nb); + tableau_size = (sizeof(IMRT_StrHdl_Fmt_Func) * Fmt_Id_Nb); + IMRG_MM_StrHdl_Fmt_Func_Tab = (IMRT_StrHdl_Fmt_Func *) malloc( tableau_size ); + if (IMRG_MM_StrHdl_Fmt_Func_Tab== NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("malloc IMRG_MM_StrHdl_Fmt_Func_Tab failed" ); + } + else + { + memset( IMRG_MM_StrHdl_Fmt_Func_Tab, '\0', tableau_size ); + IMRG_Taille_Fmt_Max = Fmt_Id_Nb; + } + } + + if (status == IMRS_OK) + { + StrHdl_Fmt_dynamic_ptr = &(IMRG_MM_StrHdl_Fmt_Func_Tab[Format_Id]); + strcpy( StrHdl_Fmt_dynamic_ptr->Nom , Format_Name); + + strcpy(ptr_name , "Init"); + sprintf(func_ptr_name,"MM_%s_StrHdl_%s",Format_Name,ptr_name); + StrHdl_Fmt_dynamic_ptr->Init_Ptr = ( IMRT_MM_Fmt_Hdl_Init *)dlsym(handle , func_ptr_name); + if ((StrHdl_Fmt_dynamic_ptr->Init_Ptr == NULL) && (!fmt_is_unknown)) + it_is_OK = IMRD_FALSE; + + if (it_is_OK) + { + strcpy(ptr_name , "DeInit"); + sprintf(func_ptr_name,"MM_%s_StrHdl_%s",Format_Name,ptr_name); + StrHdl_Fmt_dynamic_ptr->DeInit_Ptr = ( IMRT_MM_Fmt_Hdl_DeInit *)dlsym(handle , func_ptr_name); + if ((StrHdl_Fmt_dynamic_ptr->DeInit_Ptr == NULL) &&( !fmt_is_unknown)) + it_is_OK = IMRD_FALSE; + } + + if (it_is_OK) + { + strcpy(ptr_name , "Data_Free"); + sprintf(func_ptr_name,"MM_%s_StrHdl_%s",Format_Name,ptr_name); + StrHdl_Fmt_dynamic_ptr->Data_Free_Ptr = (IMRT_MM_Fmt_Hdl_Data_Free *)dlsym(handle , func_ptr_name); + if ((StrHdl_Fmt_dynamic_ptr->Data_Free_Ptr == NULL) && (!fmt_is_unknown)) + it_is_OK = IMRD_FALSE; + } + + if (it_is_OK) + { + strcpy(ptr_name , "Ident"); + sprintf(func_ptr_name,"MM_%s_StrHdl_%s",Format_Name,ptr_name); + StrHdl_Fmt_dynamic_ptr->Ident_Ptr = (IMRT_MM_Fmt_Hdl_Ident *)dlsym(handle , func_ptr_name); + if ((StrHdl_Fmt_dynamic_ptr->Ident_Ptr == NULL) && (!fmt_is_unknown)) + it_is_OK = IMRD_FALSE; + } + + if (it_is_OK) + { + strcpy(ptr_name , "Open"); + sprintf(func_ptr_name,"MM_%s_StrHdl_%s",Format_Name,ptr_name); + StrHdl_Fmt_dynamic_ptr->Open_Ptr = (IMRT_MM_Fmt_Hdl_Open *)dlsym(handle , func_ptr_name); + if ((StrHdl_Fmt_dynamic_ptr->Open_Ptr == NULL) && (!fmt_is_unknown)) + it_is_OK = IMRD_FALSE; + } + + if (it_is_OK) + { + strcpy(ptr_name , "Close"); + sprintf(func_ptr_name,"MM_%s_StrHdl_%s",Format_Name,ptr_name); + StrHdl_Fmt_dynamic_ptr->Close_Ptr = (IMRT_MM_Fmt_Hdl_Close *)dlsym(handle , func_ptr_name); + if ((StrHdl_Fmt_dynamic_ptr->Close_Ptr == NULL) && (!fmt_is_unknown)) + it_is_OK = IMRD_FALSE; + } + + if (it_is_OK) + { + strcpy(ptr_name , "Data_List"); + sprintf(func_ptr_name,"MM_%s_StrHdl_%s",Format_Name,ptr_name); + StrHdl_Fmt_dynamic_ptr->Data_List_Ptr = (IMRT_MM_Fmt_Hdl_Data_List *)dlsym(handle , func_ptr_name); + if ((StrHdl_Fmt_dynamic_ptr->Data_List_Ptr == NULL) && (!fmt_is_unknown)) + it_is_OK = IMRD_FALSE; + } + + if (it_is_OK) + { + strcpy(ptr_name , "Copy"); + sprintf(func_ptr_name,"MM_%s_StrHdl_%s",Format_Name,ptr_name); + StrHdl_Fmt_dynamic_ptr->Copy_Ptr = (IMRT_MM_Fmt_Hdl_Copy *)dlsym(handle , func_ptr_name); + if ((StrHdl_Fmt_dynamic_ptr->Copy_Ptr == NULL) && (!fmt_is_unknown)) + it_is_OK = IMRD_FALSE; + } + + if (it_is_OK) + { + strcpy(ptr_name , "Flush"); + sprintf(func_ptr_name,"MM_%s_StrHdl_%s",Format_Name,ptr_name); + StrHdl_Fmt_dynamic_ptr->Flush_Ptr = (IMRT_MM_Fmt_Hdl_Flush *)dlsym(handle , func_ptr_name); + if ((StrHdl_Fmt_dynamic_ptr->Flush_Ptr == NULL) && (!fmt_is_unknown)) + it_is_OK = IMRD_FALSE; + } + + if (it_is_OK) + { + strcpy(ptr_name , "Get"); + sprintf(func_ptr_name,"MM_%s_StrHdl_%s",Format_Name,ptr_name); + StrHdl_Fmt_dynamic_ptr->Get_Ptr = (IMRT_MM_Fmt_Hdl_Get *)dlsym(handle , func_ptr_name); + if ((StrHdl_Fmt_dynamic_ptr->Get_Ptr == NULL) && (!fmt_is_unknown)) + it_is_OK = IMRD_FALSE; + } + + if (it_is_OK) + { + strcpy(ptr_name , "Convert"); + sprintf(func_ptr_name,"MM_%s_StrHdl_%s",Format_Name,ptr_name); + StrHdl_Fmt_dynamic_ptr->Cnv_Ptr = (IMRT_MM_Fmt_Hdl_Cnv *)dlsym(handle , func_ptr_name); + if ((StrHdl_Fmt_dynamic_ptr->Cnv_Ptr == NULL) && (!fmt_is_unknown)) + it_is_OK = IMRD_FALSE; + } + + if (it_is_OK) + { + strcpy(ptr_name , "Put"); + sprintf(func_ptr_name,"MM_%s_StrHdl_%s",Format_Name,ptr_name); + StrHdl_Fmt_dynamic_ptr->Put_Ptr = (IMRT_MM_Fmt_Hdl_Put *)dlsym(handle , func_ptr_name); + if ((StrHdl_Fmt_dynamic_ptr->Put_Ptr == NULL) && (!fmt_is_unknown)) + it_is_OK = IMRD_FALSE; + } + + if (it_is_OK && StrHdl_Fmt_dynamic_ptr->Init_Ptr != NULL) + { + status = StrHdl_Fmt_dynamic_ptr->Init_Ptr(); + if (status == IMRS_KO) + IMRD_LM_LOG_ERROR_0("Initialisation handlers failed" ); + } + + if (!it_is_OK) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Pointeur null et format different de unknown" ); + IMRD_LM_LOG_ERROR_1("dlsym failed [%s]", dlerror()); + } + + } + + IMRD_LM_LOG_TRACE_1(IMRD_LOG_LEVEL_VERBOSE_2 , "Initialisation format demand : End with status : (%d)" , status); + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_2 , "============================================================================") + + return ( status ); + +} + +IMRT_Status IMR_MM_Cnv_Add(IMRT_Cnv_Id Conv_Id , IMRT_Cnv_Name Conv_Name , IMRT_Cnv_Id Conv_Id_Nb) +{ + IMRT_Status status; + char *func_name = "IMR_MM_Cnv_Add"; + size_t tableau_size; + IMRT_StrHdl_Cnv_Func *StrHdl_Cnv_dynamic_ptr; + char func_ptr_name[100]; + char ptr_name[100]; + IMRT_Boolean cnv_is_unknown; + IMRT_Boolean it_is_OK; + + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_2 , "============================================================================") + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_2 , "Initialisation conversion function demand : Begin"); + IMRD_LM_LOG_TRACE_2(IMRD_LOG_LEVEL_VERBOSE_2 , "Conversion Id : (%d) name : (%s)" , Conv_Id , Conv_Name); + + + cnv_is_unknown = IMRD_FALSE; + it_is_OK = IMRD_TRUE; + status = IMRS_OK; + StrHdl_Cnv_dynamic_ptr = NULL; + + memset( func_ptr_name, '\0', sizeof(func_ptr_name) ); + memset( ptr_name, '\0', sizeof(ptr_name) ); + + if (strcmp(Conv_Name,IMRD_CNV_NAME_UNKNOWN)==0) + cnv_is_unknown = IMRD_TRUE; + + if (IMRG_MM_StrHdl_Cnv_Func_Tab == NULL) + { + IMRD_LM_LOG_TRACE_1(IMRD_LOG_LEVEL_VERBOSE_2 , "Conv_Id Max : (%d)" , Conv_Id_Nb); + tableau_size = (sizeof(IMRT_StrHdl_Cnv_Func) * Conv_Id_Nb); + IMRG_MM_StrHdl_Cnv_Func_Tab = (IMRT_StrHdl_Cnv_Func *) malloc( tableau_size ); + if (IMRG_MM_StrHdl_Cnv_Func_Tab== NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("malloc IMRG_MM_StrHdl_Cnv_Func_Tab failed" ); + } + else + { + memset( IMRG_MM_StrHdl_Cnv_Func_Tab, '\0', tableau_size ); + IMRG_Taille_Cnv_Max = Conv_Id_Nb; + } + } + + if (status == IMRS_OK) + { + StrHdl_Cnv_dynamic_ptr = &(IMRG_MM_StrHdl_Cnv_Func_Tab[Conv_Id]); + strcpy( StrHdl_Cnv_dynamic_ptr->Nom , Conv_Name); + strcpy(ptr_name , "Init"); + sprintf(func_ptr_name,"MM_%s_%s",Conv_Name,ptr_name); + StrHdl_Cnv_dynamic_ptr->Init_Ptr = ( IMRT_MM_Cnv_Init *)dlsym(handle , func_ptr_name); + if ((StrHdl_Cnv_dynamic_ptr->Init_Ptr == NULL) && (!cnv_is_unknown)) + it_is_OK = IMRD_FALSE; + + if (it_is_OK) + { + strcpy(ptr_name , "DeInit"); + sprintf(func_ptr_name,"MM_%s_%s",Conv_Name,ptr_name); + StrHdl_Cnv_dynamic_ptr->DeInit_Ptr = ( IMRT_MM_Cnv_DeInit *)dlsym(handle , func_ptr_name); + if ((StrHdl_Cnv_dynamic_ptr->DeInit_Ptr == NULL) && ( !cnv_is_unknown)) + it_is_OK = IMRD_FALSE; + } + + if (it_is_OK) + { + strcpy(ptr_name , "Convert"); + sprintf(func_ptr_name,"MM_%s_%s",Conv_Name,ptr_name); + StrHdl_Cnv_dynamic_ptr->Convert_Ptr = (IMRT_MM_Convert *)dlsym(handle , func_ptr_name); + if ((StrHdl_Cnv_dynamic_ptr->Convert_Ptr == NULL) && ( !cnv_is_unknown)) + it_is_OK = IMRD_FALSE; + } + + + if (it_is_OK && StrHdl_Cnv_dynamic_ptr->Init_Ptr != NULL) + { + status = StrHdl_Cnv_dynamic_ptr->Init_Ptr(); + if (status == IMRS_KO) + IMRD_LM_LOG_ERROR_0("Initialisation convert failed" ); + } + + if (!it_is_OK) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Pointeur null et Fonction de conversion differente de unknown" ); + IMRD_LM_LOG_ERROR_1("dlsym failed [%s]", dlerror()); + } + + } + + + IMRD_LM_LOG_TRACE_1(IMRD_LOG_LEVEL_VERBOSE_2 , "Initialisation conversion function demand : End with status : (%d)" , status); + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_2 , "============================================================================") + + return ( status ); + +} + + +IMRT_Status MM_Buffer_List( IMRT_Buffer *Buffer_Ptr, char *texte) +{ + char status_str[10]; + char flag_str[10]; + IMRT_Fmt_Id fmt_id; + IMRT_Status status; + + + status = IMRS_OK; + fmt_id = IMRD_FMT_ID_UNKNOWN; + + if (Buffer_Ptr == NULL) + { + IMRD_LM_LOG_WARNING_0("Buffer pointer NULL"); + } + else + { + switch( Buffer_Ptr->Status) + { + case IMRD_BUFFER_STATUS_ALLOCATED : strcpy( status_str, "ALLOCATED"); break; + case IMRD_BUFFER_STATUS_FREED : strcpy( status_str, "FREED"); break; + default : strcpy( status_str, "UNKNOWN"); break; + } + + switch (Buffer_Ptr->Flag) + { + case IMRD_BUFFER_FLAG_OPENED : strcpy( flag_str, "OPENED"); break; + case IMRD_BUFFER_FLAG_CLOSED : strcpy( flag_str, "CLOSED"); break; + default : strcpy( flag_str, "UNKNOWN"); break; + } + + IMRD_LM_LOG_TRACE_2( IMRD_LOG_LEVEL_VERBOSE_1, "Buffer_List: Buffer: [%s] Address: (0x%X)", texte, Buffer_Ptr); + + if( ( status = Buffer_Format_Check( Buffer_Ptr->Fmt_Id)) == IMRS_OK) + { + fmt_id = Buffer_Ptr->Fmt_Id; + } + else + { + fmt_id = IMRD_FMT_ID_UNKNOWN; + } + + IMRD_LM_LOG_TRACE_3( IMRD_LOG_LEVEL_VERBOSE_1, "Buffer_List: Appl_Id_Input: (%2d) Appl_Id_Output: (%2d) Dir_Id: (%2d)", Buffer_Ptr->Appl_Id_Input, Buffer_Ptr->Appl_Id_Output, Buffer_Ptr->Dir_Id); + IMRD_LM_LOG_TRACE_3( IMRD_LOG_LEVEL_VERBOSE_1, "Buffer_List: Fmt_Id: (%2d) [%9s] Msg_Id: (%2d)", Buffer_Ptr->Fmt_Id, IMRG_MM_StrHdl_Fmt_Func_Tab[fmt_id].Nom, Buffer_Ptr->Msg_Id); + IMRD_LM_LOG_TRACE_4( IMRD_LOG_LEVEL_VERBOSE_1, "Buffer_List: Status: (%2d) [%9s] Flag: (%2d) [%7s]", Buffer_Ptr->Status, status_str, Buffer_Ptr->Flag, flag_str); + IMRD_LM_LOG_TRACE_1( IMRD_LOG_LEVEL_VERBOSE_1, "Buffer_List: Format attribute: [%s]" , Buffer_Ptr->FmtAttr_Value); + + if (IMRG_MM_StrHdl_Fmt_Func_Tab != NULL) + { + if ( IMRG_MM_StrHdl_Fmt_Func_Tab[fmt_id].Data_List_Ptr == NULL) + { + IMRD_LM_LOG_WARNING_1( "Null Fonction List for [%s] format", IMRG_MM_StrHdl_Fmt_Func_Tab[fmt_id].Nom); + } + else + { + status = IMRG_MM_StrHdl_Fmt_Func_Tab[Buffer_Ptr->Fmt_Id].Data_List_Ptr(Buffer_Ptr); + } + } + } + + return ( status ); +} + +IMRT_Status MM_Buffer_Alloc (IMRT_Buffer **Buffer_Ptr_Ptr) +{ + IMRT_Buffer *buffer_Ptr; + IMRT_Status status; + char *func_name = "MM_Buffer_Alloc"; + + + status = IMRS_OK; + buffer_Ptr = (IMRT_Buffer *) malloc( sizeof(IMRT_Buffer) ); + + + if (buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer pointer NULL" ); + } + else + if (buffer_Ptr->FmtAttr_Value == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("buffer_Ptr->FmtAttr_Value NULL" ); + } + else + if (Buffer_Ptr_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer pointer NULL" ); + } + else + { + *Buffer_Ptr_Ptr = buffer_Ptr; + buffer_Ptr->Appl_Id_Input = IMRD_APPL_ID_UNKNOWN; + buffer_Ptr->Appl_Id_Output = IMRD_APPL_ID_UNKNOWN; + buffer_Ptr->Dir_Id = IMRD_DIR_ID_UNKNOWN; + buffer_Ptr->Fmt_Id = IMRD_FMT_ID_UNKNOWN; + strcpy(buffer_Ptr->FmtAttr_Value , IMRD_FMTATTR_NAME_UNKNOWN); + buffer_Ptr->Msg_Id = IMRD_MSG_ID_UNKNOWN; + buffer_Ptr->Status = IMRD_BUFFER_STATUS_UNKNOWN; + buffer_Ptr->Flag = IMRD_BUFFER_FLAG_UNKNOWN; + buffer_Ptr->Data_Buf_Ptr = NULL; + buffer_Ptr->Data_Tmp_Ptr = NULL; + buffer_Ptr->Data_Tmp_Changed = IMRD_FALSE; + buffer_Ptr->Data_Buf_Size = 0; + buffer_Ptr->Data_Buf_Len = 0; + } + + return ( status ); +} + +IMRT_Status Buffer_Data_Free( IMRT_Buffer *Buffer_Ptr) +{ + IMRT_Status status; + char *func_name = "Buffer_Data_Free"; + + status = IMRS_OK; + + /* recherche du handler */ + if (Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer pointer NULL" ); + } + else + if (IMRG_MM_StrHdl_Fmt_Func_Tab == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Format tab pointer NULL" ); + } + else + { + status = Buffer_Format_Check( Buffer_Ptr->Fmt_Id ); + + if (status == IMRS_OK) + { + if (IMRG_MM_StrHdl_Fmt_Func_Tab[Buffer_Ptr->Fmt_Id].Data_Free_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_1("fonction Data_Free = NULL pour format %s" , + IMRG_MM_StrHdl_Fmt_Func_Tab[Buffer_Ptr->Fmt_Id].Nom); + } + else + { + status = IMRG_MM_StrHdl_Fmt_Func_Tab[Buffer_Ptr->Fmt_Id].Data_Free_Ptr(Buffer_Ptr); + } + } + } + + + return ( status ); +} + +IMRT_Status MM_Buffer_Free (IMRT_Buffer **Buffer_Ptr_Ptr) +{ + IMRT_Status status; + char *func_name = "MM_Buffer_Free"; + + + status = IMRS_OK; + + if (*Buffer_Ptr_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer pointer NULL" ); + } + else + { + /* il y a des donnees dans Data_Buf_Ptr ou dans Data_Tmp_Ptr */ + if ( ((*Buffer_Ptr_Ptr)->Status == IMRD_BUFFER_STATUS_ALLOCATED) || + ((*Buffer_Ptr_Ptr)->Flag == IMRD_BUFFER_FLAG_OPENED) ) + { + status = Buffer_Data_Free( *Buffer_Ptr_Ptr ); + } + free(*Buffer_Ptr_Ptr); + *Buffer_Ptr_Ptr = NULL; + } + + return ( status ) ; +} + +IMRT_Status MM_Buffer_Clear (IMRT_Buffer *Buffer_Ptr) +{ + IMRT_Status status; + char *func_name = "MM_Buffer_Clear"; + + + status = IMRS_OK; + + if (Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer pointer NULL" ); + } + else + { + /* il y a des donnees dans Data_Buf_Ptr ou dans Data_Tmp_Ptr */ + if ( (Buffer_Ptr->Status == IMRD_BUFFER_STATUS_ALLOCATED) || + (Buffer_Ptr->Flag == IMRD_BUFFER_FLAG_OPENED) ) + { + status = Buffer_Data_Free( Buffer_Ptr); + } + if (status == IMRS_OK) + { + Buffer_Ptr->Fmt_Id = IMRD_FMT_ID_UNKNOWN; + Buffer_Ptr->Msg_Id = IMRD_MSG_ID_UNKNOWN; + Buffer_Ptr->Status = IMRD_BUFFER_STATUS_UNKNOWN; + Buffer_Ptr->Flag = IMRD_BUFFER_FLAG_UNKNOWN; + } + } + + return ( status ); +} + +IMRT_Status Buffer_Format_Check( IMRT_Fmt_Id Format ) +{ + IMRT_Status status; + char *func_name = "Buffer_Format_Check"; + + status = IMRS_OK; + + if ( (Format >= 0) && (Format < IMRG_Taille_Fmt_Max)) + status =IMRS_OK; + else + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_1("Format %d incorrect" , Format ); + } + + return ( status ); +} + +IMRT_Status MM_Buffer_Ident_Update( IMRT_Buffer *Buffer_Ptr, + IMRT_Fmt_Id Format, + IMRT_FmtAttr_Value Fmt_Attr , + IMRT_Msg_Id Type) +{ + IMRT_Status status; + char *func_name = "MM_Buffer_Ident_Update"; + + status = IMRS_OK; + + + if (Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer pointer NULL" ); + } + else + if (Buffer_Ptr->FmtAttr_Value == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer_Ptr->FmtAttr_Value NULL" ); + } + if (Fmt_Attr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("FmtAttr NULL" ); + } + else + { + status = Buffer_Format_Check( Format ); + if (status == IMRS_OK) + { + /* si le buffer est ouvert le fermer avant de changer de format */ + if ( (Buffer_Ptr->Flag == IMRD_BUFFER_FLAG_OPENED) + && ( (Buffer_Ptr->Fmt_Id != Format) || + (strcmp(Buffer_Ptr->FmtAttr_Value,Fmt_Attr) !=0) ) ) + { + status = MM_Buffer_Close(Buffer_Ptr); + } + } + if (status == IMRS_OK) + { + Buffer_Ptr->Fmt_Id = Format; + strcpy(Buffer_Ptr->FmtAttr_Value , Fmt_Attr); + Buffer_Ptr->Msg_Id = Type; + } + } + + return ( status ); +} + +IMRT_Status MM_Buffer_Ident(IMRT_Msg_Id Msg_Id_Ident , IMRT_Buffer *Buffer_Ptr) +{ + IMRT_Status status; + char *func_name = "MM_Buffer_Ident"; + + status = IMRS_OK; + + if (Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer pointer NULL" ); + } + else + { + if (IMRG_MM_StrHdl_Fmt_Func_Tab == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Format tab pointer NULL" ); + } + else + { + if (Buffer_Ptr->Flag != IMRD_BUFFER_FLAG_OPENED) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer not open" ); + } + else + { + status = Buffer_Format_Check(Buffer_Ptr->Fmt_Id); + if (status == IMRS_OK) + { + if (IMRG_MM_StrHdl_Fmt_Func_Tab[Buffer_Ptr->Fmt_Id].Ident_Ptr == NULL) + { + IMRD_LM_LOG_TRACE_1(IMRD_LOG_LEVEL_VERBOSE_1 , "fonction Ident = NULL pour format %s" , + IMRG_MM_StrHdl_Fmt_Func_Tab[Buffer_Ptr->Fmt_Id].Nom); + } + else + { + status = IMRG_MM_StrHdl_Fmt_Func_Tab[Buffer_Ptr->Fmt_Id].Ident_Ptr(&Msg_Id_Ident, Buffer_Ptr); + } + } + if (status == IMRS_OK) + { + Buffer_Ptr->Msg_Id = Msg_Id_Ident; + } + } + } + } + + + return ( status ); + +} + + +IMRT_Status MM_Buffer_Open( IMRT_Buffer *Buffer_Ptr) +{ + IMRT_Fmt_Id format_temp; + short indice; + IMRT_Status status; + char *func_name = "MM_Buffer_Open"; + + + status = IMRS_OK; + indice = 0; + format_temp = IMRD_FMT_ID_UNKNOWN; + + if (Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer pointer NULL" ); + } + else + { + format_temp = Buffer_Ptr->Fmt_Id; + if (Buffer_Ptr->Flag !=IMRD_BUFFER_FLAG_OPENED) + { + + /* controle validite du format */ + status = Buffer_Format_Check( format_temp ); + + if (IMRG_MM_StrHdl_Fmt_Func_Tab == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Format tab pointer NULL" ); + } + else + { + /* format non identifie */ + if ( format_temp == IMRD_FMT_ID_UNKNOWN ) + { + if ( Buffer_Ptr->Status != IMRD_BUFFER_STATUS_ALLOCATED ) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer not allocated" ); + } + else + { + indice = 0; + status = IMRS_BAD_FORMAT; + while ( (status == IMRS_BAD_FORMAT) + && (indice < IMRG_Taille_Fmt_Max) ) + { + if (IMRG_MM_StrHdl_Fmt_Func_Tab[indice].Open_Ptr == NULL) + { + IMRD_LM_LOG_TRACE_1(IMRD_LOG_LEVEL_VERBOSE_1 , "fonction Open = NULL pour format %s" , + IMRG_MM_StrHdl_Fmt_Func_Tab[indice].Nom); + } + else + { format_temp = indice; + status = IMRG_MM_StrHdl_Fmt_Func_Tab[indice].Open_Ptr( Buffer_Ptr); + } + indice++; + } + } + } + /* format identifie */ + else + { + if (status == IMRS_OK) + { + if (IMRG_MM_StrHdl_Fmt_Func_Tab[Buffer_Ptr->Fmt_Id].Open_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_1("fonction Open = NULL pour format %s" , + IMRG_MM_StrHdl_Fmt_Func_Tab[Buffer_Ptr->Fmt_Id].Nom); + } + else + { + status = IMRG_MM_StrHdl_Fmt_Func_Tab[Buffer_Ptr->Fmt_Id].Open_Ptr( Buffer_Ptr); + } + } + } + } + + if (status == IMRS_OK) + { + Buffer_Ptr->Flag = IMRD_BUFFER_FLAG_OPENED; + if (Buffer_Ptr->Fmt_Id != format_temp) + Buffer_Ptr->Fmt_Id = format_temp; + + } + } + } + + + return ( status ); +} + +IMRT_Status MM_Buffer_Close(IMRT_Buffer *Buffer_Ptr) +{ + IMRT_Status status; + char *func_name = "MM_Buffer_Close"; + + + status = IMRS_OK; + + if (Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer pointer NULL" ); + } + else + { + if (Buffer_Ptr->Flag !=IMRD_BUFFER_FLAG_CLOSED) + { + status = Buffer_Format_Check( Buffer_Ptr->Fmt_Id ); + if (status == IMRS_OK) + { + if (Buffer_Ptr->Flag == IMRD_BUFFER_FLAG_OPENED) + { + if (IMRG_MM_StrHdl_Fmt_Func_Tab == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Format tab pointer NULL" ); + } + else + { + if (IMRG_MM_StrHdl_Fmt_Func_Tab[Buffer_Ptr->Fmt_Id].Close_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_1("fonction Close = NULL pour format %s" , + IMRG_MM_StrHdl_Fmt_Func_Tab[Buffer_Ptr->Fmt_Id].Nom); + } + else + { + status = IMRG_MM_StrHdl_Fmt_Func_Tab[Buffer_Ptr->Fmt_Id].Close_Ptr(Buffer_Ptr); + } + } + } + } + if (status == IMRS_OK) + { + Buffer_Ptr->Flag = IMRD_BUFFER_FLAG_CLOSED; + } + } + } + + return ( status ); +} + +/* La fonction suivante n'est pas implementee pour le moment */ +/* Le nom des applications n'est connue que du static data manager */ +IMRT_Status Buffer_Application_Check( IMRT_Appl_Id Application ) +{ + IMRT_Status status; + char *func_name = "Buffer_Application_Check"; + + + status =IMRS_OK; + + + + return ( status ); +} + +IMRT_Status Buffer_Direction_Check( IMRT_Dir_Id Direction ) +{ + IMRT_Status status; + char *func_name = "Buffer_Direction_Check"; + + + if ((Direction == IMRD_DIR_ID_UNKNOWN) || + (Direction == IMRD_DIR_ID_IN ) || + (Direction == IMRD_DIR_ID_OUT ) ) + status =IMRS_OK; + else + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_1("Incorrect direction %d" , Direction ); + } + + + return ( status ); +} + +IMRT_Status Buffer_Statut_Check( IMRT_Buffer_Status Statut ) +{ + IMRT_Status status; + char *func_name = "Buffer_Statut_Check"; + + + if ((Statut == IMRD_BUFFER_STATUS_UNKNOWN ) || + (Statut == IMRD_BUFFER_STATUS_ALLOCATED) || + (Statut == IMRD_BUFFER_STATUS_FREED ) ) + status =IMRS_OK; + else + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_1("Incorrect status %d" , Statut ); + } + + return ( status ); +} + +IMRT_Status Buffer_Etat_Check( IMRT_Buffer_Flag Flag ) +{ + IMRT_Status status; + char *func_name = "Buffer_Etat_Check"; + + + if ((Flag == IMRD_BUFFER_FLAG_UNKNOWN) || + (Flag == IMRD_BUFFER_FLAG_OPENED ) || + (Flag == IMRD_BUFFER_FLAG_CLOSED ) ) + status =IMRS_OK; + else + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_1("Incorrect Flag %d" , Flag ) + } + + return ( status ); +} + +IMRT_Status MM_Buffer_Check( IMRT_Buffer *Buffer_Ptr) +{ + IMRT_Status status; + char *func_name = "MM_Buffer_Check"; + + status = IMRS_OK; + + if (Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer pointer NULL" ); + } + else + { + if ( ( Buffer_Application_Check(Buffer_Ptr->Appl_Id_Input ) == IMRS_OK ) && + ( Buffer_Application_Check(Buffer_Ptr->Appl_Id_Output ) == IMRS_OK ) && + ( Buffer_Direction_Check (Buffer_Ptr->Dir_Id ) == IMRS_OK ) && + ( Buffer_Format_Check (Buffer_Ptr->Fmt_Id ) == IMRS_OK ) && + ( Buffer_Statut_Check (Buffer_Ptr->Status ) == IMRS_OK ) && + ( Buffer_Etat_Check (Buffer_Ptr->Flag ) == IMRS_OK ) ) + status = IMRS_OK; + else + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer check failed" ); + } + } + + return ( status ); +} + +IMRT_Status MM_Buffer_Copy( IMRT_Buffer *Output_Buffer_Ptr, IMRT_Buffer *Input_Buffer_Ptr) +{ + IMRT_Status status; + char *func_name = "MM_Buffer_Copy"; + + + status = IMRS_OK; + + + if (Input_Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Input buffer pointer NULL" ); + } + else + if (Output_Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Output buffer pointer NULL" ); + } + else + if (IMRG_MM_StrHdl_Fmt_Func_Tab == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Format tab pointer NULL" ); + } + else + { + /* buffer non identifie => demande identification */ + if ( (Input_Buffer_Ptr->Fmt_Id == IMRD_FMT_ID_UNKNOWN) || (Input_Buffer_Ptr->Msg_Id == IMRD_MSG_ID_UNKNOWN) ) + { + status = MM_Buffer_Open( Input_Buffer_Ptr ); + } + + /* s'assurer que les donnees sont dans Data_Buf */ + if ( status == IMRS_OK ) + { + if (IMRG_MM_StrHdl_Fmt_Func_Tab[Input_Buffer_Ptr->Fmt_Id].Flush_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_1("fonction Flush = NULL pour format %s" , + IMRG_MM_StrHdl_Fmt_Func_Tab[Input_Buffer_Ptr->Fmt_Id].Nom); + } + else + { + status = IMRG_MM_StrHdl_Fmt_Func_Tab[Input_Buffer_Ptr->Fmt_Id].Flush_Ptr(Input_Buffer_Ptr); + } + } + + /* reinitialiser le buffer destinataire */ + if (status == IMRS_OK) + { + status = MM_Buffer_Clear( Output_Buffer_Ptr ); + } + + /* mise a jour du format et du type du buffer destinataire */ + if (status == IMRS_OK) + { + status = MM_Buffer_Ident_Update(Output_Buffer_Ptr, + Input_Buffer_Ptr->Fmt_Id, + Input_Buffer_Ptr->FmtAttr_Value, + Input_Buffer_Ptr->Msg_Id); + } + + /* mise a jour des applications et direction du buffer destinataire */ + if (status == IMRS_OK) + { + Output_Buffer_Ptr->Appl_Id_Input = Input_Buffer_Ptr->Appl_Id_Input ; + Output_Buffer_Ptr->Appl_Id_Output = Input_Buffer_Ptr->Appl_Id_Output ; + Output_Buffer_Ptr->Dir_Id = Input_Buffer_Ptr->Dir_Id ; + } + + + /* mise a jour de l'attribut du format du buffer destinataire */ + if (status == IMRS_OK) + { + strcpy(Output_Buffer_Ptr->FmtAttr_Value , Input_Buffer_Ptr->FmtAttr_Value) ; + } + + + /* copie des donnees du buffer source dans le buffer destinataire */ + if (status == IMRS_OK) + { + if (IMRG_MM_StrHdl_Fmt_Func_Tab[Input_Buffer_Ptr->Fmt_Id].Copy_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_1("fonction Copy = NULL pour format %s" , + IMRG_MM_StrHdl_Fmt_Func_Tab[Input_Buffer_Ptr->Fmt_Id].Nom); + } + else + { + status = IMRG_MM_StrHdl_Fmt_Func_Tab[Input_Buffer_Ptr->Fmt_Id].Copy_Ptr(Output_Buffer_Ptr, + Input_Buffer_Ptr); + } + } + if (status == IMRS_OK) + { + Output_Buffer_Ptr->Flag = IMRD_BUFFER_FLAG_CLOSED; + } + } + + + return ( status ); +} + +IMRT_Status MM_Buffer_Map(IMRT_Buffer *Output_Buffer_Ptr, + IMRT_Buffer *Input_Buffer_Ptr, + IMRT_MsgMap *MsgMap_Ptr) +{ + IMRT_Status status; + char *func_name = "MM_Buffer_Map"; + + status = IMRS_OK; + + if (Input_Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Input buffer pointer NULL" ); + } + else + if (Output_Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Output buffer pointer NULL" ); + } + else + { + if ( ( Input_Buffer_Ptr->Flag != IMRD_BUFFER_FLAG_OPENED ) || + ( Output_Buffer_Ptr->Flag != IMRD_BUFFER_FLAG_OPENED ) ) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer input or output not open" ); + } + else + { + IMRG_Input_Buffer_Ptr = Input_Buffer_Ptr; + IMRG_Output_Buffer_Ptr = Output_Buffer_Ptr; + status = IMR_SDM_MsgMap_Proceed( MsgMap_Ptr, IMR_MM_Buffer_FieldMap); + if (status != IMRS_OK) + IMRD_LM_LOG_ERROR_1("MsgMap proceed ended with status (%d)" , status); + IMRG_Input_Buffer_Ptr = NULL; + IMRG_Output_Buffer_Ptr = NULL; + } + } + + + return ( status ); +} + +IMRT_Status IMR_MM_Buffer_FieldMap( IMRT_Field *Field_Output_Ptr , IMRT_Field *Field_Input_Ptr ) +{ + IMRT_Buffer *buffer_ptr; + IMRT_Buffer_Data *data_In_ptr; + IMRT_Buffer_Data *data_Out_ptr; + IMRT_Status status; + size_t field_len; + IMRT_Boolean cnv_OK; + char *func_name = "IMR_MM_Buffer_FieldMap"; + + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_1 , "============================================================================") + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_1 , "Field map demand : Begin"); + IMRD_LM_LOG_TRACE_2(IMRD_LOG_LEVEL_VERBOSE_1 , "Field Input name : (%s) Field Output name : (%s)" , Field_Input_Ptr->Name , Field_Output_Ptr->Name); + + status = IMRS_OK; + cnv_OK =IMRD_TRUE; + data_In_ptr = NULL; + data_Out_ptr = NULL; + buffer_ptr = NULL; + field_len = 0L; + + if (IMRG_Input_Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Input buffer pointer NULL" ); + } + else + if (IMRG_Output_Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Output buffer pointer NULL" ); + } + else + if (IMRG_MM_StrHdl_Fmt_Func_Tab == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Format tab pointer NULL" ); + } + else + { + buffer_ptr = IMRG_Input_Buffer_Ptr; + if (IMRG_MM_StrHdl_Fmt_Func_Tab[buffer_ptr->Fmt_Id].Get_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_1("fonction Get = NULL pour format %s" , + IMRG_MM_StrHdl_Fmt_Func_Tab[buffer_ptr->Fmt_Id].Nom); + } + else + { + status = IMRG_MM_StrHdl_Fmt_Func_Tab[buffer_ptr->Fmt_Id].Get_Ptr(&data_In_ptr, + Field_Input_Ptr, + buffer_ptr , + &field_len ); + IMRD_LM_LOG_TRACE_2(IMRD_LOG_LEVEL_VERBOSE_2 , "Data and len after get [%s] : (%ld)",data_In_ptr,field_len); + } + + + if (status == IMRS_OK) + { + buffer_ptr = IMRG_Output_Buffer_Ptr; + if (IMRG_MM_StrHdl_Fmt_Func_Tab[buffer_ptr->Fmt_Id].Cnv_Ptr == NULL) + { + cnv_OK = IMRD_FALSE; + IMRD_LM_LOG_WARNING_1("fonction de convertion nulle pour handler de format %s" , + IMRG_MM_StrHdl_Fmt_Func_Tab[buffer_ptr->Fmt_Id].Nom); + } + else + { + status = IMRG_MM_StrHdl_Fmt_Func_Tab[buffer_ptr->Fmt_Id].Cnv_Ptr(&data_Out_ptr, + data_In_ptr, + Field_Output_Ptr, + &field_len, + IMRG_MM_StrHdl_Cnv_Func_Tab); + IMRD_LM_LOG_TRACE_2(IMRD_LOG_LEVEL_VERBOSE_2 , "Data and len after convert [%s] : (%ld)",data_Out_ptr,field_len); + } + } + + if (status == IMRS_OK) + { + if (IMRG_MM_StrHdl_Fmt_Func_Tab[buffer_ptr->Fmt_Id].Put_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_1("fonction Put = NULL pour format %s" , + IMRG_MM_StrHdl_Fmt_Func_Tab[buffer_ptr->Fmt_Id].Nom); + if (cnv_OK) + { + free(data_Out_ptr); + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_2 , "liberation du data_Out_ptr" ); + } + else + { + free(data_In_ptr); + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_2 , "liberation du data_In_ptr" ); + } + } + else + { + if (cnv_OK) + { + status = IMRG_MM_StrHdl_Fmt_Func_Tab[buffer_ptr->Fmt_Id].Put_Ptr(data_Out_ptr, + Field_Output_Ptr, + buffer_ptr, + field_len); + } + else + { + status = IMRG_MM_StrHdl_Fmt_Func_Tab[buffer_ptr->Fmt_Id].Put_Ptr(data_In_ptr, + Field_Output_Ptr, + buffer_ptr, + field_len); + } + } + } + } + + MM_Buffer_List( buffer_ptr, " Buffer after put"); + IMRD_LM_LOG_TRACE_1(IMRD_LOG_LEVEL_VERBOSE_2 , "Field map demand : End with status : (%d)" , status); + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_2 , "============================================================================") + + return ( status ); +} diff --git a/src/libmapping_mng/src/buffer_mng.h b/src/libmapping_mng/src/buffer_mng.h new file mode 100644 index 0000000..4caec3c --- /dev/null +++ b/src/libmapping_mng/src/buffer_mng.h @@ -0,0 +1,175 @@ +/*----------------------------------------------------------------------------*/ +/* File: buffer_mng.h */ +/*----------------------------------------------------------------------------*/ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#ifndef _BUFFER_MNG_H_ +#define _BUFFER_MNG_H_ + +/*----------------------------------------------------------------------------*/ +/* Global Include */ +/*----------------------------------------------------------------------------*/ + +#include +#include "libmapping_mng.h" + +/*----------------------------------------------------------------------------*/ +/* Local Includes */ +/*----------------------------------------------------------------------------*/ + +#ifdef _BUFFER_MNG_C_ + +# include "fmt_hdl_fixed.h" +# include "fmt_hdl_xml.h" + +# ifdef TUX_SUPPORT +# include "fmt_hdl_fml.h" +# endif /* TUX_SUPPORT */ + +# include "cnv_hdl_pad_right.h" +# include "cnv_hdl_pad_left.h" +# include "cnv_hdl_strip_right.h" +# include "cnv_hdl_strip_left.h" +# include "cnv_hdl_cut_right.h" +# include "cnv_hdl_strip_num.h" + +#endif + +/*----------------------------------------------------------------------------*/ +/* Local definition */ +/*----------------------------------------------------------------------------*/ + +#ifdef _BUFFER_MNG_C_ + + + typedef IMRT_Status (IMRT_MM_Fmt_Hdl_Init)( void ); + typedef IMRT_Status (IMRT_MM_Fmt_Hdl_DeInit)( void ); + typedef IMRT_Status (IMRT_MM_Fmt_Hdl_Data_Free)( IMRT_Buffer * ); + typedef IMRT_Status (IMRT_MM_Fmt_Hdl_Ident)( IMRT_Msg_Id *, IMRT_Buffer * ); + typedef IMRT_Status (IMRT_MM_Fmt_Hdl_Open)( IMRT_Buffer * ); + typedef IMRT_Status (IMRT_MM_Fmt_Hdl_Close)( IMRT_Buffer * ); + typedef IMRT_Status (IMRT_MM_Fmt_Hdl_Data_List)( IMRT_Buffer * ); + typedef IMRT_Status (IMRT_MM_Fmt_Hdl_Copy)( IMRT_Buffer * , IMRT_Buffer * ); + typedef IMRT_Status (IMRT_MM_Fmt_Hdl_Flush)( IMRT_Buffer * ); + typedef IMRT_Status (IMRT_MM_Fmt_Hdl_Get)( IMRT_Buffer_Data ** , IMRT_Field * , IMRT_Buffer * , size_t * ); + typedef IMRT_Status (IMRT_MM_Fmt_Hdl_Cnv)( IMRT_Buffer_Data ** , IMRT_Buffer_Data * , IMRT_Field * , size_t *, IMRT_StrHdl_Cnv_Func * ); + typedef IMRT_Status (IMRT_MM_Fmt_Hdl_Put)( IMRT_Buffer_Data * , IMRT_Field * , IMRT_Buffer * , size_t ); + + typedef struct IMRT_StrHdl_Fmt_Func + + { IMRT_Fmt_Name Nom; + IMRT_MM_Fmt_Hdl_Init *Init_Ptr; + IMRT_MM_Fmt_Hdl_DeInit *DeInit_Ptr; + IMRT_MM_Fmt_Hdl_Data_Free *Data_Free_Ptr; + IMRT_MM_Fmt_Hdl_Ident *Ident_Ptr; + IMRT_MM_Fmt_Hdl_Open *Open_Ptr; + IMRT_MM_Fmt_Hdl_Close *Close_Ptr; + IMRT_MM_Fmt_Hdl_Data_List *Data_List_Ptr; + IMRT_MM_Fmt_Hdl_Copy *Copy_Ptr; + IMRT_MM_Fmt_Hdl_Flush *Flush_Ptr; + IMRT_MM_Fmt_Hdl_Get *Get_Ptr; + IMRT_MM_Fmt_Hdl_Cnv *Cnv_Ptr; + IMRT_MM_Fmt_Hdl_Put *Put_Ptr; + + } IMRT_StrHdl_Fmt_Func; + + + + +#endif + +/*----------------------------------------------------------------------------*/ +/* Global Variables */ +/*----------------------------------------------------------------------------*/ + +#ifdef _BUFFER_MNG_C_ + + void *handle; + IMRT_Buffer *IMRG_Input_Buffer_Ptr; + IMRT_Buffer *IMRG_Output_Buffer_Ptr; + + + IMRT_StrHdl_Fmt_Func *IMRG_MM_StrHdl_Fmt_Func_Tab; + IMRT_Fmt_Id IMRG_Taille_Fmt_Max; + + IMRT_Cnv_Id IMRG_Taille_Cnv_Max; + + +#endif + + + +/*----------------------------------------------------------------------------*/ +/* Prototypes */ +/*----------------------------------------------------------------------------*/ + +#ifdef _BUFFER_MNG_C_ + + IMRT_Status MM_Buffer_Init ( void ); + IMRT_Status MM_Buffer_DeInit ( void ); + IMRT_Status IMR_MM_Fmt_Add ( IMRT_Fmt_Id , IMRT_Fmt_Name , IMRT_Fmt_Id ); + IMRT_Status IMR_MM_Cnv_Add ( IMRT_Cnv_Id , IMRT_Cnv_Name , IMRT_Cnv_Id ); + IMRT_Status MM_Buffer_List ( IMRT_Buffer * , char * ); + IMRT_Status MM_Buffer_Alloc ( IMRT_Buffer ** ); + IMRT_Status MM_Buffer_Free ( IMRT_Buffer ** ); + IMRT_Status MM_Buffer_Clear ( IMRT_Buffer * ); + IMRT_Status MM_Buffer_Ident ( IMRT_Msg_Id , IMRT_Buffer *); + IMRT_Status MM_Buffer_Open ( IMRT_Buffer * ); + IMRT_Status MM_Buffer_Close ( IMRT_Buffer * ); + IMRT_Status MM_Buffer_Copy ( IMRT_Buffer * , IMRT_Buffer * ); + IMRT_Status MM_Buffer_Map ( IMRT_Buffer * , IMRT_Buffer * , IMRT_MsgMap * ); + IMRT_Status MM_Buffer_Ident_Update ( IMRT_Buffer * , IMRT_Fmt_Id , IMRT_FmtAttr_Value , IMRT_Msg_Id ); + IMRT_Status Buffer_Application_Check( IMRT_Appl_Id ); + IMRT_Status Buffer_Direction_Check ( IMRT_Dir_Id ); + IMRT_Status Buffer_Format_Check ( IMRT_Fmt_Id ); + IMRT_Status Buffer_Statut_Check ( IMRT_Buffer_Status ); + IMRT_Status Buffer_Etat_Check ( IMRT_Buffer_Flag ); + IMRT_Status MM_Buffer_Check ( IMRT_Buffer * ); + IMRT_Status Buffer_Data_Free ( IMRT_Buffer * ); + IMRT_Status IMR_MM_Buffer_FieldMap ( IMRT_Field * , IMRT_Field * ); + +#else + + extern IMRT_Status MM_Buffer_Init ( void ); + extern IMRT_Status MM_Buffer_DeInit ( void ); + extern IMRT_Status MM_Buffer_List ( IMRT_Buffer * , char * ); + extern IMRT_Status MM_Buffer_Alloc ( IMRT_Buffer ** ); + extern IMRT_Status MM_Buffer_Free ( IMRT_Buffer ** ); + extern IMRT_Status MM_Buffer_Clear ( IMRT_Buffer * ); + extern IMRT_Status MM_Buffer_Ident ( IMRT_Msg_Id , IMRT_Buffer *); + extern IMRT_Status MM_Buffer_Open ( IMRT_Buffer * ); + extern IMRT_Status MM_Buffer_Close ( IMRT_Buffer * ); + extern IMRT_Status MM_Buffer_Check ( IMRT_Buffer * ); + extern IMRT_Status MM_Buffer_Copy ( IMRT_Buffer * , IMRT_Buffer * ); + extern IMRT_Status MM_Buffer_Map ( IMRT_Buffer * , IMRT_Buffer * , IMRT_MsgMap * ); + extern IMRT_Status MM_Buffer_Ident_Update ( IMRT_Buffer * , IMRT_Fmt_Id , IMRT_FmtAttr_Value , IMRT_Msg_Id ); + +#endif + + +/*----------------------------------------------------------------------------*/ + +#endif diff --git a/src/libmapping_mng/src/cnv_hdl_cut_right.c b/src/libmapping_mng/src/cnv_hdl_cut_right.c new file mode 100644 index 0000000..5dd9161 --- /dev/null +++ b/src/libmapping_mng/src/cnv_hdl_cut_right.c @@ -0,0 +1,113 @@ +/*----------------------------------------------------------------------------*/ +/* File: cnv_hdl_cut_right.c */ +/*----------------------------------------------------------------------------*/ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#define _LIBMAPPING_MNG_ +#define _CNV_HANDLER_CUT_RIGHT_C_ + +#include "cnv_hdl_cut_right.h" + +IMRT_Status MM_Cut_Right_Init() +{ + return (IMRS_OK); +} + +IMRT_Status MM_Cut_Right_DeInit() +{ + + return (IMRS_OK); +} + +IMRT_Status MM_Cut_Right_Convert(IMRT_Buffer_Data *Data_Out_Ptr , IMRT_Buffer_Data *Data_In_Ptr , size_t * Len_Ptr , size_t size , IMRT_Cnv_Attr Cnv_Attr ) +{ + IMRT_Status status; + int nb_char_to_rm; + int cpt; + /*char attr;*/ + size_t len_tmp; + IMRT_Buffer_Data *data_tmp_ptr; + char *func_name = "MM_Cut_Right_Convert"; + + + status = IMRS_OK; + cpt = 0; + + if (Len_Ptr == NULL) + { + IMRD_LM_LOG_ERROR_0("Len pointer NULL" ); + status = IMRS_KO; + } + else if (Data_In_Ptr == NULL) + { + IMRD_LM_LOG_ERROR_0("Input pointer NULL" ); + status = IMRS_KO; + } + else + if (Data_Out_Ptr == NULL) + { + IMRD_LM_LOG_ERROR_0("Output pointer NULL" ); + status = IMRS_KO; + } + else + { + len_tmp = *Len_Ptr ; + nb_char_to_rm = atoi(Cnv_Attr); + if (len_tmp > size) + { + IMRD_LM_LOG_ERROR_0("Field Len > size" ); + status = IMRS_KO; + } + else + if ((size_t)nb_char_to_rm > len_tmp) + { + IMRD_LM_LOG_ERROR_2("Nb of char : (%d) > len (%ld)" , nb_char_to_rm , len_tmp); + status = IMRS_KO; + } + else + if (nb_char_to_rm <= 0) + { + IMRD_LM_LOG_TRACE_1(IMRD_LOG_LEVEL_VERBOSE_1 , "Nb of char : (%d) Nothing to delete" , nb_char_to_rm); + status = IMRD_STATUS_NOTHING_TO_DO; + } + } + + if (status == IMRS_OK) + { + + memcpy(Data_Out_Ptr , Data_In_Ptr , (len_tmp - nb_char_to_rm)); + + Data_Out_Ptr[(len_tmp - nb_char_to_rm)] = '\0'; + + *Len_Ptr = (len_tmp - nb_char_to_rm) ; + } + + if (status == IMRD_STATUS_NOTHING_TO_DO) + status = IMRS_OK; + + return (status); +} + diff --git a/src/libmapping_mng/src/cnv_hdl_cut_right.h b/src/libmapping_mng/src/cnv_hdl_cut_right.h new file mode 100644 index 0000000..5539402 --- /dev/null +++ b/src/libmapping_mng/src/cnv_hdl_cut_right.h @@ -0,0 +1,59 @@ +/*----------------------------------------------------------------------------*/ +/* File: cnv_hdl_cut_right.h */ +/*----------------------------------------------------------------------------*/ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#ifndef _CNV_HANDLER_CUT_RIGHT_H_ +#define _CNV_HANDLER_CUT_RIGHT_H_ + +/*----------------------------------------------------------------------------*/ +/* Global Include */ +/*----------------------------------------------------------------------------*/ + +#include "libmapping_mng.h" + +/*----------------------------------------------------------------------------*/ +/* Prototypes */ +/*----------------------------------------------------------------------------*/ + +#ifdef _CNV_HANDLER_CUT_RIGHT_C_ + + IMRT_Status MM_Cut_Right_Init ( void ); + IMRT_Status MM_Cut_Right_DeInit ( void ); + IMRT_Status MM_Cut_Right_Convert( IMRT_Buffer_Data * , IMRT_Buffer_Data * , size_t * , size_t , IMRT_Cnv_Attr ); + +#else + extern IMRT_Status MM_Cut_Right_Init ( void ); + extern IMRT_Status MM_Cut_Right_DeInit ( void ); + extern IMRT_Status MM_Cut_Right_Convert( IMRT_Buffer_Data * , IMRT_Buffer_Data * , size_t * , size_t , IMRT_Cnv_Attr ); + +#endif + +/*----------------------------------------------------------------------------*/ + +#endif + + diff --git a/src/libmapping_mng/src/cnv_hdl_pad_left.c b/src/libmapping_mng/src/cnv_hdl_pad_left.c new file mode 100644 index 0000000..3e10458 --- /dev/null +++ b/src/libmapping_mng/src/cnv_hdl_pad_left.c @@ -0,0 +1,111 @@ +/*----------------------------------------------------------------------------*/ +/* File: cnv_hdl_pad_left.c */ +/*----------------------------------------------------------------------------*/ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#define _LIBMAPPING_MNG_ +#define _CNV_HANDLER_PAD_LEFT_C_ + +#include "cnv_hdl_pad_left.h" + +IMRT_Status MM_Pad_Left_Init() +{ + return (IMRS_OK); +} + +IMRT_Status MM_Pad_Left_DeInit() +{ + + return (IMRS_OK); +} + +IMRT_Status MM_Pad_Left_Convert(IMRT_Buffer_Data *Data_Out_Ptr , IMRT_Buffer_Data *Data_In_Ptr , size_t * Len_Ptr , size_t size , IMRT_Cnv_Attr Cnv_Attr ) +{ + IMRT_Status status; + char attr; + size_t compteur; + size_t len_tmp; + size_t offset; + IMRT_Buffer_Data *data_tmp_ptr; + char *func_name = "MM_Pad_Left_Convert"; + + + + status = IMRS_OK; + compteur = 0L; + offset = 0L; + attr = '0'; + + len_tmp = *Len_Ptr ; + + if (Len_Ptr == NULL) + { + IMRD_LM_LOG_ERROR_0("Len pointer NULL" ); + status = IMRS_KO; + } + else + if (Data_In_Ptr == NULL) + { + IMRD_LM_LOG_ERROR_0("Input pointer NULL" ); + status = IMRS_KO; + } + else + if (Data_Out_Ptr == NULL) + { + IMRD_LM_LOG_ERROR_0("Output pointer NULL" ); + status = IMRS_KO; + } + else + { + len_tmp = *Len_Ptr ; + if (len_tmp > size) + { + IMRD_LM_LOG_ERROR_0("Field Len > size" ); + status = IMRS_KO; + } + else + { + offset = size - len_tmp; + + attr = Cnv_Attr[0]; + + memcpy(Data_Out_Ptr + offset , Data_In_Ptr , len_tmp); + data_tmp_ptr = Data_Out_Ptr; + + for (compteur = 0L ; compteur < offset ; compteur++) + { + data_tmp_ptr[compteur] = attr; + } + + data_tmp_ptr[size] = '\0'; + *Len_Ptr = size ; + } + } + + + return (status); +} + diff --git a/src/libmapping_mng/src/cnv_hdl_pad_left.h b/src/libmapping_mng/src/cnv_hdl_pad_left.h new file mode 100644 index 0000000..3077683 --- /dev/null +++ b/src/libmapping_mng/src/cnv_hdl_pad_left.h @@ -0,0 +1,59 @@ +/*----------------------------------------------------------------------------*/ +/* File: cnv_hdl_pad_left.h */ +/*----------------------------------------------------------------------------*/ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#ifndef _CNV_HANDLER_PAD_LEFT_H_ +#define _CNV_HANDLER_PAD_LEFT_H_ + +/*----------------------------------------------------------------------------*/ +/* Global Include */ +/*----------------------------------------------------------------------------*/ + +#include "libmapping_mng.h" + +/*----------------------------------------------------------------------------*/ +/* Prototypes */ +/*----------------------------------------------------------------------------*/ + +#ifdef _CNV_HANDLER_PAD_LEFT_C_ + + IMRT_Status MM_Pad_Left_Init ( void ); + IMRT_Status MM_Pad_Left_DeInit ( void ); + IMRT_Status MM_Pad_Left_Convert( IMRT_Buffer_Data * ,IMRT_Buffer_Data * , size_t * , size_t , IMRT_Cnv_Attr ); + +#else + extern IMRT_Status MM_Pad_Left_Init ( void ); + extern IMRT_Status MM_Pad_Left_DeInit ( void ); + extern IMRT_Status MM_Pad_Left_Convert( IMRT_Buffer_Data * ,IMRT_Buffer_Data * , size_t * , size_t , IMRT_Cnv_Attr ); + +#endif + +/*----------------------------------------------------------------------------*/ + +#endif + + diff --git a/src/libmapping_mng/src/cnv_hdl_pad_num.c b/src/libmapping_mng/src/cnv_hdl_pad_num.c new file mode 100644 index 0000000..6c49359 --- /dev/null +++ b/src/libmapping_mng/src/cnv_hdl_pad_num.c @@ -0,0 +1,81 @@ +/*----------------------------------------------------------------------------*/ +/* File: cnv_hdl_pad_left.c */ +/*----------------------------------------------------------------------------*/ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#define _LIBMAPPING_MNG_ +#define _CNV_HANDLER_PAD_NUM_C_ + +#include "cnv_hdl_pad_num.h" + + + +IMRT_Status MM_Pad_Num_Init() +{ + return (IMRS_OK); +} + +IMRT_Status MM_Pad_Num_DeInit() +{ + + return (IMRS_OK); +} + +IMRT_Status MM_Pad_Num_Convert(IMRT_Buffer_Data *Data_Out_Ptr , IMRT_Buffer_Data *Data_In_Ptr , size_t * Len_Ptr , size_t size , IMRT_Cnv_Attr Cnv_Attr ) +{ + IMRT_Status status; + char attr_space[2] ; + char attr_zero[2] ; + IMRT_Buffer_Data *Tmp_Ptr; + char *func_name = "MM_Pad_Num_Convert"; + + + status = IMRS_OK; + strcpy(attr_space , " "); + strcpy(attr_zero , "0"); + + Tmp_Ptr = (IMRT_Buffer_Data *)malloc(size + 1L); + if (Tmp_Ptr == NULL) + { + IMRD_LM_LOG_ERROR_0("Memory allocation failed"); + status = IMRS_KO; + } + else + { + memset(Tmp_Ptr, '\0', (size + 1L)); + + status = MM_Strip_Num_Convert(Tmp_Ptr , Data_In_Ptr , Len_Ptr , size , attr_zero ); + + if (status == IMRS_OK) + status = MM_Pad_Left_Convert(Data_Out_Ptr , Tmp_Ptr , Len_Ptr , size , attr_zero ); + } + if (Tmp_Ptr != NULL) + free(Tmp_Ptr); + + return (status); + +} + diff --git a/src/libmapping_mng/src/cnv_hdl_pad_num.h b/src/libmapping_mng/src/cnv_hdl_pad_num.h new file mode 100644 index 0000000..4e71b9f --- /dev/null +++ b/src/libmapping_mng/src/cnv_hdl_pad_num.h @@ -0,0 +1,59 @@ +/*----------------------------------------------------------------------------*/ +/* File: cnv_hdl_pad_left.h */ +/*----------------------------------------------------------------------------*/ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#ifndef _CNV_HANDLER_PAD_NUM_H_ +#define _CNV_HANDLER_PAD_NUM_H_ + +/*----------------------------------------------------------------------------*/ +/* Global Include */ +/*----------------------------------------------------------------------------*/ + +#include "libmapping_mng.h" + +/*----------------------------------------------------------------------------*/ +/* Prototypes */ +/*----------------------------------------------------------------------------*/ + +#ifdef _CNV_HANDLER_PAD_LEFT_C_ + + IMRT_Status MM_Pad_Num_Init ( void ); + IMRT_Status MM_Pad_Num_DeInit ( void ); + IMRT_Status MM_Pad_Num_Convert( IMRT_Buffer_Data * ,IMRT_Buffer_Data * , size_t * , size_t , IMRT_Cnv_Attr ); + +#else + extern IMRT_Status MM_Pad_Num_Init ( void ); + extern IMRT_Status MM_Pad_Num_DeInit ( void ); + extern IMRT_Status MM_Pad_Num_Convert( IMRT_Buffer_Data * ,IMRT_Buffer_Data * , size_t * , size_t , IMRT_Cnv_Attr ); + +#endif + +/*----------------------------------------------------------------------------*/ + +#endif + + diff --git a/src/libmapping_mng/src/cnv_hdl_pad_right.c b/src/libmapping_mng/src/cnv_hdl_pad_right.c new file mode 100644 index 0000000..6774a07 --- /dev/null +++ b/src/libmapping_mng/src/cnv_hdl_pad_right.c @@ -0,0 +1,100 @@ +/*----------------------------------------------------------------------------*/ +/* File: cnv_hdl_pad_right.c */ +/*----------------------------------------------------------------------------*/ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#define _LIBMAPPING_MNG_ +#define _CNV_HANDLER_PAD_RIGHT_C_ + +#include "cnv_hdl_pad_right.h" + +IMRT_Status MM_Pad_Right_Init() +{ + return (IMRS_OK); +} + +IMRT_Status MM_Pad_Right_DeInit() +{ + + return (IMRS_OK); +} + + +IMRT_Status MM_Pad_Right_Convert(IMRT_Buffer_Data *Data_Out_Ptr , IMRT_Buffer_Data *Data_In_Ptr , size_t * Len_Ptr , size_t size , IMRT_Cnv_Attr Cnv_Attr ) +{ + IMRT_Status status; + char attr; + size_t compteur; + size_t len_tmp; + IMRT_Buffer_Data *data_tmp_ptr; + char *func_name = "MM_Pad_Right_Convert"; + + + status = IMRS_OK; + compteur = 0L; + attr = '0'; + + len_tmp = *Len_Ptr ; + + if (len_tmp > size) + { + IMRD_LM_LOG_ERROR_0("Field Len > size" ); + status = IMRS_KO; + } + else + { + if (Data_In_Ptr == NULL) + { + IMRD_LM_LOG_ERROR_0("Input pointer NULL" ); + status = IMRS_KO; + } + else + if (Data_Out_Ptr == NULL) + { + IMRD_LM_LOG_ERROR_0("Output pointer NULL" ); + status = IMRS_KO; + } + else + { + attr = Cnv_Attr[0]; + + memcpy(Data_Out_Ptr , Data_In_Ptr , len_tmp); + data_tmp_ptr = Data_Out_Ptr + len_tmp ; + + for (compteur = 0L ; compteur < (size - len_tmp) ; compteur++) + { + data_tmp_ptr[compteur] = attr; + } + + data_tmp_ptr[compteur] = '\0'; + *Len_Ptr = size ; + } + } + + + return (status); +} + diff --git a/src/libmapping_mng/src/cnv_hdl_pad_right.h b/src/libmapping_mng/src/cnv_hdl_pad_right.h new file mode 100644 index 0000000..ea54a7f --- /dev/null +++ b/src/libmapping_mng/src/cnv_hdl_pad_right.h @@ -0,0 +1,59 @@ +/*----------------------------------------------------------------------------*/ +/* File: cnv_hdl_pad_right.h */ +/*----------------------------------------------------------------------------*/ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#ifndef _CNV_HANDLER_PAD_RIGHT_H_ +#define _CNV_HANDLER_PAD_RIGHT_H_ + +/*----------------------------------------------------------------------------*/ +/* Global Include */ +/*----------------------------------------------------------------------------*/ + +#include "libmapping_mng.h" + +/*----------------------------------------------------------------------------*/ +/* Prototypes */ +/*----------------------------------------------------------------------------*/ + +#ifdef _CNV_HANDLER_PAD_RIGHT_C_ + + IMRT_Status MM_Pad_Right_Init ( void ); + IMRT_Status MM_Pad_Right_DeInit ( void ); + IMRT_Status MM_Pad_Right_Convert( IMRT_Buffer_Data * ,IMRT_Buffer_Data * , size_t * , size_t , IMRT_Cnv_Attr ); + +#else + extern IMRT_Status MM_Pad_Right_Init ( void ); + extern IMRT_Status MM_Pad_Right_DeInit ( void ); + extern IMRT_Status MM_Pad_Right_Convert( IMRT_Buffer_Data * ,IMRT_Buffer_Data * , size_t * , size_t , IMRT_Cnv_Attr ); + +#endif + +/*----------------------------------------------------------------------------*/ + +#endif + + diff --git a/src/libmapping_mng/src/cnv_hdl_strip_left.c b/src/libmapping_mng/src/cnv_hdl_strip_left.c new file mode 100644 index 0000000..c9b295f --- /dev/null +++ b/src/libmapping_mng/src/cnv_hdl_strip_left.c @@ -0,0 +1,128 @@ +/*----------------------------------------------------------------------------*/ +/* File: cnv_hdl_strip_left.c */ +/*----------------------------------------------------------------------------*/ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#define _LIBMAPPING_MNG_ +#define _CNV_HANDLER_STRIP_LEFT_C_ + +#include "cnv_hdl_strip_left.h" + +IMRT_Status MM_Strip_Left_Init() +{ + return (IMRS_OK); +} + +IMRT_Status MM_Strip_Left_DeInit() +{ + + return (IMRS_OK); +} + +IMRT_Status MM_Strip_Left_Convert(IMRT_Buffer_Data *Data_Out_Ptr , IMRT_Buffer_Data *Data_In_Ptr , size_t * Len_Ptr , size_t size , IMRT_Cnv_Attr Cnv_Attr ) +{ + IMRT_Status status; + char attr; + size_t compteur; + size_t len_tmp; + IMRT_Buffer_Data *data_tmp_ptr; + IMRT_Buffer_Data *data_tmp_idx_ptr; + char *func_name = "MM_Strip_Left_Convert"; + + + status = IMRS_OK; + + + if (Len_Ptr == NULL) + { + IMRD_LM_LOG_ERROR_0("Len pointer NULL" ); + status = IMRS_KO; + } + else + if (Data_In_Ptr == NULL) + { + IMRD_LM_LOG_ERROR_0("Input pointer NULL" ); + status = IMRS_KO; + } + else + if (Data_Out_Ptr == NULL) + { + IMRD_LM_LOG_ERROR_0("Output pointer NULL" ); + status = IMRS_KO; + } + else + { + len_tmp = *Len_Ptr ; + if (len_tmp > size) + { + IMRD_LM_LOG_ERROR_0("Field Len > size" ); + status = IMRS_KO; + } + else + { + attr = Cnv_Attr[0]; + + data_tmp_ptr = (IMRT_Buffer_Data *)malloc(size + 1L); + if(data_tmp_ptr == NULL) + { + /*erreur allocation */ + IMRD_LM_LOG_ERROR_0("Memory allocation failed"); + status = IMRS_KO; + } + else + { + memset( data_tmp_ptr, '\0' , (size + 1L) ); + data_tmp_idx_ptr = data_tmp_ptr; + memcpy(data_tmp_ptr , Data_In_Ptr , len_tmp) ; + data_tmp_ptr[len_tmp] = '\0'; + memset( Data_Out_Ptr, '\0' , (size + 1L) ); + + compteur = 0L; + + while ((data_tmp_idx_ptr[0L] == attr) && (compteur < *Len_Ptr)) + { + data_tmp_idx_ptr++; + len_tmp--; + compteur++; + } + + data_tmp_idx_ptr[len_tmp] = '\0'; + + memcpy(Data_Out_Ptr , data_tmp_idx_ptr , len_tmp + 1L); + + *Len_Ptr = len_tmp ; + + free(data_tmp_ptr); + } + } + + } + + + return (status); + +} + diff --git a/src/libmapping_mng/src/cnv_hdl_strip_left.h b/src/libmapping_mng/src/cnv_hdl_strip_left.h new file mode 100644 index 0000000..a40b107 --- /dev/null +++ b/src/libmapping_mng/src/cnv_hdl_strip_left.h @@ -0,0 +1,59 @@ +/*----------------------------------------------------------------------------*/ +/* File: cnv_hdl_strip_left.h */ +/*----------------------------------------------------------------------------*/ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#ifndef _CNV_HANDLER_STRIP_LEFT_H_ +#define _CNV_HANDLER_STRIP_LEFT_H_ + +/*----------------------------------------------------------------------------*/ +/* Global Include */ +/*----------------------------------------------------------------------------*/ + +#include "libmapping_mng.h" + +/*----------------------------------------------------------------------------*/ +/* Prototypes */ +/*----------------------------------------------------------------------------*/ + +#ifdef _CNV_HANDLER_STRIP_LEFT_C_ + + IMRT_Status MM_Strip_Left_Init ( void ); + IMRT_Status MM_Strip_Left_DeInit ( void ); + IMRT_Status MM_Strip_Left_Convert( IMRT_Buffer_Data * , IMRT_Buffer_Data * , size_t * , size_t , IMRT_Cnv_Attr ); + +#else + extern IMRT_Status MM_Strip_Left_Init ( void ); + extern IMRT_Status MM_Strip_Left_DeInit ( void ); + extern IMRT_Status MM_Strip_Left_Convert( IMRT_Buffer_Data * , IMRT_Buffer_Data * , size_t * , size_t , IMRT_Cnv_Attr ); + +#endif + +/*----------------------------------------------------------------------------*/ + +#endif + + diff --git a/src/libmapping_mng/src/cnv_hdl_strip_num.c b/src/libmapping_mng/src/cnv_hdl_strip_num.c new file mode 100644 index 0000000..c89bc8f --- /dev/null +++ b/src/libmapping_mng/src/cnv_hdl_strip_num.c @@ -0,0 +1,80 @@ +/*----------------------------------------------------------------------------*/ +/* File: cnv_hdl_strip_num.c */ +/*----------------------------------------------------------------------------*/ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#define _LIBMAPPING_MNG_ +#define _CNV_HANDLER_STRIP_NUM_C_ + +#include "cnv_hdl_strip_num.h" + +IMRT_Status MM_Strip_Num_Init() +{ + return (IMRS_OK); +} + +IMRT_Status MM_Strip_Num_DeInit() +{ + + return (IMRS_OK); +} + +IMRT_Status MM_Strip_Num_Convert(IMRT_Buffer_Data *Data_Out_Ptr , IMRT_Buffer_Data *Data_In_Ptr , size_t * Len_Ptr , size_t size , IMRT_Cnv_Attr Cnv_Attr ) +{ + IMRT_Status status; + char attr_space[2] ; + char attr_zero[2] ; + IMRT_Buffer_Data *Data_Tmp_Ptr; + char *func_name = "MM_Strip_Num_Convert"; + + + status = IMRS_OK; + strcpy(attr_space , " "); + strcpy(attr_zero , "0"); + + Data_Tmp_Ptr = (IMRT_Buffer_Data *)malloc(size + 1L); + if (Data_Tmp_Ptr == NULL) + { + IMRD_LM_LOG_ERROR_0("Memory allocation failed"); + status = IMRS_KO; + } + else + { + memset(Data_Tmp_Ptr, '\0', (size + 1L)); + + status = MM_Strip_Left_Convert(Data_Tmp_Ptr , Data_In_Ptr , Len_Ptr , size , attr_space ); + + if (status == IMRS_OK) + status = MM_Strip_Left_Convert(Data_Out_Ptr , Data_Tmp_Ptr , Len_Ptr , size , attr_zero ); + } + + if(Data_Tmp_Ptr != NULL) + free(Data_Tmp_Ptr); + + return (status); + +} + diff --git a/src/libmapping_mng/src/cnv_hdl_strip_num.h b/src/libmapping_mng/src/cnv_hdl_strip_num.h new file mode 100644 index 0000000..282cb20 --- /dev/null +++ b/src/libmapping_mng/src/cnv_hdl_strip_num.h @@ -0,0 +1,59 @@ +/*----------------------------------------------------------------------------*/ +/* File: cnv_hdl_strip_num.h */ +/*----------------------------------------------------------------------------*/ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#ifndef _CNV_HANDLER_STRIP_NUM_H_ +#define _CNV_HANDLER_STRIP_NUM_H_ + +/*----------------------------------------------------------------------------*/ +/* Global Include */ +/*----------------------------------------------------------------------------*/ + +#include "libmapping_mng.h" + +/*----------------------------------------------------------------------------*/ +/* Prototypes */ +/*----------------------------------------------------------------------------*/ + +#ifdef _CNV_HANDLER_STRIP_NUM_C_ + + IMRT_Status MM_Strip_Num_Init ( void ); + IMRT_Status MM_Strip_Num_DeInit ( void ); + IMRT_Status MM_Strip_Num_Convert( IMRT_Buffer_Data * , IMRT_Buffer_Data * , size_t * , size_t , IMRT_Cnv_Attr ); + +#else + extern IMRT_Status MM_Strip_Num_Init ( void ); + extern IMRT_Status MM_Strip_Num_DeInit ( void ); + extern IMRT_Status MM_Strip_Num_Convert( IMRT_Buffer_Data * , IMRT_Buffer_Data * , size_t * , size_t , IMRT_Cnv_Attr ); + +#endif + +/*----------------------------------------------------------------------------*/ + +#endif + + diff --git a/src/libmapping_mng/src/cnv_hdl_strip_right.c b/src/libmapping_mng/src/cnv_hdl_strip_right.c new file mode 100644 index 0000000..a314387 --- /dev/null +++ b/src/libmapping_mng/src/cnv_hdl_strip_right.c @@ -0,0 +1,105 @@ +/*----------------------------------------------------------------------------*/ +/* File: cnv_hdl_strip_right.c */ +/*----------------------------------------------------------------------------*/ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#define _LIBMAPPING_MNG_ +#define _CNV_HANDLER_STRIP_RIGHT_C_ + +#include "cnv_hdl_strip_right.h" + +IMRT_Status MM_Strip_Right_Init() +{ + return (IMRS_OK); +} + +IMRT_Status MM_Strip_Right_DeInit() +{ + + return (IMRS_OK); +} + +IMRT_Status MM_Strip_Right_Convert(IMRT_Buffer_Data *Data_Out_Ptr , IMRT_Buffer_Data *Data_In_Ptr , size_t * Len_Ptr , size_t size , IMRT_Cnv_Attr Cnv_Attr ) +{ + IMRT_Status status; + char attr; + size_t len_tmp; + IMRT_Buffer_Data *data_tmp_ptr; + char *func_name = "MM_Strip_Right_Convert"; + + + status = IMRS_OK; + + + if (Len_Ptr == NULL) + { + IMRD_LM_LOG_ERROR_0("Len pointer NULL" ); + status = IMRS_KO; + } + else + if (Data_In_Ptr == NULL) + { + IMRD_LM_LOG_ERROR_0("Input pointer NULL" ); + status = IMRS_KO; + } + else + if (Data_Out_Ptr == NULL) + { + IMRD_LM_LOG_ERROR_0("Output pointer NULL" ); + status = IMRS_KO; + } + else + { + len_tmp = *Len_Ptr ; + if (len_tmp > size) + { + IMRD_LM_LOG_ERROR_0("Field Len > size" ); + status = IMRS_KO; + } + else + { + attr = Cnv_Attr[0]; + + data_tmp_ptr = Data_In_Ptr + len_tmp ; + + + while ((data_tmp_ptr > Data_In_Ptr) && (*(--data_tmp_ptr) == attr) ) + { + len_tmp--; + } + + if (Data_Out_Ptr != Data_In_Ptr) + memcpy(Data_Out_Ptr , Data_In_Ptr , len_tmp); + Data_Out_Ptr[len_tmp] = '\0'; + + *Len_Ptr = len_tmp ; + } + } + + + return (status); +} + diff --git a/src/libmapping_mng/src/cnv_hdl_strip_right.h b/src/libmapping_mng/src/cnv_hdl_strip_right.h new file mode 100644 index 0000000..acbd5f4 --- /dev/null +++ b/src/libmapping_mng/src/cnv_hdl_strip_right.h @@ -0,0 +1,59 @@ +/*----------------------------------------------------------------------------*/ +/* File: cnv_hdl_strip_right.h */ +/*----------------------------------------------------------------------------*/ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#ifndef _CNV_HANDLER_STRIP_RIGHT_H_ +#define _CNV_HANDLER_STRIP_RIGHT_H_ + +/*----------------------------------------------------------------------------*/ +/* Global Include */ +/*----------------------------------------------------------------------------*/ + +#include "libmapping_mng.h" + +/*----------------------------------------------------------------------------*/ +/* Prototypes */ +/*----------------------------------------------------------------------------*/ + +#ifdef _CNV_HANDLER_STRIP_RIGHT_C_ + + IMRT_Status MM_Strip_Right_Init ( void ); + IMRT_Status MM_Strip_Right_DeInit ( void ); + IMRT_Status MM_Strip_Right_Convert( IMRT_Buffer_Data * , IMRT_Buffer_Data * , size_t * , size_t , IMRT_Cnv_Attr ); + +#else + extern IMRT_Status MM_Strip_Right_Init ( void ); + extern IMRT_Status MM_Strip_Right_DeInit ( void ); + extern IMRT_Status MM_Strip_Right_Convert( IMRT_Buffer_Data * , IMRT_Buffer_Data * , size_t * , size_t , IMRT_Cnv_Attr ); + +#endif + +/*----------------------------------------------------------------------------*/ + +#endif + + diff --git a/src/libmapping_mng/src/field.tbls.h b/src/libmapping_mng/src/field.tbls.h new file mode 100644 index 0000000..c581e0d --- /dev/null +++ b/src/libmapping_mng/src/field.tbls.h @@ -0,0 +1,31 @@ +/*----------------------------------------------------------------------------*/ +/* File: field.tbls.h */ +/*----------------------------------------------------------------------------*/ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +/* fname fldid */ +/* ----- ----- */ +#define FML_MSG_TXT ((FLDID32)201327012) /* number: 420 type: carray */ diff --git a/src/libmapping_mng/src/fmt_hdl_dltd.c b/src/libmapping_mng/src/fmt_hdl_dltd.c new file mode 100644 index 0000000..a415295 --- /dev/null +++ b/src/libmapping_mng/src/fmt_hdl_dltd.c @@ -0,0 +1,1079 @@ +/*----------------------------------------------------------------------------*/ +/* File: fmt_hdl_dltd.c */ +/* Comptage des occurences : la premiere est numerotee 0 */ +/* La zone de donnees Data_Tmp_Ptr du buffer contient la prochaine occurence */ +/*----------------------------------------------------------------------------*/ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#define _LIBMAPPING_MNG_ +#define _DELIMITED_HANDLER_C_ + +#include "fmt_hdl_dltd.h" + +IMRT_Status MM_Delimited_StrHdl_Init() +{ + IMRG_Delimited_Buffer_Ident_Ptr = NULL; + return (IMRS_OK); +} + +IMRT_Status MM_Delimited_StrHdl_DeInit() +{ + return (IMRS_OK); +} + +IMRT_Status Delimited_Hdl_DataBuf_Alloc( IMRT_Buffer *Buffer_Ptr, size_t Taille_Alloc ) +{ + IMRT_Buffer_Data *data_Ptr; + IMRT_Status status; + IMRT_Delimited_TmpId * TmpId_Ptr; + char *func_name = "Delimited_Hdl_DataBuf_Alloc"; + + + status = IMRS_OK; + data_Ptr = NULL; + + if (Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer pointer NULL" ); + } + else + if (Buffer_Ptr->Status == IMRD_BUFFER_STATUS_ALLOCATED) + { + if (Taille_Alloc > Buffer_Ptr->Data_Buf_Size) + { + data_Ptr = (IMRT_Buffer_Data *) realloc ( (void *) Buffer_Ptr->Data_Buf_Ptr, Taille_Alloc ); + if (data_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Realloc error"); + } + else + { + memset( data_Ptr + Buffer_Ptr->Data_Buf_Size, '\0', Taille_Alloc - Buffer_Ptr->Data_Buf_Size ); + Buffer_Ptr->Data_Buf_Ptr = data_Ptr; + Buffer_Ptr->Data_Buf_Size = Taille_Alloc; + } + } + } + else + { + data_Ptr = (IMRT_Buffer_Data *) malloc ( Taille_Alloc ); + if (data_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Malloc error"); + } + else + { + memset( data_Ptr, '\0', Taille_Alloc ); + Buffer_Ptr->Data_Buf_Ptr = data_Ptr; + Buffer_Ptr->Status = IMRD_BUFFER_STATUS_ALLOCATED; + Buffer_Ptr->Data_Buf_Size = Taille_Alloc; + Buffer_Ptr->Data_Buf_Len = 0; + } + + if (status == IMRS_OK) + { + TmpId_Ptr = (IMRT_Delimited_TmpId *) malloc ( sizeof(IMRT_Delimited_TmpId)); + if (TmpId_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Malloc error"); + free(Buffer_Ptr->Data_Buf_Ptr); + Buffer_Ptr->Status = IMRD_BUFFER_STATUS_FREED; + Buffer_Ptr->Data_Buf_Size = 0; + } + else + { + /* Initialisation de la premiere occurence a 0 */ + memset( TmpId_Ptr, '\0', sizeof(IMRT_Delimited_TmpId) ); + TmpId_Ptr->TmpId = 0; + Buffer_Ptr->Data_Tmp_Ptr = (IMRT_Buffer_Data *)(TmpId_Ptr); + } + } + + } + + + return ( status ); +} + +IMRT_Status MM_Delimited_StrHdl_Data_Free( IMRT_Buffer *Buffer_Ptr) +{ + IMRT_Status status; + char *func_name = "MM_Delimited_StrHdl_Data_Free"; + + + status = IMRS_OK; + + if (Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer pointer NULL" ); + } + else + if (Buffer_Ptr->Status == IMRD_BUFFER_STATUS_ALLOCATED) + { + if(Buffer_Ptr->Data_Buf_Ptr != NULL) + { + free(Buffer_Ptr->Data_Buf_Ptr); + } + Buffer_Ptr->Data_Buf_Ptr = NULL; + Buffer_Ptr->Status = IMRD_BUFFER_STATUS_FREED; + Buffer_Ptr->Data_Buf_Size = 0; + Buffer_Ptr->Data_Buf_Len = 0; + if(Buffer_Ptr->Data_Tmp_Ptr != NULL) + free(Buffer_Ptr->Data_Tmp_Ptr); + Buffer_Ptr->Data_Tmp_Ptr = NULL; + Buffer_Ptr->Data_Tmp_Changed = IMRD_FALSE; + Buffer_Ptr->Data_Tmp_Ptr = NULL; + } + + return ( status ); +} + +IMRT_Status Delimited_Hdl_Format_Ident( IMRT_Buffer *Buffer_Ptr ) +{ + IMRT_Status status; + char *func_name = "Delimited_Hdl_Format_Ident"; + + + if (Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer pointer NULL" ); + } + else + if (Buffer_Ptr->Status == IMRD_BUFFER_STATUS_ALLOCATED) + { + status = IMRS_OK; + } + else + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer not allocated"); + } + + + return ( status ); +} + +IMRT_Status MM_Delimited_StrHdl_Ident( IMRT_Msg_Id *Msg_Id_Ident_Ptr, + IMRT_Buffer *Buffer_Ptr ) +{ + + IMRT_Fmt_Id Format; + IMRT_Status status; + IMRT_Msg_Id *Msg_Id_Tmp; + char *func_name = "MM_Delimited_StrHdl_Ident"; + + + if (Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer pointer NULL" ); + } + else + if (Msg_Id_Ident_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Msg_Id_Ident_Ptr NULL" ); + } + else + { + Format = Buffer_Ptr->Fmt_Id; + Msg_Id_Tmp = Msg_Id_Ident_Ptr; + status = IMRS_OK; + + IMRG_Delimited_Buffer_Ident_Ptr = Buffer_Ptr; + /* Le Msg_Id transmis au SDM est le point de depart de l'identification */ + /* C'est egalement le resultat qui sera inclus dans le buffer */ + status = IMR_SDM_MsgIdent_Proceed(Format, + Msg_Id_Tmp, + IMR_MM_Delimited_StrHdl_Field_Value, + IMR_MM_Delimited_StrHdl_Field_Exist, + IMR_MM_Delimited_StrHdl_Msg_Size); + IMRG_Delimited_Buffer_Ident_Ptr = NULL; + + Msg_Id_Ident_Ptr = Msg_Id_Tmp; + } + + return ( status ); + +} + +IMRT_Status Delimited_Hdl_TmpId_Init( IMRT_Buffer *Buffer_Ptr , short nb_occ) +{ + IMRT_Status status; + IMRT_Delimited_TmpId * TmpId_Ptr; + char *func_name = "Delimited_Hdl_TmpId_Init"; + + status = IMRS_OK; + TmpId_Ptr = NULL; + TmpId_Ptr = (IMRT_Delimited_TmpId *) malloc ( sizeof(IMRT_Delimited_TmpId)); + if (TmpId_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Malloc error"); + } + else + if (Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer pointer null"); + } + else + { + /* Initialisation de la premiere occurence a 0 */ + memset( TmpId_Ptr, '\0', sizeof(IMRT_Delimited_TmpId) ); + TmpId_Ptr->TmpId = nb_occ; + Buffer_Ptr->Data_Tmp_Ptr = (IMRT_Buffer_Data *)(TmpId_Ptr); + } + + + return status; +} + + + +IMRT_Status Delimited_Hdl_Occ_Count( IMRT_Buffer_Data *data_ptr , short *nb_occ , IMRT_FmtAttr_Value attr) +{ + IMRT_Status status; + IMRT_Buffer_Data *deb_data_ptr; + IMRT_Boolean loop_end; + short cpt; + char indicateur[2]; + char *delim_ptr; + IMRT_FmtAttr_Value delimiteur; + char *func_name = "Delimited_Hdl_Occ_Count"; + + status = IMRS_OK; + deb_data_ptr = NULL; + loop_end = IMRD_FALSE; + + + if (nb_occ == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Nb occ pointer null"); + } + else + if ((data_ptr == NULL) || (strcmp(attr , "")==0)) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Error : data pointer NULL or attribute is an empty string"); + } + + if ( status == IMRS_OK ) + { + strcpy(delimiteur , ""); + strncpy(indicateur , attr , 1); + indicateur[1] = '\0'; + delim_ptr = NULL; + delim_ptr = (attr); + delim_ptr++; + strcpy(delimiteur , delim_ptr); + + + /* Controle de validite de l'indicateur */ + if ((strcmp(indicateur , "S") != 0) && (strcmp(indicateur , "T") != 0)) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_1("Indicateur non correct [%s]",indicateur); + } + } + + + + if (status == IMRS_OK) + { + if (strcmp(data_ptr , "") == 0) + { + cpt = 0; + } + else + { + /* La premiŠre occurence est la 0 */ + cpt = 0; + /* positionnement au debut de la chaine */ + deb_data_ptr = data_ptr; + /* boucle de comptage des occurrences */ + while (!loop_end) + { + deb_data_ptr = (IMRT_Buffer_Data *)strstr((const char *)deb_data_ptr , (const char *)delimiteur); + IMRD_LM_LOG_TRACE_1( IMRD_LOG_LEVEL_VERBOSE_2, "attr [%s]" , delimiteur); + IMRD_LM_LOG_TRACE_1( IMRD_LOG_LEVEL_VERBOSE_2, "deb_data_ptr [%s]" , deb_data_ptr); + + if (deb_data_ptr != NULL) + { + cpt++; + deb_data_ptr++; + } + else + loop_end = IMRD_TRUE; + } + + } + /* si l'indicateur est S il faut rajouter une occurence */ + if ((cpt != 0)&&(strcmp(indicateur , "S") == 0)) + cpt++; + + *nb_occ = cpt; + } + + return status; +} + + +IMRT_Status MM_Delimited_StrHdl_Open( IMRT_Buffer *Buffer_Ptr) +{ + IMRT_Msg_Id type_temp; + IMRT_Status status; + IMRT_Delimited_TmpId *TmpId_Ptr; + IMRT_Boolean flag_init; + short nb_occ; + char *func_name = "MM_Delimited_StrHdl_Open"; + + + + status = IMRS_OK; + nb_occ = 0; + flag_init = IMRD_FALSE; + + if (Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer pointer NULL" ); + } + else + { + type_temp = Buffer_Ptr->Msg_Id; + if (Buffer_Ptr->Status != IMRD_BUFFER_STATUS_ALLOCATED) + { + + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_2, "Le buffer n'a pas le status allocated"); + /* Cas d'open du buffer en ecriture */ + /* le type du message est passe */ + /* par le SDM : il doit donc etre connu */ + if (type_temp == IMRD_MSG_ID_UNKNOWN) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Msg Id unknown"); + } + else + { + status = Delimited_Hdl_DataBuf_Alloc( Buffer_Ptr, DELIMITED_TAILLE_ALLOC ); + } + } + else /* le status est allocated */ + { + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_2, "Le buffer a le status allocated"); + + /* comptage du nombre d'occurences */ + status = Delimited_Hdl_Occ_Count( Buffer_Ptr->Data_Buf_Ptr , &nb_occ , Buffer_Ptr->FmtAttr_Value); + if (Buffer_Ptr->Data_Tmp_Ptr != NULL) + { + TmpId_Ptr = (IMRT_Delimited_TmpId *)Buffer_Ptr->Data_Tmp_Ptr; + if (TmpId_Ptr->TmpId != nb_occ) + { + flag_init = IMRD_TRUE; + free(Buffer_Ptr->Data_Tmp_Ptr); + } + } + else + { + flag_init = IMRD_TRUE; + } + + if ((status == IMRS_OK) && (flag_init == IMRD_TRUE)) + { + /* initialisation de Data_Tmp_Ptr avec le nombre d'occurence */ + status = Delimited_Hdl_TmpId_Init(Buffer_Ptr , nb_occ); + } + + + if (status == IMRS_OK) + { + /* controle du format (inutile actuellement) */ + status = Delimited_Hdl_Format_Ident( Buffer_Ptr ) ; + if (status != IMRS_OK) + { + status = IMRS_BAD_FORMAT; + } + } + } + } + + return ( status ); +} + + + +IMRT_Status MM_Delimited_StrHdl_Close( IMRT_Buffer *Buffer_Ptr) +{ + char *func_name = "MM_Delimited_StrHdl_Close"; + IMRT_Status status; + + status = IMRS_OK; + + if (Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer pointer NULL" ); + } + else + { + status = MM_Delimited_StrHdl_Flush( Buffer_Ptr ); + if ((status == IMRS_OK) && (Buffer_Ptr->Data_Tmp_Ptr != NULL)) + { + free(Buffer_Ptr->Data_Tmp_Ptr); + Buffer_Ptr->Data_Tmp_Ptr = NULL; + } + } + + return ( status ); +} + +IMRT_Status MM_Delimited_StrHdl_Flush( IMRT_Buffer *Buffer_Ptr) +{ + char *func_name = "MM_Delimited_StrHdl_Flush"; + + return (IMRS_OK); +} + + + +IMRT_Status MM_Delimited_StrHdl_Data_List( IMRT_Buffer *Buffer_Ptr) +{ + + if (Buffer_Ptr == NULL) + { + IMRD_LM_LOG_WARNING_0("Buffer pointer NULL" ); + } + else + { + IMRD_LM_LOG_TRACE_3( IMRD_LOG_LEVEL_VERBOSE_1, "Buffer_List: Data_Buf_Ptr_Size: (%d) Data_Buf_Ptr_Len: (%d) Data_Buf_Ptr: (0x%X)", Buffer_Ptr->Data_Buf_Size, Buffer_Ptr->Data_Buf_Len, Buffer_Ptr->Data_Buf_Ptr); + IMRD_LM_LOG_TRACE_1( IMRD_LOG_LEVEL_VERBOSE_2, "Buffer_List: Data_Buf: [%s]", Buffer_Ptr->Data_Buf_Ptr); + IMRD_LM_LOG_TRACE_2( IMRD_LOG_LEVEL_VERBOSE_1, "Buffer_List: Data_Tmp_Changed: (%d) Data_Tmp_Ptr: (0x%X)", Buffer_Ptr->Data_Tmp_Changed, Buffer_Ptr->Data_Tmp_Ptr); + if (Buffer_Ptr->Data_Tmp_Ptr != NULL) + IMRD_LM_LOG_TRACE_1( IMRD_LOG_LEVEL_VERBOSE_2, "Buffer_List: TmpId: (%d)", (short )( ( (IMRT_Delimited_TmpId *)(Buffer_Ptr->Data_Tmp_Ptr))->TmpId)); + } + + return (IMRS_OK); +} + + + +IMRT_Status MM_Delimited_StrHdl_Copy( IMRT_Buffer *Output_Buffer_Ptr, IMRT_Buffer *Input_Buffer_Ptr ) +{ + IMRT_Status status; + char *func_name = "MM_Delimited_StrHdl_Copy"; + + + status = IMRS_OK; + + if (Input_Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Input buffer pointer NULL" ); + } + else + if (Output_Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Output buffer pointer NULL" ); + } + else + /* controle donnees dans Input_Buffer */ + if (Input_Buffer_Ptr->Status != IMRD_BUFFER_STATUS_ALLOCATED) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer input not allocated"); + } + /* le buffer destinataire ne doit pas comporter de données */ + else if ( ( Output_Buffer_Ptr->Status == IMRD_BUFFER_STATUS_ALLOCATED) || + ( Output_Buffer_Ptr->Data_Tmp_Ptr != NULL) ) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer output not allocated or Data_Tmp_Ptr no NULL"); + } + else + { + status = Delimited_Hdl_DataBuf_Alloc(Output_Buffer_Ptr, Input_Buffer_Ptr->Data_Buf_Size); + if (status == IMRS_OK) + { + memcpy( Output_Buffer_Ptr->Data_Buf_Ptr, + Input_Buffer_Ptr->Data_Buf_Ptr, + Input_Buffer_Ptr->Data_Buf_Size); + Output_Buffer_Ptr->Data_Buf_Len = Input_Buffer_Ptr->Data_Buf_Len; + if (Input_Buffer_Ptr->Data_Tmp_Ptr != NULL) + { + memcpy( Output_Buffer_Ptr->Data_Tmp_Ptr, + Input_Buffer_Ptr->Data_Tmp_Ptr, + sizeof(IMRT_Delimited_TmpId)); + } + } + } + + + return ( status ); +} + +IMRT_Status Delimited_Hdl_Field_Exist(IMRT_Field *Field_Ptr , IMRT_Buffer *Buffer_Ptr) +{ + IMRT_Status status; + char *func_name = "Delimited_Hdl_Field_Exist"; + + + status = IMRS_OK; + + + if (Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer pointer NULL" ); + } + else + if (Field_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Field pointer NULL" ); + } + else + if (Field_Ptr->Delimited.Id >= ((IMRT_Delimited_TmpId *)(Buffer_Ptr->Data_Tmp_Ptr))->TmpId) + { + status = IMRS_NO_IDENT; + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_1 , "Field not exist"); + } + + + return ( status ); + +} + +IMRT_Status MM_Delimited_StrHdl_Get(IMRT_Buffer_Data **Data_Ptr_Ptr, IMRT_Field *Field_Ptr, + IMRT_Buffer *Buffer_Ptr , size_t *len ) +{ + IMRT_Buffer_Data *data_ptr; + IMRT_Buffer_Data *deb_data_ptr; + IMRT_Buffer_Data *end_data_ptr; + IMRT_Status status; + IMRT_Status status_ret; + char *delim_ptr; + IMRT_FmtAttr_Value delimiteur; + size_t sizeTmp; + size_t delimLen; + char indicateur[2]; + short indice; + + char *func_name = "MM_Delimited_StrHdl_Get"; + + + status = IMRS_OK; + deb_data_ptr = NULL; + end_data_ptr = NULL; + sizeTmp = 0L; + indice = 0; + + if (Data_Ptr_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Data_Ptr_Ptr NULL"); + } + else if (len == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("len pointer NULL"); + } + else if (Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer_Ptr NULL"); + } + else if (Field_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Field_Ptr NULL"); + } + else if (strcmp((Buffer_Ptr->FmtAttr_Value) , "") == 0) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Delimiteur vide"); + } + + + if ( status == IMRS_OK ) + { + strncpy(indicateur , Buffer_Ptr->FmtAttr_Value , 1); + indicateur[1] = '\0'; + strcpy(delimiteur , ""); + delim_ptr = (Buffer_Ptr->FmtAttr_Value); + delim_ptr++; + strcpy(delimiteur , delim_ptr); + delimLen = strlen(delimiteur); + } + + /* Controle de validite de l'indicateur */ + if ((strcmp(indicateur , "S") != 0) && (strcmp(indicateur , "T") != 0)) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_1("Indicateur non correct [%s]",indicateur); + } + + + /* Controle de validite de l'Id */ + if (status == IMRS_OK) + { + if (Field_Ptr->Delimited.Id == IMRD_DELIMITED_ID_UNKNOWN) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Occurence Delimited unknown"); + } + } + + /* Controle de l'existence du champ */ + if (status == IMRS_OK) + status = Delimited_Hdl_Field_Exist(Field_Ptr , Buffer_Ptr); + /* Le champ n'existe pas => on prend la valeur par defaut */ + if (status == IMRS_NO_IDENT) + { + sizeTmp = strlen(Field_Ptr->Delimited.Def_Val); + data_ptr = (IMRT_Buffer_Data *) malloc ( sizeTmp + 1); + if (data_ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Malloc error"); + } + else + { + memset( data_ptr, '\0', sizeTmp + 1 ); + memcpy(data_ptr , Field_Ptr->Delimited.Def_Val , sizeTmp ); + *(data_ptr + sizeTmp) = '\0'; + *Data_Ptr_Ptr = data_ptr; + status = IMRS_OK; + } + } + /* le champ existe => on extrait la valeur */ + else if (status == IMRS_OK) + { + /* positionnement au debut de la chaine */ + deb_data_ptr = Buffer_Ptr->Data_Buf_Ptr; + /* Placement sur la bonne occurence */ + while ((indice < Field_Ptr->Delimited.Id)&&(status == IMRS_OK)) + { + deb_data_ptr = (IMRT_Buffer_Data *)strstr((const char *)deb_data_ptr , (const char *)delimiteur); + if (deb_data_ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Search occurence error"); + } + else + { + deb_data_ptr = deb_data_ptr + delimLen ; + indice++; + } + } + /*positionnement a la fin de la chaine */ + end_data_ptr = (IMRT_Buffer_Data *)strstr((const char *)deb_data_ptr , (const char *)delimiteur); + if (end_data_ptr == NULL) + { + /* Si l'indicateur est S */ + /* Si c'est la derniere occurence il n'y a pas de delimiteur */ + if (strcmp(indicateur , "S") == 0) + sizeTmp = (Buffer_Ptr->Data_Buf_Len - (deb_data_ptr - (Buffer_Ptr->Data_Buf_Ptr))); + else + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Incorrect format"); + } + } + else + { + sizeTmp = end_data_ptr - deb_data_ptr ; + } + data_ptr = (IMRT_Buffer_Data *) malloc ( sizeTmp + 1); + if (data_ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Malloc error"); + } + else + { + memset( data_ptr, '\0', sizeTmp + 1 ); + memcpy(data_ptr , deb_data_ptr , sizeTmp ); + *(data_ptr + sizeTmp) = '\0'; + *Data_Ptr_Ptr = data_ptr; + } + } + + if (status == IMRS_OK) + { + *len = sizeTmp; + } + + + return ( status ); +} + + +IMRT_Status IMR_MM_Delimited_StrHdl_Msg_Size( size_t Msg_Size ) +{ + IMRT_Status status; + char *func_name = "IMR_MM_Delimited_StrHdl_Msg_Size"; + + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_1 , "============================================================================") + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_1 , "Size msg demand : Begin"); + IMRD_LM_LOG_TRACE_1(IMRD_LOG_LEVEL_VERBOSE_1 , "Msg_Size : (%ld)" , Msg_Size); + + + /* Erreur de referentiel */ + status = IMRS_KO; + IMRD_LM_LOG_WARNING_0("Referential error ; this should never happen"); + + IMRD_LM_LOG_TRACE_1(IMRD_LOG_LEVEL_VERBOSE_2 , "Size msg demand : End with status : (%d)" , status); + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_2 , "============================================================================") + + return ( status ); +} + + +IMRT_Status IMR_MM_Delimited_StrHdl_Field_Exist( IMRT_Field *Field_Ptr ) +{ + IMRT_Status status; + char *func_name = "IMR_MM_Delimited_StrHdl_Field_Exist"; + + status = IMRS_OK; + + if (Field_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Field_Ptr NULL"); + } + else + { + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_1 , "============================================================================") + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_1 , "Existing field demand : Begin"); + IMRD_LM_LOG_TRACE_1(IMRD_LOG_LEVEL_VERBOSE_1 , "Field Input name : [%s]" , Field_Ptr->Name); + + if (IMRG_Delimited_Buffer_Ident_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer pointer NULL"); + } + else + { + status = Delimited_Hdl_Field_Exist( Field_Ptr, IMRG_Delimited_Buffer_Ident_Ptr); + } + } + + + IMRD_LM_LOG_TRACE_1(IMRD_LOG_LEVEL_VERBOSE_2 , "Existing field demand : End with status : (%d)" , status); + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_2 , "============================================================================") + + + return ( status ); +} + + +IMRT_Status IMR_MM_Delimited_StrHdl_Field_Value( IMRT_Field *Field_Ptr , IMRT_Field_Value_Id Value_Id ) +{ + IMRT_Buffer_Data *data_ptr; + IMRT_Status status; + size_t field_len; + char *func_name = "IMR_MM_Delimited_StrHdl_Field_Value"; + + status = IMRS_OK; + + if (Field_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Field_Ptr NULL"); + } + else + { + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_1 , "============================================================================") + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_1 , "Field Value demand : Begin"); + IMRD_LM_LOG_TRACE_2(IMRD_LOG_LEVEL_VERBOSE_1 , "Field Input name : [%s] Value Id : [%s]" , Field_Ptr->Name , Value_Id); + + + field_len = 0L; + + if (IMRG_Delimited_Buffer_Ident_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer pointer NULL"); + } + else + { + status = MM_Delimited_StrHdl_Get(&data_ptr, Field_Ptr, IMRG_Delimited_Buffer_Ident_Ptr , &field_len); + } + if (status == IMRS_OK) + { + IMRD_LM_LOG_TRACE_1(IMRD_LOG_LEVEL_VERBOSE_2 , "Value extracted : [%s]" , data_ptr); + if (strcmp(data_ptr, Value_Id) != 0) + { + status = IMRS_NO_IDENT; + } + free(data_ptr); + } + } + + IMRD_LM_LOG_TRACE_1(IMRD_LOG_LEVEL_VERBOSE_2 , "Field Value demand : End with status : (%d)" , status); + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_2 , "============================================================================") + + return ( status ); +} + +IMRT_Status MM_Delimited_StrHdl_Convert(IMRT_Buffer_Data **Data_Output_Ptr , IMRT_Buffer_Data *Data_Input_Ptr , IMRT_Field *Field_Ptr, + size_t *len , IMRT_StrHdl_Cnv_Func *Cnv_Func_Tab ) +{ + IMRT_Status status; + IMRT_Buffer_Data *data_tmp_Ptr = NULL; + size_t size; + char *func_name = "MM_Delimited_StrHdl_Convert"; + + + + status = IMRS_OK; + + if (Data_Output_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Data_Output_Ptr NULL"); + } + else if (Cnv_Func_Tab == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Cnv_Func_Tab NULL"); + } + else if (len == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("len pointer NULL"); + } + else if (Field_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Field_Ptr NULL"); + } + else + if (Data_Input_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Data_Input_Ptr NULL"); + } + else + { + size = Field_Ptr->Fixed.Size; + + data_tmp_Ptr = (IMRT_Buffer_Data *)malloc(size + 1L); + memset( data_tmp_Ptr, '\0' , (size + 1L) ); + + + /* Appel de la fonction de convertion */ + + if ((Field_Ptr->Delimited.Cnv_Ptr == NULL) ||(Cnv_Func_Tab[Field_Ptr->Delimited.Cnv_Ptr->Id].Convert_Ptr == NULL)) + { + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_1 , "Pas de fonction de conversion"); + + if (Data_Input_Ptr != NULL) + { + *Data_Output_Ptr = data_tmp_Ptr; + memcpy(*Data_Output_Ptr,Data_Input_Ptr,*len); + } + } + else + { + status = Cnv_Func_Tab[Field_Ptr->Delimited.Cnv_Ptr->Id].Convert_Ptr( data_tmp_Ptr, + Data_Input_Ptr, + len , + size , + Field_Ptr->Delimited.Cnv_Attr ); + *Data_Output_Ptr = data_tmp_Ptr; + } + } + + if (Data_Input_Ptr != NULL) + free(Data_Input_Ptr); + + + return ( status ); + +} + +IMRT_Status MM_Delimited_StrHdl_Put(IMRT_Buffer_Data *Data_Ptr, IMRT_Field *Field_Ptr, + IMRT_Buffer *Buffer_Ptr , size_t len ) +{ + IMRT_Buffer_Data *data_buf_ptr; + size_t data_len; + size_t delim_len; + size_t data_max_len; + IMRT_Delimited_TmpId *TmpId_Ptr; + char *delim_ptr; + int occ; + IMRT_FmtAttr_Value delimiteur; + char indicateur[2]; + IMRT_Status status; + char *func_name = "MM_Delimited_StrHdl_Put"; + + + status = IMRS_OK; + + if (Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer_Ptr NULL"); + } + else if (strcmp((Buffer_Ptr->FmtAttr_Value) , "") == 0) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Delimiteur vide"); + } + else if (Field_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Field_Ptr NULL"); + } + else if (Data_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("data pointer NULL"); + } + + if ( status == IMRS_OK ) + { + strcpy(delimiteur , ""); + strncpy(indicateur , Buffer_Ptr->FmtAttr_Value , 1); + indicateur[1] = '\0'; + delim_ptr = NULL; + delim_ptr = (Buffer_Ptr->FmtAttr_Value); + delim_ptr++; + strcpy(delimiteur , delim_ptr); + delim_len = strlen(delimiteur); + + + /* Controle de validite de l'indicateur */ + if ((strcmp(indicateur , "S") != 0) && (strcmp(indicateur , "T") != 0)) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_1("Indicateur non correct [%s]",indicateur); + } + } + + /* Controle de validite du delimiteur */ + if ( status == IMRS_OK ) + { + if (strcmp(delimiteur , "") == 0) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Delimiteur vide"); + } + } + + if ( status == IMRS_OK ) + { + /* Controle de validite de l'Id */ + if (Field_Ptr->Delimited.Id == IMRD_DELIMITED_ID_UNKNOWN) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Occurence Delimited unknown"); + } + } + + if ( status == IMRS_OK ) + { + occ = (((IMRT_Delimited_TmpId *)(Buffer_Ptr->Data_Tmp_Ptr))->TmpId); + /* la len est recuperee de la fonction de convertion */ + data_len = len; + + TmpId_Ptr = (IMRT_Delimited_TmpId *)Buffer_Ptr->Data_Tmp_Ptr; + + + /* Controle de l' occurence */ + if (Field_Ptr->Delimited.Id > occ) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_2("Occurence (%d) not valid in [%s]",Field_Ptr->Delimited.Id,func_name); + } + } + + if ( status == IMRS_OK ) + { + /* Controle de la taille */ + data_max_len = Buffer_Ptr->Data_Buf_Len + data_len + delim_len; + if (Buffer_Ptr->Data_Buf_Size <= data_max_len) + status = Delimited_Hdl_DataBuf_Alloc( Buffer_Ptr, data_max_len + 1 ); + } + + + /* l'indicateur est 'S' */ + + if (( status == IMRS_OK )&&(strcmp(indicateur , "S")) == 0) + { + /* insertion de la valeur dans les donnees du buffer */ + + data_buf_ptr = Buffer_Ptr->Data_Buf_Ptr + Buffer_Ptr->Data_Buf_Len ; + + /* on n'insere le d‚limiteur qu'a partir de la deuxieme occurence (1) */ + if (occ != 0) + { + memcpy(data_buf_ptr, delimiteur, delim_len); + memcpy(data_buf_ptr + delim_len , Data_Ptr , data_len) ; + Buffer_Ptr->Data_Buf_Len = data_max_len; + } + else + { + memcpy(data_buf_ptr , Data_Ptr , data_len) ; + Buffer_Ptr->Data_Buf_Len = Buffer_Ptr->Data_Buf_Len + data_len ; + } + occ++; + TmpId_Ptr->TmpId = (IMRT_Delimited_Id)occ; + } + else /* l'indicateur est 'T' */ + if (( status == IMRS_OK )&&(strcmp(indicateur , "T") == 0)) + { + /* insertion de la valeur dans les donnees du buffer */ + data_buf_ptr = Buffer_Ptr->Data_Buf_Ptr + Buffer_Ptr->Data_Buf_Len ; + + /* on insere systematiquement le d‚limiteur en fin de chaine */ + memcpy(data_buf_ptr , Data_Ptr , data_len) ; + memcpy(data_buf_ptr + data_len , delimiteur, delim_len); + Buffer_Ptr->Data_Buf_Len = data_max_len; + occ++; + TmpId_Ptr->TmpId = (IMRT_Delimited_Id)occ; + + } + + IMRD_LM_LOG_TRACE_1( IMRD_LOG_LEVEL_VERBOSE_2 , "Prochaine occurence apres put (%d)",TmpId_Ptr->TmpId); + + if (Data_Ptr != NULL) + free(Data_Ptr); + + + + return ( status ); +} diff --git a/src/libmapping_mng/src/fmt_hdl_dltd.h b/src/libmapping_mng/src/fmt_hdl_dltd.h new file mode 100644 index 0000000..0a0622b --- /dev/null +++ b/src/libmapping_mng/src/fmt_hdl_dltd.h @@ -0,0 +1,115 @@ +/*----------------------------------------------------------------------------*/ +/* File: fmt_hdl_dltd.h */ +/*----------------------------------------------------------------------------*/ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#ifndef _DELIMITED_HANDLER_H_ +#define _DELIMITED_HANDLER_H_ + +/*----------------------------------------------------------------------------*/ +/* Global Include */ +/*----------------------------------------------------------------------------*/ + +#include "libmapping_mng.h" + + + +/*----------------------------------------------------------------------------*/ +/* Local definition */ +/*----------------------------------------------------------------------------*/ + +#ifdef _DELIMITED_HANDLER_C_ + +# define DELIMITED_TAILLE_ALLOC 100000 + + typedef struct IMRT_Delimited_TmpId + { + IMRT_Delimited_Id TmpId; + } IMRT_Delimited_TmpId; + + +#endif + + +/*----------------------------------------------------------------------------*/ +/* Global Variables */ +/*----------------------------------------------------------------------------*/ +#ifdef _DELIMITED_HANDLER_C_ + + IMRT_Buffer *IMRG_Delimited_Buffer_Ident_Ptr; + +#endif + +/*----------------------------------------------------------------------------*/ +/* Prototypes */ +/*----------------------------------------------------------------------------*/ + +#ifdef _DELIMITED_HANDLER_C_ + + IMRT_Status MM_Delimited_StrHdl_Init ( void ); + IMRT_Status MM_Delimited_StrHdl_DeInit ( void ); + IMRT_Status Delimited_Hdl_DataBuf_Alloc ( IMRT_Buffer * , size_t ); + IMRT_Status MM_Delimited_StrHdl_Data_Free ( IMRT_Buffer * ); + IMRT_Status Delimited_Hdl_Format_Ident ( IMRT_Buffer * ); + IMRT_Status MM_Delimited_StrHdl_Ident ( IMRT_Msg_Id * , IMRT_Buffer * ); + IMRT_Status Delimited_Hdl_Occ_Count ( IMRT_Buffer_Data * , short * , IMRT_FmtAttr_Value ); + IMRT_Status Delimited_Hdl_TmpId_Init ( IMRT_Buffer * , short ); + IMRT_Status MM_Delimited_StrHdl_Open ( IMRT_Buffer * ); + IMRT_Status MM_Delimited_StrHdl_Close ( IMRT_Buffer * ); + IMRT_Status MM_Delimited_StrHdl_Flush ( IMRT_Buffer * ); + IMRT_Status MM_Delimited_StrHdl_Flush ( IMRT_Buffer * ); + IMRT_Status MM_Delimited_StrHdl_Data_List ( IMRT_Buffer * ); + IMRT_Status MM_Delimited_StrHdl_Copy ( IMRT_Buffer * , IMRT_Buffer * ); + IMRT_Status Delimited_Hdl_Field_Exist ( IMRT_Field * , IMRT_Buffer * ); + IMRT_Status MM_Delimited_StrHdl_Get ( IMRT_Buffer_Data ** , IMRT_Field * , IMRT_Buffer * , size_t * ); + IMRT_Status MM_Delimited_StrHdl_Convert ( IMRT_Buffer_Data ** , IMRT_Buffer_Data * , IMRT_Field * , size_t *, IMRT_StrHdl_Cnv_Func * ); + IMRT_Status MM_Delimited_StrHdl_Put ( IMRT_Buffer_Data * , IMRT_Field * , IMRT_Buffer * , size_t ); + IMRT_Status IMR_MM_Delimited_StrHdl_Field_Value ( IMRT_Field * , IMRT_Field_Value_Id); + IMRT_Status IMR_MM_Delimited_StrHdl_Field_Exist ( IMRT_Field * ); + IMRT_Status IMR_MM_Delimited_StrHdl_Msg_Size ( size_t ); +#else + + extern IMRT_Status MM_Delimited_StrHdl_Init ( void ); + extern IMRT_Status MM_Delimited_StrHdl_DeInit ( void ); + extern IMRT_Status MM_Delimited_StrHdl_Library_Open ( void ); + extern IMRT_Status MM_Delimited_StrHdl_Data_Free ( IMRT_Buffer * ); + extern IMRT_Status MM_Delimited_StrHdl_Ident ( IMRT_Msg_Id * , IMRT_Buffer * ); + extern IMRT_Status MM_Delimited_StrHdl_Open ( IMRT_Buffer * ); + extern IMRT_Status MM_Delimited_StrHdl_Close ( IMRT_Buffer * ); + extern IMRT_Status MM_Delimited_StrHdl_Flush ( IMRT_Buffer * ); + extern IMRT_Status MM_Delimited_StrHdl_Flush ( IMRT_Buffer * ); + extern IMRT_Status MM_Delimited_StrHdl_Data_List ( IMRT_Buffer * ); + extern IMRT_Status MM_Delimited_StrHdl_Copy ( IMRT_Buffer * , IMRT_Buffer * ); + extern IMRT_Status MM_Delimited_StrHdl_Get ( IMRT_Buffer_Data ** , IMRT_Field * , IMRT_Buffer * , size_t * ); + extern IMRT_Status MM_Delimited_StrHdl_Convert ( IMRT_Buffer_Data ** , IMRT_Buffer_Data * , IMRT_Field * , size_t *, IMRT_StrHdl_Cnv_Func * ); + extern IMRT_Status MM_Delimited_StrHdl_Put ( IMRT_Buffer_Data * , IMRT_Field * , IMRT_Buffer * , size_t ); + +#endif + +/*----------------------------------------------------------------------------*/ + +#endif + diff --git a/src/libmapping_mng/src/fmt_hdl_fixed.c b/src/libmapping_mng/src/fmt_hdl_fixed.c new file mode 100644 index 0000000..cd02ef6 --- /dev/null +++ b/src/libmapping_mng/src/fmt_hdl_fixed.c @@ -0,0 +1,744 @@ +/*----------------------------------------------------------------------------*/ +/* File: fmt_hdl_fixed.c */ +/*----------------------------------------------------------------------------*/ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#define _LIBMAPPING_MNG_ +#define _FIXED_HANDLER_C_ + +#include "fmt_hdl_fixed.h" + +IMRT_Status MM_Fixed_StrHdl_Init() +{ + IMRG_Fixed_Buffer_Ident_Ptr = NULL; + return (IMRS_OK); +} + +IMRT_Status MM_Fixed_StrHdl_DeInit() +{ + + return (IMRS_OK); +} +IMRT_Status Fixed_Hdl_DataBuf_Alloc( IMRT_Buffer *Buffer_Ptr, size_t Taille_Alloc ) +{ + IMRT_Buffer_Data *data_Ptr; + IMRT_Status status; + char *func_name = "Fixed_Hdl_DataBuf_Alloc"; + + + status = IMRS_OK; + data_Ptr = NULL; + + if (Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer pointer NULL" ); + } + else + if (Buffer_Ptr->Status == IMRD_BUFFER_STATUS_ALLOCATED) + { + if (Taille_Alloc > Buffer_Ptr->Data_Buf_Size) + { + data_Ptr = (IMRT_Buffer_Data *) realloc ( (void *) Buffer_Ptr->Data_Buf_Ptr, Taille_Alloc ); + if (data_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Realloc error"); + } + else + { + memset( data_Ptr + Buffer_Ptr->Data_Buf_Size, '\0', Taille_Alloc - Buffer_Ptr->Data_Buf_Size ); + Buffer_Ptr->Data_Buf_Ptr = data_Ptr; + Buffer_Ptr->Data_Buf_Size = Taille_Alloc; + } + } + } + else + { + data_Ptr = (IMRT_Buffer_Data *) malloc ( Taille_Alloc ); + if (data_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Malloc error"); + } + else + { + memset( data_Ptr, '\0', Taille_Alloc ); + Buffer_Ptr->Data_Buf_Ptr = data_Ptr; + Buffer_Ptr->Status = IMRD_BUFFER_STATUS_ALLOCATED; + Buffer_Ptr->Data_Buf_Size = Taille_Alloc; + Buffer_Ptr->Data_Buf_Len = 0; + } + } + + + return ( status ); +} + +IMRT_Status MM_Fixed_StrHdl_Data_Free( IMRT_Buffer *Buffer_Ptr) +{ + IMRT_Status status; + char *func_name = "MM_Fixed_StrHdl_Data_Free"; + + + status = IMRS_OK; + + if (Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer pointer NULL" ); + } + else + if (Buffer_Ptr->Status == IMRD_BUFFER_STATUS_ALLOCATED) + { + free(Buffer_Ptr->Data_Buf_Ptr); + Buffer_Ptr->Data_Buf_Ptr = NULL; + Buffer_Ptr->Status = IMRD_BUFFER_STATUS_FREED; + Buffer_Ptr->Data_Buf_Size = 0; + Buffer_Ptr->Data_Buf_Len = 0; + } + + return ( status ); +} + +IMRT_Status Fixed_Hdl_Format_Ident( IMRT_Buffer *Buffer_Ptr ) +{ + IMRT_Status status; + char *func_name = "Fixed_Hdl_Format_Ident"; + + + if (Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer pointer NULL" ); + } + else + if (Buffer_Ptr->Status == IMRD_BUFFER_STATUS_ALLOCATED) + { + status = IMRS_OK; + } + else + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer not allocated"); + } + + + return ( status ); +} + +IMRT_Status MM_Fixed_StrHdl_Ident( IMRT_Msg_Id *Msg_Id_Ident_Ptr, + IMRT_Buffer *Buffer_Ptr ) +{ + + IMRT_Fmt_Id Format; + IMRT_Status status; + IMRT_Msg_Id *Msg_Id_Tmp; + char *func_name = "MM_Fixed_StrHdl_Ident"; + + + if (Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer pointer NULL" ); + } + else + if (Msg_Id_Ident_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Msg_Id_Ident_Ptr NULL" ); + } + else + { + Format = Buffer_Ptr->Fmt_Id; + Msg_Id_Tmp = Msg_Id_Ident_Ptr; + status = IMRS_OK; + + IMRG_Fixed_Buffer_Ident_Ptr = Buffer_Ptr; + /* Le Msg_Id transmis au SDM est le point de depart de l'identification */ + /* C'est egalement le resultat qui sera inclus dans le buffer */ + status = IMR_SDM_MsgIdent_Proceed(Format, + Msg_Id_Tmp, + IMR_MM_Fixed_StrHdl_Field_Value, + IMR_MM_Fixed_StrHdl_Field_Exist, + IMR_MM_Fixed_StrHdl_Msg_Size); + IMRG_Fixed_Buffer_Ident_Ptr = NULL; + + Msg_Id_Ident_Ptr = Msg_Id_Tmp; + } + + + return ( status ); + +} + +IMRT_Status MM_Fixed_StrHdl_Open( IMRT_Buffer *Buffer_Ptr) +{ + IMRT_Msg_Id type_temp; + IMRT_Status status; + char *func_name = "MM_Fixed_StrHdl_Open"; + + + status = IMRS_OK; + if (Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer pointer NULL" ); + } + else + { + type_temp = Buffer_Ptr->Msg_Id; + /* absence de données */ + if (Buffer_Ptr->Status != IMRD_BUFFER_STATUS_ALLOCATED) + { + /* Cas d'open du buffer en ecriture */ + /* le type du message est passe */ + /* par le SDM : il doit donc etre connu */ + if (type_temp == IMRD_MSG_ID_UNKNOWN) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Msg Id unknown"); + } + else + { + status = Fixed_Hdl_DataBuf_Alloc( Buffer_Ptr, FIXED_TAILLE_ALLOC ); + } + } + else + { + /* controle du format */ + status = Fixed_Hdl_Format_Ident( Buffer_Ptr ) ; + if (status != IMRS_OK) + { + status = IMRS_BAD_FORMAT; + } + } + } + + + + return ( status ); +} + + +IMRT_Status MM_Fixed_StrHdl_Close( IMRT_Buffer *Buffer_Ptr) +{ + char *func_name = "MM_Fixed_StrHdl_Close"; + + + return (IMRS_OK); +} + +IMRT_Status MM_Fixed_StrHdl_Flush( IMRT_Buffer *Buffer_Ptr) +{ + char *func_name = "MM_Fixed_StrHdl_Flush"; + + return (IMRS_OK); +} + + + +IMRT_Status MM_Fixed_StrHdl_Data_List( IMRT_Buffer *Buffer_Ptr) +{ + if (Buffer_Ptr == NULL) + { + IMRD_LM_LOG_WARNING_0("Buffer pointer NULL" ); + } + else + { + IMRD_LM_LOG_TRACE_3( IMRD_LOG_LEVEL_VERBOSE_1, "Buffer_List: Data_Buf_Ptr_Size: (%d) Data_Buf_Ptr_Len: (%d) Data_Buf_Ptr: (0x%X)", Buffer_Ptr->Data_Buf_Size, Buffer_Ptr->Data_Buf_Len, Buffer_Ptr->Data_Buf_Ptr); + IMRD_LM_LOG_TRACE_1( IMRD_LOG_LEVEL_VERBOSE_2, "Buffer_List: Data_Buf: [%s]", Buffer_Ptr->Data_Buf_Ptr); + + IMRD_LM_LOG_TRACE_2( IMRD_LOG_LEVEL_VERBOSE_1, "Buffer_List: Data_Tmp_Changed: (%d) Data_Tmp_Ptr: (0x%X)", Buffer_Ptr->Data_Tmp_Changed, Buffer_Ptr->Data_Tmp_Ptr); + if (Buffer_Ptr->Data_Tmp_Ptr != NULL) + IMRD_LM_LOG_TRACE_1( IMRD_LOG_LEVEL_VERBOSE_2, "Buffer_List: Data_Tmp: [%s]", Buffer_Ptr->Data_Tmp_Ptr); + } + + return (IMRS_OK); +} + + + +IMRT_Status MM_Fixed_StrHdl_Copy( IMRT_Buffer *Output_Buffer_Ptr, IMRT_Buffer *Input_Buffer_Ptr ) +{ + IMRT_Status status; + char *func_name = "MM_Fixed_StrHdl_Copy"; + + + status = IMRS_OK; + + if (Input_Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Input buffer pointer NULL" ); + } + else + if (Output_Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Output buffer pointer NULL" ); + } + else + /* controle donnees dans Input_Buffer */ + if (Input_Buffer_Ptr->Status != IMRD_BUFFER_STATUS_ALLOCATED) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer input not allocated"); + } + /* le buffer destinataire ne doit pas comporter de données */ + else if ( ( Output_Buffer_Ptr->Status == IMRD_BUFFER_STATUS_ALLOCATED) || + ( Output_Buffer_Ptr->Data_Tmp_Ptr != NULL) ) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer output not allocated or Data_Tmp_Ptr no NULL"); + } + else + { + status = Fixed_Hdl_DataBuf_Alloc(Output_Buffer_Ptr, Input_Buffer_Ptr->Data_Buf_Size); + if (status == IMRS_OK) + { + memcpy( Output_Buffer_Ptr->Data_Buf_Ptr, + Input_Buffer_Ptr->Data_Buf_Ptr, + Input_Buffer_Ptr->Data_Buf_Size); + Output_Buffer_Ptr->Data_Buf_Len = Input_Buffer_Ptr->Data_Buf_Len; + } + } + + + return ( status ); +} + +IMRT_Status Fixed_Hdl_Field_Exist(IMRT_Field *Field_Ptr , IMRT_Buffer *Buffer_Ptr) +{ + IMRT_Status status; + char *func_name = "Fixed_Hdl_Field_Exist"; + + /* En fixed, pas de cas de champ inexistant */ + + status = IMRS_OK; + + return ( status ); + +} + + +IMRT_Status MM_Fixed_StrHdl_Get(IMRT_Buffer_Data **Data_Ptr_Ptr, IMRT_Field *Field_Ptr, + IMRT_Buffer *Buffer_Ptr , size_t *len ) +{ + IMRT_Buffer_Data *data_ptr; + IMRT_Status status; + int offsetTmp; + size_t sizeTmp; + char *func_name = "MM_Fixed_StrHdl_Get"; + + + status = IMRS_OK; + data_ptr = NULL; + offsetTmp = 0; + sizeTmp = 0L; + + if (Data_Ptr_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Data_Ptr_Ptr NULL"); + } + else if (len == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("len pointer NULL"); + } + else if (Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer_Ptr NULL"); + } + else if (Field_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Field_Ptr NULL"); + } + else + /* Controle de validite de la taille */ + if (Field_Ptr->Fixed.Size == IMRD_FIXED_SIZE_UNKNOWN) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Size Fixed unknown"); + } + + + if (status == IMRS_OK) + { + /* controle sur l'offset */ + if (Field_Ptr->Fixed.Offset > Buffer_Ptr->Data_Buf_Len ) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Field offset out of data len"); + } + } + + /* Controle de l'existence du champ */ + if (status == IMRS_OK) + { + status = Fixed_Hdl_Field_Exist(Field_Ptr , Buffer_Ptr); + } + + /* Le champ n'existe pas => on prend la valeur par defaut */ + /* Actuellement, ca ne peut pas arriver en Fixed */ + if (status == IMRS_NO_IDENT) + { + sizeTmp = strlen(Field_Ptr->Fixed.Def_Val); + data_ptr = (IMRT_Buffer_Data *) malloc ( sizeTmp + 1); + if (data_ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Malloc error"); + } + else + { + memset( data_ptr, '\0', sizeTmp + 1 ); + memcpy(data_ptr , Field_Ptr->Fixed.Def_Val , sizeTmp ); + *(data_ptr + sizeTmp) = '\0'; + *Data_Ptr_Ptr = data_ptr; + status = IMRS_OK; + } + + } + else if (status == IMRS_OK) + { + /* cas ou Field_Ptr->Fixed.Size = 0 => on prend tout le champ */ + /* idem si offset + size > len du message */ + if((Field_Ptr->Fixed.Size == 0L) ||( Field_Ptr->Fixed.Offset + Field_Ptr->Fixed.Size > Buffer_Ptr->Data_Buf_Len ) ) + { + sizeTmp = Buffer_Ptr->Data_Buf_Len - Field_Ptr->Fixed.Offset; + } + else + { + sizeTmp = Field_Ptr->Fixed.Size; + } + data_ptr = (IMRT_Buffer_Data *) malloc ( sizeTmp + 1); + if (data_ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Malloc error"); + } + else + { + memcpy( data_ptr, + Buffer_Ptr->Data_Buf_Ptr + Field_Ptr->Fixed.Offset, + sizeTmp); + *(data_ptr + sizeTmp) = '\0'; + *Data_Ptr_Ptr = data_ptr; + } + + } + + if (status == IMRS_OK) + { + *len = sizeTmp; + } + + + + return ( status ); +} + + +IMRT_Status IMR_MM_Fixed_StrHdl_Msg_Size ( size_t Msg_Size) +{ + IMRT_Status status; + char *func_name = "IMR_MM_Fixed_StrHdl_Msg_Size"; + + if (IMRG_Fixed_Buffer_Ident_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer pointer NULL"); + } + else + { + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_1 , "============================================================================") + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_1 , "Size msg demand : Begin"); + IMRD_LM_LOG_TRACE_1(IMRD_LOG_LEVEL_VERBOSE_1 , "Msg_Size : (%ld)" , Msg_Size); + IMRD_LM_LOG_TRACE_1(IMRD_LOG_LEVEL_VERBOSE_1 , "Length of the buffer data : (%ld)" , IMRG_Fixed_Buffer_Ident_Ptr->Data_Buf_Len); + + status = IMRS_OK; + + if (Msg_Size != IMRG_Fixed_Buffer_Ident_Ptr->Data_Buf_Len) + status = IMRS_NO_IDENT; + } + + IMRD_LM_LOG_TRACE_1(IMRD_LOG_LEVEL_VERBOSE_2 , "Size msg demand : End with status : (%d)" , status); + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_2 , "============================================================================") + + return ( status ); +} + + +IMRT_Status IMR_MM_Fixed_StrHdl_Field_Exist( IMRT_Field *Field_Ptr ) +{ + IMRT_Status status; + char *func_name = "IMR_MM_Fixed_StrHdl_Field_Exist"; + + status = IMRS_OK; + + if (Field_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Field_Ptr NULL"); + } + else + { + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_1 , "============================================================================") + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_1 , "Existing field demand : Begin"); + IMRD_LM_LOG_TRACE_1(IMRD_LOG_LEVEL_VERBOSE_1 , "Field Input name : [%s]" , Field_Ptr->Name); + + if (IMRG_Fixed_Buffer_Ident_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer pointer NULL"); + } + else + { + status = Fixed_Hdl_Field_Exist( Field_Ptr, IMRG_Fixed_Buffer_Ident_Ptr); + } + } + + IMRD_LM_LOG_TRACE_1(IMRD_LOG_LEVEL_VERBOSE_2 , "Existing field demand : End with status : (%d)" , status); + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_2 , "============================================================================") + + return ( status ); +} + +IMRT_Status IMR_MM_Fixed_StrHdl_Field_Value( IMRT_Field *Field_Ptr , IMRT_Field_Value_Id Value_Id ) +{ + IMRT_Buffer_Data *data_ptr; + IMRT_Status status; + size_t field_len; + char *func_name = "IMR_MM_Fixed_StrHdl_Field_Value"; + + status = IMRS_OK; + + if (Field_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Field_Ptr NULL"); + } + else + { + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_1 , "============================================================================") + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_1 , "Field Value demand : Begin"); + IMRD_LM_LOG_TRACE_2(IMRD_LOG_LEVEL_VERBOSE_1 , "Field Input name : [%s] Value Id : [%s]" , Field_Ptr->Name , Value_Id); + + field_len = 0L; + status = IMRS_OK; + + if (IMRG_Fixed_Buffer_Ident_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer pointer NULL"); + } + else + { + status = MM_Fixed_StrHdl_Get(&data_ptr, Field_Ptr, IMRG_Fixed_Buffer_Ident_Ptr , &field_len ); + } + + if (status == IMRS_OK) + { + IMRD_LM_LOG_TRACE_1(IMRD_LOG_LEVEL_VERBOSE_2 , "Value extracted : [%s]" , data_ptr); + if (strcmp(data_ptr, Value_Id) != 0) + { + status = IMRS_NO_IDENT; + } + free(data_ptr); + } + } + + IMRD_LM_LOG_TRACE_1(IMRD_LOG_LEVEL_VERBOSE_2 , "Field Value demand : End with status : (%d)" , status); + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_2 , "============================================================================") + + return ( status ); +} + +IMRT_Status MM_Fixed_StrHdl_Convert(IMRT_Buffer_Data **Data_Output_Ptr , IMRT_Buffer_Data *Data_Input_Ptr , IMRT_Field *Field_Ptr, + size_t *len , IMRT_StrHdl_Cnv_Func *Cnv_Func_Tab ) +{ + IMRT_Status status; + size_t size; + char *func_name = "MM_Fixed_StrHdl_Convert"; + + + + + status = IMRS_OK; + + if (Cnv_Func_Tab == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Cnv_Func_Tab NULL"); + } + else if (Data_Output_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Data_Output_Ptr NULL"); + } + else if (len == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("len pointer NULL"); + } + else if (Field_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Field_Ptr NULL"); + } + else + if (Data_Input_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Data_Input_Ptr NULL"); + } + else + { + size = Field_Ptr->Fixed.Size ; + + *Data_Output_Ptr = (IMRT_Buffer_Data *)malloc(size + 1L); + if (*Data_Output_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("*Data_Output_Ptr NULL"); + } + else + { + memset(*Data_Output_Ptr, '\0' , (size + 1L) ); + + /* Appel de la fonction de convertion */ + if ((Field_Ptr->Fixed.Cnv_Ptr == NULL) || (Cnv_Func_Tab[Field_Ptr->Fixed.Cnv_Ptr->Id].Convert_Ptr == NULL)) + { + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_1 , "Pas de fonction de conversion"); + + if (Data_Input_Ptr != NULL) + memcpy(*Data_Output_Ptr,Data_Input_Ptr,*len); + } + else + { + status = Cnv_Func_Tab[Field_Ptr->Fixed.Cnv_Ptr->Id].Convert_Ptr(*Data_Output_Ptr, + Data_Input_Ptr, + len , + size , + Field_Ptr->Fixed.Cnv_Attr); + } + } + } + + if (Data_Input_Ptr != NULL) + free(Data_Input_Ptr); + + + return ( status ); + +} + + +IMRT_Status MM_Fixed_StrHdl_Put(IMRT_Buffer_Data *Data_Ptr, IMRT_Field *Field_Ptr, + IMRT_Buffer *Buffer_Ptr , size_t len ) +{ + IMRT_Buffer_Data *data_buf_ptr; + size_t data_len; + size_t data_max_len; + IMRT_Status status; + char *func_name = "MM_Fixed_StrHdl_Put"; + + + status = IMRS_OK; + + if (Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer_Ptr NULL"); + } + else if (Field_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Field_Ptr NULL"); + } + else if (Data_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("data pointer NULL"); + } + else + /* Controle de validite de la taille */ + if (Field_Ptr->Fixed.Size == IMRD_FIXED_SIZE_UNKNOWN) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Size Fixed unknown"); + } + + if (status == IMRS_OK) + { + if (strcmp(Data_Ptr , "") == 0) + status = IMRD_STATUS_NOTHING_TO_DO; + } + + + if ( status == IMRS_OK ) + { + data_len = len ; + data_max_len = Field_Ptr->Fixed.Offset + data_len ; + + /* controle sur la valeur */ + if ( data_len > Field_Ptr->Fixed.Size ) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_2("Data len (%ld) superior to data size (%ld)",data_len , Field_Ptr->Fixed.Size); + } + else if ( Buffer_Ptr->Data_Buf_Size <= data_max_len ) + { + status = Fixed_Hdl_DataBuf_Alloc( Buffer_Ptr, data_max_len + 1 ); + } + } + + if ( status == IMRS_OK ) + { + /* insertion de la valeur dans les donnees du buffer */ + data_buf_ptr = Buffer_Ptr->Data_Buf_Ptr + Field_Ptr->Fixed.Offset; + memcpy(data_buf_ptr, Data_Ptr, data_len); + + if ( Buffer_Ptr->Data_Buf_Len < data_max_len ) + { + Buffer_Ptr->Data_Buf_Len = data_max_len; + } + } + + if (status == IMRD_STATUS_NOTHING_TO_DO) + status = IMRS_OK; + + if (Data_Ptr != NULL) + free(Data_Ptr); + + + return ( status ); +} + diff --git a/src/libmapping_mng/src/fmt_hdl_fixed.h b/src/libmapping_mng/src/fmt_hdl_fixed.h new file mode 100644 index 0000000..007b2aa --- /dev/null +++ b/src/libmapping_mng/src/fmt_hdl_fixed.h @@ -0,0 +1,104 @@ +/*----------------------------------------------------------------------------*/ +/* File: fmt_hdl_fixed.h */ +/*----------------------------------------------------------------------------*/ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#ifndef _FIXED_HANDLER_H_ +#define _FIXED_HANDLER_H_ + +/*----------------------------------------------------------------------------*/ +/* Global Include */ +/*----------------------------------------------------------------------------*/ + +#include "libmapping_mng.h" + +/*----------------------------------------------------------------------------*/ +/* Local definition */ +/*----------------------------------------------------------------------------*/ + +#ifdef _FIXED_HANDLER_C_ + +# define FIXED_TAILLE_ALLOC 100000 + +#endif + + +/*----------------------------------------------------------------------------*/ +/* Global Variables */ +/*----------------------------------------------------------------------------*/ +#ifdef _FIXED_HANDLER_C_ + + IMRT_Buffer *IMRG_Fixed_Buffer_Ident_Ptr; + +#endif + +/*----------------------------------------------------------------------------*/ +/* Prototypes */ +/*----------------------------------------------------------------------------*/ + +#ifdef _FIXED_HANDLER_C_ + + IMRT_Status MM_Fixed_StrHdl_Init ( void ); + IMRT_Status MM_Fixed_StrHdl_DeInit ( void ); + IMRT_Status Fixed_Hdl_DataBuf_Alloc ( IMRT_Buffer * , size_t ); + IMRT_Status MM_Fixed_StrHdl_Data_Free ( IMRT_Buffer * ); + IMRT_Status Fixed_Hdl_Format_Ident ( IMRT_Buffer * ); + IMRT_Status MM_Fixed_StrHdl_Ident ( IMRT_Msg_Id * , IMRT_Buffer * ); + IMRT_Status MM_Fixed_StrHdl_Open ( IMRT_Buffer * ); + IMRT_Status MM_Fixed_StrHdl_Close ( IMRT_Buffer * ); + IMRT_Status MM_Fixed_StrHdl_Flush ( IMRT_Buffer * ); + IMRT_Status MM_Fixed_StrHdl_Data_List ( IMRT_Buffer * ); + IMRT_Status MM_Fixed_StrHdl_Copy ( IMRT_Buffer * , IMRT_Buffer * ); + IMRT_Status Fixed_Hdl_Field_Exist ( IMRT_Field * , IMRT_Buffer * ); + IMRT_Status MM_Fixed_StrHdl_Get ( IMRT_Buffer_Data ** , IMRT_Field * , IMRT_Buffer * , size_t * ); + IMRT_Status MM_Fixed_StrHdl_Convert ( IMRT_Buffer_Data ** , IMRT_Buffer_Data * , IMRT_Field * , size_t *, IMRT_StrHdl_Cnv_Func * ); + IMRT_Status MM_Fixed_StrHdl_Put ( IMRT_Buffer_Data * , IMRT_Field * , IMRT_Buffer * , size_t ); + IMRT_Status IMR_MM_Fixed_StrHdl_Field_Value ( IMRT_Field * , IMRT_Field_Value_Id); + IMRT_Status IMR_MM_Fixed_StrHdl_Field_Exist ( IMRT_Field * ); + IMRT_Status IMR_MM_Fixed_StrHdl_Msg_Size ( size_t ); + +#else + + extern IMRT_Status MM_Fixed_StrHdl_Init ( void ); + extern IMRT_Status MM_Fixed_StrHdl_DeInit ( void ); + extern IMRT_Status MM_Fixed_StrHdl_Library_Open ( void ); + extern IMRT_Status MM_Fixed_StrHdl_Data_Free ( IMRT_Buffer * ); + extern IMRT_Status MM_Fixed_StrHdl_Ident ( IMRT_Msg_Id * , IMRT_Buffer * ); + extern IMRT_Status MM_Fixed_StrHdl_Open ( IMRT_Buffer * ); + extern IMRT_Status MM_Fixed_StrHdl_Close ( IMRT_Buffer * ); + extern IMRT_Status MM_Fixed_StrHdl_Flush ( IMRT_Buffer * ); + extern IMRT_Status MM_Fixed_StrHdl_Data_List ( IMRT_Buffer * ); + extern IMRT_Status MM_Fixed_StrHdl_Copy ( IMRT_Buffer * , IMRT_Buffer * ); + extern IMRT_Status MM_Fixed_StrHdl_Get ( IMRT_Buffer_Data ** , IMRT_Field * , IMRT_Buffer * , size_t * ); + extern IMRT_Status MM_Fixed_StrHdl_Convert ( IMRT_Buffer_Data ** , IMRT_Buffer_Data * , IMRT_Field * , size_t *, IMRT_StrHdl_Cnv_Func * ); + extern IMRT_Status MM_Fixed_StrHdl_Put ( IMRT_Buffer_Data * , IMRT_Field * , IMRT_Buffer * , size_t ); + +#endif + +/*----------------------------------------------------------------------------*/ + +#endif + diff --git a/src/libmapping_mng/src/fmt_hdl_fml.c b/src/libmapping_mng/src/fmt_hdl_fml.c new file mode 100644 index 0000000..f6d72a2 --- /dev/null +++ b/src/libmapping_mng/src/fmt_hdl_fml.c @@ -0,0 +1,835 @@ +/*----------------------------------------------------------------------------*/ +/* File: fmt_hdl_fml.c */ +/*----------------------------------------------------------------------------*/ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#define _LIBMAPPING_MNG_ +#define _FML_HANDLER_C_ + +#include "fmt_hdl_fml.h" + + +IMRT_Status MM_FML_StrHdl_Init() +{ + IMRG_FML_Buffer_Ident_Ptr = NULL; + return (IMRS_OK); +} + +IMRT_Status MM_FML_StrHdl_DeInit() +{ + + return (IMRS_OK); +} + +IMRT_Status FML_Hdl_DataBuf_Alloc( IMRT_Buffer *Buffer_Ptr ) +{ + IMRT_Status status; + int retour; + char *func_name = "FML_Hdl_DataBuf_Alloc"; + FBFR32 *tpFBbuf; + + + + tpFBbuf = NULL; + status = IMRS_OK; + retour = 0; + + + if (Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer pointer NULL" ); + } + else + if (Buffer_Ptr->Status != IMRD_BUFFER_STATUS_ALLOCATED) + { + tpFBbuf = (FBFR32 *)tpalloc((char *) IMRD_FML_TYPE , NULL, Fneeded32(IMRD_FML_MAX_FLD, IMRD_FML_SIZE) ); + + if (tpFBbuf == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Error tpalloc"); + } + + if (status == IMRS_OK) + { + + retour = Finit32(tpFBbuf, (FLDLEN32) Fsizeof32(tpFBbuf)); + + if (retour == -1) + { + if (Ferror32 == FNOSPACE) + { + IMRD_LM_LOG_ERROR_0("Ferror32 = FNOSPACE"); + } + else if (Ferror32 == FALIGNERR) + { + IMRD_LM_LOG_ERROR_0("Ferror32 = FALIGNERR"); + } + else if (Ferror32 == FNOTFLD) + { + IMRD_LM_LOG_ERROR_0("Ferror32 = FNOTFLD"); + } + else if (Ferror32 == FEINVAL) + { + IMRD_LM_LOG_ERROR_0("Ferror32 = FEINVAL"); + } + else if (Ferror32 == FBADFLD) + { + IMRD_LM_LOG_ERROR_0("Ferror32 = FBADFLD"); + } + status = IMRS_KO; + tpfree((char *)tpFBbuf); + } + } + + + if (status == IMRS_OK) + { + Buffer_Ptr->Data_Buf_Ptr = (IMRT_Buffer_Data *)tpFBbuf; + Buffer_Ptr->Status = IMRD_BUFFER_STATUS_ALLOCATED; + Buffer_Ptr->Data_Buf_Size = IMRD_FML_SIZE; + Buffer_Ptr->Data_Buf_Len = 0; + + } + } + + + + return status; + +} + + +IMRT_Status MM_FML_StrHdl_Data_Free( IMRT_Buffer *Buffer_Ptr) +{ + IMRT_Status status; + char *func_name = "MM_FML_StrHdl_Data_Free"; + + + status = IMRS_OK; + + if (Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer pointer NULL" ); + } + else + if (Buffer_Ptr->Status == IMRD_BUFFER_STATUS_ALLOCATED) + { + tpfree((char *)Buffer_Ptr->Data_Buf_Ptr); + Buffer_Ptr->Data_Buf_Ptr = NULL; + Buffer_Ptr->Status = IMRD_BUFFER_STATUS_FREED; + Buffer_Ptr->Data_Buf_Size = 0; + Buffer_Ptr->Data_Buf_Len = 0; + } + + return ( status ); +} + + +IMRT_Status FML_Hdl_Format_Ident( IMRT_Buffer *Buffer_Ptr ) +{ + IMRT_Status status; + char *func_name = "FML_Hdl_Format_Ident"; + + + status = IMRS_KO; + + if (Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer pointer NULL" ); + } + else + if (Buffer_Ptr->Status == IMRD_BUFFER_STATUS_ALLOCATED) + { + /* Controle du format FML */ + if (Fnum32((FBFR32 *)Buffer_Ptr->Data_Buf_Ptr) != -1) + { + status = IMRS_OK; + } + } + else + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer not allocated"); + } + + + return ( status ); +} + +IMRT_Status MM_FML_StrHdl_Ident( IMRT_Msg_Id *Msg_Id_Ident_Ptr, + IMRT_Buffer *Buffer_Ptr ) +{ + + IMRT_Fmt_Id Format; + IMRT_Status status; + IMRT_Msg_Id *Msg_Id_Tmp; + char *func_name = "MM_FML_StrHdl_Ident"; + + + if (Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer pointer NULL" ); + } + else + if (Msg_Id_Ident_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Msg_Id_Ident_Ptr NULL" ); + } + else + { + Format = Buffer_Ptr->Fmt_Id; + Msg_Id_Tmp = Msg_Id_Ident_Ptr; + status = IMRS_OK; + + IMRG_FML_Buffer_Ident_Ptr = Buffer_Ptr; + /* Le Msg_Id transmis au SDM est le point de depart de l'identification */ + /* C'est egalement le resultat qui sera inclus dans le buffer */ + status = IMR_SDM_MsgIdent_Proceed(Format, + Msg_Id_Tmp, + IMR_MM_FML_StrHdl_Field_Value, + IMR_MM_FML_StrHdl_Field_Exist, + IMR_MM_FML_StrHdl_Msg_Size); + IMRG_FML_Buffer_Ident_Ptr = NULL; + + Msg_Id_Ident_Ptr = Msg_Id_Tmp; + } + + + return ( status ); + +} + +IMRT_Status MM_FML_StrHdl_Open( IMRT_Buffer *Buffer_Ptr) +{ + IMRT_Msg_Id type_temp; + IMRT_Status status; + char *func_name = "MM_FML_StrHdl_Open"; + + status = IMRS_OK; + + if (Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer pointer NULL" ); + } + else + { + type_temp = Buffer_Ptr->Msg_Id; + + /* absence de données */ + if (Buffer_Ptr->Status != IMRD_BUFFER_STATUS_ALLOCATED) + { + /* Cas d'open du buffer en ecriture */ + /* le type du message est passe */ + /* par le SDM : il doit donc etre connu */ + if (type_temp == IMRD_MSG_ID_UNKNOWN) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Msg Id unknown"); + } + else + { + status = FML_Hdl_DataBuf_Alloc( Buffer_Ptr ); + } + } + else + { + /* controle du format */ + status = FML_Hdl_Format_Ident( Buffer_Ptr ); + /* format non reconnu */ + if (status != IMRS_OK) + status = IMRS_BAD_FORMAT; + } + } + + + + return ( status ); +} + +IMRT_Status MM_FML_StrHdl_Close( IMRT_Buffer *Buffer_Ptr) +{ + char *func_name = "MM_FML_StrHdl_Close"; + + return (IMRS_OK); +} + +IMRT_Status MM_FML_StrHdl_Flush( IMRT_Buffer *Buffer_Ptr) +{ + char *func_name = "MM_FML_StrHdl_Flush"; + + return (IMRS_OK); +} + +IMRT_Status MM_FML_StrHdl_Data_List( IMRT_Buffer *Buffer_Ptr) +{ + if (Buffer_Ptr == NULL) + { + IMRD_LM_LOG_WARNING_0("Buffer pointer NULL" ); + } + else + { + IMRD_LM_LOG_TRACE_3( IMRD_LOG_LEVEL_VERBOSE_1, "Buffer_List: Data_Buf_Ptr_Size: (%d) Data_Buf_Ptr_Len: (%d) Data_Buf_Ptr: (0x%X)", Buffer_Ptr->Data_Buf_Size, Buffer_Ptr->Data_Buf_Len, Buffer_Ptr->Data_Buf_Ptr); + + IMRD_LM_EXEC_TRACE( IMRD_LOG_LEVEL_VERBOSE_2, "Buffer_List: Data_Tmp: [", Ffprint32( (FBFR32 *)Buffer_Ptr->Data_Buf_Ptr, IMRD_LM_STREAM_OUT), "]"); + + IMRD_LM_LOG_TRACE_2( IMRD_LOG_LEVEL_VERBOSE_1, "Buffer_List: Data_Tmp_Changed: (%d) Data_Tmp_Ptr: (0x%X)", Buffer_Ptr->Data_Tmp_Changed, Buffer_Ptr->Data_Tmp_Ptr); + + if (Buffer_Ptr->Data_Tmp_Ptr != NULL) + IMRD_LM_LOG_TRACE_1( IMRD_LOG_LEVEL_VERBOSE_2, "Buffer_List: Data_Tmp: [%s]", Buffer_Ptr->Data_Tmp_Ptr); + } + + return( IMRS_OK); +} + +IMRT_Status MM_FML_StrHdl_Copy( IMRT_Buffer *Output_Buffer_Ptr, IMRT_Buffer *Input_Buffer_Ptr ) +{ + IMRT_Status status; + char *func_name = "MM_FML_StrHdl_Copy"; + + + status = IMRS_OK; + + if (Input_Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Input buffer pointer NULL" ); + } + else + if (Output_Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Output buffer pointer NULL" ); + } + else + /* controle donnees dans Input_Buffer */ + if (Input_Buffer_Ptr->Status != IMRD_BUFFER_STATUS_ALLOCATED) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0( "Buffer input not allocated"); + } + /* le buffer destinataire ne doit pas comporter de donnees */ + else if ( ( Output_Buffer_Ptr->Status == IMRD_BUFFER_STATUS_ALLOCATED) || + ( Output_Buffer_Ptr->Data_Tmp_Ptr != NULL) ) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer output not allocated or Data_Tmp_Ptr no NULL"); + } + else + { + status = FML_Hdl_DataBuf_Alloc(Output_Buffer_Ptr); + if (status == IMRS_OK) + { + /* copie de buffer FML */ + Fcpy32((FBFR32 *)Output_Buffer_Ptr->Data_Buf_Ptr , (FBFR32 *)Input_Buffer_Ptr->Data_Buf_Ptr); + Output_Buffer_Ptr->Data_Buf_Len = Fused32((FBFR32 *)Output_Buffer_Ptr->Data_Buf_Ptr); + + /* doit on faire la maj du size et du len pour le FML ??? */ + } + } + + + return ( status ); +} + + +IMRT_Status FML_Hdl_Field_Exist(IMRT_Field *Field_Ptr , IMRT_Buffer *Buffer_Ptr , FLDID32 FML_Field) +{ + IMRT_Status status; + FLDOCC32 retour; + char *func_name = "FML_Hdl_Field_Exist"; + + + status = IMRS_OK; + retour = 0; + + if (Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer pointer NULL" ); + } + else + if (Field_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Field pointer NULL" ); + } + else + { + retour = Foccur32((FBFR32 *)Buffer_Ptr->Data_Buf_Ptr, FML_Field); + + if (retour == 0 ) + { + status = IMRS_NO_IDENT; + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_1 , "Field not exist"); + } + else if (retour == -1 ) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_1("Foccur32 error [%s]" , Fstrerror32(Ferror32)); + } + } + + + return ( status ); + +} + + +/* dans la fonction get, il conviendra d'etudier la necessite ou non de developper : + - la conversion des types + - la possibilite de champ multi-occurrence +*/ +IMRT_Status MM_FML_StrHdl_Get(IMRT_Buffer_Data **Data_Ptr_Ptr, IMRT_Field *Field_Ptr, + IMRT_Buffer *Buffer_Ptr , size_t *len ) +{ + IMRT_Buffer_Data *data_ptr; + IMRT_Status status; + int retour; + FLDID32 FML_Field; + size_t sizeTmp; + char *func_name = "MM_FML_StrHdl_Get"; + + + + status = IMRS_OK; + retour = 0; + data_ptr = NULL; + sizeTmp = 0L; + + if (Data_Ptr_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Data_Ptr_Ptr NULL"); + } + else if (len == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("len pointer NULL"); + } + else if (Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer_Ptr NULL"); + } + else if (Field_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Field_Ptr NULL"); + } + else + /* Controle de validite du tag */ + if (strcmp(Field_Ptr->FML.Tag ,IMRD_FML_TAG_UNKNOWN) == 0) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Tag FML unknown"); + } + + if (status == IMRS_OK) + { + FML_Field = Fldid32( Field_Ptr->FML.Tag ); + + if ( FML_Field == BADFLDID ) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_1("Fldid32 %s BADFLDID error",Field_Ptr->FML.Tag ); + } + } + + if (status == IMRS_OK) + { + status = FML_Hdl_Field_Exist(Field_Ptr , Buffer_Ptr , FML_Field); + } + /* Le champ n'existe pas => on prend la valeur par defaut */ + if (status == IMRS_NO_IDENT) + { + sizeTmp = strlen(Field_Ptr->FML.Def_Val); + data_ptr = (IMRT_Buffer_Data *) malloc ( sizeTmp + 1); + if (data_ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Malloc error"); + } + else + { + memset( data_ptr, '\0', sizeTmp + 1 ); + memcpy(data_ptr , Field_Ptr->FML.Def_Val , sizeTmp ); + *(data_ptr + sizeTmp) = '\0'; + *Data_Ptr_Ptr = data_ptr; + status = IMRS_OK; + } + } + /* le champ existe => on extrait la valeur */ + else if (status == IMRS_OK) + { + /*data_ptr = (IMRT_Buffer_Data *) malloc ( (Field_Ptr->Fixed.Size + 1)); + memset( data_ptr, '\0', Field_Ptr->Fixed.Size + 1 );*/ + data_ptr = (IMRT_Buffer_Data *) malloc ( IMRD_FML_SIZE); + memset( data_ptr, '\0', IMRD_FML_SIZE ); + retour = (IMRT_Status)Fget32((FBFR32 *)Buffer_Ptr->Data_Buf_Ptr, + FML_Field, + (FLDOCC32 )0L, + (char *)data_ptr, + 0); + + + if (retour == -1) + { + IMRD_LM_LOG_ERROR_3("Fget32 failed with error [%s] Field (%d) [%s]" , Fstrerror32(Ferror32) , FML_Field, Fname32(FML_Field)); + status = IMRS_KO; + } + else + { + *Data_Ptr_Ptr = data_ptr; + sizeTmp = (size_t) strlen(data_ptr); + } + } + + if (status == IMRS_OK) + { + *len = sizeTmp; + } + + + return ( status ); +} + + +IMRT_Status IMR_MM_FML_StrHdl_Msg_Size ( size_t Msg_Size) +{ + IMRT_Status status; + char *func_name = "IMR_MM_FML_StrHdl_Msg_Size"; + + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_1 , "============================================================================") + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_1 , "Size msg demand : Begin"); + IMRD_LM_LOG_TRACE_1(IMRD_LOG_LEVEL_VERBOSE_1 , "Msg_Size : (%ld)" , Msg_Size); + + /* Erreur de referentiel */ + status = IMRS_KO; + IMRD_LM_LOG_WARNING_0("Referential error ; this should never happen"); + + + IMRD_LM_LOG_TRACE_1(IMRD_LOG_LEVEL_VERBOSE_2 , "Size msg demand : End with status : (%d)" , status); + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_2 , "============================================================================") + + return ( status ); +} + + +IMRT_Status IMR_MM_FML_StrHdl_Field_Exist( IMRT_Field *Field_Ptr ) +{ + IMRT_Status status; + FLDID32 FML_Field; + char *func_name = "IMR_MM_FML_StrHdl_Field_Exist"; + + status = IMRS_OK; + + if (Field_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Field_Ptr NULL"); + } + else + { + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_1 , "============================================================================") + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_1 , "Existing field demand : Begin"); + IMRD_LM_LOG_TRACE_1(IMRD_LOG_LEVEL_VERBOSE_1 , "Field Input name : [%s]" , Field_Ptr->Name); + + if (IMRG_FML_Buffer_Ident_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer pointer NULL"); + } + + if (status == IMRS_OK) + { + FML_Field = Fldid32( Field_Ptr->FML.Tag ); + } + + if ( FML_Field == BADFLDID ) + { + status = IMRS_NO_IDENT; + IMRD_LM_LOG_TRACE_1(IMRD_LOG_LEVEL_VERBOSE_1 , "Field [%s] BADFLDID error",Field_Ptr->FML.Tag ); + } + + if (status == IMRS_OK) + { + status = FML_Hdl_Field_Exist(Field_Ptr , IMRG_FML_Buffer_Ident_Ptr , FML_Field); + } + } + + IMRD_LM_LOG_TRACE_1(IMRD_LOG_LEVEL_VERBOSE_2 , "Existing field demand : End with status : (%d)" , status); + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_2 , "============================================================================") + + return ( status ); +} + +IMRT_Status IMR_MM_FML_StrHdl_Field_Value( IMRT_Field *Field_Ptr , IMRT_Field_Value_Id Value_Id ) +{ + IMRT_Buffer_Data *data_ptr; + IMRT_Status status; + size_t field_len; + char *func_name = "IMR_MM_FML_StrHdl_Field_Value"; + + status = IMRS_OK; + + if (Field_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Field_Ptr NULL"); + } + else + { + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_1 , "============================================================================") + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_1 , "Field Value demand : Begin"); + IMRD_LM_LOG_TRACE_2(IMRD_LOG_LEVEL_VERBOSE_1 , "Field Input name : [%s] Value Id : [%s]" , Field_Ptr->Name , Value_Id); + + field_len = 0L; + + if (IMRG_FML_Buffer_Ident_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer pointer NULL"); + } + else + { + status = MM_FML_StrHdl_Get(&data_ptr, Field_Ptr, IMRG_FML_Buffer_Ident_Ptr , &field_len ); + } + if (status == IMRS_OK) + { + IMRD_LM_LOG_TRACE_1(IMRD_LOG_LEVEL_VERBOSE_2 , "Value extracted : [%s]" , data_ptr); + if (strcmp(data_ptr, Value_Id) != 0) + { + status = IMRS_NO_IDENT; + } + free(data_ptr); + } + } + + IMRD_LM_LOG_TRACE_1(IMRD_LOG_LEVEL_VERBOSE_2 , "Field Value demand : End with status : (%d)" , status); + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_2 , "============================================================================") + + return ( status ); +} + +IMRT_Status MM_FML_StrHdl_Convert(IMRT_Buffer_Data **Data_Output_Ptr , IMRT_Buffer_Data *Data_Input_Ptr , IMRT_Field *Field_Ptr, + size_t *len , IMRT_StrHdl_Cnv_Func *Cnv_Func_Tab ) +{ + IMRT_Status status; + size_t size; + char *func_name = "MM_FML_StrHdl_Convert"; + + status = IMRS_OK; + + if (len == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("len pointer NULL"); + } + else if (Data_Output_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Data_Output_Ptr NULL"); + } + else + { + size = *len ; + *Data_Output_Ptr = (IMRT_Buffer_Data *)malloc(size + 1L); + if (*Data_Output_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("*Data_Output_Ptr NULL"); + } + else + { + memset( *Data_Output_Ptr, '\0' , (size + 1L) ); + } + + if (status == IMRS_OK) + { + if (Field_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Field_Ptr NULL"); + } + else + if (Data_Input_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Data_Input_Ptr NULL"); + } + else if (Cnv_Func_Tab == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Cnv_Func_Tab NULL"); + } + else + { + /* Appel de la fonction de convertion */ + if ((Field_Ptr->FML.Cnv_Ptr == NULL) || (Cnv_Func_Tab[Field_Ptr->FML.Cnv_Ptr->Id].Convert_Ptr == NULL)) + { + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_1 , "Pas de fonction de conversion"); + + if (Data_Input_Ptr != NULL) + memcpy(*Data_Output_Ptr,Data_Input_Ptr,*len); + } + else + { + status = Cnv_Func_Tab[Field_Ptr->FML.Cnv_Ptr->Id].Convert_Ptr(*Data_Output_Ptr, + Data_Input_Ptr, + len, + size , + Field_Ptr->FML.Cnv_Attr ); + } + + } + } + } + + if (Data_Input_Ptr != NULL) + free(Data_Input_Ptr); + + + return ( status ); + +} + +IMRT_Status MM_FML_StrHdl_Put(IMRT_Buffer_Data *Data_Ptr, IMRT_Field *Field_Ptr, + IMRT_Buffer *Buffer_Ptr , size_t len ) +{ + IMRT_Buffer_Data *data_buf_ptr; + FLDID32 FML_Field; + FLDLEN32 FML_maxlen; + IMRT_Status status; + int retour; + char *func_name = "MM_FML_StrHdl_Put"; + size_t longueur; + int FML_Field_Type; + + status = IMRS_OK; + retour = 0; + + if (Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer_Ptr NULL"); + } + else if (Field_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Field_Ptr NULL"); + } + else if (Data_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("data pointer NULL"); + } + else + /* Controle de validite du tag */ + if (strcmp(Field_Ptr->FML.Tag ,IMRD_FML_TAG_UNKNOWN) == 0) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Tag FML unknown"); + } + + if ((status == IMRS_OK) && (strcmp(Data_Ptr , "") == 0)) + status = IMRD_STATUS_NOTHING_TO_DO; + + if (status == IMRS_OK) + { + FML_maxlen = (FLDLEN32)0L; + FML_Field = Fldid32( Field_Ptr->FML.Tag ); + if ( FML_Field == BADFLDID ) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_1("Fldid32 %s BADFLDID error",Field_Ptr->FML.Tag ); + } + else + { + FML_Field_Type = Fldtype32(FML_Field); + if (FML_Field_Type == FLD_CARRAY) + { + longueur = len; + } + else + { + longueur = 0L; + } + + retour = Fadd32((FBFR32 *)Buffer_Ptr->Data_Buf_Ptr, + FML_Field, + (char *)Data_Ptr, + (FLDLEN32) longueur); + + if (retour == -1) + { + if (Ferror32 == FNOSPACE) + /* prevoir la realloc */ + { + IMRD_LM_LOG_ERROR_0("Ferror32 = FNOSPACE"); + } + else if (Ferror32 == FALIGNERR) + { + IMRD_LM_LOG_ERROR_0("Ferror32 = FALIGNERR"); + } + else if (Ferror32 == FNOTFLD) + { + IMRD_LM_LOG_ERROR_0("Ferror32 = FNOTFLD"); + } + else if (Ferror32 == FEINVAL) + { + IMRD_LM_LOG_ERROR_0("Ferror32 = FEINVAL"); + } + else if (Ferror32 == FBADFLD) + { + IMRD_LM_LOG_ERROR_0("Ferror32 = FBADFLD"); + } + status = IMRS_KO; + } + } + } + + if (status == IMRS_OK) + { + /* Mise a jour de la taille du buffer */ + Buffer_Ptr->Data_Buf_Len = (Buffer_Ptr->Data_Buf_Len) + Fsizeof32((FBFR32 *)Buffer_Ptr->Data_Buf_Ptr); + } + + if (status == IMRD_STATUS_NOTHING_TO_DO) + status = IMRS_OK; + + if (Data_Ptr != NULL) + free(Data_Ptr); + + + return ( status ); +} diff --git a/src/libmapping_mng/src/fmt_hdl_fml.h b/src/libmapping_mng/src/fmt_hdl_fml.h new file mode 100644 index 0000000..5716d28 --- /dev/null +++ b/src/libmapping_mng/src/fmt_hdl_fml.h @@ -0,0 +1,108 @@ +/*----------------------------------------------------------------------------*/ +/* File: fmt_hdl_xml.h */ +/*----------------------------------------------------------------------------*/ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#ifndef _FML_HANDLER_H_ +#define _FML_HANDLER_H_ + +#include "fml.h" +#include "fml32.h" +#include "atmi.h" +#include "field.tbls.h" +#include "userlog.h" + +/*----------------------------------------------------------------------------*/ +/* Global Include */ +/*----------------------------------------------------------------------------*/ + +#include "libmapping_mng.h" + +/*----------------------------------------------------------------------------*/ +/* Local definition */ +/*----------------------------------------------------------------------------*/ + +#ifdef _FML_HANDLER_C_ + + #define IMRD_FML_TYPE "FML32" + #define IMRD_FML_SIZE (FLDLEN32)10000L + #define IMRD_FML_MAX_FLD (FLDOCC32)50L + +#endif + +/*----------------------------------------------------------------------------*/ +/* Global Variables */ +/*----------------------------------------------------------------------------*/ + +#ifdef _FML_HANDLER_C_ + + IMRT_Buffer *IMRG_FML_Buffer_Ident_Ptr; + +#endif + +/*----------------------------------------------------------------------------*/ +/* Prototypes */ +/*----------------------------------------------------------------------------*/ + +#ifdef _FML_HANDLER_C_ + + IMRT_Status MM_FML_StrHdl_Init ( void ); + IMRT_Status MM_FML_StrHdl_DeInit ( void ); + IMRT_Status FML_Hdl_DataBuf_Alloc ( IMRT_Buffer * ); + IMRT_Status MM_FML_StrHdl_Data_Free ( IMRT_Buffer * ); + IMRT_Status FML_Hdl_Format_Ident ( IMRT_Buffer * ); + IMRT_Status MM_FML_StrHdl_Ident ( IMRT_Msg_Id * , IMRT_Buffer * ); + IMRT_Status MM_FML_StrHdl_Open ( IMRT_Buffer * ); + IMRT_Status MM_FML_StrHdl_Close ( IMRT_Buffer * ); + IMRT_Status MM_FML_StrHdl_Flush ( IMRT_Buffer * ); + IMRT_Status MM_FML_StrHdl_Data_List ( IMRT_Buffer * ); + IMRT_Status MM_FML_StrHdl_Copy ( IMRT_Buffer * , IMRT_Buffer * ); + IMRT_Status FML_Hdl_Field_Exist ( IMRT_Field * , IMRT_Buffer * , FLDID32 ); + IMRT_Status MM_FML_StrHdl_Get (IMRT_Buffer_Data ** , IMRT_Field * , IMRT_Buffer * , size_t * ); + IMRT_Status MM_FML_StrHdl_Convert (IMRT_Buffer_Data ** , IMRT_Buffer_Data * , IMRT_Field * , size_t *, IMRT_StrHdl_Cnv_Func * ); + IMRT_Status MM_FML_StrHdl_Put (IMRT_Buffer_Data * , IMRT_Field * , IMRT_Buffer * , size_t ); + IMRT_Status IMR_MM_FML_StrHdl_Field_Value ( IMRT_Field * , IMRT_Field_Value_Id); + IMRT_Status IMR_MM_FML_StrHdl_Field_Exist ( IMRT_Field * ); + IMRT_Status IMR_MM_FML_StrHdl_Msg_Size ( size_t ); + +#else + + extern IMRT_Status MM_FML_StrHdl_Init ( void ); + extern IMRT_Status MM_FML_StrHdl_DeInit ( void ); + extern IMRT_Status MM_FML_StrHdl_Data_Free ( IMRT_Buffer * ); + extern IMRT_Status MM_FML_StrHdl_Ident ( IMRT_Msg_Id * , IMRT_Buffer * ); + extern IMRT_Status MM_FML_StrHdl_Open ( IMRT_Buffer * ); + extern IMRT_Status MM_FML_StrHdl_Close ( IMRT_Buffer * ); + extern IMRT_Status MM_FML_StrHdl_Flush ( IMRT_Buffer * ); + extern IMRT_Status MM_FML_StrHdl_Data_List ( IMRT_Buffer * ); + extern IMRT_Status MM_FML_StrHdl_Copy ( IMRT_Buffer * , IMRT_Buffer * ); + extern IMRT_Status MM_FML_StrHdl_Get (IMRT_Buffer_Data ** , IMRT_Field * , IMRT_Buffer * , size_t * ); + extern IMRT_Status MM_FML_StrHdl_Convert (IMRT_Buffer_Data ** , IMRT_Buffer_Data * , IMRT_Field * , size_t *, IMRT_StrHdl_Cnv_Func * ); + extern IMRT_Status MM_FML_StrHdl_Put (IMRT_Buffer_Data * , IMRT_Field * , IMRT_Buffer * , size_t ); + +#endif + +#endif diff --git a/src/libmapping_mng/src/fmt_hdl_xml.c b/src/libmapping_mng/src/fmt_hdl_xml.c new file mode 100644 index 0000000..7240df3 --- /dev/null +++ b/src/libmapping_mng/src/fmt_hdl_xml.c @@ -0,0 +1,1260 @@ +/*----------------------------------------------------------------------------*/ +/* File: fmt_hdl_.c */ +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#define _LIBMAPPING_MNG_ +#define _XML_HANDLER_C_ + +#include "fmt_hdl_xml.h" + +IMRT_Status MM_XML_StrHdl_Init() +{ + IMRG_XML_Buffer_Ident_Ptr = NULL; + return (IMRS_OK); +} + +IMRT_Status MM_XML_StrHdl_DeInit() +{ + + return (IMRS_OK); +} + +IMRT_Status XML_Hdl_DataTemp_Alloc( IMRT_Buffer *Buffer_Ptr ) +{ + xmlDocPtr xml_doc_ptr=NULL; + IMRT_Status status; + char *func_name = "XML_Hdl_DataTemp_Alloc"; + + + status = IMRS_OK; + + if (Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer pointer NULL" ); + } + else + if (Buffer_Ptr->Data_Tmp_Ptr == NULL) + { + if ( Buffer_Ptr->Status == IMRD_BUFFER_STATUS_ALLOCATED) + { + xml_doc_ptr = xmlParseMemory( (char *) Buffer_Ptr->Data_Buf_Ptr, Buffer_Ptr->Data_Buf_Size); + } + else + { + xml_doc_ptr = xmlNewDoc ((xmlChar *) IMRD_XML_VERSION); + } + if ( xml_doc_ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Pointer xml_doc_ptr NULL"); + } + else + { + Buffer_Ptr->Data_Tmp_Ptr = (IMRT_Buffer_Data *) xml_doc_ptr; + Buffer_Ptr->Data_Tmp_Changed = IMRD_FALSE; + } + } + + return ( status ); +} + +IMRT_Status XML_Hdl_DataTemp_Free( IMRT_Buffer *Buffer_Ptr ) +{ + IMRT_Status status; + char *func_name = "XML_Hdl_DataTemp_Free"; + + + status = IMRS_OK; + if (Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer pointer NULL" ); + } + else + if (Buffer_Ptr->Data_Tmp_Ptr != NULL) + { + xmlFreeDoc( (xmlDocPtr) Buffer_Ptr->Data_Tmp_Ptr); + xmlCleanupParser(); + Buffer_Ptr->Data_Tmp_Ptr = NULL; + Buffer_Ptr->Data_Tmp_Changed = IMRD_FALSE; + } + + return ( status ); +} + +IMRT_Status XML_Hdl_DataBuf_Free( IMRT_Buffer *Buffer_Ptr ) +{ + IMRT_Status status; + char *func_name = "XML_Hdl_DataBuf_Free"; + + + status = IMRS_OK; + if (Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer pointer NULL" ); + } + else + if (Buffer_Ptr->Status == IMRD_BUFFER_STATUS_ALLOCATED) + { + xmlFree(Buffer_Ptr->Data_Buf_Ptr); + Buffer_Ptr->Data_Buf_Ptr = NULL; + Buffer_Ptr->Status = IMRD_BUFFER_STATUS_FREED; + Buffer_Ptr->Data_Buf_Size = 0; + Buffer_Ptr->Data_Buf_Len = 0; + } + + return ( status ); +} + +IMRT_Status MM_XML_StrHdl_Data_Free( IMRT_Buffer *Buffer_Ptr) +{ + IMRT_Status status; + char *func_name = "MM_XML_StrHdl_Data_Free"; + + + status = IMRS_OK; + + if (Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer pointer NULL" ); + } + else + { + if ( XML_Hdl_DataBuf_Free( Buffer_Ptr ) != IMRS_OK ) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Error XML_Hdl_DataBuf_Free"); + + } + if ( XML_Hdl_DataTemp_Free( Buffer_Ptr ) != IMRS_OK ) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Error XML_Hdl_DataTemp_Free"); + } + } + + + return ( status ); +} + +IMRT_Status XML_Hdl_Format_Ident( IMRT_Buffer *Buffer_Ptr ) +{ + IMRT_Status status; + char *func_name = "XML_Hdl_Format_Ident"; + + + status = IMRS_KO; + if (Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer pointer NULL" ); + } + else + if (Buffer_Ptr->Status != IMRD_BUFFER_STATUS_ALLOCATED) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer not allocated"); + } + else + { + if (*Buffer_Ptr->Data_Buf_Ptr == (IMRT_Buffer_Data) '<') + { + status = IMRS_OK; + } + } + + + return ( status ); +} + +IMRT_Status MM_XML_StrHdl_Ident( IMRT_Msg_Id *Msg_Id_Ident_Ptr, + IMRT_Buffer *Buffer_Ptr ) +{ + + IMRT_Fmt_Id Format; + IMRT_Status status; + IMRT_Msg_Id *Msg_Id_Tmp; + char *func_name = "MM_XML_StrHdl_Ident"; + + status = IMRS_OK; + + if (Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer pointer NULL" ); + } + else + if (Msg_Id_Ident_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Msg_Id_Ident_Ptr NULL" ); + } + else + { + Format = Buffer_Ptr->Fmt_Id; + Msg_Id_Tmp = Msg_Id_Ident_Ptr; + + IMRG_XML_Buffer_Ident_Ptr = Buffer_Ptr; + /* Le Msg_Id transmis au SDM est le point de depart de l'identification */ + /* C'est egalement le resultat qui sera inclus dans le buffer */ + status = IMR_SDM_MsgIdent_Proceed(Format, + Msg_Id_Tmp, + IMR_MM_XML_StrHdl_Field_Value, + IMR_MM_XML_StrHdl_Field_Exist, + IMR_MM_XML_StrHdl_Msg_Size); + IMRG_XML_Buffer_Ident_Ptr = NULL; + + Msg_Id_Ident_Ptr = Msg_Id_Tmp; + } + + + return ( status ); + +} + +IMRT_Status MM_XML_StrHdl_Open( IMRT_Buffer *Buffer_Ptr) +{ + IMRT_Msg_Id type_temp; + IMRT_Status status; + char *func_name = "MM_XML_StrHdl_Open"; + + + status = IMRS_OK; + + if (Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer pointer NULL" ); + } + else + if (Buffer_Ptr->Data_Tmp_Ptr != NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Pointer Data_Tmp_Ptr NULL"); + } + else + { + type_temp = Buffer_Ptr->Msg_Id; + /* absence de donnees */ + if (Buffer_Ptr->Status != IMRD_BUFFER_STATUS_ALLOCATED) + { + /* Cas d'open du buffer en ecriture */ + /* le type du message est passe */ + /* par le SDM : il doit donc etre connu */ + if (type_temp == IMRD_MSG_ID_UNKNOWN) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Msg Id unknown"); + } + else + { + status = XML_Hdl_DataTemp_Alloc( Buffer_Ptr ); + Buffer_Ptr->Data_Tmp_Changed = IMRD_TRUE; + } + } + else + { + /* controle du format */ + status = XML_Hdl_Format_Ident( Buffer_Ptr ); + if (status != IMRS_OK) + status = IMRS_BAD_FORMAT; + else + /* acces aux donnees */ + status = XML_Hdl_DataTemp_Alloc( Buffer_Ptr ); + } + } + + return ( status ); +} + +IMRT_Status MM_XML_StrHdl_Close( IMRT_Buffer *Buffer_Ptr) +{ + IMRT_Status status; + char *func_name = "MM_XML_StrHdl_Close"; + + status = IMRS_OK; + + if (Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer pointer NULL" ); + } + else + { + status = MM_XML_StrHdl_Flush( Buffer_Ptr ); + if ((status == IMRS_OK) && (Buffer_Ptr->Data_Tmp_Ptr != NULL)) + { + status = XML_Hdl_DataTemp_Free( Buffer_Ptr ); + } + } + + return ( status ); +} + +IMRT_Status MM_XML_StrHdl_Flush( IMRT_Buffer *Buffer_Ptr) +{ + xmlChar *mem_Ptr; + int size; + IMRT_Status status; + char *func_name = "MM_XML_StrHdl_Flush"; + + + status = IMRS_OK; + if (Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer pointer NULL" ); + } + else + if ((Buffer_Ptr->Data_Tmp_Ptr != NULL) && (Buffer_Ptr->Data_Tmp_Changed == IMRD_TRUE)) + { + if ( Buffer_Ptr->Status == IMRD_BUFFER_STATUS_ALLOCATED ) + { + status = XML_Hdl_DataBuf_Free( Buffer_Ptr ); + } + + if ( status == IMRS_OK ) + { + + /* Dump an XML document in memory and return the #xmlChar * and it's size in bytes. + It's up to the caller to free the memory with xmlFree(). + The resulting byte array is zero terminated, though the last 0 is not included + in the returned size. */ + xmlDocDumpFormatMemory( (xmlDocPtr) Buffer_Ptr->Data_Tmp_Ptr, &mem_Ptr, &size, + ( ( IMRG_MM_Base.Config.XML_Format == IMRD_TRUE) ? 1 : 0)); + + if (mem_Ptr != NULL) + { + Buffer_Ptr->Data_Buf_Ptr = (IMRT_Buffer_Data *) mem_Ptr; + Buffer_Ptr->Status = IMRD_BUFFER_STATUS_ALLOCATED; + Buffer_Ptr->Data_Buf_Size = size + 1; + Buffer_Ptr->Data_Buf_Len = size; + Buffer_Ptr->Data_Tmp_Changed = IMRD_FALSE; + } + else + { + status == IMRS_KO; + IMRD_LM_LOG_ERROR_0("Pointer mem_Ptr = NULL after xmlDocDumpMemory"); + } + } + } + + + return ( status ); +} + +IMRT_Status MM_XML_StrHdl_Data_List( IMRT_Buffer *Buffer_Ptr) +{ + + if (Buffer_Ptr == NULL) + { + IMRD_LM_LOG_WARNING_0("Buffer pointer NULL" ); + } + else + { + IMRD_LM_LOG_TRACE_3( IMRD_LOG_LEVEL_VERBOSE_1, "Buffer_List: Data_Buf_Ptr_Size: (%d) Data_Buf_Ptr_Len: (%d) Data_Buf_Ptr: (0x%X)", Buffer_Ptr->Data_Buf_Size, Buffer_Ptr->Data_Buf_Len, Buffer_Ptr->Data_Buf_Ptr); + IMRD_LM_LOG_TRACE_1( IMRD_LOG_LEVEL_VERBOSE_2, "Buffer_List: Data_Buf: [%s]", Buffer_Ptr->Data_Buf_Ptr); + + IMRD_LM_LOG_TRACE_2( IMRD_LOG_LEVEL_VERBOSE_1, "Buffer_List: Data_Tmp_Changed: (%d) Data_Tmp_Ptr: (0x%X)", Buffer_Ptr->Data_Tmp_Changed, Buffer_Ptr->Data_Tmp_Ptr); + + if (Buffer_Ptr->Data_Tmp_Ptr != NULL) + { + IMRD_LM_EXEC_TRACE( IMRD_LOG_LEVEL_VERBOSE_2, "Buffer_List: Data_Tmp: [", xmlDocFormatDump( IMRD_LM_STREAM_OUT, (xmlDocPtr) Buffer_Ptr->Data_Tmp_Ptr, 1), "]"); + } + } + + return ( IMRS_OK); +} + + + +IMRT_Status MM_XML_StrHdl_Copy( IMRT_Buffer *Output_Buffer_Ptr, IMRT_Buffer *Input_Buffer_Ptr ) +{ + IMRT_Status status; + char *func_name = "MM_XML_StrHdl_Copy"; + + + status = IMRS_OK; + + if (Input_Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Input buffer pointer NULL" ); + } + else + if (Output_Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Output buffer pointer NULL" ); + } + else + /* controle donnees dans Input_Buffer */ + if (Input_Buffer_Ptr->Status != IMRD_BUFFER_STATUS_ALLOCATED) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer input not allocated"); + } + /* le buffer destinataire ne doit pas comporter de donnees */ + else if ( ( Output_Buffer_Ptr->Status == IMRD_BUFFER_STATUS_ALLOCATED) || + ( Output_Buffer_Ptr->Data_Tmp_Ptr != NULL) ) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer output not allocated or Data_Tmp_Ptr no NULL"); + } + else + { + Output_Buffer_Ptr->Data_Buf_Ptr = (IMRT_Buffer_Data *) malloc ( Input_Buffer_Ptr->Data_Buf_Size ); + if (Output_Buffer_Ptr->Data_Buf_Ptr != NULL) + { + memcpy( Output_Buffer_Ptr->Data_Buf_Ptr, + Input_Buffer_Ptr->Data_Buf_Ptr, + Input_Buffer_Ptr->Data_Buf_Size); + Output_Buffer_Ptr->Status = IMRD_BUFFER_STATUS_ALLOCATED; + Output_Buffer_Ptr->Data_Buf_Size = Input_Buffer_Ptr->Data_Buf_Size; + Output_Buffer_Ptr->Data_Buf_Len = Input_Buffer_Ptr->Data_Buf_Len; + } + else + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Pointer Data_Buf_Ptr of output buffer is NULL"); + } + } + + + return ( status ); +} + +IMRT_Status XML_Hdl_Field_Exist(IMRT_Field *Field_Ptr , IMRT_Buffer *Buffer_Ptr) +{ + IMRT_Status status; + xmlXPathContextPtr context; + xmlNodeSetPtr nodeset; + xmlXPathObjectPtr result; + xmlDocPtr xml_doc_ptr; + xmlChar *xpath; + + char *func_name = "XML_Hdl_Field_Exist"; + + + status = IMRS_OK; + + if (Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer pointer NULL" ); + } + else + if (Field_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Field pointer NULL" ); + } + else + if (Buffer_Ptr->Data_Tmp_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Data_Tmp_Ptr of buffer is NULL"); + } + else + { + xml_doc_ptr = (xmlDocPtr) Buffer_Ptr->Data_Tmp_Ptr; + xpath = (xmlChar *) Field_Ptr->XML.Tag; + context = xmlXPathNewContext(xml_doc_ptr); + result = xmlXPathEvalExpression(xpath, context); + if (result == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("XPath eval expression pointer NULL" ); + } + else + { + + if(xmlXPathNodeSetIsEmpty(result->nodesetval)) + { + status = IMRS_NO_IDENT; + } + else + { + nodeset = result->nodesetval; + + if (nodeset->nodeNr != 1) + { + status = IMRS_NO_IDENT; + IMRD_LM_LOG_TRACE_1(IMRD_LOG_LEVEL_VERBOSE_1 , "number of occurences not equal to one for %s",Field_Ptr->Name); + } + } + xmlXPathFreeContext(context); + xmlXPathFreeObject(result); + } + } + + + + + return ( status ); + +} + + +IMRT_Status MM_XML_StrHdl_Get(IMRT_Buffer_Data **Data_Ptr_Ptr, IMRT_Field *Field_Ptr, + IMRT_Buffer *Buffer_Ptr , size_t *len ) +{ + IMRT_Buffer_Data *data_ptr; + int sizeTmp; + xmlXPathContextPtr context; + xmlXPathObjectPtr result; + xmlNodeSetPtr nodeset; + xmlDocPtr xml_doc_ptr; + xmlChar *xpath, + *xml_data_ptr; + IMRT_Status status; + char *func_name = "MM_XML_StrHdl_Get"; + + + status = IMRS_OK; + *Data_Ptr_Ptr = NULL; + data_ptr = NULL; + sizeTmp = 0; + + if (Data_Ptr_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Data_Ptr_Ptr NULL"); + } + else if (len == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("len pointer NULL"); + } + else if (Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer_Ptr NULL"); + } + else if (Field_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Field_Ptr NULL"); + } + + /* Controle de validite du tag */ + if ((status == IMRS_OK) && (strcmp(Field_Ptr->XML.Tag ,IMRD_XML_TAG_UNKNOWN) == 0)) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Tag XML unknown"); + } + + /* controle donnees dans le buffer */ + if ((status == IMRS_OK) && (Buffer_Ptr->Data_Tmp_Ptr == NULL)) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Data_Tmp_Ptr of buffer is NULL"); + } + else + { + xml_doc_ptr = (xmlDocPtr) Buffer_Ptr->Data_Tmp_Ptr; + xpath = (xmlChar *) Field_Ptr->XML.Tag; + context = xmlXPathNewContext(xml_doc_ptr); + result = xmlXPathEvalExpression(xpath, context); + if (result == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("XPath eval expression pointer NULL" ); + } + else if(xmlXPathNodeSetIsEmpty(result->nodesetval)) + { + status = IMRS_NO_IDENT; + } + xmlXPathFreeContext(context); + } + + + + /* le champ existe => on extrait la valeur */ + if (status == IMRS_OK) + { + nodeset = result->nodesetval; + /* nombre d'occurences */ + if (nodeset->nodeNr != 1) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_1("number of occurences not equal to one for %s",Field_Ptr->Name); + } + else + { + xml_data_ptr = xmlNodeListGetString(xml_doc_ptr, nodeset->nodeTab[0]->xmlChildrenNode, 1); + if (xml_data_ptr == NULL) + { + status = IMRS_NO_IDENT; + } + else + { + + sizeTmp = strlen((char *)xml_data_ptr) + 1; + +// IMRD_LM_LOG_TRACE_2( IMRD_LOG_LEVEL_VERBOSE_1, "[%s] (%d)", xml_data_ptr, sizeTmp); + + if( ( *Data_Ptr_Ptr = (IMRT_Buffer_Data *)malloc( sizeTmp)) == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0 ( "Can't allocate memory..."); + } + else + { + UTF8Toisolat1( (unsigned char *)*Data_Ptr_Ptr, &sizeTmp, xml_data_ptr, &sizeTmp); + +// IMRD_LM_LOG_TRACE_3( IMRD_LOG_LEVEL_VERBOSE_1, "[%s] (%d) (%d)", xml_data_ptr, sizeTmp, strlen( *Data_Ptr_Ptr)); + + sizeTmp = strlen( *Data_Ptr_Ptr); + } + + xmlFree( xml_data_ptr); + } + } + + } + + /* Le champ n'existe pas => on prend la valeur par defaut */ + if (status == IMRS_NO_IDENT) + { + sizeTmp = strlen(Field_Ptr->XML.Def_Val); + data_ptr = (IMRT_Buffer_Data *) malloc ( sizeTmp + 1); + if (data_ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Malloc error on data_ptr"); + } + else + { + memset( data_ptr, '\0', sizeTmp + 1 ); + memcpy(data_ptr , Field_Ptr->XML.Def_Val , sizeTmp ); + *(data_ptr + sizeTmp) = '\0'; + *Data_Ptr_Ptr = data_ptr; + status = IMRS_OK; + } + } + + if (status == IMRS_OK) + { + *len = sizeTmp; + } + + if(result != NULL) + xmlXPathFreeObject(result); + + return ( status ); +} + + +IMRT_Status IMR_MM_XML_StrHdl_Msg_Size ( size_t Msg_Size) +{ + IMRT_Status status; + char *func_name = "IMR_MM_XML_StrHdl_Msg_Size"; + + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_1 , "============================================================================") + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_1 , "Size msg demand : Begin"); + IMRD_LM_LOG_TRACE_1(IMRD_LOG_LEVEL_VERBOSE_1 , "Msg_Size : (%ld)" , Msg_Size); + + /* Erreur de referentiel */ + status = IMRS_KO; + IMRD_LM_LOG_WARNING_0("Referential error ; this should never happen"); + + IMRD_LM_LOG_TRACE_1(IMRD_LOG_LEVEL_VERBOSE_2 , "Size msg demand : End with status : (%d)" , status); + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_2 , "============================================================================") + + return ( status ); +} + + +IMRT_Status IMR_MM_XML_StrHdl_Field_Exist( IMRT_Field *Field_Ptr ) +{ + IMRT_Status status; + char *func_name = "IMR_MM_XML_StrHdl_Field_Exist"; + + status = IMRS_OK; + + if (Field_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Field_Ptr NULL"); + } + else + { + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_1 , "============================================================================") + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_1 , "Existing field demand : Begin"); + IMRD_LM_LOG_TRACE_1(IMRD_LOG_LEVEL_VERBOSE_1 , "Field Input name : [%s]" , Field_Ptr->Name); + + if (IMRG_XML_Buffer_Ident_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer pointer NULL"); + } + else + { + status = XML_Hdl_Field_Exist( Field_Ptr, IMRG_XML_Buffer_Ident_Ptr); + } + } + + IMRD_LM_LOG_TRACE_1(IMRD_LOG_LEVEL_VERBOSE_2 , "Existing field demand : End with status : (%d)" , status); + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_2 , "============================================================================") + + return ( status ); +} + +IMRT_Status IMR_MM_XML_StrHdl_Field_Value( IMRT_Field *Field_Ptr , IMRT_Field_Value_Id Value_Id ) +{ + IMRT_Buffer_Data *data_ptr; + IMRT_Status status; + size_t field_len; + char *func_name = "IMR_MM_XML_StrHdl_Field_Value"; + + status = IMRS_OK; + + if (Field_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Field_Ptr NULL"); + } + else + { + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_1 , "============================================================================") + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_1 , "Field Value demand : Begin"); + IMRD_LM_LOG_TRACE_2(IMRD_LOG_LEVEL_VERBOSE_1 , "Field Input name : [%s] Value Id : [%s]" , Field_Ptr->Name , Value_Id); + + field_len = 0L; + + if (IMRG_XML_Buffer_Ident_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer pointer NULL"); + } + else + { + status = MM_XML_StrHdl_Get(&data_ptr, Field_Ptr, IMRG_XML_Buffer_Ident_Ptr , &field_len ); + } + + if (status == IMRS_OK) + { + IMRD_LM_LOG_TRACE_1(IMRD_LOG_LEVEL_VERBOSE_2 , "Value extracted : [%s]" , data_ptr); + if (strcmp(data_ptr, Value_Id) != 0) + { + status = IMRS_NO_IDENT; + } + free(data_ptr); + } + } + + IMRD_LM_LOG_TRACE_1(IMRD_LOG_LEVEL_VERBOSE_2 , "Field Value demand : End with status : (%d)" , status); + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_2 , "============================================================================") + + return ( status ); +} + +IMRT_Status MM_XML_StrHdl_Convert(IMRT_Buffer_Data **Data_Output_Ptr , IMRT_Buffer_Data *Data_Input_Ptr , IMRT_Field *Field_Ptr, + size_t *len , IMRT_StrHdl_Cnv_Func *Cnv_Func_Tab ) +{ + IMRT_Status status; + size_t size; + char *func_name = "MM_XML_StrHdl_Convert"; + + + + + status = IMRS_OK; + + if (len == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("len pointer NULL"); + } + else if (Data_Output_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Data_Output_Ptr NULL"); + } + else if (Cnv_Func_Tab == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Cnv_Func_Tab NULL"); + } + else + { + size = *len ; + + *Data_Output_Ptr = (IMRT_Buffer_Data *)malloc(size + 1L); + if (*Data_Output_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("*Data_Output_Ptr NULL"); + } + else + { + memset( *Data_Output_Ptr, '\0' , (size + 1L) ); + + if (Field_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Field_Ptr NULL"); + } + else + if (Data_Input_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Data_Input_Ptr NULL"); + } + else + { + /* Appel de la fonction de convertion */ + if ((Field_Ptr->XML.Cnv_Ptr == NULL) || (Cnv_Func_Tab[Field_Ptr->XML.Cnv_Ptr->Id].Convert_Ptr == NULL)) + { + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_1 , "Pas de fonction de conversion"); + + if (Data_Input_Ptr != NULL) + memcpy(*Data_Output_Ptr,Data_Input_Ptr,*len); + } + else + { + status = Cnv_Func_Tab[Field_Ptr->XML.Cnv_Ptr->Id].Convert_Ptr(*Data_Output_Ptr, + Data_Input_Ptr, + len, + size , + Field_Ptr->XML.Cnv_Attr ); + } + } + } + } + + if (Data_Input_Ptr != NULL) + free(Data_Input_Ptr); + + + return ( status ); + +} + +IMRT_Status MM_XML_DInit_StructPath(IMRT_PARSE_PATH_XML * Parse_PathStruct_Ptr) +{ + int indexe = 0; + IMRT_Status status = IMRS_OK; + + if(Parse_PathStruct_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Parse_PathStruct_Ptr NULL"); + } + else + { + if(Parse_PathStruct_Ptr->Father_Table != NULL) + { + for(indexe=0; indexe < Parse_PathStruct_Ptr->Nb_Father; indexe++) + { + if(Parse_PathStruct_Ptr->Father_Table[indexe] != NULL) + { + free(Parse_PathStruct_Ptr->Father_Table[indexe]); + } + } + free(Parse_PathStruct_Ptr->Father_Table); + } + Parse_PathStruct_Ptr->Nb_Father = 0; + } + return(status); +} + +IMRT_Status MM_XML_Proceed_Path( IMRT_PARSE_PATH_XML * PathXml_Ptr, IMRT_Buffer_Data * value, xmlDocPtr xml_doc_ptr) +{ + xmlNodePtr xml_cur_node_ptr; + xmlNodePtr root_node_ptr; + xmlNodePtr xml_node1_ptr; + xmlNodePtr xml_father_node_ptr; + xmlNodePtr xml_brother_node_ptr; + xmlAttrPtr Attribute_Ptr; + + int indexe = 0; + IMRT_Status status; + + + status = IMRS_OK; + + if (PathXml_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("PathXml_Ptr NULL"); + } + else if (value == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("value NULL"); + } + else + if (xml_doc_ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("xml_doc_ptr NULL"); + } + else + { + + xml_cur_node_ptr = xmlDocGetRootElement(xml_doc_ptr); + + for(indexe = 0; indexe < PathXml_Ptr->Nb_Father; indexe++) + { + + while( ( xml_cur_node_ptr != NULL) && + (strcmp((const char*)xml_cur_node_ptr->name , + (const char*)PathXml_Ptr->Father_Table[indexe]) != 0) + ) + { + xml_brother_node_ptr = xml_cur_node_ptr; + xml_cur_node_ptr = xml_cur_node_ptr->next; + + } + + if(xml_cur_node_ptr == NULL) + { + /*il faut creer le root**/ + if(indexe == IMRD_FIRST_NODE ) + { + xml_father_node_ptr = xmlNewNode ( NULL, (const xmlChar *) PathXml_Ptr->Father_Table[indexe]); + if(xml_father_node_ptr != NULL) + { + xmlDocSetRootElement( xml_doc_ptr, xml_father_node_ptr ); + xml_cur_node_ptr = xml_father_node_ptr; + } + else + { + /*echec de la creation du nouveau noeud on sort*/ + status = IMRS_KO; + break; + } + } + else /*il faut creer un fils*/ + { + xml_cur_node_ptr = xmlNewChild( xml_father_node_ptr, NULL, (const xmlChar *) (const xmlChar *) PathXml_Ptr->Father_Table[indexe], NULL); + if(xml_cur_node_ptr != NULL) + { + xml_father_node_ptr= xml_cur_node_ptr; + + } + else + { + /*echec de la creation du nouveau noeud on sort*/ + status = IMRS_KO; + break; + } + } + } + else + { + xml_father_node_ptr = xml_cur_node_ptr; + xml_cur_node_ptr = xml_cur_node_ptr->xmlChildrenNode; + + } + } + /*Tout les pere existaient ou on ete crees*/ + /*creation d'un fils (feuille et insertion de sa valeur*/ + /*le pere vien d'être cree c'est le noeud courant*/ + /*si le mode est egale à 0 alors on est mode creation + le neoud pere vient d'être cree c'est le noeud courant*/ + xml_cur_node_ptr = xmlNewChild( xml_father_node_ptr, NULL, (const xmlChar *) PathXml_Ptr->Soon_Name, NULL); + if(xml_cur_node_ptr != NULL) + { + xml_node1_ptr = xmlNewText( (const xmlChar *) value ); + + if( PathXml_Ptr->Attribute_present == IMRS_OK ) + { + Attribute_Ptr = xmlNewProp(xml_cur_node_ptr,(const xmlChar *)PathXml_Ptr->Attribute_Name,(const xmlChar *)PathXml_Ptr->Attribute_Value); + } + + xmlAddChild(xml_cur_node_ptr,xml_node1_ptr); + } + else + { + status = IMRS_KO; + } + } + + + return(status); +} + +IMRT_Status MM_XML_SplitAttribute( IMRT_PARSE_PATH_XML * PathXml_Ptr ) +{ + char * pos_deb_attribute_ptr = NULL; + char * pos_fin_attribute_ptr = NULL; + size_t len_attribute_value; + static const char SEP_XPATH_DEB [] = "["; + static const char SEP_XPATH_FIN [] = "]"; + static const char SEP_ATTRIBUTE [] = "@"; + IMRT_Status status; + + + if (PathXml_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("PathXml_Ptr NULL"); + } + else + { + memset(PathXml_Ptr->Attribute_Name, '\0',sizeof(PathXml_Ptr->Attribute_Name)); + memset(PathXml_Ptr->Attribute_Value, '\0',sizeof(PathXml_Ptr->Attribute_Value)); + len_attribute_value = 0; + status = IMRS_OK; + + pos_deb_attribute_ptr = strstr((const char*)PathXml_Ptr->Soon_Name,SEP_XPATH_DEB); + pos_fin_attribute_ptr = strstr((const char*)PathXml_Ptr->Soon_Name,SEP_XPATH_FIN); + PathXml_Ptr->Attribute_present = IMRS_KO; + + + if( (pos_deb_attribute_ptr != NULL) && (pos_fin_attribute_ptr != NULL) ) + { + + + if(PathXml_Ptr->Soon_Name[(pos_deb_attribute_ptr -PathXml_Ptr->Soon_Name)+1 ] == '@') + { + /*on se positionne sur le debut de l'occurence*/ + pos_deb_attribute_ptr = pos_deb_attribute_ptr +2; + + pos_fin_attribute_ptr = strstr(PathXml_Ptr->Soon_Name,"="); + strncpy(PathXml_Ptr->Attribute_Name,pos_deb_attribute_ptr,(pos_fin_attribute_ptr - pos_deb_attribute_ptr)); + PathXml_Ptr->Attribute_Name[(pos_fin_attribute_ptr - pos_deb_attribute_ptr)] = '\0'; + + /*on se positionne au debut de la valeur*/ + pos_deb_attribute_ptr = pos_fin_attribute_ptr+1; + + len_attribute_value = (size_t) ( (PathXml_Ptr->Soon_Name + strlen(PathXml_Ptr->Soon_Name)) - pos_deb_attribute_ptr ) -3; + strncpy(PathXml_Ptr->Attribute_Value,pos_deb_attribute_ptr+1,len_attribute_value); + PathXml_Ptr->Attribute_present = IMRS_OK ; + } + + pos_deb_attribute_ptr = strstr((const char*)PathXml_Ptr->Soon_Name,SEP_XPATH_DEB); + PathXml_Ptr->Soon_Name[(pos_deb_attribute_ptr - PathXml_Ptr->Soon_Name)] = '\0'; + } + } + + return(status); +} + +IMRT_Status MM_XML_Split_Path( IMRT_Buffer_Data * Chaine_Ptr , IMRT_PARSE_PATH_XML * PathXml_Ptr ) +{ + int indexe = 0; + size_t len =0; + const char SEP_XML [] = "/"; + char * sep_position_prec = NULL; + char * sep_position_suiv = NULL; + char SEP_XML_CHAR = '/'; + IMRT_Status status; + +/*initialisation */ + + + if( Chaine_Ptr == NULL) + { + IMRD_LM_LOG_ERROR_0("Le pointeur chaine a traiter est NULL"); + status = IMRS_KO; + } + else + if( PathXml_Ptr == NULL) + { + IMRD_LM_LOG_ERROR_0("PathXml_Ptr NULL"); + status = IMRS_KO; + } + else + { + PathXml_Ptr->Father_Table = NULL; + memset(PathXml_Ptr->Soon_Name, '\0', sizeof(PathXml_Ptr->Soon_Name)); + PathXml_Ptr->Nb_Father = 0; + len = strlen(Chaine_Ptr); + status = IMRS_OK; + + /*calcul du nombre de pere */ + for( indexe=0; indexe Nb_Father++; + } + } + /*si la chaîne commence par un / on en tien pas compte*/ + if(Chaine_Ptr[0] == SEP_XML_CHAR) + { + sep_position_suiv = Chaine_Ptr +1; + sep_position_prec = Chaine_Ptr +1; + PathXml_Ptr->Nb_Father = PathXml_Ptr->Nb_Father -1; + } + else + { + sep_position_suiv = Chaine_Ptr ; + sep_position_prec = Chaine_Ptr; + } + /* allocation du tableau de peres */ + PathXml_Ptr->Father_Table = (IMRT_FATHER_TABLE)malloc(sizeof(char *) * PathXml_Ptr->Nb_Father); + if( PathXml_Ptr->Father_Table == NULL) + { + /*erreur d'allocation memoire**/ + IMRD_LM_LOG_ERROR_0("Erreur allocation memoire"); + status = IMRS_KO; + } + else + { + for(indexe = 0 ; indexe < PathXml_Ptr->Nb_Father; indexe++) + { + PathXml_Ptr->Father_Table[indexe] = (char *)malloc(IMRD_FATHER_SIZE); + if(PathXml_Ptr->Father_Table[indexe] == NULL) + { + /*erreur allocation */ + IMRD_LM_LOG_ERROR_0("Erreur allocation memoire"); + status = IMRS_KO; + break ; + } + + } + + /*eclatement de la chaîne sur le n elemment on a + n-1 noeud et le n ieme elment est une feuille*/ + if(status == IMRS_OK) + { + for(indexe =0; indexe <= PathXml_Ptr->Nb_Father; indexe++) + { + /*on est a la fin de la chaine c'est une feuille */ + if( indexe == PathXml_Ptr->Nb_Father ) + { + strncpy(PathXml_Ptr->Soon_Name,sep_position_suiv,((Chaine_Ptr +len) - sep_position_suiv)); + PathXml_Ptr->Soon_Name[((Chaine_Ptr +len) - sep_position_suiv)] = '\0'; + status = MM_XML_SplitAttribute(PathXml_Ptr); + } + else + { + /*recopie des pere dans le tableau */ + sep_position_suiv = strstr((const char *)sep_position_suiv, SEP_XML); + if( sep_position_suiv != NULL) + { + strncpy(PathXml_Ptr->Father_Table[indexe], sep_position_prec, (sep_position_suiv - sep_position_prec)); + PathXml_Ptr->Father_Table[indexe][( sep_position_suiv - sep_position_prec)] = '\0'; + + sep_position_suiv = sep_position_suiv+1; + sep_position_prec = sep_position_suiv; + } + } + } + + } + } + } + return(status); +} + + + + +IMRT_Status MM_XML_StrHdl_Put(IMRT_Buffer_Data *Data_Ptr, IMRT_Field *Field_Ptr, + IMRT_Buffer *Buffer_Ptr , size_t len ) +{ + char *func_name = "MM_XML_StrHdl_Put"; + IMRT_Status status; + xmlDocPtr xml_doc_ptr; + IMRT_Buffer_Data tagxml_tab[IMRD_XML_TAG_LEN]; + IMRT_PARSE_PATH_XML Path_XML_Struct; + + + status = IMRS_OK; + + if (Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer_Ptr NULL"); + } + else if (Field_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Field_Ptr NULL"); + } + else if (Data_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("data pointer NULL"); + } + else + { + /* Controle de validite du tag */ + if (strcmp(Field_Ptr->XML.Tag ,IMRD_XML_TAG_UNKNOWN) == 0) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Tag XML unknown"); + } + } + + + if ((status == IMRS_OK) && (strcmp(Data_Ptr , "") == 0)) + status = IMRD_STATUS_NOTHING_TO_DO; + + if (status == IMRS_OK) + { + /* controle sur le buffer et la valeur */ + if (Buffer_Ptr->Data_Tmp_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer pointer NULL"); + } + else + { + xml_doc_ptr = (xmlDocPtr) Buffer_Ptr->Data_Tmp_Ptr; + strcpy( tagxml_tab, (IMRT_Buffer_Data *) Field_Ptr->XML.Tag); + //status = MM_XML_Init_StructPath(&Path_XML_Struct); + + if(status == IMRS_OK) + { + IMRD_LM_LOG_TRACE_1( IMRD_LOG_LEVEL_VERBOSE_2 , "Tag xml [%s] ",tagxml_tab); + status = MM_XML_Split_Path( tagxml_tab ,&Path_XML_Struct ); + if(status == IMRS_OK) + { + status = MM_XML_Proceed_Path( &Path_XML_Struct,Data_Ptr, xml_doc_ptr); + } + } + status = MM_XML_DInit_StructPath(&Path_XML_Struct); + } + } + + if (status == IMRS_OK) + { + /* Mise a jour de la taille du buffer */ + Buffer_Ptr->Data_Buf_Len = (Buffer_Ptr->Data_Buf_Len) + len; + } + + if (status == IMRD_STATUS_NOTHING_TO_DO) + status = IMRS_OK; + + if (Data_Ptr != NULL) + free(Data_Ptr); + + return(status); +} + + diff --git a/src/libmapping_mng/src/fmt_hdl_xml.h b/src/libmapping_mng/src/fmt_hdl_xml.h new file mode 100644 index 0000000..49c7cc7 --- /dev/null +++ b/src/libmapping_mng/src/fmt_hdl_xml.h @@ -0,0 +1,135 @@ +/*----------------------------------------------------------------------------*/ +/* File: fmt_hdl_xml.h */ +/*----------------------------------------------------------------------------*/ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#ifndef _XML_HANDLER_H_ +#define _XML_HANDLER_H_ + +#include +#include + +/*----------------------------------------------------------------------------*/ +/* Global Include */ +/*----------------------------------------------------------------------------*/ + +#include "libmapping_mng.h" + + +/*----------------------------------------------------------------------------*/ +/* Local definition */ +/*----------------------------------------------------------------------------*/ + +#ifdef _XML_HANDLER_C_ + +# define IMRD_XML_VERSION "1.0" +# define IMRD_XML_BALISE "/" +# define IMRD_SOON_SIZE 100 +# define IMRD_FIRST_NODE 0 +# define IMRD_FATHER_SIZE 100 +# define IMRD_ATTIBUTE_SIZE 100 + + typedef int IMRT_NB_FATHER ; + typedef char ** IMRT_FATHER_TABLE; + + + typedef struct IMRT_PARSE_PATH_XML + { + IMRT_NB_FATHER Nb_Father; + IMRT_Status Attribute_present; + IMRT_FATHER_TABLE Father_Table; + char Soon_Name[IMRD_SOON_SIZE]; + char Attribute_Name[IMRD_ATTIBUTE_SIZE]; + char Attribute_Value[IMRD_ATTIBUTE_SIZE]; + + }IMRT_PARSE_PATH_XML; + +#endif + +/*----------------------------------------------------------------------------*/ +/* Global Variables */ +/*----------------------------------------------------------------------------*/ + +#ifdef _XML_HANDLER_C_ + + IMRT_Buffer *IMRG_XML_Buffer_Ident_Ptr; + +#endif + + + + +/*----------------------------------------------------------------------------*/ +/* Prototypes */ +/*----------------------------------------------------------------------------*/ + +#ifdef _XML_HANDLER_C_ + + IMRT_Status MM_XML_StrHdl_Init ( void ); + IMRT_Status MM_XML_StrHdl_DeInit ( void ); + IMRT_Status XML_Hdl_DataTemp_Alloc ( IMRT_Buffer * ); + IMRT_Status XML_Hdl_DataTemp_Free ( IMRT_Buffer * ); + IMRT_Status XML_Hdl_DataBuf_Free ( IMRT_Buffer * ); + IMRT_Status MM_XML_StrHdl_Data_Free ( IMRT_Buffer * ); + IMRT_Status XML_Hdl_Format_Ident ( IMRT_Buffer * ); + IMRT_Status MM_XML_StrHdl_Ident ( IMRT_Msg_Id * , IMRT_Buffer * ); + IMRT_Status MM_XML_StrHdl_Open ( IMRT_Buffer * ); + IMRT_Status MM_XML_StrHdl_Close ( IMRT_Buffer * ); + IMRT_Status MM_XML_StrHdl_Flush ( IMRT_Buffer * ); + IMRT_Status MM_XML_StrHdl_Data_List ( IMRT_Buffer * ); + IMRT_Status MM_XML_StrHdl_Copy ( IMRT_Buffer * , IMRT_Buffer * ); + IMRT_Status XML_Hdl_Field_Exist ( IMRT_Field * , IMRT_Buffer * ); + IMRT_Status MM_XML_StrHdl_Get ( IMRT_Buffer_Data ** , IMRT_Field * , IMRT_Buffer * , size_t * ); + IMRT_Status MM_XML_StrHdl_Convert ( IMRT_Buffer_Data ** , IMRT_Buffer_Data * , IMRT_Field * , size_t *, IMRT_StrHdl_Cnv_Func * ); + IMRT_Status MM_XML_StrHdl_Put ( IMRT_Buffer_Data * , IMRT_Field * , IMRT_Buffer * , size_t ); + IMRT_Status IMR_MM_XML_StrHdl_Field_Value ( IMRT_Field * , IMRT_Field_Value_Id); + IMRT_Status IMR_MM_XML_StrHdl_Field_Exist ( IMRT_Field * ); + IMRT_Status IMR_MM_XML_StrHdl_Msg_Size ( size_t ); + IMRT_Status MM_XML_DInit_StructPath (IMRT_PARSE_PATH_XML * ); + IMRT_Status MM_XML_Proceed_Path ( IMRT_PARSE_PATH_XML * , IMRT_Buffer_Data * , xmlDocPtr ); + IMRT_Status MM_XML_Split_Path ( IMRT_Buffer_Data * Chaine_Ptr , IMRT_PARSE_PATH_XML * PathXml_Ptr ); + IMRT_Status MM_XML_SplitAttribute ( IMRT_PARSE_PATH_XML * PathXml_Ptr ); +#else + + extern IMRT_Status MM_XML_StrHdl_Init ( void ); + extern IMRT_Status MM_XML_StrHdl_DeInit ( void ); + extern IMRT_Status MM_XML_StrHdl_Data_Free ( IMRT_Buffer * ); + extern IMRT_Status MM_XML_StrHdl_Ident ( IMRT_Msg_Id * , IMRT_Buffer * ); + extern IMRT_Status MM_XML_StrHdl_Open ( IMRT_Buffer * ); + extern IMRT_Status MM_XML_StrHdl_Close ( IMRT_Buffer * ); + extern IMRT_Status MM_XML_StrHdl_Flush ( IMRT_Buffer * ); + extern IMRT_Status MM_XML_StrHdl_Data_List ( IMRT_Buffer * ); + extern IMRT_Status MM_XML_StrHdl_Copy ( IMRT_Buffer * , IMRT_Buffer * ); + extern IMRT_Status MM_XML_StrHdl_Get ( IMRT_Buffer_Data ** , IMRT_Field * , IMRT_Buffer * , size_t * ); + extern IMRT_Status MM_XML_StrHdl_Convert ( IMRT_Buffer_Data ** , IMRT_Buffer_Data * , IMRT_Field * , size_t *, IMRT_StrHdl_Cnv_Func * ); + extern IMRT_Status MM_XML_StrHdl_Put ( IMRT_Buffer_Data * , IMRT_Field * , IMRT_Buffer * , size_t ); + +#endif + +/*----------------------------------------------------------------------------*/ + +#endif + diff --git a/src/libmapping_mng/src/libmapping_mng.c b/src/libmapping_mng/src/libmapping_mng.c new file mode 100644 index 0000000..adc92fe --- /dev/null +++ b/src/libmapping_mng/src/libmapping_mng.c @@ -0,0 +1,259 @@ +/*----------------------------------------------------------------------------*/ +/* $Workfile: libmapping_mng.c $ */ +/*----------------------------------------------------------------------------*/ +/* $Author: agibert $ */ +/* $Date: 2008/11/12 02:25:23 $ */ +/* $Revision: 1.1 $ */ +/* $Label: $ */ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#define _LIBMAPPING_MNG_ +#define _LIBMAPPING_MNG_C_ + +#include "libmapping_mng.h" + + + + + + + +/******************************************************************************/ +/* Mapping Manager API */ +/******************************************************************************/ + + + +/*----------------------------------------------------------------------------*/ +/* Open Mapping Manager */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IMR_MM_Library_Open( IMRT_MM_Config *Config) +{ + IMRT_Status status; + + + if( IMRG_MM_Module.Lib.Status != IMRD_LIB_STATUS_CLOSED) + { + IMRD_LM_LOG_ERROR_0( "Library not closed !"); + + return( IMRS_KO); + } + else + { + IMRG_MM_Base.Config.XML_Format = Config->XML_Format; + + status = IMRS_OK; + + status = MM_Schedul_Init( ); + + if (status != IMRS_OK) + { + IMRD_LM_LOG_ERROR_0("Error MM_Schedul_Init in IMR_MM_Library_Open"); + } + else + { + status = MM_Buffer_Init( ) ; + } + + + if( status != IMRS_OK) + { + IMRD_LM_LOG_ERROR_0( "Can't open library !"); + } + else + { + IMRG_MM_Module.Lib.Status = IMRD_LIB_STATUS_OPENED; + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_1, "Library opened !"); + } + + return( status); + } +} + + + + + +/*----------------------------------------------------------------------------*/ +/* Close Mapping Manager */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IMR_MM_Library_Close() +{ + IMRT_Status status; + + + if( IMRG_MM_Module.Lib.Status != IMRD_LIB_STATUS_OPENED) + { + IMRD_LM_LOG_ERROR_0( "Library not opened !"); + + return( IMRS_KO); + } + else + { + status = IMRS_OK; + + status = MM_Schedul_DeInit( ); + + if (status != IMRS_OK) + { + IMRD_LM_LOG_ERROR_0("Error MM_Schedul_DeInit in IMR_MM_Library_Close"); + } + else + { + status = MM_Buffer_DeInit( ) ; + } + + if( status != IMRS_OK) + { + IMRD_LM_LOG_ERROR_0( "Can't close library !"); + } + else + { + IMRG_MM_Module.Lib.Status = IMRD_LIB_STATUS_CLOSED; + + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_1, "Library closed !"); + } + + return( status) ; + } +} + + + + + +/*----------------------------------------------------------------------------*/ +/* Buffer allocation */ +/*----------------------------------------------------------------------------*/ +/* (O) Buffer_Ptr_Ptr : Buffer pointer pointer */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IMR_MM_Buffer_Alloc( IMRT_Buffer **Buffer_Ptr_Ptr) +{ + IMRT_Status status; + + status = IMRS_OK; + + status = MM_Buffer_Alloc( Buffer_Ptr_Ptr ) ; + + if (status != IMRS_OK) + { + IMRD_LM_LOG_ERROR_0("Error MM_Buffer_Alloc"); + } + else + { + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_1, "Allocated buffer success"); + } + + return (status) ; +} + + +/*----------------------------------------------------------------------------*/ +/* Buffer free */ +/*----------------------------------------------------------------------------*/ +/* (IO) Buffer_Ptr_Ptr : Buffer pointer pointer */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IMR_MM_Buffer_Free( IMRT_Buffer **Buffer_Ptr_Ptr) +{ + IMRT_Status status; + + status = IMRS_OK; + + status = MM_Buffer_Free( Buffer_Ptr_Ptr ) ; + + if (status != IMRS_OK) + { + IMRD_LM_LOG_ERROR_0("Error MM_Buffer_Free"); + } + else + { + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_1, "Freed buffer success"); + } + + return (status) ; + +} + + +/*----------------------------------------------------------------------------*/ +/* Buffer check */ +/*----------------------------------------------------------------------------*/ +/* (I) Buffer_Ptr : Buffer pointer */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IMR_MM_Buffer_Check (IMRT_Buffer *Buffer_Ptr) +{ + + IMRT_Status status; + + status = IMRS_OK; + + status = MM_Buffer_Check( Buffer_Ptr ) ; + + if (status != IMRS_OK) + { + IMRD_LM_LOG_ERROR_0("Error MM_Buffer_Check in IMR_MM_Buffer_Check"); + } + else + { + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_1, "Check buffer success"); + } + + return (status) ; + +} + + +/*----------------------------------------------------------------------------*/ +/* Buffer list */ +/*----------------------------------------------------------------------------*/ +/* (I) Buffer_Ptr : Buffer pointer */ +/* (I) texte : Text to print */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IMR_MM_Buffer_List( IMRT_Buffer *Buffer_Ptr, char *texte) +{ + return( MM_Buffer_List( Buffer_Ptr, texte ) ); +} + + +/*----------------------------------------------------------------------------*/ +/* Buffer mapping */ +/*----------------------------------------------------------------------------*/ +/* (I) Output_Buffer_Ptr : Output buffer pointer */ +/* (I) Input_Buffer_Ptr : Input buffer pointer */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IMR_MM_Buffer_Map( IMRT_Buffer *Output_Buffer_Ptr, IMRT_Buffer *Input_Buffer_Ptr) +{ + return ( MM_Schedul_Buffer_Map( Output_Buffer_Ptr, Input_Buffer_Ptr ) ); +} + + diff --git a/src/libmapping_mng/src/libmapping_mng.h b/src/libmapping_mng/src/libmapping_mng.h new file mode 100644 index 0000000..d3d23b1 --- /dev/null +++ b/src/libmapping_mng/src/libmapping_mng.h @@ -0,0 +1,142 @@ +/*----------------------------------------------------------------------------*/ +/* File: libmapping_mng.h */ +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#ifndef _LIBMAPPING_MNG_H_ +#define _LIBMAPPING_MNG_H_ + + + + + +/*----------------------------------------------------------------------------*/ +/* Global Include */ +/*----------------------------------------------------------------------------*/ + +#include + + + + + +/*----------------------------------------------------------------------------*/ +/* Lib Definitions */ +/*----------------------------------------------------------------------------*/ + +#define IMRD_MM_MODULE_ID ( IMRT_Module_Id) 4 +#define IMRD_MM_MODULE_NAME ( IMRT_Module_Name) "mm" +#define IMRD_MM_MODULE_NAME_LONG ( IMRT_Module_Name_Long) "Mapping Manager" +#define IMRD_MM_MODULE_VERSION ( IMRT_Module_Version) "@(#) VERSIONIMR: $Label: $ $Date: 2008/11/12 02:25:23 $ $Workfile: libmapping_mng.h $" + +#define IMRD_MODULE_PTR &IMRG_MM_Module + + + + + +/*----------------------------------------------------------------------------*/ +/* Local definition */ +/*----------------------------------------------------------------------------*/ + +#define IMRD_STATUS_NOTHING_TO_DO (IMRT_Status) 4 + +typedef IMRT_Status (IMRT_MM_Cnv_Init)( void ); +typedef IMRT_Status (IMRT_MM_Cnv_DeInit)( void ); +typedef IMRT_Status (IMRT_MM_Convert)( IMRT_Buffer_Data * , IMRT_Buffer_Data * , size_t * , size_t , IMRT_Cnv_Attr ); + +typedef struct IMRT_StrHdl_Cnv_Func + +{ IMRT_Cnv_Name Nom; + IMRT_MM_Cnv_Init *Init_Ptr; + IMRT_MM_Cnv_DeInit *DeInit_Ptr; + IMRT_MM_Convert *Convert_Ptr; +} IMRT_StrHdl_Cnv_Func; + +/* a virer apres les tests */ +IMRT_StrHdl_Cnv_Func *IMRG_MM_StrHdl_Cnv_Func_Tab; + + + +typedef struct IMRT_MM_Base +{ + IMRT_MM_Config Config; +} IMRT_MM_Base; + + + + + +/*----------------------------------------------------------------------------*/ +/* Prototypes */ +/*----------------------------------------------------------------------------*/ + + + + + + + +/*----------------------------------------------------------------------------*/ +/* Global Variables */ +/*----------------------------------------------------------------------------*/ + +# ifdef _LIBMAPPING_MNG_C_ + +IMRT_MM_Base IMRG_MM_Base = +{ + { IMRD_FALSE} +}; + + + +IMRT_Module IMRG_MM_Module = +{ + IMRD_MM_MODULE_ID, + IMRD_MM_MODULE_NAME, + IMRD_MM_MODULE_NAME_LONG, + IMRD_MM_MODULE_VERSION, + IMRD_MODULE_TYPE_LIBRARY, + { + IMRD_LIB_STATUS_CLOSED, + ( IMRT_Lib_Open *) &IMR_MM_Library_Open, + ( IMRT_Lib_Close *) &IMR_MM_Library_Close + } +}; + +# else + +extern IMRT_MM_Base IMRG_MM_Base; +extern IMRT_Module IMRG_MM_Module; + +# endif + + + + + +#endif diff --git a/src/libmapping_mng/src/map_scheduler.c b/src/libmapping_mng/src/map_scheduler.c new file mode 100644 index 0000000..1b11370 --- /dev/null +++ b/src/libmapping_mng/src/map_scheduler.c @@ -0,0 +1,484 @@ +/*----------------------------------------------------------------------------*/ +/* File: map_scheduler.c */ +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#define _LIBMAPPING_MNG_ +#define _MAP_SCHEDULER_C_ + +#include "map_scheduler.h" + +IMRT_Status MM_Schedul_Buffer_Map( IMRT_Buffer *Output_Buffer_Ptr, IMRT_Buffer *Input_Buffer_Ptr) +{ + IMRT_Status status; + short indice; + IMRT_Fmt_Id format_temp; + char *func_name = "MM_Schedul_Buffer_Map"; + + status = IMRS_OK; + indice = 0; + format_temp = Input_Buffer_Ptr->Fmt_Id; + + /* controles sur les buffers */ + status = Schedul_Buffers_Check(Input_Buffer_Ptr, Output_Buffer_Ptr); + + /* fermeture des buffers */ + if (status == IMRS_OK) + { + status = MM_Buffer_Close(Input_Buffer_Ptr); + } + if (status != IMRS_OK) + { + IMRD_LM_LOG_ERROR_0("Buffer input close failed"); + } + else + { + status = MM_Buffer_Close(Output_Buffer_Ptr); + } + + if (status != IMRS_OK) + { + IMRD_LM_LOG_ERROR_0("Buffer output close failed"); + } + else + { + /* initialisation du tableau */ + Buffer_Tab[0] = Input_Buffer_Ptr; + Buffer_Tab[1] = Output_Buffer_Ptr; + for (indice = 2; indice < IMRT_BUFFER_ID_MAX_NB; indice++) + Buffer_Tab[indice] = NULL; + + Input_Buffer_Ptr->Fmt_Id = IMRD_FMT_ID_UNKNOWN ; + status = MM_Buffer_Open( Input_Buffer_Ptr ); + + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_2 , "Values before MapMath proceed begin :"); + IMRD_LM_LOG_TRACE_3(IMRD_LOG_LEVEL_VERBOSE_2 , "Output Application : Id (%d) Fmt_Id (%d) Msg type Id (%d)" , Output_Buffer_Ptr->Appl_Id_Output , Output_Buffer_Ptr->Fmt_Id , Output_Buffer_Ptr->Msg_Id); + IMRD_LM_LOG_TRACE_3(IMRD_LOG_LEVEL_VERBOSE_2 , "Input Application : Id (%d) Fmt_Id (%d) Msg type Id (%d)" , Input_Buffer_Ptr->Appl_Id_Input , Input_Buffer_Ptr->Fmt_Id , Input_Buffer_Ptr->Msg_Id); + + + if (status != IMRS_OK) + { + IMRD_LM_LOG_ERROR_0("Buffer input open failed"); + Input_Buffer_Ptr->Fmt_Id = format_temp; + } + else + { + status = IMR_SDM_MapPath_Proceed( Input_Buffer_Ptr->Appl_Id_Output, + Output_Buffer_Ptr->Fmt_Id, + Output_Buffer_Ptr->Msg_Id, + Input_Buffer_Ptr->Appl_Id_Input, + Input_Buffer_Ptr->Fmt_Id, + Input_Buffer_Ptr->Msg_Id, + IMR_MM_Schedul_Map, + IMR_MM_Schedul_Copy, + IMR_MM_Schedul_Ident); + if (status != IMRS_OK) + { + IMRD_LM_LOG_ERROR_1("MapPath proceed ended with status (%d)", status); + } + } + } + + indice = 2; + while (indice < IMRT_BUFFER_ID_MAX_NB) + { + if (Buffer_Tab[indice] != NULL) + { + if (MM_Buffer_Free(&Buffer_Tab[indice]) != IMRS_OK) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_1("Buffer (%d) free failed" , indice); + } + } + indice++; + } + + if (MM_Buffer_Close(Input_Buffer_Ptr) != IMRS_OK) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer input close failed"); + } + if (MM_Buffer_Close(Output_Buffer_Ptr) != IMRS_OK) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Buffer output close failed"); + } + + Buffer_Tab[0] = NULL; + Buffer_Tab[1] = NULL; + + return ( status ); +} + +IMRT_Status Schedul_Buffers_Check( IMRT_Buffer *Input_Buffer_Ptr, IMRT_Buffer *Output_Buffer_Ptr) +{ + IMRT_Status status; + char *func_name = "Schedul_Buffers_Check"; + + + status = IMRS_OK; + + if (Input_Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Input buffer pointer NULL"); + } + else + if (Output_Buffer_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Output buffer pointer NULL"); + } + else + { + if (MM_Buffer_Check(Input_Buffer_Ptr) != IMRS_OK) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Check buffer input failed"); + } + if (MM_Buffer_Check(Output_Buffer_Ptr) != IMRS_OK) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Check buffer output failed"); + } + if (Input_Buffer_Ptr->Appl_Id_Input == IMRD_APPL_ID_UNDEFINEDED) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Application input buffer equal to undefineded"); + } + if (Input_Buffer_Ptr->Status != IMRD_BUFFER_STATUS_ALLOCATED) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Status input buffer equal to unknown"); + } + if (Input_Buffer_Ptr->Data_Buf_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Data_Buf_Ptr input buffer equal to NULL"); + } + } + + return ( status ); +} + + +IMRT_Status IMR_MM_Schedul_Ident( IMRT_Fmt_Id *Format_Ptr, + IMRT_Msg_Id *Type, + IMRT_Buffer_Id Ident_Buffer_Indice, + IMRT_Boolean Ident_Total ) +{ + IMRT_Status status; + IMRT_Msg_Id TypeTmp; + char *func_name = "IMR_MM_Schedul_Ident"; + + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_1 , "============================================================================") + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_1 , "Ident buffer demand : Begin"); + IMRD_LM_LOG_TRACE_1(IMRD_LOG_LEVEL_VERBOSE_1 , "Ident buffer demand : Buffer : (%d)" , Ident_Buffer_Indice); + IMRD_LM_LOG_TRACE_1(IMRD_LOG_LEVEL_VERBOSE_1 , "Ident buffer demand : Format Id : (%d)" , *Format_Ptr); + IMRD_LM_LOG_TRACE_1(IMRD_LOG_LEVEL_VERBOSE_1 , "Ident buffer demand : Msg type : (%d)" , *Type); + IMRD_LM_LOG_TRACE_1(IMRD_LOG_LEVEL_VERBOSE_1 , "Ident buffer demand : Total ident : (%d)" , Ident_Total); + + status = IMRS_OK; + TypeTmp = IMRD_MSG_ID_UNKNOWN; + + /* controle valeur de l'indice */ + if ( ( Ident_Buffer_Indice < 0 ) || ( Ident_Buffer_Indice >= IMRT_BUFFER_ID_MAX_NB ) ) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_1("Buffer (%d) out of bounds" , Ident_Buffer_Indice); + } + /* controle allocation d'un buffer pour l'indice */ + else if ( Buffer_Tab[Ident_Buffer_Indice] == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_1("Buffer (%d) not allocated" , Ident_Buffer_Indice); + } + else + { + TypeTmp = Buffer_Tab[Ident_Buffer_Indice]->Msg_Id; + + if (Ident_Total == IMRD_TRUE) // identification totale + { + status = MM_Buffer_Ident_Update(Buffer_Tab[Ident_Buffer_Indice], + IMRD_FMT_ID_UNKNOWN, + IMRD_FMTATTR_NAME_UNKNOWN, + IMRD_MSG_ID_UNKNOWN); + } + } + + if ( status != IMRS_OK ) + { + IMRD_LM_LOG_ERROR_0("MM_Buffer_Ident_Update failed"); + } + else + { + status = MM_Buffer_Open ( Buffer_Tab[Ident_Buffer_Indice] ); + } + + if ( status != IMRS_OK ) + { + IMRD_LM_LOG_ERROR_1("Buffer (%d) not open" , Ident_Buffer_Indice); + } + else + { + status = MM_Buffer_Ident ( *Type , Buffer_Tab[Ident_Buffer_Indice] ); + } + + if (status != IMRS_OK) + { + IMRD_LM_LOG_ERROR_0("MM_Buffer_Ident failed"); + } + else + { + *Format_Ptr = Buffer_Tab[Ident_Buffer_Indice]->Fmt_Id; + *Type = Buffer_Tab[Ident_Buffer_Indice]->Msg_Id; + } + + + if ((status != IMRS_OK) && (status != IMRS_KO)) + { + status = IMRS_OK; + } + + MM_Buffer_List( Buffer_Tab[Ident_Buffer_Indice], " CB Ident end"); + + IMRD_LM_LOG_TRACE_1(IMRD_LOG_LEVEL_VERBOSE_1 , "Ident buffer demand end : Format Id : (%d)" , *Format_Ptr); + IMRD_LM_LOG_TRACE_1(IMRD_LOG_LEVEL_VERBOSE_1 , "Ident buffer demand end : Msg type : (%d)" , *Type); + IMRD_LM_LOG_TRACE_1(IMRD_LOG_LEVEL_VERBOSE_1 , "Ident buffer demand : End with status : (%d)" , status); + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_1 , "============================================================================") + + return ( status ); +} + +IMRT_Status IMR_MM_Schedul_Copy( IMRT_Buffer_Id Output_Buffer_Indice, IMRT_Buffer_Id Input_Buffer_Indice) +{ + IMRT_Status status; + IMRT_Buffer *buffer_ptr; + char *func_name = "IMR_MM_Schedul_Copy"; + + + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_1 , "============================================================================") + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_1 , "Copy buffer demand : Begin"); + IMRD_LM_LOG_TRACE_1(IMRD_LOG_LEVEL_VERBOSE_1 , "Copy buffer demand : Buffer Target : (%d)" , Output_Buffer_Indice); + IMRD_LM_LOG_TRACE_1(IMRD_LOG_LEVEL_VERBOSE_1 , "Copy buffer demand : Buffer Source : (%d)" , Input_Buffer_Indice); + + + status = IMRS_OK; + buffer_ptr = NULL; + + /* controle la validite des indices */ + if ( ( Input_Buffer_Indice < 0 ) || ( Input_Buffer_Indice >= IMRT_BUFFER_ID_MAX_NB ) || + ( Output_Buffer_Indice < 0 ) || ( Output_Buffer_Indice >= IMRT_BUFFER_ID_MAX_NB ) ) + { + IMRD_LM_LOG_ERROR_2("Buffer input with indice (%d) or output with indice (%d) out of bounds" , Input_Buffer_Indice , Output_Buffer_Indice); + status = IMRS_KO; + } + else if ( Buffer_Tab[Input_Buffer_Indice] == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_1("Buffer with indice (%d) not initialized" , Input_Buffer_Indice); + } + /* allocation du buffer destinataire si necessaire */ + else if ( Buffer_Tab[Output_Buffer_Indice] == NULL) + { + status = MM_Buffer_Alloc(&buffer_ptr); + if (status != IMRS_OK) + { + IMRD_LM_LOG_ERROR_0("Error MM_Buffer_Alloc"); + } + else + { + Buffer_Tab[Output_Buffer_Indice] = buffer_ptr; + } + } + MM_Buffer_List( Buffer_Tab[Input_Buffer_Indice], " Before Copy Buffer In"); + if (status == IMRS_OK) + { + status = MM_Buffer_Copy( Buffer_Tab[Output_Buffer_Indice], Buffer_Tab[Input_Buffer_Indice]); + } + MM_Buffer_List( Buffer_Tab[Output_Buffer_Indice], " After Copy Buffer Out"); + + IMRD_LM_LOG_TRACE_1(IMRD_LOG_LEVEL_VERBOSE_1 , "Copy buffer demand : End with status : (%d)" , status); + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_1 , "============================================================================") + + return ( status ); +} + +/*----------------------------------------------------------------------------*/ +/* Buffer Mapping CallBack */ +/*----------------------------------------------------------------------------*/ +/* (I) Buffer_Id_Target: Target buffer id */ +/* (I) Fmt_Target: Target format */ +/* (I) Buffer_Id_Src: Source buffer id */ +/* (I) Fmt_Src: Source format */ +/* (I) MsgMap: Message Map to use */ +/* (I) Clear_Flag: Clear or not output buffer */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IMR_MM_Schedul_Map( IMRT_Buffer_Id Buffer_Id_Target , + IMRT_Fmt_Id Fmt_Target, + IMRT_FmtAttr_Value Fmt_Target_Attr , + IMRT_Buffer_Id Buffer_Id_Src , + IMRT_Fmt_Id Fmt_Src , + IMRT_FmtAttr_Value Fmt_Src_Attr , + IMRT_MsgMap *MsgMap_ptr , + IMRT_MapCmd_Flag Clear_Flag) + +{ + IMRT_Buffer *input_buffer_ptr, + *output_buffer_ptr; + IMRT_Status status; + char *func_name = "IMR_MM_Schedul_Map"; + + + status = IMRS_OK; + input_buffer_ptr = NULL; + output_buffer_ptr = NULL; + + + /* controle buffers */ + if ( ( Buffer_Id_Src < 0 ) || ( Buffer_Id_Src >= IMRT_BUFFER_ID_MAX_NB ) || + ( Buffer_Id_Target < 0 ) || ( Buffer_Id_Target >= IMRT_BUFFER_ID_MAX_NB ) ) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_2("Indices buffer input (%d) or output (%d) out of bounds" , Buffer_Id_Src,Buffer_Id_Target); + } + else if ( Buffer_Tab[Buffer_Id_Src] == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_1("Buffer with indice (%d) not allocated ",Buffer_Id_Src); + } + else if (Fmt_Src_Attr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Source format attribute NULL"); + } + else if (Fmt_Target_Attr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Target format attribute NULL"); + } + else if (MsgMap_ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Message map pointer NULL"); + } + else if (MsgMap_ptr->Msg_Input_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Message input pointer NULL"); + } + else if (MsgMap_ptr->Msg_Output_Ptr == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0("Message output pointer NULL"); + } + + if ( status == IMRS_OK ) + { + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_1 , "============================================================================") + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_1 , "Mapping buffer demand : Begin"); + IMRD_LM_LOG_TRACE_1(IMRD_LOG_LEVEL_VERBOSE_1 , "Mapping buffer demand : MsgMap : (%s)" , (char *) MsgMap_ptr->Name); + IMRD_LM_LOG_TRACE_2(IMRD_LOG_LEVEL_VERBOSE_1 , "Mapping buffer demand : indices Buffers : Src (%d) : Tgt (%d)" , Buffer_Id_Src , Buffer_Id_Target); + IMRD_LM_LOG_TRACE_2(IMRD_LOG_LEVEL_VERBOSE_1 , "Mapping buffer demand : formats : Src (%d) : Tgt (%d)" , Fmt_Src , Fmt_Target); + IMRD_LM_LOG_TRACE_2(IMRD_LOG_LEVEL_VERBOSE_1 , "Mapping buffer demand : Attributs : Src (%s) : Tgt (%s)" , Fmt_Src_Attr , Fmt_Target_Attr); + IMRD_LM_LOG_TRACE_2(IMRD_LOG_LEVEL_VERBOSE_1 , "Mapping buffer demand : Types de msg : Src (%s) : Tgt (%s)" , (char *) MsgMap_ptr->Msg_Input_Ptr->Name , (char *) MsgMap_ptr->Msg_Output_Ptr->Name); + IMRD_LM_LOG_TRACE_1(IMRD_LOG_LEVEL_VERBOSE_1 , "Mapping buffer demand : Flag buffer clear : (%d)" , Clear_Flag); + + input_buffer_ptr = Buffer_Tab[Buffer_Id_Src]; + if ( Buffer_Tab[Buffer_Id_Target] == NULL) + { + status = MM_Buffer_Alloc(&output_buffer_ptr); + if ( status != IMRS_OK ) + { + IMRD_LM_LOG_ERROR_1("MM_Buffer_Alloc failed for buffer output (%d)",Buffer_Id_Target); + } + else + { + Buffer_Tab[Buffer_Id_Target] = output_buffer_ptr; + } + + } + else if ( Clear_Flag == IMRD_TRUE ) + { + output_buffer_ptr = Buffer_Tab[Buffer_Id_Target]; + status = MM_Buffer_Clear(output_buffer_ptr); + } + else + { + output_buffer_ptr = Buffer_Tab[Buffer_Id_Target]; + } + } + /* mise a jour des formats et types des buffers */ + if ( status == IMRS_OK ) + { + status = MM_Buffer_Ident_Update(input_buffer_ptr, + Fmt_Src, + Fmt_Src_Attr, + MsgMap_ptr->Msg_Input_Ptr->Id); + } + if ( status == IMRS_OK ) + { + status =MM_Buffer_Ident_Update( output_buffer_ptr, + Fmt_Target, + Fmt_Target_Attr, + MsgMap_ptr->Msg_Output_Ptr->Id); + } + /* ouverture des buffers */ + if ( status == IMRS_OK ) + { + status = MM_Buffer_Open( input_buffer_ptr); + } + if ( status == IMRS_OK ) + { + MM_Buffer_Open( output_buffer_ptr); + } + + MM_Buffer_List( input_buffer_ptr, " Input Buffer Before Mapping"); + + if ( status == IMRS_OK ) + { + status = MM_Buffer_Map( output_buffer_ptr, input_buffer_ptr, MsgMap_ptr); + } + + MM_Buffer_List( output_buffer_ptr, " Output Buffer after Mapping"); + + IMRD_LM_LOG_TRACE_1(IMRD_LOG_LEVEL_VERBOSE_1 , "Mapping buffer demand : End with status : (%d)" , status); + IMRD_LM_LOG_TRACE_0(IMRD_LOG_LEVEL_VERBOSE_1 , "============================================================================") + + return ( status ); +} + +IMRT_Status MM_Schedul_Init() +{ + return (IMRS_OK); +} + +IMRT_Status MM_Schedul_DeInit() +{ + return (IMRS_OK); +} diff --git a/src/libmapping_mng/src/map_scheduler.h b/src/libmapping_mng/src/map_scheduler.h new file mode 100644 index 0000000..fa502e7 --- /dev/null +++ b/src/libmapping_mng/src/map_scheduler.h @@ -0,0 +1,88 @@ +/*----------------------------------------------------------------------------*/ +/* File: map_scheduler.h */ +/*----------------------------------------------------------------------------*/ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#ifndef _MAP_SCHEDULER_H_ +#define _MAP_SCHEDULER_H_ + +/*----------------------------------------------------------------------------*/ +/* Global Include */ +/*----------------------------------------------------------------------------*/ + +#include "libmapping_mng.h" + +/*----------------------------------------------------------------------------*/ +/* Global Variables */ +/*----------------------------------------------------------------------------*/ + +#ifdef _MAP_SCHEDULER_C_ + + IMRT_Buffer *Buffer_Tab[IMRT_BUFFER_ID_MAX_NB]; + +#endif + +/*----------------------------------------------------------------------------*/ +/* Prototypes */ +/*----------------------------------------------------------------------------*/ +#ifdef _MAP_SCHEDULER_C_ + + IMRT_Status MM_Schedul_Init ( void ); + IMRT_Status MM_Schedul_DeInit ( void ); + IMRT_Status MM_Schedul_Buffer_Map ( IMRT_Buffer * , IMRT_Buffer * ); + IMRT_Status Schedul_Buffers_Check ( IMRT_Buffer * , IMRT_Buffer * ); + IMRT_Status IMR_MM_Schedul_Ident ( IMRT_Fmt_Id * , IMRT_Msg_Id *, IMRT_Buffer_Id , IMRT_Boolean ); + IMRT_Status IMR_MM_Schedul_Copy ( IMRT_Buffer_Id , IMRT_Buffer_Id ); + +/*----------------------------------------------------------------------------*/ +/* Buffer Mapping CallBack */ +/*----------------------------------------------------------------------------*/ +/* (I) Buffer_Id_Target: Target buffer id */ +/* (I) Fmt_Target: Target format */ +/* (I) Fmt_Attr_Target: Target format attribute */ +/* (I) Buffer_Id_Src: Source buffer id */ +/* (I) Fmt_Src: Source format */ +/* (I) Fmt_Attr_Src: Source format attribute */ +/* (I) MsgMap: Message Map to use */ +/* (I) Clear_Flag: Clear or donn't clear output buffer */ +/*----------------------------------------------------------------------------*/ + IMRT_Status IMR_MM_Schedul_Map( IMRT_Buffer_Id, IMRT_Fmt_Id, IMRT_FmtAttr_Value, IMRT_Buffer_Id, IMRT_Fmt_Id, IMRT_FmtAttr_Value, IMRT_MsgMap *, IMRT_MapCmd_Flag); + +/*----------------------------------------------------------------------------*/ + + +#else + + extern IMRT_Status MM_Schedul_Init ( void ); + extern IMRT_Status MM_Schedul_DeInit ( void ); + extern IMRT_Status MM_Schedul_Buffer_Map ( IMRT_Buffer * , IMRT_Buffer * ); + +#endif + + +/*----------------------------------------------------------------------------*/ + +#endif diff --git a/src/libmsg_router/include/msg_router.h b/src/libmsg_router/include/msg_router.h new file mode 100644 index 0000000..505f53f --- /dev/null +++ b/src/libmsg_router/include/msg_router.h @@ -0,0 +1,132 @@ +/*----------------------------------------------------------------------------*/ +/* File: msg_router.h */ +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#ifndef _MSG_ROUTER_H_ +#define _MSG_ROUTER_H_ + + + +#include + + + + + +/*----------------------------------------------------------------------------*/ +/* IMRD_MR_API definition */ +/*----------------------------------------------------------------------------*/ + +# ifdef _LIBMSG_ROUTER_ +# define IMRD_MR_API +# else +# define IMRD_MR_API extern +# endif + + + + + +/*----------------------------------------------------------------------------*/ +/* MR_Config definition */ +/*----------------------------------------------------------------------------*/ + +typedef struct IMRT_MR_Config +{ + IMRT_Boolean Mapping_Forced; + IMRT_Boolean Continue_Forced; + IMRT_Read_Mode Read_Mode; + IMRT_Log_Id_Struct Log_Id_Struct_Input; + IMRT_Log_Id_Struct Log_Id_Struct_Output; +} IMRT_MR_Config; + + + + + +/*----------------------------------------------------------------------------*/ +/* Global Variables */ +/*----------------------------------------------------------------------------*/ + +# ifdef _LIBMSG_ROUTER_ + +# else + +extern IMRT_Module IMRG_MR_Module; + +# endif + + + + + + + +/******************************************************************************/ +/* Msg Router API */ +/******************************************************************************/ + + + +/*----------------------------------------------------------------------------*/ +/* Open Msg Router */ +/*----------------------------------------------------------------------------*/ +/* Lib_Flag: Setup MR init mode */ +/*----------------------------------------------------------------------------*/ + +IMRD_MR_API IMRT_Status IMR_MR_Library_Open( IMRT_MR_Config *); + + + +/*----------------------------------------------------------------------------*/ +/* Close Msg Router */ +/*----------------------------------------------------------------------------*/ + +IMRD_MR_API IMRT_Status IMR_MR_Library_Close( void); + + + + + +/*----------------------------------------------------------------------------*/ +/* Proceed Message Routing */ +/*----------------------------------------------------------------------------*/ +/* Medium_URL_Output: Output medium URL */ +/* Appl_Id_Output: Output application Id */ +/* Medium_URL_Input: Trash Medium URL */ +/* Medium_URL_Input: Input Medium URL */ +/* Appl_Id_Input: Input Application Id */ +/*----------------------------------------------------------------------------*/ + +IMRD_MR_API IMRT_Status IMR_MR_Proceed( IMRT_Medium_URL, IMRT_Appl_Id, IMRT_Medium_URL, IMRT_Medium_URL, IMRT_Appl_Id); + + + +/*----------------------------------------------------------------------------*/ + +#endif diff --git a/src/libmsg_router/src/Makefile b/src/libmsg_router/src/Makefile new file mode 100644 index 0000000..4235e6d --- /dev/null +++ b/src/libmsg_router/src/Makefile @@ -0,0 +1,65 @@ +#------------------------------------------------------------------------------ +# Local Makefile +#------------------------------------------------------------------------------ +# $Workfile: Makefile $ +#------------------------------------------------------------------------------ +# $Author: agibert $ +# $Date: 2008/11/12 02:25:23 $ +# $Revision: 1.1 $ +# $Label: $ +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# IMR - Interlinking Message Router +# Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) +# mailto:arnaud@rx3.net +# http://www.rx3.org/dvp/?dvp=imr +#------------------------------------------------------------------------------ +# This file is part of IMR +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# Var include +#------------------------------------------------------------------------------ + +include ../../Makefile_var.mk + + + +#------------------------------------------------------------------------------ +# Variables +#------------------------------------------------------------------------------ + +TARGET= libmsg_router$(SHLIB_SUFFIX) + +OBJ= libmsg_router.o + +EXTRA_INC= + +EXTRA_LIB= + + + +#------------------------------------------------------------------------------ +# Rule include +#------------------------------------------------------------------------------ + +include ../../Makefile_rule.mk diff --git a/src/libmsg_router/src/libmsg_router.c b/src/libmsg_router/src/libmsg_router.c new file mode 100644 index 0000000..0f3185b --- /dev/null +++ b/src/libmsg_router/src/libmsg_router.c @@ -0,0 +1,544 @@ +/*----------------------------------------------------------------------------*/ +/* $Workfile: libmsg_router.c $ */ +/*----------------------------------------------------------------------------*/ +/* $Author: agibert $ */ +/* $Date: 2008/11/12 02:25:23 $ */ +/* $Revision: 1.1 $ */ +/* $Label: $ */ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#define _LIBMSG_ROUTER_ +#define _LIBMSG_ROUTER_C_ + +#include "libmsg_router.h" + + + + + + + +/******************************************************************************/ +/* Msg Router API */ +/******************************************************************************/ + + + +/*----------------------------------------------------------------------------*/ +/* Open Msg Router */ +/*----------------------------------------------------------------------------*/ +/* Lib_Flag: Setup MR init mode */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IMR_MR_Library_Open( IMRT_MR_Config *Config_Ptr) +{ + int idx; + + + if( IMRG_MR_Module.Lib.Status != IMRD_LIB_STATUS_CLOSED) + { + IMRD_LM_LOG_ERROR_0( "Library not closed !"); + + return( IMRS_KO); + } + else + { + IMRG_MR_Base.Config.Mapping_Forced = Config_Ptr->Mapping_Forced; + IMRG_MR_Base.Config.Continue_Forced = Config_Ptr->Continue_Forced; + IMRG_MR_Base.Config.Read_Mode = Config_Ptr->Read_Mode; + + if( Config_Ptr->Log_Id_Struct_Input.Bit_Nb != 0) + { + IMRG_MR_Base.Config.Log_Id_Struct_Input.Bit_Nb = Config_Ptr->Log_Id_Struct_Input.Bit_Nb; + IMRG_MR_Base.Config.Log_Id_Struct_Input.Log_Size = Config_Ptr->Log_Id_Struct_Input.Log_Size; + + if( ( IMRG_MR_Base.Config.Log_Id_Struct_Input.Log_Id_Bit_Ptr = + malloc( IMRG_MR_Base.Config.Log_Id_Struct_Input.Bit_Nb * sizeof( IMRT_Log_Id_Bit))) == NULL) + { + IMRD_LM_LOG_ERROR_1( "Can't allocate Input Log_Id_Bit_Ptr (%d) !", errno); + + return( IMRS_OK); + } + + for( idx = 0; idx < IMRG_MR_Base.Config.Log_Id_Struct_Input.Bit_Nb; idx++) + { + IMRG_MR_Base.Config.Log_Id_Struct_Input.Log_Id_Bit_Ptr[idx].Offset = Config_Ptr->Log_Id_Struct_Input.Log_Id_Bit_Ptr[idx].Offset; + IMRG_MR_Base.Config.Log_Id_Struct_Input.Log_Id_Bit_Ptr[idx].Size = Config_Ptr->Log_Id_Struct_Input.Log_Id_Bit_Ptr[idx].Size; + } + } + + if( Config_Ptr->Log_Id_Struct_Output.Bit_Nb != 0) + { + IMRG_MR_Base.Config.Log_Id_Struct_Output.Bit_Nb = Config_Ptr->Log_Id_Struct_Output.Bit_Nb; + IMRG_MR_Base.Config.Log_Id_Struct_Output.Log_Size = Config_Ptr->Log_Id_Struct_Output.Log_Size; + + if( ( IMRG_MR_Base.Config.Log_Id_Struct_Output.Log_Id_Bit_Ptr = + malloc( IMRG_MR_Base.Config.Log_Id_Struct_Output.Bit_Nb * sizeof( IMRT_Log_Id_Bit))) == NULL) + { + IMRD_LM_LOG_ERROR_1( "Can't allocate Output Log_Id_Bit_Ptr (%d) !", errno); + + return( IMRS_OK); + } + + for( idx = 0; idx < IMRG_MR_Base.Config.Log_Id_Struct_Output.Bit_Nb; idx++) + { + IMRG_MR_Base.Config.Log_Id_Struct_Output.Log_Id_Bit_Ptr[idx].Offset = Config_Ptr->Log_Id_Struct_Output.Log_Id_Bit_Ptr[idx].Offset; + IMRG_MR_Base.Config.Log_Id_Struct_Output.Log_Id_Bit_Ptr[idx].Size = Config_Ptr->Log_Id_Struct_Output.Log_Id_Bit_Ptr[idx].Size; + } + } + + IMRG_MR_Module.Lib.Status = IMRD_LIB_STATUS_OPENED; + + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_1, "Library opened !"); + + return( IMRS_OK); + } +} + + + + + +/*----------------------------------------------------------------------------*/ +/* Close Msg Router */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IMR_MR_Library_Close() +{ + if( IMRG_MR_Module.Lib.Status != IMRD_LIB_STATUS_OPENED) + { + IMRD_LM_LOG_ERROR_0( "Library not opened !"); + + return( IMRS_KO); + } + else + { + if( IMRG_MR_Base.Config.Log_Id_Struct_Input.Bit_Nb != 0) + { + free( IMRG_MR_Base.Config.Log_Id_Struct_Input.Log_Id_Bit_Ptr); + } + + if( IMRG_MR_Base.Config.Log_Id_Struct_Output.Bit_Nb != 0) + { + free( IMRG_MR_Base.Config.Log_Id_Struct_Output.Log_Id_Bit_Ptr); + } + + IMRG_MR_Module.Lib.Status = IMRD_LIB_STATUS_CLOSED; + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_1, "Library closed !"); + + return( IMRS_OK); + } +} + + + + + +/*----------------------------------------------------------------------------*/ +/* Close all allocated resources */ +/*----------------------------------------------------------------------------*/ +/* Buffer_Input_Ptr: Input buffer */ +/* Buffer_Output_Ptr: Output buffer */ +/* Medium_Input_Ptr: Input Medium */ +/* Medium_Output_Ptr: Output Medium */ +/* Medium_Trash_Ptr: Output Medium */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status Close_All( IMRT_Buffer *Buffer_Input_Ptr, IMRT_Buffer *Buffer_Output_Ptr, + IMRT_Medium *Medium_Input_Ptr, IMRT_Medium *Medium_Output_Ptr, IMRT_Medium *Medium_Trash_Ptr) +{ + IMRT_Status status; + + + if( Buffer_Output_Ptr != NULL) + { + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_0, "Freeing output buffer..."); + + if( ( status = IMR_MM_Buffer_Free( &Buffer_Output_Ptr)) != IMRS_OK) + { + IMRD_LM_LOG_ERROR_1( "Can't free output buffer (%d) !", status); + } + } + + if( Buffer_Input_Ptr != NULL) + { + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_0, "Freeing input buffer..."); + + if( ( status = IMR_MM_Buffer_Free( &Buffer_Input_Ptr)) != IMRS_OK) + { + IMRD_LM_LOG_ERROR_1( "Can't free input buffer (%d) !", status); + } + } + + if( Medium_Trash_Ptr != NULL) + { + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_0, "Closing trash medium..."); + + if( ( status = IMR_IOM_Medium_Close( Medium_Trash_Ptr)) != IMRS_OK) + { + IMRD_LM_LOG_ERROR_1( "Can't close trash medium (%d) !", status); + } + } + + if( Medium_Output_Ptr != NULL) + { + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_0, "Closing output medium..."); + + if( ( status = IMR_IOM_Medium_Close( Medium_Output_Ptr)) != IMRS_OK) + { + IMRD_LM_LOG_ERROR_1( "Can't close output medium (%d) !", status); + } + } + + if( Medium_Input_Ptr != NULL) + { + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_0, "Closing input medium..."); + + if( ( status = IMR_IOM_Medium_Close( Medium_Input_Ptr)) != IMRS_OK) + { + IMRD_LM_LOG_ERROR_1( "Can't close input medium (%d) !", status); + } + } + + return( IMRS_OK); +} + + + + + +/*----------------------------------------------------------------------------*/ +/* Proceed Message Routing */ +/*----------------------------------------------------------------------------*/ +/* Medium_URL_Output: Output medium URL */ +/* Appl_Id_Output: Output application Id */ +/* Medium_URL_Input: Input Medium URL */ +/* Appl_Id_Input: Input Application Id */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IMR_MR_Proceed( IMRT_Medium_URL Medium_URL_Output, IMRT_Appl_Id Appl_Id_Output, + IMRT_Medium_URL Medium_URL_Trash, + IMRT_Medium_URL Medium_URL_Input, IMRT_Appl_Id Appl_Id_Input) +{ + IMRT_Status status, return_status = IMRS_OK; + IMRT_Boolean data = IMRD_TRUE; + IMRT_Appl_Id appl_id_raw; + IMRT_Buffer *buffer_input_ptr = NULL, *buffer_output_ptr = NULL; + IMRT_Medium *medium_input_ptr = NULL, *medium_output_ptr = NULL, *medium_trash_ptr = NULL; + IMRT_Tran *tran_ptr = NULL; + + + if( sigsetjmp( IMRG_Base.SigLongJmp_Env, 1) != 0 ) + { + IMRD_LM_LOG_TRACE_1( IMRD_LOG_LEVEL_VERBOSE_0, "Exiting on signal (%d)...", IMRG_Base.Sig_Trapped); + + Close_All( buffer_input_ptr, buffer_output_ptr, medium_input_ptr, medium_output_ptr, medium_trash_ptr); + + return( IMRS_OK); + } + + if( IMR_SDM_Appl_Id_Get( &appl_id_raw, "raw") != IMRS_OK) + { + IMRD_LM_LOG_ERROR_1( "Can't get Appl_Id from [%s] !", "raw"); + + return( IMRS_KO); + } + + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_0, "Opening input medium..."); + + if( ( status = IMR_IOM_Medium_Open( &medium_input_ptr, "Input", Medium_URL_Input, Appl_Id_Input, Appl_Id_Output, IMRD_DIR_ID_IN)) != IMRS_OK) + { + IMRD_LM_LOG_ERROR_1( "Can't open input medium (%d) !", status); + + return_status = IMRS_KO; + } + else + { + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_0, "Opening output medium..."); + + if( ( status = IMR_IOM_Medium_Open( &medium_output_ptr, "Output", Medium_URL_Output, Appl_Id_Input, Appl_Id_Output, IMRD_DIR_ID_OUT)) != IMRS_OK) + { + IMRD_LM_LOG_ERROR_1( "Can't open output medium (%d) !", status); + + return_status = IMRS_KO; + } + else + { + if( IMRG_MR_Base.Config.Continue_Forced == IMRD_TRUE) + { + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_0, "Opening trash medium..."); + + if( ( status = IMR_IOM_Medium_Open( &medium_trash_ptr, "Trash", Medium_URL_Trash, appl_id_raw, appl_id_raw, IMRD_DIR_ID_OUT)) != IMRS_OK) + { + IMRD_LM_LOG_ERROR_1( "Can't open trash medium (%d) !", status); + + return_status = IMRS_KO; + } + } + + if( return_status == IMRS_OK) + { + do + { + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_0, "Allocating input buffer..."); + + if( ( status = IMR_MM_Buffer_Alloc( &buffer_input_ptr)) != IMRS_OK) + { + IMRD_LM_LOG_ERROR_1( "Can't allocate input buffer (%d) !", status); + + return_status = IMRS_KO; + } + else + { + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_0, "Begining transaction..."); + + if( ( status = IMR_IOM_Tran_Begin( &tran_ptr, 2, medium_output_ptr, medium_input_ptr)) == IMRS_KO) + { + IMRD_LM_LOG_ERROR_1( "Can't begin transaction (%d) !", status); + + return_status = IMRS_KO; + } + else + { + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_0, "Reading input medium..."); + + if( ( status = IMR_IOM_Medium_Read( buffer_input_ptr, medium_input_ptr, IMRG_MR_Base.Config.Read_Mode)) == IMRS_KO) + { + IMRD_LM_LOG_ERROR_1( "Can't read input buffer (%d) !", status); + + return_status = IMRS_KO; + } + else + { + if( status == IMRS_NO_DATA) + { + + + + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_0, "No more data to read..."); + + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_0, "Rollbaking transaction..."); + + if( ( status = IMR_IOM_Tran_Rollback( tran_ptr)) == IMRS_KO) + { + IMRD_LM_LOG_ERROR_1( "Can't rollback transaction (%d) !", status); + + return_status = IMRS_KO; + } + else + { + return_status = IMRS_NO_DATA; + } + } + else + { + if( status == IMRS_SIGNAL) + { + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_0, "Read interupted by a signal !"); + + return_status = status; + } + else + { + IMR_MM_Buffer_List( buffer_input_ptr, "Input Buffer"); + + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_0, "Allocating output buffer..."); + + if( ( status = IMR_MM_Buffer_Alloc( &buffer_output_ptr)) != IMRS_OK) + { + IMRD_LM_LOG_ERROR_1( "Can't allocate output buffer (%d) !", status); + + return_status = IMRS_KO; + } + else + { + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_0, "Maping input buffer to output buffer..."); + + if( ( status = IMR_MM_Buffer_Map( buffer_output_ptr, buffer_input_ptr)) != IMRS_OK) + { + IMRD_LM_LOG_ERROR_1( "Can't map buffers (%d) !", status); + + if( IMRG_MR_Base.Config.Mapping_Forced == IMRD_TRUE) + { + data = IMRD_TRUE; + } + else + { + data = IMRD_FALSE; + } + + if( IMRG_MR_Base.Config.Continue_Forced == IMRD_TRUE) + { + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_0, "Writing trash medium..."); + + if( ( status = IMR_IOM_Medium_Write( medium_trash_ptr, buffer_input_ptr)) != IMRS_OK) + { + IMRD_LM_LOG_ERROR_1( "Can't write input buffer (%d) !", status); + + return_status = IMRS_KO; + } + } + else + { + return_status = IMRS_KO; + } + } + else + { + data = IMRD_TRUE; + } + + IMR_MM_Buffer_List( buffer_output_ptr, "Output Buffer"); + + if( data == IMRD_TRUE) + { + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_0, "Writing output medium..."); + + if( ( status = IMR_IOM_Medium_Write( medium_output_ptr, buffer_output_ptr)) != IMRS_OK) + { + IMRD_LM_LOG_ERROR_1( "Can't write output buffer (%d) !", status); + + return_status = IMRS_KO; + } + } + + if( return_status != IMRS_OK) + { + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_0, "Rollbaking transaction..."); + + if( ( status = IMR_IOM_Tran_Rollback( tran_ptr)) == IMRS_KO) + { + IMRD_LM_LOG_ERROR_1( "Can't rollback transaction (%d) !", status); + + return_status = IMRS_KO; + } + } + else + { + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_0, "Comiting transaction..."); + + if( ( status = IMR_IOM_Tran_Commit( tran_ptr)) == IMRS_KO) + { + IMRD_LM_LOG_ERROR_1( "Can't commit transaction (%d) !", status); + + return_status = IMRS_KO; + } + + IMRD_LM_LOG_BUFFER_ID( buffer_input_ptr, &IMRG_MR_Base.Config.Log_Id_Struct_Input, IMRD_MR_LOG_ID_HEADER_MSG_INPUT); + IMRD_LM_LOG_BUFFER_ID( buffer_output_ptr, &IMRG_MR_Base.Config.Log_Id_Struct_Output, IMRD_MR_LOG_ID_HEADER_MSG_OUTPUT); + } + + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_0, "Freeing output buffer..."); + + if( ( status = IMR_MM_Buffer_Free( &buffer_output_ptr)) != IMRS_OK) + { + IMRD_LM_LOG_ERROR_1( "Can't free output buffer (%d) !", status); + + return_status = IMRS_KO; + } + + buffer_output_ptr = NULL; + } + } + } + } + } + + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_0, "Freeing input buffer..."); + + if( ( status = IMR_MM_Buffer_Free( &buffer_input_ptr)) != IMRS_OK) + { + IMRD_LM_LOG_ERROR_1( "Can't free input buffer (%d) !", status); + + return_status = IMRS_KO; + } + + buffer_input_ptr = NULL; + } + } + while( ( return_status == IMRS_OK) && ( IMRG_Base.Sig_Trapped == 0)); + + switch( return_status) + { + case IMRS_OK: + case IMRS_NO_DATA: + case IMRS_SIGNAL: + { + return_status = IMRS_OK; + break; + } + + case IMRS_KO: + default: + { + return_status = IMRS_KO; + break; + } + } + + if( IMRG_MR_Base.Config.Continue_Forced == IMRD_TRUE) + { + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_0, "Closing trash medium..."); + + if( ( status = IMR_IOM_Medium_Close( medium_trash_ptr)) != IMRS_OK) + { + IMRD_LM_LOG_ERROR_1( "Can't close trash medium (%d) !", status); + + return_status = IMRS_KO; + } + + medium_trash_ptr = NULL; + } + } + + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_0, "Closing output medium..."); + + if( ( status = IMR_IOM_Medium_Close( medium_output_ptr)) != IMRS_OK) + { + IMRD_LM_LOG_ERROR_1( "Can't close output medium (%d) !", status); + + return_status = IMRS_KO; + } + + medium_output_ptr = NULL; + } + + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_0, "Closing input medium..."); + + if( ( status = IMR_IOM_Medium_Close( medium_input_ptr)) != IMRS_OK) + { + IMRD_LM_LOG_ERROR_1( "Can't close input medium (%d) !", status); + + return_status = IMRS_KO; + } + + medium_input_ptr = NULL; + } + + return( return_status); +} + + diff --git a/src/libmsg_router/src/libmsg_router.h b/src/libmsg_router/src/libmsg_router.h new file mode 100644 index 0000000..a1e7e33 --- /dev/null +++ b/src/libmsg_router/src/libmsg_router.h @@ -0,0 +1,146 @@ +/*----------------------------------------------------------------------------*/ +/* File: libmsg_router.h */ +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#ifndef _LIBMSG_ROUTER_H_ +#define _LIBMSG_ROUTER_H_ + + + +/*----------------------------------------------------------------------------*/ +/* Global Include */ +/*----------------------------------------------------------------------------*/ + +#include + + + + + +/*----------------------------------------------------------------------------*/ +/* Lib Definitions */ +/*----------------------------------------------------------------------------*/ + +#define IMRD_MR_MODULE_ID ( IMRT_Module_Id) 5 +#define IMRD_MR_MODULE_NAME ( IMRT_Module_Name) "mr" +#define IMRD_MR_MODULE_NAME_LONG ( IMRT_Module_Name_Long) "Message Router" +#define IMRD_MR_MODULE_VERSION ( IMRT_Module_Version) "@(#) VERSIONIMR: $Label: $ $Date: 2008/11/12 02:25:23 $ $Workfile: libmsg_router.h $" + +#define IMRD_MODULE_PTR &IMRG_MR_Module + + + +typedef struct IMRT_MR_Base +{ + IMRT_MR_Config Config; +} IMRT_MR_Base; + + + + + +/*----------------------------------------------------------------------------*/ +/* Local Definitions */ +/*----------------------------------------------------------------------------*/ + +#define IMRD_MR_LOG_ID_HEADER_MSG_INPUT ( IMRT_Log_Id_Header) "Input Message Id:" +#define IMRD_MR_LOG_ID_HEADER_MSG_OUTPUT ( IMRT_Log_Id_Header) "Output Message Id:" + + + + + + + +/*----------------------------------------------------------------------------*/ +/* Prototypes */ +/*----------------------------------------------------------------------------*/ + +# ifdef _LIBMSG_ROUTER_C_ + +IMRT_Status Close_All( IMRT_Buffer *, IMRT_Buffer *, IMRT_Medium *, IMRT_Medium *, IMRT_Medium *); + +# endif + + + + + + +/*----------------------------------------------------------------------------*/ +/* Local Includes */ +/*----------------------------------------------------------------------------*/ + + + + + + + +/*----------------------------------------------------------------------------*/ +/* Global Variables */ +/*----------------------------------------------------------------------------*/ + +# ifdef _LIBMSG_ROUTER_C_ + +IMRT_MR_Base IMRG_MR_Base = +{ + { + IMRD_FALSE, + IMRD_READ_MODE_WAIT + } +}; + +IMRT_Module IMRG_MR_Module = +{ + IMRD_MR_MODULE_ID, + IMRD_MR_MODULE_NAME, + IMRD_MR_MODULE_NAME_LONG, + IMRD_MR_MODULE_VERSION, + IMRD_MODULE_TYPE_LIBRARY, + { + IMRD_LIB_STATUS_CLOSED, + ( IMRT_Lib_Open *) &IMR_MR_Library_Open, + ( IMRT_Lib_Close *) &IMR_MR_Library_Close + } +}; + +# else + +extern IMRT_MR_Base IMRG_MR_Base; +extern IMRT_Module IMRG_MR_Module; + +# endif + + + + + +/*----------------------------------------------------------------------------*/ + +#endif diff --git a/src/libnode/GNU-FDL.txt b/src/libnode/GNU-FDL.txt new file mode 100644 index 0000000..b42936b --- /dev/null +++ b/src/libnode/GNU-FDL.txt @@ -0,0 +1,355 @@ + GNU Free Documentation License + Version 1.1, March 2000 + + Copyright (C) 2000 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + +0. PREAMBLE + +The purpose of this License is to make a manual, textbook, or other +written document "free" in the sense of freedom: to assure everyone +the effective freedom to copy and redistribute it, with or without +modifying it, either commercially or noncommercially. Secondarily, +this License preserves for the author and publisher a way to get +credit for their work, while not being considered responsible for +modifications made by others. + +This License is a kind of "copyleft", which means that derivative +works of the document must themselves be free in the same sense. It +complements the GNU General Public License, which is a copyleft +license designed for free software. + +We have designed this License in order to use it for manuals for free +software, because free software needs free documentation: a free +program should come with manuals providing the same freedoms that the +software does. But this License is not limited to software manuals; +it can be used for any textual work, regardless of subject matter or +whether it is published as a printed book. We recommend this License +principally for works whose purpose is instruction or reference. + + +1. APPLICABILITY AND DEFINITIONS + +This License applies to any manual or other work that contains a +notice placed by the copyright holder saying it can be distributed +under the terms of this License. The "Document", below, refers to any +such manual or work. Any member of the public is a licensee, and is +addressed as "you". + +A "Modified Version" of the Document means any work containing the +Document or a portion of it, either copied verbatim, or with +modifications and/or translated into another language. + +A "Secondary Section" is a named appendix or a front-matter section of +the Document that deals exclusively with the relationship of the +publishers or authors of the Document to the Document's overall subject +(or to related matters) and contains nothing that could fall directly +within that overall subject. (For example, if the Document is in part a +textbook of mathematics, a Secondary Section may not explain any +mathematics.) The relationship could be a matter of historical +connection with the subject or with related matters, or of legal, +commercial, philosophical, ethical or political position regarding +them. + +The "Invariant Sections" are certain Secondary Sections whose titles +are designated, as being those of Invariant Sections, in the notice +that says that the Document is released under this License. + +The "Cover Texts" are certain short passages of text that are listed, +as Front-Cover Texts or Back-Cover Texts, in the notice that says that +the Document is released under this License. + +A "Transparent" copy of the Document means a machine-readable copy, +represented in a format whose specification is available to the +general public, whose contents can be viewed and edited directly and +straightforwardly with generic text editors or (for images composed of +pixels) generic paint programs or (for drawings) some widely available +drawing editor, and that is suitable for input to text formatters or +for automatic translation to a variety of formats suitable for input +to text formatters. A copy made in an otherwise Transparent file +format whose markup has been designed to thwart or discourage +subsequent modification by readers is not Transparent. A copy that is +not "Transparent" is called "Opaque". + +Examples of suitable formats for Transparent copies include plain +ASCII without markup, Texinfo input format, LaTeX input format, SGML +or XML using a publicly available DTD, and standard-conforming simple +HTML designed for human modification. Opaque formats include +PostScript, PDF, proprietary formats that can be read and edited only +by proprietary word processors, SGML or XML for which the DTD and/or +processing tools are not generally available, and the +machine-generated HTML produced by some word processors for output +purposes only. + +The "Title Page" means, for a printed book, the title page itself, +plus such following pages as are needed to hold, legibly, the material +this License requires to appear in the title page. For works in +formats which do not have any title page as such, "Title Page" means +the text near the most prominent appearance of the work's title, +preceding the beginning of the body of the text. + + +2. VERBATIM COPYING + +You may copy and distribute the Document in any medium, either +commercially or noncommercially, provided that this License, the +copyright notices, and the license notice saying this License applies +to the Document are reproduced in all copies, and that you add no other +conditions whatsoever to those of this License. You may not use +technical measures to obstruct or control the reading or further +copying of the copies you make or distribute. However, you may accept +compensation in exchange for copies. If you distribute a large enough +number of copies you must also follow the conditions in section 3. + +You may also lend copies, under the same conditions stated above, and +you may publicly display copies. + + +3. COPYING IN QUANTITY + +If you publish printed copies of the Document numbering more than 100, +and the Document's license notice requires Cover Texts, you must enclose +the copies in covers that carry, clearly and legibly, all these Cover +Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on +the back cover. Both covers must also clearly and legibly identify +you as the publisher of these copies. The front cover must present +the full title with all words of the title equally prominent and +visible. You may add other material on the covers in addition. +Copying with changes limited to the covers, as long as they preserve +the title of the Document and satisfy these conditions, can be treated +as verbatim copying in other respects. + +If the required texts for either cover are too voluminous to fit +legibly, you should put the first ones listed (as many as fit +reasonably) on the actual cover, and continue the rest onto adjacent +pages. + +If you publish or distribute Opaque copies of the Document numbering +more than 100, you must either include a machine-readable Transparent +copy along with each Opaque copy, or state in or with each Opaque copy +a publicly-accessible computer-network location containing a complete +Transparent copy of the Document, free of added material, which the +general network-using public has access to download anonymously at no +charge using public-standard network protocols. If you use the latter +option, you must take reasonably prudent steps, when you begin +distribution of Opaque copies in quantity, to ensure that this +Transparent copy will remain thus accessible at the stated location +until at least one year after the last time you distribute an Opaque +copy (directly or through your agents or retailers) of that edition to +the public. + +It is requested, but not required, that you contact the authors of the +Document well before redistributing any large number of copies, to give +them a chance to provide you with an updated version of the Document. + + +4. MODIFICATIONS + +You may copy and distribute a Modified Version of the Document under +the conditions of sections 2 and 3 above, provided that you release +the Modified Version under precisely this License, with the Modified +Version filling the role of the Document, thus licensing distribution +and modification of the Modified Version to whoever possesses a copy +of it. In addition, you must do these things in the Modified Version: + +A. Use in the Title Page (and on the covers, if any) a title distinct + from that of the Document, and from those of previous versions + (which should, if there were any, be listed in the History section + of the Document). You may use the same title as a previous version + if the original publisher of that version gives permission. +B. List on the Title Page, as authors, one or more persons or entities + responsible for authorship of the modifications in the Modified + Version, together with at least five of the principal authors of the + Document (all of its principal authors, if it has less than five). +C. State on the Title page the name of the publisher of the + Modified Version, as the publisher. +D. Preserve all the copyright notices of the Document. +E. Add an appropriate copyright notice for your modifications + adjacent to the other copyright notices. +F. Include, immediately after the copyright notices, a license notice + giving the public permission to use the Modified Version under the + terms of this License, in the form shown in the Addendum below. +G. Preserve in that license notice the full lists of Invariant Sections + and required Cover Texts given in the Document's license notice. +H. Include an unaltered copy of this License. +I. Preserve the section entitled "History", and its title, and add to + it an item stating at least the title, year, new authors, and + publisher of the Modified Version as given on the Title Page. If + there is no section entitled "History" in the Document, create one + stating the title, year, authors, and publisher of the Document as + given on its Title Page, then add an item describing the Modified + Version as stated in the previous sentence. +J. Preserve the network location, if any, given in the Document for + public access to a Transparent copy of the Document, and likewise + the network locations given in the Document for previous versions + it was based on. These may be placed in the "History" section. + You may omit a network location for a work that was published at + least four years before the Document itself, or if the original + publisher of the version it refers to gives permission. +K. In any section entitled "Acknowledgements" or "Dedications", + preserve the section's title, and preserve in the section all the + substance and tone of each of the contributor acknowledgements + and/or dedications given therein. +L. Preserve all the Invariant Sections of the Document, + unaltered in their text and in their titles. Section numbers + or the equivalent are not considered part of the section titles. +M. Delete any section entitled "Endorsements". Such a section + may not be included in the Modified Version. +N. Do not retitle any existing section as "Endorsements" + or to conflict in title with any Invariant Section. + +If the Modified Version includes new front-matter sections or +appendices that qualify as Secondary Sections and contain no material +copied from the Document, you may at your option designate some or all +of these sections as invariant. To do this, add their titles to the +list of Invariant Sections in the Modified Version's license notice. +These titles must be distinct from any other section titles. + +You may add a section entitled "Endorsements", provided it contains +nothing but endorsements of your Modified Version by various +parties--for example, statements of peer review or that the text has +been approved by an organization as the authoritative definition of a +standard. + +You may add a passage of up to five words as a Front-Cover Text, and a +passage of up to 25 words as a Back-Cover Text, to the end of the list +of Cover Texts in the Modified Version. Only one passage of +Front-Cover Text and one of Back-Cover Text may be added by (or +through arrangements made by) any one entity. If the Document already +includes a cover text for the same cover, previously added by you or +by arrangement made by the same entity you are acting on behalf of, +you may not add another; but you may replace the old one, on explicit +permission from the previous publisher that added the old one. + +The author(s) and publisher(s) of the Document do not by this License +give permission to use their names for publicity for or to assert or +imply endorsement of any Modified Version. + + +5. COMBINING DOCUMENTS + +You may combine the Document with other documents released under this +License, under the terms defined in section 4 above for modified +versions, provided that you include in the combination all of the +Invariant Sections of all of the original documents, unmodified, and +list them all as Invariant Sections of your combined work in its +license notice. + +The combined work need only contain one copy of this License, and +multiple identical Invariant Sections may be replaced with a single +copy. If there are multiple Invariant Sections with the same name but +different contents, make the title of each such section unique by +adding at the end of it, in parentheses, the name of the original +author or publisher of that section if known, or else a unique number. +Make the same adjustment to the section titles in the list of +Invariant Sections in the license notice of the combined work. + +In the combination, you must combine any sections entitled "History" +in the various original documents, forming one section entitled +"History"; likewise combine any sections entitled "Acknowledgements", +and any sections entitled "Dedications". You must delete all sections +entitled "Endorsements." + + +6. COLLECTIONS OF DOCUMENTS + +You may make a collection consisting of the Document and other documents +released under this License, and replace the individual copies of this +License in the various documents with a single copy that is included in +the collection, provided that you follow the rules of this License for +verbatim copying of each of the documents in all other respects. + +You may extract a single document from such a collection, and distribute +it individually under this License, provided you insert a copy of this +License into the extracted document, and follow this License in all +other respects regarding verbatim copying of that document. + + +7. AGGREGATION WITH INDEPENDENT WORKS + +A compilation of the Document or its derivatives with other separate +and independent documents or works, in or on a volume of a storage or +distribution medium, does not as a whole count as a Modified Version +of the Document, provided no compilation copyright is claimed for the +compilation. Such a compilation is called an "aggregate", and this +License does not apply to the other self-contained works thus compiled +with the Document, on account of their being thus compiled, if they +are not themselves derivative works of the Document. + +If the Cover Text requirement of section 3 is applicable to these +copies of the Document, then if the Document is less than one quarter +of the entire aggregate, the Document's Cover Texts may be placed on +covers that surround only the Document within the aggregate. +Otherwise they must appear on covers around the whole aggregate. + + +8. TRANSLATION + +Translation is considered a kind of modification, so you may +distribute translations of the Document under the terms of section 4. +Replacing Invariant Sections with translations requires special +permission from their copyright holders, but you may include +translations of some or all Invariant Sections in addition to the +original versions of these Invariant Sections. You may include a +translation of this License provided that you also include the +original English version of this License. In case of a disagreement +between the translation and the original English version of this +License, the original English version will prevail. + + +9. TERMINATION + +You may not copy, modify, sublicense, or distribute the Document except +as expressly provided for under this License. Any other attempt to +copy, modify, sublicense or distribute the Document is void, and will +automatically terminate your rights under this License. However, +parties who have received copies, or rights, from you under this +License will not have their licenses terminated so long as such +parties remain in full compliance. + + +10. FUTURE REVISIONS OF THIS LICENSE + +The Free Software Foundation may publish new, revised versions +of the GNU Free Documentation License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. See +http://www.gnu.org/copyleft/. + +Each version of the License is given a distinguishing version number. +If the Document specifies that a particular numbered version of this +License "or any later version" applies to it, you have the option of +following the terms and conditions either of that specified version or +of any later version that has been published (not as a draft) by the +Free Software Foundation. If the Document does not specify a version +number of this License, you may choose any version ever published (not +as a draft) by the Free Software Foundation. + + +ADDENDUM: How to use this License for your documents + +To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and +license notices just after the title page: + + Copyright (c) YEAR YOUR NAME. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.1 + or any later version published by the Free Software Foundation; + with the Invariant Sections being LIST THEIR TITLES, with the + Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. + A copy of the license is included in the section entitled "GNU + Free Documentation License". + +If you have no Invariant Sections, write "with no Invariant Sections" +instead of saying which ones are invariant. If you have no +Front-Cover Texts, write "no Front-Cover Texts" instead of +"Front-Cover Texts being LIST"; likewise for Back-Cover Texts. + +If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of +free software license, such as the GNU General Public License, +to permit their use in free software. diff --git a/src/libnode/GNU-GPL.txt b/src/libnode/GNU-GPL.txt new file mode 100644 index 0000000..5b6e7c6 --- /dev/null +++ b/src/libnode/GNU-GPL.txt @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/src/libnode/GNU-LGPL.txt b/src/libnode/GNU-LGPL.txt new file mode 100644 index 0000000..b1e3f5a --- /dev/null +++ b/src/libnode/GNU-LGPL.txt @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/src/libnode/ReadMe.txt b/src/libnode/ReadMe.txt new file mode 100644 index 0000000..5b2e6ac --- /dev/null +++ b/src/libnode/ReadMe.txt @@ -0,0 +1,44 @@ +# %RCSfile: ReadMe.txt,v % +# %Revision: 2.8 % +# %Name: libnode-2_1_0-1 % +# %Date: 2005/01/24 01:19:50 % +# %Author: agibert % + + + + + +Welcome to LibNode 2.1.x ! + + + +This release of LibNode supports the following OS: + - Linux 2.2.x, 2.4.x and 2.6.x (tested on RedHat & Mandrake), + - Solaris 2.6, + - Windows NT4, 2000 and XP. + + + +The support of LibVer is now optional (To enable it, use: make _LIBVER_SUPPORT=1 all). + +LibNode support LibShMem 2.0.0 and LibDataStr 2.0.0 ! + + + +Warning: Associated documentation (including the comments !) is outdated... +Please read demo and ndbench code. + + + +Libnode is licensed under the LGPL/GPL GNU Licenses. +For more information, please read the corresponding source file headers. +The license details can be found in the GNU-GPL.txt, GNU-LGPL.txt and GNU-FDL.txt files. + + + +Enjoy it! + +Your LibNode Team. + +arnaud@rx3.net +http://www.rx3.org/dvp/libnode diff --git a/src/libnode/ReleaseNotes.txt b/src/libnode/ReleaseNotes.txt new file mode 100644 index 0000000..d631beb --- /dev/null +++ b/src/libnode/ReleaseNotes.txt @@ -0,0 +1,220 @@ +# %RCSfile: ReleaseNotes.txt,v % +# %Revision: 2.20 % +# %Name: libnode-2_1_0-1 % +# %Date: 2005/01/24 00:50:55 % +# %Author: agibert % + + + + + +------------------------------------------------------------------------------------------------------------------------------------ +LibNode V 2.1.0-1 - A. Gibert - 24/01/05 +------------------------------------------------------------------------------------------------------------------------------------ + +All: This new LibNode branch (2.1.x) should support the forthcoming new LibShMem branch (2.0.x), +LibNode: Add symbol lookup support for manager, allocator and desallocator functions call, + New Allocator and desallocator API interace, + Code cleanup, +NDBench: DS_Open now support an arg in order to use or not symbol lookup, + Add test-*-s.ndb batch files witch use symbol lookup. + + + +------------------------------------------------------------------------------------------------------------------------------------ +LibNode V 2.0.7-1 - A. Gibert - 20/01/05 +------------------------------------------------------------------------------------------------------------------------------------ + +All: Add to Makefile.var auto version label detection from CVS Tag. + This should be the final release of the 2.0 branch, + This new release is developped for the MICOT/Target project (Banque de France - Paris). +LibNode: Minor bug fixes in ND_*_Info_Print() functions and ND_Library_StdErr_Set alias defines. + + + +------------------------------------------------------------------------------------------------------------------------------------ +LibNode V 2.0.6-1 - A. Gibert - 24/08/04 +------------------------------------------------------------------------------------------------------------------------------------ + +All: Generate *-c executables with checking mode enabled (ND_MODE=1), + Code clean up and more cleanly indented, + This new release is developped for the MICOT/Target project (Banque de France - Paris), +LibNode: Add OpenStruct tracing support (Enabled by ND_MODE=1 and Debug=1), + Re-implement for Unix and Windows target, full address checking in ND_Address_Check(), +NDDemo0: Add LibNode 2.0.6 support: Add ND_Library_Open/Close() calls, +NDBench: Add Lib_Open, Lib_Close, Index_Value_Break and Index_Node_Break command, + Improve random number generation, + Add test-10.ndb and test-errror.ndb batch files. + + + +------------------------------------------------------------------------------------------------------------------------------------ +LibNode V 2.0.5-1 - A. Gibert / M. Regimbeau - 28/07/03 +------------------------------------------------------------------------------------------------------------------------------------ + +All: Add a new Makefile system (Makefile.rule and Makefile.var), + Add 'make distrib' support, + Add libnode.spec file, + Move node.h from lib directory to include directory. + + + +------------------------------------------------------------------------------------------------------------------------------------ +LibNode V 2.0.4-1 - A. Gibert - 29/07/02 +------------------------------------------------------------------------------------------------------------------------------------ + +All: This release of libnode pass with sucess valgrind test on linux. +LibNode: Add and use ND_Index_Clear() private API, +NbBench: Add fclose() call at the end of batch_run. + + + +------------------------------------------------------------------------------------------------------------------------------------ +LibNode V 2.0.3-1 - A. Gibert - 09/04/02 +------------------------------------------------------------------------------------------------------------------------------------ + +All: Fix Microsoft Visual Project to generate Debug and Release config correctly, +LibNode: Change index type numeric print value from decimal to hexa in ND_Index_Info_Print() API, +LibNode: Add new cases in ND_Index_Convert() handling (List->List:FIFO and List->List:LIFO), +LibNode: Generate in Debug mode libnoded.lib, libnoded.dll, libnoded_a.lib, +LibNode: Generate in Release mode libnode.lib, libnode.dll, libnode_a.lib, +Demo0: Generate in Debug mode demo0d.exe and in Release mode demo0d.exe, +NbBench: Generate in Debug mode ndbenchd.exe and in Release mode ndbenchd.exe. + + + +------------------------------------------------------------------------------------------------------------------------------------ +LibNode V 2.0.2-2 - A. Gibert - 01/03/02 +------------------------------------------------------------------------------------------------------------------------------------ + +All: Add GNU-GPL.txt, GNU-LGPL.txt and GNU-FDL.txt license files, +All: Add license stuff in ReandMe. +LibNode: Add LGPL header in libnode.c, libnode.h and node.h, +LibNode: Replace GPL by LGPL in libnode.rc, +Demo0: Add GPL header in demo0.c, +NbBench: Add GPL header in ndbench.c. + + + +------------------------------------------------------------------------------------------------------------------------------------ +LibNode V 2.0.2-1 - A. Gibert - 27/02/02 +------------------------------------------------------------------------------------------------------------------------------------ + +All: Makefiles now generate static and dynamic objects, +All: Add no libver support in Makefiles, +LibNode: VisualStudio Project now generate Windows DLL and use libnode.rc resource file, +LibNode: Rename Index_Open_Nb into Index_Open_Count, +LibNode: Fix bugs in ND_Node_Root_Alloc() on Index_Open_Count handling, +LibNode: Minor fix into ND_DataStruct_Check_I() and ND_Index_Check_I() functions, +NbBench: Implement Index_Close and Index_Info_Print functions. + + + +------------------------------------------------------------------------------------------------------------------------------------ +LibNode V 2.0.1-1 - A. Gibert - 28/11/01 +------------------------------------------------------------------------------------------------------------------------------------ + +LibNode: Fix the error level of TIMAS_KO: it's now an error status. + + + +------------------------------------------------------------------------------------------------------------------------------------ +LibNode V 2.0.0-1 - A. Gibert - 26/11/01 +------------------------------------------------------------------------------------------------------------------------------------ + +All: Merge the main CVS trunc with the win32 branche (2.0.0-alpha5), + Switch file release to 2.0. + + + +------------------------------------------------------------------------------------------------------------------------------------ +LibNode V 2.0.0-alpha5 - A. Gibert - 25/10/01 +------------------------------------------------------------------------------------------------------------------------------------ + +LibNode: Add Open/Close Index support, +LibNode: Fix return code next to empty struct manipulations, +NdBench: Add full multi index support. + + + +------------------------------------------------------------------------------------------------------------------------------------ +LibNode V 2.0.0-alpha4 - A. Gibert - 28/09/01 +------------------------------------------------------------------------------------------------------------------------------------ + +All: Add optional libver support, +LibNode: Fix missing recursive offset args, +LibNode: Start to fix some return code of empty struct manipulations, +NdBench: Fix local stack pointer big bug. + + + +------------------------------------------------------------------------------------------------------------------------------------ +LibNode V 2.0.0-alpha3 - A. Gibert - 18/9/01 +------------------------------------------------------------------------------------------------------------------------------------ + +New manager args interface (again !), +ndbench support batch mode. + + + +------------------------------------------------------------------------------------------------------------------------------------ +LibNode V 2.0.0-alpha2 - A. Gibert - 08/09/01 +------------------------------------------------------------------------------------------------------------------------------------ + +Re-enable libver support for unix, +Bug fixes, +Code cleanup. + + + +------------------------------------------------------------------------------------------------------------------------------------ +LibNode V 2.0.0-alpha1 - A. Gibert - 07/09/01 +------------------------------------------------------------------------------------------------------------------------------------ + +Add Full win32 support, +Remove libver support, +Multi index support, +New manager args format, +Major Code cleanup et standardisation. +This new version (2.0.x) is developped for the TIMA project (Misys IBS - France). + + + +------------------------------------------------------------------------------------------------------------------------------------ +LibNode V 1.0.0 - S. Mas / A. Gibert - 18/07/00 +------------------------------------------------------------------------------------------------------------------------------------ + +Unix (Linux and Solaris) version only, for BDM project (Société Générale - Paris) +Major code rewrite. + + + +------------------------------------------------------------------------------------------------------------------------------------ +LibNode V 0.2.2 - A. Gibert - 01/06/93 +------------------------------------------------------------------------------------------------------------------------------------ + +Embeded version on OS/2 2.1 (Companie Générale des Eaux - Paris) + + + +------------------------------------------------------------------------------------------------------------------------------------ +LibNode V 0.2.1 - A. Gibert - 01/04/92 +------------------------------------------------------------------------------------------------------------------------------------ + +Amiga and PC support (Bareau de Draguignan - Ste Maxime). + + + +------------------------------------------------------------------------------------------------------------------------------------ +LibNode V 0.2.0 - A. Gibert - 01/03/91 +------------------------------------------------------------------------------------------------------------------------------------ + +C version aided by p2c tools on Pyramid (Swansee University - Wales). + + + +------------------------------------------------------------------------------------------------------------------------------------ +LibNode V 0.1.0 - A. Gibert - 01/12/90 +------------------------------------------------------------------------------------------------------------------------------------ + +Inital version in Pascal on Pyramid (Swansee University - Wales). diff --git a/src/libnode/ToDo.txt b/src/libnode/ToDo.txt new file mode 100644 index 0000000..e7ef09a --- /dev/null +++ b/src/libnode/ToDo.txt @@ -0,0 +1,14 @@ +# %RCSfile: ToDo.txt,v % +# %Revision: 2.5 % +# %Name: libnode-2_1_0-1 % +# %Date: 2005/01/24 01:19:50 % +# %Author: agibert % + + + + + +- Check LibShMem/LibDataStr support (via symbol lookup support), +- Add Cache Value option, +- New English documentation (man/tex), +- Improve API consitency. diff --git a/src/libnode/demo/nddemo0.c b/src/libnode/demo/nddemo0.c new file mode 100644 index 0000000..444ce55 --- /dev/null +++ b/src/libnode/demo/nddemo0.c @@ -0,0 +1,686 @@ +/*---------------------------------------------------------------------------------*/ +/* %RCSfile: nddemo0.c,v % */ +/*---------------------------------------------------------------------------------*/ +/* %Revision: 2.8 % */ +/* %Name: libnode-2_1_0-1 % */ +/* %Date: 2004/08/23 22:48:37 % */ +/* %Author: agibert % */ +/*---------------------------------------------------------------------------------*/ + +/*---------------------------------------------------------------------------------*/ +/* This file is part of LibNode */ +/* */ +/* LibNode is free software; you can redistribute it and/or modify */ +/* it under the terms of the GNU General Public Licence as published by */ +/* the Free Software Foundation; either version 2 of the License, or */ +/* (at your option) any later version. */ +/* */ +/* LibNode is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU Lesser General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with LibNode; if not, write to the Free Software */ +/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/*---------------------------------------------------------------------------------*/ + + + + + +#include +#include + +#include + + + +#define DEMO_FILE_NAME "nddemo0.dat" +#define STRING_LEN ( short) 1024 +#define STRING_SIZE ( short) ( STRING_LEN + 1) +#define VAL_LEN ( short) 64 +#define VAL_SIZE ( short) ( VAL_LEN + 1) +#define INDEX_NB ( short) 4 + +#define NDD_CMD_INDEX0_PRINT ( NDT_Command) 64 +#define NDD_CMD_INDEX1_PRINT ( NDT_Command) 65 +#define NDD_CMD_INDEX2_PRINT ( NDT_Command) 66 +#define NDD_CMD_INDEX3_PRINT ( NDT_Command) 67 + + + +typedef struct Demo_Value +{ + char Val0[ VAL_SIZE]; + char Val1[ VAL_SIZE]; + char Val2[ VAL_SIZE]; + char Val3[ VAL_SIZE]; +} Demo_Value; + + + +/*---------------------------------------------------------------------------------*/ +/* Prototypes */ +/*---------------------------------------------------------------------------------*/ + +NDT_Status Demo_DS_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list); +void DataStruct_Load( NDT_Root *, FILE *); +void DataStruct_Load( NDT_Root *, FILE *); +void Demo( char *, short); +int main( int, char **); + + + + + + + +/*---------------------------------------------------------------------------------*/ +/* */ +/*---------------------------------------------------------------------------------*/ + +NDT_Status Demo_DS_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node *Node_Ptr, NDT_Command Command, va_list Args) +{ + NDT_Command_Name Command_Name; + + + switch( Command) + { + case NDD_CMD_MANAGER_VERSION: + { + NDT_Version_Name *Version_Name_Ptr = (NDT_Version_Name *)va_arg( Args, NDT_Version_Name *); + + + Command_Name = "NDD_CMD_MANAGER_VERSION"; + + *Version_Name_Ptr = "%Revision: 2.8 % %Name: libnode-2_1_0-1 % %Date: 2004/08/23 22:48:37 % %Author: agibert %"; + + return( NDS_OK); + } + + case NDD_CMD_INDEX_GET: + { + /* + NDT_Index_Id *Reply_Index_Id_Ptr = (NDT_Index_Id *)va_arg( Args, NDT_Index_Id *); + NDT_Command *Reply_Command_Ptr = (NDT_Command *)va_arg( Args, NDT_Command *); + NDT_Command Cmd = (NDT_Command)va_arg( Args, NDT_Command); + void *Value_ptr = (void *)va_arg( Args, void *); + */ + NDT_Index_Id *Reply_Index_Id_Ptr = (NDT_Index_Id *)va_arg( Args, NDT_Index_Id *); + NDT_Command *Reply_Command_Ptr = (NDT_Command *)va_arg( Args, NDT_Command *); + NDT_Command Cmd = (NDT_Command)va_arg( Args, NDT_Command); + Demo_Value *Value_ptr = (Demo_Value *)va_arg( Args, Demo_Value *); + + + Command_Name = "NDD_CMD_INDEX_GET"; + + switch(Cmd) + { + case NDD_CMD_INDEX0_PRINT: + { + *Reply_Index_Id_Ptr = 0; + *Reply_Command_Ptr = NDD_CMD_VALUE_PRINT; + break; + } + + case NDD_CMD_INDEX1_PRINT: + { + *Reply_Index_Id_Ptr = 1; + *Reply_Command_Ptr = NDD_CMD_VALUE_PRINT; + break; + } + + case NDD_CMD_INDEX2_PRINT: + { + *Reply_Index_Id_Ptr = 2; + *Reply_Command_Ptr = NDD_CMD_VALUE_PRINT; + break; + } + + case NDD_CMD_INDEX3_PRINT: + { + *Reply_Index_Id_Ptr = 3; + *Reply_Command_Ptr = NDD_CMD_VALUE_PRINT; + break; + } + + default: + { + *Reply_Index_Id_Ptr = Index_Id; + *Reply_Command_Ptr = Cmd; + break; + } + } + + return( NDS_OK); + } + + case NDD_CMD_VALUE_ALLOC: + { + /* + void **Value_Ptr_Ptr = (void **)va_arg( Args, void **); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + Demo_Value **Value_Ptr_Ptr = va_arg( Args, Demo_Value **); + + + Command_Name = "NDD_CMD_VALUE_ALLOC"; + + if( ( *Value_Ptr_Ptr = (Demo_Value *)malloc( sizeof(Demo_Value))) == NULL) + { + return(NDS_ERRMEM); + } + else + { + (*Value_Ptr_Ptr)->Val0[0] = '\0'; + (*Value_Ptr_Ptr)->Val1[0] = '\0'; + (*Value_Ptr_Ptr)->Val2[0] = '\0'; + (*Value_Ptr_Ptr)->Val3[0] = '\0'; + + return( NDS_OK); + } + } + + case NDD_CMD_VALUE_FREE: + { + /* + void *Value_Ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + Demo_Value *Value_Ptr = (Demo_Value *)va_arg( Args, Demo_Value *); + + + Command_Name = "NDD_CMD_VALUE_FREE"; + + free( Value_Ptr); + + return( NDS_OK); + } + + case NDD_CMD_VALUE_COMP: + { + /* + void *Value1_Ptr = (void *)va_arg( Args, void *); + void *Value2_Ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + Demo_Value *Value1_Ptr = va_arg( Args, Demo_Value *); + Demo_Value *Value2_Ptr = va_arg( Args, Demo_Value *); + + + Command_Name = "NDD_CMD_VALUE_COMP"; + + switch( Index_Id) + { + case 0: + { + int rc; + + + rc = strcmp( Value1_Ptr->Val0, Value2_Ptr->Val0); + + if( rc < 0) + { + return( NDS_LOWER); + } + else + { + if( rc > 0) + { + return( NDS_GREATER); + } + else + { + return( NDS_EQUAL); + } + } + } + + case 1: + { + int val1 = atoi( Value1_Ptr->Val1); + int val2 = atoi( Value2_Ptr->Val1); + + + if( val1 < val2) + { + return( NDS_LOWER); + } + else + { + if( val1 > val2) + { + return( NDS_GREATER); + } + else + { + return( NDS_EQUAL); + } + } + } + + case 2: + { + int val1 = strlen( Value1_Ptr->Val2); + int val2 = strlen( Value2_Ptr->Val2); + + + if( val1 < val2) + { + return( NDS_LOWER); + } + else + { + if( val1 > val2) + { + return( NDS_GREATER); + } + else + { + return( NDS_EQUAL); + } + } + } + + default: + { + printf( "Unknown COMP idx (%d) !\n", Index_Id); + return( NDS_KO); + } + } + + return( NDS_OK); + } + + case NDD_CMD_VALUE_ADD: + { + /* + void *Value_Ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + + Command_Name = "NDD_CMD_VALUE_ADD"; + + return( NDS_OK); + } + + case NDD_CMD_VALUE_REMOVE: + { + /* + void *Value_Ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + + Command_Name = "NDD_CMD_VALUE_REMOVE"; + + return( NDS_OK); + } + + case NDD_CMD_VALUE_PRINT: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + va_list user_args = (va_list)va_arg( lib_args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + + void *Value_Ptr = Node_Ptr->Value; + */ + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + + Demo_Value *Value_Ptr = Node_Ptr->Value; + + + Command_Name = "NDD_CMD_VALUE_PRINT"; + + fprintf( Out, "Val0: (%s) Val1: (%s) Val2: (%s) Val3: (%s)\n", + Value_Ptr->Val0, Value_Ptr->Val1, Value_Ptr->Val2, Value_Ptr->Val3); + + return( NDS_OK); + } + + case NDD_CMD_INFO_PRINT: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + va_list user_args = (va_list)va_arg( lib_args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + + void *Value_Ptr = Node_Ptr->Value; + */ + + Command_Name = "NDD_CMD_INFO_PRINT"; + + return( NDS_OK); + } + + default: + { + printf( "Demo_DS_Manager() called with an undefined command %d\n", Command); + return( NDS_ERRAPI); + } + } + + printf( "Demo_DS_Manager() called with command %d (%s)\n", Command, Command_Name); + return( NDS_OK); +} + + + + + +/*---------------------------------------------------------------------------------*/ +/* */ +/*---------------------------------------------------------------------------------*/ + +void DataStruct_Load( NDT_Root *ds_ptr, FILE *demo_file) +{ + NDT_Status status; + char *str; + char input_string[STRING_SIZE]; + char val0[VAL_SIZE], val1[VAL_SIZE], val2[VAL_SIZE], val3[VAL_SIZE]; + Demo_Value *value_ptr; + + + while( !feof( demo_file)) + { + str = fgets( input_string, STRING_SIZE, demo_file); + if( ( (const int)str != EOF) && ( str != NULL)) + { + if( strlen( input_string) >= STRING_LEN) + { + printf( "Input line too long ! Skipping ..."); + + while( !feof( demo_file) && strlen( input_string) >= STRING_LEN) + { + printf( "."); + str = fgets( input_string, STRING_SIZE, demo_file); + } + + printf("\n"); + } + else + { + if( input_string[0] != '#') + { + if( sscanf( input_string, "%s %s %s %s\n", val0, val1, val2, val3) != 4) + { + printf( "Input line scaning error... Skipping !\n"); + } + else + { + printf( "Input line read: \t(%s)\t(%s)\t(%s)\t(%s)\n", val0, val1, val2, val3); + printf( "Allocate Vallue: "); + + if( ( status = ND_Value_Alloc( ds_ptr, (void **)&value_ptr)) != NDS_OK) + { + printf( "ND_Value_Alloc() failed (%d) !\n", status); + } + else + { + printf( "Ok !\n"); + + strcpy( value_ptr->Val0, val0); + strcpy( value_ptr->Val1, val1); + strcpy( value_ptr->Val2, val2); + strcpy( value_ptr->Val3, val3); + + printf( "Add Vallue: "); + + if( ( status = ND_DataStruct_Value_Add( ds_ptr, (void **)value_ptr)) != NDS_OK) + { + printf( "ND_Value_Add() failed (%d) !\n", status); + } + else + { + printf( "Ok !\n"); + } + } + } + } + } + } + } +} + + + + + +/*---------------------------------------------------------------------------------*/ +/* */ +/*---------------------------------------------------------------------------------*/ + +void DataStruct_Dump( NDT_Root *ds_ptr) +{ + NDT_Status status; + + + printf( "Print DataStructure Info:\n"); + + if( ( status = ND_DataStruct_Info_Print( stdout, ds_ptr, NDD_RECURSIVE_MODE_PARENT_CHILD, 0, 0)) != NDS_OK) + { + printf( "ND_DataStruct_Info_Print() failed (%d) !\n", status); + } + + printf( "\n"); + + + + printf( "Traverse DataStructure Index 0:\n"); + + if( ( status = ND_DataStruct_Traverse( ds_ptr, NDD_CMD_INDEX0_PRINT, stdout, NDD_RECURSIVE_MODE_PARENT, 0)) != NDS_OK) + { + printf( "ND_DataStruct_Traverse() failed (%d) !\n", status); + } + + printf( "\n"); + + + + printf( "Traverse DataStructure Index 1:\n"); + + if( ( status = ND_DataStruct_Traverse( ds_ptr, NDD_CMD_INDEX1_PRINT, stdout, NDD_RECURSIVE_MODE_PARENT, 0)) != NDS_OK) + { + printf( "ND_DataStruct_Traverse() failed (%d) !\n", status); + } + + printf( "\n"); + + + + printf( "Traverse DataStructure Index 2:\n"); + + if( ( status = ND_DataStruct_Traverse( ds_ptr, NDD_CMD_INDEX2_PRINT, stdout, NDD_RECURSIVE_MODE_PARENT, 0)) != NDS_OK) + { + printf( "ND_DataStruct_Traverse() failed (%d) !\n", status); + } + + printf( "\n"); + + + + printf( "Traverse DataStructure Index 3:\n"); + + if( ( status = ND_DataStruct_Traverse( ds_ptr, NDD_CMD_INDEX3_PRINT, stdout, NDD_RECURSIVE_MODE_PARENT, 0)) != NDS_OK) + { + printf( "ND_DataStruct_Traverse() failed (%d) !\n", status); + } + + printf( "\n"); +} + + + + + +/*---------------------------------------------------------------------------------*/ +/* */ +/*---------------------------------------------------------------------------------*/ + +void Demo( char *Demo_File_Name, short Optimized_Mode) +{ + NDT_Status status; + NDT_Root *demo_ds_ptr; + NDT_Index_Type index_type_initial_tab[INDEX_NB] = + { + (NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_LIST | NDD_INDEX_SUBTYPE_FIFO), + (NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_LIST | NDD_INDEX_SUBTYPE_FIFO), + (NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_LIST | NDD_INDEX_SUBTYPE_FIFO), + (NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_LIST | NDD_INDEX_SUBTYPE_FIFO) + }; + NDT_Index_Type index_type_final_tab[INDEX_NB] = + { + (NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_TREE | NDD_INDEX_SUBTYPE_BALANCED), + (NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_LIST | NDD_INDEX_SUBTYPE_SORTED), + (NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_TREE | NDD_INDEX_SUBTYPE_BALANCED), + (NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_LIST | NDD_INDEX_SUBTYPE_FIFO) + }; + NDT_Index_Type *index_type_ptr; + FILE *demo_file; + + + printf( "Open library: "); + + if( ( status = ND_Library_Open( NDD_TRUE)) != NDS_OK) + { + printf( "ND_Library_Open() failed (%d) !\n", status); + } + else + { + printf( "Ok !\n"); + + printf( "Create demo DataStructure: "); + + if( Optimized_Mode) + { + index_type_ptr = index_type_initial_tab; + } + else + { + index_type_ptr = index_type_final_tab; + } + + if( ( status = ND_DataStruct_Open( &demo_ds_ptr, INDEX_NB, index_type_ptr, "Demo_DS_Manager", Demo_DS_Manager, NULL, NULL, NULL, NULL,0, NULL)) != NDS_OK) + { + printf( "ND_DataStruct_Open() failed (%d) !\n", status); + } + else + { + printf( "Ok !\n"); + + printf( "Open demo datafile: "); + + if( ( demo_file = fopen( Demo_File_Name, "r")) == NULL) + { + printf( "fopen() failed (%d/%s) !\n", errno, strerror(errno)); + } + else + { + printf( "Ok !\n"); + + + + printf( "\n\n\nLaod Data File:\n\n"); + DataStruct_Load( demo_ds_ptr, demo_file); + + if( Optimized_Mode) + { + printf( "\n\n\nInitial Structure Dump:\n\n"); + DataStruct_Dump( demo_ds_ptr); + + printf( "Convert data structure: "); + + if( ( status = ND_DataStruct_Convert( demo_ds_ptr, index_type_final_tab)) != NDS_OK) + { + printf( "ND_DataStruct_Convert() failed (%d) !\n", status); + } + else + { + printf( "Ok !\n"); + } + } + + + + printf( "\n\n\nFinal Structure Dump:\n\n"); + DataStruct_Dump( demo_ds_ptr); + + printf( "Close demo datafile: "); + + if( fclose( demo_file) != 0) + { + printf( "fclose() failed (%d/%s) !\n", errno, strerror(errno)); + } + else + { + printf( "Ok !\n"); + } + } + + + printf( "Close demo DataStructure: "); + + if( ( status = ND_DataStruct_Close( demo_ds_ptr)) != NDS_OK) + { + printf( "ND_DataStruct_Close() failed (%d) !\n", status); + } + else + { + printf( "Ok !\n"); + } + } + + printf( "Close library: "); + + if( ( status = ND_Library_Close()) != NDS_OK) + { + printf( "ND_Library_Close() failed (%d) !\n", status); + } + else + { + printf( "Ok !\n"); + } + } +} + + + + + +/*---------------------------------------------------------------------------------*/ +/* */ +/*---------------------------------------------------------------------------------*/ + +int main( int argc, char **argv) +{ + printf( "Non Optimized Demo\n------------------\n\n\n"); + Demo( DEMO_FILE_NAME, 0); + + printf( "\n\n\n\n\nOptimized Demo\n--------------\n\n\n"); + Demo( DEMO_FILE_NAME, 1); +} diff --git a/src/libnode/demo/nddemo0.dat b/src/libnode/demo/nddemo0.dat new file mode 100644 index 0000000..07ddfe8 --- /dev/null +++ b/src/libnode/demo/nddemo0.dat @@ -0,0 +1,15 @@ +#--------------------------------------------------------------------------------- +# %RCSfile: nddemo0.dat,v % +#--------------------------------------------------------------------------------- +# %Revision: 2.1 % +# %Name: libnode-2_1_0-1 % +# %Date: 2003/07/16 00:17:02 % +# %Author: agibert % +#--------------------------------------------------------------------------------- +ggg 1 xxxxxx example +aaa 7 x this +bbb 6 xxx is +ccc 5 xxxxx a +ddd 4 xxxx really +eee 3 xxxxxxx good +fff 2 xx libnode diff --git a/src/libnode/include/node.h b/src/libnode/include/node.h new file mode 100644 index 0000000..2d83cda --- /dev/null +++ b/src/libnode/include/node.h @@ -0,0 +1,926 @@ +/*----------------------------------------------------------------------------*/ +/* $Workfile: node.h $ */ +/*----------------------------------------------------------------------------*/ +/* $Author: agibert $ */ +/* $Date: 2008/11/12 02:25:23 $ */ +/* $Revision: 1.1 $ */ +/* $Label: $ */ +/*----------------------------------------------------------------------------*/ + +/*---------------------------------------------------------------------------------*/ +/* %RCSfile: node.h,v % */ +/*---------------------------------------------------------------------------------*/ +/* %Revision: 2.12 % */ +/* %Name: libnode-2_1_0-1 % */ +/* %Date: 2005/01/20 00:00:25 % */ +/* %Author: agibert % */ +/*---------------------------------------------------------------------------------*/ + +/*---------------------------------------------------------------------------------*/ +/* This file is part of LibNode */ +/* */ +/* LibNode is free software; you can redistribute it and/or modify */ +/* it under the terms of the GNU Lesser General Public Licence as published by */ +/* the Free Software Foundation; either version 2.1 of the License, or */ +/* (at your option) any later version. */ +/* */ +/* LibNode is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU Lesser General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU Lesser General Public License */ +/* along with LibNode; if not, write to the Free Software */ +/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/*---------------------------------------------------------------------------------*/ + + + + + + +#ifndef _LIBNODE_H_ +# define _LIBNODE_H_ + +# ifdef __cplusplus +extern "C" { +# endif + +# include +# include +# include +# include + +# ifdef _LIBVER_SUPPORT +# include +# endif + + + + + + + +#define NDD_TRUE 1 + +#define NDD_FALSE 0 + +#define NDD_MIN(A,B) ((A > B) ? B : A) + +#define NDD_MAX(A,B) ((A < B) ? B : A) + + + +/* + Différence de profondeur entre la branche la plus courte et + la plus longue d'un arbre. + Le dépassement de ce seuil provoque le rééquilibrage de l'arbre +*/ + +#define DEF_MAX_DIF 100 + +/* Types de structure */ + +typedef short NDT_Root_Type; + +typedef int NDT_Index_Type; + +#define NDD_INDEX_MSK 0xffff +#define NDD_INDEX_RMSK 0x0000 + +#define NDD_INDEX_STATUS_UNKNOWN 0x0000 +#define NDD_INDEX_STATUS_OPENED 0x0001 +#define NDD_INDEX_STATUS_CLOSED 0x0002 +#define NDD_INDEX_STATUS_MSK (NDD_INDEX_STATUS_UNKNOWN | NDD_INDEX_STATUS_OPENED | NDD_INDEX_STATUS_CLOSED) +#define NDD_INDEX_STATUS_RMSK (NDD_INDEX_MSK ^ NDD_INDEX_STATUS_MSK) + +#define ND_INDEX_STATUS_VALUE_UNKNOWN_IS( v) ( ( (v) & NDD_INDEX_STATUS_MSK) == NDD_INDEX_STATUS_UNKNOWN) +#define ND_INDEX_STATUS_VALUE_OPENED_IS( v) ( ( (v) & NDD_INDEX_STATUS_MSK) == NDD_INDEX_STATUS_OPENED) +#define ND_INDEX_STATUS_VALUE_CLOSED_IS( v) ( ( (v) & NDD_INDEX_STATUS_MSK) == NDD_INDEX_STATUS_CLOSED) +#define ND_INDEX_STATUS_UNKNOWN_IS( r, i) ND_INDEX_STATUS_VALUE_UNKNOWN_IS( (r)->Index_Tab[(i)].Type) +#define ND_INDEX_STATUS_OPENED_IS( r, i) ND_INDEX_STATUS_VALUE_OPENED_IS( (r)->Index_Tab[(i)].Type) +#define ND_INDEX_STATUS_CLOSED_IS( r, i) ND_INDEX_STATUS_VALUE_CLOSED_IS( (r)->Index_Tab[(i)].Type) + +#define ND_INDEX_STATUS_VALUE_ASCII_GET( v) ( ND_INDEX_STATUS_VALUE_UNKNOWN_IS( (v)) ? "UNKNOWN" : ( ND_INDEX_STATUS_VALUE_OPENED_IS( (v)) ? "OPENED" : ( ND_INDEX_STATUS_VALUE_CLOSED_IS( (v)) ? "CLOSED" : "???"))) +#define ND_INDEX_STATUS_ASCII_GET( r, i) ND_INDEX_STATUS_VALUE_ASCII_GET( (r)->Index_Tab[(i)].Type) + + + +#define NDD_INDEX_TYPE_UNKNOWN 0x0000 +#define NDD_INDEX_TYPE_LIST 0x0010 +#define NDD_INDEX_TYPE_TREE 0x0020 +#define NDD_INDEX_TYPE_MSK (NDD_INDEX_TYPE_UNKNOWN | NDD_INDEX_TYPE_LIST | NDD_INDEX_TYPE_TREE) +#define NDD_INDEX_TYPE_RMSK (NDD_INDEX_MSK ^ NDD_INDEX_TYPE_MSK) + +#define ND_INDEX_TYPE_VALUE_UNKNOWN_IS( v) ( ( (v) & NDD_INDEX_TYPE_MSK) == NDD_INDEX_TYPE_UNKNOWN) +#define ND_INDEX_TYPE_VALUE_LIST_IS( v) ( ( (v) & NDD_INDEX_TYPE_MSK) == NDD_INDEX_TYPE_LIST) +#define ND_INDEX_TYPE_VALUE_TREE_IS( v) ( ( (v) & NDD_INDEX_TYPE_MSK) == NDD_INDEX_TYPE_TREE) + +#define ND_INDEX_TYPE_UNKNOWN_IS( r, i) ND_INDEX_TYPE_VALUE_UNKNOWN_IS( (r)->Index_Tab[(i)].Type) +#define ND_INDEX_TYPE_LIST_IS( r, i) ND_INDEX_TYPE_VALUE_LIST_IS( (r)->Index_Tab[(i)].Type) +#define ND_INDEX_TYPE_TREE_IS( r, i) ND_INDEX_TYPE_VALUE_TREE_IS( (r)->Index_Tab[(i)].Type) + +#define ND_INDEX_TYPE_VALUE_ASCII_GET( v) ( ND_INDEX_TYPE_VALUE_UNKNOWN_IS( (v)) ? "UNKNOWN" : ( ND_INDEX_TYPE_VALUE_LIST_IS( (v)) ? "LIST" : ( ND_INDEX_TYPE_VALUE_TREE_IS( (v)) ? "TREE" : "???"))) + +#define ND_INDEX_TYPE_ASCII_GET( r, i) ND_INDEX_TYPE_VALUE_ASCII_GET( (r)->Index_Tab[(i)].Type) + + + +#define NDD_INDEX_SUBTYPE_UNKNOWN 0x0000 +#define NDD_INDEX_SUBTYPE_FIFO 0x0100 /* principe de la file d'attente (First In First Out) */ +#define NDD_INDEX_SUBTYPE_LILO NDD_INDEX_SUBTYPE_FIFO +#define NDD_INDEX_SUBTYPE_LIFO 0x0200 /* principe de la pile (First In Last Out) */ +#define NDD_INDEX_SUBTYPE_FILO NDD_INDEX_SUBTYPE_LIFO +#define NDD_INDEX_SUBTYPE_SORTED 0x0300 /* liste triée */ +#define NDD_INDEX_SUBTYPE_UNBALANCED 0x0400 +#define NDD_INDEX_SUBTYPE_BALANCED 0x0500 /* arbre auto-équilibré */ +#define NDD_INDEX_SUBTYPE_MSK ( NDD_INDEX_SUBTYPE_UNKNOWN | NDD_INDEX_SUBTYPE_FIFO | NDD_INDEX_SUBTYPE_FILO | NDD_INDEX_SUBTYPE_SORTED | NDD_INDEX_SUBTYPE_UNBALANCED | NDD_INDEX_SUBTYPE_BALANCED) +#define NDD_INDEX_SUBTYPE_RMSK (NDD_INDEX_MSK ^ NDD_INDEX_SUBTYPE_MSK) + +#define ND_INDEX_SUBTYPE_VALUE_UNKNOWN_IS( v) ( ( (v) & NDD_INDEX_SUBTYPE_MSK) == NDD_INDEX_SUBTYPE_UNKNOWN) +#define ND_INDEX_SUBTYPE_VALUE_FIFO_IS( v) ( ( (v) & NDD_INDEX_SUBTYPE_MSK) == NDD_INDEX_SUBTYPE_FIFO) +#define ND_INDEX_SUBTYPE_VALUE_LILO_IS( v) ND_INDEX_SUBTYPE_VALUE_FIFO_IS( v) +#define ND_INDEX_SUBTYPE_VALUE_LIFO_IS( v) ( ( (v) & NDD_INDEX_SUBTYPE_MSK) == NDD_INDEX_SUBTYPE_LIFO) +#define ND_INDEX_SUBTYPE_VALUE_FILO_IS( v) ND_INDEX_SUBTYPE_LIFO_IS( r, i) +#define ND_INDEX_SUBTYPE_VALUE_SORTED_IS( v) ( ( (v) & NDD_INDEX_SUBTYPE_MSK) == NDD_INDEX_SUBTYPE_SORTED) +#define ND_INDEX_SUBTYPE_VALUE_UNBALANCED_IS( v) ( ( (v) & NDD_INDEX_SUBTYPE_MSK) == NDD_INDEX_SUBTYPE_UNBALANCED) +#define ND_INDEX_SUBTYPE_VALUE_BALANCED_IS( v) ( ( (v) & NDD_INDEX_SUBTYPE_MSK) == NDD_INDEX_SUBTYPE_BALANCED) + +#define ND_INDEX_SUBTYPE_UNKNOWN_IS( r, i) ND_INDEX_SUBTYPE_VALUE_UNKNOWN_IS( (r)->Index_Tab[(i)].Type) +#define ND_INDEX_SUBTYPE_FIFO_IS( r, i) ND_INDEX_SUBTYPE_VALUE_FIFO_IS( (r)->Index_Tab[(i)].Type) +#define ND_INDEX_SUBTYPE_LILO_IS( r, i) ND_INDEX_SUBTYPE_VALUE_LILO_IS( (r)->Index_Tab[(i)].Type) +#define ND_INDEX_SUBTYPE_LIFO_IS( r, i) ND_INDEX_SUBTYPE_VALUE_LIFO_IS( (r)->Index_Tab[(i)].Type) +#define ND_INDEX_SUBTYPE_FILO_IS( r, i) ND_INDEX_SUBTYPE_VALUE_FILO_IS( (r)->Index_Tab[(i)].Type) +#define ND_INDEX_SUBTYPE_SORTED_IS( r, i) ND_INDEX_SUBTYPE_VALUE_SORTED_IS( (r)->Index_Tab[(i)].Type) +#define ND_INDEX_SUBTYPE_UNBALANCED_IS( r, i) ND_INDEX_SUBTYPE_VALUE_UNBALANCED_IS( (r)->Index_Tab[(i)].Type) +#define ND_INDEX_SUBTYPE_BALANCED_IS( r, i) ND_INDEX_SUBTYPE_VALUE_BALANCED_IS( (r)->Index_Tab[(i)].Type) + +#define ND_INDEX_SUBTYPE_VALUE_ASCII_GET( v) ( ND_INDEX_SUBTYPE_VALUE_UNKNOWN_IS( v) ? "UNKNOWN" : ( ND_INDEX_SUBTYPE_VALUE_FIFO_IS( v) ? "FIFO" : ( ND_INDEX_SUBTYPE_VALUE_LIFO_IS( v) ? "LIFO" : ( ND_INDEX_SUBTYPE_VALUE_SORTED_IS( v) ? "SORTED" : ( ND_INDEX_SUBTYPE_VALUE_UNBALANCED_IS( v) ? "UNBALANCED" : ( ND_INDEX_SUBTYPE_VALUE_BALANCED_IS( v) ? "BALANCED" : "???")))))) +#define ND_INDEX_SUBTYPE_ASCII_GET( r, i) ND_INDEX_SUBTYPE_VALUE_ASCII_GET( (r)->Index_Tab[(i)].Type) + + + +/* Commandes du manager */ + +typedef int NDT_Command; + +#define NDD_CMD_UNKNOWN (NDT_Command)0 +#define NDD_CMD_MANAGER_VERSION (NDT_Command)1 +#define NDD_CMD_INDEX_GET (NDT_Command)2 +#define NDD_CMD_VALUE_ALLOC (NDT_Command)3 +#define NDD_CMD_VALUE_FREE (NDT_Command)4 +#define NDD_CMD_VALUE_COMP (NDT_Command)5 +#define NDD_CMD_VALUE_ADD (NDT_Command)6 +#define NDD_CMD_VALUE_REMOVE (NDT_Command)7 +#define NDD_CMD_VALUE_PRINT (NDT_Command)8 +#define NDD_CMD_VALUE_FIND (NDT_Command)9 +#define NDD_CMD_INFO_PRINT (NDT_Command)10 + +#define NDD_CMD_USER_TRAVERSE (NDT_Command)17 + + +typedef char *NDT_Command_Name; +typedef char *NDT_Version_Name; + + + +/* Types de réponse du manager ou code retour des diverses fonctions */ + +typedef int NDT_Status; + +#define ND_ERROR(s) ((s) <= 0) /* All negative or 0 status are errors */ + +#define NDS_OK 1 +#define NDS_KO 0 + +#define NDS_YES 1 +#define NDS_NO 0 + +#define NDS_EQUAL 1 +#define NDS_GREATER 2 +#define NDS_LOWER 3 + +#define NDS_ERRMEM -1 /* Problème d'allocation mémoire */ +#define NDS_ERRAPI -2 /* Utilisation incorrecte des API */ + + + +typedef short NDT_Index_Id; +typedef short NDT_Index_Nb; + +#define NDD_INDEX_UNKNOWN (NDT_Index_Id)-1 +#define NDD_INDEX_PRIMARY (NDT_Index_Id)0 + + + +struct NDT_Root; +struct NDT_Node; + + + +/* Pointeur de fonction sur le manager */ + +#define NDD_MANAGER_NAME_LEN_MAX 64 +#define NDD_MANAGER_NAME_SIZE_MAX (NDD_MANAGER_NAME_LEN_MAX + 1) + +typedef char *NDT_Manager_Name; + +typedef NDT_Status NDT_Manager( struct NDT_Root *, NDT_Index_Id, struct NDT_Node *, NDT_Command, va_list); + + +/* Pointeur de fonction sur l'allocateur */ + +#define NDD_ALLOCATOR_NAME_LEN_MAX 64 +#define NDD_ALLOCATOR_NAME_SIZE_MAX (NDD_ALLOCATOR_NAME_LEN_MAX + 1) + +typedef char *NDT_Allocator_Name; + +typedef NDT_Status NDT_Allocator( void **, size_t, void *); + + +/* Pointeur de fonction sur le désallocateur */ + +#define NDD_DESALLOCATOR_NAME_LEN_MAX 64 +#define NDD_DESALLOCATOR_NAME_SIZE_MAX (NDD_DESALLOCATOR_NAME_LEN_MAX + 1) + +typedef char *NDT_Desallocator_Name; + +typedef NDT_Status NDT_Desallocator( void *, void *); + + + + +typedef struct NDT_Index +{ + NDT_Index_Type Type; /* Type de la structure (liste, arbre ... ) */ + + long Node_Number; /* Nombre de noeuds dans la structure */ + long Min_Depth; /* Profondeur minimale de l'arbre */ + long Max_Depth; /* Profondeur maximale de l'arbre */ + long Max_Dif; /* Différence maximale autorisée entre la branche la plus courte et la plus longue */ + long Nb_Equ; /* Nombre de réquilibrages réalisés sur l'arbre */ + struct NDT_Node *Head; /* Noeud de tête */ + struct NDT_Node *Tail; /* Noeud de queue */ + struct NDT_Node *Save; /* Pointeur de sauvegarde (utile pour la fonction de restauration) */ + +} NDT_Index; + + + +typedef struct NDT_Root +{ +/* NDT_Root_Type Type;*/ /* Root Structure Type */ +/* NDT_DataStruct_Type DS_Type;*/ /* Type de la structure (liste, arbre ... ) */ + + NDT_Manager *Manager_Ptr; /* Pointeur sur la fonction manager */ + char Manager_Name[NDD_MANAGER_NAME_SIZE_MAX]; /* Nom de la fonction manager */ + NDT_Allocator *Allocator_Ptr; /* Pointeur sur la fonction d'allocation */ + char Allocator_Name[NDD_ALLOCATOR_NAME_SIZE_MAX]; /* Nom de la fonction d'allocation */ + NDT_Desallocator *Desallocator_Ptr; /* Pointeur sur la fonction de désallocation */ + char Desallocator_Name[NDD_DESALLOCATOR_NAME_SIZE_MAX]; /* Nom de la fonction de désallocation */ + + short Own_Value; /* Indique si la structure est propriétaire de ses valeurs */ + void *User_Ptr; /* Pointeur utilisable librement par l'utilisateur */ + + NDT_Index_Nb Index_Nb; + NDT_Index_Nb Index_Open_Count; + NDT_Index Index_Tab[1]; + +} NDT_Root; + + + +typedef struct NDT_DataStruct +{ + + NDT_Root *Root_Ptr; + + NDT_Manager *Manager_Ptr; /* Manager function pointer */ + NDT_Allocator *Allocator_Ptr; /* Allocator function pointer */ + NDT_Desallocator *Desallocator_Ptr; /* Desallocator function pointer */ + +} NDT_DataStruct; + + + +/* Structure de noeud */ + +typedef struct NDT_Node +{ + NDT_Root *Root; + NDT_Index_Id Index; + struct NDT_Node *Parent; + struct NDT_Node *Left; + struct NDT_Node *Right; + void *Value; +} NDT_Node; + + + +typedef int NDT_Recursive_Mode; +typedef int NDT_Recursive_Depth; +typedef int NDT_Recursive_Offset; + +#define NDD_RECURSIVE_MODE_UNKNOWN (NDT_Recursive_Mode)0x00 +#define NDD_RECURSIVE_MODE_PARENT (NDT_Recursive_Mode)0x01 +#define NDD_RECURSIVE_MODE_CHILD (NDT_Recursive_Mode)0x02 +#define NDD_RECURSIVE_MODE_PARENT_CHILD (NDT_Recursive_Mode)0x03 + +#define ND_RECURSIVE_PARENT_IS(m) (m & NDD_RECURSIVE_MODE_PARENT) +#define ND_RECURSIVE_CHILD_IS(m) (m & NDD_RECURSIVE_MODE_CHILD) + +#define ND_RECURSIVE_PRINT_OFFSET 8 + + + +/* Définition des alias de l'API */ + +#ifndef ND_MODE +#define ND_MODE 0 +#endif + +#if ND_MODE == 1 /* API sans vérification des arguments */ + +#define ND_Library_Open ND_Library_Open_I +#define ND_Library_Close ND_Library_Close_I +#define ND_Library_StdErr_Set ND_Library_StdErr_Set_I + +#define ND_DataStruct_Open ND_DataStruct_Open_I +#define ND_DataStruct_Close ND_DataStruct_Close_I +#define ND_DataStruct_Flush ND_DataStruct_Flush_I +#define ND_DataStruct_Check ND_DataStruct_Check_I +#define ND_DataStruct_Convert ND_DataStruct_Convert_I +#define ND_DataStruct_Reorg ND_DataStruct_Reorg_I +#define ND_DataStruct_Traverse_V ND_DataStruct_Traverse_VI +#define ND_DataStruct_Traverse ND_DataStruct_Traverse_I +#define ND_DataStruct_Info_Print ND_DataStruct_Info_Print_I +#define ND_DataStruct_Value_Add ND_DataStruct_Value_Add_I +#define ND_DataStruct_Value_Remove ND_DataStruct_Value_Remove_I +#define ND_DataStruct_Value_Print ND_DataStruct_Value_Print_I +#define ND_DataStruct_Value_Find ND_DataStruct_Value_Find_I + +#define ND_Index_Open ND_Index_Open_I +#define ND_Index_Close ND_Index_Close_I +#define ND_Index_Flush ND_Index_Flush_I +#define ND_Index_Check ND_Index_Check_I +#define ND_Index_Convert ND_Index_Convert_I +#define ND_Index_Reorg ND_Index_Reorg_I +#define ND_Index_Traverse_V ND_Index_Traverse_VI +#define ND_Index_Traverse ND_Index_Traverse_I +#define ND_Index_Info_Print ND_Index_Info_Print_I +#define ND_Index_Value_Add ND_Index_Value_Add_I +#define ND_Index_Value_Remove ND_Index_Value_Remove_I +#define ND_Index_Value_Print ND_Index_Value_Print_I +#define ND_Index_Node_Add ND_Index_Node_Add_I +#define ND_Index_Node_Remove ND_Index_Node_Remove_I +#define ND_Index_Node_First_Get ND_Index_Node_First_Get_I +#define ND_Index_Node_Last_Get ND_Index_Node_Last_Get_I +#define ND_Index_Node_Next_Get ND_Index_Node_Next_Get_I +#define ND_Index_Node_Previous_Get ND_Index_Node_Previous_Get_I +#define ND_Index_Node_Find ND_Index_Node_Find_I + +#define ND_Node_Root_Get ND_Node_Root_Get_I + +#define ND_Value_Alloc ND_Value_Alloc_I +#define ND_Value_Free ND_Value_Free_I + +#define ND_Manager_Exec_V ND_Manager_Exec_VI +#define ND_Manager_Exec ND_Manager_Exec_I +#define ND_Allocator_Exec ND_Allocator_Exec_I +#define ND_Desallocator_Exec ND_Desallocator_Exec_I + +#else /* API avec vérification des arguments */ + +#define ND_Library_Open ND_Library_Open_C +#define ND_Library_Close ND_Library_Close_C +#define ND_Library_StdErr_Set ND_Library_StdErr_Set_C + +#define ND_DataStruct_Open ND_DataStruct_Open_C +#define ND_DataStruct_Close ND_DataStruct_Close_C +#define ND_DataStruct_Flush ND_DataStruct_Flush_C +#define ND_DataStruct_Check ND_DataStruct_Check_C +#define ND_DataStruct_Convert ND_DataStruct_Convert_C +#define ND_DataStruct_Reorg ND_DataStruct_Reorg_C +#define ND_DataStruct_Traverse_V ND_DataStruct_Traverse_VC +#define ND_DataStruct_Traverse ND_DataStruct_Traverse_C +#define ND_DataStruct_Info_Print ND_DataStruct_Info_Print_C +#define ND_DataStruct_Value_Add ND_DataStruct_Value_Add_C +#define ND_DataStruct_Value_Remove ND_DataStruct_Value_Remove_C +#define ND_DataStruct_Value_Print ND_DataStruct_Value_Print_C +#define ND_DataStruct_Value_Find ND_DataStruct_Value_Find_C + +#define ND_Index_Open ND_Index_Open_C +#define ND_Index_Close ND_Index_Close_C +#define ND_Index_Flush ND_Index_Flush_C +#define ND_Index_Check ND_Index_Check_C +#define ND_Index_Convert ND_Index_Convert_C +#define ND_Index_Reorg ND_Index_Reorg_C +#define ND_Index_Traverse_V ND_Index_Traverse_VC +#define ND_Index_Traverse ND_Index_Traverse_C +#define ND_Index_Info_Print ND_Index_Info_Print_C +#define ND_Index_Value_Add ND_Index_Value_Add_C +#define ND_Index_Value_Remove ND_Index_Value_Remove_C +#define ND_Index_Value_Print ND_Index_Value_Print_C +#define ND_Index_Node_Add ND_Index_Node_Add_C +#define ND_Index_Node_Remove ND_Index_Node_Remove_C +#define ND_Index_Node_First_Get ND_Index_Node_First_Get_C +#define ND_Index_Node_Last_Get ND_Index_Node_Last_Get_C +#define ND_Index_Node_Next_Get ND_Index_Node_Next_Get_C +#define ND_Index_Node_Previous_Get ND_Index_Node_Previous_Get_C +#define ND_Index_Node_Find ND_Index_Node_Find_C + +#define ND_Node_Root_Get ND_Node_Root_Get_C + +#define ND_Value_Alloc ND_Value_Alloc_C +#define ND_Value_Free ND_Value_Free_C + +#define ND_Manager_Exec_V ND_Manager_Exec_VC +#define ND_Manager_Exec ND_Manager_Exec_C +#define ND_Allocator_Exec ND_Allocator_Exec_C +#define ND_Desallocator_Exec ND_Desallocator_Exec_C + +#endif + + + +/*------------------------------------------------------------------------------*/ + +# if defined(_WIN32) && !defined(LIBNODE_STATIC) +# ifndef _LIBNODE_C_ +# define NDD_DLL_API __declspec(dllimport) +# else +# define NDD_DLL_API __declspec(dllexport) +# endif +# else +# define NDD_DLL_API +# endif + + + +/*------------------------------------------------------------------------------*/ +/* Initialisation du contexte de la librairie */ +/*------------------------------------------------------------------------------*/ +NDD_DLL_API NDT_Status ND_Library_Open_I ( int Debug_Mode ); +NDD_DLL_API NDT_Status ND_Library_Open_C ( int Debug_Mode ); + + + +/*------------------------------------------------------------------------------*/ +/* Fermeture du contexte de la librairie */ +/*------------------------------------------------------------------------------*/ +NDD_DLL_API NDT_Status ND_Library_Close_I( void); +NDD_DLL_API NDT_Status ND_Library_Close_C( void); + + + +/*------------------------------------------------------------------------------*/ +/* Définition de la sortie standard des messages d'erreur de la librairie */ +/*------------------------------------------------------------------------------*/ +NDD_DLL_API NDT_Status ND_Library_StdErr_Set_I( FILE *); +NDD_DLL_API NDT_Status ND_Library_StdErr_Set_C( FILE *); + + + +/*------------------------------------------------------------------------------*/ +/* Création d'une nouvelle structure de données */ +/*------------------------------------------------------------------------------*/ +/* (O) Root: adresse d'un pointeur sur la racine de la nouvelle structure */ +/* (I) Type: type de la structure.de données (liste ou arbre binaire) */ +/* (I) Allocator: pointeur vers la fonction d'allocation */ +/* (I) Desallocator: pointeur vers la fonction de désallocation */ +/* (I) Data : pointeur de données utiles à l'allocateur */ +/* (I) Own_Value : indique si la structure est propriétaire de ses valeurs */ +/*------------------------------------------------------------------------------*/ +NDD_DLL_API NDT_Status ND_DataStruct_Open_I( NDT_Root **, NDT_Index_Nb, NDT_Index_Type *, NDT_Manager_Name, NDT_Manager *, NDT_Allocator_Name, NDT_Allocator *, NDT_Desallocator_Name, NDT_Desallocator *, short, void *); +NDD_DLL_API NDT_Status ND_DataStruct_Open_C( NDT_Root **, NDT_Index_Nb, NDT_Index_Type *, NDT_Manager_Name, NDT_Manager *, NDT_Allocator_Name, NDT_Allocator *, NDT_Desallocator_Name, NDT_Desallocator *, short, void *); + + + +/*------------------------------------------------------------------------------*/ +/* Destruction d'une structure de données */ +/*------------------------------------------------------------------------------*/ +/* (O) Root: pointeur sur la racine de la structure de données */ +/*------------------------------------------------------------------------------*/ +NDD_DLL_API NDT_Status ND_DataStruct_Close_I( NDT_Root *); +NDD_DLL_API NDT_Status ND_DataStruct_Close_C( NDT_Root *); + + + +/*------------------------------------------------------------------------------*/ +/* Destruction d'une structure de données */ +/*------------------------------------------------------------------------------*/ +/* (O) Root: pointeur sur la racine de la structure de données */ +/*------------------------------------------------------------------------------*/ +NDD_DLL_API NDT_Status ND_DataStruct_Flush_I( NDT_Root *); +NDD_DLL_API NDT_Status ND_DataStruct_Flush_C( NDT_Root *); + + + +/*------------------------------------------------------------------------------*/ +/* Function de réparation d'une structure : */ +/* - vérifie que tous les noeuds sont correctement liés les uns aux autres */ +/* - corrige les informations statistiques de la racine */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la structure */ +/* (O) Nb_Detected : pointeur sur le nombre d'erreurs */ +/* (O) Nb_Corrected : pointeur sur le nombre d'erreurs */ +/* (I) Out : flux de sortie du rapport */ +/*------------------------------------------------------------------------------*/ +NDD_DLL_API NDT_Status ND_DataStruct_Check_I( NDT_Root *, int *, int *, FILE *); +NDD_DLL_API NDT_Status ND_DataStruct_Check_C( NDT_Root *, int *, int *, FILE *); + + + +/*------------------------------------------------------------------------------*/ +/* Réorganisation d'une structure de données : */ +/* - ordonnancement d'une liste non ordonnée */ +/* - réquilibrage d'un arbre non auto-équilibré */ +/*------------------------------------------------------------------------------*/ +/* (I) Root: pointeur sur la racine de la structure de données */ +/*------------------------------------------------------------------------------*/ +NDD_DLL_API NDT_Status ND_DataStruct_Reorg_I( NDT_Root *); +NDD_DLL_API NDT_Status ND_DataStruct_Reorg_C( NDT_Root *); + + + +/*------------------------------------------------------------------------------*/ +/* Conversion d'une structure de données d'un type en un autre */ +/*------------------------------------------------------------------------------*/ +/* (I) Root: pointeur sur la racine de la structure de données */ +/* (I) Target_Type: type de structure cible */ +/*------------------------------------------------------------------------------*/ +NDD_DLL_API NDT_Status ND_DataStruct_Convert_I( NDT_Root *, NDT_Index_Type *); +NDD_DLL_API NDT_Status ND_DataStruct_Convert_C( NDT_Root *, NDT_Index_Type *); + + + +/*------------------------------------------------------------------------------*/ +/* Parcours de tous les noeuds d'une structure de données et exécution d'une */ +/* commande sur chacun d'eux */ +/*------------------------------------------------------------------------------*/ +/* (I) Root: pointeur sur la racine de la structure de données */ +/* (I) Command: Commande à exécuter sur chaque noeud traversé */ +/* (I) Data: pointeur de données utilisateur */ +/*------------------------------------------------------------------------------*/ +NDD_DLL_API NDT_Status ND_DataStruct_Traverse_VI( NDT_Root *, NDT_Command, va_list); +NDD_DLL_API NDT_Status ND_DataStruct_Traverse_VC( NDT_Root *, NDT_Command, va_list); +NDD_DLL_API NDT_Status ND_DataStruct_Traverse_I( NDT_Root *, NDT_Command, ...); +NDD_DLL_API NDT_Status ND_DataStruct_Traverse_C( NDT_Root *, NDT_Command, ...); + + + +/*------------------------------------------------------------------------------*/ +/* Affichage d'informations sur une structure de données */ +/*------------------------------------------------------------------------------*/ +/* (I) Root: pointeur sur la racine de la structure de données */ +/* (I) Out : flux de sortie */ +/*------------------------------------------------------------------------------*/ +NDD_DLL_API NDT_Status ND_DataStruct_Info_Print_I( FILE *, NDT_Root *, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset); +NDD_DLL_API NDT_Status ND_DataStruct_Info_Print_C( FILE *, NDT_Root *, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset); + + + +/*------------------------------------------------------------------------------*/ +/* Ajout d'une valeur à une structure de données */ +/*------------------------------------------------------------------------------*/ +/* (I) Root: pointeur sur la racine de la structure de données */ +/* (I) Value: pointeur sur la valeur à ajouter */ +/*------------------------------------------------------------------------------*/ +NDD_DLL_API NDT_Status ND_DataStruct_Value_Add_I( NDT_Root *, void *); +NDD_DLL_API NDT_Status ND_DataStruct_Value_Add_C( NDT_Root *, void *); + + + +/*------------------------------------------------------------------------------*/ +/* Suppression du premier noeud correspondant à une valeur donnée */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la structure de données */ +/* (I) Reference_Value : pointeur sur la valeur de référence */ +/* (I) Removed_Value : adresse d'un pointeur sur la valeur supprimée */ +/*------------------------------------------------------------------------------*/ +NDD_DLL_API NDT_Status ND_DataStruct_Value_Remove_I( NDT_Root *, void *); +NDD_DLL_API NDT_Status ND_DataStruct_Value_Remove_C( NDT_Root *, void *); + + + +/*------------------------------------------------------------------------------*/ +/* Affichage de la valeur de tous les noeuds d'une structure de données */ +/*------------------------------------------------------------------------------*/ +/* (I) Root: pointeur sur la racine de la structure de données */ +/* (I) Out : flux de sortie */ +/*------------------------------------------------------------------------------*/ +NDD_DLL_API NDT_Status ND_DataStruct_Value_Print_VI( FILE *, NDT_Root *, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset, va_list); +NDD_DLL_API NDT_Status ND_DataStruct_Value_Print_I( FILE *, NDT_Root *, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset, ...); +NDD_DLL_API NDT_Status ND_DataStruct_Value_Print_C( FILE *, NDT_Root *, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset, ...); + + + +/*------------------------------------------------------------------------------*/ +/* Recherche un noeud à partir d'une valeur */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de l'abre */ +/* (O) Node : pointeur sur le noeud à récuperer */ +/* (I) Value : pointeur sur la valeur à rechercher */ +/* (I) Data : pointeur de données */ +/*------------------------------------------------------------------------------*/ + +NDD_DLL_API NDT_Status ND_DataStruct_Value_Find_VI( void **, NDT_Root *, void *, va_list); +NDD_DLL_API NDT_Status ND_DataStruct_Value_Find_VC( void **, NDT_Root *, void *, va_list); +NDD_DLL_API NDT_Status ND_DataStruct_Value_Find_I( void **, NDT_Root *, void *, ...); +NDD_DLL_API NDT_Status ND_DataStruct_Value_Find_C( void **, NDT_Root *, void *, ...); + + + +/*------------------------------------------------------------------------------*/ +/* Create a new index (not yet implemented !) */ +/*------------------------------------------------------------------------------*/ +/* (O) Root: adresse d'un pointeur sur la racine de la nouvelle structure */ +/* (I) Type: type de la structure.de données (liste ou arbre binaire) */ +/* (I) Allocator: pointeur vers la fonction d'allocation */ +/* (I) Desallocator: pointeur vers la fonction de désallocation */ +/* (I) Data : pointeur de données utiles à l'allocateur */ +/* (I) Own_Value : indique si la structure est propriétaire de ses valeurs */ +/*------------------------------------------------------------------------------*/ +NDD_DLL_API NDT_Status ND_Index_Open_I( NDT_Root *, NDT_Index_Id, NDT_Index_Type); +NDD_DLL_API NDT_Status ND_Index_Open_C( NDT_Root *, NDT_Index_Id, NDT_Index_Type); + + + +/*------------------------------------------------------------------------------*/ +/* Remove an Index (not yet implemented !) */ +/*------------------------------------------------------------------------------*/ +/* (O) Root: pointeur sur la racine de la structure de données */ +/*------------------------------------------------------------------------------*/ +NDD_DLL_API NDT_Status ND_Index_Close_I( NDT_Root *, NDT_Index_Id); +NDD_DLL_API NDT_Status ND_Index_Close_C( NDT_Root *, NDT_Index_Id); + + + +/*------------------------------------------------------------------------------*/ +/* Remove an Index (not yet implemented !) */ +/*------------------------------------------------------------------------------*/ +/* (O) Root: pointeur sur la racine de la structure de données */ +/*------------------------------------------------------------------------------*/ +NDD_DLL_API NDT_Status ND_Index_Flush_I( NDT_Root *, NDT_Index_Id); +NDD_DLL_API NDT_Status ND_Index_Flush_C( NDT_Root *, NDT_Index_Id); + + + +/*------------------------------------------------------------------------------*/ +/* Function de réparation d'une structure : */ +/* - vérifie que tous les noeuds sont correctement liés les uns aux autres */ +/* - corrige les informations statistiques de la racine */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la structure */ +/* (O) Nb_Detected : pointeur sur le nombre d'erreurs */ +/* (O) Nb_Corrected : pointeur sur le nombre d'erreurs */ +/* (I) Out : flux de sortie du rapport */ +/*------------------------------------------------------------------------------*/ +NDD_DLL_API NDT_Status ND_Index_Check_I( NDT_Root *, NDT_Index_Id, int *, int *, FILE *); +NDD_DLL_API NDT_Status ND_Index_Check_C( NDT_Root *, NDT_Index_Id, int *, int *, FILE *); + + + +/*------------------------------------------------------------------------------*/ +/* Conversion d'une structure de données d'un type en un autre */ +/*------------------------------------------------------------------------------*/ +/* (I) Root: pointeur sur la racine de la structure de données */ +/* (I) Target_Type: type de structure cible */ +/*------------------------------------------------------------------------------*/ +NDD_DLL_API NDT_Status ND_Index_Convert_I ( NDT_Root *, NDT_Index_Id, NDT_Index_Type); +NDD_DLL_API NDT_Status ND_Index_Convert_C ( NDT_Root *, NDT_Index_Id, NDT_Index_Type); + + + +/*------------------------------------------------------------------------------*/ +/* Réorganisation d'une structure de données : */ +/* - ordonnancement d'une liste non ordonnée */ +/* - réquilibrage d'un arbre non auto-équilibré */ +/*------------------------------------------------------------------------------*/ +/* (I) Root: pointeur sur la racine de la structure de données */ +/*------------------------------------------------------------------------------*/ +NDD_DLL_API NDT_Status ND_Index_Reorg_I( NDT_Root *, NDT_Index_Id); +NDD_DLL_API NDT_Status ND_Index_Reorg_C( NDT_Root *, NDT_Index_Id); + + + +/*------------------------------------------------------------------------------*/ +/* Parcours de tous les noeuds d'une structure de données et exécution d'une */ +/* commande sur chacun d'eux */ +/*------------------------------------------------------------------------------*/ +/* (I) Root: pointeur sur la racine de la structure de données */ +/* (I) Command: Commande à exécuter sur chaque noeud traversé */ +/* (I) Data: pointeur de données utilisateur */ +/*------------------------------------------------------------------------------*/ +NDD_DLL_API NDT_Status ND_Index_Traverse_VI( NDT_Root *, NDT_Index_Id, NDT_Command, va_list); +NDD_DLL_API NDT_Status ND_Index_Traverse_VC( NDT_Root *, NDT_Index_Id, NDT_Command, va_list); +NDD_DLL_API NDT_Status ND_Index_Traverse_I( NDT_Root *, NDT_Index_Id, NDT_Command, ...); +NDD_DLL_API NDT_Status ND_Index_Traverse_C( NDT_Root *, NDT_Index_Id, NDT_Command, ...); + + + +/*------------------------------------------------------------------------------*/ +/* Parcours de tous les noeuds d'une structure de données et exécution d'une */ +/* commande sur chacun d'eux */ +/*------------------------------------------------------------------------------*/ +/* (I) Root: pointeur sur la racine de la structure de données */ +/* (I) Command: Commande à exécuter sur chaque noeud traversé */ +/* (I) Data: pointeur de données utilisateur */ +/*------------------------------------------------------------------------------*/ +NDD_DLL_API NDT_Status ND_Index_Info_Print_I( FILE *, NDT_Root *, NDT_Index_Id, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset); +NDD_DLL_API NDT_Status ND_Index_Info_Print_C( FILE *, NDT_Root *, NDT_Index_Id, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset); + + + +/*------------------------------------------------------------------------------*/ +/* Ajout d'une valeur à une structure de données */ +/*------------------------------------------------------------------------------*/ +/* (I) Root: pointeur sur la racine de la structure de données */ +/* (I) Value: pointeur sur la valeur à ajouter */ +/*------------------------------------------------------------------------------*/ +NDD_DLL_API NDT_Status ND_Index_Value_Add_I( NDT_Root *, NDT_Index_Id, void *); +NDD_DLL_API NDT_Status ND_Index_Value_Add_C( NDT_Root *, NDT_Index_Id, void *); + + + +/*------------------------------------------------------------------------------*/ +/* Suppression du premier noeud correspondant à une valeur donnée */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la structure de données */ +/* (I) Reference_Value : pointeur sur la valeur de référence */ +/* (I) Removed_Value : adresse d'un pointeur sur la valeur supprimée */ +/*------------------------------------------------------------------------------*/ +NDD_DLL_API NDT_Status ND_Index_Value_Remove_I( NDT_Root *, NDT_Index_Id, void *); +NDD_DLL_API NDT_Status ND_Index_Value_Remove_C( NDT_Root *, NDT_Index_Id, void *); + + + +/*------------------------------------------------------------------------------*/ +/* Affichage de la valeur de tous les noeuds d'une structure de données */ +/*------------------------------------------------------------------------------*/ +/* (I) Root: pointeur sur la racine de la structure de données */ +/* (I) Out : flux de sortie */ +/*------------------------------------------------------------------------------*/ +NDD_DLL_API NDT_Status ND_Index_Value_Print_VI( FILE *, NDT_Root *, NDT_Index_Id, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset, va_list); +NDD_DLL_API NDT_Status ND_Index_Value_Print_I( FILE *, NDT_Root *, NDT_Index_Id, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset, ...); +NDD_DLL_API NDT_Status ND_Index_Value_Print_C( FILE *, NDT_Root *, NDT_Index_Id, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset, ...); + + + +/*------------------------------------------------------------------------------*/ +/* Ajout d'un noeud à une structure de données */ +/*------------------------------------------------------------------------------*/ +/* (I) Root: pointeur sur la racine de la structure de données */ +/* (I) Node: pointeur sur le noeud à ajouter */ +/*------------------------------------------------------------------------------*/ +NDD_DLL_API NDT_Status ND_Index_Node_Add_I( NDT_Root *, NDT_Index_Id, NDT_Node *); +NDD_DLL_API NDT_Status ND_Index_Node_Add_C( NDT_Root *, NDT_Index_Id, NDT_Node *); + + + +/*------------------------------------------------------------------------------*/ +/* Suppression d'un noeud dans une structure de données */ +/*------------------------------------------------------------------------------*/ +/* (I) Node: pointeur sur le noeud à supprimer de la structure de données */ +/*------------------------------------------------------------------------------*/ +NDD_DLL_API NDT_Status ND_Index_Node_Remove_I( NDT_Node *); +NDD_DLL_API NDT_Status ND_Index_Node_Remove_C( NDT_Node *); + + + +/*------------------------------------------------------------------------------*/ +/* Récupération du premier noeud d'une structure */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine dont on cherche le premier noeud */ +/* (O) Node : pointeur sur le noeud à récupérer */ +/*------------------------------------------------------------------------------*/ +NDD_DLL_API NDT_Status ND_Index_Node_First_Get_I( NDT_Node **, NDT_Root *, NDT_Index_Id); +NDD_DLL_API NDT_Status ND_Index_Node_First_Get_C( NDT_Node **, NDT_Root *, NDT_Index_Id); + + + +/*------------------------------------------------------------------------------*/ +/* Récupération du dernier noeud d'une structure */ +/*------------------------------------------------------------------------------*/ +/* (I) Root: pointeur sur la racine dont on cherche le dernier noeud */ +/* (O) Node : pointeur sur le noeud à récupérer */ +/*------------------------------------------------------------------------------*/ +NDD_DLL_API NDT_Status ND_Index_Node_Last_Get_I( NDT_Node **, NDT_Root *, NDT_Index_Id); +NDD_DLL_API NDT_Status ND_Index_Node_Last_Get_C( NDT_Node **, NDT_Root *, NDT_Index_Id); + + + +/*------------------------------------------------------------------------------*/ +/* Récupération du noeud suivant */ +/*------------------------------------------------------------------------------*/ +/* (I) Node: pointeur sur le noeud dont on cherche le suivant */ +/* (O) Next_Node : pointeur sur le noeud suivant */ +/*------------------------------------------------------------------------------*/ +NDD_DLL_API NDT_Status ND_Index_Node_Next_Get_I( NDT_Node **, NDT_Node *); +NDD_DLL_API NDT_Status ND_Index_Node_Next_Get_C( NDT_Node **, NDT_Node *); + + + +/*------------------------------------------------------------------------------*/ +/* Récupération du noeud précédant */ +/*------------------------------------------------------------------------------*/ +/* (I) Node: pointeur sur le noeud dont on cherche le précédant */ +/* (O) Prev_Node : pointeur sur le noeud précédant */ +/*------------------------------------------------------------------------------*/ +NDD_DLL_API NDT_Status ND_Index_Node_Previous_Get_I( NDT_Node **, NDT_Node *); +NDD_DLL_API NDT_Status ND_Index_Node_Previous_Get_C( NDT_Node **, NDT_Node *); + + + +/*------------------------------------------------------------------------------*/ +/* Recherche un noeud à partir d'une valeur */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de l'abre */ +/* (O) Node : pointeur sur le noeud à récuperer */ +/* (I) Value : pointeur sur la valeur à rechercher */ +/* (I) Data : pointeur de données */ +/*------------------------------------------------------------------------------*/ +NDD_DLL_API NDT_Status ND_Index_Node_Find_VI( NDT_Node **, NDT_Root *, NDT_Index_Id, void *, va_list); +NDD_DLL_API NDT_Status ND_Index_Node_Find_VC( NDT_Node **, NDT_Root *, NDT_Index_Id, void *, va_list); +NDD_DLL_API NDT_Status ND_Index_Node_Find_I( NDT_Node **, NDT_Root *, NDT_Index_Id, void *, ...); +NDD_DLL_API NDT_Status ND_Index_Node_Find_C( NDT_Node **, NDT_Root *, NDT_Index_Id, void *, ...); + + + +/*------------------------------------------------------------------------------*/ +/* Récupération de la racine d'une structure */ +/*------------------------------------------------------------------------------*/ +/* (O) Root: Adresse du pointeur sur la racine à récupérer */ +/* (I) Node: pointeur sur le noeud dont on cherche la racine */ +/*------------------------------------------------------------------------------*/ +NDD_DLL_API NDT_Status ND_Node_Root_Get_I( NDT_Root **, NDT_Node *); +NDD_DLL_API NDT_Status ND_Node_Root_Get_C( NDT_Root **, NDT_Node *); + + + +/*------------------------------------------------------------------------------*/ +/* Allocation d'une valeur d'une structure de données */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la structure de données */ +/* (O) Value : adresse d'un pointeur sur la valeur à allouer */ +/* (I) ... : arguments relatifs à l'allocation de la valeur */ +/*------------------------------------------------------------------------------*/ +NDD_DLL_API NDT_Status ND_Value_Alloc_I( NDT_Root *, void **, ...); +NDD_DLL_API NDT_Status ND_Value_Alloc_C( NDT_Root *, void **, ...); + + + +/*------------------------------------------------------------------------------*/ +/* Désallocation d'une valeur d'une structure de données */ +/*------------------------------------------------------------------------------*/ +/* (I) Root: pointeur sur la racine de la structure de données */ +/* (I) Value: pointeur sur la valeur à désallouer */ +/*------------------------------------------------------------------------------*/ +NDD_DLL_API NDT_Status ND_Value_Free_I( NDT_Root *, void *); +NDD_DLL_API NDT_Status ND_Value_Free_C( NDT_Root *, void *); + + + +/*------------------------------------------------------------------------------*/ +/* Exécution d'une fonction Manager dont le nom est passé en paramètre */ +/*------------------------------------------------------------------------------*/ +/* (I) Function : nom de la fonction manager à exécuter */ +/*------------------------------------------------------------------------------*/ +NDD_DLL_API NDT_Status ND_Manager_Exec_VI( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list); +NDD_DLL_API NDT_Status ND_Manager_Exec_VC( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list); +NDD_DLL_API NDT_Status ND_Manager_Exec_I( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, ...); +NDD_DLL_API NDT_Status ND_Manager_Exec_C( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, ...); + + + +/*------------------------------------------------------------------------------*/ +/* Exécution d'une fonction d'allocation dont le nom est passé en paramètre */ +/*------------------------------------------------------------------------------*/ +/* (I) Function : nom de la fonction à exécuter */ +/* (O) Ptr : adresse d'un pointeur sur la zone à allouer */ +/* (I) Size : taille de la zone à allouer */ +/* (I) Data : pointeur de données utiles à l'allocateur */ +/*------------------------------------------------------------------------------*/ +NDD_DLL_API NDT_Status ND_Allocator_Exec_I( void **, size_t, NDT_Allocator_Name, NDT_Allocator *, void *); +NDD_DLL_API NDT_Status ND_Allocator_Exec_C( void **, size_t, NDT_Allocator_Name, NDT_Allocator *, void *); + + + +/*------------------------------------------------------------------------------*/ +/* Exécution d'une fonction de désallocation le dont nom est passé en paramètre */ +/*------------------------------------------------------------------------------*/ +/* (I) Function : nom de la fonction à exécuter */ +/* (I) Function : nom de la fonction à exécuter */ +/* (I) Ptr : adresse de la zone à désallouer */ +/* (I) Data : pointeur de données utiles au désallocateur */ +/*------------------------------------------------------------------------------*/ +NDD_DLL_API NDT_Status ND_Desallocator_Exec_I( void *, NDT_Desallocator_Name, NDT_Desallocator *, void *); +NDD_DLL_API NDT_Status ND_Desallocator_Exec_C( void *, NDT_Desallocator_Name, NDT_Desallocator *, void *); + + + +# ifdef __cplusplus +} +# endif + +#endif diff --git a/src/libnode/src/Makefile b/src/libnode/src/Makefile new file mode 100644 index 0000000..bbd7722 --- /dev/null +++ b/src/libnode/src/Makefile @@ -0,0 +1,42 @@ +#------------------------------------------------------------------------------ +# Local Makefile +#------------------------------------------------------------------------------ +# $Workfile: Makefile $ +#------------------------------------------------------------------------------ +# $Author: agibert $ +# $Date: 2008/11/12 02:25:23 $ +# $Revision: 1.1 $ +# $Label: $ +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# Var include +#------------------------------------------------------------------------------ + +include ../../Makefile_var.mk + + + +#------------------------------------------------------------------------------ +# Variables +#------------------------------------------------------------------------------ + +TARGET= libnode$(SHLIB_SUFFIX) + +OBJ= libnode.o + +#EXTRA_INC= + +#EXTRA_LIB= + + + +#------------------------------------------------------------------------------ +# Rule include +#------------------------------------------------------------------------------ + +include ../../Makefile_rule.mk diff --git a/src/libnode/src/libnode.c b/src/libnode/src/libnode.c new file mode 100644 index 0000000..3145883 --- /dev/null +++ b/src/libnode/src/libnode.c @@ -0,0 +1,5819 @@ +/*----------------------------------------------------------------------------*/ +/* $Workfile: libnode.c $ */ +/*----------------------------------------------------------------------------*/ +/* $Author: agibert $ */ +/* $Date: 2008/11/12 02:25:23 $ */ +/* $Revision: 1.1 $ */ +/* $Label: $ */ +/*----------------------------------------------------------------------------*/ + +/*---------------------------------------------------------------------------------*/ +/* %RCSfile: libnode.c,v % */ +/*---------------------------------------------------------------------------------*/ +/* %Revision: 2.15 % */ +/* %Name: libnode-2_1_0-1 % */ +/* %Date: 2005/01/19 23:59:41 % */ +/* %Author: agibert % */ +/*---------------------------------------------------------------------------------*/ + +/*---------------------------------------------------------------------------------*/ +/* This file is part of LibNode */ +/* */ +/* LibNode is free software; you can redistribute it and/or modify */ +/* it under the terms of the GNU Lesser General Public Licence as published by */ +/* the Free Software Foundation; either version 2.1 of the License, or */ +/* (at your option) any later version. */ +/* */ +/* LibNode is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU Lesser General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU Lesser General Public License */ +/* along with LibNode; if not, write to the Free Software */ +/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/*---------------------------------------------------------------------------------*/ + + + + + +#define _LIBNODE_C_ + +#include + +#ifdef _LIBVER_SUPPORT +VER_INFO_EXPORT( libnode, "%Revision: 2.15 %", "%Name: libnode-2_1_0-1 %", __FILE__, "%Author: agibert %") +#endif + +char IMRG_ND_WHAT_IDENT[] = "@(#) VERSIONIMR: $Label: $ $Date: 2008/11/12 02:25:23 $ $Workfile: libnode.c $"; + + + + + + + +/*------------------------------------------------------------------------------*/ +/*------------------------------------------------------------------------------*/ +/* Node Manager Template */ +/*------------------------------------------------------------------------------*/ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Default_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node *Node_Ptr, NDT_Command Command, va_list Args) +{ + NDT_Command_Name Command_Name; + + + switch( Command) + { + case NDD_CMD_MANAGER_VERSION: + { + NDT_Version_Name *Version_Name_Ptr = (NDT_Version_Name *)va_arg( Args, NDT_Version_Name *); + + + Command_Name = "NDD_CMD_MANAGER_VERSION"; + + *Version_Name_Ptr = "%Revision: 2.15 % %Name: libnode-2_1_0-1 % %Date: 2005/01/19 23:59:41 % %Author: agibert %"; + + return( NDS_OK); + } + + case NDD_CMD_INDEX_GET: + { + /* + NDT_Index_Id *Reply_Index_Id_Ptr = (NDT_Index_Id *)va_arg( Args, NDT_Index_Id *); + NDT_Command *Reply_Command_Ptr = (NDT_Command *)va_arg( Args, NDT_Command *); + NDT_Command Cmd = (NDT_Command)va_arg( Args, NDT_Command); + void *Value_ptr = (void *)va_arg( Args, void *); + */ + NDT_Index_Id *Reply_Index_Id_Ptr = (NDT_Index_Id *)va_arg( Args, NDT_Index_Id *); + NDT_Command *Reply_Command_Ptr = (NDT_Command *)va_arg( Args, NDT_Command *); + NDT_Command Cmd = (NDT_Command)va_arg( Args, NDT_Command); + void *Value_ptr = (void *)va_arg( Args, void *); + + + Command_Name = "NDD_CMD_INDEX_GET"; + + switch(Cmd) + { + /* + case NDT_CMD_SOME_USER_CMD: + { + *Reply_Index_Id_Ptr = 0; + *Reply_Command_Ptr = NDD_CMD_SOME_OTHER_CMD; + break; + } + + ... + */ + + default: + { + *Reply_Index_Id_Ptr = Index_Id; + *Reply_Command_Ptr = Cmd; + break; + } + } + + return( NDS_OK); + } + + case NDD_CMD_VALUE_ALLOC: + { + /* + void **Value_Ptr_Ptr = (void **)va_arg( Args, void **); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + + + Command_Name = "NDD_CMD_VALUE_ALLOC"; + + /* + if( ( *Value_Ptr_Ptr = (void *)malloc( sizeof(void))) == NULL) + { + return(NDS_ERRMEM); + } + else + { + ... + + return( NDS_OK); + } + */ + } + + case NDD_CMD_VALUE_FREE: + { + /* + void *Value_Ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + + + Command_Name = "NDD_CMD_VALUE_FREE"; + + /* + free( Value_Ptr); + + return( NDS_OK); + */ + } + + case NDD_CMD_VALUE_COMP: + { + /* + void *Value1_Ptr = (void *)va_arg( Args, void *); + void *Value2_Ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + + + Command_Name = "NDD_CMD_VALUE_COMP"; + + /* + switch( Index_Id) + { + case 0: + { + int rc; + + + rc = strcmp( Value1_Ptr->..., Value2_Ptr->...); + + if( rc < 0) + { + return(NDS_LOWER); + } + else + { + if( rc > 0) + { + return(NDS_GREATER); + } + else + { + return(NDS_EQUAL); + } + } + } + + case 1: + { + int val1 = atoi(Value1_Ptr->...); + int val2 = atoi(Value2_Ptr->...); + + + if( val1 < val2) + { + return(NDS_LOWER); + } + else + { + if( val1 > val2) + { + return(NDS_GREATER); + } + else + { + return(NDS_EQUAL); + } + } + } + + case 2: + { + ... + } + + default: + { + printf( "Unknown COMP idx (%d) !\n", Index_Id); + return( NDS_KO); + } + } + + return( NDS_OK); + */ + } + + case NDD_CMD_VALUE_ADD: + { + /* + void *Value_Ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + + + Command_Name = "NDD_CMD_VALUE_ADD"; + + /* + return( NDS_OK); + */ + } + + case NDD_CMD_VALUE_REMOVE: + { + /* + void *Value_Ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + + + Command_Name = "NDD_CMD_VALUE_REMOVE"; + /* + return( NDS_OK); + */ + } + + case NDD_CMD_VALUE_PRINT: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + NDT_Recursive_Offset Recursive_Offset = (NDT_Recursive_Offset)va_arg( lib_args, NDT_Recursive_Offset); + va_list user_args = (va_list)va_arg( lib_args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + + void *Value_Ptr = Node_Ptr->Value; + */ + + + Command_Name = "NDD_CMD_VALUE_PRINT"; + + /* + fprintf( Out, "...\n", Value_Ptr->..., ...); + + return( NDS_OK); + */ + } + + case NDD_CMD_INFO_PRINT: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + NDT_Recursive_Offset Recursive_Offset = (NDT_Recursive_Offset)va_arg( lib_args, NDT_Recursive_Offset); + va_list user_args = (va_list)va_arg( lib_args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + + void *Value_Ptr = Node_Ptr->Value; + */ + + + Command_Name = "NDD_CMD_INFO_PRINT"; + + /* + return( NDS_OK); + */ + } + + case NDD_CMD_USER_TRAVERSE: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + + void *Value_Ptr = Node_Ptr->Value; + */ + + + Command_Name = "NDD_CMD_USER_TRAVERSE"; + + /* + return( NDS_OK); + */ + } + + default: + { + printf( "ND_Default_Manager() called with an undefined command %d\n", Command); + return(NDS_ERRAPI); + } + } + + printf( "ND_Default_Manager() called with command %d (%s)\n", Command, Command_Name); + return(NDS_OK); +} + + + + + + + +/*------------------------------------------------------------------------------*/ +/* OpenStruct Manager */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_OpenStruct_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node *Node_Ptr, NDT_Command Command, va_list Args) +{ + NDT_Command_Name Command_Name; + + + switch( Command) + { + case NDD_CMD_MANAGER_VERSION: + { + NDT_Version_Name *Version_Name_Ptr = (NDT_Version_Name *)va_arg( Args, NDT_Version_Name *); + + + Command_Name = "NDD_CMD_MANAGER_VERSION"; + + *Version_Name_Ptr = "%Revision: 2.15 % %Name: libnode-2_1_0-1 % %Date: 2005/01/19 23:59:41 % %Author: agibert %"; + + return( NDS_OK); + } + + case NDD_CMD_INDEX_GET: + { + /* + NDT_Index_Id *Reply_Index_Id_Ptr = (NDT_Index_Id *)va_arg( Args, NDT_Index_Id *); + NDT_Command *Reply_Command_Ptr = (NDT_Command *)va_arg( Args, NDT_Command *); + NDT_Command Cmd = (NDT_Command)va_arg( Args, NDT_Command); + void *Value_ptr = (void *)va_arg( Args, void *); + */ + NDT_Index_Id *Reply_Index_Id_Ptr = (NDT_Index_Id *)va_arg( Args, NDT_Index_Id *); + NDT_Command *Reply_Command_Ptr = (NDT_Command *)va_arg( Args, NDT_Command *); + NDT_Command Cmd = (NDT_Command)va_arg( Args, NDT_Command); + void *Value_ptr = (void *)va_arg( Args, void *); + + + Command_Name = "NDD_CMD_INDEX_GET"; + + switch(Cmd) + { + default: + { + *Reply_Index_Id_Ptr = Index_Id; + *Reply_Command_Ptr = Cmd; + break; + } + } + + return( NDS_OK); + } + + case NDD_CMD_VALUE_ALLOC: + { + /* + void **Value_Ptr_Ptr = (void **)va_arg( Args, void **); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + + + Command_Name = "NDD_CMD_VALUE_ALLOC"; + + return( NDS_OK); + } + + case NDD_CMD_VALUE_FREE: + { + /* + void *Value_Ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + + + Command_Name = "NDD_CMD_VALUE_FREE"; + + return( NDS_OK); + } + + case NDD_CMD_VALUE_COMP: + { + /* + void *Value1_Ptr = (void *)va_arg( Args, void *); + void *Value2_Ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + + void *Value1_Ptr = (void *)va_arg( Args, void *); + void *Value2_Ptr = (void *)va_arg( Args, void *); + + + Command_Name = "NDD_CMD_VALUE_COMP"; + + switch( Index_Id) + { + case 0: + { + if( Value1_Ptr < Value2_Ptr) + { + return(NDS_LOWER); + } + else + { + if( Value1_Ptr > Value2_Ptr) + { + return(NDS_GREATER); + } + else + { + return(NDS_EQUAL); + } + } + } + + default: + { + printf( "Unknown COMP idx (%d) !\n", Index_Id); + return( NDS_KO); + } + } + + return( NDS_OK); + } + + case NDD_CMD_VALUE_ADD: + { + /* + void *Value_Ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + + + Command_Name = "NDD_CMD_VALUE_ADD"; + + return( NDS_OK); + } + + case NDD_CMD_VALUE_REMOVE: + { + /* + void *Value_Ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + + + Command_Name = "NDD_CMD_VALUE_REMOVE"; + + return( NDS_OK); + } + + case NDD_CMD_VALUE_PRINT: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + NDT_Recursive_Offset Recursive_Offset = (NDT_Recursive_Offset)va_arg( lib_args, NDT_Recursive_Offset); + va_list user_args = (va_list)va_arg( lib_args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + + void *Value_Ptr = Node_Ptr->Value; + */ + + + Command_Name = "NDD_CMD_VALUE_PRINT"; + + return( NDS_OK); + } + + case NDD_CMD_INFO_PRINT: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + NDT_Recursive_Offset Recursive_Offset = (NDT_Recursive_Offset)va_arg( lib_args, NDT_Recursive_Offset); + va_list user_args = (va_list)va_arg( lib_args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + + void *Value_Ptr = Node_Ptr->Value; + */ + + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + NDT_Recursive_Offset Recursive_Offset = (NDT_Recursive_Offset)va_arg( lib_args, NDT_Recursive_Offset); + + void *Value_Ptr = Node_Ptr->Value; + + + Command_Name = "NDD_CMD_INFO_PRINT"; + + return( ND_DataStruct_Info_Print_I( Out, (NDT_Root *)Value_Ptr, Recursive_Mode, --Recursive_Depth, ++Recursive_Offset)); + } + + default: + { + printf( "OpenStruct_Manager() called with an undefined command %d\n", Command); + return( NDS_ERRAPI); + } + } + + printf( "OpenStruct_Manager() called with command %d (%s)\n", Command, Command_Name); + return( NDS_OK); +} + + + + + + + +/*------------------------------------------------------------------------------*/ +/*------------------------------------------------------------------------------*/ +/* FONCTIONS PUBLIQUES */ +/*------------------------------------------------------------------------------*/ +/*------------------------------------------------------------------------------*/ + + + + + +/*------------------------------------------------------------------------------*/ +/* Initialisation du contexte de la librairie */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Library_Open_I( int Debug_Mode) +{ + NDG_Base.Debug_Mode = Debug_Mode; + NDG_Base.Open_Status = NDD_TRUE; + + if( Debug_Mode == NDD_TRUE) + { + ND_Library_StdErr_Set_I( stderr); + } + +#if !defined(_WIN32) + if( ( NDG_Base.DL_Ptr = dlopen( NULL, ( RTLD_NOW | RTLD_GLOBAL))) == NULL) + { + sprintf( NDG_Base.Err_String, "Error ND_Library_Open: can't dlopen [%s]", dlerror()); + ND_Error_Print(); + + return( NDS_KO); + } +#endif + + return( NDS_OK); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Initialisation du contexte de la librairie */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Library_Open_C( int Debug_Mode) +{ + NDT_Status status; + + + if( NDG_Base.Open_Status != NDD_FALSE) + { + sprintf( NDG_Base.Err_String, "Error ND_Library_Open_C: library is not closed"); + ND_Error_Print(); + + return( NDS_KO); + } + else + { + if( Debug_Mode == NDD_TRUE) + { + if( ( status = ND_DataStruct_Open_I( &(NDG_Base.OpenStruct_Ptr), 1, NDG_Base.OpenStruct_Index_Type, "ND_OpenStruct_Manager", ND_OpenStruct_Manager, NULL, NULL, NULL, NULL, 0, NULL)) != NDS_OK) + { + sprintf( NDG_Base.Err_String, "Error ND_Library_Open_C: can't open OpenStruct"); + ND_Error_Print(); + + return( NDS_KO); + } + } + } + + return( ND_Library_Open_I( Debug_Mode)); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Fermeture du contexte de la librairie */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Library_Close_I( void) +{ + NDT_Symbol *Symbol, *Next_Symbol; + + + /* Désallocation de la table des symboles locale */ + + Symbol = NDG_Base.Symbol_First_Ptr; + + while( Symbol) + { + Next_Symbol = Symbol->Next; + free( Symbol->Name); + free( Symbol); + Symbol = Next_Symbol; + } + + NDG_Base.Symbol_First_Ptr = (NDT_Symbol *)NULL; + +#if !defined(_WIN32) +/* + if( dlclose( NDG_Base.DL_Ptr) != 0) + { + sprintf( NDG_Base.Err_String, "Error ND_Library_Open: can't dlclose [%s]", dlerror()); + ND_Error_Print(); + + return( NDS_KO); + } +*/ +/* dlclose buggy on HPUX... 8^/ */ +#endif + + NDG_Base.Open_Status = NDD_FALSE; + + return( NDS_OK); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Fermeture du contexte de la librairie */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Library_Close_C( void) +{ + NDT_Status status; + + + if( NDG_Base.Open_Status != NDD_TRUE) + { + sprintf( NDG_Base.Err_String, "Error ND_Library_Close_C: library is not opened"); + ND_Error_Print(); + + return( NDS_KO); + } + + if( ( NDG_Base.Debug_Mode == NDD_TRUE) && ( NDG_Base.Err_Stream != NULL)) + { + if( NDG_Base.OpenStruct_Ptr->Index_Tab[NDD_INDEX_PRIMARY].Node_Number > 0) + { + sprintf( NDG_Base.Err_String, "Error ND_Library_Close_C: Unclosed DataStruct:"); + ND_Error_Print(); + + if( ( status = ND_DataStruct_Info_Print_I( NDG_Base.Err_Stream, NDG_Base.OpenStruct_Ptr, NDD_RECURSIVE_MODE_PARENT_CHILD, 0, 0)) != NDS_OK) + { + sprintf( NDG_Base.Err_String, "Error ND_Library_Close_C: can't print OpenStruct info"); + ND_Error_Print(); + + return( NDS_KO); + } + } + + if( ( status = ND_DataStruct_Close_I( NDG_Base.OpenStruct_Ptr)) != NDS_OK) + { + sprintf( NDG_Base.Err_String, "Error ND_Library_Close_C: can't close OpenStruct"); + ND_Error_Print(); + + return( NDS_KO); + } + } + + return( ND_Library_Close_I()); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Définition de la sortie standard des messages d'erreur de la librairie */ +/*------------------------------------------------------------------------------*/ +/* (I) Out : flux de sortie de l'affichage des messages d'erreur */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Library_StdErr_Set_I( FILE *Out) +{ + NDG_Base.Err_Stream = Out; + + return( NDS_OK); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Définition de la sortie standard des messages d'erreur de la librairie */ +/*------------------------------------------------------------------------------*/ +/* (I) Out : flux de sortie de l'affichage des messages d'erreur */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Library_StdErr_Set_C( FILE *Out) +{ + if( NDG_Base.Open_Status != NDD_TRUE) + { + sprintf( NDG_Base.Err_String, "Error ND_Library_StdErr_Set_C: library is not opened"); + ND_Error_Print(); + + return( NDS_KO); + } + + return( ND_Library_StdErr_Set_I( Out)); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Création d'une nouvelle structure de données */ +/*------------------------------------------------------------------------------*/ +/* (O) Root: adresse d'un pointeur sur la racine de la nouvelle structure */ +/* (I) Type: type de la structure.de données (liste ou arbre binaire) */ +/* (I) Allocator: pointeur vers la fonction d'allocation */ +/* (I) Desallocator: pointeur vers la fonction de désallocation */ +/* (I) Data : pointeur de données utiles à l'allocateur */ +/* (I) Own_Value : indique si la structure est propriétaire de ses valeurs */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Index_Open_I( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Index_Type Type) +{ + NDT_Status status; + NDT_Node *node_ptr; + + + if( ( status = ND_Index_Clear( Root_Ptr, Index_Id)) != NDS_OK) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Open_I: Index cleaning error"); + ND_Error_Print(); + + return( NDS_KO); + } + + Root_Ptr->Index_Tab[Index_Id].Type = Type & NDD_INDEX_STATUS_RMSK | NDD_INDEX_STATUS_OPENED ; + + Root_Ptr->Index_Open_Count++; + + if( Index_Id != NDD_INDEX_PRIMARY) + { + if( ( status = ND_Index_Node_First_Get_I( &node_ptr, Root_Ptr, NDD_INDEX_PRIMARY)) != NDS_OK) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Open_I: can't get first primary index node"); + ND_Error_Print(); + + return( NDS_KO); + } + + while( node_ptr != NULL) + { + if( ( status = ND_Index_Value_Add_I( Root_Ptr, Index_Id, node_ptr->Value)) != NDS_OK) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Open_I: can't add value"); + ND_Error_Print(); + + return( NDS_KO); + } + + if( ( status = ND_Index_Node_Next_Get_I( &node_ptr, node_ptr)) != NDS_OK) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Open_I: can't get next node"); + ND_Error_Print(); + + return( NDS_KO); + } + } + } + + return( NDS_OK); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Création d'une nouvelle structure de données */ +/*------------------------------------------------------------------------------*/ +/* (O) Root: adresse d'un pointeur sur la racine de la nouvelle structure */ +/* (I) Type: type de la structure.de données (liste ou arbre binaire) */ +/* (I) Allocator: pointeur vers la fonction d'allocation */ +/* (I) Desallocator: pointeur vers la fonction de désallocation */ +/* (I) Data : pointeur de données utiles à l'allocateur */ +/* (I) Own_Value : indique si la structure est propriétaire de ses valeurs */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Index_Open_C( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Index_Type Type) +{ + if( !Root_Ptr) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Open_C: structure root is null"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( NDG_Base.Open_Status != NDD_TRUE) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Open_C: library is not open"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !ND_INDEX_STATUS_CLOSED_IS( Root_Ptr, Index_Id)) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Open_C: index is not closed"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( ( Root_Ptr->Index_Open_Count == 0) && ( Index_Id != NDD_INDEX_PRIMARY)) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Open_I: fist opened index should be the primary"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + return( ND_Index_Open_I( Root_Ptr, Index_Id, Type)); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Création d'une nouvelle structure de données */ +/*------------------------------------------------------------------------------*/ +/* (O) Root: adresse d'un pointeur sur la racine de la nouvelle structure */ +/* (I) Type: type de la structure.de données (liste ou arbre binaire) */ +/* (I) Allocator: pointeur vers la fonction d'allocation */ +/* (I) Desallocator: pointeur vers la fonction de désallocation */ +/* (I) Data : pointeur de données utiles à l'allocateur */ +/* (I) Own_Value : indique si la structure est propriétaire de ses valeurs */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_DataStruct_Open_I( NDT_Root **Root_Ptr_Ptr, NDT_Index_Nb Index_Nb, NDT_Index_Type *Type_Ptr, NDT_Manager_Name Manager_Name, NDT_Manager *Manager_Ptr, + NDT_Allocator_Name Allocator_Name, NDT_Allocator *Allocator_Ptr, NDT_Desallocator_Name Desallocator_Name, NDT_Desallocator *Desallocator_Ptr, short Own_Value, void *Data) +{ + NDT_Status status; + NDT_Manager_Name Real_Manager_Name; + NDT_Manager *Real_Manager_Ptr; + NDT_Allocator_Name Real_Allocator_Name; + NDT_Allocator *Real_Allocator_Ptr; + NDT_Desallocator_Name Real_Desallocator_Name; + NDT_Desallocator *Real_Desallocator_Ptr; + + + /* Valeurs par défaut des fonctions d'allocation et de désallocation */ + +#if defined(_WIN32) + if( ( Manager_Name != NULL) && ( Manager_Ptr == NULL)) + { + sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Open_I: no symbol lookup support, Manager_Ptr shouldn't be NULL"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } +#endif + + if( ( Manager_Name != NULL) || ( Manager_Ptr != NULL)) + { + Real_Manager_Name = Manager_Name; + Real_Manager_Ptr = Manager_Ptr; + } + else + { + Real_Manager_Name = "ND_Default_Manager"; + Real_Manager_Ptr = ND_Default_Manager; + } + +#if defined(_WIN32) + if( ( Allocator_Name != NULL) && ( Allocator_Ptr == NULL)) + { + sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Open_I: no symbol lookup support, Allocator_Ptr shouldn't be NULL"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } +#endif + + if( ( Allocator_Name != NULL) || ( Allocator_Ptr != NULL)) + { + Real_Allocator_Name = Allocator_Name; + Real_Allocator_Ptr = Allocator_Ptr; + } + else + { + Real_Allocator_Name = "ND_Default_Allocator"; + Real_Allocator_Ptr = ND_Default_Allocator; + } + +#if defined(_WIN32) + if( ( Desallocator_Name != NULL) && ( Desallocator_Ptr == NULL)) + { + sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Open_I: no symbol lookup support, Desallocator_Ptr shouldn't be NULL"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } +#endif + + if( ( Desallocator_Name != NULL) || ( Desallocator_Ptr != NULL)) + { + Real_Desallocator_Name = Desallocator_Name; + Real_Desallocator_Ptr = Desallocator_Ptr; + } + else + { + Real_Desallocator_Name = "ND_Default_Desallocator"; + Real_Desallocator_Ptr = ND_Default_Desallocator; + } + + status = ND_Node_Root_Alloc( Root_Ptr_Ptr, Index_Nb, Type_Ptr, Real_Manager_Name, Real_Manager_Ptr, Real_Allocator_Name, Real_Allocator_Ptr, Real_Desallocator_Name, Real_Desallocator_Ptr, Own_Value, Data); + + if( ND_ERROR( status)) return( status); + + return( NDS_OK); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Création d'une nouvelle structure de données */ +/*------------------------------------------------------------------------------*/ +/* (O) Root: adresse d'un pointeur sur la racine de la nouvelle structure */ +/* (I) Type: type de la structure.de données (liste ou arbre binaire) */ +/* (I) Allocator: pointeur vers la fonction d'allocation */ +/* (I) Desallocator: pointeur vers la fonction de désallocation */ +/* (I) Data : pointeur de données utiles à l'allocateur */ +/* (I) Own_Value : indique si la structure est propriétaire de ses valeurs */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_DataStruct_Open_C( NDT_Root **Root_Ptr_Ptr, NDT_Index_Nb Index_Nb, NDT_Index_Type *Type_Ptr, NDT_Manager_Name Manager_Name, NDT_Manager *Manager_Ptr, + NDT_Allocator_Name Allocator_Name, NDT_Allocator *Allocator_Ptr, NDT_Desallocator_Name Desallocator_Name, NDT_Desallocator *Desallocator_Ptr, short Own_Value, void *Data_Ptr) +{ + NDT_Status status; + + + if( NDG_Base.Open_Status != NDD_TRUE) + { + sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Open_C: library is not open"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( ( status = ND_DataStruct_Open_I( Root_Ptr_Ptr, Index_Nb, Type_Ptr, Manager_Name, Manager_Ptr, Allocator_Name, Allocator_Ptr, Desallocator_Name, Desallocator_Ptr, Own_Value, Data_Ptr)) != NDS_OK) + { + return( status); + } + + if( ( NDG_Base.Debug_Mode == NDD_TRUE) && ( NDG_Base.Open_Status == NDD_TRUE)) + { + if( ( status = ND_DataStruct_Value_Add_I( NDG_Base.OpenStruct_Ptr, (void **)*Root_Ptr_Ptr)) != NDS_OK) + { + sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Open_C: can't add value in OpenStruct"); + ND_Error_Print(); + + return( NDS_KO); + } + } + + return( NDS_OK); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Destruction d'une structure de données */ +/*------------------------------------------------------------------------------*/ +/* (O) Root: pointeur sur la racine de la structure de données à détruire */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Index_Close_I( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id) +{ + NDT_Status status; + + + if( ( Root_Ptr->Index_Open_Count != 1) && ( Index_Id == NDD_INDEX_PRIMARY)) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Close_I: the primary should be the last closed"); + ND_Error_Print(); + return(NDS_ERRAPI); + } + + status = ND_Index_Flush_I( Root_Ptr, Index_Id); + if( ND_ERROR( status)) return( status); + + Root_Ptr->Index_Tab[ Index_Id].Type = Root_Ptr->Index_Tab[ Index_Id].Type & NDD_INDEX_STATUS_RMSK | NDD_INDEX_STATUS_CLOSED; + + Root_Ptr->Index_Open_Count--; + + return( NDS_OK); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Destruction d'une structure de données */ +/*------------------------------------------------------------------------------*/ +/* (O) Root: pointeur sur la racine de la structure de données à détruire */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Index_Close_C( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id) +{ + if( NDG_Base.Open_Status != NDD_TRUE) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Close_C: library is not open"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Root_Ptr) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Close_C: structure root is null"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !ND_INDEX_STATUS_OPENED_IS( Root_Ptr, Index_Id)) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Close_C: index is not opened"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + return( ND_Index_Close_I( Root_Ptr, Index_Id)); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Destruction d'une structure de données */ +/*------------------------------------------------------------------------------*/ +/* (O) Root: pointeur sur la racine de la structure de données à détruire */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_DataStruct_Close_I( NDT_Root *Root_Ptr) +{ + NDT_Status status; + + + status = ND_DataStruct_Flush_I( Root_Ptr); + if( ND_ERROR( status)) return( status); + + return( ND_Node_Root_Free( Root_Ptr)); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Destruction d'une structure de données */ +/*------------------------------------------------------------------------------*/ +/* (O) Root: pointeur sur la racine de la structure de données à détruire */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_DataStruct_Close_C( NDT_Root *Root_Ptr) +{ + NDT_Status status; + + + if( NDG_Base.Open_Status != NDD_TRUE) + { + sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Close_C: library is not open"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if (!Root_Ptr) + { + sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Close_C: structure root is null"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( ( status = ND_DataStruct_Close_I( Root_Ptr)) != NDS_OK) + { + return( status); + } + + if( NDG_Base.Debug_Mode == NDD_TRUE) + { + if( ( status = ND_DataStruct_Value_Remove_I( NDG_Base.OpenStruct_Ptr, (void *)Root_Ptr)) != NDS_OK) + { + sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Close_I: can't remove value from OpenStruct"); + ND_Error_Print(); + + return( NDS_KO); + } + } + + return( NDS_OK); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* (O) Root: pointeur sur la racine de la structure de données à détruire */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Index_Flush_I( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id) +{ + NDT_Status status; + NDT_Node *Node_Ptr, *Next_Node_Ptr; + + + ND_Index_Node_First_Get_I( &Node_Ptr, Root_Ptr, Index_Id); + + while( Node_Ptr) + { + Next_Node_Ptr = NULL; + ND_Index_Node_Next_Get_I( &Next_Node_Ptr, Node_Ptr); + + if( Index_Id == NDD_INDEX_PRIMARY) + { + status = ND_Manager_Exec_I( Root_Ptr, Index_Id, Node_Ptr, NDD_CMD_VALUE_FREE, Node_Ptr->Value); + if( ND_ERROR( status)) return( status); + } + else + { + status = ND_Manager_Exec_I( Root_Ptr, Index_Id, Node_Ptr, NDD_CMD_VALUE_REMOVE, Node_Ptr->Value); + if( ND_ERROR( status)) return( status); + } + + status = ND_Index_Node_Remove_I( Node_Ptr); + if( ND_ERROR( status)) return( status); + + status = ND_Node_Free( Root_Ptr, Node_Ptr); + if (ND_ERROR( status)) return( status); + + Node_Ptr = Next_Node_Ptr; + } + + return( NDS_OK); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Destruction d'une structure de données */ +/*------------------------------------------------------------------------------*/ +/* (O) Root: pointeur sur la racine de la structure de données à détruire */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Index_Flush_C( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id) +{ + if( NDG_Base.Open_Status != NDD_TRUE) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Flush_C: library is not open"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Root_Ptr) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Flush_C: structure root is null"); + ND_Error_Print(); + + return(NDS_ERRAPI); + } + + return( ND_Index_Flush_I( Root_Ptr, Index_Id)); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Destruction d'une structure de données */ +/*------------------------------------------------------------------------------*/ +/* (O) Root: pointeur sur la racine de la structure de données à détruire */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_DataStruct_Flush_I( NDT_Root *Root_Ptr) +{ + NDT_Status status; + NDT_Index_Id index_id; + + + for( index_id = ( Root_Ptr->Index_Nb - 1); index_id >= 0 ; index_id--) + { + status = ND_Index_Flush_I( Root_Ptr, index_id); + if( ND_ERROR( status)) return( status); + } + + return( NDS_OK); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Destruction d'une structure de données */ +/*------------------------------------------------------------------------------*/ +/* (O) Root: pointeur sur la racine de la structure de données à détruire */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_DataStruct_Flush_C( NDT_Root *Root_Ptr) +{ + if( NDG_Base.Open_Status != NDD_TRUE) + { + sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Flush_C: library is not open"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if (!Root_Ptr) + { + sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Flush_C: structure root is null"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + return ND_DataStruct_Flush_I( Root_Ptr); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Function de réparation d'une structure : */ +/* - vérifie que tous les noeuds sont correctement liés les uns aux autres */ +/* - corrige les informations statistiques de la racine */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la structure */ +/* (O) Nb_Detected : pointeur sur le nombre d'erreurs détectées */ +/* (O) Nb_Corrected : pointeur sur le nombre d'erreurs corrigées */ +/* (I) Out : flux de sortie du rapport */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Index_Check_I( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, int *Detected_Nb_Ptr, int *Corrected_Nb_Ptr, FILE *Out) +{ + *Detected_Nb_Ptr = 0; + *Corrected_Nb_Ptr = 0; + + + if( ND_INDEX_STATUS_OPENED_IS( Root_Ptr, Index_Id)) + { + if( ND_INDEX_TYPE_LIST_IS( Root_Ptr, Index_Id)) + { + ND_List_Check( Root_Ptr, Index_Id, Detected_Nb_Ptr, Corrected_Nb_Ptr, Out); + } + else if( ND_INDEX_TYPE_TREE_IS( Root_Ptr, Index_Id)) + { + ND_Tree_Check( Root_Ptr, Index_Id, Detected_Nb_Ptr, Corrected_Nb_Ptr, Out); + } + else + { + sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Check_I: unknown structure type (%d) in structure (%p:%d)\n", Root_Ptr->Index_Tab[Index_Id].Type, Root_Ptr, Index_Id); + ND_Error_Print(); + + (*Detected_Nb_Ptr)++; + return( NDS_OK); + } + + /* Affichage du résultat de la procédure de vérification */ + + if( *Detected_Nb_Ptr == 0) + { + fprintf( Out, "No error detected in the node structure (%p:%d)\n", Root_Ptr, Index_Id); + } + else + { + fprintf( Out, "%d/%d error(s) corrected in the node structure (%p:%d)\n", *Corrected_Nb_Ptr, *Detected_Nb_Ptr, Root_Ptr, Index_Id); + } + } + + return( NDS_OK); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Function de réparation d'une structure : */ +/* - vérifie que tous les noeuds sont correctement liés les uns aux autres */ +/* - corrige les informations statistiques de la racine */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la structure */ +/* (O) Nb_Detected : pointeur sur le nombre d'erreurs détectées */ +/* (O) Nb_Corrected : pointeur sur le nombre d'erreurs corrigées */ +/* (I) Out : flux de sortie du rapport */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Index_Check_C( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, int *Nb_Detected_Ptr, int *Nb_Corrected_Ptr, FILE *Out) +{ + if( NDG_Base.Open_Status != NDD_TRUE) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Check_C: library is not open"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Root_Ptr) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Check_C: structure root is null"); + ND_Error_Print(); + + (*Nb_Detected_Ptr)++; + + return(NDS_ERRAPI); + } + + if( !Out) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Check_C: the stream descriptor is null"); + ND_Error_Print(); + + return(NDS_ERRAPI); + } + + return( ND_Index_Check_I( Root_Ptr, Index_Id, Nb_Detected_Ptr, Nb_Corrected_Ptr, Out)); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Function de réparation d'une structure : */ +/* - vérifie que tous les noeuds sont correctement liés les uns aux autres */ +/* - corrige les informations statistiques de la racine */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la structure */ +/* (O) Nb_Detected : pointeur sur le nombre d'erreurs détectées */ +/* (O) Nb_Corrected : pointeur sur le nombre d'erreurs corrigées */ +/* (I) Out : flux de sortie du rapport */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_DataStruct_Check_I( NDT_Root *Root_Ptr, int *Error_Detected_Nb_Ptr, int *Error_Corrected_Nb_Ptr, FILE *Out) +{ + NDT_Status status; + NDT_Index_Id index_id; + int index_error_detected_nb, index_error_corrected_nb; + + + for( index_id = 0; index_id < Root_Ptr->Index_Nb; index_id++) + { + status = ND_Index_Check_I( Root_Ptr, index_id, &index_error_detected_nb, &index_error_corrected_nb, Out); + if( ND_ERROR(status)) return(status); + + *Error_Detected_Nb_Ptr = *Error_Detected_Nb_Ptr + index_error_detected_nb; + *Error_Corrected_Nb_Ptr = *Error_Corrected_Nb_Ptr + index_error_corrected_nb; + } + + return( NDS_OK); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Function de réparation d'une structure : */ +/* - vérifie que tous les noeuds sont correctement liés les uns aux autres */ +/* - corrige les informations statistiques de la racine */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la structure */ +/* (O) Nb_Detected : pointeur sur le nombre d'erreurs détectées */ +/* (O) Nb_Corrected : pointeur sur le nombre d'erreurs corrigées */ +/* (I) Out : flux de sortie du rapport */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_DataStruct_Check_C( NDT_Root *Root_Ptr, int *Nb_Detected_Ptr, int *Nb_Corrected_Ptr, FILE *Out) +{ + if( NDG_Base.Open_Status != NDD_TRUE) + { + sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Check_C: library is not open"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Root_Ptr) + { + sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Check_C: structure root is null"); + ND_Error_Print(); + (*Nb_Detected_Ptr)++; + + return( NDS_ERRAPI); + } + + if( !Out) + { + sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Check_C: the stream descriptor is null"); + ND_Error_Print(); + return( NDS_ERRAPI); + } + + return( ND_DataStruct_Check_I( Root_Ptr, Nb_Detected_Ptr, Nb_Corrected_Ptr, Out)); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Conversion d'une structure de données d'un type en un autre */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la structure de données à convertir */ +/* (I) Target_Type : type de structure cible */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Index_Convert_I( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Index_Type Target_Type) +{ + NDT_Status rc; + + + if( ND_INDEX_STATUS_OPENED_IS( Root_Ptr, Index_Id)) + { + switch( Root_Ptr->Index_Tab[Index_Id].Type & NDD_INDEX_TYPE_MSK) + { + case NDD_INDEX_TYPE_LIST: + { + + switch( Target_Type & ( NDD_INDEX_TYPE_MSK | NDD_INDEX_SUBTYPE_MSK)) + { + case( NDD_INDEX_TYPE_LIST | NDD_INDEX_SUBTYPE_SORTED): + { + rc = ND_List_Sort( Root_Ptr, Index_Id); + if( ND_ERROR( rc)) return( rc); + + Root_Ptr->Index_Tab[Index_Id].Type = Target_Type; + + return( rc); + } + + case( NDD_INDEX_TYPE_LIST | NDD_INDEX_SUBTYPE_FIFO): + case( NDD_INDEX_TYPE_LIST | NDD_INDEX_SUBTYPE_LIFO): + { + Root_Ptr->Index_Tab[Index_Id].Type = Target_Type; + + return( NDS_OK); + } + + + case( NDD_INDEX_TYPE_TREE | NDD_INDEX_SUBTYPE_BALANCED): + case( NDD_INDEX_TYPE_TREE | NDD_INDEX_SUBTYPE_UNBALANCED): + { + rc = ND_List_Sort( Root_Ptr, Index_Id); + if( rc != NDS_OK) return( rc); + + rc = ND_Tree_Make( Root_Ptr, Index_Id); + if( ND_ERROR( rc)) return( rc); + + Root_Ptr->Index_Tab[Index_Id].Type = Target_Type; + + return( rc); + } + + default: + { + return( NDS_KO); + } + } + + break; + } + + case NDD_INDEX_TYPE_TREE: + { + switch( Target_Type & ( NDD_INDEX_TYPE_MSK | NDD_INDEX_SUBTYPE_MSK)) + { + case( NDD_INDEX_TYPE_LIST | NDD_INDEX_SUBTYPE_SORTED): + case( NDD_INDEX_TYPE_LIST | NDD_INDEX_SUBTYPE_FIFO): + case( NDD_INDEX_TYPE_LIST | NDD_INDEX_SUBTYPE_LIFO): + { + + rc = ND_List_Make( Root_Ptr, Index_Id); + if( ND_ERROR( rc)) return( rc); + + Root_Ptr->Index_Tab[Index_Id].Type = Target_Type; + + return( rc); + } + + default: + { + return( NDS_KO); + } + } + + break; + } + + default: + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Convert_I: unknown structure type (%d)", Root_Ptr->Index_Tab[Index_Id].Type); + ND_Error_Print (); + return NDS_ERRAPI; + } + } + } + + return( NDS_OK); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Conversion d'une structure de données d'un type en un autre */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la structure de données à convertir */ +/* (I) Target_Type : type de structure cible */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Index_Convert_C( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Index_Type Target_Type) +{ + if( NDG_Base.Open_Status != NDD_TRUE) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Convert_C: library is not open"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Root_Ptr) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Convert_C: structure root is null"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + return( ND_Index_Convert_I( Root_Ptr, Index_Id, Target_Type)); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Conversion d'une structure de données d'un type en un autre */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la structure de données à convertir */ +/* (I) Target_Type : type de structure cible */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_DataStruct_Convert_I( NDT_Root *Root_Ptr, NDT_Index_Type *Target_Type_Ptr) +{ + NDT_Status rc; + NDT_Index_Nb idx; + + + for( idx = 0; idx < Root_Ptr->Index_Nb; idx++) + { + rc = ND_Index_Convert_I( Root_Ptr, idx, Target_Type_Ptr[idx]); + if( ND_ERROR(rc)) return rc; + } + + return( NDS_OK); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Conversion d'une structure de données d'un type en un autre */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la structure de données à convertir */ +/* (I) Target_Type : type de structure cible */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_DataStruct_Convert_C( NDT_Root *Root_Ptr, NDT_Index_Type *Target_Type_Ptr) +{ + if( NDG_Base.Open_Status != NDD_TRUE) + { + sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Convert_C: library is not open"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Root_Ptr) + { + sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Convert_C: structure root is null"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Target_Type_Ptr) + { + sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Convert_C: target type ptr is null"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + return( ND_DataStruct_Convert_I( Root_Ptr, Target_Type_Ptr)); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Réorganisation d'une structure de données */ +/* - ordonnancement d'une liste non ordonnée */ +/* - réquilibrage d'un arbre non auto-équilibré */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la structure de données à supprimer */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Index_Reorg_I( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id) +{ + NDT_Status status; + + + if( ND_INDEX_STATUS_OPENED_IS( Root_Ptr, Index_Id)) + { + if( ( status = ND_INDEX_TYPE_LIST_IS( Root_Ptr, Index_Id))) + { + if ( !ND_INDEX_SUBTYPE_SORTED_IS( Root_Ptr, Index_Id)) + { + if( ( status = ND_List_Sort( Root_Ptr, Index_Id)) != NDS_OK) + { + return( status); + } + } + } + else + { + if( ND_INDEX_TYPE_TREE_IS( Root_Ptr, Index_Id)) + { + if( ( status = ND_Tree_Equalize( Root_Ptr, Index_Id)) != NDS_OK) + { + return( status); + } + } + else + { + sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Reorg_C: unknown structure type (%d) in structure (%p:%d)\n", Root_Ptr->Index_Tab[Index_Id].Type, Root_Ptr, Index_Id); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + } + } + + return( NDS_OK); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Réorganisation d'une structure de données */ +/* - ordonnancement d'une liste non ordonnée */ +/* - réquilibrage d'un arbre non auto-équilibré */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la structure de données à supprimer */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Index_Reorg_C( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id) +{ + if( NDG_Base.Open_Status != NDD_TRUE) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Reorg_C: library is not open"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Root_Ptr) + { + sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Reorg_C: structure root is null"); + ND_Error_Print (); + + return( NDS_ERRAPI); + } + + return( ND_Index_Reorg_I( Root_Ptr, Index_Id)); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Réorganisation d'une structure de données */ +/* - ordonnancement d'une liste non ordonnée */ +/* - réquilibrage d'un arbre non auto-équilibré */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la structure de données à supprimer */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_DataStruct_Reorg_I( NDT_Root *Root_Ptr) +{ + NDT_Status status; + NDT_Index_Id index_id; + + + for( index_id = 0; index_id < Root_Ptr->Index_Nb; index_id++) + { + status = ND_Index_Reorg_I( Root_Ptr, index_id); + if( ND_ERROR( status)) return status; + } + + return( NDS_OK); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Réorganisation d'une structure de données */ +/* - ordonnancement d'une liste non ordonnée */ +/* - réquilibrage d'un arbre non auto-équilibré */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la structure de données à supprimer */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_DataStruct_Reorg_C( NDT_Root *Root_Ptr) +{ + if( NDG_Base.Open_Status != NDD_TRUE) + { + sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Reorg_C: library is not open"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Root_Ptr) + { + sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Reorg_C: structure root is null"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + return( ND_DataStruct_Reorg_I( Root_Ptr)); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Parcours de tous les noeuds d'une structure de données et exécution d'une */ +/* commande sur chacun d'eux */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la structure de données à parcourir */ +/* (I) Command : Commande à exécuter sur chaque noeud traversé */ +/* (I) Data : pointeur de données utilisateur */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Index_Traverse_VI( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Command Command, va_list Args) +{ + NDT_Status rc; + NDT_Node *Node_Ptr, *Next_Node_Ptr; + + + ND_Index_Node_First_Get_I( &Node_Ptr, Root_Ptr, Index_Id); + + while( Node_Ptr) + { + Next_Node_Ptr = NULL; + ND_Index_Node_Next_Get_I( &Next_Node_Ptr, Node_Ptr); + + switch (Command) + { + case NDD_CMD_VALUE_REMOVE: + case NDD_CMD_VALUE_FREE: + { + + rc = ND_Manager_Exec_I( Root_Ptr, Index_Id, Node_Ptr, Command, Node_Ptr->Value, Args); + if (ND_ERROR( rc)) return rc; + + rc = ND_Index_Node_Remove_I( Node_Ptr); + if( ND_ERROR( rc)) return rc; + + rc = ND_Node_Free( Root_Ptr, Node_Ptr); + if (ND_ERROR(rc)) return rc; + + break; + } + + default: + { + rc = ND_Manager_Exec_I( Root_Ptr, Index_Id, Node_Ptr, Command, Next_Node_Ptr, Args); + if (ND_ERROR( rc)) return rc; + + break; + } + } + + Node_Ptr = Next_Node_Ptr; + } + + return( NDS_OK); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Parcours de tous les noeuds d'une structure de données et exécution d'une */ +/* commande sur chacun d'eux */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la structure de données à parcourir */ +/* (I) Command : Commande à exécuter sur chaque noeud traversé */ +/* (I) Data : pointeur de données utilisateur */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Index_Traverse_VC( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Command Command, va_list Args) +{ + if( NDG_Base.Open_Status != NDD_TRUE) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Traverse_VC: library is not open"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Root_Ptr) + { + sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Traverse_VC: structure root is null"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + return( ND_Index_Traverse_VI( Root_Ptr, Index_Id, Command, Args)); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Parcours de tous les noeuds d'une structure de données et exécution d'une */ +/* commande sur chacun d'eux */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la structure de données à parcourir */ +/* (I) Command : Commande à exécuter sur chaque noeud traversé */ +/* (I) Data : pointeur de données utilisateur */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Index_Traverse_I( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Command Command, ...) +{ + NDT_Status status; + va_list args; + NDT_Node *Node_Ptr, *Next_Node_Ptr; + + + va_start( args, Command); + + ND_Index_Node_First_Get_I( &Node_Ptr, Root_Ptr, Index_Id); + + status = NDS_OK; + + while( Node_Ptr) + { + Next_Node_Ptr = NULL; + ND_Index_Node_Next_Get_I( &Next_Node_Ptr, Node_Ptr); + + switch (Command) + { + case NDD_CMD_VALUE_REMOVE: + case NDD_CMD_VALUE_FREE: + { + + status = ND_Manager_Exec_I( Root_Ptr, Index_Id, Node_Ptr, Command, Node_Ptr->Value, args); + if( ND_ERROR( status)) return( status); + + status = ND_Index_Node_Remove_I( Node_Ptr); + if( ND_ERROR( status)) return( status); + + status = ND_Node_Free( Root_Ptr, Node_Ptr); + if (ND_ERROR( status)) return( status); + + break; + } + + default: + { + status = ND_Manager_Exec_I( Root_Ptr, Index_Id, Node_Ptr, Command, Next_Node_Ptr, args); + if( ND_ERROR( status)) return( status); + + break; + } + } + + Node_Ptr = Next_Node_Ptr; + } + + va_end( args); + + return( status); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Parcours de tous les noeuds d'une structure de données et exécution d'une */ +/* commande sur chacun d'eux */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la structure de données à parcourir */ +/* (I) Command : Commande à exécuter sur chaque noeud traversé */ +/* (I) Data : pointeur de données utilisateur */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Index_Traverse_C( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Command Command, ...) +{ + NDT_Status status; + va_list args; + + + va_start( args, Command); + + if( NDG_Base.Open_Status != NDD_TRUE) + { + sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Traverse_C: library is not open"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Root_Ptr) + { + sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Traverse_C: structure root is null"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + status = ND_Index_Traverse_VI( Root_Ptr, Index_Id, Command, args); + + va_end( args); + + return( status); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Parcours de tous les noeuds d'une structure de données et exécution d'une */ +/* commande sur chacun d'eux */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la structure de données à parcourir */ +/* (I) Command : Commande à exécuter sur chaque noeud traversé */ +/* (I) Data : pointeur de données utilisateur */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_DataStruct_Traverse_VI( NDT_Root *Root_Ptr, NDT_Command Command, va_list Args) +{ + NDT_Status status; + NDT_Index_Id new_index; + NDT_Command new_cmd; + + + status = ND_Manager_Exec_I( Root_Ptr, NDD_INDEX_PRIMARY, NULL, NDD_CMD_INDEX_GET, &new_index, &new_cmd, Command, NULL); + if( ND_ERROR(status)) return( status); + + return( ND_Index_Traverse_VI( Root_Ptr, new_index, new_cmd, Args)); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Parcours de tous les noeuds d'une structure de données et exécution d'une */ +/* commande sur chacun d'eux */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la structure de données à parcourir */ +/* (I) Command : Commande à exécuter sur chaque noeud traversé */ +/* (I) Data : pointeur de données utilisateur */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_DataStruct_Traverse_VC( NDT_Root *Root_Ptr, NDT_Command Command, va_list Args) +{ + if( NDG_Base.Open_Status != NDD_TRUE) + { + sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Traverse_VC: library is not open"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Root_Ptr) + { + sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Traverse_VC: structure root is null"); + ND_Error_Print(); + return( NDS_ERRAPI); + } + + return( ND_DataStruct_Traverse_VI( Root_Ptr, Command, Args)); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Parcours de tous les noeuds d'une structure de données et exécution d'une */ +/* commande sur chacun d'eux */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la structure de données à parcourir */ +/* (I) Command : Commande à exécuter sur chaque noeud traversé */ +/* (I) Data : pointeur de données utilisateur */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_DataStruct_Traverse_I( NDT_Root *Root_Ptr, NDT_Command Command, ...) +{ + NDT_Status status; + va_list args; + NDT_Index_Id new_index; + NDT_Command new_cmd; + + + va_start( args, Command); + + status = ND_Manager_Exec_I( Root_Ptr, NDD_INDEX_PRIMARY, NULL, NDD_CMD_INDEX_GET, &new_index, &new_cmd, Command, NULL); + if( ND_ERROR( status)) return( status); + + status = ND_Index_Traverse_VI( Root_Ptr, new_index, new_cmd, args); + + va_end( args); + + return( status); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Parcours de tous les noeuds d'une structure de données et exécution d'une */ +/* commande sur chacun d'eux */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la structure de données à parcourir */ +/* (I) Command : Commande à exécuter sur chaque noeud traversé */ +/* (I) Data : pointeur de données utilisateur */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_DataStruct_Traverse_C( NDT_Root *Root_Ptr, NDT_Command Command, ...) +{ + NDT_Status status; + va_list args; + + + va_start( args, Command); + + if( NDG_Base.Open_Status != NDD_TRUE) + { + sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Taverse_C: library is not open"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Root_Ptr) + { + sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Traverse_C: structure root is null"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + status = ND_DataStruct_Traverse_VI( Root_Ptr, Command, args); + + va_end( args); + + return( status); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Affichage d'informations sur une structure de données */ +/*------------------------------------------------------------------------------*/ +/* (I) Root: pointeur sur la racine de la structure de données */ +/* (I) Out : flux de sortie */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Index_Info_Print_I( FILE *Out, NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Recursive_Mode Recursive_Mode, NDT_Recursive_Depth Recursive_Depth, NDT_Recursive_Offset Recursive_Offset) +{ + NDT_Status status; + char offset[255]; + + + if( ND_RECURSIVE_PARENT_IS( Recursive_Mode)) + { + memset( offset, ' ', Recursive_Offset * ND_RECURSIVE_PRINT_OFFSET); + offset[Recursive_Offset * ND_RECURSIVE_PRINT_OFFSET] = '\0'; + + fprintf( Out, "%s Index Id: (%d)\tType: (%#06x) [%s:%s:%s]\tNode Nb: (%d)\tHead: (%s%p)\tTail: (%s%p)\n%s Min Depth: (%d)\tMax Depth: (%d)\tMax Dif: (%d)\tNb Equ: (%d)\tSave: (%s%p)\n\n", + offset, Index_Id, Root_Ptr->Index_Tab[Index_Id].Type, ND_INDEX_STATUS_ASCII_GET( Root_Ptr, Index_Id), ND_INDEX_TYPE_ASCII_GET( Root_Ptr, Index_Id), ND_INDEX_SUBTYPE_ASCII_GET( Root_Ptr, Index_Id), + Root_Ptr->Index_Tab[Index_Id].Node_Number, + NDD_PRINTF_PTR_PREFIX, Root_Ptr->Index_Tab[Index_Id].Head, NDD_PRINTF_PTR_PREFIX, Root_Ptr->Index_Tab[Index_Id].Tail, + offset, Root_Ptr->Index_Tab[Index_Id].Min_Depth, Root_Ptr->Index_Tab[Index_Id].Max_Depth, Root_Ptr->Index_Tab[Index_Id].Max_Dif, Root_Ptr->Index_Tab[Index_Id].Nb_Equ, + NDD_PRINTF_PTR_PREFIX, Root_Ptr->Index_Tab[Index_Id].Save); + } + + if( ND_RECURSIVE_CHILD_IS(Recursive_Mode)) + { + status = ND_Index_Traverse_I( Root_Ptr, Index_Id, NDD_CMD_INFO_PRINT, Out, NDD_RECURSIVE_MODE_PARENT_CHILD, Recursive_Depth, Recursive_Offset); + } + else + { + status = NDS_OK; + } + + return( status); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Affichage d'informations sur une structure de données */ +/*------------------------------------------------------------------------------*/ +/* (I) Root: pointeur sur la racine de la structure de données */ +/* (I) Out : flux de sortie */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Index_Info_Print_C( FILE *Out, NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Recursive_Mode Recursive_Mode, NDT_Recursive_Depth Recursive_Depth, NDT_Recursive_Offset Recursive_Offset) +{ + if( NDG_Base.Open_Status != NDD_TRUE) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Info_Print_C: library is not open"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Root_Ptr) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Info_Print_C: structure root is null"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Out) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Info_Print_C: the stream descriptor is null"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + return( ND_Index_Info_Print_I( Out, Root_Ptr, Index_Id, Recursive_Mode, Recursive_Depth, Recursive_Offset)); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Affichage d'informations sur une structure de données */ +/*------------------------------------------------------------------------------*/ +/* (I) Root: pointeur sur la racine de la structure de données */ +/* (I) Out : flux de sortie */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_DataStruct_Info_Print_I( FILE *Out, NDT_Root *Root_Ptr, NDT_Recursive_Mode Recursive_Mode, NDT_Recursive_Depth Recursive_Depth, NDT_Recursive_Offset Recursive_Offset) +{ + NDT_Status status; + NDT_Index_Nb idx; + NDT_Version_Name version_name; + char offset[255]; + + + if( ND_RECURSIVE_PARENT_IS( Recursive_Mode)) + { + memset( offset, ' ', Recursive_Offset * ND_RECURSIVE_PRINT_OFFSET); + offset[Recursive_Offset * ND_RECURSIVE_PRINT_OFFSET] = '\0'; + + status = ND_Manager_Exec_I( Root_Ptr, NDD_INDEX_UNKNOWN, NULL, NDD_CMD_MANAGER_VERSION, &version_name); + if( ND_ERROR( status)) return( status); + + fprintf( Out, "%sRoot: (%s%p)\tIndex Nb: (%d)\tIndex Open Count: (%d)\tManager: (%s%p) [%s]\n%sAllocator: (%s%p) [%s]\tDesallocator: (%s%p) [%s]\tUser: (%s%p)\n%sManager Version: [%s]\n\n", + offset, NDD_PRINTF_PTR_PREFIX, Root_Ptr, Root_Ptr->Index_Nb, Root_Ptr->Index_Open_Count, NDD_PRINTF_PTR_PREFIX, Root_Ptr->Manager_Ptr, Root_Ptr->Manager_Name, + offset, NDD_PRINTF_PTR_PREFIX, Root_Ptr->Allocator_Ptr, Root_Ptr->Allocator_Name, NDD_PRINTF_PTR_PREFIX, Root_Ptr->Desallocator_Ptr, Root_Ptr->Desallocator_Name, NDD_PRINTF_PTR_PREFIX, Root_Ptr->User_Ptr, + offset, version_name); + } + + if( ND_RECURSIVE_CHILD_IS( Recursive_Mode)) + { + for( idx = NDD_INDEX_PRIMARY; idx < Root_Ptr->Index_Nb; idx++) + { + status = ND_Index_Info_Print_I( Out, Root_Ptr, idx, NDD_RECURSIVE_MODE_PARENT, 0, Recursive_Offset); + if( ND_ERROR( status)) return( status); + } + + return( ND_Index_Info_Print_I( Out, Root_Ptr, NDD_INDEX_PRIMARY, NDD_RECURSIVE_MODE_CHILD, Recursive_Depth, Recursive_Offset)); + } + else + { + return( NDS_OK); + } +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Affichage d'informations sur une structure de données */ +/*------------------------------------------------------------------------------*/ +/* (I) Root: pointeur sur la racine de la structure de données */ +/* (I) Out : flux de sortie */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_DataStruct_Info_Print_C( FILE *Out, NDT_Root *Root_Ptr, NDT_Recursive_Mode Recursive_Mode, NDT_Recursive_Depth Recursive_Depth, NDT_Recursive_Offset Recursive_Offset) +{ + if( NDG_Base.Open_Status != NDD_TRUE) + { + sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Info_Print_C: library is not open"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Root_Ptr) + { + sprintf (NDG_Base.Err_String, "Error ND_DataStruct_Info_Print_C: structure root is null"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Out) + { + sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Info_Print_C: the stream descriptor is null"); + ND_Error_Print(); + return( NDS_ERRAPI); + } + + return( ND_DataStruct_Info_Print_I( Out, Root_Ptr, Recursive_Mode, Recursive_Depth, Recursive_Offset)); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Ajout d'une valeur à une structure de données */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la structure de données */ +/* (I) Value : pointeur sur la valeur à ajouter à la structure de données */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Index_Value_Add_I( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, void *Value_Ptr) +{ + NDT_Status status; + + + if( ND_INDEX_TYPE_LIST_IS( Root_Ptr, Index_Id)) + { + status = ND_List_Value_Add( Root_Ptr, Index_Id, Value_Ptr); + if(ND_ERROR( status)) return( status); + } + else if( ND_INDEX_TYPE_TREE_IS( Root_Ptr, Index_Id)) + { + status = ND_Tree_Value_Add( Root_Ptr, Index_Id, Value_Ptr); + if(ND_ERROR( status)) return( status); + } + else + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Value_Add_I: unknown structure type (%d)", Root_Ptr->Index_Tab[Index_Id].Type); + ND_Error_Print(); + return( NDS_ERRAPI); + } + + return( NDS_OK); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Ajout d'une valeur à une structure de données */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la structure de données */ +/* (I) Value : pointeur sur la valeur à ajouter à la structure de données */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Index_Value_Add_C( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, void *Value_Ptr) +{ + if( NDG_Base.Open_Status != NDD_TRUE) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Value_Add_C: library is not open"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Root_Ptr) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Value_Add_C: structure root is null"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Value_Ptr) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Value_Add_C: the value to add is null"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + return( ND_Index_Value_Add_I( Root_Ptr, Index_Id, Value_Ptr)); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Ajout d'une valeur à une structure de données */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la structure de données */ +/* (I) Value : pointeur sur la valeur à ajouter à la structure de données */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_DataStruct_Value_Add_I( NDT_Root *Root_Ptr, void *Value_Ptr) +{ + NDT_Status status; + NDT_Index_Id index_id; + + + for( index_id = 0; index_id < Root_Ptr->Index_Nb; index_id++) + { + if( ND_INDEX_STATUS_OPENED_IS( Root_Ptr, index_id)) + { + status = ND_Index_Value_Add_I( Root_Ptr, index_id, Value_Ptr); + if( ND_ERROR( status)) return( status); + } + } + + return( NDS_OK); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Ajout d'une valeur à une structure de données */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la structure de données */ +/* (I) Value : pointeur sur la valeur à ajouter à la structure de données */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_DataStruct_Value_Add_C( NDT_Root *Root_Ptr, void *Value_Ptr) +{ + if( NDG_Base.Open_Status != NDD_TRUE) + { + sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Value_Add_C: library is not open"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Root_Ptr) + { + sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Value_Add_C: structure root is null"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Value_Ptr) + { + sprintf( NDG_Base.Err_String, "Error ND_DatatStruct_Value_Add_C: the value to add is null"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + return( ND_DataStruct_Value_Add_I( Root_Ptr, Value_Ptr)); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Suppression du premier noeud correspondant à une valeur donnée */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la structure de données */ +/* (I) Reference_Value : pointeur sur la valeur de référence */ +/* (I) Removed_Value : adresse d'un pointeur sur la valeur supprimée */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Index_Value_Remove_I( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, void *Value_Ptr) +{ + NDT_Status status; + NDT_Node *node_ptr; + + + /* Recherche du premier noeud correspondant à la valeur de référence */ + + status = ND_Index_Node_Find_I( &node_ptr, Root_Ptr, Index_Id, Value_Ptr); + if( ND_ERROR( status)) return( status); + + if( !node_ptr) return( NDS_OK); + + /* manager call */ + + status = ND_Manager_Exec_I( Root_Ptr, Index_Id, node_ptr, NDD_CMD_VALUE_REMOVE, Value_Ptr); + if (ND_ERROR( status)) return( status); + + /* Retrait du noeud de la structure */ + + status = ND_Index_Node_Remove_I( node_ptr); + if( ND_ERROR( status)) return( status); + + /* Désallocation du noeud */ + + status = ND_Node_Free( Root_Ptr, node_ptr); + + return( status); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Suppression du premier noeud correspondant à une valeur donnée */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la structure de données */ +/* (I) Reference_Value : pointeur sur la valeur de référence */ +/* (I) Removed_Value : adresse d'un pointeur sur la valeur supprimée */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Index_Value_Remove_C( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, void *Value_Ptr) +{ + if( NDG_Base.Open_Status != NDD_TRUE) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Value_Remove_C: library is not open"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Root_Ptr) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Value_Remove_C: structure root is null"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Value_Ptr) + { + sprintf (NDG_Base.Err_String, "Error ND_Index_Value_Remove_C: the value is null"); + ND_Error_Print (); + + return( NDS_ERRAPI); + } + + return( ND_Index_Value_Remove_I( Root_Ptr, Index_Id, Value_Ptr)); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Suppression du premier noeud correspondant à une valeur donnée */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la structure de données */ +/* (I) Reference_Value : pointeur sur la valeur de référence */ +/* (I) Removed_Value : adresse d'un pointeur sur la valeur supprimée */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_DataStruct_Value_Remove_I( NDT_Root *Root_Ptr, void *Value_Ptr) +{ + NDT_Status status; + NDT_Index_Id index_id; + + + for( index_id = 0; index_id < Root_Ptr->Index_Nb; index_id++) + { + if( ND_INDEX_STATUS_OPENED_IS( Root_Ptr, index_id)) + { + status = ND_Index_Value_Remove_I( Root_Ptr, index_id, Value_Ptr); + if( ND_ERROR( status)) return( status); + } + } + + return( NDS_OK); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Suppression du premier noeud correspondant à une valeur donnée */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la structure de données */ +/* (I) Reference_Value : pointeur sur la valeur de référence */ +/* (I) Removed_Value : adresse d'un pointeur sur la valeur supprimée */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_DataStruct_Value_Remove_C( NDT_Root *Root_Ptr, void *Value_Ptr) +{ + if( NDG_Base.Open_Status != NDD_TRUE) + { + sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Value_Remove_C: library is not open"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Root_Ptr) + { + sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Value_Remove_C: structure root is null"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Value_Ptr) + { + sprintf (NDG_Base.Err_String, "Error ND_DataStruct_Value_Remove_C: the value is null"); + ND_Error_Print (); + + return( NDS_ERRAPI); + } + + return( ND_DataStruct_Value_Remove_I( Root_Ptr, Value_Ptr)); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Affichage d'une structure de données */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la structure de données à afficher */ +/* (I) Out : flux de sortie */ +/*------------------------------------------------------------------------------*/ +NDT_Status ND_Index_Value_Print_VI( FILE *Out, NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Recursive_Mode Recursive_Mode, NDT_Recursive_Depth Recursive_Depth, NDT_Recursive_Offset Recursive_Offset, va_list Args) +{ + NDT_Status status; + + + status = ND_Index_Traverse_I( Root_Ptr, Index_Id, NDD_CMD_VALUE_PRINT, Out, Recursive_Mode, Recursive_Depth, Recursive_Offset, Args); + + return( status); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Affichage d'une structure de données */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la structure de données à afficher */ +/* (I) Out : flux de sortie */ +/*------------------------------------------------------------------------------*/ +NDT_Status ND_Index_Value_Print_I( FILE *Out, NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Recursive_Mode Recursive_Mode, NDT_Recursive_Depth Recursive_Depth, NDT_Recursive_Offset Recursive_Offset, ...) +{ + NDT_Status status; + va_list user_args; + + + va_start( user_args, Recursive_Offset); + + status = ND_Index_Traverse_I( Root_Ptr, Index_Id, NDD_CMD_VALUE_PRINT, Out, Recursive_Mode, Recursive_Depth, Recursive_Offset, user_args); + + va_end( user_args); + + return( status); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Affichage d'une structure de données */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la structure de données à afficher */ +/* (I) Out : flux de sortie */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Index_Value_Print_C( FILE *Out, NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Recursive_Mode Recursive_Mode, NDT_Recursive_Depth Recursive_Depth, NDT_Recursive_Offset Recursive_Offset, ...) +{ + NDT_Status status; + va_list user_args; + + + va_start( user_args, Recursive_Offset); + + if( NDG_Base.Open_Status != NDD_TRUE) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Value_Print_C: library is not open"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Root_Ptr) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Value_Print_C: structure root is null"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Out) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Value_Print_C: the stream descriptor is null"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + status = ND_Index_Value_Print_VI( Out, Root_Ptr, Index_Id, Recursive_Mode, Recursive_Depth, Recursive_Offset, user_args); + + va_end( user_args); + + return( status); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Affichage d'une structure de données */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la structure de données à afficher */ +/* (I) Out : flux de sortie */ +/*------------------------------------------------------------------------------*/ +NDT_Status ND_DataStruct_Value_Print_VI( FILE *Out, NDT_Root *Root_Ptr, NDT_Recursive_Mode Recursive_Mode, NDT_Recursive_Depth Recursive_Depth, NDT_Recursive_Offset Recursive_Offset, va_list User_Args) +{ + NDT_Status status; + + status = ND_DataStruct_Traverse_I( Root_Ptr, NDD_CMD_VALUE_PRINT, Out, Recursive_Mode, Recursive_Depth, Recursive_Offset, User_Args); + + return( status); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Affichage d'une structure de données */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la structure de données à afficher */ +/* (I) Out : flux de sortie */ +/*------------------------------------------------------------------------------*/ +NDT_Status ND_DataStruct_Value_Print_I( FILE *Out, NDT_Root *Root_Ptr, NDT_Recursive_Mode Recursive_Mode, NDT_Recursive_Depth Recursive_Depth, NDT_Recursive_Offset Recursive_Offset, ...) +{ + NDT_Status status; + va_list user_args; + + + va_start( user_args, Recursive_Offset); + + status = ND_DataStruct_Traverse_I( Root_Ptr, NDD_CMD_VALUE_PRINT, Out, Recursive_Mode, Recursive_Depth, Recursive_Offset, user_args); + + va_end( user_args); + + return( status); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Affichage d'une structure de données */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la structure de données à afficher */ +/* (I) Out : flux de sortie */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_DataStruct_Value_Print_C( FILE *Out, NDT_Root *Root_Ptr, NDT_Recursive_Mode Recursive_Mode, NDT_Recursive_Depth Recursive_Depth, NDT_Recursive_Offset Recursive_Offset, ...) +{ + NDT_Status status; + va_list user_args; + + + va_start( user_args, Recursive_Offset); + + if( NDG_Base.Open_Status != NDD_TRUE) + { + sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Value_Print_C: library is not open"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Root_Ptr) + { + sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Value_Print_C: structure root is null"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Out) + { + sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Value_Print_C: the stream descriptor is null"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + status = ND_DataStruct_Value_Print_VI( Out, Root_Ptr, Recursive_Mode, Recursive_Depth, Recursive_Offset, user_args); + + va_end( user_args); + + return( status); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Ajout d'un noeud à une structure de données */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la structure de données */ +/* (I) Node : pointeur sur le noeud à ajouter */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Index_Node_Add_I( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node *Node_Ptr ) +{ + if( ND_INDEX_TYPE_LIST_IS( Root_Ptr, Index_Id)) return ND_List_Node_Add( Root_Ptr, Index_Id, Node_Ptr); + else if( ND_INDEX_TYPE_TREE_IS( Root_Ptr, Index_Id)) return ND_Tree_Node_Add( Root_Ptr, Index_Id, Node_Ptr); + else + { + sprintf (NDG_Base.Err_String, "Error ND_Index_Node_Add_I: unknown structure type (%d)", Root_Ptr->Index_Tab[Index_Id].Type); + ND_Error_Print (); + return( NDS_ERRAPI); + } + + return( NDS_KO); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Ajout d'un noeud à une structure de données */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la structure de données */ +/* (I) Node : pointeur sur le noeud à ajouter */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Index_Node_Add_C( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node *Node_Ptr) +{ + if( NDG_Base.Open_Status != NDD_TRUE) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Node_Add_C: library is not open"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Root_Ptr) + { + sprintf (NDG_Base.Err_String, "Error ND_Index_Node_Add_C: structure root is null"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Node_Ptr) + { + sprintf (NDG_Base.Err_String, "Error ND_Index_Node_Add_C: the node to add is null"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + return( ND_Index_Node_Add_I( Root_Ptr, Index_Id, Node_Ptr)); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Suppression d'un noeud dans une structure de données */ +/*------------------------------------------------------------------------------*/ +/* (I) Node: pointeur sur le noeud à supprimer */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Index_Node_Remove_I( NDT_Node *Node_Ptr) +{ + NDT_Root *root_ptr; + NDT_Index_Id index_id; + + + root_ptr = Node_Ptr->Root; + index_id = Node_Ptr->Index; + + if( ND_INDEX_TYPE_LIST_IS( root_ptr, index_id)) return ND_List_Node_Remove( Node_Ptr); + else if( ND_INDEX_TYPE_TREE_IS( root_ptr, index_id)) + { + NDT_Node **tmp_ptr_ptr; + + /* On récupère l'adresse du lien entre le noeud à supprimer et son père */ + + if( Node_Ptr->Parent) + { + /* Cas général */ + + if( Node_Ptr == Node_Ptr->Parent->Left) tmp_ptr_ptr = &(Node_Ptr->Parent->Left); + else tmp_ptr_ptr = &(Node_Ptr->Parent->Right); + } + else + { + /* Cas du noeud racine */ + + tmp_ptr_ptr = NULL; + } + + if( Node_Ptr->Right) + { + NDT_Node *Right_Node_Ptr = Node_Ptr->Right; + NDT_Node *Left_Node_Ptr = Node_Ptr->Left; + NDT_Node *First_Node_Ptr; + + /* + On sauve le fils gauche du noeud à supprimer dans un pointeur de + sauvegarde pour pouvoir le récupérer au cas où la procédure serait + interrompue (recovery). + */ + + root_ptr->Index_Tab[index_id].Save = Left_Node_Ptr; + + /* On remplace le noeud supprimé par son sous-arbre droit */ + + if( !tmp_ptr_ptr) root_ptr->Index_Tab[index_id].Head = root_ptr->Index_Tab[index_id].Tail = Node_Ptr->Right; + else *tmp_ptr_ptr = Node_Ptr->Right; + + Right_Node_Ptr->Parent = Node_Ptr->Parent; + + /* On attache le sous-arbre gauche au premier noeud du sous-arbre droit */ + + if( root_ptr->Index_Tab[index_id].Save) + { + First_Node_Ptr = ND_Tree_Node_First_Recursive_Get(Right_Node_Ptr); + + First_Node_Ptr->Left = root_ptr->Index_Tab[index_id].Save; + + root_ptr->Index_Tab[index_id].Save->Parent = First_Node_Ptr; + + root_ptr->Index_Tab[index_id].Save = NULL; + } + } + else + { + /* On remplace le noeud supprimé par son sous-arbre gauche */ + + if( !tmp_ptr_ptr) root_ptr->Index_Tab[index_id].Head = root_ptr->Index_Tab[index_id].Tail = Node_Ptr->Left; + else *tmp_ptr_ptr = Node_Ptr->Left; + + if( Node_Ptr->Left) Node_Ptr->Left->Parent = Node_Ptr->Parent; + } + + root_ptr->Index_Tab[index_id].Node_Number--; + + /* Pas de mise à jour des informations de profondeur : trop coûteux */ + + Node_Ptr->Root = NULL; + Node_Ptr->Index = NDD_INDEX_UNKNOWN; + Node_Ptr->Left = NULL; + Node_Ptr->Right = NULL; + Node_Ptr->Parent = NULL; + } + else + { + sprintf (NDG_Base.Err_String, "Error ND_Index_Node_Remove_I: unknown structure type (%d)", root_ptr->Index_Tab[index_id].Type); + ND_Error_Print (); + return(NDS_ERRAPI); + } + + return(NDS_OK); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Suppression d'un noeud dans une structure de données */ +/*------------------------------------------------------------------------------*/ +/* (I) Node: pointeur sur le noeud à supprimer */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Index_Node_Remove_C( NDT_Node *Node_Ptr) +{ + if( NDG_Base.Open_Status != NDD_TRUE) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Node_Remove_C: library is not open"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Node_Ptr) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Node_Remove_C: the node to remove is null"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + return( ND_Index_Node_Remove_I( Node_Ptr)); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Récupération du premier noeud d'une structure */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine dont on cherche le premier noeud */ +/* (O) First_Node : adresse du pointeur sur le premier noeud */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Index_Node_First_Get_I( NDT_Node **First_Node_Ptr_Ptr, NDT_Root *Root_Ptr, NDT_Index_Id Index_Id) +{ + *First_Node_Ptr_Ptr = NULL; + + if( ND_INDEX_TYPE_LIST_IS(Root_Ptr, Index_Id)) *First_Node_Ptr_Ptr = (Root_Ptr->Index_Tab)[Index_Id].Head; + + else if( ND_INDEX_TYPE_TREE_IS(Root_Ptr, Index_Id)) *First_Node_Ptr_Ptr = ND_Tree_Node_First_Recursive_Get( Root_Ptr->Index_Tab[Index_Id].Head); + + // if(!*First_Node_Ptr_Ptr) return(NDS_KO); + + return( NDS_OK); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Récupération du premier noeud d'une structure */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine dont on cherche le premier noeud */ +/* (O) First_Node : adresse du pointeur sur le premier noeud */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Index_Node_First_Get_C( NDT_Node **First_Node_Ptr_Ptr, NDT_Root *Root_Ptr, NDT_Index_Id Index_Id) +{ + if( NDG_Base.Open_Status != NDD_TRUE) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Node_First_Get_C: library is not open"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Root_Ptr) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Node_First_Get_C: structure root is null"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + return( ND_Index_Node_First_Get_I( First_Node_Ptr_Ptr, Root_Ptr, Index_Id)); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Récupération du dernier noeud d'une structure */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine dont on cherche le dernier noeud */ +/* (O) Last_Node : adresse du pointeur sur le premier noeud */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Index_Node_Last_Get_I ( NDT_Node **Last_Node_Ptr_Ptr, NDT_Root *Root_Ptr, NDT_Index_Id Index_Id) +{ + *Last_Node_Ptr_Ptr = NULL; + + if( ND_INDEX_TYPE_LIST_IS(Root_Ptr, Index_Id)) *Last_Node_Ptr_Ptr = Root_Ptr->Index_Tab[Index_Id].Tail; + + else if( ND_INDEX_TYPE_TREE_IS(Root_Ptr, Index_Id)) *Last_Node_Ptr_Ptr = ND_Tree_Node_Last_Recursive_Get( Root_Ptr->Index_Tab[Index_Id].Head); + + // if(!*Last_Node_Ptr_Ptr) return(NDS_KO); + + return( NDS_OK); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Récupération du dernier noeud d'une structure */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine dont on cherche le dernier noeud */ +/* (O) Last_Node : adresse du pointeur sur le premier noeud */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Index_Node_Last_Get_C( NDT_Node **Last_Node_Ptr_Ptr, NDT_Root *Root_Ptr, NDT_Index_Id Index_Id) +{ + if( NDG_Base.Open_Status != NDD_TRUE) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Node_Last_Get_C: library is not open"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Root_Ptr) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Node_Last_Get_C: structure root is null"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + return( ND_Index_Node_Last_Get_I( Last_Node_Ptr_Ptr, Root_Ptr, Index_Id)); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Récupération du noeud suivant */ +/*------------------------------------------------------------------------------*/ +/* (I) Node : pointeur sur le noeud dont on cherche le suivant */ +/* (O) Next_Node : adresse du pointeur sur le noeud suivant */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Index_Node_Next_Get_I ( NDT_Node **Next_Node_Ptr_Ptr, NDT_Node *Node_Ptr) +{ + if( ND_INDEX_TYPE_LIST_IS( Node_Ptr->Root, Node_Ptr->Index)) + { + *Next_Node_Ptr_Ptr = Node_Ptr->Right; + } + else if( ND_INDEX_TYPE_TREE_IS( Node_Ptr->Root, Node_Ptr->Index)) + { + if( !Node_Ptr->Right) + { + *Next_Node_Ptr_Ptr = ND_Tree_Parent_Next_Recursive_Get(Node_Ptr); + } + else + { + *Next_Node_Ptr_Ptr = ND_Tree_Node_First_Recursive_Get(Node_Ptr->Right); + } + } + + // if(!*Next_Node_Ptr_Ptr) return(NDS_KO); + + return( NDS_OK); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Récupération du noeud suivant */ +/*------------------------------------------------------------------------------*/ +/* (I) Node : pointeur sur le noeud dont on cherche le suivant */ +/* (O) Next_Node : adresse du pointeur sur le noeud suivant */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Index_Node_Next_Get_C( NDT_Node **Next_Node_Ptr_Ptr, NDT_Node *Node_Ptr) +{ + if( NDG_Base.Open_Status != NDD_TRUE) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Node_Next_Get_C: library is not open"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Node_Ptr) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Node_Next_Get_C: node is null"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + return( ND_Index_Node_Next_Get_I( Next_Node_Ptr_Ptr, Node_Ptr)); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Récupération du noeud précédant */ +/*------------------------------------------------------------------------------*/ +/* (I) Node : pointeur sur le noeud dont on cherche le précédant */ +/* (O) Prev_Node : adresse du pointeur sur le noeud suivant */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Index_Node_Previous_Get_I( NDT_Node **Prev_Node_Ptr_Ptr, NDT_Node *Node_Ptr) +{ + if( ND_INDEX_TYPE_LIST_IS( Node_Ptr->Root, Node_Ptr->Index)) *Prev_Node_Ptr_Ptr = Node_Ptr->Left; + + if( ND_INDEX_TYPE_TREE_IS( Node_Ptr->Root, Node_Ptr->Index)) + { + if( !Node_Ptr->Left) + { + *Prev_Node_Ptr_Ptr = ND_Tree_Parent_Previous_Recursive_Get( Node_Ptr); + } + else + { + *Prev_Node_Ptr_Ptr = ND_Tree_Node_Last_Recursive_Get( Node_Ptr->Left); + } + } + + // if( !*Prev_Node_Ptr_Ptr) return( NDS_KO); + + return( NDS_OK); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Récupération du noeud précédant */ +/*------------------------------------------------------------------------------*/ +/* (I) Node : pointeur sur le noeud dont on cherche le précédant */ +/* (O) Prev_Node : adresse du pointeur sur le noeud suivant */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Index_Node_Previous_Get_C( NDT_Node **Prev_Node_Ptr_Ptr, NDT_Node *Node_Ptr) +{ + if( NDG_Base.Open_Status != NDD_TRUE) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Node_Previous_Get_C: library is not open"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Node_Ptr) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Node_Previous_Get_C: node is null"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + return( ND_Index_Node_Previous_Get_I( Prev_Node_Ptr_Ptr, Node_Ptr)); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Recherche un noeud à partir d'une valeur */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de l'abre */ +/* (O) Node : adresse du pointeur sur le noeud à récuperer */ +/* (I) Value : pointeur sur la valeur à rechercher */ +/* (I) Data : pointeur de données */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Index_Node_Find_VI( NDT_Node **Node_Ptr_Ptr, NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, void *Value_Ptr, va_list Args) +{ + if( ND_INDEX_TYPE_LIST_IS( Root_Ptr, Index_Id)) + { + *Node_Ptr_Ptr = ND_List_Node_Find( Root_Ptr, Index_Id, Value_Ptr, Args); + } + else if ( ND_INDEX_TYPE_TREE_IS( Root_Ptr, Index_Id)) + { + *Node_Ptr_Ptr = ND_Tree_Node_Find( Root_Ptr, Index_Id, Value_Ptr, Args); + } + else + { + sprintf (NDG_Base.Err_String, "Error ND_Index_Node_Find_VI: unknown structure type (%d)", Root_Ptr->Index_Tab[Index_Id].Type); + ND_Error_Print (); + + return( NDS_KO); + } + + return( NDS_OK); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Recherche un noeud à partir d'une valeur */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de l'abre */ +/* (O) Node : adresse du pointeur sur le noeud à récuperer */ +/* (I) Value : pointeur sur la valeur à rechercher */ +/* (I) Data : pointeur de données */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Index_Node_Find_VC( NDT_Node **Node_Ptr_Ptr, NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, void *Value_Ptr, va_list Args) +{ + NDT_Status status; + + + if( NDG_Base.Open_Status != NDD_TRUE) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Node_Find_VC: library is not open"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Root_Ptr) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Node_Find_VC: structure root is null"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Value_Ptr) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Node_Find_VC: the value to find is null"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + status = ND_Index_Node_Find_VI( Node_Ptr_Ptr, Root_Ptr, Index_Id, Value_Ptr, Args); + + + return( status); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Recherche un noeud à partir d'une valeur */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de l'abre */ +/* (O) Node : adresse du pointeur sur le noeud à récuperer */ +/* (I) Value : pointeur sur la valeur à rechercher */ +/* (I) Data : pointeur de données */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Index_Node_Find_I( NDT_Node **Node_Ptr_Ptr, NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, void *Value_Ptr, ...) +{ + va_list user_args; + + + va_start( user_args, Value_Ptr); + + if( ND_INDEX_TYPE_LIST_IS( Root_Ptr, Index_Id)) + { + *Node_Ptr_Ptr = ND_List_Node_Find( Root_Ptr, Index_Id, Value_Ptr, user_args); + } + else if ( ND_INDEX_TYPE_TREE_IS( Root_Ptr, Index_Id)) + { + *Node_Ptr_Ptr = ND_Tree_Node_Find( Root_Ptr, Index_Id, Value_Ptr, user_args); + } + else + { + sprintf (NDG_Base.Err_String, "Error ND_Index_Node_Find_I: unknown structure type (%d)", Root_Ptr->Index_Tab[Index_Id].Type); + ND_Error_Print (); + } + + va_end( user_args); + + return( NDS_OK); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Recherche un noeud à partir d'une valeur */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de l'abre */ +/* (O) Node : adresse du pointeur sur le noeud à récuperer */ +/* (I) Value : pointeur sur la valeur à rechercher */ +/* (I) Data : pointeur de données */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Index_Node_Find_C( NDT_Node **Node_Ptr_Ptr, NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, void *Value_Ptr, ...) +{ + NDT_Status status; + va_list user_args; + + + va_start( user_args, Value_Ptr); + + if( NDG_Base.Open_Status != NDD_TRUE) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Node_Find_C: library is not open"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Root_Ptr) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Node_Find_C: structure root is null"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Value_Ptr) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Node_Find_C: the value to find is null"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + status = ND_Index_Node_Find_VI( Node_Ptr_Ptr, Root_Ptr, Index_Id, Value_Ptr, user_args); + + va_end( user_args); + + return( status); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Recherche un noeud à partir d'une valeur */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de l'abre */ +/* (O) Node : adresse du pointeur sur le noeud à récuperer */ +/* (I) Value : pointeur sur la valeur à rechercher */ +/* (I) Data : pointeur de données */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_DataStruct_Value_Find_VI( void **Value_Ptr_Ptr, NDT_Root *Root_Ptr, void *Ref_Value_Ptr, va_list Args) +{ + NDT_Status status; + NDT_Index_Id new_index; + NDT_Command new_cmd; + NDT_Node *node_ptr; + + + status = ND_Manager_Exec_I( Root_Ptr, NDD_INDEX_PRIMARY, NULL, NDD_CMD_INDEX_GET, &new_index, &new_cmd, NDD_CMD_VALUE_FIND, Ref_Value_Ptr); + if( ND_ERROR(status)) return( status); + + status = ND_Index_Node_Find_VI( &node_ptr, Root_Ptr, new_index, Ref_Value_Ptr, Args); + if( ND_ERROR(status)) return( status); + + if( node_ptr != NULL) + { + *Value_Ptr_Ptr = node_ptr->Value; + } + else + { + *Value_Ptr_Ptr = NULL; + } + + return( NDS_OK); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Recherche un noeud à partir d'une valeur */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de l'abre */ +/* (O) Node : adresse du pointeur sur le noeud à récuperer */ +/* (I) Value : pointeur sur la valeur à rechercher */ +/* (I) Data : pointeur de données */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_DataStruct_Value_Find_VC( void **Value_Ptr_Ptr, NDT_Root *Root_Ptr, void *Ref_Value_Ptr, va_list Args) +{ + NDT_Status status; + + + if( NDG_Base.Open_Status != NDD_TRUE) + { + sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Value_Find_VC: library is not open"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Root_Ptr) + { + sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Value_Find_VC: structure root is null"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Ref_Value_Ptr) + { + sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Value_Find_VC: the ref value to find is null"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + status = ND_DataStruct_Value_Find_VI( Value_Ptr_Ptr, Root_Ptr, Ref_Value_Ptr, Args); + + return( status); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Recherche un noeud à partir d'une valeur */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de l'abre */ +/* (O) Node : adresse du pointeur sur le noeud à récuperer */ +/* (I) Value : pointeur sur la valeur à rechercher */ +/* (I) Data : pointeur de données */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_DataStruct_Value_Find_I( void **Value_Ptr_Ptr, NDT_Root *Root_Ptr, void *Ref_Value_Ptr, ...) +{ + NDT_Status status; + va_list user_args; + NDT_Index_Id new_index; + NDT_Command new_cmd; + NDT_Node *node_ptr; + + + va_start( user_args, Ref_Value_Ptr); + + status = ND_Manager_Exec_I( Root_Ptr, NDD_INDEX_PRIMARY, NULL, NDD_CMD_INDEX_GET, &new_index, &new_cmd, NDD_CMD_VALUE_FIND, Ref_Value_Ptr); + if( ND_ERROR(status)) return( status); + + status = ND_Index_Node_Find_VI( &node_ptr, Root_Ptr, new_index, Ref_Value_Ptr, user_args); + if( ND_ERROR(status)) return( status); + + if( node_ptr != NULL) + { + *Value_Ptr_Ptr = node_ptr->Value; + } + else + { + *Value_Ptr_Ptr = NULL; + } + + va_end( user_args); + + return( NDS_OK); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Recherche un noeud à partir d'une valeur */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de l'abre */ +/* (O) Node : adresse du pointeur sur le noeud à récuperer */ +/* (I) Value : pointeur sur la valeur à rechercher */ +/* (I) Data : pointeur de données */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_DataStruct_Value_Find_C( void **Value_Ptr_Ptr, NDT_Root *Root_Ptr, void *Ref_Value_Ptr, ...) +{ + NDT_Status status; + va_list user_args; + + + va_start( user_args, Ref_Value_Ptr); + + if( NDG_Base.Open_Status != NDD_TRUE) + { + sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Value_Find_C: library is not open"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Root_Ptr) + { + sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Value_Find_C: structure root is null"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Ref_Value_Ptr) + { + sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Value_Find_C: the ref value to find is null"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + status = ND_DataStruct_Value_Find_VI( Value_Ptr_Ptr, Root_Ptr, Ref_Value_Ptr, user_args); + + va_end( user_args); + + return(status); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Récupération de la racine d'une structure */ +/*------------------------------------------------------------------------------*/ +/* (O) Root : adresse du pointeur sur la racine à récupérer */ +/* (I) Node : pointeur sur le noeud dont on cherche la racine */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Node_Root_Get_I( NDT_Root **Root_Ptr_Ptr, NDT_Node *Node_Ptr) +{ + *Root_Ptr_Ptr = Node_Ptr->Root; + + return NDS_OK; +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Récupération de la racine d'une structure */ +/*------------------------------------------------------------------------------*/ +/* (O) Root : adresse du pointeur sur la racine à récupérer */ +/* (I) Node : pointeur sur le noeud dont on cherche la racine */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Node_Root_Get_C( NDT_Root **Root_Ptr_Ptr, NDT_Node *Node_Ptr ) +{ + if( NDG_Base.Open_Status != NDD_TRUE) + { + sprintf( NDG_Base.Err_String, "Error ND_Node_Root_Get_C: library is not open"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Node_Ptr) + { + sprintf( NDG_Base.Err_String, "Error ND_Node_Root_Get_C: node is null"); + ND_Error_Print(); + + return(NDS_ERRAPI); + } + + return( ND_Node_Root_Get_I( Root_Ptr_Ptr, Node_Ptr)); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Allocation d'une valeur d'une structure de données */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la structure de données */ +/* (O) Value : adresse d'un pointeur sur la valeur à allouer */ +/* (I) ... : arguments relatifs à l'allocation de la valeur */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Value_Alloc_I( NDT_Root *Root_Ptr, void **Value_Ptr_Ptr, ...) +{ + NDT_Status rc; + va_list user_args; + + + /* Récupération des arguments pour l'allocation de la valeur */ + + va_start( user_args, Value_Ptr_Ptr); + + /* Appel du manager */ + + rc = ND_Manager_Exec_I( Root_Ptr, NDD_INDEX_UNKNOWN, NULL, NDD_CMD_VALUE_ALLOC, Value_Ptr_Ptr, user_args); + + va_end( user_args); + + return( rc); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Allocation d'une valeur d'une structure de données */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la structure de données */ +/* (O) Value : adresse d'un pointeur sur la valeur à allouer */ +/* (I) ... : arguments relatifs à l'allocation de la valeur */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Value_Alloc_C( NDT_Root *Root_Ptr, void **Value_Ptr_Ptr, ...) +{ + NDT_Status rc; + va_list user_args; + + + if( NDG_Base.Open_Status != NDD_TRUE) + { + sprintf( NDG_Base.Err_String, "Error ND_Value_Alloc_C: library is not open"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Root_Ptr) + { + sprintf( NDG_Base.Err_String, "Error ND_Value_Alloc_C: structure root is null"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + /* Récupération des arguments pour l'allocation de la valeur */ + + va_start( user_args, Value_Ptr_Ptr); + + /* Appel du manager */ + + rc = ND_Manager_Exec_I( Root_Ptr, NDD_INDEX_UNKNOWN, NULL, NDD_CMD_VALUE_ALLOC, Value_Ptr_Ptr, user_args); + + va_end( user_args); + + return( rc); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Désallocation d'une valeur d'une structure de données */ +/*------------------------------------------------------------------------------*/ +/* (I) Root: pointeur sur la racine de la structure de données */ +/* (I) Value: pointeur sur la valeur à désallouer */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Value_Free_I( NDT_Root *Root_Ptr, void *Value_Ptr) +{ + return( ND_Manager_Exec_I( Root_Ptr, NDD_INDEX_UNKNOWN, NULL, NDD_CMD_VALUE_FREE, Value_Ptr)); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Désallocation d'une valeur d'une structure de données */ +/*------------------------------------------------------------------------------*/ +/* (I) Root: pointeur sur la racine de la structure de données */ +/* (I) Value: pointeur sur la valeur à désallouer */ +/*------------------------------------------------------------------------------*/ +NDT_Status ND_Value_Free_C( NDT_Root *Root_Ptr, void *Value_Ptr) +{ + if( NDG_Base.Open_Status != NDD_TRUE) + { + sprintf( NDG_Base.Err_String, "Error ND_Value_Free_C: library is not open"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Root_Ptr) + { + sprintf( NDG_Base.Err_String, "Error ND_Value_Free_C: structure root is null"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Value_Ptr) + { + sprintf( NDG_Base.Err_String, "Error ND_Value_Free_C: the value to free is null"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + /* Appel du manager */ + + return( ND_Value_Free_I( Root_Ptr, Value_Ptr)); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Exécution d'une fonction Manager dont le nom est passé en paramètre */ +/*------------------------------------------------------------------------------*/ +/* (I) Function : nom de la fonction manager à exécuter */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Manager_Exec_VI( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node *Node_Ptr, NDT_Command Command, va_list Args) +{ + NDT_Status status; + NDT_Manager *manager_ptr; + + + if( Root_Ptr->Manager_Ptr != NULL) + { + manager_ptr = Root_Ptr->Manager_Ptr; + } + else + { + if( ND_Symbol_Find( (void **)&manager_ptr, Root_Ptr->Manager_Name) != NDS_OK) + { + sprintf( NDG_Base.Err_String, "ND_Manager_Exec_VI: cant't find manger function"); + ND_Error_Print(); + + return( NDS_KO); + } + } + + status = manager_ptr( Root_Ptr, Index_Id, Node_Ptr, Command, Args); + + return( status); +} + + + + +/*------------------------------------------------------------------------------*/ +/* Exécution d'une fonction Manager dont le nom est passé en paramètre */ +/*------------------------------------------------------------------------------*/ +/* (I) Function : nom de la fonction manager à exécuter */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Manager_Exec_VC( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node *Node_Ptr, NDT_Command Command, va_list Args) +{ + NDT_Status status; + + + if( NDG_Base.Open_Status != NDD_TRUE) + { + sprintf( NDG_Base.Err_String, "Error ND_Manager_Exec_VC: library is not open"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Root_Ptr) + { + sprintf( NDG_Base.Err_String, "Error ND_Manager_Exec_VC: structure root is null"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Root_Ptr->Manager_Ptr || !*(Root_Ptr->Manager_Ptr)) + { + sprintf( NDG_Base.Err_String, "Error ND_Manager_Exec_VC: undefined function name"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + status = ND_Manager_Exec_VI( Root_Ptr, Index_Id, Node_Ptr, Command, Args); + + return( status); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Exécution d'une fonction Manager dont le nom est passé en paramètre */ +/*------------------------------------------------------------------------------*/ +/* (I) Function : nom de la fonction manager à exécuter */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Manager_Exec_I( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node *Node_Ptr, NDT_Command Command, ...) +{ + NDT_Status status; + va_list args; + NDT_Manager *manager_ptr; + + + va_start( args, Command); + + if( Root_Ptr->Manager_Ptr != NULL) + { + manager_ptr = Root_Ptr->Manager_Ptr; + } + else + { + if( ND_Symbol_Find( (void **)&manager_ptr, Root_Ptr->Manager_Name) != NDS_OK) + { + sprintf( NDG_Base.Err_String, "ND_Manager_Exec_I: cant't find manger function"); + ND_Error_Print(); + + return( NDS_KO); + } + } + + status = manager_ptr( Root_Ptr, Index_Id, Node_Ptr, Command, args); + + va_end( args); + + return( status); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Exécution d'une fonction Manager dont le nom est passé en paramètre */ +/*------------------------------------------------------------------------------*/ +/* (I) Function : nom de la fonction manager à exécuter */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Manager_Exec_C( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node *Node_Ptr, NDT_Command Command, ...) +{ + NDT_Status status; + va_list args; + + + va_start( args, Command); + + if( NDG_Base.Open_Status != NDD_TRUE) + { + sprintf( NDG_Base.Err_String, "Error ND_Manager_Exec_C: library is not open"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Root_Ptr) + { + sprintf( NDG_Base.Err_String, "Error ND_Manager_Exec_C: structure root is null"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( !Root_Ptr->Manager_Ptr || !*(Root_Ptr->Manager_Ptr)) + { + sprintf( NDG_Base.Err_String, "Error ND_Manager_Exec_C: undefined function name"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + status = ND_Manager_Exec_VI( Root_Ptr, Index_Id, Node_Ptr, Command, args); + + va_end( args); + + return( status); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Exécution d'une fonction d'allocation dont le nom est passé en paramètre */ +/*------------------------------------------------------------------------------*/ +/* (I) Function : nom de la fonction à exécuter */ +/* (O) Ptr : adresse d'un pointeur sur la zone à allouer */ +/* (I) Size : taille de la zone à allouer */ +/* (I) Data : données utilisateur utiles à l'allocateur */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Allocator_Exec_I( void **Ptr_Ptr, size_t Size, NDT_Allocator_Name Allocator_Name, NDT_Allocator *Allocator_Ptr, void *Data_Ptr) +{ + NDT_Allocator *allocator_ptr; + + + if( Allocator_Ptr != NULL) + { + allocator_ptr = Allocator_Ptr; + } + else + { + if( ND_Symbol_Find( (void **)&allocator_ptr, Allocator_Name) != NDS_OK) + { + sprintf( NDG_Base.Err_String, "Error ND_Manager_Exec_I: cant't find allocator function"); + ND_Error_Print(); + + return( NDS_KO); + } + } + + return allocator_ptr( Ptr_Ptr, Size, Data_Ptr); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Exécution d'une fonction d'allocation dont le nom est passé en paramètre */ +/*------------------------------------------------------------------------------*/ +/* (I) Function : nom de la fonction à exécuter */ +/* (O) Ptr : adresse d'un pointeur sur la zone à allouer */ +/* (I) Size : taille de la zone à allouer */ +/* (I) Data : données utilisateur utiles à l'allocateur */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Allocator_Exec_C( void **Ptr_Ptr, size_t Size, NDT_Allocator_Name Allocator_Name, NDT_Allocator *Allocator_Ptr, void *Data_Ptr) +{ + if( NDG_Base.Open_Status != NDD_TRUE) + { + sprintf( NDG_Base.Err_String, "Error ND_Allocator_Exec_C: library is not open"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( ( Allocator_Name == NULL) && ( Allocator_Ptr == NULL)) + { + sprintf( NDG_Base.Err_String, "Error ND_Allocator_Exec_C: undefined function name"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + return( ND_Allocator_Exec_I( Ptr_Ptr, Size, Allocator_Name, Allocator_Ptr, Data_Ptr)); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Exécution d'une fonction de désallocation dont nom est passé en paramètre */ +/*------------------------------------------------------------------------------*/ +/* (I) Function : nom de la fonction à exécuter */ +/* (I) Ptr : adresse de la zone à désallouer */ +/* (I) Data : données utilisateur utiles à l'allocateur */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Desallocator_Exec_I( void *Ptr, NDT_Desallocator_Name Desallocator_Name, NDT_Desallocator *Desallocator_Ptr, void *Data_Ptr) +{ + NDT_Desallocator *desallocator_ptr; + + + if( Desallocator_Ptr != NULL) + { + desallocator_ptr = Desallocator_Ptr; + } + else + { + if( ND_Symbol_Find( (void **)&desallocator_ptr, Desallocator_Name) != NDS_OK) + { + sprintf( NDG_Base.Err_String, "Error ND_Manager_Exec_I: cant't find desallocator function"); + ND_Error_Print(); + + return( NDS_KO); + } + } + + return( desallocator_ptr( Ptr, Data_Ptr)); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Exécution d'une fonction de désallocation dont nom est passé en paramètre */ +/*------------------------------------------------------------------------------*/ +/* (I) Function : nom de la fonction à exécuter */ +/* (I) Ptr : adresse de la zone à désallouer */ +/* (I) Data : données utilisateur utiles à l'allocateur */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Desallocator_Exec_C( void *Ptr, NDT_Desallocator_Name Desallocator_Name, NDT_Desallocator *Desallocator_Ptr, void *Data_Ptr) +{ + if( NDG_Base.Open_Status != NDD_TRUE) + { + sprintf( NDG_Base.Err_String, "Error ND_Desallocator_Exec_C: library is not open"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + if( ( Desallocator_Name == NULL) && ( Desallocator_Ptr == NULL)) + { + sprintf( NDG_Base.Err_String, "Error ND_Desallocator_Exec_C: undefined function name"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } + + return( ND_Desallocator_Exec_I( Ptr, Desallocator_Name, Desallocator_Ptr, Data_Ptr)); +} + + + + + + + +/*------------------------------------------------------------------------------*/ +/*------------------------------------------------------------------------------*/ +/* PRIVATE FUNCTIONS */ +/*------------------------------------------------------------------------------*/ +/*------------------------------------------------------------------------------*/ + +/*------------------------------------------------------------------------------*/ +/* Symbol Lookup */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Symbol_Find( void **Ptr_Ptr, const char *Symbol_Name) +{ +#if !defined(_WIN32) + NDT_Symbol *Symbol_Ptr; + + + /* Recherche du symbole dans la table des symboles locale */ + + Symbol_Ptr = NDG_Base.Symbol_First_Ptr; + + while( Symbol_Ptr) + { + if( !strcmp( Symbol_Ptr->Name, Symbol_Name)) + { + *Ptr_Ptr = Symbol_Ptr->Ptr; + return( NDS_OK); + } + else + { + Symbol_Ptr = Symbol_Ptr->Next; + } + } + + + /* Si le symbole n'a pas été trouvée dans la table des symboles locale, on l'y ajoute */ + + if( ( *Ptr_Ptr = dlsym( NDG_Base.DL_Ptr, (const char *)Symbol_Name)) == NULL) + { + sprintf( NDG_Base.Err_String, "Error ND_Symbol_Find: unable to find \"%s\"' in symbol table (%s)", Symbol_Name, dlerror()); + ND_Error_Print(); + + return( NDS_KO); + } + + Symbol_Ptr = (NDT_Symbol *)malloc( sizeof( NDT_Symbol)); + if( Symbol_Ptr == NULL) + { + sprintf( NDG_Base.Err_String, "Error ND_Symbol_Find: no more memory"); + ND_Error_Print(); + + return( NDS_KO); + } + else + { + Symbol_Ptr->Name = strdup (Symbol_Name); + Symbol_Ptr->Ptr = *Ptr_Ptr; + Symbol_Ptr->Next = NDG_Base.Symbol_First_Ptr; + + NDG_Base.Symbol_First_Ptr = Symbol_Ptr; + } +#endif + + return( NDS_OK); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Allocation d'un noeud */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la structure */ +/* (O) Node : adresse du pointeur sur le nouveau noeud */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Node_Alloc( NDT_Root *Root_Ptr, NDT_Node **Node_Ptr_Ptr ) +{ + NDT_Status rc; + + + rc = ND_Allocator_Exec_I( (void **)Node_Ptr_Ptr, sizeof(NDT_Node), Root_Ptr->Allocator_Name, Root_Ptr->Allocator_Ptr, Root_Ptr->User_Ptr); + if( ND_ERROR( rc)) return( rc); + + (*Node_Ptr_Ptr)->Root = NULL; + (*Node_Ptr_Ptr)->Index = NDD_INDEX_UNKNOWN; + (*Node_Ptr_Ptr)->Parent = NULL; + (*Node_Ptr_Ptr)->Left = NULL; + (*Node_Ptr_Ptr)->Right = NULL; + (*Node_Ptr_Ptr)->Value = NULL; + + return( NDS_OK); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Désallocation d'un noeud */ +/*------------------------------------------------------------------------------*/ +/* (I) Root: pointeur sur la racine de la structure */ +/* (I) Node : pointeur sur le noeud à détruire */ +/*------------------------------------------------------------------------------*/ +NDT_Status ND_Node_Free( NDT_Root *Root_Ptr, NDT_Node *Node_Ptr) +{ + return( ND_Desallocator_Exec_I( Node_Ptr, Root_Ptr->Desallocator_Name, Root_Ptr->Desallocator_Ptr, Root_Ptr->User_Ptr)); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Création d'une nouvelle structure de données */ +/*------------------------------------------------------------------------------*/ +/* (O) Root: adresse d'un pointeur sur la racine de la nouvelle structure */ +/* (I) Type: type de la structure.de données (liste ou arbre binaire) */ +/* (I) Allocator: pointeur vers la fonction d'allocation */ +/* (I) Desallocator: pointeur vers la fonction de désallocation */ +/* (I) Data : pointeur de données utiles à l'allocateur */ +/* (I) Own_Value : indique si la structure est propriétaire de ses valeurs */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Index_Clear( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id) +{ + Root_Ptr->Index_Tab[Index_Id].Type = NDD_INDEX_STATUS_UNKNOWN; + + Root_Ptr->Index_Tab[Index_Id].Head = NULL; + Root_Ptr->Index_Tab[Index_Id].Tail = NULL; + Root_Ptr->Index_Tab[Index_Id].Save = NULL; + + Root_Ptr->Index_Tab[Index_Id].Max_Dif = DEF_MAX_DIF; + + Root_Ptr->Index_Tab[Index_Id].Node_Number = 0; + Root_Ptr->Index_Tab[Index_Id].Max_Depth = 0; + Root_Ptr->Index_Tab[Index_Id].Min_Depth = NDD_HUGE_LONG; + Root_Ptr->Index_Tab[Index_Id].Nb_Equ = 0; + + return( NDS_OK); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Allocation d'une racine de structure de données */ +/*------------------------------------------------------------------------------*/ +/* (O) New_Root: adresse du pointeur sur la nouvelle racine */ +/* (I) Type: type de la structure de données */ +/* (I) Allocator: pointeur vers la fonction d'allocation */ +/* (I) Desallocator: pointeur vers la fonction de désallocation */ +/* (I) Data : pointeur de données utiles à l'allocateur */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Node_Root_Alloc( NDT_Root **Root_Ptr_Ptr, NDT_Index_Nb Index_Nb, NDT_Index_Type *Type_Ptr, char *Manager_Name, NDT_Manager *Manager_Ptr, char *Allocator_Name, NDT_Allocator *Allocator_Ptr, char *Desallocator_Name, NDT_Desallocator *Desallocator_Ptr, short Own_Value, void *Data_Ptr) +{ + NDT_Status status; + NDT_Index_Id index_id; + + + status = ND_Allocator_Exec_I( (void **)Root_Ptr_Ptr, ( sizeof( NDT_Root) + sizeof(NDT_Index) * (Index_Nb - 1)), Allocator_Name, Allocator_Ptr, Data_Ptr); + if( ND_ERROR(status)) return( status); + + if( strlen(Manager_Name) > NDD_MANAGER_NAME_LEN_MAX) return( NDS_ERRAPI); + strcpy( (*Root_Ptr_Ptr)->Manager_Name, Manager_Name); + (*Root_Ptr_Ptr)->Manager_Ptr = Manager_Ptr; + + if( strlen(Allocator_Name) > NDD_ALLOCATOR_NAME_LEN_MAX) return( NDS_ERRAPI); + strcpy( (*Root_Ptr_Ptr)->Allocator_Name, Allocator_Name); + (*Root_Ptr_Ptr)->Allocator_Ptr = Allocator_Ptr; + + if( strlen(Desallocator_Name) > NDD_DESALLOCATOR_NAME_LEN_MAX) return( NDS_ERRAPI); + strcpy( (*Root_Ptr_Ptr)->Desallocator_Name, Desallocator_Name); + (*Root_Ptr_Ptr)->Desallocator_Ptr = Desallocator_Ptr; + + (*Root_Ptr_Ptr)->Own_Value = Own_Value; + (*Root_Ptr_Ptr)->User_Ptr = Data_Ptr; + + (*Root_Ptr_Ptr)->Index_Nb = Index_Nb; + (*Root_Ptr_Ptr)->Index_Open_Count = 0; + + for( index_id = 0; index_id < Index_Nb; index_id++) + { + if( ( Type_Ptr[index_id] & NDD_INDEX_STATUS_MSK) == NDD_INDEX_STATUS_OPENED) + { + status = ND_Index_Open_I( *Root_Ptr_Ptr, index_id, Type_Ptr[index_id]); + if( ND_ERROR( status)) return( status); + } + else + { + if( ( status = ND_Index_Clear( *Root_Ptr_Ptr, index_id)) != NDS_OK) + { + sprintf( NDG_Base.Err_String, "Error ND_Index_Open_I: Index cleaning error"); + ND_Error_Print(); + return( NDS_KO); + } + + ( *Root_Ptr_Ptr)->Index_Tab[index_id].Type = NDD_INDEX_STATUS_CLOSED; + } + } + + return( NDS_OK); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Désallocation de la racine d'une structure de donnée */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine à détruire */ +/*------------------------------------------------------------------------------*/ +NDT_Status ND_Node_Root_Free( NDT_Root *Root_Ptr) +{ + return( ND_Desallocator_Exec_I( Root_Ptr, Root_Ptr->Desallocator_Name, Root_Ptr->Desallocator_Ptr, Root_Ptr->User_Ptr)); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Ajout d'un noeud à une liste chaînée */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la liste */ +/* (I) New_Node : pointeur sur le noeud à ajouter */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_List_Node_Add( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node *New_Node_Ptr) +{ + /* Ajout dans une liste triée */ + + if( ND_INDEX_SUBTYPE_SORTED_IS( Root_Ptr, Index_Id)) + { + NDT_Node *node_ptr; + NDT_Status rc; + + + New_Node_Ptr->Root = Root_Ptr; + New_Node_Ptr->Index = Index_Id; + New_Node_Ptr->Parent = New_Node_Ptr->Left = New_Node_Ptr->Right = NULL; + + /* + Une liste triée peut être orientée de 2 manières : + + - FIFO : un noeud sera inséré APRES un noeud de même valeur (par défaut) + - FILO : un noeud sera inséré AVANT un noeud de même valeur + */ + + if( ND_INDEX_SUBTYPE_LIFO_IS( Root_Ptr, Index_Id)) + { + /* Pour une liste triée orientée FILO, on parcourt la liste en sens normal */ + + node_ptr = Root_Ptr->Index_Tab[Index_Id].Head; + + while( node_ptr) + { + rc = ND_Manager_Exec_I( Root_Ptr, Index_Id, node_ptr, NDD_CMD_VALUE_COMP, New_Node_Ptr->Value, node_ptr->Value, NULL); + + if(rc == NDS_GREATER) + node_ptr = node_ptr->Right; + else + { + /* On insère avant le noeud courant si le nouveau noeud est de valeur inférieure ou égale */ + + New_Node_Ptr->Left = node_ptr->Left; + New_Node_Ptr->Right = node_ptr; + + if(!node_ptr->Left) Root_Ptr->Index_Tab[Index_Id].Head = New_Node_Ptr; + else node_ptr->Left->Right = New_Node_Ptr; + + node_ptr->Left = New_Node_Ptr; + node_ptr = NULL; + } + } + + /* Insertion en queue de liste si le noeud n'a pas été inséré */ + + if(!New_Node_Ptr->Left && !New_Node_Ptr->Right) + { + if( !Root_Ptr->Index_Tab[Index_Id].Tail) Root_Ptr->Index_Tab[Index_Id].Head = Root_Ptr->Index_Tab[Index_Id].Tail = New_Node_Ptr; + else + { + Root_Ptr->Index_Tab[Index_Id].Tail->Right = New_Node_Ptr; + New_Node_Ptr->Left = Root_Ptr->Index_Tab[Index_Id].Tail; + Root_Ptr->Index_Tab[Index_Id].Tail = New_Node_Ptr; + } + } + } + else + { + /* Pour une liste triée orientée FIFO, on parcourt la liste dans le sens inverse */ + + node_ptr = Root_Ptr->Index_Tab[Index_Id].Tail; + while( node_ptr) + { + rc = ND_Manager_Exec_I( Root_Ptr, Index_Id, node_ptr, NDD_CMD_VALUE_COMP, New_Node_Ptr->Value, node_ptr->Value, NULL); + + /* On insère après le noeud courant si le nouveau noeud est de valeur strictement supérieure ou égale */ + + if( rc == NDS_LOWER) node_ptr = node_ptr->Left; + else + { + New_Node_Ptr->Left = node_ptr; + New_Node_Ptr->Right = node_ptr->Right; + + if( !node_ptr->Right) Root_Ptr->Index_Tab[Index_Id].Tail = New_Node_Ptr; + else node_ptr->Right->Left = New_Node_Ptr; + + node_ptr->Right = New_Node_Ptr; + node_ptr = NULL; + } + } + + /* Insertion en tête de liste si le noeud n'a pas été inséré */ + + if( !New_Node_Ptr->Left && !New_Node_Ptr->Right) + { + if( !Root_Ptr->Index_Tab[Index_Id].Head) Root_Ptr->Index_Tab[Index_Id].Head = Root_Ptr->Index_Tab[Index_Id].Tail = New_Node_Ptr; + else + { + Root_Ptr->Index_Tab[Index_Id].Head->Left = New_Node_Ptr; + New_Node_Ptr->Right = Root_Ptr->Index_Tab[Index_Id].Head; + Root_Ptr->Index_Tab[Index_Id].Head = New_Node_Ptr; + } + } + } + + Root_Ptr->Index_Tab[Index_Id].Node_Number++; + + return( NDS_OK); + } + else + { + /* FIFO = ajout en queue de liste */ + + if( ND_INDEX_SUBTYPE_FIFO_IS( Root_Ptr, Index_Id)) + { + New_Node_Ptr->Root = Root_Ptr; + New_Node_Ptr->Index = Index_Id; + New_Node_Ptr->Parent = NULL; + New_Node_Ptr->Left = Root_Ptr->Index_Tab[Index_Id].Tail; + New_Node_Ptr->Right = NULL; + + if( !Root_Ptr->Index_Tab[Index_Id].Head) Root_Ptr->Index_Tab[Index_Id].Head = New_Node_Ptr; + else Root_Ptr->Index_Tab[Index_Id].Tail->Right = New_Node_Ptr; + + Root_Ptr->Index_Tab[Index_Id].Tail = New_Node_Ptr; + Root_Ptr->Index_Tab[Index_Id].Node_Number++; + + return( NDS_OK); + } + + /* FILO = ajout en tête de liste */ + + if( ND_INDEX_SUBTYPE_LIFO_IS( Root_Ptr, Index_Id)) + { + + New_Node_Ptr->Root = Root_Ptr; + New_Node_Ptr->Index = Index_Id; + New_Node_Ptr->Parent = NULL; + New_Node_Ptr->Left = NULL; + New_Node_Ptr->Right = Root_Ptr->Index_Tab[Index_Id].Head; + + if( !Root_Ptr->Index_Tab[Index_Id].Tail) Root_Ptr->Index_Tab[Index_Id].Tail = New_Node_Ptr; + else Root_Ptr->Index_Tab[Index_Id].Head->Left = New_Node_Ptr; + + Root_Ptr->Index_Tab[Index_Id].Head = New_Node_Ptr; + Root_Ptr->Index_Tab[Index_Id].Node_Number++; + + return( NDS_OK); + } + } + + printf( "ND_List_Node_Add: unknown list type (%d)\n", Root_Ptr->Index_Tab[Index_Id].Type); + return( NDS_ERRAPI); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Ajout d'une nouvelle valeur à une liste */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la liste */ +/* (I) Value : pointeur sur la valeur à ajouter */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_List_Value_Add( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, void *Value_Ptr) +{ + NDT_Status rc; + NDT_Node *node_ptr; + + + rc = ND_Node_Alloc( Root_Ptr, &node_ptr); + if( ND_ERROR(rc)) return(rc); + + node_ptr->Value = Value_Ptr; + +// return ND_List_Node_Add( Root, Node); + + rc = ND_List_Node_Add( Root_Ptr, Index_Id, node_ptr); + if( ND_ERROR(rc)) + { + return( rc); + } + else + { + return( ND_Manager_Exec_I( Root_Ptr, Index_Id, node_ptr, NDD_CMD_VALUE_ADD, Value_Ptr, NULL)); + } +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Ajout d'un noeud à un arbre binaire */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de l'arbre */ +/* (I) Value : pointeur sur la valeur à ajouter */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Tree_Value_Add( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, void *Value_Ptr) +{ + NDT_Status rc; + NDT_Node *node_ptr; + + + rc = ND_Node_Alloc( Root_Ptr, &node_ptr); + if( ND_ERROR(rc)) return(rc); + + node_ptr->Value = Value_Ptr; + +// return ND_Tree_Node_Add( Root, Node); + + rc = ND_Tree_Node_Add( Root_Ptr, Index_Id, node_ptr); + if( ND_ERROR(rc)) + { + return( rc); + } + else + { + return ND_Manager_Exec_I( Root_Ptr, Index_Id, node_ptr, NDD_CMD_VALUE_ADD, Value_Ptr, NULL); + } +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Recherche une valeur dans une liste et retourne le noeud correspondant */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la liste */ +/* (I) Value : pointeur sur la valeur à rechercher */ +/* (I) Data : pointeur de données */ +/*------------------------------------------------------------------------------*/ + +NDT_Node *ND_List_Node_Find( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, void *Value_Ptr, va_list User_Args) +{ + NDT_Node *node_ptr; + NDT_Status rc; + + + node_ptr = Root_Ptr->Index_Tab[Index_Id].Head; + + if( ND_INDEX_SUBTYPE_SORTED_IS( Root_Ptr, Index_Id)) + { + /* Pour les listes triées, la recherche peut être optimisée */ + + while( node_ptr) + { + rc = ND_Manager_Exec_I( Root_Ptr, Index_Id, node_ptr, NDD_CMD_VALUE_COMP, Value_Ptr, node_ptr->Value, User_Args); + + switch( rc) + { + case NDS_EQUAL: + { + return(node_ptr); + } + + case NDS_LOWER: + { + /* Ce n'est pas a peine de continuer car on a déjà dépassé la valeur recherchée */ + + return(NULL); + } + + case NDS_GREATER: + { + node_ptr = node_ptr->Right; + break; + } + } + } + } + else + { + /* Pour les listes non triées, il faut parcourir toute la liste */ + + while( node_ptr && ( ND_Manager_Exec_I( Root_Ptr, Index_Id, node_ptr, NDD_CMD_VALUE_COMP, Value_Ptr, node_ptr->Value, User_Args) != NDS_EQUAL)) + { + node_ptr = node_ptr->Right; + } + } + + return( node_ptr); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Recherche un noeud dans un arbre et retourne le pointeur sur le noeud */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de l'abre */ +/* (I) Value : pointeur sur la valeur à rechercher */ +/* (I) Data : pointeur de données */ +/*------------------------------------------------------------------------------*/ + +/*------------------------------ Recursive Kernel ------------------------------*/ + +NDT_Node *ND_Tree_Node_Recursive_Find( NDT_Node *Node_Ptr, void *Value_Ptr, va_list User_Args) +{ + NDT_Status answer; + + + if( !Node_Ptr) return(NULL); + + answer = ND_Manager_Exec_I( Node_Ptr->Root, Node_Ptr->Index, Node_Ptr, NDD_CMD_VALUE_COMP, Value_Ptr, Node_Ptr->Value, User_Args); + + /* Noeud trouvé */ + + if( answer == NDS_EQUAL) return(Node_Ptr); + + /* Continuation de la recherche par appel récursif */ + + if( answer == NDS_LOWER) return( ND_Tree_Node_Recursive_Find( Node_Ptr->Left, Value_Ptr, User_Args)); + + if( answer == NDS_GREATER) return( ND_Tree_Node_Recursive_Find( Node_Ptr->Right, Value_Ptr, User_Args)); + + return( NULL); +} + + + +/*-------------------------------- main body ---------------------------------*/ + +NDT_Node *ND_Tree_Node_Find( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, void *Value_Ptr, va_list User_Args) +{ + return( ND_Tree_Node_Recursive_Find( Root_Ptr->Index_Tab[Index_Id].Head, Value_Ptr, User_Args)); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Recherche du premier noeud parent situé après */ +/*------------------------------------------------------------------------------*/ +/* (I) Node : pointeur sur le noeud */ +/*------------------------------------------------------------------------------*/ + +NDT_Node *ND_Tree_Parent_Next_Recursive_Get( NDT_Node *Node_Ptr) +{ + if( !Node_Ptr->Parent) return( NULL); + + if( Node_Ptr == Node_Ptr->Parent->Right) return( ND_Tree_Parent_Next_Recursive_Get( Node_Ptr->Parent)); + + return( Node_Ptr->Parent); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Recherche du premier noeud parent situé avant */ +/*------------------------------------------------------------------------------*/ +/* (I) Node : pointeur sur le noeud */ +/*------------------------------------------------------------------------------*/ + +NDT_Node *ND_Tree_Parent_Previous_Recursive_Get( NDT_Node *Node_Ptr) +{ + if( !Node_Ptr->Parent) return( NULL); + + if( Node_Ptr == Node_Ptr->Parent->Left) return( ND_Tree_Parent_Previous_Recursive_Get( Node_Ptr->Parent)); + + return( Node_Ptr->Parent); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Supprime le noeud d'une liste */ +/*------------------------------------------------------------------------------*/ +/* (I) Node : pointeur sur le noeud à supprimer */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_List_Node_Remove( NDT_Node *Node_Ptr) +{ + if( !Node_Ptr->Left) Node_Ptr->Root->Index_Tab[Node_Ptr->Index].Head = Node_Ptr->Right; + else Node_Ptr->Left->Right = Node_Ptr->Right; + + if( !Node_Ptr->Right) Node_Ptr->Root->Index_Tab[Node_Ptr->Index].Tail = Node_Ptr->Left; + else Node_Ptr->Right->Left = Node_Ptr->Left; + + Node_Ptr->Root->Index_Tab[Node_Ptr->Index].Node_Number--; + + Node_Ptr->Root = NULL; + Node_Ptr->Index = NDD_INDEX_UNKNOWN; + Node_Ptr->Left = NULL; + Node_Ptr->Right = NULL; + + return( NDS_OK); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Conversion d'un arbre en liste chaînée */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine du la structure à convertir */ +/*------------------------------------------------------------------------------*/ + +/*------------------------------- Recursive Kernel -----------------------------*/ + +NDT_Status ND_List_Recursive_Make( NDT_Node *Node_Ptr, NDT_Root *Root_Ptr, NDT_Index_Id Index_Id) +{ + NDT_Node *right_node_ptr; + + + if( !Node_Ptr) return NDS_OK; + + if( ND_List_Recursive_Make( Node_Ptr->Left, Root_Ptr, Index_Id) != NDS_OK) return NDS_KO; + + right_node_ptr = Node_Ptr->Right; + + if( ND_List_Node_Add( Root_Ptr, Index_Id, Node_Ptr) != NDS_OK) return NDS_KO; + + return( ND_List_Recursive_Make( right_node_ptr, Root_Ptr, Index_Id)); +} + + + +/*--------------------------------- main body --------------------------------*/ + +NDT_Status ND_List_Make( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id) +{ + NDT_Node *node_ptr; + + + node_ptr = Root_Ptr->Index_Tab[Index_Id].Head; + + Root_Ptr->Index_Tab[Index_Id].Head = NULL; + Root_Ptr->Index_Tab[Index_Id].Tail = NULL; + Root_Ptr->Index_Tab[Index_Id].Max_Dif = DEF_MAX_DIF; + Root_Ptr->Index_Tab[Index_Id].Node_Number = 0; + Root_Ptr->Index_Tab[Index_Id].Max_Depth = 0; + Root_Ptr->Index_Tab[Index_Id].Min_Depth = NDD_HUGE_LONG; + Root_Ptr->Index_Tab[Index_Id].Nb_Equ = 0; + Root_Ptr->Index_Tab[Index_Id].Type = NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_LIST | NDD_INDEX_SUBTYPE_FIFO; + + return( ND_List_Recursive_Make( node_ptr, Root_Ptr, Index_Id)); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Conversion d'une structure en arbre binaire */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine du la structure à convertir */ +/* (I) Type : type du futur arbre */ +/*------------------------------------------------------------------------------*/ + +/*------------------------------- Recursive Kernel -----------------------------*/ + +NDT_Node *ND_Tree_Recursive_Make( long Depth, long Node_Number, NDT_Node *Node_Ptr ) +{ + long middle_pos, left_len, right_len, i; + NDT_Node *left_node_ptr, *middle_node_ptr, *right_node_ptr; + + + if( !Node_Ptr) return( NULL); + + /* On calcule le milieu de la liste */ + + middle_pos = Node_Number / 2 + 1; + middle_node_ptr = Node_Ptr; + + for( i = 1; i < middle_pos; i++) middle_node_ptr = middle_node_ptr->Right; + + /* On coupe la liste en deux */ + + if( middle_node_ptr->Left) + { + middle_node_ptr->Left->Right = NULL; + left_node_ptr = Node_Ptr; + left_len = middle_pos - 1; + } + else + { + left_node_ptr = NULL; + left_len = 0; + } + + if( middle_node_ptr->Right) + { + middle_node_ptr->Right->Left = NULL; + right_node_ptr = middle_node_ptr->Right; + right_len = Node_Number - middle_pos; + } + else + { + right_node_ptr = NULL; + right_len = 0; + } + + /* Construction des sous-arbres */ + + middle_node_ptr->Left = ND_Tree_Recursive_Make( Depth + 1, left_len, left_node_ptr); + + middle_node_ptr->Right = ND_Tree_Recursive_Make( Depth + 1, right_len, right_node_ptr); + + if( middle_node_ptr->Left) middle_node_ptr->Left->Parent = middle_node_ptr; + + if( middle_node_ptr->Right) middle_node_ptr->Right->Parent = middle_node_ptr; + + /* Mise à jour des informations statistiques de la structure */ + + middle_node_ptr->Root->Index_Tab[middle_node_ptr->Index].Node_Number++; + + if( !middle_node_ptr->Left && !middle_node_ptr->Right) + { + /* + Si le noeud courant est une feuille, on met éventuellement à jour + les longueurs minimale et maximale des branches de l'arbre + */ + + if( Depth > middle_node_ptr->Root->Index_Tab[middle_node_ptr->Index].Max_Depth) + { + middle_node_ptr->Root->Index_Tab[middle_node_ptr->Index].Max_Depth = Depth; + } + + if( Depth < middle_node_ptr->Root->Index_Tab[middle_node_ptr->Index].Min_Depth) + { + middle_node_ptr->Root->Index_Tab[middle_node_ptr->Index].Min_Depth = Depth; + } + } + + return( middle_node_ptr); +} + + + +/*--------------------------------- main body --------------------------------*/ + +NDT_Status ND_Tree_Make( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id ) +{ + NDT_Status rc; + NDT_Node *node_ptr; + long node_number; + + + if( ND_INDEX_SUBTYPE_SORTED_IS( Root_Ptr, Index_Id)) + { + rc = ND_List_Sort( Root_Ptr, Index_Id); + if( ND_ERROR(rc)) return( rc); + } + + node_ptr = Root_Ptr->Index_Tab[Index_Id].Head; + node_number = Root_Ptr->Index_Tab[Index_Id].Node_Number; + + Root_Ptr->Index_Tab[Index_Id].Head = NULL; + Root_Ptr->Index_Tab[Index_Id].Tail = NULL; + Root_Ptr->Index_Tab[Index_Id].Max_Dif = DEF_MAX_DIF; + Root_Ptr->Index_Tab[Index_Id].Node_Number = 0; + Root_Ptr->Index_Tab[Index_Id].Max_Depth = 0; + Root_Ptr->Index_Tab[Index_Id].Min_Depth = NDD_HUGE_LONG; + Root_Ptr->Index_Tab[Index_Id].Nb_Equ = 0; + Root_Ptr->Index_Tab[Index_Id].Type = NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_TREE | NDD_INDEX_SUBTYPE_BALANCED; + + Root_Ptr->Index_Tab[Index_Id].Head = Root_Ptr->Index_Tab[Index_Id].Tail = ND_Tree_Recursive_Make( 1, node_number, node_ptr); + + return( NDS_OK); +} + + + + + +/*----------------------------------------------------------------------------*/ +/* Equilibrage d'un arbre binaire */ +/*----------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de l'arbre */ +/*----------------------------------------------------------------------------*/ + +NDT_Status ND_Tree_Equalize( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id) +{ + NDT_Status rc; + NDT_Index_Type type; + long max_dif, nb_equ; + + + type = Root_Ptr->Index_Tab[Index_Id].Type; + max_dif = Root_Ptr->Index_Tab[Index_Id].Max_Dif; + nb_equ = Root_Ptr->Index_Tab[Index_Id].Nb_Equ; + + rc = ND_List_Make( Root_Ptr, Index_Id); + if( ND_ERROR(rc)) return(rc); + + Root_Ptr->Index_Tab[Index_Id].Type = NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_LIST | NDD_INDEX_SUBTYPE_SORTED; + + rc = ND_Tree_Make( Root_Ptr, Index_Id); + if( ND_ERROR(rc)) return(rc); + + Root_Ptr->Index_Tab[Index_Id].Type = type; + Root_Ptr->Index_Tab[Index_Id].Max_Dif = max_dif; + Root_Ptr->Index_Tab[Index_Id].Nb_Equ = nb_equ + 1; + + return( NDS_OK); +} + + + + + +/*----------------------------------------------------------------------------*/ +/* Retourne la profondeur de la plus grande branche à partir d'un noeud */ +/*----------------------------------------------------------------------------*/ +/* (I) Node : pointeur sur le noeud */ +/*----------------------------------------------------------------------------*/ + +long ND_Tree_MaxDepth_Get( NDT_Node *Node_Ptr) +{ + long Max_Left, Max_Right; + + + if( !Node_Ptr) return( 0); + + Max_Left = ND_Tree_MaxDepth_Get( Node_Ptr->Left); + + Max_Right = ND_Tree_MaxDepth_Get( Node_Ptr->Right); + + return( NDD_MAX( Max_Left, Max_Right) + 1 ); +} + +/*----------------------------------------------------------------------------*/ +/* Retourne la profondeur de la plus petite branche à partir d'un noeud */ +/*----------------------------------------------------------------------------*/ +/* (I) Node : pointeur sur le noeud */ +/*----------------------------------------------------------------------------*/ + +long ND_Tree_MinDepth_Get( NDT_Node *Node_Ptr) +{ + long Min_Left, Min_Right; + + + if( !Node_Ptr) return( 0); + + Min_Left = ND_Tree_MinDepth_Get( Node_Ptr->Left); + + Min_Right = ND_Tree_MinDepth_Get( Node_Ptr->Right); + + return( NDD_MIN( Min_Left, Min_Right) + 1 ); +} + + + + + +/*----------------------------------------------------------------------------*/ +/* Ajoute un noeud à un arbre */ +/*----------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de l'arbre */ +/* (I) Node : pointeur sur le noeud à ajouter */ +/*----------------------------------------------------------------------------*/ + +/*------------------------------ Recursive Kernel ----------------------------*/ + +void ND_Tree_Node_Recursive_Add( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node *Parent_Node, NDT_Node **Node_Ptr_Ptr, long Depth, NDT_Node *New_Node_Ptr ) +{ + if( *Node_Ptr_Ptr) + { + /* Appel récursif */ + + if( ND_Manager_Exec_I( Root_Ptr, Index_Id, (*Node_Ptr_Ptr), NDD_CMD_VALUE_COMP, New_Node_Ptr->Value, (*Node_Ptr_Ptr)->Value, NULL) == NDS_LOWER) + ND_Tree_Node_Recursive_Add( Root_Ptr, Index_Id, (*Node_Ptr_Ptr), &((*Node_Ptr_Ptr)->Left), Depth + 1, New_Node_Ptr); + else + ND_Tree_Node_Recursive_Add( Root_Ptr, Index_Id, (*Node_Ptr_Ptr), &((*Node_Ptr_Ptr)->Right), Depth + 1, New_Node_Ptr); + } + else + { + long Max_Depth, Min_Depth; + + /* Rattachement du nouveau noeud à l'arbre */ + + New_Node_Ptr->Root = Root_Ptr; + New_Node_Ptr->Index = Index_Id; + New_Node_Ptr->Parent = Parent_Node; + + *Node_Ptr_Ptr = New_Node_Ptr; + + /* Mise à jour des informations statistiques de la structure */ + + Root_Ptr->Index_Tab[Index_Id].Node_Number++; + + Max_Depth = ND_Tree_MaxDepth_Get( New_Node_Ptr); + + Min_Depth = ND_Tree_MinDepth_Get( New_Node_Ptr); + + if( Max_Depth + Depth - 1 > Root_Ptr->Index_Tab[Index_Id].Max_Depth) Root_Ptr->Index_Tab[Index_Id].Max_Depth = Max_Depth + Depth - 1; + + if( Min_Depth + Depth - 1 < Root_Ptr->Index_Tab[Index_Id].Min_Depth) Root_Ptr->Index_Tab[Index_Id].Min_Depth = Min_Depth + Depth - 1 ; + } +} + + + +/*-------------------------------- main body ---------------------------------*/ + +NDT_Status ND_Tree_Node_Add( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node *Node_Ptr) +{ + ND_Tree_Node_Recursive_Add( Root_Ptr, Index_Id, NULL, &(Root_Ptr->Index_Tab[Index_Id].Head), 1, Node_Ptr); + + if( ND_INDEX_SUBTYPE_BALANCED_IS( Root_Ptr, Index_Id) && Root_Ptr->Index_Tab[Index_Id].Max_Depth - Root_Ptr->Index_Tab[Index_Id].Min_Depth > Root_Ptr->Index_Tab[Index_Id].Max_Dif) + return( ND_Tree_Equalize( Root_Ptr, Index_Id)); + + return( NDS_OK); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Ajoute tous les noeud d'une liste à un arbre */ +/*------------------------------------------------------------------------------*/ +/* (I) Tree_Root : pointeur sur la racine de l'arbre */ +/* (I) List_Root : pointeur sur la racine de la liste */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Tree_List_Add( NDT_Root *Tree_Root_Ptr, NDT_Index_Id Tree_Index_Id, NDT_Root *List_Root_Ptr, NDT_Index_Id List_Index_Id) +{ + NDT_Status rc; + NDT_Node *node_ptr; + + + node_ptr = List_Root_Ptr->Index_Tab[List_Index_Id].Head; + + while( node_ptr) + { + rc = ND_Tree_Node_Add( Tree_Root_Ptr, Tree_Index_Id, node_ptr); + if( ND_ERROR( rc)) return( rc); + node_ptr = node_ptr->Right; + } + + return( NDS_OK); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Affiche toutes les informations d'une structure de données */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la structure */ +/*------------------------------------------------------------------------------*/ + +/*------------------------------- Recursive Kernel -----------------------------*/ + +void ND_Tree_Recursive_Print( NDT_Node *Node_Ptr, long Depth, FILE *Out) +{ + const int BRANCH_LEN = 4; + + + if( !Node_Ptr) return; + + if( Node_Ptr->Right) + { + ND_Tree_Recursive_Print( Node_Ptr->Right, Depth + 1, Out); + fprintf( Out, "%*s/\n", (int)(Depth * BRANCH_LEN - 1), ""); + } + + fprintf( Out, "%*s (%p) ", (int)((Depth - 1) * BRANCH_LEN), "", Node_Ptr); + +/* Affichage des toutes les informations (noeud et valeur) : + +if( Node->Root) fprintf( Out, "Root=%p ", Node->Root); +if( Node->Parent) fprintf( Out, "Parent=%p ", Node->Parent); +if( Node->Left) fprintf( Out, "Left=%p ", Node->Left); +if( Node->Right) fprintf( Out, "Right=%p ", Node->Right); + +fprintf( Out, "Value=["); +ND_Manager_Exec( Node->Root->Manager, NDD_CMD_PRINT_VALUE, Node->Value, Out); +fprintf( Out, "]\n"); +*/ + +/* Affichage de la valeur seule : */ + + ND_Manager_Exec_I( Node_Ptr->Root, Node_Ptr->Index, Node_Ptr, NDD_CMD_VALUE_PRINT, Node_Ptr->Value, Out, NULL); + fprintf( Out, "\n"); + + if( Node_Ptr->Left) + { + fprintf( Out, "%*s\\\n", (int)( Depth * BRANCH_LEN - 1), ""); + ND_Tree_Recursive_Print( Node_Ptr->Left, Depth + 1, Out); + } +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Function de comparaison de noeuds (pour le quick sort) */ +/*------------------------------------------------------------------------------*/ + +int ND_Node_Compare( void **Node1_Ptr_Ptr, void **Node2_Ptr_Ptr) +{ + NDT_Status rc; + + + rc = ND_Manager_Exec_I( ( ( NDT_Node *)( *Node1_Ptr_Ptr))->Root, ( ( NDT_Node *)(*Node1_Ptr_Ptr))->Index, *Node1_Ptr_Ptr, NDD_CMD_VALUE_COMP, ( (NDT_Node *) (*Node1_Ptr_Ptr))->Value, ( ( NDT_Node *)( *Node2_Ptr_Ptr))->Value, NULL); + + switch( (int)rc) + { + case NDS_EQUAL: return( 0); + case NDS_LOWER: return( -1); + case NDS_GREATER: return( 1); + + default: + { + sprintf( NDG_Base.Err_String, "Error ND_Node_Compare : incorrect return code from the manager: %d", rc); + ND_Error_Print(); + + return( 0); + } + } +} + + + + + +/*----------------------------------------------------------------------------*/ +/* Ordonne une liste chaînée : */ +/*----------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la liste à trier */ +/*----------------------------------------------------------------------------*/ + +NDT_Status ND_List_Sort( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id) +{ + int i; + NDT_Node *node_ptr; + void **tab; + + + if( Root_Ptr->Index_Tab[Index_Id].Node_Number < 2) return NDS_OK; + + /* Allocation d'un tableau de pointeur de noeuds */ + + tab = (void **)malloc( Root_Ptr->Index_Tab[Index_Id].Node_Number * sizeof( NDT_Node *)); + + /* On remplit le tableau avec les noeuds de la structure à trier */ + + i = 0; + node_ptr = Root_Ptr->Index_Tab[Index_Id].Head; + + while( node_ptr) + { + tab[i] = node_ptr; + node_ptr = node_ptr->Right; + i++; + } + + /* Tri du tableau de pointeurs de noeuds */ + + qsort( (void *)tab, (size_t)( Root_Ptr->Index_Tab[Index_Id].Node_Number), sizeof( NDT_Node *), ( int (*)( const void *, const void *))&ND_Node_Compare); + + /* On met à jour les liens entre les noeuds */ + + for( i = 0; i < Root_Ptr->Index_Tab[Index_Id].Node_Number; i++) + { + node_ptr = (NDT_Node *)tab[i]; + + node_ptr->Left = (i ? (NDT_Node *)( tab[i - 1]) : NULL); + node_ptr->Right = (i != Root_Ptr->Index_Tab[Index_Id].Node_Number - 1 ? (NDT_Node *)( tab[i + 1]) : NULL); + } + + Root_Ptr->Index_Tab[Index_Id].Head = (NDT_Node *)( tab[0]); + Root_Ptr->Index_Tab[Index_Id].Tail = (NDT_Node *)( tab[Root_Ptr->Index_Tab[Index_Id].Node_Number - 1]); + + /* Désallocation du tableau */ + + free(tab); + + return( NDS_OK); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Récupère le premier noeud dans un sous-arbre */ +/*------------------------------------------------------------------------------*/ +/* (I) Node : pointeur sur le noeud racine du sous-arbre */ +/*------------------------------------------------------------------------------*/ + +NDT_Node *ND_Tree_Node_First_Recursive_Get( NDT_Node *Node_Ptr) +{ + if( !Node_Ptr) return NULL; + + if( !Node_Ptr->Left) return( Node_Ptr); + + return( ND_Tree_Node_First_Recursive_Get( Node_Ptr->Left)); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Récupère le dernier noeud dans un sous-arbre */ +/*------------------------------------------------------------------------------*/ +/* (I) Node : pointeur sur le noeud racine du sous-arbre */ +/*------------------------------------------------------------------------------*/ + +NDT_Node *ND_Tree_Node_Last_Recursive_Get( NDT_Node *Node_Ptr) +{ + if( !Node_Ptr) return NULL; + + if( !Node_Ptr->Right) return( Node_Ptr); + + return ND_Tree_Node_Last_Recursive_Get( Node_Ptr->Right); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Redéfinition de la fonction malloc() avec retour de type NDT_Status */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Default_Allocator( void **Ptr_Ptr, size_t Size, void *Data_Ptr) +{ + *Ptr_Ptr = malloc( Size); + + + if( !*Ptr_Ptr) return( NDS_ERRMEM); + + return( NDS_OK); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Redéfinition de la fonction free() avec retour de type NDT_Status */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Default_Desallocator( void *Ptr, void *Data_Ptr) +{ + if( !Ptr) return( NDS_ERRAPI); + + free( Ptr); + + return( NDS_OK); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Function de vérification d'une liste : */ +/*------------------------------------------------------------------------------*/ + +void ND_List_Check( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, int *Nb_Detected_Ptr, int *Nb_Corrected_Ptr, FILE *Out) +{ + /* On vérifie les liens entre les noeuds */ + + ND_List_Link_Check( Root_Ptr, Index_Id, Nb_Detected_Ptr, Nb_Corrected_Ptr, Out); + + /* On vérifie les valeurs des noeuds */ + + ND_Value_Check( Root_Ptr, Index_Id, Nb_Detected_Ptr, Nb_Corrected_Ptr, Out); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Function de vérification et correction des liens entre noeuds d'une liste */ +/*------------------------------------------------------------------------------*/ + +void ND_List_Link_Check( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, int *Nb_Detected_Ptr, int *Nb_Corrected_Ptr, FILE *Out) +{ + NDT_Node *node_ptr; + int left2right_node_number = 0; + int right2left_node_number = 0; + + + /* + On commence à vérifier si l'on trouve le même nombre de noeuds + en parcourant la liste de droite à gauche, puis de gauche à droite + */ + + node_ptr = Root_Ptr->Index_Tab[Index_Id].Head; + + while( node_ptr) + { + left2right_node_number++; + node_ptr = node_ptr->Right; + } + + node_ptr = Root_Ptr->Index_Tab[Index_Id].Tail; + + while( node_ptr) + { + right2left_node_number++; + node_ptr = node_ptr->Left; + } + + /* Cas où tout est OK */ + + if( left2right_node_number == Root_Ptr->Index_Tab[Index_Id].Node_Number && left2right_node_number == right2left_node_number) return; + + /* Cas où le nombre de noeuds n'a simplement pas été mis à jour au niveau de la racine */ + + if( left2right_node_number == right2left_node_number) + { + Root_Ptr->Index_Tab[Index_Id].Node_Number = left2right_node_number; + fprintf( Out, "\t- number of node has been corrected on structure %p:%d\n", Root_Ptr, Index_Id); + (*Nb_Detected_Ptr)++; + (*Nb_Corrected_Ptr)++; + return; + } + + /* Cas où le parcours de gauche à droite est plus complet : il manque un lien 'Left' */ + + if( left2right_node_number > right2left_node_number) + { + node_ptr = Root_Ptr->Index_Tab[Index_Id].Head; + + while( node_ptr) + { + if( node_ptr->Right && ( node_ptr->Right->Left != node_ptr)) + { + fprintf( Out, "\t- link 'Left' has been corrected on node %p of structure %p:%d\n", node_ptr->Right, Root_Ptr, Index_Id); + node_ptr->Right->Left = node_ptr; + (*Nb_Detected_Ptr)++; + (*Nb_Corrected_Ptr)++; + } + + if( !node_ptr->Right && ( node_ptr != Root_Ptr->Index_Tab[Index_Id].Tail)) + { + fprintf( Out, "\t- link 'Tail' has been corrected on structure %p:%d\n", Root_Ptr, Index_Id); + Root_Ptr->Index_Tab[Index_Id].Tail = node_ptr; + (*Nb_Detected_Ptr)++; + (*Nb_Corrected_Ptr)++; + } + + node_ptr = node_ptr->Right; + } + + if( Root_Ptr->Index_Tab[Index_Id].Node_Number != left2right_node_number) + { + fprintf( Out, "\t- number of node has been corrected on structure %p:%d\n", Root_Ptr, Index_Id); + Root_Ptr->Index_Tab[Index_Id].Node_Number = left2right_node_number; + (*Nb_Detected_Ptr)++; + (*Nb_Corrected_Ptr)++; + } + + return; + } + + /* Cas où le parcours de droite à gauche est plus complet : il manque un lien 'Right' */ + + if( right2left_node_number > left2right_node_number) + { + node_ptr = Root_Ptr->Index_Tab[Index_Id].Tail; + + while( node_ptr) + { + if( node_ptr->Left && ( node_ptr->Left->Right != node_ptr)) + { + fprintf( Out, "\t- link 'Right' has been corrected on node %p of list %p:%d\n", node_ptr->Left, Root_Ptr, Index_Id); + node_ptr->Left->Right = node_ptr; + (*Nb_Detected_Ptr)++; + (*Nb_Corrected_Ptr)++; + } + + if( !node_ptr->Left && ( node_ptr != Root_Ptr->Index_Tab[Index_Id].Head)) + { + fprintf( Out, "\t- link 'Head' has been corrected on the structure root %p:%d\n", Root_Ptr, Index_Id); + Root_Ptr->Index_Tab[Index_Id].Head = node_ptr; + (*Nb_Detected_Ptr)++; + (*Nb_Corrected_Ptr)++; + } + + node_ptr = node_ptr->Left; + } + + if( Root_Ptr->Index_Tab[Index_Id].Node_Number != right2left_node_number) + { + fprintf( Out, "\t- number of node has been corrected on structure %p:%d\n", Root_Ptr, Index_Id); + Root_Ptr->Index_Tab[Index_Id].Node_Number = right2left_node_number; + (*Nb_Detected_Ptr)++; + (*Nb_Corrected_Ptr)++; + } + } +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Function de vérification des valeurs des noeuds d'une liste */ +/*------------------------------------------------------------------------------*/ + +void ND_Value_Check( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, int *Nb_Detected, int *Nb_Corrected, FILE *Out) +{ + NDT_Node *node_ptr, *next_node_ptr; + + + /* Chaque noeud sans valeur est purement et simplement supprimé de la liste */ + + ND_Index_Node_First_Get_I( &node_ptr, Root_Ptr, Index_Id); + + while( node_ptr) + { + ND_Index_Node_Next_Get_I( &next_node_ptr, node_ptr); + + if( !node_ptr->Value) + { + fprintf( Out, "\t- node %p has been removed from structure %p:%d because no value is attached to it\n", node_ptr, Root_Ptr, Index_Id); + + ND_Index_Node_Remove_I( node_ptr); + + node_ptr = next_node_ptr; + + (*Nb_Detected)++; + (*Nb_Corrected)++; + } + else if( ND_Address_Check( node_ptr->Value) != NDS_OK) + { + fprintf (Out, "\t- node %p has been removed from structure %p:%d because its value cannot be accessed\n", node_ptr, Root_Ptr, Index_Id); + + ND_Index_Node_Remove_I( node_ptr); + + node_ptr = next_node_ptr; + + (*Nb_Detected)++; + (*Nb_Corrected)++; + } + else ND_Index_Node_Next_Get( &node_ptr, node_ptr); + } +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Function de vérification d'un arbre : */ +/*------------------------------------------------------------------------------*/ + +void ND_Tree_Check( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, int *Nb_Detected_Ptr, int *Nb_Corrected_Ptr, FILE *Out) +{ + /* On vérifie les liens entre les noeuds */ + + ND_Tree_Link_Check( Root_Ptr, Index_Id, Nb_Detected_Ptr, Nb_Corrected_Ptr, Out); + + /* On vérifie les valeurs attachées aux noeuds */ + + ND_Value_Check( Root_Ptr, Index_Id, Nb_Detected_Ptr, Nb_Corrected_Ptr, Out); + + /* On met à jour les informations statistiques de la racine */ + + Root_Ptr->Index_Tab[Index_Id].Max_Depth = ND_Tree_MaxDepth_Get( Root_Ptr->Index_Tab[Index_Id].Head); + Root_Ptr->Index_Tab[Index_Id].Min_Depth = ND_Tree_MaxDepth_Get( Root_Ptr->Index_Tab[Index_Id].Head); +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Function de vérification et correction des liens entre noeuds d'un arbre */ +/*------------------------------------------------------------------------------*/ + +void ND_Tree_Link_Check( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, int *Nb_Detected_Ptr, int *Nb_Corrected_Ptr, FILE *Out) +{ + /* On vérifie les liens 'Parent' et les liens 'Root' de chaque noeud */ + + if( Root_Ptr->Index_Tab[Index_Id].Head) + { + if( Root_Ptr->Index_Tab[Index_Id].Head->Root != Root_Ptr) + { + Root_Ptr->Index_Tab[Index_Id].Head->Root = Root_Ptr; + fprintf( Out, "\t- link 'Root' has been corrected on node %p of structure %p:%d\n", Root_Ptr->Index_Tab[Index_Id].Head, Root_Ptr, Index_Id); + (*Nb_Detected_Ptr)++; + (*Nb_Corrected_Ptr)++; + } + + ND_Tree_Link_Recursive_Check( Root_Ptr->Index_Tab[Index_Id].Head, Nb_Detected_Ptr, Nb_Corrected_Ptr, Out); + } + + /* + On vérifie si le lien 'Save' contient un noeud (cela signifie + que la procédure ND_Node_Remove n'a pas été jusqu'à son terme). + */ + + if( Root_Ptr->Index_Tab[Index_Id].Save) + { + NDT_Node *node_ptr; + + + /* On attache le noeud contenu dans 'Save' à l'arbre s'il n'existe pas déjà */ + + if( ND_Index_Node_Find_I( &node_ptr, Root_Ptr, Index_Id, Root_Ptr->Index_Tab[Index_Id].Save->Value, NULL) != NDS_OK) + { + ND_Index_Node_Add_I( Root_Ptr, Index_Id, Root_Ptr->Index_Tab[Index_Id].Save); + fprintf( Out, "\t- saved node %p has been restored to structure %p:%d\n", Root_Ptr->Index_Tab[Index_Id].Save, Root_Ptr, Index_Id); + (*Nb_Detected_Ptr)++; + (*Nb_Corrected_Ptr)++; + } + + Root_Ptr->Index_Tab[Index_Id].Save = NULL; + } +} + + + +/*------------------------------ Recursive Kernel ------------------------------*/ + +void ND_Tree_Link_Recursive_Check( NDT_Node *Node_Ptr, int *Nb_Detected_Ptr, int *Nb_Corrected_Ptr, FILE *Out) +{ + if( Node_Ptr->Left) + { + if( Node_Ptr->Left->Root != Node_Ptr->Root) + { + Node_Ptr->Left->Root = Node_Ptr->Root; + fprintf( Out, "\t- link 'Root' has been corrected on node %p of structure %p:%d\n", Node_Ptr->Left, Node_Ptr->Root, Node_Ptr->Index); + (*Nb_Detected_Ptr)++; + (*Nb_Corrected_Ptr)++; + } + + if( Node_Ptr->Left->Parent != Node_Ptr) + { + Node_Ptr->Left->Parent = Node_Ptr; + fprintf( Out, "\t- link 'Parent' has been corrected on node %p of structure %p:%d\n", Node_Ptr->Left, Node_Ptr->Root, Node_Ptr->Index); + (*Nb_Detected_Ptr)++; + (*Nb_Corrected_Ptr)++; + } + + /* Appel récursif */ + + ND_Tree_Link_Recursive_Check( Node_Ptr->Left, Nb_Detected_Ptr, Nb_Corrected_Ptr, Out); + } + + if( Node_Ptr->Right) + { + if( Node_Ptr->Right->Root != Node_Ptr->Root) + { + Node_Ptr->Right->Root = Node_Ptr->Root; + fprintf( Out, "\t- link 'Root' has been corrected on node %p of structure %p:%d\n", Node_Ptr->Right, Node_Ptr->Root, Node_Ptr->Index); + (*Nb_Detected_Ptr)++; + (*Nb_Corrected_Ptr)++; + } + + if( Node_Ptr->Right->Parent != Node_Ptr) + { + Node_Ptr->Right->Parent = Node_Ptr; + fprintf( Out, "\t- link 'Parent' has been corrected on node %p of structure %p:%d\n", Node_Ptr->Right, Node_Ptr->Root, Node_Ptr->Index); + (*Nb_Detected_Ptr)++; + (*Nb_Corrected_Ptr)++; + } + + /* Appel récursif */ + + ND_Tree_Link_Recursive_Check( Node_Ptr->Right, Nb_Detected_Ptr, Nb_Corrected_Ptr, Out); + } +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Target address access try */ +/*------------------------------------------------------------------------------*/ + +NDT_Status ND_Address_Check( void *Address) +{ +#if !defined(_WIN32) + NDT_Status status; + int rc; + int test; + struct sigaction act = {0}, oact_bus, oact_segv; + + act.sa_handler = ND_Signal_Trap; + + NDG_Base.Sig_Trapped = 0; + + + + /* Trap SIGBUS and SIGSEGV */ + + if( ( rc = sigaction( SIGBUS, &act, &oact_bus)) != 0) + { + sprintf( NDG_Base.Err_String, "Error ND_Address_Check: sigaction (Add SIGBUS Hdl) rc: %d errno: %d", rc, errno); + ND_Error_Print(); + + return( NDS_KO); + } + + if( ( rc = sigaction( SIGSEGV, &act, &oact_segv)) != 0) + { + sprintf( NDG_Base.Err_String, "Error ND_Address_Check: sigaction (Add SIGSEGV Hdl) rc: %d errno: %d", rc, errno); + ND_Error_Print(); + + return( NDS_KO); + } + + + + /* Target address access try */ + + if( sigsetjmp( NDG_Base.SigLongJmp_Env, 1) == 0 ) + { + test = *( (int *)Address); + + status = NDS_OK; + } + else + { + status = NDS_KO; + } + + + + /* Untrap SIGBUS and SIGSEGV */ + + if( ( rc = sigaction( SIGBUS, &oact_bus, &act)) != 0) + { + sprintf( NDG_Base.Err_String, "Error ND_Address_Check: sigaction (Remove SIGBUS Hdl) rc: %d errno: %d", rc, errno); + ND_Error_Print(); + + return( NDS_KO); + } + + if( ( rc = sigaction( SIGSEGV, &oact_segv, &act)) != 0) + { + sprintf( NDG_Base.Err_String, "Error ND_Address_Check: sigaction (Remove SIGSEGV Hdl) rc: %d errno: %d", rc, errno); + ND_Error_Print(); + + return( NDS_KO); + } + + return( status); +#else + NDT_Status status; + int test; + void (__cdecl *old_sigsegv_sighandler)(int); + + + NDG_Base.Sig_Trapped = 0; + + + + /* Trap SIGSEGV */ + + if( ( old_sigsegv_sighandler = signal( SIGSEGV, ND_Signal_Trap)) == SIG_ERR) + { + sprintf( NDG_Base.Err_String, "Error ND_Address_Check: signal (Add SIGSEGV Hdl) errno: %d", errno); + ND_Error_Print(); + + return( NDS_KO); + } + + + + /* Target address access try */ + + if( setjmp( NDG_Base.SigLongJmp_Env) == 0 ) + { + test = *( (int *)Address); + + status = NDS_OK; + } + else + { + status = NDS_KO; + } + + + + /* Untrap SIGSEGV */ + + if( ( old_sigsegv_sighandler = signal( SIGSEGV, old_sigsegv_sighandler)) == SIG_ERR) + { + sprintf( NDG_Base.Err_String, "Error ND_Address_Check: signal (Remove SIGSEGV Hdl) errno: %d", errno); + ND_Error_Print(); + + return( NDS_KO); + } + + return( status); +#endif +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Trap d'un signal */ +/*------------------------------------------------------------------------------*/ + +void ND_Signal_Trap( int Sig_Num) +{ + NDG_Base.Sig_Trapped = Sig_Num; + +#if !defined(_WIN32) + siglongjmp( NDG_Base.SigLongJmp_Env, 1); +#else + longjmp( NDG_Base.SigLongJmp_Env, 1); +#endif +} + + + + + +/*------------------------------------------------------------------------------*/ +/* Routine d'affichage d'un message d'erreur */ +/*------------------------------------------------------------------------------*/ + +void ND_Error_Print( void) +{ + if( NDG_Base.Err_Stream) fprintf( ( NDG_Base.Err_Stream == (FILE *)-1 ) ? stderr : NDG_Base.Err_Stream, "%s\n", NDG_Base.Err_String); +} diff --git a/src/libnode/src/libnode.h b/src/libnode/src/libnode.h new file mode 100644 index 0000000..6793135 --- /dev/null +++ b/src/libnode/src/libnode.h @@ -0,0 +1,356 @@ +/*----------------------------------------------------------------------------*/ +/* $Workfile: libnode.h $ */ +/*----------------------------------------------------------------------------*/ +/* $Author: agibert $ */ +/* $Date: 2008/11/12 02:25:23 $ */ +/* $Revision: 1.1 $ */ +/* $Label: $ */ +/*----------------------------------------------------------------------------*/ + +/*---------------------------------------------------------------------------------*/ +/* %RCSfile: libnode.h,v % */ +/*---------------------------------------------------------------------------------*/ +/* %Revision: 2.9 % */ +/* %Name: libnode-2_1_0-1 % */ +/* %Date: 2005/01/19 23:59:42 % */ +/* %Author: agibert % */ +/*---------------------------------------------------------------------------------*/ + +/*---------------------------------------------------------------------------------*/ +/* This file is part of LibNode */ +/* */ +/* LibNode is free software; you can redistribute it and/or modify */ +/* it under the terms of the GNU Lesser General Public Licence as published by */ +/* the Free Software Foundation; either version 2.1 of the License, or */ +/* (at your option) any later version. */ +/* */ +/* LibNode is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU Lesser General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU Lesser General Public License */ +/* along with LibNode; if not, write to the Free Software */ +/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/*---------------------------------------------------------------------------------*/ + + + + + +#include +#include +#include +#include +#include +#include +#include + + + +/* Utilisation des API de la LIBNODE sans vérification des arguments */ + +#define ND_MODE 1 + +#include + + + + + + + +#ifdef __linux +# define NDD_PRINTF_PTR_PREFIX "" +#else +# define NDD_PRINTF_PTR_PREFIX "0x" +#endif + + + + + +#define NDD_HUGE_LONG ( long) 0xFFFFFFL + + + +/* Table des symboles locale */ + +struct NDT_Symbol; + +typedef struct NDT_Symbol +{ + void *Ptr; + char *Name; + struct NDT_Symbol *Next; +} NDT_Symbol; + + + +/* LibNode Global Base Structure */ + +typedef struct NDT_Base +{ + int Open_Status; + int Debug_Mode; + char Err_String[512]; + FILE *Err_Stream; + int Sig_Trapped; +#if !defined(_WIN32) + sigjmp_buf SigLongJmp_Env; +#else + jmp_buf SigLongJmp_Env; +#endif + NDT_Symbol *Symbol_First_Ptr; + void *DL_Ptr; + NDT_Index_Type OpenStruct_Index_Type[1]; + NDT_Root *OpenStruct_Ptr; +} NDT_Base; + +NDT_Base NDG_Base = +{ + NDD_FALSE, + NDD_TRUE, + "", + (FILE *) -1, + 0, + {0}, + (NDT_Symbol *) NULL, + NULL, + { NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_LIST | NDD_INDEX_SUBTYPE_FIFO}, + (NDT_Root *) NULL +}; + + + + + +/*------------------------------------------------------------------------------*/ +/*------------------------------------------------------------------------------*/ +/* Fonctions et procédures privées de la librairie (moyen niveau) */ +/*------------------------------------------------------------------------------*/ +/*------------------------------------------------------------------------------*/ + +/*------------------------------------------------------------------------------*/ +/* Manager par défaut */ +/*------------------------------------------------------------------------------*/ +/* (I) va_list Arguments : Liste d'arguments contextuels */ +/*------------------------------------------------------------------------------*/ +NDT_Status ND_Default_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list); + +/*------------------------------------------------------------------------------*/ +/* OpenStruct Manager */ +/*------------------------------------------------------------------------------*/ +/* (I) va_list Arguments : Liste d'arguments contextuels */ +/*------------------------------------------------------------------------------*/ +NDT_Status ND_OpenStruct_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list); + +/*------------------------------------------------------------------------------*/ +/* Redéfinition de la fonction malloc() avec retour de type NDT_Status */ +/*------------------------------------------------------------------------------*/ +NDT_Status ND_Default_Allocator( void **, size_t, void *); + +/*------------------------------------------------------------------------------*/ +/* Redéfinition de la fonction free() avec retour de type NDT_Status */ +/*------------------------------------------------------------------------------*/ +NDT_Status ND_Default_Desallocator( void *, void *); + +/*------------------------------------------------------------------------------*/ +/* Création d'un noeud */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : adresse de la racine pour laquelle on crée un noeud */ +/* (O) New_Node : adresse du pointeur sur le nouveau noeud */ +/*------------------------------------------------------------------------------*/ +NDT_Status ND_Node_Alloc( NDT_Root * Root, NDT_Node ** New_Node); + +/*------------------------------------------------------------------------------*/ +/* Destruction d'un noeud */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : adresse de la racine dans laquelle on détruit un noeud */ +/* (I) Node : pointeur sur le noeud à détruire */ +/*------------------------------------------------------------------------------*/ +NDT_Status ND_Node_Free( NDT_Root *, NDT_Node *); + +/*------------------------------------------------------------------------------*/ +/* Création d'une nouvelle structure de données */ +/*------------------------------------------------------------------------------*/ +/* (O) Root: adresse d'un pointeur sur la racine de la nouvelle structure */ +/* (I) Type: type de la structure.de données (liste ou arbre binaire) */ +/* (I) Allocator: pointeur vers la fonction d'allocation */ +/* (I) Desallocator: pointeur vers la fonction de désallocation */ +/* (I) Data : pointeur de données utiles à l'allocateur */ +/* (I) Own_Value : indique si la structure est propriétaire de ses valeurs */ +/*------------------------------------------------------------------------------*/ +NDT_Status ND_Index_Clear( NDT_Root *, NDT_Index_Id); + +/*------------------------------------------------------------------------------*/ +/* Création de la racine d'une structure de données quelconque */ +/*------------------------------------------------------------------------------*/ +/* (O) New_Root : adresse du pointeur sur la nouvelle racine */ +/* (I) Type : type de la structure de données */ +/* (I) Allocater : pointeur vers la fonction d'allocation */ +/* (I) Desallocater : pointeur vers la fonction de désallocation */ +/* (I) Data : pointeur de données utiles à l'allocateur */ +/*------------------------------------------------------------------------------*/ +NDT_Status ND_Node_Root_Alloc( NDT_Root **, NDT_Index_Nb, NDT_Index_Type[], char *, NDT_Manager *, char *, NDT_Allocator *, char *, NDT_Desallocator *, short, void *); + +/*------------------------------------------------------------------------------*/ +/* Destruction d'une racine */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine à détruire */ +/*------------------------------------------------------------------------------*/ +NDT_Status ND_Node_Root_Free( NDT_Root *); + +/*------------------------------------------------------------------------------*/ +/* Ajout d'un noeud à une liste chaînée */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la liste */ +/* (I) New_Node : pointeur sur le noeud à ajouter */ +/*------------------------------------------------------------------------------*/ +NDT_Status ND_List_Node_Add( NDT_Root *, NDT_Index_Id, NDT_Node *); + +/*------------------------------------------------------------------------------*/ +/* Ajout d'une nouvelle valeur à une liste */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la liste */ +/* (I) Value : pointeur sur la valeur à ajouter */ +/*------------------------------------------------------------------------------*/ +NDT_Status ND_List_Value_Add( NDT_Root *, NDT_Index_Id, void *); + +/*------------------------------------------------------------------------------*/ +/* Ajout d'un noeud à un arbre binaire */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de l'arbre */ +/* (I) Value : pointeur sur la valeur à ajouter */ +/*------------------------------------------------------------------------------*/ +NDT_Status ND_Tree_Value_Add( NDT_Root *, NDT_Index_Id, void *); + +/*------------------------------------------------------------------------------*/ +/* Supprime le noeud d'une liste */ +/*------------------------------------------------------------------------------*/ +/* (I) Node : pointeur sur le noeud à supprimer */ +/*------------------------------------------------------------------------------*/ +NDT_Status ND_List_Node_Remove( NDT_Node *); + +/*------------------------------------------------------------------------------*/ +/* Conversion d'une structure en liste chaînée */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine du la structure à convertir */ +/*------------------------------------------------------------------------------*/ +NDT_Status ND_List_Make( NDT_Root *, NDT_Index_Id); + +/*------------------------------------------------------------------------------*/ +/* Recherche une valeur dans une liste et retourne le noeud correspondant */ +/*------------------------------------------------------------------------------*/ +NDT_Node *ND_List_Node_Find( NDT_Root *, NDT_Index_Id, void *, va_list); + +/*------------------------------------------------------------------------------*/ +/* Recherche un noeud dans un arbre et retourne le pointeur sur le noeud */ +/*------------------------------------------------------------------------------*/ +NDT_Node *ND_Tree_Node_Find( NDT_Root *, NDT_Index_Id, void *, va_list); + +/*------------------------------------------------------------------------------*/ +/* Conversion d'une structure en arbre binaire */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine du la structure à convertir */ +/* (I) Type : type du futur arbre */ +/*------------------------------------------------------------------------------*/ +NDT_Status ND_Tree_Make( NDT_Root *, NDT_Index_Id); + +/*------------------------------------------------------------------------------*/ +/* Equilibrage d'un arbre */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de l'arbre */ +/*------------------------------------------------------------------------------*/ +NDT_Status ND_Tree_Equalize( NDT_Root *, NDT_Index_Id); + +/*------------------------------------------------------------------------------*/ +/* Retourne la profondeur de la plus grande branche à partir d'un noeud */ +/*------------------------------------------------------------------------------*/ +/* (I) Node : pointeur sur le noeud */ +/*------------------------------------------------------------------------------*/ +long ND_Tree_MaxDepth_Get( NDT_Node *); + +/*------------------------------------------------------------------------------*/ +/* Retourne la profondeur de la plus petite branche à partir d'un noeud */ +/*------------------------------------------------------------------------------*/ +/* (I) Node : pointeur sur le noeud */ +/*------------------------------------------------------------------------------*/ +long ND_Tree_MinDepth_Get( NDT_Node *); + +/*------------------------------------------------------------------------------*/ +/* Ajout d'un noeud à un arbre binaire */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de l'arbre */ +/* (I) Node : pointeur sur le noeud à ajouter */ +/*------------------------------------------------------------------------------*/ +NDT_Status ND_Tree_Node_Add( NDT_Root *, NDT_Index_Id, NDT_Node *); + +/*------------------------------------------------------------------------------*/ +/* Ajoute tous les noeud d'une liste à un arbre */ +/*------------------------------------------------------------------------------*/ +/* (I) Tree_Root : pointeur sur la racine de l'arbre */ +/* (I) List_Root : pointeur sur la racine de la liste */ +/*------------------------------------------------------------------------------*/ +NDT_Status ND_Tree_List_Add( NDT_Root *, NDT_Index_Id, NDT_Root *, NDT_Index_Id); + +/*------------------------------------------------------------------------------*/ +/* Fonction de comparaison de noeuds (pour le quick sort) */ +/*------------------------------------------------------------------------------*/ +int ND_Node_Compare( void **, void **); + +/*------------------------------------------------------------------------------*/ +/* Ordonne une liste chaînée selon l'algorithme du tri à bulle */ +/*------------------------------------------------------------------------------*/ +/* (I) Root : pointeur sur la racine de la liste à trier */ +/*------------------------------------------------------------------------------*/ +NDT_Status ND_List_Sort( NDT_Root *, NDT_Index_Id); + + + + + + +/*------------------------------------------------------------------------------*/ +/*------------------------------------------------------------------------------*/ +/* PRIVATE FUNCTIONS */ +/*------------------------------------------------------------------------------*/ +/*------------------------------------------------------------------------------*/ + +void ND_List_Check( NDT_Root *, NDT_Index_Id, int *, int *, FILE *); + +void ND_List_Link_Check( NDT_Root *, NDT_Index_Id, int *, int *, FILE *); + +void ND_Value_Check( NDT_Root *, NDT_Index_Id, int *, int *, FILE *); + +void ND_Tree_Check( NDT_Root *, NDT_Index_Id, int *, int *, FILE *); + +void ND_Tree_Link_Check( NDT_Root *, NDT_Index_Id, int *, int *, FILE *); + +NDT_Status ND_List_Recursive_Make( NDT_Node *, NDT_Root *, NDT_Index_Id); + +NDT_Node *ND_Tree_Recursive_Make( long, long, NDT_Node *); + +void ND_Tree_Node_Recursive_Add( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Node **, long , NDT_Node *); + +NDT_Node *ND_Tree_Node_First_Recursive_Get( NDT_Node *); + +NDT_Node *ND_Tree_Node_Last_Recursive_Get( NDT_Node *); + +NDT_Node *ND_Tree_Node_Recursive_Find( NDT_Node *, void *, va_list); + +NDT_Node *ND_Tree_Parent_Next_Recursive_Get( NDT_Node *); + +NDT_Node *ND_Tree_Parent_Previous_Recursive_Get( NDT_Node *); + +void ND_Tree_Recursive_Print( NDT_Node *, long, FILE *); + +void ND_Tree_Link_Recursive_Check( NDT_Node *, int *, int *, FILE *); + +NDT_Status ND_Symbol_Find( void **, const char *); + +void ND_Error_Print( void); + +void ND_Signal_Trap( int); + +NDT_Status ND_Address_Check( void *); diff --git a/src/libnode/util/ndbench.c b/src/libnode/util/ndbench.c new file mode 100644 index 0000000..6e232a0 --- /dev/null +++ b/src/libnode/util/ndbench.c @@ -0,0 +1,1602 @@ +/*---------------------------------------------------------------------------------*/ +/* %RCSfile: ndbench.c,v % */ +/*---------------------------------------------------------------------------------*/ +/* %Revision: 2.9 % */ +/* %Name: libnode-2_1_0-1 % */ +/* %Date: 2005/01/20 00:07:27 % */ +/* %Author: agibert % */ +/*---------------------------------------------------------------------------------*/ + +/*---------------------------------------------------------------------------------*/ +/* This file is part of LibNode */ +/* */ +/* LibNode is free software; you can redistribute it and/or modify */ +/* it under the terms of the GNU General Public Licence as published by */ +/* the Free Software Foundation; either version 2 of the License, or */ +/* (at your option) any later version. */ +/* */ +/* LibNode is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU Lesser General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with LibNode; if not, write to the Free Software */ +/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/*---------------------------------------------------------------------------------*/ + + + + + +/*---------------------------------------------------------------------------------*/ +/* Includes */ +/*---------------------------------------------------------------------------------*/ +#include +#include +#include +#include +#include + + + +#ifdef _WIN32 +# include +#else +# include +#endif + +#ifdef _LIBVER_SUPPORT +# include +#endif + + + + + +/*---------------------------------------------------------------------------------*/ +/* Defines */ +/*---------------------------------------------------------------------------------*/ + +#ifdef _LIBVER_SUPPORT +VER_INFO_EXPORT( ndbench, "%Revision: 2.9 %", "%Name: libnode-2_1_0-1 %", __FILE__, "%Author: agibert %"); +# define USAGE "Usage : %s [ --help | --version [-v] | --batch_run ]\n" +#else +# define USAGE "Usage : %s [ --help | --batch_run ]\n" +#endif + +#include + + + +#define QUIT 0 +#define LIB_OPEN 1 +#define LIB_CLOSE 2 +#define DS_OPEN 3 +#define DS_CLOSE 4 +#define DS_FLUSH 5 +#define DS_CHECK 6 +#define DS_REORG 7 +#define DS_INFO_PRINT 8 +#define DS_VALUE_ADD 9 +#define DS_VALUE_REMOVE 10 +#define DS_VALUE_PRINT 11 +#define DS_VALUE_FIND 12 +#define INDEX_LIST_OPEN 13 +#define INDEX_TREE_OPEN 14 +#define INDEX_CLOSE 15 +#define INDEX_FLUSH 16 +#define INDEX_CHECK 17 +#define INDEX_LIST_SUBTYPE_SET 18 +#define INDEX_LIST_TO_TREE 19 +#define INDEX_TREE_SUBTYPE_SET 20 +#define INDEX_TREE_TO_LIST 21 +#define INDEX_REORG 22 +#define INDEX_INFO_PRINT 23 +#define INDEX_VALUE_PRINT 24 +#define INDEX_VALUE_BREAK 25 +#define INDEX_NODE_BREAK 26 +#define BATCH_RUN 27 + +#define COMMAND_NB 28 + +#define INDEX_NB 32 + + + +#define DS_STATE_UNKNOWN 0 +#define DS_STATE_OPENED 1 +#define DS_STATE_CLOSED 2 + + + +#define ARG_SIZE ( 32 + 1) + + + +#define BUF_LEN 99 +#define BUF_SIZE (BUF_LEN + 1) + + + + + +/*---------------------------------------------------------------------------------*/ +/* Types */ +/*---------------------------------------------------------------------------------*/ + +typedef struct Command +{ + + short id; + char Name[25]; + char FullName[64]; + short DS_State; + NDT_Index_Type Index_Type; + +} Command; + +typedef char Arg[32 + 1]; + + + +/* Mesure des temps d'exécution */ + +#ifdef _WIN32 + +typedef struct +{ + double sec; + struct _timeb start; + struct _timeb stop; +} cpt; + +# define t_start(x) { _ftime( &(x.start));} +# define t_stop(x) { _ftime( &(x.stop)); x.sec = (double)(x.stop.time) - (double)(x.start.time) + ((double)(x.stop.millitm) - (double)(x.start.millitm)) / 1000;} +# define seed_get(x) (int)( (x).start.time) + +#else + +typedef struct +{ + double sec; + struct timeval start; + struct timeval stop; +} cpt; + +# define t_start(x) { gettimeofday( &((x).start), NULL);} +# define t_stop(x) { gettimeofday( &((x).stop), NULL); (x).sec = (double)((x).stop.tv_sec) - (double)((x).start.tv_sec) + ((double)((x).stop.tv_usec) - (double)((x).start.tv_usec)) / 1000000;} +# define seed_get(x) (int)( (x).start.tv_sec) + +#endif + +cpt t_exec; + + + +/* Définition des valeurs attachées aux noeuds de la structure */ + +typedef struct +{ + int Id; + char *Nom; +} T_Module; + + + +NDT_Index_Type idx_type_tab[INDEX_NB]; + +NDT_Index_Type idx_type_fifo = NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_LIST | NDD_INDEX_SUBTYPE_FIFO; + +NDT_Index_Type idx_type_sorted_list = NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_LIST | NDD_INDEX_SUBTYPE_SORTED; + +NDT_Index_Type idx_type_balanced_tree = NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_TREE | NDD_INDEX_SUBTYPE_BALANCED; + + + + + +/*---------------------------------------------------------------------------------*/ +/* Prototype */ +/*---------------------------------------------------------------------------------*/ + +NDT_Status Module_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list); + +void Menu_Print( FILE *, NDT_Root *); +void Command_Get( int *, char **, char **, FILE *, FILE *, short); +void Command_Exec_Begin_Print( FILE *, int); +void Command_Exec_End_Print( FILE *, int, cpt, int); +void Command_Index_Range_Get( FILE *, int *, int *, char *, FILE *, int, char *); +void Command_Exec( NDT_Root **, FILE *, int, char *, char *, FILE *); +void Batch_Run( NDT_Root **, FILE *, FILE *, short); + + + + + +/*---------------------------------------------------------------------------------*/ +/* Global Variable */ +/*---------------------------------------------------------------------------------*/ + +Command Command_Tab[] = +{ + { QUIT, "Quit", "Quit", ( DS_STATE_OPENED | DS_STATE_CLOSED), ( NDD_INDEX_TYPE_LIST | NDD_INDEX_TYPE_TREE)}, + { LIB_OPEN, "Lib_Open", "Open Library", ( DS_STATE_OPENED | DS_STATE_CLOSED), ( NDD_INDEX_TYPE_LIST | NDD_INDEX_TYPE_TREE)}, + { LIB_CLOSE, "Lib_Close", "Close Library", ( DS_STATE_OPENED | DS_STATE_CLOSED), ( NDD_INDEX_TYPE_LIST | NDD_INDEX_TYPE_TREE)}, + { DS_OPEN, "DS_Open", "Open DataStructure", ( DS_STATE_CLOSED), ( NDD_INDEX_TYPE_LIST | NDD_INDEX_TYPE_TREE)}, + { DS_CLOSE, "DS_Close", "Close DataStructure", ( DS_STATE_OPENED), ( NDD_INDEX_TYPE_LIST | NDD_INDEX_TYPE_TREE)}, + { DS_FLUSH, "DS_Flush", "Flush DataStructure", ( DS_STATE_OPENED), ( NDD_INDEX_TYPE_LIST | NDD_INDEX_TYPE_TREE)}, + { DS_CHECK, "DS_Check", "Check DataStructure", ( DS_STATE_OPENED), ( NDD_INDEX_TYPE_LIST | NDD_INDEX_TYPE_TREE)}, + { DS_REORG, "DS_Reorg", "Reorg DataStructure", ( DS_STATE_OPENED), ( NDD_INDEX_TYPE_LIST | NDD_INDEX_TYPE_TREE)}, + { DS_INFO_PRINT, "DS_Info_Print", "Print DataStructure Informations", ( DS_STATE_OPENED), ( NDD_INDEX_TYPE_LIST | NDD_INDEX_TYPE_TREE)}, + { DS_VALUE_ADD, "DS_Value_Add", "Add Values to DataStructure", ( DS_STATE_OPENED), ( NDD_INDEX_TYPE_LIST | NDD_INDEX_TYPE_TREE)}, + { DS_VALUE_REMOVE, "DS_Value_Remove", "Remove Values from DataStructure", ( DS_STATE_OPENED), ( NDD_INDEX_TYPE_LIST | NDD_INDEX_TYPE_TREE)}, + { DS_VALUE_PRINT, "DS_Value_Print", "Print DataStructure Values", ( DS_STATE_OPENED), ( NDD_INDEX_TYPE_LIST | NDD_INDEX_TYPE_TREE)}, + { DS_VALUE_FIND, "DS_Value_Find", "Find Values in DataStructure", ( DS_STATE_OPENED), ( NDD_INDEX_TYPE_LIST | NDD_INDEX_TYPE_TREE)}, + { INDEX_LIST_OPEN, "Index_List_Open", "Open List Index", ( DS_STATE_CLOSED), ( NDD_INDEX_TYPE_LIST | NDD_INDEX_TYPE_TREE)}, + { INDEX_TREE_OPEN, "Index_Tree_Open", "Open Tree Index", ( DS_STATE_CLOSED), ( NDD_INDEX_TYPE_LIST | NDD_INDEX_TYPE_TREE)}, + { INDEX_CLOSE, "Index_Close", "Close Index", ( DS_STATE_OPENED), ( NDD_INDEX_TYPE_LIST | NDD_INDEX_TYPE_TREE)}, + { INDEX_FLUSH, "Index_Flush", "Flush Index", ( DS_STATE_OPENED), ( NDD_INDEX_TYPE_LIST | NDD_INDEX_TYPE_TREE)}, + { INDEX_CHECK, "Index_Check", "Check Index", ( DS_STATE_OPENED), ( NDD_INDEX_TYPE_LIST | NDD_INDEX_TYPE_TREE)}, + { INDEX_LIST_SUBTYPE_SET, "Index_List_SubType_Set", "Set List SubType", ( DS_STATE_OPENED), ( NDD_INDEX_TYPE_LIST)}, + { INDEX_LIST_TO_TREE, "Index_List_To_Tree", "Convert List to Tree", ( DS_STATE_OPENED), ( NDD_INDEX_TYPE_LIST)}, + { INDEX_TREE_SUBTYPE_SET, "Index_Tree_SubType_Set", "Set Tree SubType", ( DS_STATE_OPENED), ( NDD_INDEX_TYPE_TREE)}, + { INDEX_TREE_TO_LIST, "Index_Tree_To_List", "Convert Tree to List", ( DS_STATE_OPENED), ( NDD_INDEX_TYPE_TREE)}, + { INDEX_REORG, "Index_Reorg", "Reorg Index", ( DS_STATE_OPENED), ( NDD_INDEX_TYPE_LIST | NDD_INDEX_TYPE_TREE)}, + { INDEX_INFO_PRINT, "Index_Info_Print", "Print Index Informations", ( DS_STATE_OPENED), ( NDD_INDEX_TYPE_LIST | NDD_INDEX_TYPE_TREE)}, + { INDEX_VALUE_PRINT, "Index_Value_Print", "Print Index Values", ( DS_STATE_OPENED), ( NDD_INDEX_TYPE_LIST | NDD_INDEX_TYPE_TREE)}, + { INDEX_VALUE_BREAK, "Index_Value_Break", "Break Index Value", ( DS_STATE_OPENED), ( NDD_INDEX_TYPE_LIST | NDD_INDEX_TYPE_TREE)}, + { INDEX_NODE_BREAK, "Index_Node_Break", "Break Index Node", ( DS_STATE_OPENED), ( NDD_INDEX_TYPE_LIST | NDD_INDEX_TYPE_TREE)}, + { BATCH_RUN, "Batch_Run", "Run NDBench Bach", ( DS_STATE_OPENED | DS_STATE_CLOSED), ( NDD_INDEX_TYPE_LIST | NDD_INDEX_TYPE_TREE)} +}; + + + + + +/*---------------------------------------------------------------------------------*/ +/* */ +/*---------------------------------------------------------------------------------*/ + +NDT_Status Module_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node *Node_Ptr, NDT_Command Command, va_list Args) +{ + NDT_Command_Name Command_Name; + + + switch( Command) + { + case NDD_CMD_MANAGER_VERSION: + { + NDT_Version_Name *Version_Name_Ptr = (NDT_Version_Name *)va_arg( Args, NDT_Version_Name *); + + Command_Name = "NDD_CMD_MANAGER_VERSION"; + + *Version_Name_Ptr = "%Revision: 2.9 % %Name: libnode-2_1_0-1 % %Date: 2005/01/20 00:07:27 % %Author: agibert %"; + + return( NDS_OK); + } + + case NDD_CMD_INDEX_GET: + { + /* + NDT_Index_Id *Reply_Index_Id_Ptr = (NDT_Index_Id *)va_arg( Args, NDT_Index_Id *); + NDT_Command *Reply_Command_Ptr = (NDT_Command *)va_arg( Args, NDT_Command *); + NDT_Command Cmd = (NDT_Command)va_arg( Args, NDT_Command); + void *Value_ptr = (void *)va_arg( Args, void *); + */ + NDT_Index_Id *Reply_Index_Id_Ptr = (NDT_Index_Id *)va_arg( Args, NDT_Index_Id *); + NDT_Command *Reply_Command_Ptr = (NDT_Command *)va_arg( Args, NDT_Command *); + NDT_Command Cmd = (NDT_Command)va_arg( Args, NDT_Command); + T_Module **Module_Ptr_Ptr = (T_Module **)va_arg( Args, T_Module **); + + + Command_Name = "NDD_CMD_INDEX_GET"; + + switch(Cmd) + { + /* + case NDT_CMD_SOME_USER_CMD: + { + *Reply_Index_Id_Ptr = 0; + *Reply_Command_Ptr = NDD_CMD_SOME_OTHER_CMD; + break; + } + ... + */ + + default: + { + *Reply_Index_Id_Ptr = Index_Id; + *Reply_Command_Ptr = Cmd; + break; + } + } + + return( NDS_OK); + } + + case NDD_CMD_VALUE_ALLOC: + { + /* + void **Value_Ptr_Ptr = (void **)va_arg( Args, void **); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + T_Module **Module_Ptr_Ptr = (T_Module **)va_arg( Args, T_Module **); + va_list user_args = (va_list)va_arg( Args, va_list); + char *Nom = (char *)va_arg( user_args, char *); + int Id = (int)va_arg( user_args, int); + + + Command_Name = "NDD_CMD_VALUE_ALLOC"; + + if( ( *Module_Ptr_Ptr = (T_Module *)malloc( sizeof(T_Module))) != NULL) + { + (*Module_Ptr_Ptr)->Nom = strdup(Nom); + (*Module_Ptr_Ptr)->Id = Id; + + return( NDS_OK); + } + else + { + return( NDS_KO); + } + + } + + case NDD_CMD_VALUE_FREE: + { + /* + void *Value_Ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + T_Module *Module_Ptr = (T_Module *)va_arg( Args, T_Module *); + + + Command_Name = "NDD_CMD_VALUE_FREE"; + + + free( Module_Ptr->Nom); + free( Module_Ptr); + + return( NDS_OK); + } + + case NDD_CMD_VALUE_COMP: + { + /* + void *Value1_Ptr = (void *)va_arg( Args, void *); + void *Value2_Ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + T_Module *Value1 = (T_Module *)va_arg( Args, T_Module *); + T_Module *Value2 = (T_Module *)va_arg( Args, T_Module *); + + + Command_Name = "NDD_CMD_VALUE_COMP"; + + if( ( Index_Id >= 0) && ( Index_Id < INDEX_NB)) + { + int rc; + + + rc = Value1->Id - Value2->Id; + + if( rc < 0) + { + return(NDS_LOWER); + } + else + { + if( rc > 0) + { + return(NDS_GREATER); + } + else + { + return(NDS_EQUAL); + } + } + } + else + { + printf( "Unknown COMP idx (%d) !\n", Index_Id); + return( NDS_KO); + } + + return( NDS_OK); + } + + case NDD_CMD_VALUE_ADD: + { + /* + void *Value_Ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + + + Command_Name = "NDD_CMD_VALUE_ADD"; + + return( NDS_OK); + } + + case NDD_CMD_VALUE_REMOVE: + { + /* + void *Value_Ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + + + Command_Name = "NDD_CMD_VALUE_REMOVE"; + return( NDS_OK); + } + + case NDD_CMD_VALUE_PRINT: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + va_list user_args = (va_list)va_arg( lib_args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + + void *Value_Ptr = Node_Ptr->Value; + */ + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + + T_Module *Module_Ptr = Node_Ptr->Value; + + + Command_Name = "NDD_CMD_VALUE_PRINT"; + + fprintf( Out, "Id=%d\tNom=\"%s\"\n", Module_Ptr->Id, Module_Ptr->Nom); + + return( NDS_OK); + } + + case NDD_CMD_INFO_PRINT: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + va_list user_args = (va_list)va_arg( lib_args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + + void *Value_Ptr = Node_Ptr->Value; + */ + + + Command_Name = "NDD_CMD_INFO_PRINT"; + + return( NDS_OK); + + } + + default: + { + printf( "Module_Manager() called with an undefined command %d\n", Command); + return( NDS_ERRAPI); + + } + } + + printf( "Module_Manager() called with command %d (%s)\n", Command, Command_Name); + return( NDS_OK); +} + + + + + +/*---------------------------------------------------------------------------------*/ +/* */ +/*---------------------------------------------------------------------------------*/ + +void Menu_Print( FILE *File_Output, NDT_Root *DS_Ptr) +{ + short i; + char headc; + + + fprintf( File_Output, "\n-----------------------------------------------------------------------\nMenu :\n"); + + for( i = 0; i < COMMAND_NB; i++) + { + if( ( DS_Ptr && ( Command_Tab[i].DS_State & DS_STATE_OPENED) && ( DS_Ptr->Index_Tab[0].Type & Command_Tab[i].Index_Type)) + || ( !DS_Ptr && ( Command_Tab[i].DS_State & DS_STATE_CLOSED))) + { + headc = '-'; + } + else + { + headc = '*'; + } + + fprintf( File_Output, "\t%c (%2d) [%s]%*s%s\n", headc, i, Command_Tab[i].Name, ( 25 - strlen(Command_Tab[i].Name)), " ", Command_Tab[i].FullName); + } +} + + + + + +/*---------------------------------------------------------------------------------*/ +/* */ +/*---------------------------------------------------------------------------------*/ + +void Command_Get( int *choice, char **arg1, char **arg2, FILE *File_Output, FILE *File_Input, short Interactive_Flag) +{ + char buf[100]; + char *tmp_arg1, *tmp_arg2; + + + do + { + if( Interactive_Flag) + { + fprintf( File_Output, "\nChoice ? "); + } + + if( fgets( buf, BUF_LEN, File_Input) != NULL) + { + while( ( buf[ strlen( buf) - 1] == '\r') || ( buf[ strlen( buf) - 1] == '\n') || ( buf[ strlen( buf) - 1] == '\t') || ( buf[ strlen( buf) - 1] == ' ')) + { + buf[ strlen( buf) - 1] = '\0'; + } + + if( isdigit( *buf)) + { + *choice = atoi( buf); + } + else + { + for( *choice = 0; ( *choice < COMMAND_NB) && ( strncmp( buf, Command_Tab[*choice].Name, strlen(Command_Tab[*choice].Name))) ; (*choice)++); + } + + if( ( *choice < 0) || ( *choice >= COMMAND_NB)) + { + if( strlen( buf) != 0) fprintf( File_Output, "\nUndefined choice (%s) !\n",buf); + + *choice = -1; + *arg1 = NULL; + *arg2 = NULL; + } + else + { + if( ( tmp_arg1 = strstr( buf, " ")) != NULL) + { + tmp_arg1++; + + if( ( tmp_arg2 = strstr( tmp_arg1, " ")) != NULL) + { + *tmp_arg2 = '\0'; + tmp_arg2++; + + *arg2 = malloc( ARG_SIZE); + if( *arg2 != NULL) strcpy( *arg2, tmp_arg2); + } + else + { + *arg2 = NULL; + } + + *arg1 = malloc( ARG_SIZE); + if( *arg1 != NULL) strcpy( *arg1, tmp_arg1); + } + else + { + *arg1 = NULL; + *arg2 = NULL; + } + } + } + else + { + *choice = 0; + *arg1 = NULL; + *arg2 = NULL; + } + } + while( *choice == -1); +} + + + + + +/*---------------------------------------------------------------------------------*/ +/* */ +/*---------------------------------------------------------------------------------*/ + +void Command_Exec_Begin_Print( FILE *File_Output, int Choice) +{ + fprintf( File_Output, "%s: %s...\n", Command_Tab[Choice].Name, Command_Tab[Choice].FullName); + fflush( File_Output); +} + + + + + +/*---------------------------------------------------------------------------------*/ +/* */ +/*---------------------------------------------------------------------------------*/ + +void Command_Exec_End_Print( FILE *File_Output, int Choice, cpt T_Exec, int nb) +{ + if( nb == 1) + { + fprintf( File_Output, "%s: Completed in (%.4f) second !\n", Command_Tab[Choice].Name, T_Exec.sec); + } + else + { + fprintf( File_Output, "%s: Completed in (%.4f) second, (%.2f) per second !\n", Command_Tab[Choice].Name, T_Exec.sec, nb / T_Exec.sec); + } +} + + + + + +/*---------------------------------------------------------------------------------*/ +/* */ +/*---------------------------------------------------------------------------------*/ + +void Command_Index_Range_Get( FILE *File_Output, int *Low, int *High, char *Arg, FILE *File_Input, int Choice, char *Obj_Name) +{ + char buf[100]; + char *tmp; + + + if( Arg == NULL) + { + fprintf( File_Output, "%s: %s range (?-?) : ", Command_Tab[Choice].Name, Obj_Name); + fgets( buf, BUF_LEN, File_Input); + + Arg = buf; + } + + tmp = strstr( Arg, "-"); + + if( tmp != NULL) + { + *tmp = '\0'; + *Low = atoi( Arg); + tmp++; + *High = atoi( tmp); + + if( ( *High < *Low) || ( !strcmp( Obj_Name, "Index") && ( *High >= INDEX_NB))) + { + fprintf( File_Output, "%s: Invalit range (%d-%d) !\n", Command_Tab[Choice].Name, *Low, *High); + *Low = *High = -1; + } + } + else + { + fprintf( File_Output, "%s: Invalit range !\n", Command_Tab[Choice].Name); + *Low = *High = -1; + } +} + + + + + +/*---------------------------------------------------------------------------------*/ +/* */ +/*---------------------------------------------------------------------------------*/ + +void Command_Exec( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, int Choice, char *Arg1, char *Arg2, FILE *File_Input) +{ + int low, high, i, j, nb_removed, Nb_Detected, Nb_Corrected; + T_Module Ref_Module, *Module_Ptr; + char buf[BUF_SIZE]; + NDT_Index_Type index_subtype; + + + fprintf( File_Output, "\n"); + + switch( Choice) + { + case QUIT: + { + break; + } + + case LIB_OPEN: + { + Command_Exec_Begin_Print( File_Output, Choice); + + if( Arg1 == NULL) + { + fprintf( File_Output, "Library_Open: Debug Mode ( 0:OFF | 1:ON) ? "); + fgets( buf, BUF_LEN, File_Input); + + Arg1 = buf; + } + + Choice = atoi( Arg1); + + t_start( t_exec); + ND_Library_Open( Choice); + t_stop( t_exec); + + Command_Exec_End_Print( File_Output, Choice, t_exec, 1); + break; + } + + case LIB_CLOSE: + { + Command_Exec_Begin_Print( File_Output, Choice); + + t_start( t_exec); + ND_Library_Close(); + t_stop( t_exec); + + Command_Exec_End_Print( File_Output, Choice, t_exec, 1); + break; + } + + case DS_OPEN: + { + Command_Exec_Begin_Print( File_Output, Choice); + + if( Arg1 == NULL) + { + fprintf( File_Output, "DataStruct_Open: Symbol Lookup ( 0:OFF | 1:ON) ? "); + fgets( buf, BUF_LEN, File_Input); + + Arg1 = buf; + } + + Choice = atoi( Arg1); + + for( i = 0; i < INDEX_NB; i++) + { + idx_type_tab[i] = NDD_INDEX_STATUS_CLOSED; + } + + t_start( t_exec); + if( Choice == 0) + { + ND_DataStruct_Open( DS_Ptr_Ptr, INDEX_NB, idx_type_tab, "Module_Manager", Module_Manager, NULL, NULL, NULL, NULL, NDD_TRUE, NULL); + } + else + { + ND_DataStruct_Open( DS_Ptr_Ptr, INDEX_NB, idx_type_tab, "Module_Manager", NULL, NULL, NULL, NULL, NULL, NDD_TRUE, NULL); + } + t_stop( t_exec); + + Command_Exec_End_Print( File_Output, Choice, t_exec, 1); + break; + } + + case DS_CLOSE: + { + Command_Exec_Begin_Print( File_Output, Choice); + + t_start( t_exec); + ND_DataStruct_Close( *DS_Ptr_Ptr); + t_stop( t_exec); + + *DS_Ptr_Ptr = NULL; + + Command_Exec_End_Print( File_Output, Choice, t_exec, 1); + break; + } + + case DS_FLUSH: + { + Command_Exec_Begin_Print( File_Output, Choice); + + t_start( t_exec); + ND_DataStruct_Flush( *DS_Ptr_Ptr); + t_stop( t_exec); + + Command_Exec_End_Print( File_Output, Choice, t_exec, 1); + break; + } + + case DS_CHECK: + { + Command_Exec_Begin_Print( File_Output, Choice); + + Nb_Corrected = Nb_Detected = 0; + + t_start( t_exec); + ND_DataStruct_Check( *DS_Ptr_Ptr, &Nb_Detected, &Nb_Corrected, File_Output); + t_stop( t_exec); + + Command_Exec_End_Print( File_Output, Choice, t_exec, 1); + break; + } + + case DS_REORG: + { + Command_Exec_Begin_Print( File_Output, Choice); + + t_start( t_exec); + ND_DataStruct_Reorg( *DS_Ptr_Ptr); + t_stop( t_exec); + + Command_Exec_End_Print( File_Output, Choice, t_exec, 1); + break; + } + + case DS_INFO_PRINT: + { + Command_Exec_Begin_Print( File_Output, Choice); + + ND_DataStruct_Info_Print( File_Output, *DS_Ptr_Ptr, NDD_RECURSIVE_MODE_PARENT_CHILD, 99, 0); + + break; + } + + case DS_VALUE_ADD: + { + int order; + + + Command_Index_Range_Get( File_Output, &low, &high, Arg1, File_Input, Choice, "Value"); + + if( low != -1) + { + if( Arg2 == NULL) + { + fprintf( File_Output, "DS_Value_Add: Add order ( 0:croissant | 1:decroissant) ? "); + fgets( buf, BUF_LEN ,stdin); + + Arg2 = buf; + } + + order = atoi( Arg2); + + fprintf( File_Output, "DS_Value_Add: Adding from: (%d) to: (%d) order: (%d)...\n", low, high, order); + fflush( File_Output); + + t_start( t_exec); + + if( order == 0) + { + i = low; + j = high + 1; + + while( i < j) + { + if( ND_Value_Alloc( *DS_Ptr_Ptr, (void **)&Module_Ptr, "x", i) == NDS_OK) + { + ND_DataStruct_Value_Add( *DS_Ptr_Ptr, Module_Ptr); + } + else + { + fprintf( File_Output, "DS_Value_Add: Allocation Failled !\n"); + break; + } + + i++; + } + } + else + { + i = high; + j = low - 1; + + while( i > j) + { + if( ND_Value_Alloc( *DS_Ptr_Ptr, (void **)&Module_Ptr, "x", i) == NDS_OK) + { + ND_DataStruct_Value_Add( *DS_Ptr_Ptr, Module_Ptr); + } + else + { + fprintf( File_Output, "DS_Value_Add: Allocation Failled !\n"); + break; + } + + i--; + } + } + + t_stop( t_exec); + + Command_Exec_End_Print( File_Output, Choice, t_exec, high - low); + } + + break; + } + + case DS_VALUE_REMOVE: + { + int order; + nb_removed = 0; + + + Command_Index_Range_Get( File_Output, &low, &high, Arg1, File_Input, Choice, "Value"); + + if( low != -1) + { + if( Arg2 == NULL) + { + fprintf( File_Output, "\nDS_Value_Remove: Remove order (croissant=0 | decroissant=1) ? "); + fgets( buf, BUF_LEN, File_Input); + + Arg2 = buf; + } + + order = atoi( Arg2); + + t_start( t_exec); + + if( order == 0) + { + i = low; + j = high + 1; + + while( i < j) + { + Ref_Module.Id = i; + + if( ( ND_DataStruct_Value_Find( (void **)&Module_Ptr, *DS_Ptr_Ptr, &Ref_Module) == NDS_OK) && ( Module_Ptr != NULL)) + { + if( ND_DataStruct_Value_Remove( *DS_Ptr_Ptr, (void **)&Module_Ptr) == NDS_OK) + { + nb_removed++; + ND_Value_Free( *DS_Ptr_Ptr, Module_Ptr); + } + } + + i++; + } + } + else + { + i = high; + j = low - 1; + t_start( t_exec); + + while( i > j) + { + Ref_Module.Id = i; + + if( ( ND_DataStruct_Value_Find( (void **)&Module_Ptr, *DS_Ptr_Ptr, &Ref_Module) == NDS_OK) && ( Module_Ptr != NULL)) + { + if( ND_DataStruct_Value_Remove( *DS_Ptr_Ptr, (void **)&Module_Ptr) == NDS_OK) + { + nb_removed++; + ND_Value_Free( *DS_Ptr_Ptr, Module_Ptr); + } + } + + i--; + } + } + + t_stop( t_exec); + + Command_Exec_End_Print( File_Output, Choice, t_exec, high - low); + } + + break; + } + + case DS_VALUE_PRINT: + { + Command_Exec_Begin_Print( File_Output, Choice); + + ND_DataStruct_Value_Print( File_Output, *DS_Ptr_Ptr, NDD_RECURSIVE_MODE_PARENT_CHILD, 99, 0); + break; + } + + case DS_VALUE_FIND: + { + Command_Index_Range_Get( File_Output, &low, &high, Arg1, File_Input, Choice, "Search"); + + if( low != -1) + { + fprintf( File_Output, "DS_Value_Find: from: (%d) to: (%d)...\n", low, high); + fflush( File_Output); + + i = low; + j = high + 1; + + t_start( t_exec); + + while( i < j) + { + Ref_Module.Id = low + (int)( (double)( high - low) * rand() / ( RAND_MAX + 1.0)); + ND_DataStruct_Value_Find( (void *)&Module_Ptr, *DS_Ptr_Ptr, &Ref_Module); + i++; + } + + t_stop (t_exec); + + Command_Exec_End_Print( File_Output, Choice, t_exec, high - low); + } + + break; + } + + case INDEX_LIST_OPEN: + { + Command_Index_Range_Get( File_Output, &low, &high, Arg1, File_Input, Choice, "Index"); + + if( low != -1) + { + fprintf( File_Output, "Index_List_Open: Opening a FIFO List from: (%d) to: (%d)...\n", low, high); + fflush( File_Output); + + t_start( t_exec); + + for( i = low; i <= high; i++) + { + ND_Index_Open( *DS_Ptr_Ptr, (NDT_Index_Id)i, idx_type_fifo); + } + + t_stop( t_exec); + + Command_Exec_End_Print( File_Output, Choice, t_exec, high - low); + } + + break; + } + + case INDEX_TREE_OPEN: + { + Command_Index_Range_Get( File_Output, &low, &high, Arg1, File_Input, Choice, "Index"); + + if( low != -1) + { + + fprintf( File_Output, "Index_Tree_Open: Opening a balanced Tree from: (%d) to: (%d)...\n", low, high); + fflush( File_Output); + + t_start( t_exec); + + for( i = low; i <= high; i++) + { + ND_Index_Open( *DS_Ptr_Ptr, (NDT_Index_Id)i, idx_type_balanced_tree); + } + + t_stop( t_exec); + + Command_Exec_End_Print( File_Output, Choice, t_exec, high - low); + } + + break; + } + + case INDEX_CLOSE: + { + Command_Index_Range_Get( File_Output, &low, &high, Arg1, File_Input, Choice, "Index"); + + if( low != -1) + { + + fprintf( File_Output, "Index_Close: Closing index from: (%d) to: (%d)...\n", low, high); + fflush( File_Output); + + t_start( t_exec); + + for( i = high; i >= low; i--) + { + ND_Index_Close( *DS_Ptr_Ptr, (NDT_Index_Id)i); + } + + t_stop( t_exec); + + Command_Exec_End_Print( File_Output, Choice, t_exec, high - low); + } + + break; + } + + case INDEX_LIST_SUBTYPE_SET: + { + int subtype; + + + Command_Index_Range_Get( File_Output, &low, &high, Arg1, File_Input, Choice, "Index"); + + if( low != -1) + { + if( Arg2 == NULL) + { + fprintf( File_Output, "Index_List_SubType_Set: List SubType ( 0:FIFO | 1:LIFO | 2:Sorted) ? "); + fgets( buf, BUF_LEN, File_Input); + + Arg2 = buf; + } + + subtype = atoi( Arg2); + + switch( subtype) + { + case 0: + { + index_subtype = NDD_INDEX_SUBTYPE_FIFO; + break; + } + + case 1: + { + index_subtype = NDD_INDEX_SUBTYPE_FILO; + break; + } + + case 2: + { + index_subtype = NDD_INDEX_SUBTYPE_SORTED; + break; + } + + default: + { + index_subtype = NDD_INDEX_SUBTYPE_UNKNOWN; + printf ("Index_List_SubType_Set: Invalid selection (%d) !\n", subtype); + break; + } + } + + if( index_subtype != NDD_INDEX_SUBTYPE_UNKNOWN) + { + fprintf( File_Output, "Index_List_SubType_Set: Setting List SubType to: (%d) (%s) !\n", index_subtype, ND_INDEX_SUBTYPE_VALUE_ASCII_GET( index_subtype)); + + t_start( t_exec); + + for( i = low; i <= high; i++) + { + if( ND_INDEX_TYPE_LIST_IS( *DS_Ptr_Ptr, i)) + { + (*DS_Ptr_Ptr)->Index_Tab[i].Type = ( (*DS_Ptr_Ptr)->Index_Tab[i].Type & NDD_INDEX_SUBTYPE_RMSK) | index_subtype; + } + else + { + fprintf( File_Output, "Index_List_SubType_Set: Error: index (%d) is not a List !\n", i); + } + } + + t_stop( t_exec); + + Command_Exec_End_Print( File_Output, Choice, t_exec, high - low); + } + } + + break; + } + + case INDEX_TREE_SUBTYPE_SET: + { + int subtype; + + + Command_Index_Range_Get( File_Output, &low, &high, Arg1, File_Input, Choice, "Index"); + + if( low != -1) + { + if( Arg2 == NULL) + { + fprintf( File_Output, "Index_Tree_SubType_Set: Tree SubType (0:UnBalanced | 1:Balanced) ? "); + fgets( buf, BUF_LEN, stdin); + + Arg2 = buf; + } + + subtype = atoi( Arg2); + + switch( subtype) + { + case 0: + { + index_subtype = NDD_INDEX_SUBTYPE_UNBALANCED; + break; + } + + case 1: + { + index_subtype = NDD_INDEX_SUBTYPE_BALANCED; + break; + } + + default: + { + index_subtype = NDD_INDEX_SUBTYPE_UNKNOWN; + printf ("Index_Tree_SubType_Set: Invalid selection (%d)!\n", subtype); + break; + } + } + + if( index_subtype != NDD_INDEX_SUBTYPE_UNKNOWN) + { + + t_start( t_exec); + + for( i = low; i <= high; i++) + { + if( ND_INDEX_TYPE_TREE_IS( *DS_Ptr_Ptr, i)) + { + (*DS_Ptr_Ptr)->Index_Tab[i].Type = ( (*DS_Ptr_Ptr)->Index_Tab[i].Type & NDD_INDEX_SUBTYPE_RMSK) | index_subtype; + } + else + { + fprintf( File_Output, "Index_Tree_SubType_Set: Error: index (%d) is not a Tree !\n", i); + } + } + + t_stop( t_exec); + + Command_Exec_End_Print( File_Output, Choice, t_exec, high - low); + } + } + + break; + } + + case INDEX_REORG: + { + Command_Index_Range_Get( File_Output, &low, &high, Arg1, File_Input, Choice, "Index"); + + if( low != -1) + { + t_start( t_exec); + + for( i = low; i <= high; i++) + { + fprintf( File_Output, "Index_Reorg: Reorganizing index (%d)...\n", i); + fflush( File_Output); + + ND_Index_Reorg( *DS_Ptr_Ptr, (NDT_Index_Id)i); + } + + t_stop( t_exec); + + Command_Exec_End_Print( File_Output, Choice, t_exec, high - low); + } + + break; + } + + case INDEX_TREE_TO_LIST: + { + Command_Index_Range_Get( File_Output, &low, &high, Arg1, File_Input, Choice, "Index"); + + if( low != -1) + { + t_start( t_exec); + + for( i = low; i <= high; i++) + { + fprintf( File_Output, "Index_Tree_To_List: Converting Index (%d)...\n", i); + fflush( File_Output); + + ND_Index_Convert( *DS_Ptr_Ptr, (NDT_Index_Id)i, idx_type_sorted_list); + } + + t_stop (t_exec); + + Command_Exec_End_Print( File_Output, Choice, t_exec, high - low); + } + + break; + } + + case INDEX_LIST_TO_TREE: + { + Command_Index_Range_Get( File_Output, &low, &high, Arg1, File_Input, Choice, "Index"); + + if( low != -1) + { + t_start( t_exec); + + for( i = low; i <= high; i++) + { + fprintf( File_Output, "Index_List_To_Tree: Converting Index (%d)...\n", i); + fflush( File_Output); + + ND_Index_Convert( *DS_Ptr_Ptr, (NDT_Index_Id)i, idx_type_balanced_tree); + } + + t_stop (t_exec); + + Command_Exec_End_Print( File_Output, Choice, t_exec, high - low); + } + + break; + } + + case INDEX_INFO_PRINT: + { + Command_Index_Range_Get( File_Output, &low, &high, Arg1, File_Input, Choice, "Index"); + + if( low != -1) + { + fprintf( File_Output, "Index_Info_Print: Printing index from: (%d) to: (%d)...\n", low, high); + fflush( File_Output); + + for( i = low; i <= high; i++) + { + ND_Index_Info_Print( File_Output, *DS_Ptr_Ptr, (NDT_Index_Id)i, NDD_RECURSIVE_MODE_PARENT_CHILD, 99, 0); + } + } + + break; + } + + case INDEX_VALUE_PRINT: + { + fprintf( File_Output, "DS_Value_Print:\n"); + fflush( File_Output); + + ND_DataStruct_Value_Print( File_Output, *DS_Ptr_Ptr, NDD_RECURSIVE_MODE_PARENT_CHILD, 99, 0); + break; + } + + case INDEX_VALUE_BREAK: + { + int position; + NDT_Node *node_ptr; + + + Command_Index_Range_Get( File_Output, &low, &high, Arg1, File_Input, Choice, "Index"); + + if( low != -1) + { + if( Arg2 == NULL) + { + fprintf( File_Output, "Index_Value_Break: Value position (0:Head | 1:Tail | 2:Random) ? "); + fgets( buf, BUF_LEN, stdin); + + Arg2 = buf; + } + + position = atoi( Arg2); + + fprintf( File_Output, "Index_Value_Break: Breaking %s values from index : (%d) to: (%d)...\n", + ( position == 0 ) ? "Head" : ( ( position == 1) ? "Tail" : "Random"), + low, high); + fflush( File_Output); + + t_start( t_exec); + + fprintf( File_Output, "Index_Value_Break: Breaking value of nodes: "); + fflush( File_Output); + + for( i = low; i <= high; i++) + { + switch( position) + { + case 0: + { + node_ptr =(*DS_Ptr_Ptr)->Index_Tab[i].Head; + break; + } + + case 1: + { + node_ptr=(*DS_Ptr_Ptr)->Index_Tab[i].Tail; + break; + } + + case 2: + { + j = (int)( (double)( (*DS_Ptr_Ptr)->Index_Tab[i].Node_Number) * rand() / ( RAND_MAX + 1.0)); + + for( node_ptr = (*DS_Ptr_Ptr)->Index_Tab[i].Head; j > 0; j--) + { + node_ptr = node_ptr->Right; + } + + break; + } + } + + fprintf( File_Output, "0x(%x)", node_ptr); + fflush( File_Output); + + node_ptr->Value = (void *)-1; + } + + t_stop (t_exec); + + fprintf( File_Output, "\n"); + fflush( File_Output); + + Command_Exec_End_Print( File_Output, Choice, t_exec, high - low); + } + + break; + } + + case INDEX_NODE_BREAK: + { + + break; + } + + case INDEX_CHECK: + { + Command_Index_Range_Get( File_Output, &low, &high, Arg1, File_Input, Choice, "Index"); + + if( low != -1) + { + t_start( t_exec); + + for( i = low; i <= high; i++) + { + fprintf( File_Output, "Index_Check: Checking Index (%d)...\n", i); + fprintf( File_Output, "Index_Check: "); + fflush( File_Output); + + Nb_Corrected = Nb_Detected = 0; + ND_Index_Check( *DS_Ptr_Ptr, (NDT_Index_Id)i, &Nb_Detected, &Nb_Corrected, File_Output); + } + + t_stop (t_exec); + + Command_Exec_End_Print( File_Output, Choice, t_exec, high - low); + } + + break; + } + + case BATCH_RUN: + { + FILE *file_input; + + + if( Arg1 == NULL) + { + fprintf( File_Output, "Batch_Run: Batch file name ? "); + + fgets( buf, BUF_LEN, stdin); + buf[ strlen( buf) - 1] = '\0'; + Arg1 = buf; + } + + file_input = fopen( Arg1, "r"); + + if( file_input == NULL) + { + fprintf( File_Output, "Batch_Run: Can't open file (%s)!\n", Arg1); + } + else + { + fprintf( File_Output, "\n\n--------------------------------------------------------------------------------\n"); + fprintf( File_Output, "Batch_Run: Starting execution (%s)...\n", Arg1); + Batch_Run( DS_Ptr_Ptr, File_Output, file_input, 0); + fprintf( File_Output, "\n"); + fprintf( File_Output, "Batch_Run: Ending execution (%s)...\n", Arg1); + + fclose( file_input); + } + + break; + } + + default: + { + fprintf( File_Output, "\nUndefined command (%d) !\n", Choice); + } + } +} + + + + + +/*---------------------------------------------------------------------------------*/ +/* */ +/*---------------------------------------------------------------------------------*/ + +void Batch_Run( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, FILE *File_Input, short Interactive_Flag) +{ + int choice; + char *arg1, *arg2; + + + do + { + if( Interactive_Flag) + { + Menu_Print( File_Output, *DS_Ptr_Ptr); + } + + Command_Get( &choice, &arg1, &arg2, File_Output, File_Input, Interactive_Flag); + + if( ( choice != QUIT) && ( choice != -1)) + { + Command_Exec( DS_Ptr_Ptr, File_Output, choice, arg1, arg2, File_Input); + } + + if( arg1 != NULL) free( arg1); + if( arg2 != NULL) free( arg2); + } + while( choice != QUIT); +} + + + + + +/*---------------------------------------------------------------------------------*/ +/* */ +/*---------------------------------------------------------------------------------*/ + +int main( int argc, char **argv) +{ + NDT_Root *ds_ptr = NULL; + + + /* Init Random numbers... */ + + t_start( t_exec); + t_stop( t_exec); + srand( seed_get(t_exec)); + + + + /* Args Parsing */ + + if( argc >= 2) + { + if( !strcmp( argv[1], "--help")) + { + fprintf( stderr, USAGE, argv[0]); + return( 1); + } +#ifdef _LIBVER_SUPPORT + else if( !strcmp( argv[1], "--version")) + { + if( argc >= 3 && !strcmp( argv[2], "-v")) + { + return( VER_Object_Print( stdout, VERD_VERBOSE)); + } + else + { + return( VER_Object_Print( stdout, VERD_MINIMAL)); + } + } +#endif + else if( !strcmp( argv[1], "--batch_run")) + { + /* Batch Mode */ + + Command_Exec( &ds_ptr, stdout, BATCH_RUN, argv[2], NULL, stdin); + + return( 0); + } + else + { + fprintf( stderr, USAGE, argv[0]); + return( -1); + } + } + + + + /* Interactive Mode */ + + Batch_Run( &ds_ptr, stdout, stdin, 1); + + return( 0); +} diff --git a/src/libnode/util/test-10-s.ndb b/src/libnode/util/test-10-s.ndb new file mode 100644 index 0000000..cf2138c --- /dev/null +++ b/src/libnode/util/test-10-s.ndb @@ -0,0 +1,10 @@ +Lib_Open 0 +DS_Open 1 +Index_List_Open 0-0 +DS_Value_Add 1-10 0 +DS_Value_Find 1-10 +Index_List_To_Tree 0-0 +DS_Value_Find 1-10 +DS_Check +DS_Close +Lib_Close diff --git a/src/libnode/util/test-10.ndb b/src/libnode/util/test-10.ndb new file mode 100644 index 0000000..76e86c8 --- /dev/null +++ b/src/libnode/util/test-10.ndb @@ -0,0 +1,10 @@ +Lib_Open 0 +DS_Open 0 +Index_List_Open 0-0 +DS_Value_Add 1-10 0 +DS_Value_Find 1-10 +Index_List_To_Tree 0-0 +DS_Value_Find 1-10 +DS_Check +DS_Close +Lib_Close diff --git a/src/libnode/util/test-100K-s.ndb b/src/libnode/util/test-100K-s.ndb new file mode 100644 index 0000000..5429713 --- /dev/null +++ b/src/libnode/util/test-100K-s.ndb @@ -0,0 +1,10 @@ +Lib_Open 0 +DS_Open 1 +Index_List_Open 0-0 +DS_Value_Add 1-100000 0 +DS_Value_Find 49900-50100 +Index_List_To_Tree 0-0 +DS_Value_Find 1-100000 +DS_Check +DS_Close +Lib_Close diff --git a/src/libnode/util/test-100K.ndb b/src/libnode/util/test-100K.ndb new file mode 100644 index 0000000..a0279e7 --- /dev/null +++ b/src/libnode/util/test-100K.ndb @@ -0,0 +1,10 @@ +Lib_Open 0 +DS_Open 0 +Index_List_Open 0-0 +DS_Value_Add 1-100000 0 +DS_Value_Find 49900-50100 +Index_List_To_Tree 0-0 +DS_Value_Find 1-100000 +DS_Check +DS_Close +Lib_Close diff --git a/src/libnode/util/test-10K-s.ndb b/src/libnode/util/test-10K-s.ndb new file mode 100644 index 0000000..3586b39 --- /dev/null +++ b/src/libnode/util/test-10K-s.ndb @@ -0,0 +1,10 @@ +Lib_Open 0 +DS_Open 1 +Index_List_Open 0-0 +DS_Value_Add 1-10000 0 +DS_Value_Find 4000-6000 +Index_List_To_Tree 0-0 +DS_Value_Find 1-10000 +DS_Check +DS_Close +Lib_Close diff --git a/src/libnode/util/test-10K.ndb b/src/libnode/util/test-10K.ndb new file mode 100644 index 0000000..088f6e4 --- /dev/null +++ b/src/libnode/util/test-10K.ndb @@ -0,0 +1,10 @@ +Lib_Open 0 +DS_Open 0 +Index_List_Open 0-0 +DS_Value_Add 1-10000 0 +DS_Value_Find 4000-6000 +Index_List_To_Tree 0-0 +DS_Value_Find 1-10000 +DS_Check +DS_Close +Lib_Close diff --git a/src/libnode/util/test-1M-s.ndb b/src/libnode/util/test-1M-s.ndb new file mode 100644 index 0000000..87d9c6d --- /dev/null +++ b/src/libnode/util/test-1M-s.ndb @@ -0,0 +1,10 @@ +Lib_Open 0 +DS_Open 1 +Index_List_Open 0-0 +DS_Value_Add 1-1000000 0 +DS_Value_Find 499990-500010 +Index_List_To_Tree 0-0 +DS_Value_Find 1-1000000 +DS_Check +DS_Close +Lib_Close diff --git a/src/libnode/util/test-1M.ndb b/src/libnode/util/test-1M.ndb new file mode 100644 index 0000000..5ccf43c --- /dev/null +++ b/src/libnode/util/test-1M.ndb @@ -0,0 +1,10 @@ +Lib_Open 0 +DS_Open 0 +Index_List_Open 0-0 +DS_Value_Add 1-1000000 0 +DS_Value_Find 499990-500010 +Index_List_To_Tree 0-0 +DS_Value_Find 1-1000000 +DS_Check +DS_Close +Lib_Close diff --git a/src/libnode/util/test-all.ndb b/src/libnode/util/test-all.ndb new file mode 100644 index 0000000..cc341de --- /dev/null +++ b/src/libnode/util/test-all.ndb @@ -0,0 +1,9 @@ +Batch_Run test-error.ndb +Batch_Run test-10.ndb +Batch_Run test-10-s.ndb +Batch_Run test-10K.ndb +Batch_Run test-10K-s.ndb +Batch_Run test-100K.ndb +Batch_Run test-100K-s.ndb +Batch_Run test-1M.ndb +Batch_Run test-1M-s.ndb diff --git a/src/libnode/util/test-error.ndb b/src/libnode/util/test-error.ndb new file mode 100644 index 0000000..df0ddbe --- /dev/null +++ b/src/libnode/util/test-error.ndb @@ -0,0 +1,15 @@ +DS_Open 0 +Lib_Open 0 +DS_Open 0 +Index_List_Open 0-0 +DS_Value_Add 1-10 0 +Lib_Close +Lib_Open 1 +DS_Open 0 +Index_List_Open 0-0 +DS_Value_Add 1-10 0 +Index_Value_Break 0-0 0 +Index_Value_Break 0-0 1 +Index_Value_Break 0-0 2 +DS_Check +Lib_Close diff --git a/src/libstatic_data_mng/include/static_data_mng.h b/src/libstatic_data_mng/include/static_data_mng.h new file mode 100644 index 0000000..82712be --- /dev/null +++ b/src/libstatic_data_mng/include/static_data_mng.h @@ -0,0 +1,420 @@ +/*----------------------------------------------------------------------------*/ +/* File: static_data_mng.h */ +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#ifndef _STATIC_DATA_MNG_H_ +#define _STATIC_DATA_MNG_H_ + + + +#include + + + + + +/*----------------------------------------------------------------------------*/ +/* IMRD_API definition */ +/*----------------------------------------------------------------------------*/ + +# ifdef _LIBSTATIC_DATA_MNG_C_ +# define IMRD_SDM_API +# else +# define IMRD_SDM_API extern +# endif + + + + +/*----------------------------------------------------------------------------*/ +/* IMRT_SDM_Config */ +/*----------------------------------------------------------------------------*/ + +typedef short IMRT_SDM_Flag; + +#define IMRD_SDM_FLAG_UNKNOWN ( IMRT_SDM_Flag) 0 +#define IMRD_SDM_FLAG_XML ( IMRT_SDM_Flag) 1 +#define IMRD_SDM_FLAG_SQL ( IMRT_SDM_Flag) 2 + + + +typedef struct +{ + IMRT_SDM_Flag Flag; + IMRT_Path Lib_Path; +} IMRT_SDM_Config; + + + + + +/*----------------------------------------------------------------------------*/ +/* IMRT_MsgMap_Id definition */ +/*----------------------------------------------------------------------------*/ + +typedef int IMRT_MsgMap_Id; + +#define IMRD_MSGMAP_ID_UNKNOWN ( IMRT_MsgMap_Id) 0 + + + + +/*----------------------------------------------------------------------------*/ +/* IMRT_MsgMap definition */ +/*----------------------------------------------------------------------------*/ + +typedef struct IMRT_MsgMap +{ + IMRT_MsgMap_Id Id; + char Name[IMRD_NAME_SIZE]; + IMRT_Msg *Msg_Input_Ptr; + IMRT_Msg *Msg_Output_Ptr; + NDT_Root *FieldMap_Struct_Ptr; +} IMRT_MsgMap; + + + + + +/*----------------------------------------------------------------------------*/ +/* IMRT_Jump definition */ +/*----------------------------------------------------------------------------*/ + +typedef struct IMRT_Jump +{ + IMRT_Fmt *Fmt_Ptr; + IMRT_Msg *Msg_Ptr; + int Branche_Id; +} IMRT_Jump; + + + + + +/*----------------------------------------------------------------------------*/ +/* IMRT_MapCmd */ +/*----------------------------------------------------------------------------*/ + +/*#define IMRD_JUMP_NB_MAX ( short) 40*/ + + + +typedef short IMRT_MapCmd_Id; + + + +typedef short IMRT_MapCmd_Type; + +#define IMRD_MAPCMD_TYPE_UNKNOWN ( IMRT_MapCmd_Type) 0 +#define IMRD_MAPCMD_TYPE_MAP ( IMRT_MapCmd_Type) 1 +#define IMRD_MAPCMD_TYPE_COPY ( IMRT_MapCmd_Type) 2 +#define IMRD_MAPCMD_TYPE_IDENT ( IMRT_MapCmd_Type) 3 +#define IMRD_MAPCMD_TYPE_GOTO ( IMRT_MapCmd_Type) 4 + + + +typedef short IMRT_MapCmd_Branch_Id; + + + +typedef short IMRT_MapCmd_Flag; + + + +typedef struct IMRT_MapCmd +{ + IMRT_MapCmd_Id MapCmd_Id; + IMRT_MapCmd_Type TypeCmd; + IMRT_MapCmd_Branch_Id Branche_Id; + IMRT_Boolean Ident_Total; + IMRT_Msg *Ident_First_Msg_Ptr; + IMRT_Fmt *Fmt_Input_Ptr; + IMRT_FmtAttr *FmtAttr_Input_Ptr; + IMRT_Fmt *Fmt_Output_Ptr; + IMRT_FmtAttr *FmtAttr_Output_Ptr; + IMRT_Buffer_Id Buffer_Id_Input; + IMRT_Buffer_Id Buffer_Id_Output; + IMRT_Buffer_Id Buffer_Id_Ident; + IMRT_MapCmd_Flag Clear_Flag; + IMRT_MsgMap *MsgMap_Ptr; + IMRT_MapCmd_Branch_Id Goto_Branche_Id; + int JmpTbleNbElts; + IMRT_Jump *Jump_Tab; +} IMRT_MapCmd; + + + + + + + +/*----------------------------------------------------------------------------*/ +/* Global Variables */ +/*----------------------------------------------------------------------------*/ + +# ifdef _LIBSTATIC_DATA_MNG_ + +# else + +extern IMRT_Module IMRG_SDM_Module; + +# endif + + + + + + + +/******************************************************************************/ +/* Static Data Manager Client CallBack */ +/******************************************************************************/ + + + +/*----------------------------------------------------------------------------*/ +/* Format Add CallBack */ +/*----------------------------------------------------------------------------*/ +/* (I) Fmt_Id: Format id */ +/* (I) Fmt_Name: Format name */ +/* (I) Fmt_Id_Nb: Total number of format */ +/*----------------------------------------------------------------------------*/ + +typedef IMRT_Status IMRT_SDMCB_Fmt_Add( IMRT_Fmt_Id, IMRT_Fmt_Name, IMRT_Fmt_Id); + + + +/*----------------------------------------------------------------------------*/ +/* Convert Add CallBack */ +/*----------------------------------------------------------------------------*/ +/* (I) Cnv_Id: Convert id */ +/* (I) Cnv_Name: Convert name */ +/* (I) Cnv_Id_Nb: Total number of convert */ +/*----------------------------------------------------------------------------*/ + +typedef IMRT_Status IMRT_SDMCB_Cnv_Add( IMRT_Cnv_Id, IMRT_Cnv_Name, IMRT_Cnv_Id); + + + +/*----------------------------------------------------------------------------*/ +/* Buffer Mapping CallBack */ +/*----------------------------------------------------------------------------*/ +/* (I) Buffer_Id_Target: Target buffer id */ +/* (I) Fmt_Target: Target format */ +/* (I) Fmt_Attr_Target: Target format attribute */ +/* (I) Buffer_Id_Src: Source buffer id */ +/* (I) Fmt_Src: Source format */ +/* (I) Fmt_Attr_Src: Source format attribute */ +/* (I) MsgMap: Message Map to use */ +/* (I) Clear_Flag: Clear or donn't clear output buffer */ +/*----------------------------------------------------------------------------*/ + +typedef IMRT_Status IMRT_SDMCB_Buffer_Map( IMRT_Buffer_Id, IMRT_Fmt_Id, IMRT_FmtAttr_Value, IMRT_Buffer_Id, IMRT_Fmt_Id, IMRT_FmtAttr_Value, IMRT_MsgMap *, IMRT_MapCmd_Flag); + + + +/*----------------------------------------------------------------------------*/ +/* Buffer Copy CallBack */ +/*----------------------------------------------------------------------------*/ +/* (I) Buffer_Id_Target: Target buffer id */ +/* (I) Buffer_Id_Src: Source buffer id */ +/*----------------------------------------------------------------------------*/ + +typedef IMRT_Status IMRT_SDMCB_Buffer_Copy( IMRT_Buffer_Id, IMRT_Buffer_Id); + + + +/*----------------------------------------------------------------------------*/ +/* Buffer Identification CallBack */ +/*----------------------------------------------------------------------------*/ +/* (O) Fmt_Id_Ptr: Buffer format to return */ +/* (I/O) Msg_Id_Ptr: Buffer message id to read (if not total) and return */ +/* (I) Buffer_Id_Ptr: Id of the buffer to identify */ +/* (I) Ident_Total: True if total identification */ +/*----------------------------------------------------------------------------*/ + +typedef IMRT_Status IMRT_SDMCB_Buffer_Ident( IMRT_Fmt_Id *, IMRT_Msg_Id *, IMRT_Buffer_Id, IMRT_Boolean); + + + +/*----------------------------------------------------------------------------*/ +/* Field Mapping CallBack */ +/*----------------------------------------------------------------------------*/ +/* (I) Field_Target_Ptr: Target Field pointer */ +/* (I) Field_Source_Ptr: Source Field pointer */ +/*----------------------------------------------------------------------------*/ + +typedef IMRT_Status IMRT_SDMCB_Field_Map( IMRT_Field *, IMRT_Field *); + + + +/*----------------------------------------------------------------------------*/ +/* Field Ident CallBack */ +/*----------------------------------------------------------------------------*/ +/* (I) FieldMap_Ptr: FielMap pointer */ +/*----------------------------------------------------------------------------*/ + +typedef IMRT_Status IMRT_SDMCB_Ident_Field_Value( IMRT_Field *, IMRT_Field_Value_Id); + + +typedef IMRT_Status IMRT_SDMCB_Ident_Field_Exist( IMRT_Field *); + + +typedef IMRT_Status IMRT_SDMCB_Ident_Msg_Size( size_t); + + + + + +/******************************************************************************/ +/* Static Data Manager API */ +/******************************************************************************/ + + + +/*----------------------------------------------------------------------------*/ +/* Open Static Data Manager */ +/*----------------------------------------------------------------------------*/ +/* Lib_Flag: Setup SDM init mode (XML, SQL, ...) */ +/*----------------------------------------------------------------------------*/ + +IMRD_SDM_API IMRT_Status IMR_SDM_Library_Open( IMRT_SDM_Config *); + + + +/*----------------------------------------------------------------------------*/ +/* Close Static Data Manager */ +/*----------------------------------------------------------------------------*/ + +IMRD_SDM_API IMRT_Status IMR_SDM_Library_Close( void); + + + +/*----------------------------------------------------------------------------*/ +/* Dump Data Structures to SQL files */ +/*----------------------------------------------------------------------------*/ +IMRD_SDM_API IMRT_Status IMR_SDM_SQL_Dump(void); + + + +/*----------------------------------------------------------------------------*/ +/* Dump Data Structures to XML files */ +/*----------------------------------------------------------------------------*/ +IMRD_SDM_API IMRT_Status IMR_SDM_XML_Dump(void); + + + + +/*----------------------------------------------------------------------------*/ +/* Proceed Format */ +/*----------------------------------------------------------------------------*/ +/* (I) CCB_Fmt_Add_Ptr: Format add callback */ +/*----------------------------------------------------------------------------*/ + +IMRD_SDM_API IMRT_Status IMR_SDM_Fmt_Proceed( IMRT_SDMCB_Fmt_Add *); + + + +/*----------------------------------------------------------------------------*/ +/* Proceed Convert */ +/*----------------------------------------------------------------------------*/ +/* (I) CCB_Cnv_Add_Ptr: Convert add callback */ +/*----------------------------------------------------------------------------*/ +IMRD_SDM_API IMRT_Status IMR_SDM_Cnv_Proceed( IMRT_SDMCB_Cnv_Add *); + + + +/*----------------------------------------------------------------------------*/ +/* Proceed Convert */ +/*----------------------------------------------------------------------------*/ +/* (I) CCB_Cnv_Add_Ptr: Convert add callback */ +/*----------------------------------------------------------------------------*/ + +IMRD_SDM_API IMRT_Status IMR_SDM_Cnv_Proceed( IMRT_SDMCB_Cnv_Add *); + + + +/*----------------------------------------------------------------------------*/ +/* Proceed Mapping Path */ +/*----------------------------------------------------------------------------*/ +/* (I) Appl_Id_Target: Target buffer application id */ +/* (I) Fmt_Id_Target: Target buffer format id */ +/* (I) Msg_Id_Target: Target buffer message id */ +/* (I) ApplId_Src: Source buffer application id */ +/* (I) Fmt_Id_Src: Source buffer format id */ +/* (I) Msg_Id_Src: Source buffer message id */ +/* (I) CCB_Buffer_Map_Ptr: Buffer mapping callback */ +/* (I) CCB_Buffer_Copy_Ptr: Buffer copy callback */ +/* (I) CCB_Buffer_Ident_Ptr: Buffer identification callback */ +/*----------------------------------------------------------------------------*/ + +IMRD_SDM_API IMRT_Status IMR_SDM_MapPath_Proceed( IMRT_Appl_Id, IMRT_Fmt_Id, IMRT_Msg_Id, + IMRT_Appl_Id, IMRT_Fmt_Id, IMRT_Msg_Id, + IMRT_SDMCB_Buffer_Map *, IMRT_SDMCB_Buffer_Copy *, IMRT_SDMCB_Buffer_Ident *); + + + +/*----------------------------------------------------------------------------*/ +/* Proceed Buffer Mapping */ +/*----------------------------------------------------------------------------*/ +/* (I) MsgMap_Ptr: Message map pointer */ +/* (I) CCB_Field_Map_Ptr: Field mapping callback */ +/*----------------------------------------------------------------------------*/ + +IMRD_SDM_API IMRT_Status IMR_SDM_MsgMap_Proceed( IMRT_MsgMap *, IMRT_SDMCB_Field_Map *); + + + +/*----------------------------------------------------------------------------*/ +/* Proceed Message Identification */ +/*----------------------------------------------------------------------------*/ +/* (I) Fmt_Id: Target buffer format id */ +/* (I) Msg_Id: Target buffer message id */ +/* (I) CCB_Field_Ident_Ptr: Field ident callback */ +/*----------------------------------------------------------------------------*/ + +IMRD_SDM_API IMRT_Status IMR_SDM_MsgIdent_Proceed( IMRT_Fmt_Id, IMRT_Msg_Id *, IMRT_SDMCB_Ident_Field_Value *, IMRT_SDMCB_Ident_Field_Exist *, IMRT_SDMCB_Ident_Msg_Size *); + + + +/*----------------------------------------------------------------------------*/ +/* Convert Buffer Format Name to Buffer Format Id */ +/*----------------------------------------------------------------------------*/ + +IMRD_SDM_API IMRT_Status IMR_SDM_Fmt_Id_Get( IMRT_Fmt_Id *, const IMRT_Fmt_Name); + + + +/*----------------------------------------------------------------------------*/ +/* Convert Buffer Appli Name to Buffer Appli Id */ +/*----------------------------------------------------------------------------*/ +IMRD_SDM_API IMRT_Status IMR_SDM_Appl_Id_Get( IMRT_Appl_Id *, const IMRT_Appl_Name); + + + +#endif diff --git a/src/libstatic_data_mng/src/Makefile b/src/libstatic_data_mng/src/Makefile new file mode 100644 index 0000000..dfc6541 --- /dev/null +++ b/src/libstatic_data_mng/src/Makefile @@ -0,0 +1,79 @@ +#------------------------------------------------------------------------------ +# Local Makefile +#------------------------------------------------------------------------------ +# $Workfile: Makefile $ +#------------------------------------------------------------------------------ +# $Author: agibert $ +# $Date: 2008/11/12 02:25:23 $ +# $Revision: 1.1 $ +# $Label: $ +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# IMR - Interlinking Message Router +# Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) +# mailto:arnaud@rx3.net +# http://www.rx3.org/dvp/?dvp=imr +#------------------------------------------------------------------------------ +# This file is part of IMR +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# Var include +#------------------------------------------------------------------------------ + +include ../../Makefile_var.mk + + + +#------------------------------------------------------------------------------ +# Variables +#------------------------------------------------------------------------------ + +TARGET= libstatic_data_mng$(SHLIB_SUFFIX) + +OBJ= libstatic_data_mng.o \ + arc_hdl_xml.o \ + buffer_info_mng.o \ + mapping_info_mng.o \ + struct_info_mng.o \ + buffer_info_xml.o \ + mapping_info_xml.o \ + struct_info_xml.o + +ifeq ($(ORACLE_SUPPORT),1) + OBJ+= arc_hdl_sql.o \ + buffer_info_sql.o \ + mapping_info_sql.o \ + struct_info_sql.o +endif + +EXTRA_INC= + +EXTRA_LIB= + + + +#------------------------------------------------------------------------------ +# Rule include +#------------------------------------------------------------------------------ + +include ../../Makefile_rule.mk diff --git a/src/libstatic_data_mng/src/arc_hdl_sql.h b/src/libstatic_data_mng/src/arc_hdl_sql.h new file mode 100644 index 0000000..6e660fc --- /dev/null +++ b/src/libstatic_data_mng/src/arc_hdl_sql.h @@ -0,0 +1,101 @@ +/*----------------------------------------------------------------------------*/ +/* File: arc_hdl_sql.h */ +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#ifndef _ARC_HDL_SQL_H_ +# define _ARC_HDL_SQL_H_ + + + +/*----------------------------------------------------------------------------*/ +/* Global Include */ +/*----------------------------------------------------------------------------*/ + +# include +# include + + +/*----------------------------------------------------------------------------*/ +/* Global variables */ +/*----------------------------------------------------------------------------*/ +# ifdef _ARC_HDL_SQL_PC_ + +typedef short IMRT_DB_Open_Flag; + +#define IMRD_DB_OPEN_FLAG_UNKNOWN ( IMRT_DB_Open_Flag) 0 +#define IMRD_DB_OPEN_FLAG_OPENED ( IMRT_DB_Open_Flag) 1 +#define IMRD_DB_OPEN_FLAG_CLOSED ( IMRT_DB_Open_Flag) 2 + + + +typedef struct IMRT_SDM_SQL_Base +{ + IMRT_DB_Open_Flag Open_Flag; + +} IMRT_SDM_SQL_Base; + + + +IMRT_SDM_SQL_Base IMRG_SDM_SQL_Base = +{ + IMRD_DB_OPEN_FLAG_CLOSED +}; + +# endif + + + +/*----------------------------------------------------------------------------*/ +/* Prototypes */ +/*----------------------------------------------------------------------------*/ + +# ifdef _ARC_HDL_SQL_PC_ + +IMRT_Status SDM_HDR_SQL_Init(IMRT_SDM_Flag Flag); +IMRT_Status SDM_HDR_SQL_DInit(void); +IMRT_Status SDM_SQL_ConnectOra(void); +IMRT_Status SDM_SQL_DisconnectOra(void); +IMRT_Status SDM_SQL_Set_Struct_Version(IMRT_Data_Version *, char *); + +# else + +extern IMRT_Status SDM_HDR_SQL_Init(IMRT_SDM_Flag Flag); +extern IMRT_Status SDM_HDR_SQL_DInit(void); +extern IMRT_Status SDM_SQL_ConnectOra(void); +extern IMRT_Status SDM_SQL_DisconnectOra(void); +extern IMRT_Status SDM_SQL_Set_Struct_Version(IMRT_Data_Version *, char *); + +# endif + + + + + +/*----------------------------------------------------------------------------*/ + +#endif diff --git a/src/libstatic_data_mng/src/arc_hdl_sql.pc b/src/libstatic_data_mng/src/arc_hdl_sql.pc new file mode 100644 index 0000000..e15cf67 --- /dev/null +++ b/src/libstatic_data_mng/src/arc_hdl_sql.pc @@ -0,0 +1,185 @@ +/*----------------------------------------------------------------------------*/ +/* File: arc_hdl_sql.pc */ +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#define _LIBSTATIC_DATA_MNG_ +#define _ARC_HDL_SQL_PC_ + +#include "arc_hdl_sql.h" + + +IMRT_Status SDM_HDR_SQL_Init(IMRT_SDM_Flag Flag) +{ + IMRT_Status status; + + status = IMRS_OK; + + if (Flag == IMRD_SDM_FLAG_SQL) + { + status = SDM_SQL_ConnectOra(); + if (status == IMRS_OK) + { + IMRG_SDM_SQL_Base.Open_Flag = IMRD_DB_OPEN_FLAG_OPENED; + } + } + + return(status); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_HDR_SQL_DInit(void) +{ + IMRT_Status status; + + status = IMRS_OK; + + if (IMRG_SDM_SQL_Base.Open_Flag == IMRD_DB_OPEN_FLAG_OPENED) + { + status = SDM_SQL_DisconnectOra(); + } + + return(status); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_SQL_ConnectOra(void) +{ + IMRT_Status status; + const char sFunctionName []="SDM_SQL_ConnectOra"; + EXEC SQL BEGIN DECLARE SECTION; + VARCHAR vConnectString[50]; + EXEC SQL END DECLARE SECTION; + + status = IMRS_OK; + strcpy ( (char *) vConnectString.arr, "/"); + vConnectString.len = strlen( (char *) vConnectString.arr ); + + EXEC SQL CONNECT :vConnectString ; + if (sqlca.sqlcode != 0) + { + IMRD_LM_LOG_ERROR_3("Erreur %s. Erreur Oracle : %d - %s !", sFunctionName, sqlca.sqlcode, sqlca.sqlerrm.sqlerrmc); + status = IMRS_KO; + } + + return(status); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_SQL_DisconnectOra(void) +{ + IMRT_Status status; + const char sFunctionName []="SDM_SQL_DisconnectOra"; + + status = IMRS_OK; + + EXEC SQL COMMIT WORK RELEASE; + if (sqlca.sqlcode != 0) + { + IMRD_LM_LOG_ERROR_3("Erreur %s. Erreur Oracle : %d - %s !", sFunctionName, sqlca.sqlcode, sqlca.sqlerrm.sqlerrmc); + status = IMRS_KO; + } + + return(status); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_SQL_Set_Struct_Version(IMRT_Data_Version *Data_Version_Ptr, char *Component_Ptr) +{ + const char sFunctionName []="SDM_SQL_Get_Struct_Version"; + IMRT_Status status; + + EXEC SQL BEGIN DECLARE SECTION; + VARCHAR vVersName[IMRD_SDMD_VERS_NAME_LEN]; + VARCHAR vVersLabel[IMRD_SDMD_VERS_LABEL_LEN]; + VARCHAR vVersDate[IMRD_SDMD_VERS_DATE_LEN]; + + short hIndVersName; + short hIndVersLabel; + short hIndVersDate; + EXEC SQL END DECLARE SECTION; + + + /* initialisation */ + status = IMRS_OK; + + strcpy((char*) vVersName.arr, Component_Ptr); + vVersName.len = strlen((char*) vVersName.arr ); + + memset(vVersLabel.arr, '\0', (size_t) IMRD_SDMD_VERS_LABEL_LEN); + memset(vVersDate.arr, '\0', (size_t) IMRD_SDMD_VERS_DATE_LEN); + + EXEC SQL DECLARE cur_imr_version CURSOR FOR + SELECT VERS_LABEL, VERS_DATE + FROM IMR_DATA_VERSION + WHERE VERS_NAME = :vVersName; + + EXEC SQL OPEN cur_imr_version; + + EXEC SQL FETCH cur_imr_version + INTO :vVersLabel:hIndVersLabel, + :vVersDate:hIndVersDate; + + if (sqlca.sqlcode == 0) + { + if (hIndVersLabel >= 0) + { + strcpy(Data_Version_Ptr->Label, (char*)vVersLabel.arr); + } + else + { + Data_Version_Ptr->Label[0] = '\0'; + } + + if (hIndVersDate >= 0) + { + strcpy(Data_Version_Ptr->Date, (char*)vVersDate.arr); + } + else + { + Data_Version_Ptr->Date[0] = '\0'; + } + } + else + { + status = IMRS_KO; + } + + EXEC SQL CLOSE cur_imr_version; + + return(status); + +} + +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ + diff --git a/src/libstatic_data_mng/src/arc_hdl_xml.c b/src/libstatic_data_mng/src/arc_hdl_xml.c new file mode 100644 index 0000000..1f2b3dc --- /dev/null +++ b/src/libstatic_data_mng/src/arc_hdl_xml.c @@ -0,0 +1,76 @@ +/*----------------------------------------------------------------------------*/ +/* File: arc_hdl_xml.c */ +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#define _LIBSTATIC_DATA_MNG_ +#define _ARC_HDL_XML_C_ + +#include "arc_hdl_xml.h" + + + + + +/*----------------------------------------------------------------------------*/ +/*Raise Error */ +/*ctx : contexte avec lequele la fonction est appelée */ +/*functionname : nom de la focntion qui léve l'erreur */ +/*lib_error : libellé de l'erreur */ +/*code : code de l'erreur */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status SDM_HDR_XML_Init(IMRT_SDM_Flag Flag) +{ + + return(IMRS_OK); + +} + +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_HDR_XML_DInit(void) +{ + + return(IMRS_OK); + +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +void SDM_RaiseError(xmlParserCtxt * Ctx_Sax_Ptr, IMRT_Error * Struct_Error_Ptr ,IMRT_Status * Flag_Error , + const char* functionname, const char* lib_error, const int code ) +{ + + fprintf(stderr,"\nRaise error <%s>",lib_error); + Ctx_Sax_Ptr->sax = &ErrorSAXHandlerStruct; + *Flag_Error = IMRS_KO; + Struct_Error_Ptr->errorCode = code; + strcpy(Struct_Error_Ptr->libError,lib_error) ; + strcpy(Struct_Error_Ptr->function,functionname); +} diff --git a/src/libstatic_data_mng/src/arc_hdl_xml.h b/src/libstatic_data_mng/src/arc_hdl_xml.h new file mode 100644 index 0000000..532b540 --- /dev/null +++ b/src/libstatic_data_mng/src/arc_hdl_xml.h @@ -0,0 +1,113 @@ +/*----------------------------------------------------------------------------*/ +/* File: arc_hdl_xml.h */ +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#ifndef _ARC_HDL_XML_H_ +# define _ARC_HDL_XML_H_ + + + +/*----------------------------------------------------------------------------*/ +/* Global Include */ +/*----------------------------------------------------------------------------*/ + +# include + + + +# ifdef _ARC_HDL_XML_C_ +/*-----------------------------------------------------------------------------*/ +/*Globale Variable */ +/*-----------------------------------------------------------------------------*/ + + +xmlSAXHandler ErrorSAXHandlerStruct = { + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + 1, + NULL, + NULL, + NULL, + NULL +}; +# else +extern xmlSAXHandler ErrorSAXHandlerStruct; + +# endif +/*----------------------------------------------------------------------------*/ +/* Prototypes */ +/*----------------------------------------------------------------------------*/ + +# ifdef _ARC_HDL_XML_C_ + +IMRT_Status SDM_HDR_XML_Init(IMRT_SDM_Flag Flag); +IMRT_Status SDM_HDR_XML_DInit(void); +void SDM_RaiseError(xmlParserCtxt * Ctx_Sax_Ptr, IMRT_Error * Struct_Erro_Ptr ,IMRT_Status * Flag_Error , + const char* functionname, const char* lib_error, const int code ); + +# else + +extern IMRT_Status SDM_HDR_XML_Init(IMRT_SDM_Flag Flag); +extern IMRT_Status SDM_HDR_XML_DInit(void); +extern void SDM_RaiseError(xmlParserCtxt * Ctx_Sax_Ptr, IMRT_Error * Struct_Erro_Ptr ,IMRT_Status * Flag_Error , + const char* functionname, const char* lib_error, const int code ); + +# endif + + + + + +/*----------------------------------------------------------------------------*/ + +#endif diff --git a/src/libstatic_data_mng/src/buffer_info_mng.c b/src/libstatic_data_mng/src/buffer_info_mng.c new file mode 100644 index 0000000..20dad2b --- /dev/null +++ b/src/libstatic_data_mng/src/buffer_info_mng.c @@ -0,0 +1,2909 @@ +/*----------------------------------------------------------------------------*/ +/* File: buffer_info_mng.c */ +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#define _LIBSTATIC_DATA_MNG_ +#define _BUFFER_INFO_MNG_C_ + +#include "buffer_info_mng.h" + +IMRT_Status SDM_DataStruct_Finalize(NDT_Root *ds_Ptr, NDT_Index_Type *Index_Type_Ptr, short hMaxEntries) +{ + NDT_Status nd_status; + IMRT_Status status; + short Compteur; + + Compteur = 0; + status = IMRS_OK; + + do + { + if (Compteur == 0) + { + nd_status = ND_DataStruct_Convert(ds_Ptr, Index_Type_Ptr); + + if(nd_status != NDS_OK) + { + + status = IMRS_KO; + } + } + else + { + nd_status = ND_Index_Open(ds_Ptr, Compteur, Index_Type_Ptr[Compteur]); + if(nd_status != NDS_OK) + { + + status = IMRS_KO; + } + } + + Compteur = Compteur + 1; + } while((nd_status == NDS_OK)&&(Compteur < hMaxEntries)); + + return(status); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +void SDM_IniTableCritere(IMRT_Status Table[],const int NbElement) +{ + int i; + for(i =0; iInputAppli != IMRD_APPL_ID_UNKNOWN) && + (Critere->InputAppli != myMapPath->Appl_Input_Ptr->Id) && + (myMapPath->Appl_Input_Ptr->Id != IMRD_APPL_ID_UNKNOWN) + ) + { + CitereTable[SDMD_CRI_IA] = IMRS_KO; + } + if( (Critere->OutputAppli != IMRD_APPL_ID_UNKNOWN ) && + (Critere->OutputAppli != myMapPath->Appl_Output_Ptr->Id) && + (myMapPath->Appl_Output_Ptr->Id != IMRD_APPL_ID_UNKNOWN ) + ) + { + CitereTable[SDMD_CRI_OA] = IMRS_KO; + } + if( (Critere->InputFormat != IMRD_FMT_ID_UNKNOWN) && + (Critere->InputFormat != myMapPath->Fmt_Input_Ptr->Id) && + (myMapPath->Fmt_Input_Ptr->Id != IMRD_FMT_ID_UNKNOWN) + ) + { + CitereTable[SDMD_CRI_IF] = IMRS_KO; + } + if( (Critere->OutputFormat != IMRD_FMT_ID_UNKNOWN) && + (Critere->OutputFormat != myMapPath->Fmt_Output_Ptr->Id) && + (myMapPath->Fmt_Output_Ptr->Id != IMRD_FMT_ID_UNKNOWN) + ) + { + CitereTable[SDMD_CRI_OF] = IMRS_KO; + } + + *Valide=IMRS_OK; + for(indexe =0; indexe Id < Value2_Ptr->Id) + { + return( NDS_LOWER); + } + else + { + if( Value1_Ptr->Id > Value2_Ptr->Id) + { + return( NDS_GREATER); + } + else + { + return( NDS_EQUAL); + } + } + } + + case 1: + { + int rc; + + + rc=strcmp( Value1_Ptr->Name, Value2_Ptr->Name); + + if( rc <0) + { + return( NDS_LOWER); + } + else + { + if( rc > 0) + { + return( NDS_GREATER); + } + else + { + return( NDS_EQUAL); + } + } + } + + default: + { + return( NDS_KO); + } + } + + return( NDS_OK); + } + + case NDD_CMD_VALUE_ADD: + { + /* + void *Value_Ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + + Command_Name = "NDD_CMD_VALUE_ADD"; + + return( NDS_OK); + } + + case NDD_CMD_VALUE_REMOVE: + { + /* + void *Value_Ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + + Command_Name = "NDD_CMD_VALUE_REMOVE"; + + return( NDS_OK); + } + + case NDD_CMD_VALUE_PRINT: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + va_list user_args = (va_list)va_arg( lib_args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + void *Value_Ptr = Node_Ptr->Value; + */ + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + + IMRT_Appl *Value_Ptr = Node_Ptr->Value; + + + Command_Name = "NDD_CMD_VALUE_PRINT"; + + fprintf( Out, "Name: (%s) \n", Value_Ptr->Name); + return( NDS_OK); + + } + + case NDD_CMD_INFO_PRINT: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + va_list user_args = (va_list)va_arg( lib_args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + void *Value_Ptr = Node_Ptr->Value; + */ + + Command_Name = "NDD_CMD_INFO_PRINT"; + + return( NDS_OK); + } + + case IMRD_SDMD_CMD_API_SQL_DUMP: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + + void *Value_Ptr = Node_Ptr->Value; + */ + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list user_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( user_args, FILE *); + + IMRT_Appl *Appl_Ptr = Node_Ptr->Value; + + + Command_Name = "IMRD_SDMD_CMD_API_SQL_DUMP"; + + fprintf( Out, "INSERT INTO IMR_APPLI(APPLI_ID, APPLI_NAME) VALUES(%d, '%s');\n", + Appl_Ptr->Id, Appl_Ptr->Name); + + return( NDS_OK); + } + + case IMRD_SDMD_CMD_API_XML_DUMP: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + + void *Value_Ptr = Node_Ptr->Value; + */ + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list user_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( user_args, FILE *); + + IMRT_Appl *Appl_Ptr = Node_Ptr->Value; + + + Command_Name = "IMRD_SDMD_CMD_API_XML_DUMP"; + + fprintf( Out, "\t<%s>\n", IMRD_SDMD_TAG_APPLI); + + fprintf( Out, "\t\t<%s>%s\n", + IMRD_SDMD_TAG_NAME, Appl_Ptr->Name, IMRD_SDMD_TAG_NAME); + + fprintf( Out, "\t\n", IMRD_SDMD_TAG_APPLI); + + return( NDS_OK); + } + + default: + { + IMRD_LM_LOG_ERROR_1( "SDM_Appl_Manager() called with an undefined command %d\n", Command); + return NDS_ERRAPI; + } + } + + + return NDS_OK; +} + + + + +/*----------------------------------------------------------------------------*/ +/* FmtAttr Manager */ +/*----------------------------------------------------------------------------*/ + +NDT_Status SDM_FmtAttr_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node *Node_Ptr, NDT_Command Command, va_list Args) +{ + NDT_Command_Name Command_Name; + IMRT_Status status; + + + switch( Command) + { + case NDD_CMD_MANAGER_VERSION: + { + NDT_Version_Name *Version_Name_Ptr = (NDT_Version_Name *)va_arg( Args, NDT_Version_Name *); + + + Command_Name = "NDD_CMD_MANAGER_VERSION"; + *Version_Name_Ptr = "Revision: 2.1 Name: libnode-2_0_4-1 Date: 2002/02/28 22:00:35 Author: agibert "; + + return( NDS_OK); + } + + case NDD_CMD_INDEX_GET: + { + /* + NDT_Index_Id *Reply_Index_Id_Ptr = (NDT_Index_Id *)va_arg( Args, NDT_Index_Id *); + NDT_Command *Reply_Command_Ptr = (NDT_Command *)va_arg( Args, NDT_Command *); + NDT_Command Cmd = (NDT_Command)va_arg( Args, NDT_Command); + void *Value_ptr = (void *)va_arg( Args, void *); + */ + NDT_Index_Id *Reply_Index_Id_Ptr = (NDT_Index_Id *)va_arg( Args, NDT_Index_Id *); + NDT_Command *Reply_Command_Ptr = (NDT_Command *)va_arg( Args, NDT_Command *); + NDT_Command Cmd = (NDT_Command)va_arg( Args, NDT_Command); + IMRT_FmtAttr *Value_ptr = (IMRT_FmtAttr *)va_arg( Args, IMRT_FmtAttr *); + + + Command_Name = "NDD_CMD_INDEX_GET"; + + switch(Cmd) + { + case IMRD_SDMD_CMD_INDEX0_PRINT: + { + *Reply_Index_Id_Ptr = 0; + *Reply_Command_Ptr = NDD_CMD_VALUE_PRINT; + + break; + } + default: + { + *Reply_Index_Id_Ptr = Index_Id; + *Reply_Command_Ptr = Cmd; + + break; + } + } + + return( NDS_OK); + } + + case NDD_CMD_VALUE_ALLOC: + { + /* + void **Value_Ptr_Ptr = (void **)va_arg( Args, void **); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + IMRT_FmtAttr **Value_Ptr_Ptr = va_arg( Args, IMRT_FmtAttr **); + + + Command_Name = "NDD_CMD_VALUE_ALLOC"; + + if( ( *Value_Ptr_Ptr = (IMRT_FmtAttr *)malloc( sizeof(IMRT_FmtAttr))) == NULL) + { + return( NDS_ERRMEM); + } + else + { + SDM_InitFmtAttr(*Value_Ptr_Ptr); + return( NDS_OK); + } + } + + case NDD_CMD_VALUE_FREE: + { + /* + void *Value_Ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + IMRT_FmtAttr *Value_Ptr = (IMRT_FmtAttr *)va_arg( Args, IMRT_FmtAttr *); + Command_Name = "NDD_CMD_VALUE_FREE"; + + free( Value_Ptr); + + return( NDS_OK); + } + + case NDD_CMD_VALUE_COMP: + { + /* + void *Value1_Ptr = (void *)va_arg( Args, void *); + void *Value2_Ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + IMRT_FmtAttr *Value1_Ptr = va_arg( Args, IMRT_FmtAttr *); + IMRT_FmtAttr *Value2_Ptr = va_arg( Args, IMRT_FmtAttr *); + + + Command_Name = "NDD_CMD_VALUE_COMP"; + + switch( Index_Id) + { + case 0: + { + if( Value1_Ptr->Id < Value2_Ptr->Id) + { + return( NDS_LOWER); + } + else + { + if( Value1_Ptr->Id > Value2_Ptr->Id) + { + return( NDS_GREATER); + } + else + { + return( NDS_EQUAL); + } + } + } + + case 1: + { + int rc; + + + rc=strcmp( Value1_Ptr->Name, Value2_Ptr->Name); + + if( rc <0) + { + return( NDS_LOWER); + } + else + { + if( rc > 0) + { + return( NDS_GREATER); + } + else + { + return( NDS_EQUAL); + } + } + } + + default: + { + IMRD_LM_LOG_ERROR_1( "SDM_FmtAttr_Manager Unknown COMP idx (%d) !\n", Index_Id); + + return( NDS_KO); + } + } + + return( NDS_OK); + } + + case NDD_CMD_VALUE_ADD: + { + /* + void *Value_Ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + + Command_Name = "NDD_CMD_VALUE_ADD"; + + return( NDS_OK); + } + + case NDD_CMD_VALUE_REMOVE: + { + /* + void *Value_Ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + + Command_Name = "NDD_CMD_VALUE_REMOVE"; + + return( NDS_OK); + } + + case NDD_CMD_VALUE_PRINT: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + va_list user_args = (va_list)va_arg( lib_args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + void *Value_Ptr = Node_Ptr->Value; + */ + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + + IMRT_FmtAttr *FmtAttr_Ptr = Node_Ptr->Value; + + + Command_Name = "NDD_CMD_VALUE_PRINT"; + + fprintf( Out, "Id: (%d) Name: (%s) Value: (%s) \n", FmtAttr_Ptr->Id, FmtAttr_Ptr->Name, FmtAttr_Ptr->Value); + return( NDS_OK); + + } + + case NDD_CMD_INFO_PRINT: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + va_list user_args = (va_list)va_arg( lib_args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + void *Value_Ptr = Node_Ptr->Value; + */ + + Command_Name = "NDD_CMD_INFO_PRINT"; + + return( NDS_OK); + } + + case IMRD_SDMD_CMD_API_SQL_DUMP: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + + void *Value_Ptr = Node_Ptr->Value; + */ + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list user_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( user_args, FILE *); + IMRT_FmtAttr *FmtAttr_Ptr = Node_Ptr->Value; + + char * FmtAttr_Value_convert_Ptr; + + Command_Name = "IMRD_SDMD_CMD_API_SQL_DUMP"; + + FmtAttr_Value_convert_Ptr = (char *) malloc(IMRD_FMTATTR_VALUE_SIZE); + status = SDM_ConvertAttributeInv(FmtAttr_Ptr->Value, FmtAttr_Value_convert_Ptr); + fprintf( Out, "INSERT INTO IMR_FMT_ATTR(FMTATTR_ID, FMTATTR_NAME, FMTATTR_VALUE) VALUES(%d, '%s', '%s');\n", + FmtAttr_Ptr->Id, FmtAttr_Ptr->Name, FmtAttr_Value_convert_Ptr); + free(FmtAttr_Value_convert_Ptr); + + return( NDS_OK); + } + + case IMRD_SDMD_CMD_API_XML_DUMP: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + + void *Value_Ptr = Node_Ptr->Value; + */ + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list user_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( user_args, FILE *); + IMRT_FmtAttr *FmtAttr_Ptr = Node_Ptr->Value; + + char * FmtAttr_Value_convert_Ptr; + + Command_Name = "IMRD_SDMD_CMD_API_XML_DUMP"; + + fprintf( Out, "\t<%s>\n", IMRD_SDMD_TAG_FMTATTR); + + fprintf( Out, "\t\t<%s>%s\n", + IMRD_SDMD_TAG_NAME, FmtAttr_Ptr->Name, IMRD_SDMD_TAG_NAME); + + FmtAttr_Value_convert_Ptr = (char *) malloc(IMRD_FMTATTR_VALUE_SIZE); + status = SDM_ConvertAttributeInv(FmtAttr_Ptr->Value, FmtAttr_Value_convert_Ptr); + fprintf( Out, "\t\t<%s>%s\n", + IMRD_SDMD_TAG_VALUE, FmtAttr_Value_convert_Ptr, IMRD_SDMD_TAG_VALUE); + + fprintf( Out, "\t\n", IMRD_SDMD_TAG_FMTATTR); + free(FmtAttr_Value_convert_Ptr); + + return( NDS_OK); + } + + default: + { + IMRD_LM_LOG_ERROR_1( "SDM_FmtAttr_Manager() called with an undefined command %d\n", Command); + return NDS_ERRAPI; + } + } + + + return NDS_OK; +} + + + + +/*----------------------------------------------------------------------------*/ +/* FmtMsg Manager */ +/*----------------------------------------------------------------------------*/ + +NDT_Status SDM_FmtMsg_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node *Node_Ptr, NDT_Command Command, va_list Args) +{ + NDT_Command_Name Command_Name; + NDT_Status status; + IMRT_Status statuscb; + /*static short Num_Ordre=0;*/ + + + switch( Command) + { + case NDD_CMD_MANAGER_VERSION: + { + NDT_Version_Name *Version_Name_Ptr = (NDT_Version_Name *)va_arg( Args, NDT_Version_Name *); + + Command_Name = "NDD_CMD_MANAGER_VERSION"; + *Version_Name_Ptr = "Revision: 2.1 Name: libnode-2_0_4-1 Date: 2002/02/28 22:00:35 Author: agibert "; + + return( NDS_OK); + } + + case NDD_CMD_INDEX_GET: + { + /* + NDT_Index_Id *Reply_Index_Id_Ptr = (NDT_Index_Id *)va_arg( Args, NDT_Index_Id *); + NDT_Command *Reply_Command_Ptr = (NDT_Command *)va_arg( Args, NDT_Command *); + NDT_Command Cmd = (NDT_Command)va_arg( Args, NDT_Command); + void *Value_ptr = (void *)va_arg( Args, void *); + */ + NDT_Index_Id *Reply_Index_Id_Ptr = (NDT_Index_Id *)va_arg( Args, NDT_Index_Id *); + NDT_Command *Reply_Command_Ptr = (NDT_Command *)va_arg( Args, NDT_Command *); + NDT_Command Cmd = (NDT_Command)va_arg( Args, NDT_Command); + IMRT_FmtMsg * Value_ptr = (IMRT_FmtMsg *)va_arg( Args, IMRT_FmtMsg *); + + + Command_Name = "NDD_CMD_INDEX_GET"; + + switch(Cmd) + { + case IMRD_SDMD_CMD_INDEX0_PRINT: + { + *Reply_Index_Id_Ptr = 0; + *Reply_Command_Ptr = NDD_CMD_VALUE_PRINT; + + break; + } + + case IMRD_SDMD_CMD_EXECUTE: + { + *Reply_Index_Id_Ptr = 0; + *Reply_Command_Ptr = NDD_CMD_EXECUTE; + + break; + } + + default: + { + *Reply_Index_Id_Ptr = Index_Id; + *Reply_Command_Ptr = Cmd; + + break; + } + } + + return( NDS_OK); + } + + case NDD_CMD_VALUE_ALLOC: + { + /* + void **Value_Ptr_Ptr = (void **)va_arg( Args, void **); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + IMRT_FmtMsg **Value_Ptr_Ptr = va_arg( Args, IMRT_FmtMsg **); + + + Command_Name = "NDD_CMD_VALUE_ALLOC"; + + if( ( *Value_Ptr_Ptr = (IMRT_FmtMsg *)malloc( sizeof(IMRT_FmtMsg))) == NULL) + { + return( NDS_ERRMEM); + } + else + { + SDM_InitFmtMsg(*Value_Ptr_Ptr); + + return( NDS_OK); + } + + } + + case NDD_CMD_VALUE_FREE: + { + /* + void *Value_Ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + + /*IMRT_Fmt *Value_Ptr = (IMRT_Fmt *)va_arg( Args, IMRT_Fmt *); + + + Command_Name = "NDD_CMD_VALUE_FREE"; + + free( Value_Ptr->FmtAttr_Ptr); + free( Value_Ptr);*/ + + + IMRT_FmtMsg *Value_Ptr = (IMRT_FmtMsg *)va_arg( Args, IMRT_FmtMsg *); + + Command_Name = "NDD_CMD_VALUE_FREE"; + + free( Value_Ptr); + + return( NDS_OK); + + } + + case NDD_CMD_VALUE_COMP: + { + /* + void *Value1_Ptr = (void *)va_arg( Args, void *); + void *Value2_Ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + IMRT_Msg * Value1_Ptr = (IMRT_Msg *)va_arg( Args, NDT_Node *); + IMRT_Msg * Value2_Ptr = (IMRT_Msg *)va_arg( Args, NDT_Node *); + + + Command_Name = "NDD_CMD_VALUE_COMP"; + + switch( Index_Id) + { + case 0: + { + int rc; + + + rc = strcmp( Value1_Ptr->Name, Value1_Ptr->Name); + + if( rc < 0) + { + return( NDS_LOWER); + } + else + { + if( rc > 0) + { + return( NDS_GREATER); + } + else + { + return( NDS_EQUAL); + } + } + } + + default: + { + IMRD_LM_LOG_ERROR_1("SDM_FmtMsg_Manager Unknown COMP idx (%d) !\n", Index_Id); + + return( NDS_KO); + } + } + + return( NDS_OK); + } + + case NDD_CMD_VALUE_ADD: + { + /* + void *Value_Ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + + Command_Name = "NDD_CMD_VALUE_ADD"; + + return( NDS_OK); + } + + case NDD_CMD_VALUE_REMOVE: + { + /* + void *Value_Ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + + Command_Name = "NDD_CMD_VALUE_REMOVE"; + + return( NDS_OK); + } + + case NDD_CMD_VALUE_PRINT: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + va_list user_args = (va_list)va_arg( lib_args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + void *Value_Ptr = Node_Ptr->Value; + */ + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + IMRT_FmtMsg *Value_Ptr = Node_Ptr->Value; + + + Command_Name = "NDD_CMD_VALUE_PRINT"; + + fprintf( Out, "\tFmtMsg - Msg Name: (%s) Branche Id: (%d) Attribute: (%s)\n", Value_Ptr->Msg_Ptr->Name, Value_Ptr->Branche_Id, Value_Ptr->FmtAttr_Ptr->Value); + + return( NDS_OK); + } + + case NDD_CMD_INFO_PRINT: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + va_list user_args = (va_list)va_arg( lib_args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + void *Value_Ptr = Node_Ptr->Value; + */ + Command_Name = "NDD_CMD_INFO_PRINT"; + + return( NDS_OK); + } + case NDD_CMD_EXECUTE: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + va_list user_args = (va_list)va_arg( lib_args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + void *Value_Ptr = Node_Ptr->Value; + */ + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + va_list user_args = (va_list)va_arg( Args, va_list); + IMRT_SDM_IdentMessage * IdentStruct_Ptr = (IMRT_SDM_IdentMessage *)va_arg(lib_args,IMRT_SDM_IdentMessage *); + + IMRT_FmtMsg *FmtMsg_Ptr = (IMRT_FmtMsg *)Node_Ptr->Value; + IMRT_Msg *Msg_Ptr = (IMRT_Msg *)FmtMsg_Ptr->Msg_Ptr; + + Command_Name = "NDD_CMD_EXECUTE"; + status = NDS_OK; + statuscb = IMRS_OK; + + if (IdentStruct_Ptr->Mode == IMRD_SKIP_MODE) + { + if (IdentStruct_Ptr->Id == Msg_Ptr->Id) + { + IdentStruct_Ptr->Mode = IMRD_NORMALE_MODE; + IdentStruct_Ptr->Branche_Id = FmtMsg_Ptr->Branche_Id; + } + } + else + { + if (FmtMsg_Ptr->Branche_Id == IdentStruct_Ptr->Branche_Id) + { + if(Msg_Ptr->Size != 0 ) + { + statuscb = IdentStruct_Ptr->Ident_Msg_SizeFunc_Ptr(Msg_Ptr->Size); + } + + if(statuscb == IMRS_OK) + { + status = ND_DataStruct_Traverse( Msg_Ptr->Field_Struct_Ptr, IMRD_SDMD_CMD_EXECUTE, stdout, NDD_RECURSIVE_MODE_PARENT, IdentStruct_Ptr); + + if(status == NDS_OK) + { + strcpy( IdentStruct_Ptr->Type, Msg_Ptr->Name); + IdentStruct_Ptr->Id = Msg_Ptr->Id; + status = NDS_IDENT_OK; + } + else if(status == NDS_KO) + { + status = NDS_KO; + } + else + { + status = NDS_OK; + } + } + else if(statuscb == IMRS_NO_IDENT) + { + status = NDS_OK; + } + else + { + status = NDS_KO; + } + } + else + { + status = NDS_NO_IDENT; + } + } + + return (status); + } + + case IMRD_SDMD_CMD_CHECK_FMT_ATTR: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + + void *Value_Ptr = Node_Ptr->Value; + */ + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list user_args = (va_list)va_arg( Args, va_list); + /*FILE *Out = (FILE *)va_arg( user_args, FILE *);*/ + IMRT_Msg *Msg_Ptr = (IMRT_Msg *)va_arg( user_args, IMRT_Msg *); + IMRT_FmtAttr *FmtAttr_Ptr = (IMRT_FmtAttr *)va_arg( user_args, IMRT_FmtAttr *); + + IMRT_FmtMsg *FmtMsg_Ptr = Node_Ptr->Value; + + Command_Name = "IMRD_SDMD_CMD_CHECK_FMT_ATTR"; + + if((FmtMsg_Ptr->Msg_Ptr == Msg_Ptr) && + (FmtMsg_Ptr->FmtAttr_Ptr == FmtAttr_Ptr)) + { + return( NDS_NODE_FOUND); + } + return( NDS_OK); + } + + case IMRD_SDMD_CMD_API_SQL_DUMP: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + + void *Value_Ptr = Node_Ptr->Value; + */ + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list user_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( user_args, FILE *); + IMRT_Fmt_Id Fmt_Id = (IMRT_Fmt_Id)va_arg( user_args, IMRT_Fmt_Id); + short *Num_Ordre = (short *)va_arg( user_args, short *); + + IMRT_FmtMsg *FmtMsg_Ptr = Node_Ptr->Value; + IMRT_FmtAttr_Id FmtAttr_Id; + + + Command_Name = "IMRD_SDMD_CMD_API_SQL_DUMP"; + + *Num_Ordre += 1; + if (FmtMsg_Ptr->FmtAttr_Ptr == NULL) + { + FmtAttr_Id = IMRD_FMTATTR_ID_UNKNOWN; + } + else + { + FmtAttr_Id = FmtMsg_Ptr->FmtAttr_Ptr->Id; + } + + fprintf( Out, "INSERT INTO IMR_FMT_MSG(MSG_ID, FORMAT_ID, FMTATTR_Id, NUM_ORDRE_FMT_MSG, FMTMSG_BRANCHE_ID) VALUES(%d, %d, %d, %d, %d);\n", + FmtMsg_Ptr->Msg_Ptr->Id, Fmt_Id, FmtAttr_Id, *Num_Ordre, FmtMsg_Ptr->Branche_Id); + + return( NDS_OK); + } + + case IMRD_SDMD_CMD_API_XML_DUMP: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + + void *Value_Ptr = Node_Ptr->Value; + */ + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list user_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( user_args, FILE *); + + IMRT_FmtMsg *FmtMsg_Ptr = Node_Ptr->Value; + + Command_Name = "IMRD_SDMD_CMD_API_XML_DUMP"; + + fprintf( Out, "\t\t<%s>\n", IMRD_SDMD_TAG_FMTMSG); + + fprintf( Out, "\t\t\t<%s>%s\n", + IMRD_SDMD_TAG_NAME, FmtMsg_Ptr->Msg_Ptr->Name, IMRD_SDMD_TAG_NAME); + + fprintf( Out, "\t\t\t<%s>%d\n", + IMRD_SDMD_TAG_BRANCHE_ID, FmtMsg_Ptr->Branche_Id, IMRD_SDMD_TAG_BRANCHE_ID); + + if (FmtMsg_Ptr->FmtAttr_Ptr != NULL) + { + if (strcmp(FmtMsg_Ptr->FmtAttr_Ptr->Name, IMRD_FMTATTR_NAME_UNKNOWN) != 0) + { + fprintf( Out, "\t\t\t<%s>%s\n", + IMRD_SDMD_TAG_FMTATTR_NAME, FmtMsg_Ptr->FmtAttr_Ptr->Name, IMRD_SDMD_TAG_FMTATTR_NAME); + } + } + + + fprintf( Out, "\t\t\n", IMRD_SDMD_TAG_FMTMSG); + + return( NDS_OK); + } + + default: + { + IMRD_LM_LOG_ERROR_1("SDM_FmtMsg_Manager() called with an undefined command %d\n", Command); + + return( NDS_ERRAPI); + } + } + return( NDS_OK); +} + + + + + +/*----------------------------------------------------------------------------*/ +/* Fmt Manager */ +/*----------------------------------------------------------------------------*/ + +NDT_Status SDM_Fmt_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node *Node_Ptr, NDT_Command Command, va_list Args) +{ + NDT_Command_Name Command_Name; + NDT_Status status; + IMRT_Status imr_status; + + + switch( Command) + { + case NDD_CMD_MANAGER_VERSION: + { + NDT_Version_Name *Version_Name_Ptr = (NDT_Version_Name *)va_arg( Args, NDT_Version_Name *); + + + Command_Name = "NDD_CMD_MANAGER_VERSION"; + + *Version_Name_Ptr = "Revision: 2.1 Name: libnode-2_0_4-1 Date: 2002/02/28 22:00:35 Author: agibert "; + + return( NDS_OK); + } + + case NDD_CMD_INDEX_GET: + { + /* + NDT_Index_Id *Reply_Index_Id_Ptr = (NDT_Index_Id *)va_arg( Args, NDT_Index_Id *); + NDT_Command *Reply_Command_Ptr = (NDT_Command *)va_arg( Args, NDT_Command *); + NDT_Command Cmd = (NDT_Command)va_arg( Args, NDT_Command); + void *Value_ptr = (void *)va_arg( Args, void *); + */ + NDT_Index_Id *Reply_Index_Id_Ptr = (NDT_Index_Id *)va_arg( Args, NDT_Index_Id *); + NDT_Command *Reply_Command_Ptr = (NDT_Command *)va_arg( Args, NDT_Command *); + NDT_Command Cmd = (NDT_Command)va_arg( Args, NDT_Command); + IMRT_Fmt * Value_ptr = (IMRT_Fmt *)va_arg( Args, IMRT_Fmt *); + + + Command_Name = "NDD_CMD_INDEX_GET"; + + switch(Cmd) + { + case IMRD_SDMD_CMD_INDEX0_PRINT: + { + *Reply_Index_Id_Ptr = 0; + *Reply_Command_Ptr = NDD_CMD_VALUE_PRINT; + + break; + } + + default: + { + *Reply_Index_Id_Ptr = Index_Id; + *Reply_Command_Ptr = Cmd; + + break; + } + } + + return( NDS_OK); + } + + case NDD_CMD_VALUE_ALLOC: + { + /* + void **Value_Ptr_Ptr = (void **)va_arg( Args, void **); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + IMRT_Fmt **Value_Ptr_Ptr = va_arg( Args, IMRT_Fmt **); + + + Command_Name = "NDD_CMD_VALUE_ALLOC"; + + if( ( *Value_Ptr_Ptr = (IMRT_Fmt *)malloc( sizeof(IMRT_Fmt))) == NULL) + { + return( NDS_ERRMEM); + } + else + { + SDM_InitFormat(*Value_Ptr_Ptr); + + if( ( status = ND_DataStruct_Open( &((*Value_Ptr_Ptr)->FmtMsg_Struct_Ptr), IMRD_SDMD_INDEX_NB, index_type_initial_tab, "SDM_FmtMsg_Manager", SDM_FmtMsg_Manager, NULL, NULL, NULL, NULL,0, NULL)) != NDS_OK) + { + IMRD_LM_LOG_ERROR_1( "ND_DataStruct_Open() Format failed (%d) !\n", status); + } + return( NDS_OK); + } + } + + case NDD_CMD_VALUE_FREE: + { + /* + void *Value_Ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + IMRT_Fmt *Value_Ptr = (IMRT_Fmt *)va_arg( Args, IMRT_Fmt *); + + + Command_Name = "NDD_CMD_VALUE_FREE"; + + if( ( status = ND_DataStruct_Close( Value_Ptr->FmtMsg_Struct_Ptr)) != NDS_OK) + { + IMRD_LM_LOG_ERROR_1( "ND_DataStruct_Close() Format failed (%d) !\n", status); + return( status); + } + free( Value_Ptr); + + return( NDS_OK); + } + + case NDD_CMD_VALUE_COMP: + { + /* + void *Value1_Ptr = (void *)va_arg( Args, void *); + void *Value2_Ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + IMRT_Fmt *Value1_Ptr = va_arg( Args, IMRT_Fmt *); + IMRT_Fmt *Value2_Ptr = va_arg( Args, IMRT_Fmt *); + + + Command_Name = "NDD_CMD_VALUE_COMP"; + + switch( Index_Id) + { + + case 0: + { + if( Value1_Ptr->Id < Value2_Ptr->Id) + { + return( NDS_LOWER); + } + else + { + if( Value1_Ptr->Id > Value2_Ptr->Id) + { + return( NDS_GREATER); + } + else + { + return( NDS_EQUAL); + } + } + } + + case 1: + { + int rc; + + + rc=strcmp( Value1_Ptr->Name, Value2_Ptr->Name); + + if( rc <0) + { + return( NDS_LOWER); + } + else + { + if( rc > 0) + { + return( NDS_GREATER); + } + else + { + return( NDS_EQUAL); + } + } + } + + default: + { + IMRD_LM_LOG_ERROR_1( "Unknown COMP idx (%d) !\n", Index_Id); + + return( NDS_KO); + } + } + + return( NDS_OK); + } + + case NDD_CMD_VALUE_ADD: + { + /* + void *Value_Ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + Command_Name = "NDD_CMD_VALUE_ADD"; + + return( NDS_OK); + } + + case NDD_CMD_VALUE_REMOVE: + { + /* + void *Value_Ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + Command_Name = "NDD_CMD_VALUE_REMOVE"; + + return( NDS_OK); + } + + case NDD_CMD_VALUE_PRINT: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + NDT_Recursive_Offset Recursive_Offset = (NDT_Recursive_Offset)va_arg( lib_args, NDT_Recursive_Offset); + va_list user_args = (va_list)va_arg( lib_args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + void *Value_Ptr = Node_Ptr->Value; + */ + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + NDT_Recursive_Offset Recursive_Offset = (NDT_Recursive_Offset)va_arg( lib_args, NDT_Recursive_Offset); + + IMRT_Fmt *Value_Ptr = Node_Ptr->Value; + + + Command_Name = "NDD_CMD_VALUE_PRINT"; + + fprintf( Out, "Format - Name: (%s) \n",Value_Ptr->Name); + + return( ND_DataStruct_Value_Print( Out, Value_Ptr->FmtMsg_Struct_Ptr, NDD_RECURSIVE_MODE_PARENT_CHILD, --Recursive_Depth, ++Recursive_Offset)); + } + + case NDD_CMD_INFO_PRINT: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + va_list user_args = (va_list)va_arg( lib_args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + void *Value_Ptr = Node_Ptr->Value; + */ + + Command_Name = "NDD_CMD_INFO_PRINT"; + + return( NDS_OK); + } + + case IMRD_SDMD_CMD_EXECUTE: + { /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + NDT_Recursive_Offset Recursive_Offset = (NDT_Recursive_Offset)va_arg( lib_args, NDT_Recursive_Offset); + va_list user_args = (va_list)va_arg( lib_args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + void *Value_Ptr = Node_Ptr->Value; + */ + IMRT_Fmt * Value_Ptr = (IMRT_Fmt*)Node_Ptr->Value; + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + IMRT_SDMCB_Fmt_Add * FmtProceedFunc = ( IMRT_SDMCB_Fmt_Add *)va_arg(lib_args, IMRT_SDMCB_Fmt_Add *); + + imr_status = FmtProceedFunc(Value_Ptr->Id, Value_Ptr->Name, IMRG_SDM_Base.RootFmt->Index_Tab[NDD_INDEX_PRIMARY].Node_Number); + if(imr_status == IMRS_OK) + { + status = NDS_OK; + } + else + { + status = NDS_KO; + } + + return(status); + } + + case IMRD_SDMD_CMD_API_SQL_DUMP: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + + void *Value_Ptr = Node_Ptr->Value; + */ + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list user_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( user_args, FILE *); + + IMRT_Fmt *Fmt_Ptr = Node_Ptr->Value; + short Num_Ordre=0; + + Command_Name = "IMRD_SDMD_CMD_API_SQL_DUMP"; + + fprintf( Out, "INSERT INTO IMR_FORMAT(FORMAT_ID, FORMAT_NAME) VALUES(%d, '%s');\n", + Fmt_Ptr->Id, Fmt_Ptr->Name); + + if( ( status = ND_DataStruct_Traverse( Fmt_Ptr->FmtMsg_Struct_Ptr, IMRD_SDMD_CMD_API_SQL_DUMP, Out, Fmt_Ptr->Id, &Num_Ordre)) != NDS_OK) + { + IMRD_LM_LOG_ERROR_1( "ND_DataStruct_Traverse failed (%d)...\n",status); + return(NDS_KO); + } + + return( NDS_OK); + } + + case IMRD_SDMD_CMD_API_XML_DUMP: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + + void *Value_Ptr = Node_Ptr->Value; + */ + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list user_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( user_args, FILE *); + + IMRT_Fmt *Fmt_Ptr = Node_Ptr->Value; + + + Command_Name = "IMRD_SDMD_CMD_API_XML_DUMP"; + + fprintf( Out, "\t<%s>\n", IMRD_SDMD_TAG_FORMAT); + + fprintf( Out, "\t\t<%s>%s\n", + IMRD_SDMD_TAG_NAME, Fmt_Ptr->Name, IMRD_SDMD_TAG_NAME); + + if( ( status = ND_DataStruct_Traverse( Fmt_Ptr->FmtMsg_Struct_Ptr, IMRD_SDMD_CMD_API_XML_DUMP, Out)) != NDS_OK) + { + IMRD_LM_LOG_ERROR_1( "ND_DataStruct_Traverse failed (%d)...\n",status); + return(NDS_KO); + } + + fprintf( Out, "\t\n", IMRD_SDMD_TAG_FORMAT); + + return( NDS_OK); + } + + default: + { + IMRD_LM_LOG_ERROR_1( "SDM_Fmt_Manager() called with an undefined command %d\n", Command); + + return( NDS_ERRAPI); + } + } + + + + return( NDS_OK); +} + + + + + +/*----------------------------------------------------------------------------*/ +/* MapCmd Manager */ +/*----------------------------------------------------------------------------*/ + +NDT_Status SDM_MapCmd_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node *Node_Ptr, NDT_Command Command, va_list Args) +{ + NDT_Command_Name Command_Name; + SDMT_CritereRecChemin * Recherche = NULL; + IMRT_Status statusTmp; + char functioname[] = "SDM_MapCmd_Manager"; + int i; + + + + + switch( Command) + { + case NDD_CMD_MANAGER_VERSION: + { + NDT_Version_Name *Version_Name_Ptr = (NDT_Version_Name *)va_arg( Args, NDT_Version_Name *); + + + Command_Name = "NDD_CMD_MANAGER_VERSION"; + + *Version_Name_Ptr = "Revision: 2.1 Name: libnode-2_0_4-1 Date: 2002/02/28 22:00:35 Author: agibert "; + + return( NDS_OK); + } + + case NDD_CMD_INDEX_GET: + { + /* + NDT_Index_Id *Reply_Index_Id_Ptr = (NDT_Index_Id *)va_arg( Args, NDT_Index_Id *); + NDT_Command *Reply_Command_Ptr = (NDT_Command *)va_arg( Args, NDT_Command *); + NDT_Command Cmd = (NDT_Command)va_arg( Args, NDT_Command); + void *Value_ptr = (void *)va_arg( Args, void *); + */ + NDT_Index_Id *Reply_Index_Id_Ptr = (NDT_Index_Id *)va_arg( Args, NDT_Index_Id *); + NDT_Command *Reply_Command_Ptr = (NDT_Command *)va_arg( Args, NDT_Command *); + NDT_Command Cmd = (NDT_Command)va_arg( Args, NDT_Command); + IMRT_MapCmd * Value_ptr = (IMRT_MapCmd *)va_arg( Args, IMRT_MapCmd *); + + Command_Name = "NDD_CMD_INDEX_GET"; + + switch(Cmd) + { + case IMRD_SDMD_CMD_INDEX0_PRINT: + { + *Reply_Index_Id_Ptr = 0; + *Reply_Command_Ptr = NDD_CMD_VALUE_PRINT; + break; + } + + case IMRD_SDMD_CMD_EXECUTE: + { + *Reply_Index_Id_Ptr = 0; + *Reply_Command_Ptr = NDD_CMD_EXECUTE; + break; + } + + default: + { + *Reply_Index_Id_Ptr = Index_Id; + *Reply_Command_Ptr = Cmd; + break; + } + } + return( NDS_OK); + } + + case NDD_CMD_VALUE_ALLOC: + { + /* + void **Value_Ptr_Ptr = (void **)va_arg( Args, void **); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + IMRT_MapCmd **Value_Ptr_Ptr = va_arg( Args, IMRT_MapCmd **); + + Command_Name = "NDD_CMD_VALUE_ALLOC"; + + if( ( *Value_Ptr_Ptr = (IMRT_MapCmd *)malloc( sizeof(IMRT_MapCmd))) == NULL) + { + return( NDS_ERRMEM); + } + else + { + SDM_InitMapCmd( *Value_Ptr_Ptr); + return( NDS_OK); + } + } + + case NDD_CMD_VALUE_FREE: + { + /* + void *Value_Ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + IMRT_MapCmd *Value_Ptr = (IMRT_MapCmd *)va_arg( Args, IMRT_MapCmd *); + + Command_Name = "NDD_CMD_VALUE_FREE"; + + free(Value_Ptr->Jump_Tab); + free( Value_Ptr); + + return( NDS_OK); + } + + case NDD_CMD_VALUE_COMP: + { + /* + void *Value1_Ptr = (void *)va_arg( Args, void *); + void *Value2_Ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + IMRT_MapCmd *Value1_Ptr = va_arg( Args, IMRT_MapCmd *); + IMRT_MapCmd *Value2_Ptr = va_arg( Args, IMRT_MapCmd *); + + + Command_Name = "NDD_CMD_VALUE_COMP"; + + switch( Index_Id) + { + case 0: + { + if( Value1_Ptr->MapCmd_IdMapCmd_Id) + { + return( NDS_LOWER); + } + else + { + if( Value1_Ptr->MapCmd_Id > Value2_Ptr->MapCmd_Id) + { + return( NDS_GREATER); + } + else + { + return( NDS_EQUAL); + } + } + } + + default: + { + IMRD_LM_LOG_ERROR_1( "Unknown COMP idx (%d) !\n", Index_Id); + return( NDS_KO); + } + } + + return( NDS_OK); + } + + case NDD_CMD_VALUE_ADD: + { + /* + void *Value_Ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + + Command_Name = "NDD_CMD_VALUE_ADD"; + + return( NDS_OK); + } + + case NDD_CMD_VALUE_REMOVE: + { + /* + void *Value_Ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + Command_Name = "NDD_CMD_VALUE_REMOVE"; + + return( NDS_OK); + } + + case NDD_CMD_VALUE_PRINT: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + va_list user_args = (va_list)va_arg( lib_args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + void *Value_Ptr = Node_Ptr->Value; + */ + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + + IMRT_MapCmd *Value_Ptr = Node_Ptr->Value; + char Local_Ident_Total; + + Command_Name = "NDD_CMD_VALUE_PRINT"; + + if( Value_Ptr->TypeCmd == IMRD_MAPCMD_TYPE_MAP) + { + fprintf( Out,"type_commande (mapper)\n"); + } + else if( Value_Ptr->TypeCmd == IMRD_MAPCMD_TYPE_COPY) + { + fprintf( Out,"type_commande (copier)\n"); + } + else if( Value_Ptr->TypeCmd == IMRD_MAPCMD_TYPE_IDENT) + { + fprintf( Out,"type_commande (identifier)\n"); + } + else if( Value_Ptr->TypeCmd == IMRD_MAPCMD_TYPE_GOTO) + { + fprintf( Out,"type_commande (go_to)\n"); + } + + if (Value_Ptr->Ident_Total == IMRD_TRUE) + { + Local_Ident_Total = IMRD_YES; + } + else + { + Local_Ident_Total = IMRD_NO; + } + + fprintf( Out, "IdMapCmd: (%d) Ident_Total: (%c) InputFormat: (%s) InputFormat_Attr: (%s) OutputFormat: (%s) OutputFormat_Attr: (%s) \n Branche_id (%d) OutputBuffer: (%d) InputBuffer : (%d) MappingRule: (%s) NumBufferToIdent (%d) \n", + Value_Ptr->MapCmd_Id, Local_Ident_Total, Value_Ptr->Fmt_Input_Ptr->Name, Value_Ptr->FmtAttr_Input_Ptr->Value, + Value_Ptr->Fmt_Output_Ptr->Name,Value_Ptr->FmtAttr_Output_Ptr->Value, Value_Ptr->Branche_Id, + Value_Ptr->Buffer_Id_Input,Value_Ptr->Buffer_Id_Output, + Value_Ptr->MsgMap_Ptr->Name , Value_Ptr->Buffer_Id_Ident); + + return( NDS_OK); + } + + case NDD_CMD_INFO_PRINT: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + va_list user_args = (va_list)va_arg( lib_args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + void *Value_Ptr = Node_Ptr->Value; + */ + + Command_Name = "NDD_CMD_INFO_PRINT"; + + return( NDS_OK); + } + + case NDD_CMD_EXECUTE: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + va_list user_args = (va_list)va_arg( lib_args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + void *Value_Ptr = Node_Ptr->Value; + */ + IMRT_MapCmd * Value_Ptr = (IMRT_MapCmd*)Node_Ptr->Value; + IMRT_Status statuscb; + int branche =-1; + IMRT_Fmt_Id Format; + NDT_Status status; + NDT_Node *node_ptr_input; + NDT_Node *node_ptr_output; + IMRT_Msg_Id BufferType; + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + va_list user_args = (va_list)va_arg( Args, va_list); + SDMT_CritereRecChemin *Recherche = (SDMT_CritereRecChemin *)va_arg(lib_args,SDMT_CritereRecChemin *); + IMRT_Mode_Traverse * Mode_Normal_Erreur_Ptr = (IMRT_Mode_Traverse *)va_arg(lib_args, IMRT_Mode_Traverse *); + + + Command_Name = "NDD_CMD_EXECUTE"; + statuscb = IMRS_OK; + + if(Value_Ptr->Branche_Id == Recherche->Branche_id) + { + switch(Value_Ptr->TypeCmd) + { + case IMRD_MAPCMD_TYPE_MAP: + { + statuscb = Recherche->CallBackBCommandeMap(Value_Ptr->Buffer_Id_Output , + Value_Ptr->Fmt_Output_Ptr->Id, + ( (Value_Ptr->FmtAttr_Output_Ptr == NULL) ? NULL : Value_Ptr->FmtAttr_Output_Ptr->Value), + Value_Ptr->Buffer_Id_Input, + Value_Ptr->Fmt_Input_Ptr->Id , + ( (Value_Ptr->FmtAttr_Input_Ptr == NULL) ? NULL : Value_Ptr->FmtAttr_Input_Ptr->Value), + Value_Ptr->MsgMap_Ptr , + Value_Ptr->Clear_Flag); + break; + } + + case IMRD_MAPCMD_TYPE_COPY: + { + statuscb = Recherche->CallBackCommandeCopy(Value_Ptr->Buffer_Id_Output, Value_Ptr->Buffer_Id_Input); + break; + } + + case IMRD_MAPCMD_TYPE_IDENT: + { + IMRT_Status found = IMRS_KO; + Format = IMRD_FMT_ID_UNKNOWN; + BufferType = Value_Ptr->Ident_First_Msg_Ptr->Id; + statuscb = Recherche->CallBackCommandeIdent(&Format, + &BufferType, + Value_Ptr->Buffer_Id_Ident, + Value_Ptr->Ident_Total); + if(statuscb == IMRS_OK) + { + for(i=0; iJmpTbleNbElts; i++) + { + if ((Format == Value_Ptr->Jump_Tab[i].Fmt_Ptr->Id) && + (BufferType == Value_Ptr->Jump_Tab[i].Msg_Ptr->Id)) + { + Recherche->Branche_id = Value_Ptr->Jump_Tab[i].Branche_Id; + found = IMRS_OK; + } + } + + if(found == IMRS_KO) + { + statuscb = IMRS_KO; + } + } + + break; + } + + case IMRD_MAPCMD_TYPE_GOTO: + { + Recherche->Branche_id = Value_Ptr->Goto_Branche_Id; + + break; + } + + default: + { + strcpy(Recherche->FataError.function,functioname); + Recherche->FataError.errorCode = SDMD_CODE_ERROR_7; + strcpy(Recherche->FataError.libError,SDMD_LIB_ERROR_7); + + return( NDS_KO); + } + } + + if (*Mode_Normal_Erreur_Ptr == IMRD_NORMALE_MODE) + { + if (statuscb != IMRS_OK) + { + *Mode_Normal_Erreur_Ptr = IMRD_ERREUR_MODE; + Recherche->Branche_id = IMRD_LATEST_BRANCHE; + } + } + } + + return( NDS_OK); + } + case IMRD_SDMD_CMD_API_SQL_DUMP: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + + void *Value_Ptr = Node_Ptr->Value; + */ + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list user_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( user_args, FILE *); + int MapPath_Id = (int)va_arg( user_args, int); + IMRT_MapCmd *MapCmd_Ptr = Node_Ptr->Value; + + + Command_Name = "IMRD_SDMD_CMD_API_SQL_DUMP"; + + fprintf( Out, "INSERT INTO IMR_MAPCMD(MAPCMD_ID, MAPCMD_TYPE, CURRENT_BRANCHE_ID) VALUES(%d, %d, %d);\n", + MapCmd_Ptr->MapCmd_Id, MapCmd_Ptr->TypeCmd, MapCmd_Ptr->Branche_Id); + + fprintf( Out, "INSERT INTO IMR_CMD_MAP_PATH(MAP_PATH_ID, MAPCMD_ID) VALUES(%d, %d);\n", + MapPath_Id, MapCmd_Ptr->MapCmd_Id); + + if(MapCmd_Ptr->TypeCmd == IMRD_MAPCMD_TYPE_IDENT) + { + if(MapCmd_Ptr->Ident_Total == IMRD_FALSE) + { + fprintf( Out, "INSERT INTO IMR_CMD_IDENT(MAPCMD_ID, IDENT_BUFFER_ID, IDENT_TOTAL, IDENT_FIRST_MSG_ID) VALUES(%d, %d, '%c', %d);\n", + MapCmd_Ptr->MapCmd_Id, MapCmd_Ptr->Buffer_Id_Ident, IMRD_NO, MapCmd_Ptr->Ident_First_Msg_Ptr->Id); + } + else + { + fprintf( Out, "INSERT INTO IMR_CMD_IDENT(MAPCMD_ID, IDENT_BUFFER_ID, IDENT_TOTAL, IDENT_FIRST_MSG_ID) VALUES(%d, %d, '%c', %d);\n", + MapCmd_Ptr->MapCmd_Id, MapCmd_Ptr->Buffer_Id_Ident, IMRD_YES, MapCmd_Ptr->Ident_First_Msg_Ptr->Id); + } + + for(i=0; iJmpTbleNbElts; i++) + { + fprintf( Out, "INSERT INTO IMR_JUMP_TABLE(MAPCMD_ID, MSG_ID, FORMAT_ID, NUM_ORDRE_JUMP, IDENT_BRANCHE_ID) VALUES(%d, %d, %d, %d, %d);\n", + MapCmd_Ptr->MapCmd_Id, MapCmd_Ptr->Jump_Tab[i].Msg_Ptr->Id, MapCmd_Ptr->Jump_Tab[i].Fmt_Ptr->Id, i, MapCmd_Ptr->Jump_Tab[i].Branche_Id); + } + + } + else if(MapCmd_Ptr->TypeCmd == IMRD_MAPCMD_TYPE_MAP) + { + fprintf( Out, "INSERT INTO IMR_CMD_MAP(MAPCMD_ID, FORMAT_IN_ID, FMTATTR_IN_ID, FORMAT_OUT_ID, FMTATTR_OUT_ID, MSG_MAP_ID, MAP_BUFFER_ID_INPUT, MAP_BUFFER_ID_OUTPUT, CLEAR_FLAG) VALUES(%d, %d, %d, %d, %d, %d, %d, %d, %d);\n", + MapCmd_Ptr->MapCmd_Id, MapCmd_Ptr->Fmt_Input_Ptr->Id, MapCmd_Ptr->FmtAttr_Input_Ptr->Id, MapCmd_Ptr->Fmt_Output_Ptr->Id, MapCmd_Ptr->FmtAttr_Output_Ptr->Id, + MapCmd_Ptr->MsgMap_Ptr->Id, MapCmd_Ptr->Buffer_Id_Input, MapCmd_Ptr->Buffer_Id_Output, MapCmd_Ptr->Clear_Flag); + } + else if(MapCmd_Ptr->TypeCmd == IMRD_MAPCMD_TYPE_COPY) + { + fprintf( Out, "INSERT INTO IMR_CMD_COPY(MAPCMD_ID, COPY_BUFFER_ID_INPUT, COPY_BUFFER_ID_OUTPUT) VALUES(%d, %d, %d);\n", + MapCmd_Ptr->MapCmd_Id, MapCmd_Ptr->Buffer_Id_Input, MapCmd_Ptr->Buffer_Id_Output); + } + else if(MapCmd_Ptr->TypeCmd == IMRD_MAPCMD_TYPE_GOTO) + { + fprintf( Out, "INSERT INTO IMR_CMD_GOTO(MAPCMD_ID, GOTO_BRANCHE_ID) VALUES(%d, %d);\n", + MapCmd_Ptr->MapCmd_Id, MapCmd_Ptr->Goto_Branche_Id); + } + + + return( NDS_OK); + } + + case IMRD_SDMD_CMD_API_XML_DUMP: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + + void *Value_Ptr = Node_Ptr->Value; + */ + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list user_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( user_args, FILE *); + + IMRT_MapCmd *MapCmd_Ptr = Node_Ptr->Value; + + + Command_Name = "IMRD_SDMD_CMD_API_XML_DUMP"; + + fprintf( Out, "\t\t\t<%s>\n", IMRD_SDMD_TAG_MAPCMD); + + fprintf( Out, "\t\t\t\t<%s>%d\n", + IMRD_SDMD_TAG_BRANCHE_ID, MapCmd_Ptr->Branche_Id, IMRD_SDMD_TAG_BRANCHE_ID); + + if(MapCmd_Ptr->TypeCmd == IMRD_MAPCMD_TYPE_IDENT) + { + fprintf( Out, "\t\t\t\t<%s>\n", IMRD_SDMD_TAG_IDENTIFIER); + + fprintf( Out, "\t\t\t\t\t<%s>%d\n", + IMRD_SDMD_TAG_NUMBUFFER, MapCmd_Ptr->Buffer_Id_Ident, IMRD_SDMD_TAG_NUMBUFFER); + + if(MapCmd_Ptr->Ident_Total == IMRD_FALSE) + { + fprintf( Out, "\t\t\t\t\t<%s>%c\n", + IMRD_SDMD_TAG_IDENTTOTAL, IMRD_NO, IMRD_SDMD_TAG_IDENTTOTAL); + } + else + { + fprintf( Out, "\t\t\t\t\t<%s>%c\n", + IMRD_SDMD_TAG_IDENTTOTAL, IMRD_YES, IMRD_SDMD_TAG_IDENTTOTAL); + } + + if(MapCmd_Ptr->Ident_First_Msg_Ptr != NULL) + { + fprintf( Out, "\t\t\t\t\t<%s>%s\n", + IMRD_SDMD_TAG_TYPE, MapCmd_Ptr->Ident_First_Msg_Ptr->Name, IMRD_SDMD_TAG_TYPE); + } + + for(i=0; iJmpTbleNbElts; i++) + { + fprintf( Out, "\t\t\t\t\t<%s>\n", IMRD_SDMD_TAG_GO_TO); + fprintf( Out, "\t\t\t\t\t\t<%s>%s\n", + IMRD_SDMD_TAG_FORMAT, MapCmd_Ptr->Jump_Tab[i].Fmt_Ptr->Name, IMRD_SDMD_TAG_FORMAT); + + fprintf( Out, "\t\t\t\t\t\t<%s>%s\n", + IMRD_SDMD_TAG_TYPE, MapCmd_Ptr->Jump_Tab[i].Msg_Ptr->Name, IMRD_SDMD_TAG_TYPE); + + fprintf( Out, "\t\t\t\t\t\t<%s>%d\n", + IMRD_SDMD_TAG_BRANCHE_ID, MapCmd_Ptr->Jump_Tab[i].Branche_Id, IMRD_SDMD_TAG_BRANCHE_ID); + fprintf( Out, "\t\t\t\t\t\n", IMRD_SDMD_TAG_GO_TO); + } + + fprintf( Out, "\t\t\t\t\n", IMRD_SDMD_TAG_IDENTIFIER); + } + else if(MapCmd_Ptr->TypeCmd == IMRD_MAPCMD_TYPE_MAP) + { + fprintf( Out, "\t\t\t\t<%s>\n", IMRD_SDMD_TAG_MAPPER); + + fprintf( Out, "\t\t\t\t\t<%s>%s\n", + IMRD_SDMD_TAG_INPUTFORMAT, MapCmd_Ptr->Fmt_Input_Ptr->Name, IMRD_SDMD_TAG_INPUTFORMAT); + + if(strcmp(MapCmd_Ptr->FmtAttr_Input_Ptr->Value, IMRD_SDMD_EMPTY_STRING) != 0) + { + fprintf( Out, "\t\t\t\t\t<%s>%s\n", + IMRD_SDMD_TAG_INPUTFORMAT_ATTR, MapCmd_Ptr->FmtAttr_Input_Ptr->Name, IMRD_SDMD_TAG_INPUTFORMAT_ATTR); + } + + fprintf( Out, "\t\t\t\t\t<%s>%s\n", + IMRD_SDMD_TAG_OUTPUTFORMAT, MapCmd_Ptr->Fmt_Output_Ptr->Name, IMRD_SDMD_TAG_OUTPUTFORMAT); + + if(strcmp(MapCmd_Ptr->FmtAttr_Output_Ptr->Value, IMRD_SDMD_EMPTY_STRING) != 0) + { + fprintf( Out, "\t\t\t\t\t<%s>%s\n", + IMRD_SDMD_TAG_OUTPUTFORMAT_ATTR, MapCmd_Ptr->FmtAttr_Output_Ptr->Name, IMRD_SDMD_TAG_OUTPUTFORMAT_ATTR); + } + + fprintf( Out, "\t\t\t\t\t<%s>%d\n", + IMRD_SDMD_TAG_INPUTBUFFER, MapCmd_Ptr->Buffer_Id_Input, IMRD_SDMD_TAG_INPUTBUFFER); + + fprintf( Out, "\t\t\t\t\t<%s>%d\n", + IMRD_SDMD_TAG_OUTPUTBUFFER, MapCmd_Ptr->Buffer_Id_Output, IMRD_SDMD_TAG_OUTPUTBUFFER); + + if(MapCmd_Ptr->Clear_Flag != 0) + { + fprintf( Out, "\t\t\t\t\t<%s>%d\n", + IMRD_SDMD_TAG_CLEARFLAG, MapCmd_Ptr->Clear_Flag, IMRD_SDMD_TAG_CLEARFLAG); + } + + fprintf( Out, "\t\t\t\t\t<%s>%s\n", + IMRD_SDMD_TAG_MSGMAP, MapCmd_Ptr->MsgMap_Ptr->Name, IMRD_SDMD_TAG_MSGMAP); + + fprintf( Out, "\t\t\t\t\n", IMRD_SDMD_TAG_MAPPER); + } + else if(MapCmd_Ptr->TypeCmd == IMRD_MAPCMD_TYPE_COPY) + { + fprintf( Out, "\t\t\t\t<%s>\n", IMRD_SDMD_TAG_COPIE); + + fprintf( Out, "\t\t\t\t\t<%s>%d\n", + IMRD_SDMD_TAG_INPUTBUFFER, MapCmd_Ptr->Buffer_Id_Input, IMRD_SDMD_TAG_INPUTBUFFER); + + fprintf( Out, "\t\t\t\t\t<%s>%d\n", + IMRD_SDMD_TAG_OUTPUTBUFFER, MapCmd_Ptr->Buffer_Id_Output, IMRD_SDMD_TAG_OUTPUTBUFFER); + + fprintf( Out, "\t\t\t\t\n", IMRD_SDMD_TAG_COPIE); + } + else if(MapCmd_Ptr->TypeCmd == IMRD_MAPCMD_TYPE_GOTO) + { + fprintf( Out, "\t\t\t\t<%s>\n", IMRD_SDMD_TAG_GO_TO); + + fprintf( Out, "\t\t\t\t\t<%s>%d\n", + IMRD_SDMD_TAG_BRANCHE_ID, MapCmd_Ptr->Goto_Branche_Id, IMRD_SDMD_TAG_BRANCHE_ID); + + fprintf( Out, "\t\t\t\t\n", IMRD_SDMD_TAG_GO_TO); + } + + fprintf( Out, "\t\t\t\n", IMRD_SDMD_TAG_MAPCMD); + + return( NDS_OK); + } + + default: + { + IMRD_LM_LOG_ERROR_1( "with an undefined command %d\n", Command); + + return( NDS_ERRAPI); + } + } + + return( NDS_OK); +} + + + + + +/*----------------------------------------------------------------------------*/ +/* MapPath Manager */ +/*----------------------------------------------------------------------------*/ + +NDT_Status SDM_MapPath_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node *Node_Ptr, NDT_Command Command, va_list Args) +{ + NDT_Command_Name Command_Name; + NDT_Status status; + SDMT_CritereRecChemin *Recherche = NULL; + IMRT_Status TableCritere[SDMD_NB_CRITERE_CHEMIN]; + IMRT_Status Valide; + char functioname[] = "Manager_MapPath"; + + + switch( Command) + { + case NDD_CMD_MANAGER_VERSION: + { + NDT_Version_Name *Version_Name_Ptr = (NDT_Version_Name *)va_arg( Args, NDT_Version_Name *); + + + Command_Name = "NDD_CMD_MANAGER_VERSION"; + + *Version_Name_Ptr = "Revision: 2.1 Name: libnode-2_0_4-1 Date: 2002/02/28 22:00:35 Author: agibert "; + + return( NDS_OK); + } + + case NDD_CMD_INDEX_GET: + { + /* + NDT_Index_Id *Reply_Index_Id_Ptr = (NDT_Index_Id *)va_arg( Args, NDT_Index_Id *); + NDT_Command *Reply_Command_Ptr = (NDT_Command *)va_arg( Args, NDT_Command *); + NDT_Command Cmd = (NDT_Command)va_arg( Args, NDT_Command); + void *Value_ptr = (void *)va_arg( Args, void *); + */ + NDT_Index_Id *Reply_Index_Id_Ptr = (NDT_Index_Id *)va_arg( Args, NDT_Index_Id *); + NDT_Command *Reply_Command_Ptr = (NDT_Command *)va_arg( Args, NDT_Command *); + NDT_Command Cmd = (NDT_Command)va_arg( Args, NDT_Command); + IMRT_MapPath *Value_ptr = (IMRT_MapPath *)va_arg( Args, IMRT_MapPath *); + Command_Name = "NDD_CMD_INDEX_GET"; + + switch(Cmd) + { + case IMRD_SDMD_CMD_INDEX0_PRINT: + { + *Reply_Index_Id_Ptr = 0; + *Reply_Command_Ptr = NDD_CMD_VALUE_PRINT; + break; + } + + default: + { + *Reply_Index_Id_Ptr = Index_Id; + *Reply_Command_Ptr = Cmd; + break; + } + } + return( NDS_OK); + } + + case NDD_CMD_VALUE_ALLOC: + { + /* + void **Value_Ptr_Ptr = (void **)va_arg( Args, void **); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + IMRT_MapPath **Value_Ptr_Ptr = va_arg( Args, IMRT_MapPath **); + + Command_Name = "NDD_CMD_VALUE_ALLOC"; + + if( ( *Value_Ptr_Ptr = (IMRT_MapPath *)malloc( sizeof(IMRT_MapPath))) == NULL) + { + return(NDS_ERRMEM); + } + else + { + SDM_InitMapPath(*Value_Ptr_Ptr); + if( ( status = ND_DataStruct_Open( &(*Value_Ptr_Ptr)->MapCmd_Struct_Ptr, IMRD_SDMD_INDEX_NB, index_type_initial_tab, "SDM_MapCmd_Manager", SDM_MapCmd_Manager, NULL, NULL, NULL, NULL,0,NULL)) != NDS_OK) + { + IMRD_LM_LOG_ERROR_1( "ND_DataStruct_Open() MapCmd failed (%d) !\n", status); + return(NDS_KO); + } + + return( NDS_OK); + } + } + + case NDD_CMD_VALUE_FREE: + { + /* + void *Value_Ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + IMRT_MapPath *Value_Ptr = (IMRT_MapPath *)va_arg( Args, IMRT_MapPath *); + + Command_Name = "NDD_CMD_VALUE_FREE"; + if(Value_Ptr->MapCmd_Struct_Ptr != NULL) + { if( ( status = ND_DataStruct_Close(Value_Ptr->MapCmd_Struct_Ptr)) != NDS_OK) + { + IMRD_LM_LOG_ERROR_1( "ND_DataStruct_Close() failed (%d) !\n", status); + return(status); + } + } + + free( Value_Ptr); + + return( NDS_OK); + } + + case NDD_CMD_VALUE_COMP: + { + /* + void *Value1_Ptr = (void *)va_arg( Args, void *); + void *Value2_Ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + + IMRT_MapPath *Value1_Ptr = va_arg( Args, IMRT_MapPath *); + IMRT_MapPath *Value2_Ptr = va_arg( Args, IMRT_MapPath *); + va_list user_args = (va_list)va_arg( Args, va_list); + + Command_Name = "NDD_CMD_VALUE_COMP"; + + switch( Index_Id) + { + case 0: + { + if( Value1_Ptr->idMapPath< Value2_Ptr->idMapPath) + { + return(NDS_LOWER); + } + else + { + if( Value1_Ptr->idMapPath > Value2_Ptr->idMapPath) + { + return(NDS_GREATER); + } + else + { + return(NDS_EQUAL); + } + } + } + + default: + { + IMRD_LM_LOG_ERROR_1( "Unknown COMP idx (%d) !\n", Index_Id); + return( NDS_KO); + } + } /* end switch */ + + return( NDS_OK); + + } + + case NDD_CMD_VALUE_ADD: + { + /* + void *Value_Ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + + Command_Name = "NDD_CMD_VALUE_ADD"; + + return( NDS_OK); + } + + case NDD_CMD_VALUE_REMOVE: + { + /* + void *Value_Ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + + Command_Name = "NDD_CMD_VALUE_REMOVE"; + return( NDS_OK); + } + + case NDD_CMD_VALUE_PRINT: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + NDT_Recursive_Offset Recursive_Offset = (NDT_Recursive_Offset)va_arg( lib_args, NDT_Recursive_Offset); + va_list user_args = (va_list)va_arg( lib_args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + + void *Value_Ptr = Node_Ptr->Value; + */ + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + NDT_Recursive_Offset Recursive_Offset = (NDT_Recursive_Offset)va_arg( lib_args, NDT_Recursive_Offset); + + IMRT_MapPath *Value_Ptr = Node_Ptr->Value; + + Command_Name = "NDD_CMD_VALUE_PRINT"; + + + fprintf( Out, "idMapPath: (%d) InputFormat: (%s) OutputFormat: (%s) InputAppli: (%s) OutputAppli: (%s) \n", + Value_Ptr->idMapPath, + Value_Ptr->Fmt_Input_Ptr->Name, + Value_Ptr->Fmt_Output_Ptr->Name, + Value_Ptr->Appl_Input_Ptr->Name, + Value_Ptr->Appl_Output_Ptr->Name); + + return( ND_DataStruct_Value_Print( Out, Value_Ptr->MapCmd_Struct_Ptr, NDD_RECURSIVE_MODE_PARENT_CHILD, --Recursive_Depth, ++Recursive_Offset)); + + } + + case NDD_CMD_INFO_PRINT: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + NDT_Recursive_Offset Recursive_Offset = (NDT_Recursive_Offset)va_arg( lib_args, NDT_Recursive_Offset); + va_list user_args = (va_list)va_arg( lib_args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + + void *Value_Ptr = Node_Ptr->Value; + */ + + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode =(NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + NDT_Recursive_Offset Recursive_Offset = (NDT_Recursive_Offset)va_arg( lib_args, NDT_Recursive_Offset); + + IMRT_MapPath *MapPath_Ptr = Node_Ptr->Value; + + Command_Name = "NDD_CMD_INFO_PRINT"; + + return( ND_DataStruct_Info_Print( Out, MapPath_Ptr->MapCmd_Struct_Ptr, NDD_RECURSIVE_MODE_PARENT_CHILD, --Recursive_Depth, ++Recursive_Offset)); + } + case NDD_CMD_FIND_MAPPATH: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + va_list user_args = (va_list)va_arg( lib_args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + void *Value_Ptr = Node_Ptr->Value; + */ + + + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list user_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( user_args, FILE *); + SDMT_CritereRecChemin *Recherche = (SDMT_CritereRecChemin *)va_arg( user_args, SDMT_CritereRecChemin *); + + IMRT_MapPath *Value_Ptr = Node_Ptr->Value; + IMRT_Mode_Traverse Mode_Normal_Erreur = IMRD_NORMALE_MODE; + + Command_Name = "NDD_CMD_FIND_MAPPATH"; + + SDM_CompareCritereMapPath(TableCritere, SDMD_NB_CRITERE_CHEMIN,Recherche, Value_Ptr, &Valide); + /*le chemin de mappin vérifie les critére de la demande + on va traverser la structure MapCmd qui contient toutes + les commandes pour le chemin de mapping sélectionné + */ + if(Valide == IMRS_OK) + { + + IMRD_LM_LOG_TRACE_1( IMRD_LOG_LEVEL_VERBOSE_1, "Mappath match Id : <%d>", Value_Ptr->idMapPath); + status = (IMRT_Status)ND_DataStruct_Traverse( Value_Ptr->MapCmd_Struct_Ptr, IMRD_SDMD_CMD_EXECUTE, stdout, NDD_RECURSIVE_MODE_PARENT,Recherche, &Mode_Normal_Erreur); + if ((status != NDS_OK) || (Mode_Normal_Erreur != IMRD_NORMALE_MODE)) + { + IMRD_LM_LOG_ERROR_1( "ND_DataStruct_Traverse() failed (%d) !\n", status); + return(NDS_KO); + } + + return(NDS_NODE_FOUND); + } + return (NDS_OK); + } + + case IMRD_SDMD_CMD_API_SQL_DUMP: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + + void *Value_Ptr = Node_Ptr->Value; + */ + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list user_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( user_args, FILE *); + + IMRT_MapPath *MapPath_Ptr = Node_Ptr->Value; + + + Command_Name = "IMRD_SDMD_CMD_API_SQL_DUMP"; + + fprintf( Out, "INSERT INTO IMR_MAPPATH(MAP_PATH_ID, APPLI_IN_ID, APPLI_OUT_ID, FORMAT_IN_ID, FORMAT_OUT_ID) VALUES(%d, %d, %d, %d, %d);\n", + MapPath_Ptr->idMapPath, MapPath_Ptr->Appl_Input_Ptr->Id, MapPath_Ptr->Appl_Output_Ptr->Id, MapPath_Ptr->Fmt_Input_Ptr->Id, MapPath_Ptr->Fmt_Output_Ptr->Id); + + if( ( status = ND_DataStruct_Traverse( MapPath_Ptr->MapCmd_Struct_Ptr, IMRD_SDMD_CMD_API_SQL_DUMP, Out, MapPath_Ptr->idMapPath)) != NDS_OK) + { + IMRD_LM_LOG_ERROR_1( "ND_DataStruct_Traverse failed (%d)...\n",status); + return(NDS_KO); + } + + return( NDS_OK); + } + + case IMRD_SDMD_CMD_API_XML_DUMP: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + + void *Value_Ptr = Node_Ptr->Value; + */ + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list user_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( user_args, FILE *); + + IMRT_MapPath *MapPath_Ptr = Node_Ptr->Value; + + + Command_Name = "IMRD_SDMD_CMD_API_XML_DUMP"; + + fprintf( Out, "\t<%s>\n", IMRD_SDMD_TAG_MAPPATH); + + fprintf( Out, "\t\t<%s>%s\n", + IMRD_SDMD_TAG_INPUTAPPLI, MapPath_Ptr->Appl_Input_Ptr->Name, IMRD_SDMD_TAG_INPUTAPPLI); + + fprintf( Out, "\t\t<%s>%s\n", + IMRD_SDMD_TAG_OUTPUTAPPLI, MapPath_Ptr->Appl_Output_Ptr->Name, IMRD_SDMD_TAG_OUTPUTAPPLI); + + fprintf( Out, "\t\t<%s>%s\n", + IMRD_SDMD_TAG_INPUTFORMAT, MapPath_Ptr->Fmt_Input_Ptr->Name, IMRD_SDMD_TAG_INPUTFORMAT); + + fprintf( Out, "\t\t<%s>%s\n", + IMRD_SDMD_TAG_OUTPUTFORMAT, MapPath_Ptr->Fmt_Output_Ptr->Name, IMRD_SDMD_TAG_OUTPUTFORMAT); + + + if( ( status = ND_DataStruct_Traverse( MapPath_Ptr->MapCmd_Struct_Ptr, IMRD_SDMD_CMD_API_XML_DUMP, Out)) != NDS_OK) + { + IMRD_LM_LOG_ERROR_1( "ND_DataStruct_Traverse failed (%d)...\n",status); + return(NDS_KO); + } + + fprintf( Out, "\t\n", IMRD_SDMD_TAG_MAPPATH); + + return( NDS_OK); + } + + default: + { + IMRD_LM_LOG_ERROR_1("called with an undefined command %d\n", Command); + + return( NDS_ERRAPI); + } + } + + return( NDS_OK); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_BufferInfo_Init(IMRT_SDM_Config * Lib_Config_Ptr) +{ + IMRT_Status status; + + if(Lib_Config_Ptr->Flag == IMRD_SDM_FLAG_XML) + { + status = SDM_XML_BufferInfo_Init(Lib_Config_Ptr->Lib_Path); + } + else + { +#ifdef ORACLE_SUPPORT + status = SDM_SQL_BufferInfo_Init(); +#else + status = IMRS_OK; +#endif /* ORACLE_SUPPORT */ + } + + return(status); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_Close_RootMapPath(void) +{ + IMRT_Status status; + NDT_Status nd_status; + + status = IMRS_OK; + + if(IMRG_SDM_Base.RootMapPath != NULL) + { + if (IMRG_SDM_Base.RootMapPath->User_Ptr != NULL) + { + free(IMRG_SDM_Base.RootMapPath->User_Ptr); + } + + if( ( nd_status = ND_DataStruct_Close(IMRG_SDM_Base.RootMapPath)) != NDS_OK) + { + IMRD_LM_LOG_ERROR_1( "RootMapPath ND_DataStruct_Close() failed (%d) !\n", nd_status); + status = IMRS_KO; + } + } + + return(status); + +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_Close_RootAppl(void) +{ + IMRT_Status status; + NDT_Status nd_status; + + status = IMRS_OK; + + if(IMRG_SDM_Base.RootAppl != NULL) + { + if (IMRG_SDM_Base.RootAppl->User_Ptr != NULL) + { + free(IMRG_SDM_Base.RootAppl->User_Ptr); + } + + if( ( nd_status = ND_DataStruct_Close(IMRG_SDM_Base.RootAppl)) != NDS_OK) + { + IMRD_LM_LOG_ERROR_1("ND_DataStruct_Close() failed (%d) !\n", nd_status); + status = IMRS_KO; + } + } + + return(status); + +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_Close_RootFmtAttr(void) +{ + IMRT_Status status; + NDT_Status nd_status; + + status = IMRS_OK; + + if(IMRG_SDM_Base.RootFmtAttr != NULL) + { + if (IMRG_SDM_Base.RootFmtAttr->User_Ptr != NULL) + { + free(IMRG_SDM_Base.RootFmtAttr->User_Ptr); + } + + if( ( nd_status = ND_DataStruct_Close(IMRG_SDM_Base.RootFmtAttr)) != NDS_OK) + { + IMRD_LM_LOG_ERROR_1("ND_DataStruct_Close() failed (%d) !\n", nd_status); + status = IMRS_KO; + } + } + + return(status); + +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_Close_RootFmt(void) +{ + IMRT_Status status; + NDT_Status nd_status; + + status = IMRS_OK; + + if(IMRG_SDM_Base.RootFmt != NULL) + { + if (IMRG_SDM_Base.RootFmt->User_Ptr != NULL) + { + free(IMRG_SDM_Base.RootFmt->User_Ptr); + } + + if( ( nd_status = ND_DataStruct_Close(IMRG_SDM_Base.RootFmt)) != NDS_OK) + { + IMRD_LM_LOG_ERROR_1( "ND_DataStruct_Close() failed (%d) !\n", nd_status); + status = IMRS_KO; + } + } + + return(status); + +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_BufferInfo_DInit(void) +{ + IMRT_Status status, StatusMapPath, StatusAppl, StatusFmtAttr, StatusFmt; + + status = IMRS_OK; + + StatusMapPath = SDM_Close_RootMapPath(); + StatusAppl = SDM_Close_RootAppl(); + StatusFmtAttr = SDM_Close_RootFmtAttr(); + StatusFmt = SDM_Close_RootFmt(); + + if((StatusMapPath == IMRS_KO)||(StatusAppl == IMRS_KO)||(StatusFmtAttr == IMRS_KO)||(StatusFmt == IMRS_KO)) + { + status = IMRS_KO; + } + + return(status); + +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_MapPath_Proceed( IMRT_Appl_Id Appl_Id_Target, IMRT_Fmt_Id Fmt_Id_Target, IMRT_Msg_Id Msg_Id_Target, + IMRT_Appl_Id ApplId_Src, IMRT_Fmt_Id Fmt_Id_Src, IMRT_Msg_Id Msg_Id_Src, + IMRT_SDMCB_Buffer_Map *CCB_Buffer_Map_Ptr, + IMRT_SDMCB_Buffer_Copy *CCB_Buffer_Copy_Ptr, + IMRT_SDMCB_Buffer_Ident *CCB_Buffer_Ident_Ptr) + +{ + SDMT_CritereRecChemin Recherche; + NDT_Node * node_ptr; + IMRT_Status status; + IMRT_MapPath mymappath; + + Recherche.Branche_id = 0; + Recherche.InputAppli = ApplId_Src; + Recherche.OutputAppli= Appl_Id_Target; + Recherche.InputFormat = Fmt_Id_Src; + Recherche.OutputFormat = Fmt_Id_Target; + Recherche.InputType = Msg_Id_Src; + Recherche.OutputType = Msg_Id_Target; + Recherche.CallBackCommandeIdent = CCB_Buffer_Ident_Ptr; + Recherche.CallBackBCommandeMap = CCB_Buffer_Map_Ptr; + Recherche.CallBackCommandeCopy = CCB_Buffer_Copy_Ptr; + + status = (IMRT_Status)ND_DataStruct_Traverse( IMRG_SDM_Base.RootMapPath, NDD_CMD_FIND_MAPPATH, stdout,&Recherche); + + if(status != NDS_NODE_FOUND) + { + status = IMRS_KO; + } + else + { + status = IMRS_OK; + } + return(status); +} + +IMRT_Status SDM_MsgIdent_Proceed( IMRT_Fmt_Id Fmt_Id, IMRT_Msg_Id *Msg_Id, IMRT_SDMCB_Ident_Field_Value *CCB_Ident_Field_Value_Ptr, IMRT_SDMCB_Ident_Field_Exist *CCB_Ident_Field_Exist_Ptr, IMRT_SDMCB_Ident_Msg_Size *CCB_Ident_Msg_Size_Ptr) +{ +/*IMRT_SDMCB_Field_Ident *CCB_Field_Ident_Ptr*/ + + IMRT_Status status; + IMRT_Fmt Fmt; + IMRT_Fmt * Fmt2; + NDT_Root * FmtMsg_Ptr ; + NDT_Node * node_ptr; + IMRT_SDM_IdentMessage Struct_Indent; + char functionname [] = "IMR_IdentificationMessage"; + char DescErr[IMRD_SDMD_DESCERR_LEN]; + + Struct_Indent.Ident_Msg_SizeFunc_Ptr = CCB_Ident_Msg_Size_Ptr; + Struct_Indent.Ident_Field_ExistFunc_Ptr = CCB_Ident_Field_Exist_Ptr; + Struct_Indent.Ident_Field_ValueFunc_Ptr = CCB_Ident_Field_Value_Ptr; + + Struct_Indent.Id = *Msg_Id; + Struct_Indent.Mode = IMRD_SKIP_MODE; + + + /*recherche de la liste des message en fonction du format*/ + Fmt.Id = Fmt_Id; + if((status = (IMRT_Status)ND_Index_Node_Find( &node_ptr, IMRG_SDM_Base.RootFmt, + IMRD_SDMD_FMT_IDX_ID, &Fmt, NULL)) != NDS_OK) + { + snprintf(DescErr,sizeof(DescErr),SDMD_LIB_ERROR_8,Fmt.Id); + status = IMRS_KO; + } + else + { + Fmt2 = (IMRT_Fmt *)node_ptr->Value; + FmtMsg_Ptr = Fmt2->FmtMsg_Struct_Ptr; + status = (IMRT_Status)ND_DataStruct_Traverse( FmtMsg_Ptr, IMRD_SDMD_CMD_EXECUTE, stdout, NDD_RECURSIVE_MODE_PARENT,&Struct_Indent); + + if(status == (IMRT_Status)NDS_IDENT_OK) + { + *Msg_Id = Struct_Indent.Id; + status = IMRS_OK; + } + else if((status == (IMRT_Status)NDS_KO)) + { + status = IMRS_KO; + snprintf(DescErr,sizeof(DescErr),SDMD_LIB_ERROR_9,Fmt.Name); + } + else + { + *Msg_Id = IMRD_MSG_ID_UNKNOWN; + status = IMRS_OK; + } + } + + return(status); + +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_Fmt_Proceed( IMRT_SDMCB_Fmt_Add *CCB_Fmt_Add_Ptr) +{ + + IMRT_Status status; + NDT_Status nd_status; + + status = IMRS_OK; + if( ( nd_status = ND_DataStruct_Traverse( IMRG_SDM_Base.RootFmt, IMRD_SDMD_CMD_EXECUTE, stdout, NDD_RECURSIVE_MODE_PARENT, CCB_Fmt_Add_Ptr)) != NDS_OK) + { + IMRD_LM_LOG_ERROR_1("ND_DataStruct_Traverse() failed (%d) !\n", nd_status); + status = IMRS_KO; + } + + return(status); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +void SDM_InitMapCmd(IMRT_MapCmd * mymapcmd) +{ + int i; + mymapcmd->MapCmd_Id = 0; + mymapcmd->TypeCmd = IMRD_MAPCMD_TYPE_UNKNOWN; + mymapcmd->Fmt_Input_Ptr = NULL; + mymapcmd->FmtAttr_Input_Ptr = NULL; + mymapcmd->Fmt_Output_Ptr = NULL; + mymapcmd->FmtAttr_Output_Ptr = NULL; + mymapcmd->Branche_Id = -1; + mymapcmd->Buffer_Id_Input = -1; + mymapcmd->Buffer_Id_Output = -1; + mymapcmd->MsgMap_Ptr = NULL; + mymapcmd->Buffer_Id_Ident = -1; + mymapcmd->Clear_Flag = 0; + mymapcmd->Goto_Branche_Id = -1; + mymapcmd->Ident_Total = IMRD_TRUE; + mymapcmd->Ident_First_Msg_Ptr = NULL; + mymapcmd->JmpTbleNbElts = 0; + mymapcmd->Jump_Tab = NULL; + /*for( i =0 ; iJump_Tab[i].Fmt_Ptr = NULL; + mymapcmd->Jump_Tab[i].Msg_Ptr = NULL; + mymapcmd->Jump_Tab[i].Branche_Id = -1; + } */ + +} + + +void SDM_InitMapPath(IMRT_MapPath * mymappath) +{ + mymappath->idMapPath = 0; + mymappath->Fmt_Input_Ptr = NULL; + mymappath->Fmt_Output_Ptr = NULL; + mymappath->Appl_Input_Ptr = NULL; + mymappath->Appl_Output_Ptr = NULL; + mymappath->MapCmd_Struct_Ptr =NULL; +} + +void SDM_InitFormat(IMRT_Fmt * myformat) +{ + myformat->Id= IMRD_FMT_ID_UNKNOWN; + memset(myformat->Name,0,sizeof(myformat->Name)); +} + +void SDM_InitFmtAttr(IMRT_FmtAttr * myFmtAttr) +{ + myFmtAttr->Id = IMRD_FMTATTR_ID_UNKNOWN; + strcpy(myFmtAttr->Name, IMRD_FMTATTR_NAME_UNKNOWN); + memset(myFmtAttr->Value,'\0',sizeof(myFmtAttr->Value)); +} + +void SDM_InitFmtMsg(IMRT_FmtMsg * myFmtMsg) +{ + myFmtMsg->Msg_Ptr = NULL; + myFmtMsg->Branche_Id = IMRD_BRANCHE_ID_UNKNOWN; + myFmtMsg->FmtAttr_Ptr = NULL; +} + + +void SDM_InitAppl(IMRT_Appl * Appl_Ptr) +{ + Appl_Ptr->Id = IMRD_APPL_ID_UNKNOWN; + memset(Appl_Ptr->Name,0,sizeof(Appl_Ptr->Name)); +} diff --git a/src/libstatic_data_mng/src/buffer_info_mng.h b/src/libstatic_data_mng/src/buffer_info_mng.h new file mode 100644 index 0000000..ea1ea95 --- /dev/null +++ b/src/libstatic_data_mng/src/buffer_info_mng.h @@ -0,0 +1,258 @@ +/*----------------------------------------------------------------------------*/ +/* File: buffer_info_mng.h */ +/*----------------------------------------------------------------------------*/ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#ifndef _BUFFER_INFO_MNG_H_ +# define _BUFFER_INFO_MNG_H_ + + + +/*----------------------------------------------------------------------------*/ +/* Global Include */ +/*----------------------------------------------------------------------------*/ + +# include + + +/*----------------------------------------------------------------------------*/ +/* Local definition */ +/*----------------------------------------------------------------------------*/ + + +/*----------------------------------------------------------------------------*/ +/* XML TAG */ +/*----------------------------------------------------------------------------*/ +#define IMRD_SDMD_FMTATTR_STRUCT "fmtattr_struct" +#define IMRD_SDMD_APPLI_STRUCT "appl_struct" +#define IMRD_SDMD_FMT_STRUCT "fmt_struct" +#define IMRD_SDMD_MAPPATH_STRUCT "mappath_struct" + +/* Nom des fichiers pour le chargement XML */ +#define SDMD_FMTATTR_FILE "sd_fmtattr_struct.xml" +#define SDMD_APPLI_FILE "sd_appl_struct.xml" +#define SDMD_FORMAT_FILE "sd_fmt_struct.xml" +#define SDMD_MAPPATH_FILE "sd_mappath_struct.xml" + + + +#define SDMD_CRI_IA 0 /*Critére input appli*/ +#define SDMD_CRI_OA 1 /*Critére output appli*/ +#define SDMD_CRI_IF 2 /*Critére input format*/ +#define SDMD_CRI_OF 3 /*Critére output format*/ +#define SDMD_CRI_IT 4 /*Critére input type*/ +#define SDMD_CRI_OT 5 /*Critére ouput type*/ + +#define SDMD_NB_CRITERE_CHEMIN 4 + + +typedef struct IMRT_Appl +{ + IMRT_Appl_Id Id; + IMRT_Appl_Name Name ; + +} IMRT_Appl; + +typedef struct IMRT_MapPath +{ + int idMapPath; + IMRT_Fmt * Fmt_Input_Ptr; + IMRT_Fmt * Fmt_Output_Ptr; + IMRT_Appl * Appl_Input_Ptr; + IMRT_Appl * Appl_Output_Ptr; + NDT_Root * MapCmd_Struct_Ptr; +} IMRT_MapPath; + + +/*typedef struct SDMT_FmtMsg +{ + char name [IMRD_NAME_LEN]; + IMRT_Msg * msg; + +} SDMT_FmtMsg; +*/ + + +typedef struct SDMT_CritereRecChemin +{ + IMRT_Appl_Id InputAppli; + IMRT_Appl_Id OutputAppli; + IMRT_Fmt_Id InputFormat; + IMRT_Fmt_Id OutputFormat; + IMRT_Msg_Id InputType; + IMRT_Msg_Id OutputType; + int Branche_id; + IMRT_Error FataError; + IMRT_SDMCB_Buffer_Ident * CallBackCommandeIdent; + IMRT_SDMCB_Buffer_Map * CallBackBCommandeMap; + IMRT_SDMCB_Buffer_Copy * CallBackCommandeCopy; + +} SDMT_CritereRecChemin; + +/********************************************************************/ +/* Les index du Manager SDM_Appl_Manager */ +/********************************************************************/ +#define IMRD_SDMD_APPL_STRUCT_IDX_NB (short)2 + +static NDT_Index_Type Appl_Struct_initial_idx_tab[IMRD_SDMD_APPL_STRUCT_IDX_NB] = +{ + (NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_LIST | NDD_INDEX_SUBTYPE_SORTED), + (NDD_INDEX_STATUS_CLOSED) +}; + +static NDT_Index_Type Appl_Struct_final_idx_tab[IMRD_SDMD_APPL_STRUCT_IDX_NB] = +{ + (NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_TREE | NDD_INDEX_SUBTYPE_BALANCED), + (NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_TREE | NDD_INDEX_SUBTYPE_BALANCED) +}; + +#define IMRD_SDMD_APPL_IDX_ID (short)0 +#define IMRD_SDMD_APPL_IDX_NAME (short)1 + +/********************************************************************/ +/* Les index du Manager SDM_FmtAttr_Manager */ +/********************************************************************/ +#define IMRD_SDMD_FMTATTR_STRUCT_IDX_NB (short)2 + +static NDT_Index_Type FmtAttr_Struct_initial_idx_tab[IMRD_SDMD_FMTATTR_STRUCT_IDX_NB] = +{ + (NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_LIST | NDD_INDEX_SUBTYPE_SORTED), + (NDD_INDEX_STATUS_CLOSED) +}; + +static NDT_Index_Type FmtAttr_Struct_final_idx_tab[IMRD_SDMD_FMTATTR_STRUCT_IDX_NB] = +{ + (NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_TREE | NDD_INDEX_SUBTYPE_BALANCED), + (NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_TREE | NDD_INDEX_SUBTYPE_BALANCED) +}; + +#define IMRD_SDMD_FMTATTR_IDX_ID (short)0 +#define IMRD_SDMD_FMTATTR_IDX_NAME (short)1 + + +/********************************************************************/ +/* Les index du Manager SDM_Fmt_Manager */ +/********************************************************************/ +#define IMRD_SDMD_FMT_STRUCT_IDX_NB (short)2 + +static NDT_Index_Type Fmt_Struct_initial_idx_tab[IMRD_SDMD_FMT_STRUCT_IDX_NB] = +{ + (NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_LIST | NDD_INDEX_SUBTYPE_SORTED), + (NDD_INDEX_STATUS_CLOSED) +}; + +static NDT_Index_Type Fmt_Struct_final_idx_tab[IMRD_SDMD_FMT_STRUCT_IDX_NB] = +{ + (NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_TREE | NDD_INDEX_SUBTYPE_BALANCED), + (NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_TREE | NDD_INDEX_SUBTYPE_BALANCED) +}; + +#define IMRD_SDMD_FMT_IDX_ID (short)0 +#define IMRD_SDMD_FMT_IDX_NAME (short)1 + + +/*----------------------------------------------------------------------------*/ +/* Prototypes */ +/*----------------------------------------------------------------------------*/ + +# ifdef _BUFFER_INFO_MNG_C_ +IMRT_Status SDM_DataStruct_Finalize(NDT_Root *, NDT_Index_Type *, short ); +NDT_Status SDM_Appl_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list); +NDT_Status SDM_FmtAttr_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list); +NDT_Status SDM_FmtMsg_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list); +NDT_Status SDM_Fmt_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list); +NDT_Status SDM_MapCmd_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list); +NDT_Status SDM_MapPath_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list); +IMRT_Status SDM_MapPath_Proceed( IMRT_Appl_Id Appl_Id_Target, IMRT_Fmt_Id Fmt_Id_Target, IMRT_Msg_Id Msg_Id_Target, + IMRT_Appl_Id ApplId_Src, IMRT_Fmt_Id Fmt_Id_Src, IMRT_Msg_Id Msg_Id_Src, + IMRT_SDMCB_Buffer_Map *CCB_Buffer_Map_Ptr, + IMRT_SDMCB_Buffer_Copy *CCB_Buffer_Copy_Ptr, + IMRT_SDMCB_Buffer_Ident *CCB_Buffer_Ident_Ptr); +IMRT_Status SDM_Fmt_Proceed( IMRT_SDMCB_Fmt_Add *CCB_Fmt_Add_Ptr); +void SDM_CompareCritereMapPath(IMRT_Status CitereTable[], + const int NbCritere, + SDMT_CritereRecChemin * Critere, + IMRT_MapPath * myMapPath, + IMRT_Status *Valide ); +void SDM_IniTableCritere(IMRT_Status Table[],const int NbElement); +void SDM_InitMapCmd(IMRT_MapCmd * mymapcmd); +void SDM_InitMapPath(IMRT_MapPath * mymappath); +void SDM_InitFormat(IMRT_Fmt * myformat); +void SDM_InitFmtAttr(IMRT_FmtAttr * myFmtAttr); +void SDM_InitFmtMsg(IMRT_FmtMsg * myFmtMsg); +void SDM_InitAppl(IMRT_Appl * Appl_Ptr); +IMRT_Status SDM_BufferInfo_Init(IMRT_SDM_Config * Lib_Config_Ptr); +IMRT_Status SDM_Close_RootMapPath(void); +IMRT_Status SDM_Close_RootAppl(void); +IMRT_Status SDM_Close_RootFmtAttr(void); +IMRT_Status SDM_Close_RootFmt(void); +IMRT_Status SDM_BufferInfo_DInit(void); + +# else + +extern IMRT_Status SDM_DataStruct_Finalize(NDT_Root *ds_Ptr, NDT_Index_Type *Index_Id_Ptr, short hMaxEntries); +extern NDT_Status SDM_Appl_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list); +extern NDT_Status SDM_FmtAttr_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list); +extern NDT_Status SDM_FmtMsg_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list); +extern NDT_Status SDM_Fmt_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list); +extern NDT_Status SDM_MapCmd_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list); +extern NDT_Status SDM_MapPath_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list); +extern IMRT_Status SDM_MapPath_Proceed( IMRT_Appl_Id Appl_Id_Target, IMRT_Fmt_Id Fmt_Id_Target, IMRT_Msg_Id Msg_Id_Target, + IMRT_Appl_Id ApplId_Src, IMRT_Fmt_Id Fmt_Id_Src, IMRT_Msg_Id Msg_Id_Src, + IMRT_SDMCB_Buffer_Map *CCB_Buffer_Map_Ptr, + IMRT_SDMCB_Buffer_Copy *CCB_Buffer_Copy_Ptr, + IMRT_SDMCB_Buffer_Ident *CCB_Buffer_Ident_Ptr); +extern IMRT_Status SDM_Fmt_Proceed( IMRT_SDMCB_Fmt_Add *CCB_Fmt_Add_Ptr); +extern IMRT_Status SDM_BufferInfo_Init(IMRT_SDM_Config * Lib_Config_Ptr); +extern IMRT_Status SDM_Close_RootMapPath(void); +extern IMRT_Status SDM_Close_RootAppl(void); +extern IMRT_Status SDM_Close_RootFmtAttr(void); +extern IMRT_Status SDM_Close_RootFmt(void); +extern IMRT_Status SDM_BufferInfo_DInit(void); +# endif + + + + + +/*----------------------------------------------------------------------------*/ +/* Local Includes */ +/*----------------------------------------------------------------------------*/ + +# ifdef _BUFFER_INFO_MNG_C_ + +# include "buffer_info_xml.h" +# include "buffer_info_sql.h" + +# endif + + + + + +/*----------------------------------------------------------------------------*/ + +#endif diff --git a/src/libstatic_data_mng/src/buffer_info_sql.h b/src/libstatic_data_mng/src/buffer_info_sql.h new file mode 100644 index 0000000..f7a5644 --- /dev/null +++ b/src/libstatic_data_mng/src/buffer_info_sql.h @@ -0,0 +1,113 @@ +/*----------------------------------------------------------------------------*/ +/* File: buffer_info_sql.h */ +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#ifndef _BUFFER_INFO_SQL_H_ +# define _BUFFER_INFO_SQL_H_ + + + +/*----------------------------------------------------------------------------*/ +/* Global Include */ +/*----------------------------------------------------------------------------*/ + +# include + + + + + +/*----------------------------------------------------------------------------*/ +/* Prototypes */ +/*----------------------------------------------------------------------------*/ + +# ifdef _BUFFER_INFO_SQL_PC_ + +IMRT_Status SDM_SQL_BufferInfo_Init(); +IMRT_Status SDM_SQL_Load_FmtAttr(NDT_Root **myRootFmtAttr_Ptr_Ptr); +IMRT_Status SDM_SQL_Load_Appli(NDT_Root **myRootAppli_Ptr_Ptr); +IMRT_Status SDM_SQL_Load_Format(NDT_Root **myRootFormat_Ptr_Ptr); +IMRT_Status SDM_SQL_LoadFmtMsg(IMRT_Fmt *myFormat_Ptr); +IMRT_Status SDM_SQL_Load_MapPath(NDT_Root **myRootMapPath_Ptr_Ptr); +IMRT_Status SDM_SQL_LoadMapCmd(IMRT_MapPath *myMapPath_Ptr); +IMRT_Status SDM_SQL_Load_JumpTable(IMRT_Jump **JumpTable_Ptr_Ptr, int *JumpTableNbElt_Ptr, IMRT_MapCmd_Id IdMapCmd); +IMRT_Status SDM_SQL_Dump_FmtAttr_Header(FILE *dump_file); +IMRT_Status SDM_SQL_Dump_FmtAttr_Body(FILE *dump_file); +IMRT_Status SDM_SQL_Dump_FmtAttr_Footer(FILE *dump_file); +IMRT_Status SDM_SQL_Dump_FmtAttr(void); +IMRT_Status SDM_SQL_Dump_Appli_Header(FILE *dump_file); +IMRT_Status SDM_SQL_Dump_Appli_Body(FILE *dump_file); +IMRT_Status SDM_SQL_Dump_Appli_Footer(FILE *dump_file); +IMRT_Status SDM_SQL_Dump_Appli(void); +IMRT_Status SDM_SQL_Dump_Format_Header(FILE *dump_file); +IMRT_Status SDM_SQL_Dump_Format_Body(FILE *dump_file); +IMRT_Status SDM_SQL_Dump_Format_Footer(FILE *dump_file); +IMRT_Status SDM_SQL_Dump_Format(void); +IMRT_Status SDM_SQL_Dump_MapPath_Header(FILE *dump_file); +IMRT_Status SDM_SQL_Dump_MapPath_Body(FILE *dump_file); +IMRT_Status SDM_SQL_Dump_MapPath_Footer(FILE *dump_file); +IMRT_Status SDM_SQL_Dump_MapPath(void); +IMRT_Status SDM_SQL_BufferInfo_Dump(void); + +# else + +extern IMRT_Status SDM_SQL_BufferInfo_Init(); +extern IMRT_Status SDM_SQL_Load_FmtAttr(NDT_Root **myRootFmtAttr_Ptr_Ptr); +extern IMRT_Status SDM_SQL_Load_Appli(NDT_Root **myRootAppli_Ptr_Ptr); +extern IMRT_Status SDM_SQL_Load_Format(NDT_Root **myRootFormat_Ptr_Ptr); +extern IMRT_Status SDM_SQL_LoadFmtMsg(IMRT_Fmt *myFormat_Ptr); +extern IMRT_Status SDM_SQL_Load_MapPath(NDT_Root **myRootMapPath_Ptr_Ptr); +extern IMRT_Status SDM_SQL_LoadMapCmd(IMRT_MapPath *myMapPath_Ptr); +extern IMRT_Status SDM_SQL_Load_JumpTable(IMRT_Jump **JumpTable_Ptr_Ptr, int *JumpTableNbElt_Ptr, IMRT_MapCmd_Id IdMapCmd); +extern IMRT_Status SDM_SQL_Dump_FmtAttr_Header(FILE *dump_file); +extern IMRT_Status SDM_SQL_Dump_FmtAttr_Body(FILE *dump_file); +extern IMRT_Status SDM_SQL_Dump_FmtAttr_Footer(FILE *dump_file); +extern IMRT_Status SDM_SQL_Dump_FmtAttr(void); +extern IMRT_Status SDM_SQL_Dump_Appli_Header(FILE *dump_file); +extern IMRT_Status SDM_SQL_Dump_Appli_Body(FILE *dump_file); +extern IMRT_Status SDM_SQL_Dump_Appli_Footer(FILE *dump_file); +extern IMRT_Status SDM_SQL_Dump_Appli(void); +extern IMRT_Status SDM_SQL_Dump_Format_Header(FILE *dump_file); +extern IMRT_Status SDM_SQL_Dump_Format_Body(FILE *dump_file); +extern IMRT_Status SDM_SQL_Dump_Format_Footer(FILE *dump_file); +extern IMRT_Status SDM_SQL_Dump_Format(void); +extern IMRT_Status SDM_SQL_Dump_MapPath_Header(FILE *dump_file); +extern IMRT_Status SDM_SQL_Dump_MapPath_Body(FILE *dump_file); +extern IMRT_Status SDM_SQL_Dump_MapPath_Footer(FILE *dump_file); +extern IMRT_Status SDM_SQL_Dump_MapPath(void); +extern IMRT_Status SDM_SQL_BufferInfo_Dump(void); + +# endif + + + + + +/*----------------------------------------------------------------------------*/ + +#endif diff --git a/src/libstatic_data_mng/src/buffer_info_sql.pc b/src/libstatic_data_mng/src/buffer_info_sql.pc new file mode 100644 index 0000000..4849aed --- /dev/null +++ b/src/libstatic_data_mng/src/buffer_info_sql.pc @@ -0,0 +1,1476 @@ +/*----------------------------------------------------------------------------*/ +/* File: buffer_info_sql.pc */ +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#define _LIBSTATIC_DATA_MNG_ +#define _BUFFER_INFO_SQL_PC_ + +#include "buffer_info_sql.h" + + +IMRT_Status SDM_SQL_BufferInfo_Init() +{ + IMRT_Status status, StatusTmp; + + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_0, "Loading FmtAttr..."); + status = SDM_SQL_Load_FmtAttr(&(IMRG_SDM_Base.RootFmtAttr)); + if(status == IMRS_OK) + { + IMRD_LM_LOG_INFO_1( "FmtAtt loaded: (%d)", IMRG_SDM_Base.RootFmtAttr->Index_Tab[NDD_INDEX_PRIMARY].Node_Number); + + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_0, "Loading Fmt..."); + status = SDM_SQL_Load_Format(&(IMRG_SDM_Base.RootFmt)); + if(status == IMRS_OK) + { + IMRD_LM_LOG_INFO_1( "Fmt loaded: (%d)", IMRG_SDM_Base.RootFmt->Index_Tab[NDD_INDEX_PRIMARY].Node_Number); + + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_0, "Loading Appl..."); + status = SDM_SQL_Load_Appli(&(IMRG_SDM_Base.RootAppl)); + if(status == IMRS_OK) + { + IMRD_LM_LOG_INFO_1( "Appl loaded: (%d)", IMRG_SDM_Base.RootAppl->Index_Tab[NDD_INDEX_PRIMARY].Node_Number); + + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_0, "Loading MapPath..."); + status = SDM_SQL_Load_MapPath(&(IMRG_SDM_Base.RootMapPath)); + if(status == IMRS_OK) + { + IMRD_LM_LOG_INFO_1( "MapPath loaded: (%d)", IMRG_SDM_Base.RootMapPath->Index_Tab[NDD_INDEX_PRIMARY].Node_Number); + } + else + { + IMRD_LM_LOG_ERROR_0( "Can't load MapPath !"); + StatusTmp = SDM_Close_RootFmtAttr(); + StatusTmp = SDM_Close_RootFmt(); + StatusTmp = SDM_Close_RootAppl(); + } + } + else + { + IMRD_LM_LOG_ERROR_0( "Can't load Appl !"); + StatusTmp = SDM_Close_RootFmtAttr(); + StatusTmp = SDM_Close_RootFmt(); + } + } + else + { + IMRD_LM_LOG_ERROR_0( "Can't load Fmt !"); + StatusTmp = SDM_Close_RootFmtAttr(); + } + } + else + { + IMRD_LM_LOG_ERROR_0( "Can't load FmtAttr !"); + } + + return(status); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_SQL_Load_FmtAttr(NDT_Root **myRootFmtAttr_Ptr_Ptr) +{ + const char sFunctionName []="SDM_SQL_Load_FmtAttr"; + NDT_Status nd_status; + IMRT_Status status, statusTmp; + NDT_Index_Type *index_type_ptr; + IMRT_FmtAttr *myFmtAttr; + IMRT_Data_Version *Data_Version_Ptr; + + EXEC SQL BEGIN DECLARE SECTION; + IMRT_FmtAttr_Id hFmtAttrId; + VARCHAR vFmtAttrName[IMRD_FMTATTR_NAME_SIZE]; + VARCHAR vFmtAttrValue[IMRD_FMTATTR_VALUE_SIZE]; + short hIndFmtAttrId; + short hIndFmtAttrName; + short hIndFmtAttrValue; + EXEC SQL END DECLARE SECTION; + + + /* initialisation */ + index_type_ptr = FmtAttr_Struct_initial_idx_tab; + + Data_Version_Ptr = (IMRT_Data_Version *) malloc(sizeof(IMRT_Data_Version)); + status = SDM_SQL_Set_Struct_Version(Data_Version_Ptr, "FmtAttr"); + if (status != IMRS_OK) + { + return(IMRS_KO); + } + + nd_status = ND_DataStruct_Open(myRootFmtAttr_Ptr_Ptr, IMRD_SDMD_FMTATTR_STRUCT_IDX_NB,index_type_ptr, "SDM_FmtAttr_Manager",SDM_FmtAttr_Manager, NULL, NULL, NULL, NULL,0, Data_Version_Ptr); + if(nd_status != NDS_OK) + { + IMRD_LM_LOG_ERROR_2( "%s : ND_DataStruct_Open -- SDM_FmtAttr_Manager failed (%d) !", sFunctionName, nd_status); + status = IMRS_KO; + } + else + { + EXEC SQL DECLARE cur_imr_fmt_attr CURSOR FOR + SELECT FMTATTR_ID, FMTATTR_NAME, FMTATTR_VALUE + FROM IMR_FMT_ATTR + ORDER BY FMTATTR_ID ASC; + + EXEC SQL OPEN cur_imr_fmt_attr; + do + { + memset(vFmtAttrName.arr, '\0', (size_t) IMRD_FMTATTR_NAME_SIZE); + memset(vFmtAttrValue.arr, '\0', (size_t) IMRD_FMTATTR_VALUE_SIZE); + + EXEC SQL FETCH cur_imr_fmt_attr + INTO :hFmtAttrId:hIndFmtAttrId, + :vFmtAttrName:hIndFmtAttrName, + :vFmtAttrValue:hIndFmtAttrValue; + + if (sqlca.sqlcode == 0) + { + /* creation d'un nouvelle objet FmtAttr */ + nd_status = ND_Value_Alloc( *myRootFmtAttr_Ptr_Ptr, (void **)&(myFmtAttr)); + if(nd_status != NDS_OK) + { + IMRD_LM_LOG_ERROR_2( "%s : ND_Value_Alloc -- SDM_FmtAttr_Manager failed (%d) !", sFunctionName, nd_status); + status = IMRS_KO; + } + else + { + /* Ajout de l'objet Appli */ + myFmtAttr->Id = hFmtAttrId; + if(hIndFmtAttrName >= 0) + { + strcpy(myFmtAttr->Name, (char *) vFmtAttrName.arr); + } + + if(hIndFmtAttrValue >= 0) + { + statusTmp = SDM_ConvertAttribute((char *) vFmtAttrValue.arr, myFmtAttr->Value); + } + + nd_status = ND_DataStruct_Value_Add( *myRootFmtAttr_Ptr_Ptr, (void *)(myFmtAttr)); + if(nd_status != NDS_OK) + { + IMRD_LM_LOG_ERROR_2( "%s : ND_DataStruct_Value_Add -- SDM_FmtAttr_Manager failed (%d) !", sFunctionName, nd_status); + status = IMRS_KO; + } + } + } + } while((sqlca.sqlcode == 0)&&(nd_status == NDS_OK)&&(status == IMRS_OK)); + + if (sqlca.sqlcode < 0) + { + IMRD_LM_LOG_ERROR_3( "Erreur %s. Erreur Oracle : %d - %s !", sFunctionName, sqlca.sqlcode, sqlca.sqlerrm.sqlerrmc); + status = IMRS_KO; + } + + EXEC SQL CLOSE cur_imr_fmt_attr; + } + + if(status == IMRS_OK) + { + index_type_ptr = FmtAttr_Struct_final_idx_tab; + status = SDM_DataStruct_Finalize(*myRootFmtAttr_Ptr_Ptr, index_type_ptr, IMRD_SDMD_FMTATTR_STRUCT_IDX_NB); + /*SDM_DataStruct_Dump(*myRootFmtAttr_Ptr_Ptr);*/ + } + else + { + nd_status = ND_DataStruct_Close(*myRootFmtAttr_Ptr_Ptr); + if(nd_status != NDS_OK) + { + IMRD_LM_LOG_ERROR_1( "ND_DataStruct_Close() failed (%d) !", nd_status); + status == IMRS_KO; + } + } + + return(status); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_SQL_Load_Appli(NDT_Root **myRootAppli_Ptr_Ptr) +{ + const char sFunctionName []="SDM_SQL_Load_Appli"; + NDT_Status nd_status; + IMRT_Status status; + NDT_Index_Type *index_type_ptr; + IMRT_Appl *myAppli; + IMRT_Data_Version *Data_Version_Ptr; + + EXEC SQL BEGIN DECLARE SECTION; + IMRT_Appl_Id hAppliId; + VARCHAR vAppliName[IMRD_APPL_NAME_SIZE]; + short hIndAppliId; + short hIndAppliName; + EXEC SQL END DECLARE SECTION; + + + /* initialisation */ + index_type_ptr = Appl_Struct_initial_idx_tab; + + Data_Version_Ptr = (IMRT_Data_Version *) malloc(sizeof(IMRT_Data_Version)); + status = SDM_SQL_Set_Struct_Version(Data_Version_Ptr, "Appl"); + if (status != IMRS_OK) + { + return(IMRS_KO); + } + + nd_status = ND_DataStruct_Open(myRootAppli_Ptr_Ptr, IMRD_SDMD_APPL_STRUCT_IDX_NB,index_type_ptr, "SDM_Appl_Manager",SDM_Appl_Manager, NULL, NULL, NULL, NULL,0, Data_Version_Ptr); + if(nd_status != NDS_OK) + { + IMRD_LM_LOG_ERROR_2( "%s : ND_DataStruct_Open -- SDM_Appl_Manager failed (%d) !", sFunctionName, nd_status); + status = IMRS_KO; + } + else + { + EXEC SQL DECLARE cur_imr_appli CURSOR FOR + SELECT APPLI_ID, APPLI_NAME + FROM IMR_APPLI + ORDER BY APPLI_ID ASC; + + EXEC SQL OPEN cur_imr_appli; + do + { + memset(vAppliName.arr, '\0', (size_t) IMRD_APPL_NAME_SIZE); + + EXEC SQL FETCH cur_imr_appli + INTO :hAppliId:hIndAppliId, + :vAppliName:hIndAppliName; + + if (sqlca.sqlcode == 0) + { + /* creation d'un nouvelle objet appli */ + nd_status = ND_Value_Alloc( *myRootAppli_Ptr_Ptr, (void **)&(myAppli)); + if(nd_status != NDS_OK) + { + IMRD_LM_LOG_ERROR_2( "%s : ND_Value_Alloc -- SDM_Appl_Manager failed (%d) !", sFunctionName, nd_status); + status = IMRS_KO; + } + else + { + /* Ajout de l'objet Appli */ + myAppli->Id = hAppliId; + strcpy(myAppli->Name, (char *) vAppliName.arr); + + nd_status = ND_DataStruct_Value_Add( *myRootAppli_Ptr_Ptr, (void *)(myAppli)); + if(nd_status != NDS_OK) + { + IMRD_LM_LOG_ERROR_2( "%s : ND_DataStruct_Value_Add -- SDM_Appl_Manager failed (%d) !", sFunctionName, nd_status); + status = IMRS_KO; + } + } + } + } while((sqlca.sqlcode == 0)&&(nd_status == NDS_OK)&&(status == IMRS_OK)); + + if (sqlca.sqlcode < 0) + { + IMRD_LM_LOG_ERROR_3( "Erreur %s. Erreur Oracle : %d - %s !", sFunctionName, sqlca.sqlcode, sqlca.sqlerrm.sqlerrmc); + status = IMRS_KO; + } + + EXEC SQL CLOSE cur_imr_appli; + } + + if(status == IMRS_OK) + { + index_type_ptr = Appl_Struct_final_idx_tab; + status = SDM_DataStruct_Finalize(*myRootAppli_Ptr_Ptr, index_type_ptr, IMRD_SDMD_APPL_STRUCT_IDX_NB); + /*SDM_DataStruct_Dump(*myRootAppli_Ptr_Ptr);*/ + } + else + { + nd_status = ND_DataStruct_Close(*myRootAppli_Ptr_Ptr); + if(nd_status != NDS_OK) + { + IMRD_LM_LOG_ERROR_1( "ND_DataStruct_Close() failed (%d) !", nd_status); + status == IMRS_KO; + } + } + + return(status); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_SQL_Load_Format(NDT_Root **myRootFormat_Ptr_Ptr) +{ + const char sFunctionName []="SDM_SQL_Load_Format"; + NDT_Status nd_status; + IMRT_Status status; + NDT_Index_Type *index_type_ptr; + IMRT_Fmt *myFmt_Ptr; + IMRT_Data_Version *Data_Version_Ptr; + + EXEC SQL BEGIN DECLARE SECTION; + IMRT_Fmt_Id hFormatId; + VARCHAR vFormatName[IMRD_FMT_NAME_SIZE]; + short hIndFormatId; + short hIndFormatName; + EXEC SQL END DECLARE SECTION; + + /* initialisation */ + index_type_ptr = Fmt_Struct_initial_idx_tab; + + Data_Version_Ptr = (IMRT_Data_Version *) malloc(sizeof(IMRT_Data_Version)); + status = SDM_SQL_Set_Struct_Version(Data_Version_Ptr, "Fmt"); + if (status != IMRS_OK) + { + return(IMRS_KO); + } + + nd_status = ND_DataStruct_Open(myRootFormat_Ptr_Ptr, IMRD_SDMD_FMT_STRUCT_IDX_NB,index_type_ptr, "SDM_Fmt_Manager",SDM_Fmt_Manager, NULL, NULL, NULL, NULL,0, Data_Version_Ptr); + if(nd_status != NDS_OK) + { + IMRD_LM_LOG_ERROR_2( "%s : ND_DataStruct_Open -- SDM_Fmt_Manager failed (%d) !", sFunctionName, nd_status); + status = IMRS_KO; + } + else + { + EXEC SQL DECLARE cur_imr_format CURSOR FOR + SELECT FORMAT_ID, FORMAT_NAME + FROM IMR_FORMAT + ORDER BY FORMAT_ID ASC; + + EXEC SQL OPEN cur_imr_format; + do + { + memset(vFormatName.arr, '\0', (size_t) IMRD_FMT_NAME_SIZE); + + EXEC SQL FETCH cur_imr_format + INTO :hFormatId:hIndFormatId, + :vFormatName:hIndFormatName; + if (sqlca.sqlcode == 0) + { + /* creation d'un nouveau objet format */ + nd_status = ND_Value_Alloc( *myRootFormat_Ptr_Ptr, (void **)&(myFmt_Ptr)); + if(nd_status != NDS_OK) + { + IMRD_LM_LOG_ERROR_2( "%s : ND_Value_Alloc -- SDM_Fmt_Manager failed (%d) !", sFunctionName, nd_status); + status = IMRS_KO; + } + else + { + /* Ajout de l'objet Format */ + myFmt_Ptr->Id = hFormatId; + strcpy(myFmt_Ptr->Name, (char *) vFormatName.arr); + + status = SDM_SQL_LoadFmtMsg(myFmt_Ptr); + + if (status == IMRS_OK) + { + /* Add */ + nd_status = ND_DataStruct_Value_Add( *myRootFormat_Ptr_Ptr, (void *)(myFmt_Ptr)); + if(nd_status != NDS_OK) + { + IMRD_LM_LOG_ERROR_2( "%s : ND_DataStruct_Value_Add -- SDM_Fmt_Manager failed (%d) !", sFunctionName, nd_status); + status = IMRS_KO; + } + } + } + } + } while((sqlca.sqlcode == 0)&&(nd_status == NDS_OK)&&(status == IMRS_OK)); + + if (sqlca.sqlcode < 0) + { + IMRD_LM_LOG_ERROR_3( "Erreur %s. Erreur Oracle : %d - %s !", sFunctionName, sqlca.sqlcode, sqlca.sqlerrm.sqlerrmc); + status = IMRS_KO; + } + + EXEC SQL CLOSE cur_imr_format; + + if(status == IMRS_OK) + { + index_type_ptr = Fmt_Struct_final_idx_tab; + status = SDM_DataStruct_Finalize(*myRootFormat_Ptr_Ptr, index_type_ptr, IMRD_SDMD_FMT_STRUCT_IDX_NB); + /*SDM_DataStruct_Dump( *myRootFormat_Ptr_Ptr);*/ + } + else + { + if(myFmt_Ptr->FmtMsg_Struct_Ptr != NULL) + { + nd_status = ND_DataStruct_Close(myFmt_Ptr->FmtMsg_Struct_Ptr); + if(nd_status != NDS_OK) + { + IMRD_LM_LOG_ERROR_1( "ND_DataStruct_Close() failed (%d) !", nd_status); + } + } + + nd_status = ND_DataStruct_Close(*myRootFormat_Ptr_Ptr); + if(nd_status != NDS_OK) + { + IMRD_LM_LOG_ERROR_1( "ND_DataStruct_Close() failed (%d) !", nd_status); + } + } + } + + return(status); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_SQL_LoadFmtMsg(IMRT_Fmt *myFormat_Ptr) +{ + const char sFunctionName []="SDM_SQL_LoadFmtMsg"; + NDT_Status nd_status; + IMRT_Status status, statusTmp; + NDT_Node *node_ptr; + IMRT_Msg message; + IMRT_FmtMsg *myFmtMsg_Ptr; + IMRT_FmtAttr fmtattr; + + EXEC SQL BEGIN DECLARE SECTION; + IMRT_Msg_Id hMsgId; + IMRT_FmtAttr_Id hFmtAttrId; + IMRT_Branche_Id hFmtMsgBrancheId; + + short hIndMsgId; + short hIndFmtAttrId; + short hIndFmtMsgBrancheId; + EXEC SQL END DECLARE SECTION; + + + status = IMRS_OK; + + EXEC SQL DECLARE cur_imr_fmt_msg CURSOR FOR + SELECT MSG_ID, FMTATTR_ID, FMTMSG_BRANCHE_ID + FROM IMR_FMT_MSG + WHERE FORMAT_ID = :myFormat_Ptr->Id + ORDER BY NUM_ORDRE_FMT_MSG ASC; + + EXEC SQL OPEN cur_imr_fmt_msg; + do + { + EXEC SQL FETCH cur_imr_fmt_msg + INTO :hMsgId:hIndMsgId, + :hFmtAttrId:hIndFmtAttrId, + :hFmtMsgBrancheId:hIndFmtMsgBrancheId; + if (sqlca.sqlcode == 0) + { + /* Allacation de ListField */ + nd_status = ND_Value_Alloc( myFormat_Ptr->FmtMsg_Struct_Ptr, (void **)&(myFmtMsg_Ptr)); + if (nd_status != NDS_OK) + { + IMRD_LM_LOG_ERROR_2( "%s : ND_Value_Alloc -- Field failed (%d) !", sFunctionName, nd_status); + status = IMRS_KO; + } + else + { + /*recherch du message avec le nom*/ + message.Id = hMsgId; + nd_status = ND_Index_Node_Find( &node_ptr, IMRG_SDM_Base.RootMsg, + IMRD_SDMD_MSG_IDX_ID, &message, NULL); + if((nd_status != NDS_OK)||(node_ptr == NULL)) + { + IMRD_LM_LOG_ERROR_1( "Erreur lors de la recherche Message <%d> !", message.Id); + status = IMRS_KO; + } + else + { + myFmtMsg_Ptr->Msg_Ptr = node_ptr->Value; + } + + if(status == IMRS_OK) + { + if(hIndFmtMsgBrancheId >= 0) + { + myFmtMsg_Ptr->Branche_Id = hFmtMsgBrancheId; + } + + if(hIndFmtAttrId >= 0) + { + fmtattr.Id = hFmtAttrId; + nd_status = ND_Index_Node_Find( &node_ptr, IMRG_SDM_Base.RootFmtAttr, + IMRD_SDMD_FMTATTR_IDX_ID, &fmtattr, NULL); + if((nd_status != NDS_OK)||(node_ptr == NULL)) + { + IMRD_LM_LOG_ERROR_1( "Erreur lors de la recherche du FmtAttr <%d> !", fmtattr.Id); + status = IMRS_KO; + } + else + { + myFmtMsg_Ptr->FmtAttr_Ptr = node_ptr->Value; + } + } + + if(status == IMRS_OK) + { + nd_status = ND_DataStruct_Value_Add( myFormat_Ptr->FmtMsg_Struct_Ptr, (void *)(myFmtMsg_Ptr)); + if(nd_status != NDS_OK) + { + IMRD_LM_LOG_ERROR_1( "ND_Value_Add() failed (%d) !", nd_status); + status = IMRS_KO; + } + } + } + } + } + } while((sqlca.sqlcode == 0)&&(nd_status == NDS_OK)&&(status == IMRS_OK)); + + if (sqlca.sqlcode < 0) + { + IMRD_LM_LOG_ERROR_3( "Erreur %s. Erreur Oracle : %d - %s !", sFunctionName, sqlca.sqlcode, sqlca.sqlerrm.sqlerrmc); + status = IMRS_KO; + } + + EXEC SQL CLOSE cur_imr_fmt_msg; + + if(status != IMRS_OK) + { + free(myFmtMsg_Ptr); + } + /*if(status != IMRS_OK) + { + nd_status = ND_Value_Free(myFormat_Ptr->FmtMsg_Struct_Ptr, (void **)&(myFmtMsg_Ptr)); + printf("1111111 %d pointer %lx\n", nd_status, myFmtMsg_Ptr); + }*/ + + return(status); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_SQL_Load_MapPath(NDT_Root **myRootMapPath_Ptr_Ptr) +{ + const char sFunctionName []="SDM_SQL_Load_MapPath"; + NDT_Status nd_status; + IMRT_Status status; + NDT_Index_Type *index_type_ptr; + IMRT_MapPath *myMapPath_Ptr; + NDT_Node *node_ptr; + IMRT_MsgMap msgmap; + IMRT_Appl appli; + IMRT_Fmt fmt; + IMRT_Msg msg; + IMRT_Data_Version *Data_Version_Ptr; + + EXEC SQL BEGIN DECLARE SECTION; + short hMapPathId; + IMRT_Fmt_Id hFormatInId; + IMRT_Fmt_Id hFormatOutId; + IMRT_Appl_Id hAppliInId; + IMRT_Appl_Id hAppliOutId; + short hIndMapPathId; + short hIndFormatInId; + short hIndFormatOutId; + short hIndAppliInId; + short hIndAppliOutId; + EXEC SQL END DECLARE SECTION; + + /*initialisation des indexes*/ + index_type_ptr = index_type_initial_tab; + + Data_Version_Ptr = (IMRT_Data_Version *) malloc(sizeof(IMRT_Data_Version)); + status = SDM_SQL_Set_Struct_Version(Data_Version_Ptr, "MapPath"); + if (status != IMRS_OK) + { + return(IMRS_KO); + } + + nd_status = ND_DataStruct_Open(myRootMapPath_Ptr_Ptr, IMRD_SDMD_INDEX_NB, index_type_ptr, "SDM_MapPath_Manager",SDM_MapPath_Manager, NULL, NULL, NULL, NULL,0, Data_Version_Ptr); + if(nd_status != NDS_OK) + { + IMRD_LM_LOG_ERROR_2( "%s : ND_DataStruct_Open -- SDM_MapPath_Manager failed (%d) !", sFunctionName, nd_status); + return(IMRS_KO); + } + else + { + EXEC SQL DECLARE cur_imr_map_path CURSOR FOR + SELECT MAP_PATH_ID, APPLI_IN_ID, APPLI_OUT_ID, FORMAT_IN_ID, FORMAT_OUT_ID + FROM IMR_MAPPATH + ORDER BY MAP_PATH_ID ASC; + + EXEC SQL OPEN cur_imr_map_path; + do + { + + EXEC SQL FETCH cur_imr_map_path + INTO :hMapPathId:hIndMapPathId, + :hAppliInId:hIndAppliInId, + :hAppliOutId:hIndAppliOutId, + :hFormatInId:hIndFormatInId, + :hFormatOutId:hIndFormatOutId; + if (sqlca.sqlcode == 0) + { + nd_status = ND_Value_Alloc( *myRootMapPath_Ptr_Ptr, (void **)&(myMapPath_Ptr)); + if(nd_status != NDS_OK) + { + IMRD_LM_LOG_ERROR_2( "%s : ND_Value_Alloc -- SDM_MapPath_Manager failed (%d) !", sFunctionName, nd_status); + return(IMRS_KO); + } + else + { + myMapPath_Ptr->idMapPath = hMapPathId; + /* APPLI IN */ + appli.Id = hAppliInId; + nd_status = ND_Index_Node_Find( &node_ptr, IMRG_SDM_Base.RootAppl, + IMRD_SDMD_APPL_IDX_ID, &appli, NULL); + if((nd_status != NDS_OK)||(node_ptr == NULL)) + { + IMRD_LM_LOG_ERROR_1( "Erreur lors de la recherche du IN Appli <%d> !", appli.Id); + return(IMRS_KO); + } + else + { + myMapPath_Ptr->Appl_Input_Ptr = node_ptr->Value; + } + /* APPLI OUT */ + appli.Id = hAppliOutId; + nd_status = ND_Index_Node_Find( &node_ptr, IMRG_SDM_Base.RootAppl, + IMRD_SDMD_APPL_IDX_ID, &appli, NULL); + if((nd_status != NDS_OK)||(node_ptr == NULL)) + { + IMRD_LM_LOG_ERROR_1( "Erreur lors de la recherche du OUT Appli <%d> !", appli.Id); + return(IMRS_KO); + } + else + { + myMapPath_Ptr->Appl_Output_Ptr = node_ptr->Value; + } + /* FORMAT IN */ + fmt.Id = hFormatInId; + nd_status = ND_Index_Node_Find( &node_ptr, IMRG_SDM_Base.RootFmt, + IMRD_SDMD_FMT_IDX_ID, &fmt, NULL); + if((nd_status != NDS_OK)||(node_ptr == NULL)) + { + IMRD_LM_LOG_ERROR_1( "Erreur lors de la recherche du Format IN <%d> !", fmt.Id); + return(IMRS_KO); + } + else + { + myMapPath_Ptr->Fmt_Input_Ptr = node_ptr->Value; + } + /* FORMAT OUT */ + fmt.Id = hFormatOutId; + nd_status = ND_Index_Node_Find( &node_ptr, IMRG_SDM_Base.RootFmt, + IMRD_SDMD_FMT_IDX_ID, &fmt, NULL); + if((nd_status != NDS_OK)||(node_ptr == NULL)) + { + IMRD_LM_LOG_ERROR_1( "Erreur lors de la recherche du Format OUT <%d> !", fmt.Id); + return(IMRS_KO); + } + else + { + myMapPath_Ptr->Fmt_Output_Ptr = node_ptr->Value; + } + + status = SDM_SQL_LoadMapCmd(myMapPath_Ptr); + if (status == IMRS_OK) + { + /*** Add ***/ + nd_status = ND_DataStruct_Value_Add(*myRootMapPath_Ptr_Ptr, (void *)(myMapPath_Ptr)); + if(nd_status != NDS_OK) + { + IMRD_LM_LOG_ERROR_2( "%s : ND_DataStruct_Value_Add -- SDM_MapPath_Manager failed (%d) !", sFunctionName, nd_status); + return(IMRS_KO); + } + } + } + } + } while((sqlca.sqlcode == 0)&&(nd_status == NDS_OK)&&(status == IMRS_OK)); + + if (sqlca.sqlcode < 0) + { + IMRD_LM_LOG_ERROR_3( "Erreur %s. Erreur Oracle : %d - %s !", sFunctionName, sqlca.sqlcode, sqlca.sqlerrm.sqlerrmc); + status = IMRS_KO; + } + + EXEC SQL CLOSE cur_imr_map_path; + + if(status == IMRS_OK) + { + /*SDM_DataStruct_Dump(*myRootMapPath_Ptr_Ptr);*/ + } + else + { + if(myMapPath_Ptr->MapCmd_Struct_Ptr != NULL) + { + nd_status = ND_DataStruct_Close(myMapPath_Ptr->MapCmd_Struct_Ptr); + if(nd_status != NDS_OK) + { + IMRD_LM_LOG_ERROR_1( "ND_DataStruct_Close() failed (%d) !", nd_status); + } + } + + nd_status = ND_DataStruct_Close(*myRootMapPath_Ptr_Ptr); + if(nd_status != NDS_OK) + { + IMRD_LM_LOG_ERROR_1( "ND_DataStruct_Close() failed (%d) !", nd_status); + } + } + } + + return(status); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_SQL_LoadMapCmd(IMRT_MapPath *myMapPath_Ptr) + +{ + const char sFunctionName []="SDM_SQL_LoadMapCmd"; + NDT_Status nd_status; + IMRT_Status status, statusTmp; + NDT_Index_Type *index_type_ptr; + NDT_Node *node_ptr; + IMRT_MapCmd *myMapCmd_Ptr; + IMRT_MsgMap msgmap; + IMRT_Fmt fmt; + IMRT_Msg Msg; + int myJumpTableNbElt; + IMRT_Jump myJumpTable; + IMRT_FmtAttr fmtattr; + + EXEC SQL BEGIN DECLARE SECTION; + short hMapCmdId; + short hMapCmdType; + IMRT_MapCmd_Branch_Id hCurrentBrancheId; + short hCopyBufferIdInput; + short hCopyBufferIdOutput; + IMRT_Fmt_Id hFormatInId; + IMRT_FmtAttr_Id hFmtAttrInId; + IMRT_Fmt_Id hFormatOutId; + IMRT_FmtAttr_Id hFmtAttrOutId; + IMRT_MsgMap_Id hMsgMapId; + short hMapBufferIdInput; + short hMapBufferIdOutput; + short hClearFlag; + short hBufferIdIdent; + char IdentTotal; + IMRT_Msg_Id hIdentFirstMsgId; + IMRT_MapCmd_Branch_Id hGotoBrancheId; + + short hIndMapCmdId; + short hIndMapCmdType; + short hIndCurrentBrancheId; + short hIndCopyBufferIdInput; + short hIndCopyBufferIdOutput; + short hIndFormatInId; + short hIndFmtAttrInId; + short hIndFormatOutId; + short hIndFmtAttrOutId; + short hIndMsgMapId; + short hIndMapBufferIdInput; + short hIndMapBufferIdOutput; + short hIndClearFlag; + short hIndBufferIdIdent; + short hIndIdentTotal; + short hIndIdentFirstMsgId; + short hIndGotoBrancheId; + EXEC SQL END DECLARE SECTION; + + /*initialisation des indexes*/ + index_type_ptr = index_type_initial_tab; + status = IMRS_OK; + myJumpTableNbElt = 0; + + EXEC SQL DECLARE cur_imr_cmd_map_path CURSOR FOR + SELECT A.MAPCMD_ID, B.MAPCMD_TYPE, B.CURRENT_BRANCHE_ID, + C.COPY_BUFFER_ID_INPUT, C.COPY_BUFFER_ID_OUTPUT, + D.FORMAT_IN_ID, D.FMTATTR_IN_ID, D.FORMAT_OUT_ID, D.FMTATTR_OUT_ID, + D.MSG_MAP_ID, D.MAP_BUFFER_ID_INPUT, D.MAP_BUFFER_ID_OUTPUT, D.CLEAR_FLAG, + F.IDENT_BUFFER_ID, F.IDENT_TOTAL, F.IDENT_FIRST_MSG_ID, G.GOTO_BRANCHE_ID + FROM IMR_CMD_MAP_PATH A, IMR_MAPCMD B, IMR_CMD_COPY C, + IMR_CMD_MAP D, IMR_CMD_IDENT F, IMR_CMD_GOTO G + WHERE A.MAPCMD_ID = B.MAPCMD_ID + AND B.MAPCMD_ID = C.MAPCMD_ID(+) + AND B.MAPCMD_ID = D.MAPCMD_ID(+) + AND B.MAPCMD_ID = F.MAPCMD_ID(+) + AND B.MAPCMD_ID = G.MAPCMD_ID(+) + AND A.MAP_PATH_ID = :myMapPath_Ptr->idMapPath + ORDER BY A.MAPCMD_ID ASC; + + EXEC SQL OPEN cur_imr_cmd_map_path; + do + { + + EXEC SQL FETCH cur_imr_cmd_map_path + INTO :hMapCmdId:hIndMapCmdId, + :hMapCmdType:hIndMapCmdType, + :hCurrentBrancheId:hIndCurrentBrancheId, + :hCopyBufferIdInput:hIndCopyBufferIdInput, + :hCopyBufferIdOutput:hIndCopyBufferIdOutput, + :hFormatInId:hIndFormatInId, + :hFmtAttrInId:hIndFmtAttrInId, + :hFormatOutId:hIndFormatOutId, + :hFmtAttrOutId:hIndFmtAttrOutId, + :hMsgMapId:hIndMsgMapId, + :hMapBufferIdInput:hIndMapBufferIdInput, + :hMapBufferIdOutput:hIndMapBufferIdOutput, + :hClearFlag:hIndClearFlag, + :hBufferIdIdent:hIndBufferIdIdent, + :IdentTotal:hIndIdentTotal, + :hIdentFirstMsgId:hIndIdentFirstMsgId, + :hGotoBrancheId:hIndGotoBrancheId; + + if (sqlca.sqlcode == 0) + { + /* Alloc */ + nd_status = ND_Value_Alloc( myMapPath_Ptr->MapCmd_Struct_Ptr, (void **)&(myMapCmd_Ptr)); + if(nd_status != NDS_OK) + { + IMRD_LM_LOG_ERROR_2( "%s : ND_Value_Alloc -- MapCmd failed (%d) !", sFunctionName, nd_status); + status = IMRS_KO; + } + else + { + /* Add */ + /********************************************************/ + myMapCmd_Ptr->MapCmd_Id = hMapCmdId; + myMapCmd_Ptr->TypeCmd = hMapCmdType; + if (hIndCurrentBrancheId >= 0) + myMapCmd_Ptr->Branche_Id = hCurrentBrancheId; + if (hMapCmdType == IMRD_MAPCMD_TYPE_MAP) + { + if (hIndMapBufferIdInput >= 0) + myMapCmd_Ptr->Buffer_Id_Input = hMapBufferIdInput; + if (hIndMapBufferIdOutput >= 0) + myMapCmd_Ptr->Buffer_Id_Output = hMapBufferIdOutput; + } + else if (hMapCmdType == IMRD_MAPCMD_TYPE_COPY) + { + if (hIndCopyBufferIdInput >= 0) + myMapCmd_Ptr->Buffer_Id_Input = hCopyBufferIdInput; + if (hIndCopyBufferIdOutput >= 0) + myMapCmd_Ptr->Buffer_Id_Output = hCopyBufferIdOutput; + } + if (hIndClearFlag >= 0) + myMapCmd_Ptr->Clear_Flag = hClearFlag; + if (hIndBufferIdIdent >= 0) + myMapCmd_Ptr->Buffer_Id_Ident = hBufferIdIdent; + if (hIndIdentTotal >= 0) + { + if (IdentTotal == IMRD_YES) + myMapCmd_Ptr->Ident_Total = IMRD_TRUE; + else + myMapCmd_Ptr->Ident_Total = IMRD_FALSE; + } + if (hIndIdentFirstMsgId >= 0) + { + Msg.Id = hIdentFirstMsgId; + nd_status = ND_Index_Node_Find( &node_ptr, IMRG_SDM_Base.RootMsg, + IMRD_SDMD_MSG_IDX_ID, &Msg, NULL); + if((nd_status != NDS_OK)||(node_ptr == NULL)) + { + IMRD_LM_LOG_ERROR_1( "Erreur lors de la recherche du Message <%d> !", Msg.Id); + status = IMRS_KO; + } + else + { + myMapCmd_Ptr->Ident_First_Msg_Ptr = node_ptr->Value; + } + } + + /********************************************************/ + + if (hMapCmdType == IMRD_MAPCMD_TYPE_GOTO) + { + myMapCmd_Ptr->Goto_Branche_Id = hGotoBrancheId; + } + + if (hMapCmdType == IMRD_MAPCMD_TYPE_MAP) + { + /* FORMAT IN */ + fmt.Id = hFormatInId; + nd_status = ND_Index_Node_Find( &node_ptr, IMRG_SDM_Base.RootFmt, + IMRD_SDMD_FMT_IDX_ID, &fmt, NULL); + if((nd_status != NDS_OK)||(node_ptr == NULL)) + { + IMRD_LM_LOG_ERROR_1( "Erreur lors de la recherche du Format IN <%d> !", fmt.Id); + status = IMRS_KO; + } + else + { + myMapCmd_Ptr->Fmt_Input_Ptr = node_ptr->Value; + } + + if (hIndFmtAttrInId >= 0) + { + fmtattr.Id = hFmtAttrInId; + nd_status = ND_Index_Node_Find( &node_ptr, IMRG_SDM_Base.RootFmtAttr, + IMRD_SDMD_FMTATTR_IDX_ID, &fmtattr, NULL); + if((nd_status != NDS_OK)||(node_ptr == NULL)) + { + IMRD_LM_LOG_ERROR_1( "Erreur lors de la recherche du FmtAttr IN <%d> !", fmtattr.Id); + status = IMRS_KO; + } + else + { + myMapCmd_Ptr->FmtAttr_Input_Ptr = node_ptr->Value; + } + } + /* FORMAT OUT */ + fmt.Id = hFormatOutId; + nd_status = ND_Index_Node_Find( &node_ptr, IMRG_SDM_Base.RootFmt, + IMRD_SDMD_FMT_IDX_ID, &fmt, NULL); + if((nd_status != NDS_OK)||(node_ptr == NULL)) + { + IMRD_LM_LOG_ERROR_1( "Erreur lors de la recherche du Format OUT <%d> !", fmt.Id); + status = IMRS_KO; + } + else + { + myMapCmd_Ptr->Fmt_Output_Ptr = node_ptr->Value; + } + + if (hIndFmtAttrOutId >= 0) + { + fmtattr.Id = hFmtAttrOutId; + nd_status = ND_Index_Node_Find( &node_ptr, IMRG_SDM_Base.RootFmtAttr, + IMRD_SDMD_FMTATTR_IDX_ID, &fmtattr, NULL); + if((nd_status != NDS_OK)||(node_ptr == NULL)) + { + IMRD_LM_LOG_ERROR_1( "Erreur lors de la recherche du FmtAttr OUT <%d> !", fmtattr.Id); + status = IMRS_KO; + } + else + { + myMapCmd_Ptr->FmtAttr_Output_Ptr = node_ptr->Value; + } + } + /* MsgMap */ + msgmap.Id = hMsgMapId; + nd_status = ND_Index_Node_Find( &node_ptr, IMRG_SDM_Base.RootMsgMap, + IMRD_SDMD_MSGMAP_IDX_ID, &msgmap, NULL); + if((nd_status != NDS_OK)||(node_ptr == NULL)) + { + IMRD_LM_LOG_ERROR_1( "Erreur lors de la recherche du MSGMAP <%d> !", msgmap.Id); + status = IMRS_KO; + } + else + { + myMapCmd_Ptr->MsgMap_Ptr = node_ptr->Value; + } + } + /*********** Jump Table ************/ + if((hMapCmdType == IMRD_MAPCMD_TYPE_IDENT)&&(status == IMRS_OK)) + { + status = SDM_SQL_Load_JumpTable(&(myMapCmd_Ptr->Jump_Tab), &myJumpTableNbElt, hMapCmdId); + if (status != IMRS_OK) + { + IMRD_LM_LOG_ERROR_1( "Erreur lors du chargement de la Jump Table : <%d> !", status); + } + else + { + myMapCmd_Ptr->JmpTbleNbElts = myJumpTableNbElt; + } + } + + nd_status = ND_DataStruct_Value_Add( myMapPath_Ptr->MapCmd_Struct_Ptr, (void *)(myMapCmd_Ptr)); + if(nd_status != NDS_OK) + { + IMRD_LM_LOG_ERROR_2( "%s : ND_DataStruct_Value_Add -- MapCmd failed (%d) !", sFunctionName, nd_status); + status = IMRS_KO; + } + } + } + } while((sqlca.sqlcode == 0)&&(nd_status == NDS_OK)&&(status == IMRS_OK)); + + if(status != IMRS_OK) + { + free(myMapCmd_Ptr); + } + + if (sqlca.sqlcode < 0) + { + IMRD_LM_LOG_ERROR_3( "Erreur %s. Erreur Oracle : %d - %s !", sFunctionName, sqlca.sqlcode, sqlca.sqlerrm.sqlerrmc); + status = IMRS_KO; + } + + EXEC SQL CLOSE cur_imr_cmd_map_path; + + return(status); + +} + + +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_SQL_Load_JumpTable(IMRT_Jump **JumpTable_Ptr_Ptr, int * JumpTableNbElt_Ptr ,IMRT_MapCmd_Id IdMapCmd) +{ + IMRT_Status status; + NDT_Status nd_status; + const char sFunctionName []="SDM_SQL_Load_JumpTable"; + + EXEC SQL BEGIN DECLARE SECTION; + IMRT_Msg_Id hMsgId; + IMRT_Fmt_Id hFormatId; + short hBrancheIdIdent; + short hIndMsgId; + short hIndFormatId; + short hIndBrancheIdIdent; + EXEC SQL END DECLARE SECTION; + + IMRT_Fmt fmt; + IMRT_Msg msg; + NDT_Node *node_ptr; + IMRT_Jump *jump_ptr; + short IndexTable; + + status = IMRS_OK; + IndexTable = -1; + jump_ptr = NULL; + + EXEC SQL DECLARE cur_imr_jump_table CURSOR FOR + SELECT MSG_ID, FORMAT_ID, IDENT_BRANCHE_ID + FROM IMR_JUMP_TABLE + WHERE MAPCMD_ID = :IdMapCmd + ORDER BY NUM_ORDRE_JUMP ASC; + + EXEC SQL OPEN cur_imr_jump_table; + do + { + + EXEC SQL FETCH cur_imr_jump_table + INTO :hMsgId:hIndMsgId, + :hFormatId:hIndFormatId, + :hBrancheIdIdent:hIndBrancheIdIdent; + + if (sqlca.sqlcode == 0) + { + IndexTable = IndexTable + 1; + *JumpTableNbElt_Ptr = IndexTable + 1; + jump_ptr = (IMRT_Jump *)realloc((void *)*JumpTable_Ptr_Ptr , + (size_t)((IndexTable + 1) * sizeof(IMRT_Jump))); + if (jump_ptr == NULL) + { + IMRD_LM_LOG_ERROR_0( "Erreur lors de la reallocation de la Jump Table !"); + return(IMRS_KO); + } + else + { + *JumpTable_Ptr_Ptr = jump_ptr; + if (hIndBrancheIdIdent >= 0) + (*JumpTable_Ptr_Ptr)[IndexTable].Branche_Id = hBrancheIdIdent; + } + + /* FORMAT */ + fmt.Id = hFormatId; + nd_status = ND_Index_Node_Find( &node_ptr, IMRG_SDM_Base.RootFmt, + IMRD_SDMD_FMT_IDX_ID, &fmt, NULL); + if((nd_status != NDS_OK)||(node_ptr == NULL)) + { + IMRD_LM_LOG_ERROR_1( "Erreur lors de la recherche Message <%d> !", fmt.Id); + return(IMRS_KO); + } + else + { + (*JumpTable_Ptr_Ptr)[IndexTable].Fmt_Ptr = node_ptr->Value; + } + /* Msg */ + msg.Id = hMsgId; + nd_status = ND_Index_Node_Find( &node_ptr, IMRG_SDM_Base.RootMsg, + IMRD_SDMD_MSG_IDX_ID, &msg, NULL); + if((nd_status != NDS_OK)||(node_ptr == NULL)) + { + IMRD_LM_LOG_ERROR_1( "Erreur lors de la recherche Message <%d> !", msg.Id); + return(IMRS_KO); + } + else + { + (*JumpTable_Ptr_Ptr)[IndexTable].Msg_Ptr = node_ptr->Value; + } + } + } while((sqlca.sqlcode == 0)&&(nd_status == NDS_OK)); + + if (sqlca.sqlcode < 0) + { + IMRD_LM_LOG_ERROR_3( "Erreur %s. Erreur Oracle : %d - %s !", sFunctionName, sqlca.sqlcode, sqlca.sqlerrm.sqlerrmc); + status = IMRS_KO; + } + + EXEC SQL CLOSE cur_imr_jump_table; + + + return(status); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_SQL_Dump_FmtAttr_Header(FILE *dump_file) +{ + fprintf(dump_file, "---------------------------------------------------\n"); + fprintf(dump_file, "-- Init file of IMR_FMT_ATTR --\n"); + fprintf(dump_file, "---------------------------------------------------\n\n"); + fprintf(dump_file, "INSERT INTO IMR_DATA_VERSION(VERS_NAME, VERS_LABEL, VERS_DATE) VALUES('FmtAttr', '%s', '%s');\n\n", + ((IMRT_Data_Version *)(IMRG_SDM_Base.RootFmtAttr->User_Ptr))->Label, + ((IMRT_Data_Version *)(IMRG_SDM_Base.RootFmtAttr->User_Ptr))->Date); + fprintf(dump_file, "Delete IMR_FMT_ATTR;\n\n"); + return( IMRS_OK); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_SQL_Dump_FmtAttr_Body(FILE *dump_file) +{ + IMRT_Status status; + NDT_Status nd_status; + + if( ( nd_status = ND_DataStruct_Traverse( IMRG_SDM_Base.RootFmtAttr, IMRD_SDMD_CMD_API_SQL_DUMP, dump_file)) != NDS_OK) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0( "SQL Dump RootFmtAttr failed !"); + } + else + { + status = IMRS_OK; + } + + return(status); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_SQL_Dump_FmtAttr_Footer(FILE *dump_file) +{ + fprintf(dump_file, "\nCommit;\n"); + return( IMRS_OK); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_SQL_Dump_FmtAttr(void) +{ + IMRT_Status status; + char dump_filename[255]; + FILE *dump_file; + + strcpy(dump_filename, "init_imr_fmt_attr.sql"); + + if( ( dump_file = fopen( dump_filename, "w")) == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_1( "Can't open dump file (%s) !", dump_filename); + } + else + { + status = SDM_SQL_Dump_FmtAttr_Header(dump_file); + if(status == IMRS_OK) + { + status = SDM_SQL_Dump_FmtAttr_Body(dump_file); + if(status == IMRS_OK) + { + status = SDM_SQL_Dump_FmtAttr_Footer(dump_file); + } + } + + fclose( dump_file); + } + + return(status); + +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_SQL_Dump_Appli_Header(FILE *dump_file) +{ + fprintf(dump_file, "---------------------------------------------------\n"); + fprintf(dump_file, "-- Init file of IMR_APPLI --\n"); + fprintf(dump_file, "---------------------------------------------------\n\n"); + fprintf(dump_file, "INSERT INTO IMR_DATA_VERSION(VERS_NAME, VERS_LABEL, VERS_DATE) VALUES('Appl', '%s', '%s');\n\n", + ((IMRT_Data_Version *)(IMRG_SDM_Base.RootAppl->User_Ptr))->Label, + ((IMRT_Data_Version *)(IMRG_SDM_Base.RootAppl->User_Ptr))->Date); + fprintf(dump_file, "Delete IMR_APPLI;\n\n"); + return( IMRS_OK); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_SQL_Dump_Appli_Body(FILE *dump_file) +{ + IMRT_Status status; + NDT_Status nd_status; + + if( ( nd_status = ND_DataStruct_Traverse( IMRG_SDM_Base.RootAppl, IMRD_SDMD_CMD_API_SQL_DUMP, dump_file)) != NDS_OK) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0( "SQL Dump RootAppl failed !"); + } + else + { + status = IMRS_OK; + } + + return(status); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_SQL_Dump_Appli_Footer(FILE *dump_file) +{ + fprintf(dump_file, "\nCommit;\n"); + return( IMRS_OK); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_SQL_Dump_Appli(void) +{ + IMRT_Status status; + char dump_filename[255]; + FILE *dump_file; + + strcpy(dump_filename, "init_imr_appli.sql"); + + if( ( dump_file = fopen( dump_filename, "w")) == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_1( "Can't open dump file (%s) !", dump_filename); + } + else + { + status = SDM_SQL_Dump_Appli_Header(dump_file); + if(status == IMRS_OK) + { + status = SDM_SQL_Dump_Appli_Body(dump_file); + if(status == IMRS_OK) + { + status = SDM_SQL_Dump_Appli_Footer(dump_file); + } + } + + fclose( dump_file); + } + + return(status); + +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_SQL_Dump_Format_Header(FILE *dump_file) +{ + fprintf(dump_file, "---------------------------------------------------\n"); + fprintf(dump_file, "-- Init file of IMR_FORMAT & IMR_FMT_MSG --\n"); + fprintf(dump_file, "---------------------------------------------------\n\n"); + fprintf(dump_file, "INSERT INTO IMR_DATA_VERSION(VERS_NAME, VERS_LABEL, VERS_DATE) VALUES('Fmt', '%s', '%s');\n\n", + ((IMRT_Data_Version *)(IMRG_SDM_Base.RootFmt->User_Ptr))->Label, + ((IMRT_Data_Version *)(IMRG_SDM_Base.RootFmt->User_Ptr))->Date); + fprintf(dump_file, "Delete IMR_FMT_MSG;\n\n"); + fprintf(dump_file, "Delete IMR_FORMAT;\n\n"); + return( IMRS_OK); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_SQL_Dump_Format_Body(FILE *dump_file) +{ + IMRT_Status status; + NDT_Status nd_status; + + if( ( nd_status = ND_DataStruct_Traverse( IMRG_SDM_Base.RootFmt, IMRD_SDMD_CMD_API_SQL_DUMP, dump_file)) != NDS_OK) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0( "SQL Dump RootFmt failed !"); + } + else + { + status = IMRS_OK; + } + + return(status); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_SQL_Dump_Format_Footer(FILE *dump_file) +{ + fprintf(dump_file, "\nCommit;\n"); + return( IMRS_OK); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_SQL_Dump_Format(void) +{ + IMRT_Status status; + char dump_filename[255]; + FILE *dump_file; + + strcpy(dump_filename, "init_imr_format.sql"); + + if( ( dump_file = fopen( dump_filename, "w")) == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_1( "Can't open dump file (%s) !", dump_filename); + } + else + { + status = SDM_SQL_Dump_Format_Header(dump_file); + if(status == IMRS_OK) + { + status = SDM_SQL_Dump_Format_Body(dump_file); + if(status == IMRS_OK) + { + status = SDM_SQL_Dump_Format_Footer(dump_file); + } + } + + fclose( dump_file); + } + + return(status); + +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_SQL_Dump_MapPath_Header(FILE *dump_file) +{ + fprintf(dump_file, "---------------------------------------------------\n"); + fprintf(dump_file, "-- Init file of IMR_MAPPATH & IMR_CMD_MAP_PATH --\n"); + fprintf(dump_file, "-- IMR_MAPCMD & IMR_CMD_IDENT --\n"); + fprintf(dump_file, "-- IMR_JUMP_TABLE & IMR_CMD_MAP --\n"); + fprintf(dump_file, "-- IMR_CMD_GOTO & IMR_CMD_COPY --\n"); + fprintf(dump_file, "---------------------------------------------------\n\n"); + fprintf(dump_file, "INSERT INTO IMR_DATA_VERSION(VERS_NAME, VERS_LABEL, VERS_DATE) VALUES('MapPath', '%s', '%s');\n\n", + ((IMRT_Data_Version *)(IMRG_SDM_Base.RootMapPath->User_Ptr))->Label, + ((IMRT_Data_Version *)(IMRG_SDM_Base.RootMapPath->User_Ptr))->Date); + fprintf(dump_file, "Delete IMR_CMD_COPY;\n\n"); + fprintf(dump_file, "Delete IMR_CMD_GOTO;\n\n"); + fprintf(dump_file, "Delete IMR_CMD_MAP;\n\n"); + fprintf(dump_file, "Delete IMR_JUMP_TABLE;\n\n"); + fprintf(dump_file, "Delete IMR_CMD_IDENT;\n\n"); + fprintf(dump_file, "Delete IMR_MAPCMD;\n\n"); + fprintf(dump_file, "Delete IMR_CMD_MAP_PATH;\n\n"); + fprintf(dump_file, "Delete IMR_MAPPATH;\n\n"); + return( IMRS_OK); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_SQL_Dump_MapPath_Body(FILE *dump_file) +{ + IMRT_Status status; + NDT_Status nd_status; + + if( ( nd_status = ND_DataStruct_Traverse( IMRG_SDM_Base.RootMapPath, IMRD_SDMD_CMD_API_SQL_DUMP, dump_file)) != NDS_OK) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0( "SQL Dump RootMapPath failed !"); + } + else + { + status = IMRS_OK; + } + + return(status); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_SQL_Dump_MapPath_Footer(FILE *dump_file) +{ + fprintf(dump_file, "\nCommit;\n"); + return( IMRS_OK); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_SQL_Dump_MapPath(void) +{ + IMRT_Status status; + char dump_filename[255]; + FILE *dump_file; + + strcpy(dump_filename, "init_imr_mappath.sql"); + + if( ( dump_file = fopen( dump_filename, "w")) == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_1( "Can't open dump file (%s) !", dump_filename); + } + else + { + status = SDM_SQL_Dump_MapPath_Header(dump_file); + if(status == IMRS_OK) + { + status = SDM_SQL_Dump_MapPath_Body(dump_file); + if(status == IMRS_OK) + { + status = SDM_SQL_Dump_MapPath_Footer(dump_file); + } + } + + fclose( dump_file); + } + + return(status); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_SQL_BufferInfo_Dump(void) +{ + IMRT_Status status; + char dump_filename[255]; + FILE *dump_file; + + status = SDM_SQL_Dump_Appli(); + + if(status == IMRS_OK) + { + status = SDM_SQL_Dump_Format(); + if(status == IMRS_OK) + { + status = SDM_SQL_Dump_MapPath(); + if(status == IMRS_OK) + { + status = SDM_SQL_Dump_FmtAttr(); + if(status == IMRS_OK) + { + strcpy(dump_filename, "init_imr_mapcmd_type.sql"); + + if( ( dump_file = fopen( dump_filename, "w")) == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_1( "Can't open dump file (%s) !", dump_filename); + } + else + { + fprintf(dump_file, "---------------------------------------------------\n"); + fprintf(dump_file, "-- Init file of IMR_MAPCMD_TYPE --\n"); + fprintf(dump_file, "---------------------------------------------------\n\n"); + fprintf(dump_file, "Delete IMR_MAPCMD_TYPE;\n\n"); + + fprintf(dump_file, "INSERT INTO IMR_MAPCMD_TYPE(MAPCMD_TYPE) VALUES(0);\n"); + fprintf(dump_file, "INSERT INTO IMR_MAPCMD_TYPE(MAPCMD_TYPE) VALUES(1);\n"); + fprintf(dump_file, "INSERT INTO IMR_MAPCMD_TYPE(MAPCMD_TYPE) VALUES(2);\n"); + fprintf(dump_file, "INSERT INTO IMR_MAPCMD_TYPE(MAPCMD_TYPE) VALUES(3);\n"); + fprintf(dump_file, "INSERT INTO IMR_MAPCMD_TYPE(MAPCMD_TYPE) VALUES(4);\n"); + + fprintf(dump_file, "\nCommit;\n"); + + fclose( dump_file); + } + } + } + } + } + + return(status); +} +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ diff --git a/src/libstatic_data_mng/src/buffer_info_xml.c b/src/libstatic_data_mng/src/buffer_info_xml.c new file mode 100644 index 0000000..8f908d2 --- /dev/null +++ b/src/libstatic_data_mng/src/buffer_info_xml.c @@ -0,0 +1,1837 @@ +/*----------------------------------------------------------------------------*/ +/* File: buffer_info_xml.c */ +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#define _LIBSTATIC_DATA_MNG_ +#define _BUFFER_INFO_XML_C_ + +#include "buffer_info_xml.h" + + + +IMRT_Status SDM_XML_BufferInfo_Init(IMRT_Path Lib_Path) +{ + SDMT_BufferInfo_Contexte Buffer_Info_Ctx; + IMRT_Status status, StatusTmp; + char Xml_File_Name[255]; + + + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_0, "Loading FmtAttr..."); + + Buffer_Info_Ctx.flagerror = 0; + Buffer_Info_Ctx.CptFmtAttr = IMRD_FMTATTR_ID_UNKNOWN; + memset(Buffer_Info_Ctx.PathArray,0,sizeof(Buffer_Info_Ctx.PathArray)); + Buffer_Info_Ctx.PresentLevelTag = IMRD_SDMD_MIN_LEVEL_TAG; + memset(Xml_File_Name,0,sizeof(Xml_File_Name)); + strcpy(Xml_File_Name, Lib_Path); + strcat(Xml_File_Name, "/"); + strcat(Xml_File_Name, SDMD_FMTATTR_FILE); + + status = SDM_XML_Load_FmtAttr(Xml_File_Name, &(Buffer_Info_Ctx)); + + if(status == IMRS_OK) + { + IMRG_SDM_Base.RootFmtAttr = Buffer_Info_Ctx.RootFmtAttr; + + IMRD_LM_LOG_INFO_1( "FmtAtt loaded: (%d)", IMRG_SDM_Base.RootFmtAttr->Index_Tab[NDD_INDEX_PRIMARY].Node_Number); + + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_0, "Loading Fmt..."); + + Buffer_Info_Ctx.flagerror = 0; + Buffer_Info_Ctx.CptFmt = IMRD_FMT_ID_UNKNOWN; + memset(Buffer_Info_Ctx.PathArray,0,sizeof(Buffer_Info_Ctx.PathArray)); + Buffer_Info_Ctx.PresentLevelTag = IMRD_SDMD_MIN_LEVEL_TAG; + memset(Xml_File_Name,0,sizeof(Xml_File_Name)); + strcpy(Xml_File_Name, Lib_Path); + strcat(Xml_File_Name, "/"); + strcat(Xml_File_Name, SDMD_FORMAT_FILE); + + status = SDM_XML_Load_Format(Xml_File_Name, &(Buffer_Info_Ctx)); + + if(status == IMRS_OK) + { + IMRG_SDM_Base.RootFmt = Buffer_Info_Ctx.RootFormat; + + IMRD_LM_LOG_INFO_1( "Fmt loaded: (%d)", IMRG_SDM_Base.RootFmt->Index_Tab[NDD_INDEX_PRIMARY].Node_Number); + + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_0, "Loading Appl..."); + + memset(Buffer_Info_Ctx.PathArray,0,sizeof(Buffer_Info_Ctx.PathArray)); + Buffer_Info_Ctx.PresentLevelTag = IMRD_SDMD_MIN_LEVEL_TAG; + Buffer_Info_Ctx.CptAppl = IMRD_APPL_ID_UNKNOWN; + memset(Xml_File_Name,0,sizeof(Xml_File_Name)); + strcpy(Xml_File_Name, Lib_Path); + strcat(Xml_File_Name, "/"); + strcat(Xml_File_Name, SDMD_APPLI_FILE); + + status = SDM_XML_Load_Appli(Xml_File_Name, &(Buffer_Info_Ctx)); + if(status == IMRS_OK) + { + IMRG_SDM_Base.RootAppl = Buffer_Info_Ctx.RootAppli; + + IMRD_LM_LOG_INFO_1( "Appl loaded: (%d)", IMRG_SDM_Base.RootAppl->Index_Tab[NDD_INDEX_PRIMARY].Node_Number); + + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_0, "Loading MapPath..."); + + Buffer_Info_Ctx.NbMapPath = 0 ; + Buffer_Info_Ctx.NbMapCmd = 0 ; + memset(Buffer_Info_Ctx.PathArray,0,sizeof(Buffer_Info_Ctx.PathArray)); + Buffer_Info_Ctx.PresentLevelTag = IMRD_SDMD_MIN_LEVEL_TAG; + memset(Xml_File_Name,0,sizeof(Xml_File_Name)); + strcpy(Xml_File_Name, Lib_Path); + strcat(Xml_File_Name, "/"); + strcat(Xml_File_Name, SDMD_MAPPATH_FILE); + status = SDM_XML_Load_MapPath(Xml_File_Name, &(Buffer_Info_Ctx)); + if(status == IMRS_OK) + { + IMRG_SDM_Base.RootMapPath = Buffer_Info_Ctx.RootMapPath; + + IMRD_LM_LOG_INFO_1( "MapPath loaded: (%d)", IMRG_SDM_Base.RootMapPath->Index_Tab[NDD_INDEX_PRIMARY].Node_Number); + } + else + { + IMRD_LM_LOG_ERROR_0( "Can't load MapPath !"); + + StatusTmp = SDM_Close_RootFmtAttr(); + StatusTmp = SDM_Close_RootFmt(); + StatusTmp = SDM_Close_RootAppl(); + } + + } + else + { + IMRD_LM_LOG_ERROR_0( "Can't load Appl !"); + + StatusTmp = SDM_Close_RootFmtAttr(); + StatusTmp = SDM_Close_RootFmt(); + } + } + else + { + StatusTmp = SDM_Close_RootFmtAttr(); + + IMRD_LM_LOG_ERROR_0( "Can't load Fmt !"); + } + } + else + { + IMRD_LM_LOG_ERROR_0( "Can't load FmtAttr !"); + } + + return(status); + +} + + + +static IMRT_Status error(SDMT_BufferInfo_Contexte *ctx , const char *msg, ...) +{ + xmlParserCtxt * SaxCtx; + + SaxCtx = ctx->SaxCtxHdl; + + IMRD_LM_LOG_ERROR_1( "CallBack error: <%s> !",msg); + + SaxCtx->sax = &ErrorSAXHandlerStruct; + ctx->flagerror = 1; + ctx->FataError.errorCode = SDMD_XML_CODE_ERROR_1; + strcpy(ctx->FataError.libError,msg) ; + +} + +IMRT_Status startElementNsAppli( SDMT_BufferInfo_Contexte * ctx , + const xmlChar *localname, + const xmlChar *prefix, + const xmlChar *URI, + int nb_namespaces, + const xmlChar **namespaces, + int nb_attributes, + int nb_defaulted, + const xmlChar **attributes) +{ + NDT_Status nd_status; + const char functionname [] = "startElementNsAppli"; + char DescErr [IMRD_SDMD_DESCERR_LEN]; + + if(strcmp((const char*)localname, IMRD_SDMD_TAG_APPLI) == 0) + { + /*création d'un nouvelle objet appli*/ + if( ( nd_status = ND_Value_Alloc( ctx->RootAppli, (void **)&(ctx->CurrentAppli)) != NDS_OK)) + { + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_5,IMRD_SDMD_TAG_APPLI); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), functionname, DescErr, SDMD_XML_CODE_ERROR_5 ); + } + } +} + + +IMRT_Status startElementNsFmtAttr( SDMT_BufferInfo_Contexte * ctx , + const xmlChar *localname, + const xmlChar *prefix, + const xmlChar *URI, + int nb_namespaces, + const xmlChar **namespaces, + int nb_attributes, + int nb_defaulted, + const xmlChar **attributes) +{ + NDT_Status nd_status; + const char functionname [] = "startElementNsFmtAttr"; + char DescErr [IMRD_SDMD_DESCERR_LEN]; + + if(strcmp((const char*)localname, IMRD_SDMD_TAG_FMTATTR) == 0) + { + /*création d'un nouvelle objet FmtAttr*/ + if( ( nd_status = ND_Value_Alloc( ctx->RootFmtAttr, (void **)&(ctx->CurrentFmtAttr)) != NDS_OK)) + { + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_5,IMRD_SDMD_TAG_FMTATTR); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), functionname, DescErr, SDMD_XML_CODE_ERROR_5 ); + } + } + +} + + +IMRT_Status startElementNsFmt( SDMT_BufferInfo_Contexte * ctx , + const xmlChar *localname, + const xmlChar *prefix, + const xmlChar *URI, + int nb_namespaces, + const xmlChar **namespaces, + int nb_attributes, + int nb_defaulted, + const xmlChar **attributes) +{ + NDT_Status nd_status; + const char functionname [] = "startElementNsFmt"; + char DescErr [IMRD_SDMD_DESCERR_LEN]; + + + if(strcmp((const char*)localname,IMRD_SDMD_TAG_FORMAT) == 0) + { + /*création d'un nouvel objet format*/ + if(( nd_status = ND_Value_Alloc( ctx->RootFormat, (void **)&(ctx->CurrentFormat)) != NDS_OK)) + { + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_5,IMRD_SDMD_TAG_FORMAT); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), functionname, DescErr, SDMD_XML_CODE_ERROR_5 ); + } + else + { + ctx->PresentLevelTag = ctx->PresentLevelTag + 1; + strcpy(ctx->PathArray[ctx->PresentLevelTag], (char*)localname); + } + } + else if (strcmp((const char*)localname,IMRD_SDMD_TAG_FMTMSG) == 0) + { + /*creation d'un nouvel objet FmtMsg*/ + if( ( nd_status = ND_Value_Alloc( ctx->CurrentFormat->FmtMsg_Struct_Ptr, (void **)&(ctx->CurrentFmtMsg)) != NDS_OK)) + { + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_3, IMRD_SDMD_TAG_FMTMSG); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), functionname , DescErr, SDMD_XML_CODE_ERROR_3 ); + } + ctx->PresentLevelTag = ctx->PresentLevelTag + 1; + strcpy(ctx->PathArray[ctx->PresentLevelTag], (char*)localname); + } + +} + +IMRT_Status startElementNsMapPath( SDMT_BufferInfo_Contexte * ctx , + const xmlChar *localname, + const xmlChar *prefix, + const xmlChar *URI, + int nb_namespaces, + const xmlChar **namespaces, + int nb_attributes, + int nb_defaulted, + const xmlChar **attributes) +{ + NDT_Status nd_status; + const char functionname [] = "startElementNsMapPath"; + char DescErr [IMRD_SDMD_DESCERR_LEN]; + IMRT_Jump *jump_ptr; + + if(strcmp((const char *)localname, IMRD_SDMD_TAG_MAPPATH) == 0) + { + /*creation d'un nouvel objet MapPath*/ + if( ( nd_status = ND_Value_Alloc(ctx->RootMapPath,(void **)&(ctx->CurrentMapPath)) != NDS_OK)) + { + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_3, IMRD_SDMD_TAG_MAPPATH); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), functionname ,DescErr, SDMD_XML_CODE_ERROR_3); + } + ctx->PresentLevelTag = ctx->PresentLevelTag + 1; + strcpy(ctx->PathArray[ctx->PresentLevelTag], (char*)localname); + } + else if (strcmp((const char *)localname, IMRD_SDMD_TAG_MAPCMD) == 0) + { + /*creation d'un nouvel objet MapCmd*/ + if( ( nd_status = ND_Value_Alloc( ctx->CurrentMapPath->MapCmd_Struct_Ptr, (void **)&(ctx->CurrentMapCmd)) != NDS_OK)) + { + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_3, IMRD_SDMD_TAG_MAPCMD); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), functionname , DescErr, SDMD_XML_CODE_ERROR_3 ); + } + ctx->PresentLevelTag = ctx->PresentLevelTag + 1; + strcpy(ctx->PathArray[ctx->PresentLevelTag], (char*)localname); + } + else if ((strcmp((const char *)localname, IMRD_SDMD_TAG_MAPPER) == 0) || + (strcmp((const char *)localname, IMRD_SDMD_TAG_COPIE) == 0) + ) + { + ctx->PresentLevelTag = ctx->PresentLevelTag + 1; + strcpy(ctx->PathArray[ctx->PresentLevelTag], (char*)localname); + } + else if(strcmp((const char *)localname, IMRD_SDMD_TAG_IDENTIFIER) == 0) + { + ctx->PresentLevelTag = ctx->PresentLevelTag + 1; + strcpy(ctx->PathArray[ctx->PresentLevelTag], (char*)localname); + ctx->IdxJpTble = 0; + } + else if(strcmp((const char*)localname,IMRD_SDMD_TAG_GO_TO)== 0) + { + ctx->PresentLevelTag = ctx->PresentLevelTag + 1; + strcpy(ctx->PathArray[ctx->PresentLevelTag], (char*)localname); + + if (ctx->PresentLevelTag == IMRD_SDMD_LEVEL_TAG_3) + { + jump_ptr = (IMRT_Jump *)realloc((void *)ctx->CurrentMapCmd->Jump_Tab , + (size_t)((ctx->CurrentMapCmd->JmpTbleNbElts + 1) * sizeof(IMRT_Jump))); + if (jump_ptr == NULL) + { + snprintf(DescErr, sizeof(DescErr), SDMD_XML_LIB_ERROR_3, "Jump Table"); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), functionname , DescErr, SDMD_XML_CODE_ERROR_3); + } + else + { + ctx->CurrentMapCmd->Jump_Tab = jump_ptr; + ctx->CurrentMapCmd->JmpTbleNbElts++; + } + } + } + +} + + + +IMRT_Status endElementNsAppli( SDMT_BufferInfo_Contexte * ctx, + const xmlChar *localname, + const xmlChar *prefix, + const xmlChar *URI) +{ + NDT_Status nd_status; + IMRT_Status status_tmp; + const char fonctionname [] ="endElementNsAppli"; + char DescErr[IMRD_SDMD_DESCERR_LEN]; + + if(strcmp((const char*)localname, IMRD_SDMD_TAG_APPLI) == 0) + { + /*insertion de l'appli courante*/ + /*insertion du format*/ + ctx->CurrentAppli->Id = ctx->CptAppl; + if( ( nd_status = ND_DataStruct_Value_Add( ctx->RootAppli, (void *)(ctx->CurrentAppli))) != NDS_OK) + { + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_3, IMRD_SDMD_TAG_APPLI); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), fonctionname , DescErr, SDMD_XML_CODE_ERROR_3 ); + } + ctx->CptAppl ++; + } + else if(strcmp((const char*)localname, IMRD_SDMD_TAG_NAME) == 0) + { + strcpy(ctx->CurrentAppli->Name, ctx->value); + } + else if (strcmp((const char *)localname, IMRD_SDMD_TAG_VERSION) == 0) + { + IMRD_LM_LOG_INFO_1( "[Appl]: [%s]", ctx->value); + status_tmp = SDM_Set_Struct_Version((IMRT_Data_Version *)ctx->RootAppli->User_Ptr, (char *)ctx->value); + } +} + + +IMRT_Status endElementNsFmtAttr( SDMT_BufferInfo_Contexte * ctx, + const xmlChar *localname, + const xmlChar *prefix, + const xmlChar *URI) +{ + NDT_Status nd_status; + IMRT_Status status, status_tmp; + const char fonctionname [] ="endElementNsFmtAttr"; + char DescErr[IMRD_SDMD_DESCERR_LEN]; + + if(strcmp((const char*)localname, IMRD_SDMD_TAG_FMTATTR) == 0) + { + ctx->CurrentFmtAttr->Id = ctx->CptFmtAttr; + if( ( nd_status = ND_DataStruct_Value_Add( ctx->RootFmtAttr, (void *)(ctx->CurrentFmtAttr))) != NDS_OK) + { + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_3, IMRD_SDMD_TAG_FMTATTR); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), fonctionname , DescErr, SDMD_XML_CODE_ERROR_3 ); + } + ctx->CptFmtAttr ++; + } + else if(strcmp((const char*)localname, IMRD_SDMD_TAG_NAME) == 0) + { + strcpy(ctx->CurrentFmtAttr->Name, ctx->value); + } + else if(strcmp((const char*)localname, IMRD_SDMD_TAG_VALUE) == 0) + { + memset(ctx->CurrentFmtAttr->Value,'\0', IMRD_FMTATTR_VALUE_SIZE); + status = SDM_ConvertAttribute(ctx->value, ctx->CurrentFmtAttr->Value); + } + else if (strcmp((const char *)localname, IMRD_SDMD_TAG_VERSION) == 0) + { + IMRD_LM_LOG_INFO_1( "[FmtAtt]: [%s]", ctx->value); + status_tmp = SDM_Set_Struct_Version((IMRT_Data_Version *)ctx->RootFmtAttr->User_Ptr, (char *)ctx->value); + } +} + + +IMRT_Status endElementNsMapPath( SDMT_BufferInfo_Contexte * ctx, + const xmlChar *localname, + const xmlChar *prefix, + const xmlChar *URI) +{ + NDT_Node * node_ptr; + NDT_Status nd_status; + IMRT_Status status, status_tmp; + IMRT_MsgMap msgmap; + IMRT_Appl appli; + IMRT_Fmt fmt; + IMRT_Msg msg; + IMRT_FmtAttr FmtAttr; + char fonctionname [] = "endElementNsMapPath"; + char DescErr[IMRD_SDMD_DESCERR_LEN]; + + + if (strcmp((const char *)localname, IMRD_SDMD_TAG_FORMAT) == 0) + { + + strcpy(fmt.Name, ctx->value); + if(((nd_status = ND_Index_Node_Find( &node_ptr, IMRG_SDM_Base.RootFmt, + IMRD_SDMD_FMT_IDX_NAME, &fmt, NULL)) != NDS_OK)|| + (node_ptr == NULL)) + { + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_4,IMRD_SDMD_TAG_FORMAT, fmt.Name ); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), fonctionname , DescErr, SDMD_XML_CODE_ERROR_4 ); + } + else + { + ctx->CurrentMapCmd->Jump_Tab[ctx->IdxJpTble].Fmt_Ptr = node_ptr->Value; + } + } + else if (strcmp((const char *)localname, IMRD_SDMD_TAG_BRANCHE_ID) == 0) + { + switch(ctx->PresentLevelTag) + { + case IMRD_SDMD_LEVEL_TAG_1: /* IMRD_SDMD_TAG_MAPCMD */ + { + ctx->CurrentMapCmd->Branche_Id = atoi(ctx->value); + break; + } + + case IMRD_SDMD_LEVEL_TAG_2: /* Command go_to */ + { + ctx->CurrentMapCmd->Goto_Branche_Id = atoi(ctx->value); + break; + } + + case IMRD_SDMD_LEVEL_TAG_3: /* Jump Table */ + { + ctx->CurrentMapCmd->Jump_Tab[ctx->IdxJpTble].Branche_Id = atoi(ctx->value); + break; + } + + default: + { + snprintf(DescErr, sizeof(DescErr), SDMD_XML_LIB_ERROR_10, SDMD_MAPPATH_FILE); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), fonctionname , DescErr, SDMD_XML_CODE_ERROR_10); + } + } /* end switch */ + } + else if (strcmp((const char *)localname, IMRD_SDMD_TAG_TYPE) == 0) + { + switch(ctx->PresentLevelTag) + { + case IMRD_SDMD_LEVEL_TAG_2: + { + strcpy(msg.Name, ctx->value); + if(((nd_status = ND_Index_Node_Find( &node_ptr, IMRG_SDM_Base.RootMsg, + IMRD_SDMD_MSG_IDX_NAME, &msg, NULL)) != NDS_OK)|| + (node_ptr == NULL)) + { + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_4,IMRD_SDMD_TAG_TYPE, msg.Name ); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), fonctionname , DescErr, SDMD_XML_CODE_ERROR_4 ); + } + else + { + ctx->CurrentMapCmd->Ident_First_Msg_Ptr = node_ptr->Value; + } + break; + } + + case IMRD_SDMD_LEVEL_TAG_3: + { + strcpy(msg.Name, ctx->value); + if(((nd_status = ND_Index_Node_Find( &node_ptr, IMRG_SDM_Base.RootMsg, + IMRD_SDMD_MSG_IDX_NAME, &msg, NULL)) != NDS_OK)|| + (node_ptr == NULL)) + { + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_4,IMRD_SDMD_TAG_TYPE, msg.Name ); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), fonctionname , DescErr, SDMD_XML_CODE_ERROR_4 ); + } + else + { + ctx->CurrentMapCmd->Jump_Tab[ctx->IdxJpTble].Msg_Ptr = node_ptr->Value; + } + break; + } + + default: + { + snprintf(DescErr, sizeof(DescErr), SDMD_XML_LIB_ERROR_10, SDMD_MAPPATH_FILE); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), fonctionname , DescErr, SDMD_XML_CODE_ERROR_10); + } + } /* end switch */ + } + else if (strcmp((const char *)localname, IMRD_SDMD_TAG_INPUTFORMAT) == 0) + { + strcpy(fmt.Name, ctx->value); + if(((nd_status = ND_Index_Node_Find( &node_ptr, IMRG_SDM_Base.RootFmt, + IMRD_SDMD_FMT_IDX_NAME, &fmt, NULL)) != NDS_OK)|| + (node_ptr == NULL)) + { + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_4,IMRD_SDMD_TAG_INPUTFORMAT, fmt.Name ); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), fonctionname , DescErr, SDMD_XML_CODE_ERROR_4 ); + } + else + { + switch(ctx->PresentLevelTag) + { + case IMRD_SDMD_LEVEL_TAG_2: + { + ctx->CurrentMapCmd->Fmt_Input_Ptr = node_ptr->Value; + break; + } + + case IMRD_SDMD_LEVEL_TAG_0: + { + ctx->CurrentMapPath->Fmt_Input_Ptr = node_ptr->Value; + break; + } + + default: + { + snprintf(DescErr, sizeof(DescErr), SDMD_XML_LIB_ERROR_10, SDMD_MAPPATH_FILE); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), fonctionname , DescErr, SDMD_XML_CODE_ERROR_10); + } + } /* end switch */ + } + } + else if (strcmp((const char *)localname, IMRD_SDMD_TAG_INPUTFORMAT_ATTR) == 0) + { + switch(ctx->PresentLevelTag) + { + case IMRD_SDMD_LEVEL_TAG_2: + { + + strcpy(FmtAttr.Name, ctx->value); + if(((nd_status = ND_Index_Node_Find( &node_ptr, IMRG_SDM_Base.RootFmtAttr, + IMRD_SDMD_FMTATTR_IDX_NAME, &FmtAttr, NULL)) != NDS_OK)|| + (node_ptr == NULL)) + { + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_4,IMRD_SDMD_TAG_TYPE, FmtAttr.Name ); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), fonctionname , DescErr, SDMD_XML_CODE_ERROR_4 ); + } + else + { + ctx->CurrentMapCmd->FmtAttr_Input_Ptr = node_ptr->Value; + } + + break; + } + + default: + { + snprintf(DescErr, sizeof(DescErr), SDMD_XML_LIB_ERROR_10, SDMD_MAPPATH_FILE); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), fonctionname , DescErr, SDMD_XML_CODE_ERROR_10); + } + } /* end switch */ + } + else if (strcmp((const char *)localname, IMRD_SDMD_TAG_OUTPUTFORMAT) == 0) + { + strcpy(fmt.Name, ctx->value); + if(((nd_status = ND_Index_Node_Find( &node_ptr, IMRG_SDM_Base.RootFmt, + IMRD_SDMD_FMT_IDX_NAME, &fmt, NULL)) != NDS_OK)|| + (node_ptr == NULL)) + { + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_4,IMRD_SDMD_TAG_OUTPUTFORMAT, fmt.Name ); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), fonctionname , DescErr, SDMD_XML_CODE_ERROR_4 ); + } + else + { + switch(ctx->PresentLevelTag) + { + case IMRD_SDMD_LEVEL_TAG_2: + { + ctx->CurrentMapCmd->Fmt_Output_Ptr = node_ptr->Value; + break; + } + + case IMRD_SDMD_LEVEL_TAG_0: + { + ctx->CurrentMapPath->Fmt_Output_Ptr = node_ptr->Value; + break; + } + + default: + { + snprintf(DescErr, sizeof(DescErr), SDMD_XML_LIB_ERROR_10, SDMD_MAPPATH_FILE); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), fonctionname , DescErr, SDMD_XML_CODE_ERROR_10); + } + } /* end switch */ + } + } + else if (strcmp((const char *)localname, IMRD_SDMD_TAG_OUTPUTFORMAT_ATTR) == 0) + { + switch(ctx->PresentLevelTag) + { + case IMRD_SDMD_LEVEL_TAG_2: + { + strcpy(FmtAttr.Name, ctx->value); + if(((nd_status = ND_Index_Node_Find( &node_ptr, IMRG_SDM_Base.RootFmtAttr, + IMRD_SDMD_FMTATTR_IDX_NAME, &FmtAttr, NULL)) != NDS_OK)|| + (node_ptr == NULL)) + { + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_4,IMRD_SDMD_TAG_TYPE, FmtAttr.Name ); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), fonctionname , DescErr, SDMD_XML_CODE_ERROR_4 ); + } + else + { + ctx->CurrentMapCmd->FmtAttr_Output_Ptr = node_ptr->Value; + } + break; + } + + default: + { + snprintf(DescErr, sizeof(DescErr), SDMD_XML_LIB_ERROR_10, SDMD_MAPPATH_FILE); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), fonctionname , DescErr, SDMD_XML_CODE_ERROR_10); + } + } /* end switch */ + } + else if (strcmp((const char *)localname, IMRD_SDMD_TAG_INPUTBUFFER) == 0) + { + ctx->CurrentMapCmd->Buffer_Id_Input = atoi(ctx->value); + } + else if (strcmp((const char *)localname, IMRD_SDMD_TAG_OUTPUTBUFFER) == 0) + { + ctx->CurrentMapCmd->Buffer_Id_Output = atoi(ctx->value); + } + else if (strcmp((const char *)localname, IMRD_SDMD_TAG_NUMBUFFER) == 0) + { + ctx->CurrentMapCmd->Buffer_Id_Ident = atoi(ctx->value); + } + else if (strcmp((const char *)localname, IMRD_SDMD_TAG_INPUTAPPLI) == 0) + { + strcpy(appli.Name, ctx->value); + if(((nd_status = ND_Index_Node_Find( &node_ptr, IMRG_SDM_Base.RootAppl, + IMRD_SDMD_APPL_IDX_NAME, &appli, NULL)) != NDS_OK)|| + (node_ptr == NULL)) + { + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_4,IMRD_SDMD_TAG_INPUTAPPLI, appli.Name ); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), fonctionname , DescErr, SDMD_XML_CODE_ERROR_4 ); + } + else + { + ctx->CurrentMapPath->Appl_Input_Ptr = node_ptr->Value; + } + } + else if (strcmp((const char *)localname, IMRD_SDMD_TAG_OUTPUTAPPLI) == 0) + { + strcpy(appli.Name, ctx->value); + if(((nd_status = ND_Index_Node_Find( &node_ptr, IMRG_SDM_Base.RootAppl, + IMRD_SDMD_APPL_IDX_NAME, &appli, NULL)) != NDS_OK)|| + (node_ptr == NULL)) + { + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_4,IMRD_SDMD_TAG_INPUTAPPLI, appli.Name ); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), fonctionname , DescErr, SDMD_XML_CODE_ERROR_4 ); + } + else + { + ctx->CurrentMapPath->Appl_Output_Ptr = node_ptr->Value; + } + } + else if (strcmp((const char *)localname, IMRD_SDMD_TAG_IDENTTOTAL) == 0) + { + if(*(ctx->value) == IMRD_YES) + { + ctx->CurrentMapCmd->Ident_Total = IMRD_TRUE; + } + else + { + ctx->CurrentMapCmd->Ident_Total = IMRD_FALSE; + } + } + else if (strcmp((const char *)localname, IMRD_SDMD_TAG_MSGMAP) == 0) + { + strcpy(msgmap.Name, ctx->value); + if(((nd_status = ND_Index_Node_Find( &node_ptr, IMRG_SDM_Base.RootMsgMap, + IMRD_SDMD_MSGMAP_IDX_NAME, &msgmap, NULL)) != NDS_OK)|| + (node_ptr == NULL)) + { + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_4,IMRD_SDMD_TAG_MSGMAP, msgmap.Name ); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), fonctionname , DescErr, SDMD_XML_CODE_ERROR_4 ); + } + else + { + ctx->CurrentMapCmd->MsgMap_Ptr = node_ptr->Value; + } + } + else if (strcmp((const char *)localname, IMRD_SDMD_TAG_CLEARFLAG) == 0) + { + ctx->CurrentMapCmd->Clear_Flag = atoi(ctx->value); + } + else if (strcmp((const char *)localname, IMRD_SDMD_TAG_GO_TO) == 0) + { + ctx->CurrentMapCmd->TypeCmd = IMRD_MAPCMD_TYPE_GOTO; + if(ctx->PresentLevelTag == IMRD_SDMD_LEVEL_TAG_3) + { + ctx->IdxJpTble++; + + } + memset(ctx->PathArray[ctx->PresentLevelTag],0,sizeof(IMRD_SDMD_SIZE_TAG_SIZE)); + ctx->PresentLevelTag = ctx->PresentLevelTag - 1; + } + else if (strcmp((const char *)localname, IMRD_SDMD_TAG_IDENTIFIER) == 0) + { + ctx->CurrentMapCmd->TypeCmd = IMRD_MAPCMD_TYPE_IDENT; + memset(ctx->PathArray[ctx->PresentLevelTag],0,sizeof(IMRD_SDMD_SIZE_TAG_SIZE)); + ctx->PresentLevelTag = ctx->PresentLevelTag - 1; + ctx->IdxJpTble = 0; + } + else if (strcmp((const char *)localname, IMRD_SDMD_TAG_MAPPER) == 0) + { + ctx->CurrentMapCmd->TypeCmd = IMRD_MAPCMD_TYPE_MAP; + + if (ctx->CurrentMapCmd->FmtAttr_Input_Ptr == NULL) + { + strcpy(FmtAttr.Name, IMRD_FMTATTR_NAME_UNKNOWN); + if(((nd_status = ND_Index_Node_Find( &node_ptr, IMRG_SDM_Base.RootFmtAttr, + IMRD_SDMD_FMTATTR_IDX_NAME, &FmtAttr, NULL)) != NDS_OK)|| + (node_ptr == NULL)) + { + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_4,IMRD_SDMD_TAG_TYPE, FmtAttr.Name ); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), fonctionname , DescErr, SDMD_XML_CODE_ERROR_4 ); + } + else + { + ctx->CurrentMapCmd->FmtAttr_Input_Ptr = node_ptr->Value; + } + } + if (ctx->CurrentMapCmd->FmtAttr_Output_Ptr == NULL) + { + strcpy(FmtAttr.Name, IMRD_FMTATTR_NAME_UNKNOWN); + if(((nd_status = ND_Index_Node_Find( &node_ptr, IMRG_SDM_Base.RootFmtAttr, + IMRD_SDMD_FMTATTR_IDX_NAME, &FmtAttr, NULL)) != NDS_OK)|| + (node_ptr == NULL)) + { + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_4,IMRD_SDMD_TAG_TYPE, FmtAttr.Name ); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), fonctionname , DescErr, SDMD_XML_CODE_ERROR_4 ); + } + else + { + ctx->CurrentMapCmd->FmtAttr_Output_Ptr = node_ptr->Value; + } + } + + memset(ctx->PathArray[ctx->PresentLevelTag],0,sizeof(IMRD_SDMD_SIZE_TAG_SIZE)); + ctx->PresentLevelTag = ctx->PresentLevelTag - 1; + } + else if (strcmp((const char *)localname, IMRD_SDMD_TAG_COPIE) == 0) + { + ctx->CurrentMapCmd->TypeCmd = IMRD_MAPCMD_TYPE_COPY; + memset(ctx->PathArray[ctx->PresentLevelTag],0,sizeof(IMRD_SDMD_SIZE_TAG_SIZE)); + ctx->PresentLevelTag = ctx->PresentLevelTag - 1; + } + else if (strcmp((const char *)localname, IMRD_SDMD_TAG_MAPCMD) == 0) + { + if(ctx->CurrentMapCmd->Ident_First_Msg_Ptr == NULL) + { + msg.Id = IMRD_MSG_ID_UNKNOWN; + if(((nd_status = ND_Index_Node_Find( &node_ptr, IMRG_SDM_Base.RootMsg, + IMRD_SDMD_MSG_IDX_ID, &msg, NULL)) != NDS_OK)|| + (node_ptr == NULL)) + { + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_4,IMRD_SDMD_TAG_TYPE, "unknown" ); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), fonctionname , DescErr, SDMD_XML_CODE_ERROR_4 ); + } + else + { + ctx->CurrentMapCmd->Ident_First_Msg_Ptr = node_ptr->Value; + } + } + + if (ctx->CurrentMapCmd->TypeCmd == IMRD_MAPCMD_TYPE_MAP) + { + status = SDM_Control_Fmt_Attr(ctx->CurrentMapCmd->MsgMap_Ptr->Msg_Input_Ptr, + ctx->CurrentMapCmd->Fmt_Input_Ptr->FmtMsg_Struct_Ptr, + ctx->CurrentMapCmd->FmtAttr_Input_Ptr); + + if (status == IMRS_OK) + { + status = SDM_Control_Fmt_Attr(ctx->CurrentMapCmd->MsgMap_Ptr->Msg_Output_Ptr, + ctx->CurrentMapCmd->Fmt_Output_Ptr->FmtMsg_Struct_Ptr, + ctx->CurrentMapCmd->FmtAttr_Output_Ptr); + + if (status != IMRS_OK) + { + snprintf(DescErr,sizeof(DescErr),SDMD_LIB_ERROR_11 ); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), fonctionname , DescErr, SDMD_CODE_ERROR_11 ); + } + } + else + { + snprintf(DescErr,sizeof(DescErr),SDMD_LIB_ERROR_11 ); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), fonctionname , DescErr, SDMD_CODE_ERROR_11 ); + } + } + + ctx->CurrentMapCmd->MapCmd_Id = ctx->NbMapCmd; + if( ( nd_status = ND_DataStruct_Value_Add( ctx->CurrentMapPath->MapCmd_Struct_Ptr, (void *)(ctx->CurrentMapCmd))) != NDS_OK) + { + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_2,IMRD_SDMD_TAG_MAPCMD ); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), fonctionname , DescErr, SDMD_XML_CODE_ERROR_2 ); + } + ctx->NbMapCmd++; + memset(ctx->PathArray[ctx->PresentLevelTag],0,sizeof(IMRD_SDMD_SIZE_TAG_SIZE)); + ctx->PresentLevelTag = ctx->PresentLevelTag - 1; + } + else if (strcmp((const char *)localname, IMRD_SDMD_TAG_MAPPATH) == 0) + { + ctx->CurrentMapPath->idMapPath = ctx->NbMapPath; + + if( ( nd_status = ND_DataStruct_Value_Add( ctx->RootMapPath, (void *)(ctx->CurrentMapPath))) != NDS_OK) + { + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_2,IMRD_SDMD_TAG_MAPPATH ); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), fonctionname , DescErr, SDMD_XML_CODE_ERROR_2 ); + } + ctx->NbMapPath++; + memset(ctx->PathArray[ctx->PresentLevelTag],0,sizeof(IMRD_SDMD_SIZE_TAG_SIZE)); + ctx->PresentLevelTag = ctx->PresentLevelTag - 1; + } + else if (strcmp((const char *)localname, IMRD_SDMD_TAG_VERSION) == 0) + { + IMRD_LM_LOG_INFO_1( "[MapPath]: [%s]", ctx->value); + status_tmp = SDM_Set_Struct_Version((IMRT_Data_Version *)ctx->RootMapPath->User_Ptr, (char *)ctx->value); + } + +} + + +IMRT_Status endElementNsFmt ( SDMT_BufferInfo_Contexte * ctx, + const xmlChar *localname, + const xmlChar *prefix, + const xmlChar *URI) +{ + NDT_Node * node_ptr; + NDT_Status nd_status; + IMRT_Status status, status_tmp; + IMRT_Msg message; + IMRT_FmtAttr FmtAttr; + const char functionname [] = "endElementNsFmt"; + char DescErr [IMRD_SDMD_DESCERR_LEN]; + + + if (strcmp((const char *)localname, IMRD_SDMD_TAG_NAME) == 0) + { + switch(ctx->PresentLevelTag) + { + case IMRD_SDMD_LEVEL_TAG_0: + { + strcpy(ctx->CurrentFormat->Name, ctx->value); + break; + } + case IMRD_SDMD_LEVEL_TAG_1: + { + /*recherch du message avec le nom*/ + strcpy(message.Name, ctx->value); + if(((nd_status = ND_Index_Node_Find( &node_ptr, IMRG_SDM_Base.RootMsg, + IMRD_SDMD_MSG_IDX_NAME, &message, NULL)) != NDS_OK)|| + (node_ptr == NULL)) + { + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_5, IMRD_SDMD_TAG_FORMAT); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), functionname, DescErr, SDMD_XML_CODE_ERROR_5 ); + } + else + { + ctx->CurrentFmtMsg->Msg_Ptr = node_ptr->Value; + } + + break; + } + + default: + { + snprintf(DescErr, sizeof(DescErr), SDMD_XML_LIB_ERROR_10, SDMD_FORMAT_FILE); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), functionname , DescErr, SDMD_XML_CODE_ERROR_10); + } + } /* end switch */ + } + else if (strcmp((const char *)localname, IMRD_SDMD_TAG_BRANCHE_ID) == 0) + { + ctx->CurrentFmtMsg->Branche_Id = atoi(ctx->value); + } + else if (strcmp((const char *)localname, IMRD_SDMD_TAG_FMTATTR_NAME) == 0) + { + strcpy(FmtAttr.Name, ctx->value); + if(((nd_status = ND_Index_Node_Find( &node_ptr, IMRG_SDM_Base.RootFmtAttr, + IMRD_SDMD_FMTATTR_IDX_NAME, &FmtAttr, NULL)) != NDS_OK)|| + (node_ptr == NULL)) + { + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_4,IMRD_SDMD_TAG_TYPE, FmtAttr.Name ); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), functionname , DescErr, SDMD_XML_CODE_ERROR_4 ); + } + else + { + ctx->CurrentFmtMsg->FmtAttr_Ptr = node_ptr->Value; + } + } + else if (strcmp((const char *)localname, IMRD_SDMD_TAG_FORMAT) == 0) + { + + /*insertion du format*/ + ctx->CurrentFormat->Id = ctx->CptFmt; + if( ( nd_status = ND_DataStruct_Value_Add( ctx->RootFormat, (void *)(ctx->CurrentFormat))) != NDS_OK) + { + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_5,IMRD_SDMD_TAG_FORMAT); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), functionname, DescErr, SDMD_XML_CODE_ERROR_5 ); + } + ctx->CptFmt ++; + memset(ctx->PathArray[ctx->PresentLevelTag],0,sizeof(IMRD_SDMD_SIZE_TAG_SIZE)); + ctx->PresentLevelTag = ctx->PresentLevelTag - 1; + } + else if (strcmp((const char *)localname, IMRD_SDMD_TAG_FMTMSG) == 0) + { + if( ( nd_status = ND_DataStruct_Value_Add( ctx->CurrentFormat->FmtMsg_Struct_Ptr, (void *)(ctx->CurrentFmtMsg))) != NDS_OK) + { + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_5, IMRD_SDMD_TAG_FMTMSG); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), functionname, DescErr, SDMD_XML_CODE_ERROR_5 ); + } + memset(ctx->PathArray[ctx->PresentLevelTag],0,sizeof(IMRD_SDMD_SIZE_TAG_SIZE)); + ctx->PresentLevelTag = ctx->PresentLevelTag - 1; + } + else if (strcmp((const char *)localname, IMRD_SDMD_TAG_VERSION) == 0) + { + IMRD_LM_LOG_INFO_1( "[Fmt]: [%s]", ctx->value); + status_tmp = SDM_Set_Struct_Version((IMRT_Data_Version *)ctx->RootFormat->User_Ptr, (char *)ctx->value); + } +} + + + +IMRT_Status Buff_Info_characters(SDMT_BufferInfo_Contexte * ctx , const xmlChar *ch, int len) +{ + char output[40]; + int i; + + memset(ctx->value,0, sizeof(ctx->value)); + + for (i = 0;(ivalue[i] = ch[i]; + ctx->value[i] = 0; +} + + + +IMRT_Status SDM_XML_Load_Appli( char *demo_file, SDMT_BufferInfo_Contexte *mycontexte) +{ + IMRT_Status status; + NDT_Status nd_status; + char * docname = NULL; + NDT_Index_Type *index_type_ptr; + xmlDocPtr doc = NULL; + xmlDtdPtr dtd; + xmlParserCtxtPtr ctxt =NULL; + xmlSAXHandlerPtr SAXHandler; + xmlSAXHandlerPtr SAXHandler_Sav; + const char functionname []="SDM_XML_Load_Appli"; + char DescErr[IMRD_SDMD_DESCERR_LEN]; + IMRT_Data_Version *Data_Version_Ptr; + + LIBXML_TEST_VERSION + xmlKeepBlanksDefault(0); + xmlSAXDefaultVersion(2); + xmlLineNumbersDefault(1); + + status = IMRS_OK; + docname = demo_file; + ctxt = xmlNewParserCtxt(); + /*initialisation des indexes*/ + index_type_ptr = Appl_Struct_initial_idx_tab; + + + if(ctxt != NULL) + { + mycontexte->flagerror = IMRS_OK; + SAXHandler = &SaxAppliHandlerStruct; + mycontexte->SaxCtxHdl = ctxt; + ctxt->userData = mycontexte; + SAXHandler_Sav = ctxt->sax; + ctxt->sax = SAXHandler; + ctxt->sax2 = 1 ; + + Data_Version_Ptr = (IMRT_Data_Version *) malloc(sizeof(IMRT_Data_Version)); + Data_Version_Ptr->Label[0] = '\0'; + Data_Version_Ptr->Date[0] = '\0'; + if( ( nd_status = ND_DataStruct_Open(&(mycontexte->RootAppli),IMRD_SDMD_APPL_STRUCT_IDX_NB,index_type_ptr, "SDM_Appl_Manager",SDM_Appl_Manager, NULL, NULL, NULL, NULL,0, Data_Version_Ptr)) != NDS_OK) + { + status = IMRS_KO; + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_5,IMRD_SDMD_TAG_APPLI); + SDM_RaiseError(mycontexte->SaxCtxHdl,&(mycontexte->FataError),&(mycontexte->flagerror), functionname, DescErr, SDMD_XML_CODE_ERROR_5 ); + } + else + { + doc = xmlCtxtReadFile(ctxt,docname,NULL,XML_PARSE_DTDATTR+XML_PARSE_DTDVALID); + if (ctxt->lastError.code != XML_ERR_OK) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_3( "Erreur de parsing du fichier (%s): (%s) line (%d) !", docname, ctxt->lastError.message, ctxt->lastError.line); + } + else if(mycontexte->flagerror != IMRS_OK) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_1( "%s !", mycontexte->FataError.libError); + } + else + { + index_type_ptr =Appl_Struct_final_idx_tab; + status = SDM_DataStruct_Finalize(mycontexte->RootAppli,index_type_ptr, IMRD_SDMD_APPL_STRUCT_IDX_NB); + /*SDM_DataStruct_Dump(mycontexte->RootAppli);*/ + } + } + + if((status != IMRS_OK)&&(mycontexte->RootAppli != NULL)) + { + free(mycontexte->RootAppli->User_Ptr); + nd_status = ND_DataStruct_Close(mycontexte->RootAppli); + } + + ctxt->sax = SAXHandler_Sav ; + xmlFreeParserCtxt(ctxt); + } + else + { + status = IMRS_KO; + } + + return(status); + +} + + +IMRT_Status SDM_XML_Load_FmtAttr( char *demo_file, SDMT_BufferInfo_Contexte *mycontexte) +{ + IMRT_Status status; + NDT_Status nd_status; + char * docname = NULL; + NDT_Index_Type *index_type_ptr; + xmlDocPtr doc = NULL; + xmlDtdPtr dtd; + xmlParserCtxtPtr ctxt =NULL; + xmlSAXHandlerPtr SAXHandler; + xmlSAXHandlerPtr SAXHandler_Sav; + const char functionname[]= "SDM_XML_Load_FmtAttr"; + char DescErr[IMRD_SDMD_DESCERR_LEN]; + IMRT_Data_Version *Data_Version_Ptr; + + LIBXML_TEST_VERSION + xmlKeepBlanksDefault(0); + xmlSAXDefaultVersion(2); + xmlLineNumbersDefault(1); + + status = IMRS_OK; + docname = demo_file; + ctxt = xmlNewParserCtxt(); + /*initialisation des indexes*/ + index_type_ptr = FmtAttr_Struct_initial_idx_tab; + + if(ctxt != NULL) + { + mycontexte->flagerror = IMRS_OK; + SAXHandler = &SaxFmtAttrHandlerStruct; + mycontexte->SaxCtxHdl = ctxt; + ctxt->userData = mycontexte; + SAXHandler_Sav = ctxt->sax; + ctxt->sax = SAXHandler; + ctxt->sax2 = 1 ; + + Data_Version_Ptr = (IMRT_Data_Version *) malloc(sizeof(IMRT_Data_Version)); + Data_Version_Ptr->Label[0] = '\0'; + Data_Version_Ptr->Date[0] = '\0'; + if( ( nd_status = ND_DataStruct_Open(&(mycontexte->RootFmtAttr),IMRD_SDMD_FMTATTR_STRUCT_IDX_NB,index_type_ptr, "SDM_FmtAttr_Manager",SDM_FmtAttr_Manager, NULL, NULL, NULL, NULL,0, Data_Version_Ptr)) != NDS_OK) + { + status = IMRS_KO; + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_5,IMRD_SDMD_TAG_FMTATTR); + SDM_RaiseError(mycontexte->SaxCtxHdl,&(mycontexte->FataError),&(mycontexte->flagerror), functionname, DescErr, SDMD_XML_CODE_ERROR_5 ); + } + else + { + doc = xmlCtxtReadFile(ctxt,docname,NULL,XML_PARSE_DTDATTR+XML_PARSE_DTDVALID); + if (ctxt->lastError.code != XML_ERR_OK) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_3( "Erreur de parsing du fichier (%s): (%s) line (%d) !", docname, ctxt->lastError.message, ctxt->lastError.line); + } + else if(mycontexte->flagerror != IMRS_OK) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_1( "%s !", mycontexte->FataError.libError); + } + else + { + index_type_ptr = FmtAttr_Struct_final_idx_tab; + status = SDM_DataStruct_Finalize(mycontexte->RootFmtAttr, index_type_ptr, IMRD_SDMD_FMTATTR_STRUCT_IDX_NB); + /*SDM_DataStruct_Dump( mycontexte->RootFmtAttr);*/ + } + } + + if((status != IMRS_OK)&&(mycontexte->RootFmtAttr != NULL)) + { + free(mycontexte->RootFmtAttr->User_Ptr); + nd_status = ND_DataStruct_Close(mycontexte->RootFmtAttr); + } + + ctxt->sax = SAXHandler_Sav ; + xmlFreeParserCtxt(ctxt); + } + else + { + status = IMRS_KO; + } + + return(status); + +} + + + +IMRT_Status SDM_XML_Load_Format( char *demo_file, SDMT_BufferInfo_Contexte *mycontexte) +{ + IMRT_Status status; + NDT_Status nd_status; + char * docname = NULL; + NDT_Index_Type *index_type_ptr; + xmlDocPtr doc = NULL; + xmlDtdPtr dtd; + xmlParserCtxtPtr ctxt =NULL; + xmlSAXHandlerPtr SAXHandler_Sav; + xmlSAXHandlerPtr SAXHandler; + const char functionname[]= "SDM_XML_Load_Format"; + char DescErr[IMRD_SDMD_DESCERR_LEN]; + IMRT_Data_Version *Data_Version_Ptr; + + LIBXML_TEST_VERSION + xmlKeepBlanksDefault(0); + xmlSAXDefaultVersion(2); + xmlLineNumbersDefault(1); + + status = IMRS_OK; + docname = demo_file; + ctxt = xmlNewParserCtxt(); + /*initialisation des indexes*/ + index_type_ptr = Fmt_Struct_initial_idx_tab; + + if(ctxt != NULL) + { + mycontexte->flagerror = IMRS_OK; + SAXHandler = &SaxFmtHandlerStruct; + mycontexte->SaxCtxHdl = ctxt; + ctxt->userData = mycontexte; + SAXHandler_Sav = ctxt->sax; + ctxt->sax = SAXHandler; + ctxt->sax2 = 1 ; + + Data_Version_Ptr = (IMRT_Data_Version *) malloc(sizeof(IMRT_Data_Version)); + Data_Version_Ptr->Label[0] = '\0'; + Data_Version_Ptr->Date[0] = '\0'; + if( ( nd_status = ND_DataStruct_Open(&(mycontexte->RootFormat),IMRD_SDMD_FMT_STRUCT_IDX_NB,index_type_ptr, "SDM_Fmt_Manager",SDM_Fmt_Manager, NULL, NULL, NULL, NULL,0, Data_Version_Ptr)) != NDS_OK) + { + status = IMRS_KO; + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_5,IMRD_SDMD_TAG_FORMAT); + SDM_RaiseError(mycontexte->SaxCtxHdl,&(mycontexte->FataError),&(mycontexte->flagerror), functionname, DescErr, SDMD_XML_CODE_ERROR_5 ); + } + else + { + doc = xmlCtxtReadFile(ctxt,docname,NULL,XML_PARSE_DTDATTR+XML_PARSE_DTDVALID); + if (ctxt->lastError.code != XML_ERR_OK) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_3( "Erreur de parsing du fichier (%s): (%s) line (%d) !", docname, ctxt->lastError.message, ctxt->lastError.line); + } + else if(mycontexte->flagerror != IMRS_OK) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_1( "%s !", mycontexte->FataError.libError); + } + else + { + index_type_ptr = Fmt_Struct_final_idx_tab; + status = SDM_DataStruct_Finalize(mycontexte->RootFormat, index_type_ptr, IMRD_SDMD_FMT_STRUCT_IDX_NB); + /*SDM_DataStruct_Dump( mycontexte->RootFormat);*/ + } + } + + if((status != IMRS_OK)&&(mycontexte->RootFormat != NULL)) + { + free(mycontexte->RootFormat->User_Ptr); + nd_status = ND_DataStruct_Close(mycontexte->RootFormat); + } + + ctxt->sax = SAXHandler_Sav ; + xmlFreeParserCtxt(ctxt); + } + else + { + status = IMRS_KO; + } + + return(status); + +} + + + +IMRT_Status SDM_XML_Load_MapPath( char *demo_file, SDMT_BufferInfo_Contexte *mycontexte) +{ + IMRT_Status status; + NDT_Status nd_status; + char * docname = NULL; + NDT_Index_Type *index_type_ptr; + xmlDocPtr doc = NULL; + xmlDtdPtr dtd; + xmlParserCtxtPtr ctxt =NULL; + xmlSAXHandlerPtr SAXHandler; + xmlSAXHandlerPtr SAXHandler_Sav; + const char functionname []="SDM_XML_Load_MapPath"; + char DescErr[IMRD_SDMD_DESCERR_LEN]; + IMRT_Data_Version *Data_Version_Ptr; + + + LIBXML_TEST_VERSION + xmlKeepBlanksDefault(0); + xmlSAXDefaultVersion(2); + xmlLineNumbersDefault(1); + + status = IMRS_OK; + docname = demo_file; + ctxt = xmlNewParserCtxt(); + /*initialisation des indexes*/ + index_type_ptr = index_type_initial_tab; + + if(ctxt != NULL) + { + mycontexte->flagerror = IMRS_OK; + SAXHandler = &SaxMapPathHandlerStruct; + mycontexte->SaxCtxHdl = ctxt; + ctxt->userData = mycontexte; + SAXHandler_Sav = ctxt->sax ; + ctxt->sax = SAXHandler; + ctxt->sax2 = 1 ; + + Data_Version_Ptr = (IMRT_Data_Version *) malloc(sizeof(IMRT_Data_Version)); + Data_Version_Ptr->Label[0] = '\0'; + Data_Version_Ptr->Date[0] = '\0'; + if( ( nd_status = ND_DataStruct_Open(&(mycontexte->RootMapPath), IMRD_SDMD_INDEX_NB, index_type_ptr, "SDM_MapPath_Manager",SDM_MapPath_Manager, NULL, NULL, NULL, NULL,0, Data_Version_Ptr)) != NDS_OK) + { + status = IMRS_KO; + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_5,IMRD_SDMD_TAG_MAPPATH); + SDM_RaiseError(mycontexte->SaxCtxHdl,&(mycontexte->FataError),&(mycontexte->flagerror), functionname, DescErr, SDMD_XML_CODE_ERROR_5 ); + } + else + { + doc = xmlCtxtReadFile(ctxt,docname,NULL,XML_PARSE_DTDATTR+XML_PARSE_DTDVALID); + if (ctxt->lastError.code != XML_ERR_OK) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_3( "Erreur de parsing du fichier (%s): (%s) line (%d) !", docname, ctxt->lastError.message, ctxt->lastError.line); + } + else if(mycontexte->flagerror != IMRS_OK) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_1( "%s !", mycontexte->FataError.libError); + } + else + { + /*SDM_DataStruct_Dump(mycontexte->RootMapPath);*/ + } + } + + if(status != IMRS_OK) + { + if(mycontexte->CurrentMapPath != NULL) + { + if(mycontexte->CurrentMapPath->MapCmd_Struct_Ptr != NULL) + { + nd_status = ND_DataStruct_Close(mycontexte->CurrentMapPath->MapCmd_Struct_Ptr); + if(nd_status == NDS_OK) + { + free(mycontexte->CurrentMapPath); + } + } + } + if(mycontexte->CurrentMapCmd != NULL) + { + free(mycontexte->CurrentMapCmd); + } + + if(mycontexte->CurrentFormat != NULL) + { + if(mycontexte->CurrentFormat->FmtMsg_Struct_Ptr != NULL) + { + nd_status = ND_DataStruct_Close(mycontexte->CurrentFormat->FmtMsg_Struct_Ptr); + if(nd_status == NDS_OK) + { + free(mycontexte->CurrentFormat); + } + } + + } + + if(mycontexte->CurrentFmtMsg != NULL) + { + free(mycontexte->CurrentFmtMsg); + } + if (mycontexte->CurrentAppli != NULL) + { + free(mycontexte->CurrentAppli); + } + + if(mycontexte->RootMapPath != NULL) + { + free(mycontexte->RootMapPath->User_Ptr); + nd_status = ND_DataStruct_Close(mycontexte->RootMapPath); + } + + if(mycontexte->RootFormat != NULL) + { + free(mycontexte->RootFormat->User_Ptr); + nd_status = ND_DataStruct_Close(mycontexte->RootFormat); + } + + if(mycontexte->RootFmtAttr != NULL) + { + free(mycontexte->RootFmtAttr->User_Ptr); + nd_status = ND_DataStruct_Close(mycontexte->RootFmtAttr); + } + + if(mycontexte->RootAppli != NULL) + { + free(mycontexte->RootAppli->User_Ptr); + nd_status = ND_DataStruct_Close(mycontexte->RootAppli); + } + } + + ctxt->sax = SAXHandler_Sav ; + xmlFreeParserCtxt(ctxt); + } /* end if(ctxt != NULL) */ + else + { + status = IMRS_KO; + } + + return(status); + +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_XML_Dump_FmtAttr_Header(FILE *dump_file) +{ + fprintf(dump_file, "\n"); + fprintf(dump_file, "\n"); + fprintf(dump_file, "<%s>\n", IMRD_SDMD_FMTATTR_STRUCT); + fprintf(dump_file, "@(#) VERSIONIMR: $Label: $ $Date: 2008/11/12 02:25:23 $ $Workfile: buffer_info_xml.c $\n", + ((IMRT_Data_Version *)IMRG_SDM_Base.RootFmtAttr->User_Ptr)->Label, + ((IMRT_Data_Version *)IMRG_SDM_Base.RootFmtAttr->User_Ptr)->Date); + return( IMRS_OK); + +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_XML_Dump_FmtAttr_Body(FILE *dump_file) +{ + IMRT_Status status; + NDT_Status nd_status; + + if( ( nd_status = ND_DataStruct_Traverse( IMRG_SDM_Base.RootFmtAttr, IMRD_SDMD_CMD_API_XML_DUMP, dump_file)) != NDS_OK) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_1( "XML Dump RootFmtAttr failed (%d) !", nd_status); + } + else + { + status = IMRS_OK; + } + + return(status); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_XML_Dump_FmtAttr_Footer(FILE *dump_file) +{ + fprintf(dump_file, "\n"); + fprintf(dump_file, "\n", IMRD_SDMD_FMTATTR_STRUCT); + return( IMRS_OK); + +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_XML_Dump_FmtAttr(void) +{ + IMRT_Status status; + char dump_filename[255]; + FILE *dump_file; + + strcpy(dump_filename, SDMD_FMTATTR_FILE); + + if( ( dump_file = fopen( dump_filename, "w")) == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_1( "Can't open dump file (%s) !", dump_filename); + } + else + { + status = SDM_XML_Dump_FmtAttr_Header(dump_file); + if(status == IMRS_OK) + { + status = SDM_XML_Dump_FmtAttr_Body(dump_file); + if(status == IMRS_OK) + { + status = SDM_XML_Dump_FmtAttr_Footer(dump_file); + } + } + + fclose( dump_file); + } + + return(status); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_XML_Dump_Appli_Header(FILE *dump_file) +{ + fprintf(dump_file, "\n"); + fprintf(dump_file, "\n"); + fprintf(dump_file, "<%s>\n", IMRD_SDMD_APPLI_STRUCT); + fprintf(dump_file, "@(#) VERSIONIMR: $Label: $ $Date: 2008/11/12 02:25:23 $ $Workfile: buffer_info_xml.c $\n", + ((IMRT_Data_Version *)IMRG_SDM_Base.RootAppl->User_Ptr)->Label, + ((IMRT_Data_Version *)IMRG_SDM_Base.RootAppl->User_Ptr)->Date); + return( IMRS_OK); + +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_XML_Dump_Appli_Body(FILE *dump_file) +{ + IMRT_Status status; + NDT_Status nd_status; + + if( ( nd_status = ND_DataStruct_Traverse( IMRG_SDM_Base.RootAppl, IMRD_SDMD_CMD_API_XML_DUMP, dump_file)) != NDS_OK) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_1( "XML Dump RootAppl failed (%d) !", nd_status); + } + else + { + status = IMRS_OK; + } + + return(status); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_XML_Dump_Appli_Footer(FILE *dump_file) +{ + fprintf(dump_file, "\n"); + fprintf(dump_file, "\n", IMRD_SDMD_APPLI_STRUCT); + return( IMRS_OK); + +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_XML_Dump_Appli(void) +{ + IMRT_Status status; + char dump_filename[255]; + FILE *dump_file; + + strcpy(dump_filename, SDMD_APPLI_FILE); + + if( ( dump_file = fopen( dump_filename, "w")) == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_1( "Can't open dump file (%s) !", dump_filename); + } + else + { + status = SDM_XML_Dump_Appli_Header(dump_file); + if(status == IMRS_OK) + { + status = SDM_XML_Dump_Appli_Body(dump_file); + if(status == IMRS_OK) + { + status = SDM_XML_Dump_Appli_Footer(dump_file); + } + } + + fclose( dump_file); + } + + return(status); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_XML_Dump_Format_Header(FILE *dump_file) +{ + fprintf(dump_file, "\n"); + fprintf(dump_file, "\n"); + fprintf(dump_file, "<%s>\n", IMRD_SDMD_FMT_STRUCT); + fprintf(dump_file, "@(#) VERSIONIMR: $Label: $ $Date: 2008/11/12 02:25:23 $ $Workfile: buffer_info_xml.c $\n", + ((IMRT_Data_Version *)IMRG_SDM_Base.RootFmt->User_Ptr)->Label, + ((IMRT_Data_Version *)IMRG_SDM_Base.RootFmt->User_Ptr)->Date); + return( IMRS_OK); + +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_XML_Dump_Format_Body(FILE *dump_file) +{ + IMRT_Status status; + NDT_Status nd_status; + + if( ( nd_status = ND_DataStruct_Traverse( IMRG_SDM_Base.RootFmt, IMRD_SDMD_CMD_API_XML_DUMP, dump_file)) != NDS_OK) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_1( "XML Dump RootFmt failed (%d) !", nd_status); + } + else + { + status = IMRS_OK; + } + + return(status); + +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_XML_Dump_Format_Footer(FILE *dump_file) +{ + fprintf(dump_file, "\n"); + fprintf(dump_file, "\n", IMRD_SDMD_FMT_STRUCT); + return( IMRS_OK); + +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_XML_Dump_Format(void) +{ + IMRT_Status status; + char dump_filename[255]; + FILE *dump_file; + + strcpy(dump_filename, SDMD_FORMAT_FILE); + + if( ( dump_file = fopen( dump_filename, "w")) == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_1( "Can't open dump file (%s) !", dump_filename); + } + else + { + status = SDM_XML_Dump_Format_Header(dump_file); + if(status == IMRS_OK) + { + status = SDM_XML_Dump_Format_Body(dump_file); + if(status == IMRS_OK) + { + status = SDM_XML_Dump_Format_Footer(dump_file); + } + } + + fclose( dump_file); + } + + return(status); + +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_XML_Dump_MapPath_Header(FILE *dump_file) +{ + fprintf(dump_file, "\n"); + fprintf(dump_file, "\n"); + fprintf(dump_file, "<%s>\n", IMRD_SDMD_MAPPATH_STRUCT); + fprintf(dump_file, "@(#) VERSIONIMR: $Label: $ $Date: 2008/11/12 02:25:23 $ $Workfile: buffer_info_xml.c $\n", + ((IMRT_Data_Version *)IMRG_SDM_Base.RootMapPath->User_Ptr)->Label, + ((IMRT_Data_Version *)IMRG_SDM_Base.RootMapPath->User_Ptr)->Date); + return( IMRS_OK); + +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_XML_Dump_MapPath_Body(FILE *dump_file) +{ + IMRT_Status status; + NDT_Status nd_status; + + if( ( nd_status = ND_DataStruct_Traverse( IMRG_SDM_Base.RootMapPath, IMRD_SDMD_CMD_API_XML_DUMP, dump_file)) != NDS_OK) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_1( "XML Dump RootMapPath failed (%d) !", nd_status); + } + else + { + status = IMRS_OK; + } + + return(status); + +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_XML_Dump_MapPath_Footer(FILE *dump_file) +{ + fprintf(dump_file, "\n"); + fprintf(dump_file, "\n", IMRD_SDMD_MAPPATH_STRUCT); + return( IMRS_OK); + +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_XML_Dump_MapPath(void) +{ + IMRT_Status status; + char dump_filename[255]; + FILE *dump_file; + + strcpy(dump_filename, SDMD_MAPPATH_FILE); + + if( ( dump_file = fopen( dump_filename, "w")) == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_1( "Can't open dump file (%s) !", dump_filename); + } + else + { + status = SDM_XML_Dump_MapPath_Header(dump_file); + if(status == IMRS_OK) + { + status = SDM_XML_Dump_MapPath_Body(dump_file); + if(status == IMRS_OK) + { + status = SDM_XML_Dump_MapPath_Footer(dump_file); + } + } + + fclose( dump_file); + } + + return(status); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_XML_BufferInfo_Dump(void) +{ + IMRT_Status status; + + status = SDM_XML_Dump_Appli(); + if(status == IMRS_OK) + { + status = SDM_XML_Dump_Format(); + if(status == IMRS_OK) + { + status = SDM_XML_Dump_MapPath(); + if(status == IMRS_OK) + { + status = SDM_XML_Dump_FmtAttr(); + } + } + } + + return(status); + +} + +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ +IMRT_Status SDM_ConvertAttribute(char * Attribute_ptr, char * Attribute_convert_ptr) +{ + + char * read_ptr ; + char * write_ptr; + IMRT_Status status; + char *unescaped; + char sHexa[4]; + + status = IMRS_OK; + + for( read_ptr = Attribute_ptr, write_ptr =Attribute_convert_ptr ; *read_ptr != '\0'; read_ptr++, write_ptr++) + { + + if (*read_ptr == '%') + { + memset(sHexa, '\0', sizeof(sHexa)); + strncpy(sHexa, read_ptr, 3); + write_ptr = (char *)xmlURIUnescapeString(sHexa, strlen(sHexa), write_ptr); + read_ptr ++; + read_ptr ++; + } + else + { + if( ( *read_ptr == '\\') && ( *(read_ptr+1) != '\0') ) + { + switch( *( read_ptr + 1)) + { + case 'n': + { + *write_ptr = '\n'; + break; + } + + case 't': + { + *write_ptr = '\t'; + break; + } + + case '\\': + { + *write_ptr = '\\'; + break; + } + + case 'r': + { + *write_ptr = '\r'; + break; + } + + case 'T': + { + *write_ptr = 'T'; + break; + } + + case 'S': + { + *write_ptr = 'S'; + break; + } + + default: + { + *write_ptr = '?'; + break; + } + } + + read_ptr++; + } + else + { + if (( *read_ptr == '\n') || (*read_ptr == '\t')) + { + // *write_ptr = ''; + } + else + { + *write_ptr = *read_ptr; + } + } + } + } + + *write_ptr = '\0'; + + return(status); +} + + +IMRT_Status SDM_ConvertAttributeInv(char * Attrinute_Ptr, char * Attribute_convert_ptr) +{ + const xmlChar * string_to_escape = (xmlChar *)Attrinute_Ptr; + const xmlChar * list = (xmlChar *)"TS"; + xmlChar * Ret=NULL; + + memset(Attribute_convert_ptr, '\0', IMRD_FMTATTR_VALUE_SIZE); + Ret = xmlURIEscapeStr(string_to_escape, list); + if (Ret != NULL) + { + strcpy(Attribute_convert_ptr, (char *)Ret); + } + xmlFree(Ret); + + return(IMRS_OK); +} + + +IMRT_Status SDM_Control_Fmt_Attr(IMRT_Msg * Msg_Ptr, NDT_Root * FmtMsg_Struct_Ptr, IMRT_FmtAttr * FmtAttr_Ptr) +{ + IMRT_Status status; + NDT_Status nd_status; + + status = IMRS_OK; + + if (strcmp(FmtAttr_Ptr->Name , IMRD_FMTATTR_NAME_UNKNOWN) != 0) + { + nd_status = ND_DataStruct_Traverse(FmtMsg_Struct_Ptr, IMRD_SDMD_CMD_CHECK_FMT_ATTR, Msg_Ptr, FmtAttr_Ptr); + if (nd_status == NDS_NODE_FOUND) + { + status = IMRS_OK; + } + else + { + status = IMRS_KO; + } + } + + return(status); +} diff --git a/src/libstatic_data_mng/src/buffer_info_xml.h b/src/libstatic_data_mng/src/buffer_info_xml.h new file mode 100644 index 0000000..599cd00 --- /dev/null +++ b/src/libstatic_data_mng/src/buffer_info_xml.h @@ -0,0 +1,426 @@ +/*----------------------------------------------------------------------------*/ +/* File: buffer_info_xml.h */ +/*----------------------------------------------------------------------------*/ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#ifndef _BUFFER_INFO_XML_H_ +# define _BUFFER_INFO_XML_H_ + + + +/*----------------------------------------------------------------------------*/ +/* Global Include */ +/*----------------------------------------------------------------------------*/ + +# include + +/*----------------------------------------------------------------------------*/ +/* Locale Constantes */ +/*----------------------------------------------------------------------------*/ + +#define IMRD_SDMD_TAG_FMTATTR "fmtattr" +#define IMRD_SDMD_TAG_FMTATTR_NAME "fmtattr_name" + + +/*definition des tags xml pour le chargement des structure Format et FmtMsg*/ +#define IMRD_SDMD_TAG_FORMAT "format" +#define IMRD_SDMD_TAG_FMTMSG "fmtmsg" + +/*definition des tags xml pour le chargement de la structure Application*/ + +#define IMRD_SDMD_TAG_APPLI "appli" + +/*definition des tags xml pour le chargement de les structures MapPath et MapCmd*/ +#define IMRD_SDMD_TAG_MAPPATH "mappath" +#define IMRD_SDMD_TAG_INPUTAPPLI "inputappli" +#define IMRD_SDMD_TAG_OUTPUTAPPLI "outputappli" +#define IMRD_SDMD_TAG_INPUTFORMAT "inputformat" +#define IMRD_SDMD_TAG_INPUTFORMAT_ATTR "inputformat_attr" +#define IMRD_SDMD_TAG_OUTPUTFORMAT "outputformat" +#define IMRD_SDMD_TAG_OUTPUTFORMAT_ATTR "outputformat_attr" +#define IMRD_SDMD_TAG_MAPCMD "mapcmd" +#define IMRD_SDMD_TAG_BRANCHE_ID "branche_id" +#define IMRD_SDMD_TAG_MAPPER "mapper" +#define IMRD_SDMD_TAG_CLEARFLAG "clearflag" +#define IMRD_SDMD_TAG_INPUTBUFFER "inputbuffer" +#define IMRD_SDMD_TAG_OUTPUTBUFFER "outputbuffer" +#define IMRD_SDMD_TAG_IDENTIFIER "identifier" +#define IMRD_SDMD_TAG_NUMBUFFER "numbuffer" +#define IMRD_SDMD_TAG_GO_TO "go_to" +#define IMRD_SDMD_TAG_TYPE "type" +#define IMRD_SDMD_TAG_COPIE "copie" +#define IMRD_SDMD_TAG_IDENTTOTAL "identtotal" +#define IMRD_SDMD_TAG_ATTRIBUTE "attribute" +#define IMRD_SDMD_TAG_VALUE "value" + + +/*----------------------------------------------------------------------------*/ +/* Local definition */ +/*----------------------------------------------------------------------------*/ + + +typedef IMRT_Status (* xml_endeElement)(void * ctx, const xmlChar * localname, const xmlChar * prefix, const xmlChar * URI); + +typedef struct SDMT_BufferInfo_Contexte +{ + char value[IMRD_SDMD_VALUE_LEN]; + IMRT_Array_Xml_Path PathArray; + IMRT_Level_Tag PresentLevelTag; + int IdxJpTble; + int NbMapPath; + int NbMapCmd; + IMRT_Appl_Id CptAppl; + IMRT_FmtAttr_Id CptFmtAttr; + IMRT_Fmt_Id CptFmt; + IMRT_MapPath * CurrentMapPath; + IMRT_MapCmd * CurrentMapCmd; + IMRT_Appl * CurrentAppli; + IMRT_FmtMsg * CurrentFmtMsg; + IMRT_Fmt * CurrentFormat; + IMRT_FmtAttr * CurrentFmtAttr; + NDT_Root * RootFmtAttr; + NDT_Root * RootFormat; + NDT_Root * RootAppli; + NDT_Root * RootMapPath; + xmlParserCtxt * SaxCtxHdl; + IMRT_Error FataError; + IMRT_Status flagerror; +}SDMT_BufferInfo_Contexte; + + +/*----------------------------------------------------------------------------*/ +/* Prototypes */ +/*----------------------------------------------------------------------------*/ + +# ifdef _BUFFER_INFO_XML_C_ + +static IMRT_Status error(SDMT_BufferInfo_Contexte *ctx , const char *msg, ...); + +IMRT_Status startElementNsFmtAttr( SDMT_BufferInfo_Contexte * ctx , + const xmlChar *localname, + const xmlChar *prefix, + const xmlChar *URI, + int nb_namespaces, + const xmlChar **namespaces, + int nb_attributes, + int nb_defaulted, + const xmlChar **attributes); + +IMRT_Status startElementNsAppli( SDMT_BufferInfo_Contexte * ctx , + const xmlChar *localname, + const xmlChar *prefix, + const xmlChar *URI, + int nb_namespaces, + const xmlChar **namespaces, + int nb_attributes, + int nb_defaulted, + const xmlChar **attributes); + +IMRT_Status startElementNsFmt( SDMT_BufferInfo_Contexte * ctx , + const xmlChar *localname, + const xmlChar *prefix, + const xmlChar *URI, + int nb_namespaces, + const xmlChar **namespaces, + int nb_attributes, + int nb_defaulted, + const xmlChar **attributes); + +IMRT_Status startElementNsMapPath( SDMT_BufferInfo_Contexte * ctx , + const xmlChar *localname, + const xmlChar *prefix, + const xmlChar *URI, + int nb_namespaces, + const xmlChar **namespaces, + int nb_attributes, + int nb_defaulted, + const xmlChar **attributes); + +IMRT_Status endElementNsAppli( SDMT_BufferInfo_Contexte * ctx, + const xmlChar *localname, + const xmlChar *prefix, + const xmlChar *URI); + +IMRT_Status endElementNsFmtAttr( SDMT_BufferInfo_Contexte * ctx, + const xmlChar *localname, + const xmlChar *prefix, + const xmlChar *URI); + +IMRT_Status endElementNsFmt ( SDMT_BufferInfo_Contexte * ctx, + const xmlChar *localname, + const xmlChar *prefix, + const xmlChar *URI); + +IMRT_Status endElementNsMapPath( SDMT_BufferInfo_Contexte * ctx, + const xmlChar *localname, + const xmlChar *prefix, + const xmlChar *URI); + +IMRT_Status Buff_Info_characters(SDMT_BufferInfo_Contexte * ctx , const xmlChar *ch, int len); + +IMRT_Status SDM_XML_Load_FmtAttr( char *demo_file, SDMT_BufferInfo_Contexte *mycontexte); +IMRT_Status SDM_XML_Load_Appli( char *demo_file, SDMT_BufferInfo_Contexte *mycontexte); +IMRT_Status SDM_XML_Load_Format( char *demo_file, SDMT_BufferInfo_Contexte *mycontexte); +IMRT_Status SDM_XML_Load_MapPath( char *demo_file, SDMT_BufferInfo_Contexte *mycontexte); +IMRT_Status SDM_XML_BufferInfo_Init(IMRT_Path Lib_Path); +IMRT_Status SDM_Dump_XML_FmtAttr_Header(FILE *dump_file); +IMRT_Status SDM_Dump_XML_FmtAttr_Body(FILE *dump_file); +IMRT_Status SDM_Dump_XML_FmtAttr_Footer(FILE *dump_file); +IMRT_Status SDM_Dump_XML_FmtAttr(void); +IMRT_Status SDM_Dump_XML_Appli_Header(FILE *dump_file); +IMRT_Status SDM_Dump_XML_Appli_Body(FILE *dump_file); +IMRT_Status SDM_Dump_XML_Appli_Footer(FILE *dump_file); +IMRT_Status SDM_Dump_XML_Appli(void); +IMRT_Status SDM_Dump_XML_Format_Header(FILE *dump_file); +IMRT_Status SDM_Dump_XML_Format_Body(FILE *dump_file); +IMRT_Status SDM_Dump_XML_Format_Footer(FILE *dump_file); +IMRT_Status SDM_XML_Dump_Format(void); +IMRT_Status SDM_XML_Dump_MapPath_Header(FILE *dump_file); +IMRT_Status SDM_XML_Dump_MapPath_Body(FILE *dump_file); +IMRT_Status SDM_XML_Dump_MapPath_Footer(FILE *dump_file); +IMRT_Status SDM_XML_Dump_MapPath(void); +IMRT_Status SDM_XML_BufferInfo_Dump(void); +IMRT_Status SDM_ConvertAttribute(char * Attrinute_ptr, char * Attribute_convert_ptr); +IMRT_Status SDM_ConvertAttributeInv(char * Attrinute_Ptr, char * Attribute_convert_ptr); +IMRT_Status SDM_Control_Fmt_Attr(IMRT_Msg *, NDT_Root *, IMRT_FmtAttr *); +# else + +extern IMRT_Status SDM_XML_Load_FmtAttr( char *demo_file, SDMT_BufferInfo_Contexte *mycontexte); +extern IMRT_Status SDM_XML_Load_Appli( char *demo_file, SDMT_BufferInfo_Contexte *mycontexte); +extern IMRT_Status SDM_XML_Load_Format( char *demo_file, SDMT_BufferInfo_Contexte *mycontexte); +extern IMRT_Status SDM_XML_Load_MapPath( char *demo_file, SDMT_BufferInfo_Contexte *mycontexte); +extern IMRT_Status SDM_XML_BufferInfo_Init(IMRT_Path Lib_Path); +extern IMRT_Status SDM_Dump_XML_FmtAttr_Header(FILE *dump_file); +extern IMRT_Status SDM_Dump_XML_FmtAttr_Body(FILE *dump_file); +extern IMRT_Status SDM_Dump_XML_FmtAttr_Footer(FILE *dump_file); +extern IMRT_Status SDM_Dump_XML_FmtAttr(void); +extern IMRT_Status SDM_Dump_XML_Appli_Header(FILE *dump_file); +extern IMRT_Status SDM_Dump_XML_Appli_Body(FILE *dump_file); +extern IMRT_Status SDM_Dump_XML_Appli_Footer(FILE *dump_file); +extern IMRT_Status SDM_Dump_XML_Appli(void); +extern IMRT_Status SDM_Dump_XML_Format_Header(FILE *dump_file); +extern IMRT_Status SDM_Dump_XML_Format_Body(FILE *dump_file); +extern IMRT_Status SDM_Dump_XML_Format_Footer(FILE *dump_file); +extern IMRT_Status SDM_XML_Dump_Format(void); +extern IMRT_Status SDM_XML_Dump_MapPath_Header(FILE *dump_file); +extern IMRT_Status SDM_XML_Dump_MapPath_Body(FILE *dump_file); +extern IMRT_Status SDM_XML_Dump_MapPath_Footer(FILE *dump_file); +extern IMRT_Status SDM_XML_Dump_MapPath(void); +extern IMRT_Status SDM_XML_BufferInfo_Dump(void); +extern IMRT_Status SDM_Control_Fmt_Attr(IMRT_Msg *, NDT_Root *, IMRT_FmtAttr *); +# endif + + + +/*----------------------------------------------------------------------------*/ +/* Global Variables */ +/*----------------------------------------------------------------------------*/ +# ifdef _BUFFER_INFO_XML_C_ + +/*xmlSAXHandler Buff_Info_Error_SAX_Hdl_Struct = { + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + 1, + NULL, + NULL, + NULL, + NULL + };*/ +xmlSAXHandler SaxFmtHandlerStruct = { + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + (charactersSAXFunc)(Buff_Info_characters), + NULL, + NULL, + NULL, + NULL, + (errorSAXFunc)(error), + NULL, + NULL, + NULL, + NULL, + 1, + NULL, + (startElementNsSAX2Func)(startElementNsFmt), + (endElementNsSAX2Func)(endElementNsFmt), + NULL +}; + + +xmlSAXHandler SaxAppliHandlerStruct = { + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + (charactersSAXFunc)(Buff_Info_characters), + NULL, + NULL, + NULL, + NULL, + (errorSAXFunc)error, + NULL, + NULL, + NULL, + NULL, + 1, + NULL, + (startElementNsSAX2Func)(startElementNsAppli), + (endElementNsSAX2Func)(endElementNsAppli), + NULL +}; + +xmlSAXHandler SaxFmtAttrHandlerStruct = { + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + (charactersSAXFunc)(Buff_Info_characters), + NULL, + NULL, + NULL, + NULL, + (errorSAXFunc)error, + NULL, + NULL, + NULL, + NULL, + 1, + NULL, + (startElementNsSAX2Func)(startElementNsFmtAttr), + (endElementNsSAX2Func)(endElementNsFmtAttr), + NULL +}; + + +xmlSAXHandler SaxMapPathHandlerStruct = { + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + (charactersSAXFunc)(Buff_Info_characters), + NULL, + NULL, + NULL, + NULL, + (errorSAXFunc)error, + NULL, + NULL, + NULL, + NULL, + 1, + NULL, + (startElementNsSAX2Func)(startElementNsMapPath), + (endElementNsSAX2Func)(endElementNsMapPath), + NULL +}; + + + + +# endif + +/*----------------------------------------------------------------------------*/ + +#endif diff --git a/src/libstatic_data_mng/src/libstatic_data_mng.c b/src/libstatic_data_mng/src/libstatic_data_mng.c new file mode 100644 index 0000000..e374596 --- /dev/null +++ b/src/libstatic_data_mng/src/libstatic_data_mng.c @@ -0,0 +1,527 @@ +/*----------------------------------------------------------------------------*/ +/* $Workfile: libstatic_data_mng.c $ */ +/*----------------------------------------------------------------------------*/ +/* $Author: agibert $ */ +/* $Date: 2008/11/12 02:25:23 $ */ +/* $Revision: 1.1 $ */ +/* $Label: $ */ +/*----------------------------------------------------------------------------*/ +/*----------------------------------------------------------------------------*/ +/* File: libstatic_data_mng.c */ +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#define _LIBSTATIC_DATA_MNG_ +#define _LIBSTATIC_DATA_MNG_C_ + +#include "libstatic_data_mng.h" + + + + + + + +/******************************************************************************/ +/* Static Data Manager API */ +/******************************************************************************/ + +/*----------------------------------------------------------------------------*/ +/* Open Static Data Manager */ +/*----------------------------------------------------------------------------*/ +/* Lib_Flag: Setup SDM init mode (XML, SQL, ...) */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IMR_SDM_Library_Open( IMRT_SDM_Config * Lib_Config_Ptr) +{ + IMRT_Status status, StatusTmp; + NDT_Status nd_status; + + + + if( IMRG_SDM_Module.Lib.Status != IMRD_LIB_STATUS_CLOSED) + { + IMRD_LM_LOG_ERROR_0( "Library not closed !"); + + return( IMRS_KO); + } + else + { +#ifdef ORACLE_SUPPORT + if(( (status = SDM_HDR_SQL_Init(Lib_Config_Ptr->Flag)) != IMRS_OK)||( (status = SDM_HDR_XML_Init(Lib_Config_Ptr->Flag)) != IMRS_OK)) + { + status = IMRS_KO; + } +#else + status = IMRS_OK; +#endif /* ORACLE_SUPPORT */ + + if( status == IMRS_OK ) + { + status = SDM_StructInfo_Init(Lib_Config_Ptr); + if( status == IMRS_OK ) + { + status = SDM_MapInfo_Init(Lib_Config_Ptr); + if( status == IMRS_OK ) + { + status = SDM_BufferInfo_Init(Lib_Config_Ptr); + if( status != IMRS_OK ) + { + StatusTmp = SDM_MapInfo_DInit(); + StatusTmp = SDM_StructInfo_DInit(); + } + } + else + { + StatusTmp = SDM_StructInfo_DInit(); + } + } + + } + + if( status == IMRS_OK) + { + IMRG_SDM_Module.Lib.Status = IMRD_LIB_STATUS_OPENED; + + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_1, "Library opened !"); + } + + return(status); + } +} + + + + + +/*----------------------------------------------------------------------------*/ +/* Close Static Data Manager */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IMR_SDM_Library_Close( void) +{ + IMRT_Status status; + + + if( IMRG_SDM_Module.Lib.Status != IMRD_LIB_STATUS_OPENED) + { + IMRD_LM_LOG_ERROR_0( "Library not opened !"); + + return( IMRS_KO); + } + else + { + status = IMRS_OK; + + if( ((status = SDM_BufferInfo_DInit()) != IMRS_OK)|| + ((status = SDM_MapInfo_DInit()) != IMRS_OK)|| + ((status = SDM_StructInfo_DInit()) != IMRS_OK)|| + +#ifdef ORACLE_SUPPORT + ((status = SDM_HDR_SQL_DInit()) != IMRS_OK)|| +#endif /* ORACLE_SUPPORT */ + + ((status = SDM_HDR_XML_DInit()) != IMRS_OK) ) + { + status = IMRS_KO; + } + else + { + IMRG_SDM_Module.Lib.Status = IMRD_LIB_STATUS_CLOSED; + + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_1, "Library closed !"); + } + + return(status); + } +} + + + + + +/*----------------------------------------------------------------------------*/ +/* Proceed Format */ +/*----------------------------------------------------------------------------*/ +/* (I) CCB_Fmt_Add_Ptr: Format add callback */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IMR_SDM_Fmt_Proceed( IMRT_SDMCB_Fmt_Add *CCB_Fmt_Add_Ptr) +{ + IMRT_Status status; + + status = SDM_Fmt_Proceed(CCB_Fmt_Add_Ptr); + + return(status); +} + + + + + +/*----------------------------------------------------------------------------*/ +/* Proceed Convert */ +/*----------------------------------------------------------------------------*/ +/* (I) CCB_Cnv_Add_Ptr: Convert add callback */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IMR_SDM_Cnv_Proceed( IMRT_SDMCB_Cnv_Add *CCB_Cnv_Add_Ptr) +{ + IMRT_Status status; + + status = SDM_Cnv_Proceed(CCB_Cnv_Add_Ptr); + + return(status); +} + + + + + +/*----------------------------------------------------------------------------*/ +/* Proceed Mapping Path */ +/*----------------------------------------------------------------------------*/ +/* (I) Appl_Id_Target: Target buffer application id */ +/* (I) Fmt_Id_Target: Target buffer format id */ +/* (I) Msg_Id_Target: Target buffer message id */ +/* (I) ApplId_Src: Source buffer application id */ +/* (I) Fmt_Id_Src: Source buffer format id */ +/* (I) Msg_Id_Src: Source buffer message id */ +/* (I) CCB_Buffer_Map_Ptr: Buffer mapping callback */ +/* (I) CCB_Buffer_Copy_Ptr: Buffer copy callback */ +/* (I) CCB_Buffer_Ident_Ptr: Buffer identification callback */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IMR_SDM_MapPath_Proceed( IMRT_Appl_Id Appl_Id_Target, IMRT_Fmt_Id Fmt_Id_Target, IMRT_Msg_Id Msg_Id_Target, + IMRT_Appl_Id ApplId_Src, IMRT_Fmt_Id Fmt_Id_Src, IMRT_Msg_Id Msg_Id_Src, + IMRT_SDMCB_Buffer_Map *CCB_Buffer_Map_Ptr, + IMRT_SDMCB_Buffer_Copy *CCB_Buffer_Copy_Ptr, + IMRT_SDMCB_Buffer_Ident *CCB_Buffer_Ident_Ptr) +{ + IMRT_Status status; + + status = SDM_MapPath_Proceed(Appl_Id_Target,Fmt_Id_Target,Msg_Id_Target, + ApplId_Src,Fmt_Id_Src, Msg_Id_Src, + CCB_Buffer_Map_Ptr, + CCB_Buffer_Copy_Ptr, + CCB_Buffer_Ident_Ptr); + +} + + + + + +/*----------------------------------------------------------------------------*/ +/* Proceed Buffer Mapping */ +/*----------------------------------------------------------------------------*/ +/* (I) MsgMap_Ptr: Message map pointer */ +/* (I) CCB_Field_Map_Ptr: Field mapping callback */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IMR_SDM_MsgMap_Proceed( IMRT_MsgMap *MsgMap_Ptr, IMRT_SDMCB_Field_Map *CCB_Field_Map_Ptr) +{ + + IMRT_Status status; + + status = IMRS_OK; + + if(SDM_MsgMap_Proceed(MsgMap_Ptr,CCB_Field_Map_Ptr) != NDS_OK) + { + status = IMRS_KO; + } + + return(status); + +} + + + + + +/*----------------------------------------------------------------------------*/ +/* Proceed Message Identification */ +/*----------------------------------------------------------------------------*/ +/* (I) Fmt_Id: Target buffer format id */ +/* (O) Msg_Id_Ptr: Target buffer message id to return */ +/* (I) CCB_Field_Ident_Ptr: Field ident callback */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IMR_SDM_MsgIdent_Proceed( IMRT_Fmt_Id Fmt_Id, IMRT_Msg_Id *Msg_Id, IMRT_SDMCB_Ident_Field_Value *CCB_Ident_Field_Value_Ptr, + IMRT_SDMCB_Ident_Field_Exist *CCB_Ident_Field_Exist_Ptr, IMRT_SDMCB_Ident_Msg_Size *CCB_Ident_Msg_Size_Ptr) +{ + IMRT_Status status; + + status = SDM_MsgIdent_Proceed( Fmt_Id, Msg_Id, CCB_Ident_Field_Value_Ptr, CCB_Ident_Field_Exist_Ptr, CCB_Ident_Msg_Size_Ptr); + +} + + + + + +/*----------------------------------------------------------------------------*/ +/* Convert Buffer Format Name to Buffer Format Id */ +/*----------------------------------------------------------------------------*/ +/* (O) Fmt_Id_Ptr: Buffer format id */ +/* (I) Fmt_Name: Buffer format name */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IMR_SDM_Fmt_Id_Get( IMRT_Fmt_Id *Fmt_Id_Ptr, const IMRT_Fmt_Name Fmt_Name) +{ + IMRT_Status status; + NDT_Status nd_status; + NDT_Node *node_ptr; + IMRT_Fmt Fmt; + + + strcpy(Fmt.Name, Fmt_Name); + + if(((nd_status = ND_Index_Node_Find( &node_ptr, IMRG_SDM_Base.RootFmt, + IMRD_SDMD_FMT_IDX_NAME,&Fmt,NULL)) != NDS_OK)|| + (node_ptr == NULL)) + { + printf("\nErreur lors de la recherche de Format Name <%s>\n", Fmt_Name); + status = IMRS_KO; + } + else + { + *Fmt_Id_Ptr = ( ( IMRT_Fmt *)( node_ptr->Value))->Id; + status = IMRS_OK; + } + + return(status); +} + + + + + +/*----------------------------------------------------------------------------*/ +/* Convert Buffer Appli Name to Buffer Appli Id */ +/*----------------------------------------------------------------------------*/ +/* (O) Appl_Id_Ptr: Buffer appli id */ +/* (I) Appl_Name: Buffer appli name */ +/*----------------------------------------------------------------------------*/ + +IMRT_Status IMR_SDM_Appl_Id_Get( IMRT_Appl_Id *Appl_Id_Ptr, const IMRT_Appl_Name Appl_Name) +{ + IMRT_Status status; + NDT_Status nd_status; + NDT_Node *node_ptr; + IMRT_Appl Appli; + + + strcpy(Appli.Name, Appl_Name); + + if(((nd_status = ND_Index_Node_Find( &node_ptr, IMRG_SDM_Base.RootAppl, + IMRD_SDMD_APPL_IDX_NAME,&Appli,NULL)) != NDS_OK)|| + (node_ptr == NULL)) + { + printf("\nErreur lors de la recherche de Appli Name <%s>\n", Appl_Name); + status = IMRS_KO; + } + else + { + *Appl_Id_Ptr = ( ( IMRT_Appl *)( node_ptr->Value))->Id; + status = IMRS_OK; + } + + return(status); +} + + + +void SDM_DataStruct_Dump( NDT_Root *ds_ptr ) +{ + NDT_Status status; + + + printf( "Print DataStructure Info:\n"); + + if( ( status = ND_DataStruct_Info_Print( stdout, ds_ptr, NDD_RECURSIVE_MODE_PARENT_CHILD, 0, 0)) != NDS_OK) + { + printf( "ND_DataStruct_Info_Print() failed (%d) !\n", status); + } + + printf( "\n"); + printf( "Traverse DataStructure Index 0:\n"); + + if( ( status = ND_DataStruct_Traverse( ds_ptr, IMRD_SDMD_CMD_INDEX0_PRINT, stdout, NDD_RECURSIVE_MODE_PARENT, 0)) != NDS_OK) + { + printf( "ND_DataStruct_Traverse() failed (%d) !\n", status); + } +} + + + + + +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status IMR_SDM_SQL_Dump(void) +{ + IMRT_Status status; + +#ifdef ORACLE_SUPPORT + + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_0, "SQL Dump ..."); + + status = SDM_SQL_StructInfo_Dump(); + if(status == IMRS_OK) + { + status = SDM_SQL_MapInfo_Dump(); + if(status == IMRS_OK) + { + status = SDM_SQL_BufferInfo_Dump(); + } + } +#else + status = IMRS_OK; +#endif /* ORACLE_SUPPORT */ + + return(status); +} + + + + + +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status IMR_SDM_XML_Dump(void) +{ + IMRT_Status status; + + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_0, "XML Dump ..."); + + status = SDM_XML_StructInfo_Dump(); + if(status == IMRS_OK) + { + status = SDM_XML_MapInfo_Dump(); + if(status == IMRS_OK) + { + status = SDM_XML_BufferInfo_Dump(); + } + } + + return(status); + +} + + +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_Set_Struct_Version(IMRT_Data_Version *Data_Version_Ptr, char *Version_String_Ptr) +{ + char *Pos1_Ptr, *Pos2_Ptr; + char *Pos3_Ptr; + char Label[IMRD_SDMD_VERS_LABEL_LEN]; + char Date[IMRD_SDMD_VERS_DATE_LEN]; + int i; + + strcpy(Label, ""); + strcpy(Date, ""); + + Pos1_Ptr = strstr( Version_String_Ptr, "Label:"); + if (Pos1_Ptr != NULL) + { + Pos2_Ptr = strstr( Pos1_Ptr, "$"); + if (Pos2_Ptr == NULL) + { + return(IMRS_KO); + } + + strncpy(Label, Pos1_Ptr+6, Pos2_Ptr - Pos1_Ptr - 6); + Label[Pos2_Ptr - Pos1_Ptr - 6]='\0'; + Pos3_Ptr = Label; + i = strlen(Pos3_Ptr); + while((Pos3_Ptr[0] == ' ') && (i >= 0)) + { + Pos3_Ptr ++; + i --; + } + + i = strlen(Pos3_Ptr); + while((Pos3_Ptr[i-1] == ' ') && (i > 0)) + { + i --; + } + + if (i > 0) + { + strncpy(Data_Version_Ptr->Label, Pos3_Ptr, i); + Data_Version_Ptr->Label[i]= '\0'; + } + + Pos1_Ptr = strstr( Version_String_Ptr, "Date:"); + if (Pos1_Ptr != NULL) + { + Pos2_Ptr = strstr( Pos1_Ptr, "$"); + if (Pos2_Ptr == NULL) + { + return(IMRS_KO); + } + + strncpy(Date, Pos1_Ptr+5, Pos2_Ptr - Pos1_Ptr - 5); + Date[Pos2_Ptr - Pos1_Ptr - 5]='\0'; + Pos3_Ptr = Date; + i = strlen(Pos3_Ptr); + while((Pos3_Ptr[0] == ' ') && (i >= 0)) + { + Pos3_Ptr ++; + i --; + } + + i = strlen(Pos3_Ptr); + while((Pos3_Ptr[i-1] == ' ') && (i > 0)) + { + i --; + } + + if (i > 0) + { + strncpy(Data_Version_Ptr->Date, Pos3_Ptr, i); + Data_Version_Ptr->Date[i]= '\0'; + } + } + else + { + return(IMRS_KO); + } + } + else + { + return(IMRS_KO); + } + + return(IMRS_OK); + +} diff --git a/src/libstatic_data_mng/src/libstatic_data_mng.h b/src/libstatic_data_mng/src/libstatic_data_mng.h new file mode 100644 index 0000000..5ca0662 --- /dev/null +++ b/src/libstatic_data_mng/src/libstatic_data_mng.h @@ -0,0 +1,319 @@ +/*----------------------------------------------------------------------------*/ +/* File: libstatic_data_mng.h */ +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#ifndef _LIBSTATIC_DATA_MNG_H_ +#define _LIBSTATIC_DATA_MNG_H_ + + + + + + + +/*----------------------------------------------------------------------------*/ +/* Global Include */ +/*----------------------------------------------------------------------------*/ + +#include +#include +#include +#include + + + + + +/*----------------------------------------------------------------------------*/ +/* Lib Definitions */ +/*----------------------------------------------------------------------------*/ + +#define IMRD_SDM_MODULE_ID ( IMRT_Module_Id) 2 +#define IMRD_SDM_MODULE_NAME ( IMRT_Module_Name) "sdm" +#define IMRD_SDM_MODULE_NAME_LONG ( IMRT_Module_Name_Long) "Static Data Manager" +#define IMRD_SDM_MODULE_VERSION ( IMRT_Module_Version) "@(#) VERSIONIMR: $Label: $ $Date: 2008/11/12 02:25:23 $ $Workfile: libstatic_data_mng.h $" + +#define IMRD_MODULE_PTR &IMRG_SDM_Module + + + + + +/*----------------------------------------------------------------------------*/ +/* Local Definition */ +/*----------------------------------------------------------------------------*/ + +#define IMRD_SDMD_FUNCTION_NAME_LEN 20 +#define IMRD_SDMD_LIB_ERROR_LEN 60 +#define IMRD_SDMD_VALUE_LEN 255 +#define IMRD_SDMD_MARKUP_LEN 255 +#define IMRD_SDMD_DESCERR_LEN 60 + +#define IMRD_SDMD_SEP_NAME "-" +#define IMRD_SDMD_EMPTY_STRING "" + +#define IMRD_SDMD_CMD_INDEX0_PRINT (NDT_Command)64 +#define IMRD_SDMD_CMD_EXECUTE (NDT_Command)68 +#define NDD_CMD_EXECUTE (NDT_Command)20 + +#define IMRD_SDMD_CMD_API_XML_FILE_DUMP (NDT_Command)70 +#define IMRD_SDMD_CMD_API_SQL_FILE_DUMP (NDT_Command)71 +#define IMRD_SDMD_CMD_API_SQL_DDBB_DUMP (NDT_Command)72 + +#define IMRD_SDMD_CMD_API_XML_DUMP (NDT_Command)80 +#define IMRD_SDMD_CMD_API_SQL_DUMP (NDT_Command)81 +#define NDD_CMD_FIND_MAPPATH (NDT_Command)82 + +#define IMRD_SDMD_CMD_CHECK_FMT_ATTR (NDT_Command)83 + +/*définition de code retour spécifique pour la lib_node*/ + +#define NDS_NODE_FOUND (NDT_Status)-1000 +#define NDS_IDENT_OK (NDT_Status)-1010 +#define NDS_NO_IDENT (NDT_Status)-1020 +/**/ + + +#define IMRD_SDMD_MAX_LINE_DUMP_FILE 500 + +#define IMRD_SDMD_INDEX_NB (short)1 + +#define IMRD_SDMD_TAG_VERSION "version" +#define IMRD_SDMD_TAG_NAME "name" +#define IMRD_SDMD_TAG_MSGMAP "msgmap" +#define IMRD_SDMD_MSGMAP_IDX_ID (short)0 +#define IMRD_SDMD_MSGMAP_IDX_NAME (short)1 + +/*Liste des codes erreurs*/ +#define SDMD_XML_CODE_ERROR_1 1 +#define SDMD_XML_LIB_ERROR_1 "Balise non reconnu" +#define SDMD_XML_CODE_ERROR_2 2 +#define SDMD_XML_LIB_ERROR_2 "Insertion de l'objet %s impossible" +#define SDMD_XML_CODE_ERROR_3 3 +#define SDMD_XML_LIB_ERROR_3 "allocationde l'objet %s impossible" +#define SDMD_XML_CODE_ERROR_4 4 +#define SDMD_XML_LIB_ERROR_4 "l'objet %s de valeur %s est absent" +#define SDMD_XML_CODE_ERROR_5 5 +#define SDMD_XML_LIB_ERROR_5 "Impossible d'ouvrir la strcuture %s" +#define SDMD_CODE_ERROR_6 6 +#define SDMD_LIB_ERROR_6 "Impossible de trouvers un chemin de mapping" +#define SDMD_CODE_ERROR_7 7 +#define SDMD_LIB_ERROR_7 "La commande %d n'est pas une commande connut" +#define SDMD_CODE_ERROR_8 8 +#define SDMD_LIB_ERROR_8 "Le format %s n'est pas un présent dans la liste des formats" +#define SDMD_CODE_ERROR_9 9 +#define SDMD_LIB_ERROR_9 "Indentification du message impossible" + +#define SDMD_XML_CODE_ERROR_10 10 +#define SDMD_XML_LIB_ERROR_10 "Erreur de chargement du fichier XML %s" + +#define SDMD_CODE_ERROR_11 11 +#define SDMD_LIB_ERROR_11 "Erreur de control de coherence de Format Attribute" + + +#define IMRD_SDMD_VERS_NAME_LEN 30 +#define IMRD_SDMD_VERS_LABEL_LEN 30 +#define IMRD_SDMD_VERS_DATE_LEN 30 + + +/*----------------------------------------------------------------------------*/ +/* IMRT_Mode_Traverse definition */ +/*----------------------------------------------------------------------------*/ + +typedef short IMRT_Mode_Traverse; + +#define IMRD_SKIP_MODE ( IMRT_Mode_Traverse) 0 +#define IMRD_NORMALE_MODE ( IMRT_Mode_Traverse) 1 +#define IMRD_ERREUR_MODE ( IMRT_Mode_Traverse) 2 + + +#define IMRD_LATEST_BRANCHE ( IMRT_Branche_Id) 100 + +static NDT_Index_Type index_type_initial_tab[IMRD_SDMD_INDEX_NB] = +{ + (NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_LIST | NDD_INDEX_SUBTYPE_SORTED) +}; + +typedef struct IMRT_Error +{ + char function [IMRD_SDMD_FUNCTION_NAME_LEN]; + int errorCode; + char libError[IMRD_SDMD_LIB_ERROR_LEN]; +} IMRT_Error; + + +typedef struct IMRT_SDM_Base +{ + NDT_Root * RootMsg; + NDT_Root * RootMsgMap; + NDT_Root * RootFmtAttr; + NDT_Root * RootFmt; + NDT_Root * RootAppl; + NDT_Root * RootMapPath; + NDT_Root * RootCnv; +} IMRT_SDM_Base; + +typedef struct IMRT_SDM_IdentMessage +{ + IMRT_Msg_Name Type; + IMRT_Msg_Id Id; + IMRT_Mode_Traverse Mode; + IMRT_Branche_Id Branche_Id; + IMRT_SDMCB_Ident_Msg_Size *Ident_Msg_SizeFunc_Ptr; + IMRT_SDMCB_Ident_Field_Exist *Ident_Field_ExistFunc_Ptr; + IMRT_SDMCB_Ident_Field_Value *Ident_Field_ValueFunc_Ptr; +} IMRT_SDM_IdentMessage; + + +typedef struct IMRT_Data_Version +{ + char Label [IMRD_SDMD_VERS_LABEL_LEN]; + char Date[IMRD_SDMD_VERS_DATE_LEN]; +} IMRT_Data_Version; + + +/*----------------------------------------------------------------------------*/ +/* IMRT_Array_Xml_Path definition */ +/*----------------------------------------------------------------------------*/ + +#define IMRD_SDMD_MIN_LEVEL_TAG ( short ) -1 +#define IMRD_SDMD_MAX_LEVEL_TAG ( short ) 10 +#define IMRD_SDMD_LEVEL_TAG_0 ( short ) 0 +#define IMRD_SDMD_LEVEL_TAG_1 ( short ) 1 +#define IMRD_SDMD_LEVEL_TAG_2 ( short ) 2 +#define IMRD_SDMD_LEVEL_TAG_3 ( short ) 3 +#define IMRD_SDMD_LEVEL_TAG_4 ( short ) 4 +#define IMRD_SDMD_LEVEL_TAG_5 ( short ) 5 +#define IMRD_SDMD_LEVEL_TAG_6 ( short ) 6 +#define IMRD_SDMD_LEVEL_TAG_7 ( short ) 7 +#define IMRD_SDMD_LEVEL_TAG_8 ( short ) 8 +#define IMRD_SDMD_LEVEL_TAG_9 ( short ) 9 +#define IMRD_SDMD_SIZE_TAG_LEN ( short ) 30 +#define IMRD_SDMD_SIZE_TAG_SIZE ( short ) ( IMRD_SDMD_SIZE_TAG_LEN + 1) + + + + + +/*----------------------------------------------------------------------------*/ +/* IMRT_Array_Xml_Path definition */ +/*----------------------------------------------------------------------------*/ + +typedef char IMRT_Level_Name[IMRD_SDMD_SIZE_TAG_SIZE]; + +typedef IMRT_Level_Name IMRT_Array_Xml_Path[IMRD_SDMD_MAX_LEVEL_TAG]; + + + + + +/*----------------------------------------------------------------------------*/ +/* IMRT_Level_Tag definition */ +/*----------------------------------------------------------------------------*/ +typedef short IMRT_Level_Tag; + + + + + + +/*----------------------------------------------------------------------------*/ +/* Prototypes */ +/*----------------------------------------------------------------------------*/ + +# ifdef _LIBSTATIC_DATA_MNG_C_ + +void SDM_DataStruct_Dump( NDT_Root * ); +IMRT_Status SDM_Set_Struct_Version(IMRT_Data_Version *, char *); +# else + +extern void SDM_DataStruct_Dump( NDT_Root * ); +extern IMRT_Status SDM_Set_Struct_Version(IMRT_Data_Version *, char *); +# endif + + + + + +/*----------------------------------------------------------------------------*/ +/* Local Includes */ +/*----------------------------------------------------------------------------*/ + +#include "arc_hdl_xml.h" + +#ifdef ORACLE_SUPPORT +# include "arc_hdl_sql.h" +#endif /* ORACLE_SUPPORT */ + +#include "buffer_info_mng.h" +#include "mapping_info_mng.h" +#include "struct_info_mng.h" + + + + + +/*----------------------------------------------------------------------------*/ +/* Global Variables */ +/*----------------------------------------------------------------------------*/ + + +# ifdef _LIBSTATIC_DATA_MNG_C_ + +IMRT_SDM_Base IMRG_SDM_Base; + + + +IMRT_Module IMRG_SDM_Module = +{ + IMRD_SDM_MODULE_ID, + IMRD_SDM_MODULE_NAME, + IMRD_SDM_MODULE_NAME_LONG, + IMRD_SDM_MODULE_VERSION, + IMRD_MODULE_TYPE_LIBRARY, + { + IMRD_LIB_STATUS_CLOSED, + ( IMRT_Lib_Open *) &IMR_SDM_Library_Open, + ( IMRT_Lib_Close *) &IMR_SDM_Library_Close + } +}; + +# else + +extern IMRT_SDM_Base IMRG_SDM_Base; +extern IMRT_Module IMRG_SDM_Module; + +# endif + + + + + +/*----------------------------------------------------------------------------*/ + +#endif diff --git a/src/libstatic_data_mng/src/mapping_info_mng.c b/src/libstatic_data_mng/src/mapping_info_mng.c new file mode 100644 index 0000000..d589d6a --- /dev/null +++ b/src/libstatic_data_mng/src/mapping_info_mng.c @@ -0,0 +1,843 @@ +/*----------------------------------------------------------------------------*/ +/* File: mapping_info_mng.c */ +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#define _LIBSTATIC_DATA_MNG_ +#define _MAPPING_INFO_MNG_C_ + +#include "mapping_info_mng.h" + + + + +/*----------------------------------------------------------------------------*/ +/* FieldMap Manager */ +/*----------------------------------------------------------------------------*/ + +NDT_Status SDM_FieldMap_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node *Node_Ptr, NDT_Command Command, va_list Args) +{ + NDT_Command_Name Command_Name; + + + switch( Command) + { + case NDD_CMD_MANAGER_VERSION: + { + NDT_Version_Name *Version_Name_Ptr = (NDT_Version_Name *)va_arg( Args, NDT_Version_Name *); + + + Command_Name = "NDD_CMD_MANAGER_VERSION"; + + *Version_Name_Ptr = "Revision: 2.1 Name: libnode-2_0_4-1 Date: 2002/02/28 22:00:35 Author: agibert "; + + return( NDS_OK); + } + + case NDD_CMD_INDEX_GET: + { + /* + NDT_Index_Id *Reply_Index_Id_Ptr = (NDT_Index_Id *)va_arg( Args, NDT_Index_Id *); + NDT_Command *Reply_Command_Ptr = (NDT_Command *)va_arg( Args, NDT_Command *); + NDT_Command Cmd = (NDT_Command)va_arg( Args, NDT_Command); + void *Value_ptr = (void *)va_arg( Args, void *); + */ + NDT_Index_Id *Reply_Index_Id_Ptr = (NDT_Index_Id *)va_arg( Args, NDT_Index_Id *); + NDT_Command *Reply_Command_Ptr = (NDT_Command *)va_arg( Args, NDT_Command *); + NDT_Command Cmd = (NDT_Command)va_arg( Args, NDT_Command); + IMRT_FieldMap * Value_ptr = (IMRT_FieldMap *)va_arg( Args, IMRT_FieldMap *); + + + Command_Name = "NDD_CMD_INDEX_GET"; + + switch(Cmd) + { + case IMRD_SDMD_CMD_INDEX0_PRINT: + { + *Reply_Index_Id_Ptr = 0; + *Reply_Command_Ptr = NDD_CMD_VALUE_PRINT; + + break; + } + case IMRD_SDMD_CMD_EXECUTE: + { + *Reply_Index_Id_Ptr = 0; + *Reply_Command_Ptr = NDD_CMD_EXECUTE; + + break; + } + + default: + { + *Reply_Index_Id_Ptr = Index_Id; + *Reply_Command_Ptr = Cmd; + + break; + } + } + + return( NDS_OK); + } + + case NDD_CMD_VALUE_ALLOC: + { + /* + void **Value_Ptr_Ptr = (void **)va_arg( Args, void **); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + IMRT_FieldMap **Value_Ptr_Ptr = va_arg( Args, IMRT_FieldMap **); + + + Command_Name = "NDD_CMD_VALUE_ALLOC"; + + if( ( *Value_Ptr_Ptr = (IMRT_FieldMap *)malloc( sizeof(IMRT_FieldMap))) == NULL) + { + return( NDS_ERRMEM); + } + else + { + SDM_InitFieldMap( *Value_Ptr_Ptr); + + return( NDS_OK); + } + } + + case NDD_CMD_VALUE_FREE: + { + /* + void *Value_Ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + IMRT_FieldMap *Value_Ptr = (IMRT_FieldMap *)va_arg( Args, IMRT_FieldMap *); + + + Command_Name = "NDD_CMD_VALUE_FREE"; + + free( Value_Ptr); + + return( NDS_OK); + } + + case NDD_CMD_VALUE_COMP: + { + /* + void *Value1_Ptr = (void *)va_arg( Args, void *); + void *Value2_Ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + IMRT_FieldMap *Value1_Ptr = va_arg( Args, IMRT_FieldMap *); + IMRT_FieldMap *Value2_Ptr = va_arg( Args, IMRT_FieldMap *); + + + Command_Name = "NDD_CMD_VALUE_COMP"; + + switch( Index_Id) + { + case 0: + { + if( Value1_Ptr->Id < Value2_Ptr->Id) + { + return( NDS_LOWER); + } + else + { + if( Value1_Ptr->Id > Value2_Ptr->Id) + { + return( NDS_GREATER); + } + else + { + return( NDS_EQUAL); + } + } + } + + default: + { + printf( "Unknown COMP idx (%d) !\n", Index_Id); + + return( NDS_KO); + } + } + + return( NDS_OK); + } + + case NDD_CMD_VALUE_ADD: + { + /* + void *Value_Ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + + Command_Name = "NDD_CMD_VALUE_ADD"; + + return( NDS_OK); + } + + case NDD_CMD_VALUE_REMOVE: + { + /* + void *Value_Ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + + Command_Name = "NDD_CMD_VALUE_REMOVE"; + + return( NDS_OK); + } + + case NDD_CMD_VALUE_PRINT: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + va_list user_args = (va_list)va_arg( lib_args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + void *Value_Ptr = Node_Ptr->Value; + */ + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + + IMRT_FieldMap *Value_Ptr = Node_Ptr->Value; + + + Command_Name = "NDD_CMD_VALUE_PRINT"; + + fprintf( Out, "Id: (%d) InputField: (%s) OutputField: (%s)\n", + Value_Ptr->Id, Value_Ptr->Field_Input_Ptr->Name, Value_Ptr->Field_Output_Ptr->Name); + + return( NDS_OK); + } + + case NDD_CMD_INFO_PRINT: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + va_list user_args = (va_list)va_arg( lib_args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + void *Value_Ptr = Node_Ptr->Value; + */ + + Command_Name = "NDD_CMD_INFO_PRINT"; + + return( NDS_OK); + } + + case NDD_CMD_EXECUTE: + { /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + NDT_Recursive_Offset Recursive_Offset = (NDT_Recursive_Offset)va_arg( lib_args, NDT_Recursive_Offset); + va_list user_args = (va_list)va_arg( lib_args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + void *Value_Ptr = Node_Ptr->Value; + */ + IMRT_FieldMap * Value_Ptr = (IMRT_FieldMap*)Node_Ptr->Value; + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + va_list user_args = (va_list)va_arg( Args, va_list); + IMRT_SDMCB_Field_Map * MappingFieldFunc = ( IMRT_SDMCB_Field_Map *)va_arg(lib_args, IMRT_SDMCB_Field_Map *); + IMRT_Status status; + + status = MappingFieldFunc(Value_Ptr->Field_Output_Ptr, Value_Ptr->Field_Input_Ptr); + if (status == IMRS_KO) + { + return( NDS_KO); + } + return( NDS_OK); + } + + case IMRD_SDMD_CMD_API_SQL_DUMP: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + + void *Value_Ptr = Node_Ptr->Value; + */ + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list user_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( user_args, FILE *); + IMRT_MsgMap_Id MsgMap_Id = (IMRT_MsgMap_Id)va_arg( user_args, IMRT_MsgMap_Id); + IMRT_FieldMap *FieldMap_Ptr = Node_Ptr->Value; + + + Command_Name = "IMRD_SDMD_CMD_API_SQL_DUMP"; + + fprintf( Out, "INSERT INTO IMR_FIELD_MAP(FIELD_MAP_ID, MSG_MAP_ID, FIELD_IN_ID, FIELD_OUT_ID) VALUES(%d, %d, %d, %d);\n", + FieldMap_Ptr->Id, MsgMap_Id, FieldMap_Ptr->Field_Input_Ptr->Id, FieldMap_Ptr->Field_Output_Ptr->Id); + + return( NDS_OK); + } + + case IMRD_SDMD_CMD_API_XML_DUMP: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + + void *Value_Ptr = Node_Ptr->Value; + */ + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list user_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( user_args, FILE *); + + IMRT_FieldMap *FieldMap_Ptr = Node_Ptr->Value; + + + Command_Name = "IMRD_SDMD_CMD_API_XML_DUMP"; + + fprintf( Out, "\t\t\t<%s>\n\t\t\t\t<%s>%s\n\t\t\t\t<%s>%s\n\t\t\t\n", IMRD_SDMD_TAG_FIELDMAP, + IMRD_SDMD_TAG_INPUTFIELD, FieldMap_Ptr->Field_Input_Ptr->Name, IMRD_SDMD_TAG_INPUTFIELD, + IMRD_SDMD_TAG_OUTPUTFIELD, FieldMap_Ptr->Field_Output_Ptr->Name, IMRD_SDMD_TAG_OUTPUTFIELD, + IMRD_SDMD_TAG_FIELDMAP); + + return( NDS_OK); + } + + default: + { + printf( "SDM_FieldMap_Manager() called with an undefined command %d\n", Command); + + return( NDS_ERRAPI); + } + } + + printf( "SDM_FieldMap_Manager() called with command %d (%s)\n", Command, Command_Name); + + return( NDS_OK); +} + + + + + +/*----------------------------------------------------------------------------*/ +/* MsgMap Manager */ +/*----------------------------------------------------------------------------*/ + +NDT_Status SDM_MsgMap_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node *Node_Ptr, NDT_Command Command, va_list Args) +{ + NDT_Command_Name Command_Name; + NDT_Status status; + + + switch( Command) + { + case NDD_CMD_MANAGER_VERSION: + { + NDT_Version_Name *Version_Name_Ptr = (NDT_Version_Name *)va_arg( Args, NDT_Version_Name *); + + + Command_Name = "NDD_CMD_MANAGER_VERSION"; + + *Version_Name_Ptr = "Revision: 2.1 Name: libnode-2_0_4-1 Date: 2002/02/28 22:00:35 Author: agibert "; + + return( NDS_OK); + } + + case NDD_CMD_INDEX_GET: + { + /* + NDT_Index_Id *Reply_Index_Id_Ptr = (NDT_Index_Id *)va_arg( Args, NDT_Index_Id *); + NDT_Command *Reply_Command_Ptr = (NDT_Command *)va_arg( Args, NDT_Command *); + NDT_Command Cmd = (NDT_Command)va_arg( Args, NDT_Command); + void *Value_ptr = (void *)va_arg( Args, void *); + */ + NDT_Index_Id *Reply_Index_Id_Ptr = (NDT_Index_Id *)va_arg( Args, NDT_Index_Id *); + NDT_Command *Reply_Command_Ptr = (NDT_Command *)va_arg( Args, NDT_Command *); + NDT_Command Cmd = (NDT_Command)va_arg( Args, NDT_Command); + IMRT_MsgMap * Value_ptr = (IMRT_MsgMap *)va_arg( Args, IMRT_MsgMap *); + + + Command_Name = "NDD_CMD_INDEX_GET"; + + switch(Cmd) + { + case IMRD_SDMD_CMD_INDEX0_PRINT: + { + *Reply_Index_Id_Ptr = 0; + *Reply_Command_Ptr = NDD_CMD_VALUE_PRINT; + + break; + } + + case IMRD_SDMD_CMD_API_SQL_DUMP: + { + *Reply_Index_Id_Ptr = IMRD_SDMD_MSGMAP_IDX_ID; + *Reply_Command_Ptr = IMRD_SDMD_CMD_API_SQL_DUMP; + break; + } + + case IMRD_SDMD_CMD_API_XML_DUMP: + { + *Reply_Index_Id_Ptr = IMRD_SDMD_MSGMAP_IDX_ID; + *Reply_Command_Ptr = IMRD_SDMD_CMD_API_XML_DUMP; + break; + } + + default: + { + *Reply_Index_Id_Ptr = Index_Id; + *Reply_Command_Ptr = Cmd; + + break; + } + } + + return( NDS_OK); + } + + case NDD_CMD_VALUE_ALLOC: + { + /* + void **Value_Ptr_Ptr = (void **)va_arg( Args, void **); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + IMRT_MsgMap **Value_Ptr_Ptr = va_arg( Args, IMRT_MsgMap **); + + + Command_Name = "NDD_CMD_VALUE_ALLOC"; + + if( ( *Value_Ptr_Ptr = (IMRT_MsgMap *)malloc( sizeof(IMRT_MsgMap))) == NULL) + { + return( NDS_ERRMEM); + } + else + { + SDM_InitMsgMap(*Value_Ptr_Ptr); + + if( ( status = ND_DataStruct_Open( &(*Value_Ptr_Ptr)->FieldMap_Struct_Ptr, IMRD_SDMD_INDEX_NB, index_type_initial_tab, "SDM_FieldMap_Manager", SDM_FieldMap_Manager, NULL, NULL, NULL, NULL,0, NULL)) != NDS_OK) + { + printf( "ND_DataStruct_Open() FieldMap failed (%d) !\n", status); + } + + return( NDS_OK); + } + } + + case NDD_CMD_VALUE_FREE: + { + /* + void *Value_Ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + IMRT_MsgMap *Value_Ptr = (IMRT_MsgMap *)va_arg( Args, IMRT_MsgMap *); + + + Command_Name = "NDD_CMD_VALUE_FREE"; + + if(Value_Ptr->FieldMap_Struct_Ptr != NULL) + { if( ( status = ND_DataStruct_Close(Value_Ptr->FieldMap_Struct_Ptr)) != NDS_OK) + { + printf( "ND_DataStruct_Close() failed (%d) !\n", status); + + return(status); + } + } + + free( Value_Ptr); + + return( NDS_OK); + } + + case NDD_CMD_VALUE_COMP: + { + /* + void *Value1_Ptr = (void *)va_arg( Args, void *); + void *Value2_Ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + IMRT_MsgMap *Value1_Ptr = va_arg( Args, IMRT_MsgMap *); + IMRT_MsgMap *Value2_Ptr = va_arg( Args, IMRT_MsgMap *); + + + Command_Name = "NDD_CMD_VALUE_COMP"; + + switch( Index_Id) + { + case IMRD_SDMD_MSGMAP_IDX_ID: + { + if( Value1_Ptr->Id < Value2_Ptr->Id) + { + return( NDS_LOWER); + } + else + { + if( Value1_Ptr->Id > Value2_Ptr->Id) + { + return( NDS_GREATER); + } + else + { + return( NDS_EQUAL); + } + } + } + + case IMRD_SDMD_MSGMAP_IDX_NAME: + { + int rc; + + + rc=strcmp( Value1_Ptr->Name, Value2_Ptr->Name); + + if( rc <0) + { + return( NDS_LOWER); + } + else + { + if( rc > 0) + { + return( NDS_GREATER); + } + else + { + return( NDS_EQUAL); + } + } + } + + default: + { + printf( "Unknown COMP idx (%d) !\n", Index_Id); + + return( NDS_KO); + } + } + + return( NDS_OK); + } + + case NDD_CMD_VALUE_ADD: + { + /* + void *Value_Ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + + Command_Name = "NDD_CMD_VALUE_ADD"; + + return( NDS_OK); + } + + case NDD_CMD_VALUE_REMOVE: + { + /* + void *Value_Ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + + Command_Name = "NDD_CMD_VALUE_REMOVE"; + + return( NDS_OK); + } + + case NDD_CMD_VALUE_PRINT: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + NDT_Recursive_Offset Recursive_Offset = (NDT_Recursive_Offset)va_arg( lib_args, NDT_Recursive_Offset); + va_list user_args = (va_list)va_arg( lib_args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + void *Value_Ptr = Node_Ptr->Value; + */ + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + NDT_Recursive_Offset Recursive_Offset = (NDT_Recursive_Offset)va_arg( lib_args, NDT_Recursive_Offset); + + IMRT_MsgMap *Value_Ptr = Node_Ptr->Value; + + + Command_Name = "NDD_CMD_VALUE_PRINT"; + + printf("Adresse avant traverse (%x)\n",Value_Ptr); + + fprintf( Out, "Name: (%s) InputMsgName: (%s) OutputMsgName: (%s) \n", + Value_Ptr->Name, Value_Ptr->Msg_Input_Ptr->Name, Value_Ptr->Msg_Output_Ptr->Name); + + return( ND_DataStruct_Value_Print( Out, Value_Ptr->FieldMap_Struct_Ptr, NDD_RECURSIVE_MODE_PARENT_CHILD, --Recursive_Depth, ++Recursive_Offset)); + } + + case NDD_CMD_INFO_PRINT: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + NDT_Recursive_Offset Recursive_Offset = (NDT_Recursive_Offset)va_arg( lib_args, NDT_Recursive_Offset); + va_list user_args = (va_list)va_arg( lib_args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + void *Value_Ptr = Node_Ptr->Value; + */ + + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + NDT_Recursive_Offset Recursive_Offset = (NDT_Recursive_Offset)va_arg( lib_args, NDT_Recursive_Offset); + + IMRT_MsgMap *Msg_Ptr = Node_Ptr->Value; + + + Command_Name = "NDD_CMD_INFO_PRINT"; + + return( ND_DataStruct_Info_Print( Out, Msg_Ptr->FieldMap_Struct_Ptr, NDD_RECURSIVE_MODE_PARENT_CHILD, --Recursive_Depth, ++Recursive_Offset)); + } + + + case IMRD_SDMD_CMD_API_SQL_DUMP: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + + void *Value_Ptr = Node_Ptr->Value; + */ + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list user_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( user_args, FILE *); + + IMRT_MsgMap *MsgMap_Ptr = Node_Ptr->Value; + + + Command_Name = "IMRD_SDMD_CMD_API_SQL_DUMP"; + + fprintf( Out, "INSERT INTO IMR_MSG_MAP(MSG_MAP_ID, MSG_MAP_NAME, MSG_IN_ID, MSG_OUT_ID) VALUES(%d, '%s', %d, %d);\n", + MsgMap_Ptr->Id, MsgMap_Ptr->Name, MsgMap_Ptr->Msg_Input_Ptr->Id, MsgMap_Ptr->Msg_Output_Ptr->Id); + + if( ( status = ND_DataStruct_Traverse( MsgMap_Ptr->FieldMap_Struct_Ptr, IMRD_SDMD_CMD_API_SQL_DUMP, Out, MsgMap_Ptr->Id)) != NDS_OK) + { + printf( "ND_DataStruct_Traverse failed (%d)...\n"); + return(NDS_KO); + } + + return( NDS_OK); + } + + case IMRD_SDMD_CMD_API_XML_DUMP: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + + void *Value_Ptr = Node_Ptr->Value; + */ + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list user_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( user_args, FILE *); + + IMRT_MsgMap *MsgMap_Ptr = Node_Ptr->Value; + + + Command_Name = "IMRD_SDMD_CMD_API_XML_DUMP"; + + fprintf( Out, "\t<%s>\n\t\t<%s>%s\n\t\t<%s>%s\n\t\t<%s>%s\n\t\t<%s>\n", IMRD_SDMD_TAG_MSGMAP, + IMRD_SDMD_TAG_NAME, MsgMap_Ptr->Name, IMRD_SDMD_TAG_NAME, + IMRD_SDMD_TAG_INPUTMSG, MsgMap_Ptr->Msg_Input_Ptr->Name, IMRD_SDMD_TAG_INPUTMSG, + IMRD_SDMD_TAG_OUTPUTMSG, MsgMap_Ptr->Msg_Output_Ptr->Name, IMRD_SDMD_TAG_OUTPUTMSG, + IMRD_SDMD_TAG_FIELDMAPSTRUCT); + + if( ( status = ND_DataStruct_Traverse( MsgMap_Ptr->FieldMap_Struct_Ptr, IMRD_SDMD_CMD_API_XML_DUMP, Out)) != NDS_OK) + { + printf( "ND_DataStruct_Traverse failed (%d)...\n"); + return(NDS_KO); + } + + fprintf( Out, "\t\t\n\t\n", IMRD_SDMD_TAG_FIELDMAPSTRUCT, IMRD_SDMD_TAG_MSGMAP); + + return( NDS_OK); + } + + + default: + { + printf( "SDM_MsgMap_Manager() called with an undefined command %d\n", Command); + + return( NDS_ERRAPI); + } + } + + printf( "SDM_MsgMap_Manager() called with command %d (%s)\n", Command, Command_Name); + + return( NDS_OK); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_MapInfo_Init(IMRT_SDM_Config * Lib_Config_Ptr) +{ + IMRT_Status status; + if(Lib_Config_Ptr->Flag == IMRD_SDM_FLAG_XML) + { + status = SDM_XML_MapInfo_Init(Lib_Config_Ptr->Lib_Path); + } + else + { +#ifdef ORACLE_SUPPORT + status = SDM_SQL_MapInfo_Init(); +#else + status = IMRS_OK; +#endif /* ORACLE_SUPPORT */ + } + return(status); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_Close_RootMsgMap(void) +{ + IMRT_Status status; + NDT_Status nd_status; + + status = IMRS_OK; + + if(IMRG_SDM_Base.RootMsgMap != NULL) + { + if (IMRG_SDM_Base.RootMsgMap->User_Ptr != NULL) + { + free(IMRG_SDM_Base.RootMsgMap->User_Ptr); + } + + if( ( nd_status = ND_DataStruct_Close(IMRG_SDM_Base.RootMsgMap)) != NDS_OK) + { + printf( "RootMsgMap ND_DataStruct_Close() failed (%d) !\n", nd_status); + status = IMRS_KO; + } + } + + return(status); + +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_MapInfo_DInit(void) +{ + IMRT_Status status, StatusMsgMap; + NDT_Status nd_status; + + status = IMRS_OK; + + StatusMsgMap = SDM_Close_RootMsgMap(); + + if(StatusMsgMap == IMRS_KO) + { + status = IMRS_KO; + } + + return(status); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_MsgMap_Proceed( IMRT_MsgMap *MsgMap_Ptr, IMRT_SDMCB_Field_Map *CCB_Field_Map_Ptr) +{ + + NDT_Status status; + + if( ( status = ND_DataStruct_Traverse( MsgMap_Ptr->FieldMap_Struct_Ptr, IMRD_SDMD_CMD_EXECUTE, stdout, NDD_RECURSIVE_MODE_PARENT,CCB_Field_Map_Ptr)) != NDS_OK) + { + printf( "ND_DataStruct_Traverse() failed (%d) !\n", status); + } + return((IMRT_Status)status); +} + +void SDM_InitMsgMap(IMRT_MsgMap * mymsgmap) +{ + memset(mymsgmap->Name,0,sizeof(mymsgmap->Name)); + mymsgmap->Msg_Input_Ptr = NULL; + mymsgmap->Msg_Output_Ptr = NULL; + mymsgmap->FieldMap_Struct_Ptr = NULL; +} + +void SDM_InitFieldMap(IMRT_FieldMap * myfieldmap) +{ + myfieldmap->Id = IMRD_FIELDMAP_ID_UNKNOWN; + myfieldmap->Field_Input_Ptr = NULL; + myfieldmap->Field_Output_Ptr = NULL; +} diff --git a/src/libstatic_data_mng/src/mapping_info_mng.h b/src/libstatic_data_mng/src/mapping_info_mng.h new file mode 100644 index 0000000..fcdc407 --- /dev/null +++ b/src/libstatic_data_mng/src/mapping_info_mng.h @@ -0,0 +1,118 @@ +/*----------------------------------------------------------------------------*/ +/* File: mapping_info_mng.h */ +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#ifndef _MAPPING_INFO_MNG_H_ +# define _MAPPING_INFO_MNG_H_ + + + +/*----------------------------------------------------------------------------*/ +/* Global Include */ +/*----------------------------------------------------------------------------*/ + +# include + + +/*----------------------------------------------------------------------------*/ +/* XML TAG */ +/*----------------------------------------------------------------------------*/ +#define IMRD_SDMD_TAG_MSGMAP_STRUCT "msgmap_struct" + +/* Nom des fichiers pour le chargement XML */ +#define SDMD_MSGMAP_FILE "sd_msgmap_struct.xml" + + +/********************************************************************/ +/* Les index du Manager SDM_MsgMap_Manager */ +/********************************************************************/ +#define IMRD_SDMD_MSGMAP_STRUCT_IDX_NB (short)2 + +static NDT_Index_Type MsgMap_Struct_initial_idx_tab[IMRD_SDMD_MSGMAP_STRUCT_IDX_NB] = +{ + (NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_LIST | NDD_INDEX_SUBTYPE_SORTED), + (NDD_INDEX_STATUS_CLOSED) +}; + +static NDT_Index_Type MsgMap_Struct_final_idx_tab[IMRD_SDMD_MSGMAP_STRUCT_IDX_NB] = +{ + (NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_TREE | NDD_INDEX_SUBTYPE_BALANCED), + (NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_TREE | NDD_INDEX_SUBTYPE_BALANCED) +}; + + + +/*----------------------------------------------------------------------------*/ +/* Prototypes */ +/*----------------------------------------------------------------------------*/ + +# ifdef _MAPPING_INFO_MNG_C_ + +NDT_Status SDM_FieldMap_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list); +NDT_Status SDM_MsgMap_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list); +IMRT_Status SDM_MapInfoInfo_Init(IMRT_Lib_Flag Lib_Flag); +IMRT_Status SDM_Close_RootMsgMap(void); +IMRT_Status SDM_MapInfo_Init(IMRT_SDM_Config * Lib_Config_Ptr); +IMRT_Status SDM_MapInfo_DInit(void); +IMRT_Status SDM_MsgMap_Proceed( IMRT_MsgMap *MsgMap_Ptr, IMRT_SDMCB_Field_Map *CCB_Field_Map_Ptr); +void SDM_InitMsgMap(IMRT_MsgMap * mymsgmap); +void SDM_InitFieldMap(IMRT_FieldMap * myfieldmap); + +# else + +extern NDT_Status SDM_FieldMap_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list); +extern NDT_Status SDM_MsgMap_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list); +extern IMRT_Status SDM_MapInfo_Init(IMRT_SDM_Config * Lib_Config_Ptr); +extern IMRT_Status SDM_Close_RootMsgMap(void); +extern IMRT_Status SDM_MapInfo_DInit(void); +extern IMRT_Status SDM_MsgMap_Proceed( IMRT_MsgMap *MsgMap_Ptr, IMRT_SDMCB_Field_Map *CCB_Field_Map_Ptr); + +# endif + + + + + +/*----------------------------------------------------------------------------*/ +/* Local Includes */ +/*----------------------------------------------------------------------------*/ + +# ifdef _MAPPING_INFO_MNG_C_ + +# include "mapping_info_xml.h" +# include "mapping_info_sql.h" + +# endif + + + + + +/*----------------------------------------------------------------------------*/ + +#endif diff --git a/src/libstatic_data_mng/src/mapping_info_sql.h b/src/libstatic_data_mng/src/mapping_info_sql.h new file mode 100644 index 0000000..fb308f0 --- /dev/null +++ b/src/libstatic_data_mng/src/mapping_info_sql.h @@ -0,0 +1,79 @@ +/*----------------------------------------------------------------------------*/ +/* File: mapping_info_sql.h */ +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#ifndef _MAPPING_INFO_SQL_H_ +# define _MAPPING_INFO_SQL_H_ + + + +/*----------------------------------------------------------------------------*/ +/* Global Include */ +/*----------------------------------------------------------------------------*/ + +# include + + + + + +/*----------------------------------------------------------------------------*/ +/* Prototypes */ +/*----------------------------------------------------------------------------*/ + +# ifdef _MAPPING_INFO_SQL_PC_ + +IMRT_Status SDM_SQL_MapInfo_Init(void); +IMRT_Status SDM_SQL_Load_MsgMap(NDT_Root **myRootMsgMap_Ptr_Ptr); +IMRT_Status SDM_SQL_LoadFieldMap(IMRT_MsgMap *myMsgMap); +IMRT_Status SDM_SQL_Dump_MsgMap_Header(FILE *dump_file); +IMRT_Status SDM_SQL_Dump_MsgMap_Body(FILE *dump_file); +IMRT_Status SDM_SQL_Dump_MsgMap_Footer(FILE *dump_file); +IMRT_Status SDM_SQL_Dump_MsgMap(void); +IMRT_Status SDM_SQL_MapInfo_Dump(void); + +# else + +extern IMRT_Status SDM_SQL_MapInfo_Init(void); +extern IMRT_Status SDM_SQL_Load_MsgMap(NDT_Root **myRootMsgMap_Ptr_Ptr); +extern IMRT_Status SDM_SQL_LoadFieldMap(IMRT_MsgMap *myMsgMap); +extern IMRT_Status SDM_SQL_Dump_MsgMap_Header(FILE *dump_file); +extern IMRT_Status SDM_SQL_Dump_MsgMap_Body(FILE *dump_file); +extern IMRT_Status SDM_SQL_Dump_MsgMap_Footer(FILE *dump_file); +extern IMRT_Status SDM_SQL_Dump_MsgMap(void); +extern IMRT_Status SDM_SQL_MapInfo_Dump(void); + +# endif + + + + + +/*----------------------------------------------------------------------------*/ + +#endif diff --git a/src/libstatic_data_mng/src/mapping_info_sql.pc b/src/libstatic_data_mng/src/mapping_info_sql.pc new file mode 100644 index 0000000..57f3608 --- /dev/null +++ b/src/libstatic_data_mng/src/mapping_info_sql.pc @@ -0,0 +1,402 @@ +/*----------------------------------------------------------------------------*/ +/* File: mapping_info_sql.pc */ +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#define _LIBSTATIC_DATA_MNG_ +#define _MAPPING_INFO_SQL_PC_ + +#include "mapping_info_sql.h" + +IMRT_Status SDM_SQL_MapInfo_Init(void) +{ + IMRT_Status status; + + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_0, "Loading MsgMap..."); + status = SDM_SQL_Load_MsgMap(&(IMRG_SDM_Base.RootMsgMap)); + + if(status == IMRS_OK) + { + IMRD_LM_LOG_INFO_1( "MsgMap loaded: (%d)", IMRG_SDM_Base.RootMsgMap->Index_Tab[NDD_INDEX_PRIMARY].Node_Number); + } + else + { + IMRD_LM_LOG_ERROR_0( "Can't load MsgMap !"); + } + + return(status); + +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_SQL_Load_MsgMap(NDT_Root **myRootMsgMap_Ptr_Ptr) +{ + const char sFunctionName []="SDM_SQL_Load_MsgMap"; + NDT_Status nd_status; + IMRT_Status status; + NDT_Index_Type *index_type_ptr; + IMRT_Msg message; + NDT_Node *node_ptr; + IMRT_MsgMap *myMsgMap_Ptr; + IMRT_Data_Version *Data_Version_Ptr; + + EXEC SQL BEGIN DECLARE SECTION; + IMRT_MsgMap_Id hMsgMapId; + VARCHAR vMsgMapName[IMRD_NAME_SIZE]; + IMRT_Msg_Id hMsgInId; + IMRT_Msg_Id hMsgOutId; + + short hIndMsgMapId; + short hIndMsgMapName; + short hIndMsgInId; + short hIndMsgOutId; + EXEC SQL END DECLARE SECTION; + + + /*initialisation des indexes*/ + index_type_ptr = MsgMap_Struct_initial_idx_tab; + + Data_Version_Ptr = (IMRT_Data_Version *) malloc(sizeof(IMRT_Data_Version)); + status = SDM_SQL_Set_Struct_Version(Data_Version_Ptr, "MsgMap"); + if (status != IMRS_OK) + { + return(IMRS_KO); + } + + nd_status = ND_DataStruct_Open(myRootMsgMap_Ptr_Ptr, IMRD_SDMD_MSGMAP_STRUCT_IDX_NB, index_type_ptr, "SDM_MsgMap_Manager",SDM_MsgMap_Manager, NULL, NULL, NULL, NULL,0, Data_Version_Ptr); + if (nd_status != NDS_OK) + { + IMRD_LM_LOG_ERROR_2( "%s : ND_DataStruct_Open -- SDM_MsgMap_Manager failed (%d) !", sFunctionName, nd_status); + status = IMRS_KO; + } + else + { + EXEC SQL DECLARE cur_imr_msg_map CURSOR FOR + SELECT MSG_MAP_ID, MSG_MAP_NAME, MSG_IN_ID, MSG_OUT_ID + FROM IMR_MSG_MAP + ORDER BY MSG_MAP_ID ASC; + + EXEC SQL OPEN cur_imr_msg_map; + do + { + memset(vMsgMapName.arr, '\0', (size_t) IMRD_NAME_SIZE); + + EXEC SQL FETCH cur_imr_msg_map + INTO :hMsgMapId:hIndMsgMapId, + :vMsgMapName:hIndMsgMapName, + :hMsgInId:hIndMsgInId, + :hMsgOutId:hIndMsgOutId; + if (sqlca.sqlcode == 0) + { + /* creation d'un nouveau objet MsgMap */ + nd_status = ND_Value_Alloc( *myRootMsgMap_Ptr_Ptr, (void **)&(myMsgMap_Ptr)); + if(nd_status != NDS_OK) + { + IMRD_LM_LOG_ERROR_2( "%s : ND_Value_Alloc -- SDM_MsgMap_Manager failed (%d) !", sFunctionName, nd_status); + status = IMRS_KO; + } + else + { + myMsgMap_Ptr->Id = hMsgMapId; + strcpy(myMsgMap_Ptr->Name, (char *) vMsgMapName.arr); + /**** Message InPut ****/ + message.Id = hMsgInId; + nd_status = ND_Index_Node_Find( &node_ptr, IMRG_SDM_Base.RootMsg, + IMRD_SDMD_MSG_IDX_ID, &message, NULL); + if((nd_status != NDS_OK)||(node_ptr == NULL)) + { + IMRD_LM_LOG_ERROR_1( "Erreur lors de la recherche du Message IN <%d> !", message.Id); + status = IMRS_KO; + } + else + { + myMsgMap_Ptr->Msg_Input_Ptr = node_ptr->Value; + } + /**** Message OutPut ****/ + message.Id = hMsgOutId; + nd_status = ND_Index_Node_Find( &node_ptr, IMRG_SDM_Base.RootMsg, + IMRD_SDMD_MSG_IDX_ID, &message, NULL); + if((nd_status != NDS_OK)||(node_ptr == NULL)) + { + IMRD_LM_LOG_ERROR_1( "Erreur lors de la recherche du Message Out <%d> !", message.Id); + status = IMRS_KO; + } + else + { + myMsgMap_Ptr->Msg_Output_Ptr = node_ptr->Value; + } + + status = SDM_SQL_LoadFieldMap(myMsgMap_Ptr); + if (status == IMRS_OK) + { + /* Ajout du message */ + nd_status = ND_DataStruct_Value_Add( *myRootMsgMap_Ptr_Ptr, (void *)myMsgMap_Ptr); + if(nd_status != NDS_OK) + { + IMRD_LM_LOG_ERROR_2( "%s : ND_DataStruct_Value_Add -- SDM_MsgMap_Manager failed (%d) !", sFunctionName, nd_status); + status = IMRS_KO; + } + } + } + } + } while((sqlca.sqlcode == 0)&&(nd_status == NDS_OK)&&(status == IMRS_OK)); + + if (sqlca.sqlcode < 0) + { + IMRD_LM_LOG_ERROR_3( "Erreur %s. Erreur Oracle : %d - %s !", sFunctionName, sqlca.sqlcode, sqlca.sqlerrm.sqlerrmc); + status = IMRS_KO; + } + + EXEC SQL CLOSE cur_imr_msg_map; + + if(status == IMRS_OK) + { + index_type_ptr = MsgMap_Struct_final_idx_tab; + status = SDM_DataStruct_Finalize(*myRootMsgMap_Ptr_Ptr, index_type_ptr, IMRD_SDMD_MSGMAP_STRUCT_IDX_NB); + /*SDM_DataStruct_Dump(*myRootMsgMap_Ptr_Ptr);*/ + } + else + { + if(myMsgMap_Ptr->FieldMap_Struct_Ptr != NULL) + { + nd_status = ND_DataStruct_Close(myMsgMap_Ptr->FieldMap_Struct_Ptr); + if(nd_status != NDS_OK) + { + IMRD_LM_LOG_ERROR_1( "ND_DataStruct_Close() failed (%d) !", nd_status); + } + } + + nd_status = ND_DataStruct_Close(*myRootMsgMap_Ptr_Ptr); + if(nd_status != NDS_OK) + { + IMRD_LM_LOG_ERROR_1( "ND_DataStruct_Close() failed (%d) !", nd_status); + } + } + } + + return(status); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_SQL_LoadFieldMap(IMRT_MsgMap *myMsgMap_Ptr) +{ + const char sFunctionName []="SDM_SQL_LoadFieldMap"; + NDT_Status nd_status; + IMRT_Status status; + IMRT_Field myField; + NDT_Node *node_ptr; + IMRT_FieldMap *myFieldMap_Ptr; + + EXEC SQL BEGIN DECLARE SECTION; + IMRT_FieldMap_Id hFieldMapId; + IMRT_Field_Id hFieldInId; + IMRT_Field_Id hFieldOutId; + + short hIndFieldMapId; + short hIndFieldInId; + short hIndFieldOutId; + EXEC SQL END DECLARE SECTION; + + status = IMRS_OK; + + EXEC SQL DECLARE cur_imr_field_map CURSOR FOR + SELECT FIELD_MAP_ID, FIELD_IN_ID, FIELD_OUT_ID + FROM IMR_FIELD_MAP + WHERE MSG_MAP_ID = :myMsgMap_Ptr->Id + ORDER BY FIELD_MAP_ID ASC; + + EXEC SQL OPEN cur_imr_field_map; + do + { + + EXEC SQL FETCH cur_imr_field_map + INTO :hFieldMapId:hIndFieldMapId, + :hFieldInId:hIndFieldInId, + :hFieldOutId:hIndFieldOutId; + + if (sqlca.sqlcode == 0) + { + /* Allacation de FieldMap */ + nd_status = ND_Value_Alloc( myMsgMap_Ptr->FieldMap_Struct_Ptr, (void **)&(myFieldMap_Ptr)); + if(nd_status != NDS_OK) + { + IMRD_LM_LOG_ERROR_2( "%s : ND_Value_Alloc -- FieldMap failed (%d) !", sFunctionName, nd_status); + status = IMRS_KO; + } + else + { + /* Ajout du Field */ + myFieldMap_Ptr->Id = hFieldMapId; + /**** Field InPut ****/ + myField.Id = hFieldInId; + nd_status = ND_Index_Node_Find(&node_ptr, myMsgMap_Ptr->Msg_Input_Ptr->Field_Struct_Ptr, + IMRD_SDMD_FIELD_IDX_ID,&myField,NULL); + if((nd_status != NDS_OK)||(node_ptr == NULL)) + { + IMRD_LM_LOG_ERROR_1( "Erreur lors de la recherche du In Field <%d> !", hFieldInId); + status = IMRS_KO; + } + else + { + myFieldMap_Ptr->Field_Input_Ptr = node_ptr->Value; + } + /**** Field OutPut ****/ + myField.Id = hFieldOutId; + nd_status = ND_Index_Node_Find(&node_ptr, myMsgMap_Ptr->Msg_Output_Ptr->Field_Struct_Ptr, + IMRD_SDMD_FIELD_IDX_ID,&myField,NULL); + if((nd_status != NDS_OK)||(node_ptr == NULL)) + { + IMRD_LM_LOG_ERROR_1( "Erreur lors de la recherche du In Field <%d> !", hFieldOutId); + status = IMRS_KO; + } + else + { + myFieldMap_Ptr->Field_Output_Ptr = node_ptr->Value; + } + + nd_status = ND_DataStruct_Value_Add( myMsgMap_Ptr->FieldMap_Struct_Ptr, (void *)(myFieldMap_Ptr)); + if(nd_status != NDS_OK) + { + IMRD_LM_LOG_ERROR_2( "%s : ND_DataStruct_Value_Add -- FieldMap failed (%d) !", sFunctionName, nd_status); + status = IMRS_KO; + } + } + } + } while((sqlca.sqlcode == 0)&&(nd_status == NDS_OK)&&(status == IMRS_OK)); + + if(status != IMRS_OK) + { + free(myFieldMap_Ptr); + } + + if (sqlca.sqlcode < 0) + { + IMRD_LM_LOG_ERROR_3( "Erreur %s. Erreur Oracle : %d - %s !", sFunctionName, sqlca.sqlcode, sqlca.sqlerrm.sqlerrmc); + status = IMRS_KO; + } + + EXEC SQL CLOSE cur_imr_field_map; + + return(status); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_SQL_Dump_MsgMap_Header(FILE *dump_file) +{ + fprintf(dump_file, "---------------------------------------------------\n"); + fprintf(dump_file, "-- Init file of IMR_MSG_MAP & IMR_FIELD_MAP --\n"); + fprintf(dump_file, "---------------------------------------------------\n\n"); + fprintf(dump_file, "INSERT INTO IMR_DATA_VERSION(VERS_NAME, VERS_LABEL, VERS_DATE) VALUES('MsgMap', '%s', '%s');\n\n", + ((IMRT_Data_Version *)(IMRG_SDM_Base.RootMsgMap->User_Ptr))->Label, + ((IMRT_Data_Version *)(IMRG_SDM_Base.RootMsgMap->User_Ptr))->Date); + fprintf(dump_file, "Delete IMR_FIELD_MAP;\n\n"); + fprintf(dump_file, "Delete IMR_MSG_MAP;\n\n"); + return( IMRS_OK); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_SQL_Dump_MsgMap_Body(FILE *dump_file) +{ + IMRT_Status status; + NDT_Status nd_status; + + if( ( nd_status = ND_DataStruct_Traverse( IMRG_SDM_Base.RootMsgMap, IMRD_SDMD_CMD_API_SQL_DUMP, dump_file)) != NDS_OK) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0( "SQL Dump RootMsgMap failed !"); + } + else + { + status = IMRS_OK; + } + + return(status); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_SQL_Dump_MsgMap_Footer(FILE *dump_file) +{ + fprintf(dump_file, "\nCommit;\n"); + return( IMRS_OK); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_SQL_Dump_MsgMap(void) +{ + IMRT_Status status; + char dump_filename[255]; + FILE *dump_file; + + strcpy(dump_filename, "init_imr_msg_map.sql"); + + if( ( dump_file = fopen( dump_filename, "w")) == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_1( "Can't open dump file (%s) !", dump_filename); + } + else + { + status = SDM_SQL_Dump_MsgMap_Header(dump_file); + if(status == IMRS_OK) + { + status = SDM_SQL_Dump_MsgMap_Body(dump_file); + if(status == IMRS_OK) + { + status = SDM_SQL_Dump_MsgMap_Footer(dump_file); + } + } + + fclose( dump_file); + } + + return(status); + +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_SQL_MapInfo_Dump(void) +{ + IMRT_Status status; + + status = SDM_SQL_Dump_MsgMap(); + + return(status); + +} + + + +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ diff --git a/src/libstatic_data_mng/src/mapping_info_xml.c b/src/libstatic_data_mng/src/mapping_info_xml.c new file mode 100644 index 0000000..6cf0258 --- /dev/null +++ b/src/libstatic_data_mng/src/mapping_info_xml.c @@ -0,0 +1,547 @@ +/*----------------------------------------------------------------------------*/ +/* File: mapping_info_xml.c */ +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#define _LIBSTATIC_DATA_MNG_ +#define _MAPPING_INFO_XML_C_ + +#include "mapping_info_xml.h" + + +IMRT_Status SDM_MsgMap_Ctxt_Close(SDMT_MsgMap_Contexte * MsgMap_Ctx_Ptr) +{ + NDT_Status nd_status; + + if(MsgMap_Ctx_Ptr->RootMsgMap != NULL) + { + if( ( nd_status = ND_DataStruct_Close(MsgMap_Ctx_Ptr->RootMsgMap)) != NDS_OK) + { + IMRD_LM_LOG_ERROR_1( "MsgMap Struct close failed: (%d) !", nd_status); + } + } + + if(MsgMap_Ctx_Ptr->SaxCtxHdl != NULL) + { + xmlFreeParserCtxt(MsgMap_Ctx_Ptr->SaxCtxHdl); + } + +} + + + + + +IMRT_Status SDM_XML_MapInfo_Init(IMRT_Path Lib_Path) +{ + SDMT_MsgMap_Contexte MsgMap_Ctx; + IMRT_Status status; + char Xml_File_Name[255]; + + + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_0, "Loading MsgMap..."); + + MsgMap_Ctx.flagerror = 0; + + MsgMap_Ctx.CptMsgMap = IMRD_MSGMAP_ID_UNKNOWN; + MsgMap_Ctx.CptFieldMap = IMRD_FIELDMAP_ID_UNKNOWN; + memset(MsgMap_Ctx.PathArray,0,sizeof(MsgMap_Ctx.PathArray)); + MsgMap_Ctx.PresentLevelTag = IMRD_SDMD_MIN_LEVEL_TAG; + + memset(Xml_File_Name,0,sizeof(Xml_File_Name)); + strcpy(Xml_File_Name, Lib_Path); + strcat(Xml_File_Name, "/"); + strcat(Xml_File_Name, SDMD_MSGMAP_FILE); + + status = SDM_XML_Load_MsgMap(Xml_File_Name, &(MsgMap_Ctx)); + + if(status != IMRS_OK) + { + IMRD_LM_LOG_ERROR_0( "Can't load MsgMap !"); + } + else + { + IMRG_SDM_Base.RootMsgMap = MsgMap_Ctx.RootMsgMap; + IMRD_LM_LOG_INFO_1( "MsgMap loaded: (%d)", IMRG_SDM_Base.RootMsgMap->Index_Tab[NDD_INDEX_PRIMARY].Node_Number); + } + + return(status); +} + + + + + +static IMRT_Status error(SDMT_MsgMap_Contexte *ctx , const char *msg, ...) +{ + xmlParserCtxt * SaxCtx; + + SaxCtx = ctx->SaxCtxHdl; + + IMRD_LM_LOG_ERROR_1( "CallBack error: <%s> !",msg); + + SaxCtx->sax = &ErrorSAXHandlerStruct; + ctx->flagerror = 1; + ctx->FataError.errorCode = SDMD_XML_CODE_ERROR_1; + strcpy(ctx->FataError.libError,msg) ; +} + + + + + +IMRT_Status startElementNsMap( SDMT_MsgMap_Contexte * ctx , + const xmlChar *localname, + const xmlChar *prefix, + const xmlChar *URI, + int nb_namespaces, + const xmlChar **namespaces, + int nb_attributes, + int nb_defaulted, + const xmlChar **attributes) +{ + NDT_Status nd_status; + const char functionname [] = "startElementNsMap"; + char DescErr[IMRD_SDMD_DESCERR_LEN]; + + + if(strcmp((const char*)localname,IMRD_SDMD_TAG_FIELDMAP) == 0) + { + if( ( nd_status = ND_Value_Alloc( ctx->CurrentMsgMap->FieldMap_Struct_Ptr, (void **)&(ctx->CurrentFieldMap)) != NDS_OK)) + { + IMRD_LM_LOG_ERROR_1( "ND_Value_Alloc() failed (%d) !", nd_status); + + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_3,IMRD_SDMD_TAG_FIELDMAP); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), functionname , DescErr, SDMD_XML_CODE_ERROR_3 ); + } + else + { + ctx->PresentLevelTag = ctx->PresentLevelTag + 1; + strcpy(ctx->PathArray[ctx->PresentLevelTag], (char*)localname); + } + } + else if(strcmp((const char*)localname, IMRD_SDMD_TAG_MSGMAP) == 0) + { + if( ( nd_status = ND_Value_Alloc( ctx->RootMsgMap, (void **)&(ctx->CurrentMsgMap)) != NDS_OK)) + { + IMRD_LM_LOG_ERROR_1( "ND_Value_Alloc() failed (%d) !", nd_status); + + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_3,IMRD_SDMD_TAG_MSGMAP); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), functionname , DescErr, SDMD_XML_CODE_ERROR_3 ); + } + else + { + ctx->PresentLevelTag = ctx->PresentLevelTag + 1; + strcpy(ctx->PathArray[ctx->PresentLevelTag], (char*)localname); + } + } + else if(strcmp((const char*)localname, IMRD_SDMD_TAG_FIELDMAPSTRUCT) == 0) + { + ctx->PresentLevelTag = ctx->PresentLevelTag + 1; + strcpy(ctx->PathArray[ctx->PresentLevelTag], (char*)localname); + } + +} + + + + + +IMRT_Status endElementNsMap( SDMT_MsgMap_Contexte * ctx, + const xmlChar *localname, + const xmlChar *prefix, + const xmlChar *URI) +{ + IMRT_Status status_tmp; + NDT_Node * node_ptr; + NDT_Status nd_status; + IMRT_Msg message; + IMRT_Field field; + const char functionname [] = "endElementNsMap"; + char DescErr[IMRD_SDMD_DESCERR_LEN]; + + + if (strcmp((const char *)localname, IMRD_SDMD_TAG_NAME) == 0) + { + strcpy(ctx->CurrentMsgMap->Name, ctx->value); + } + else if (strcmp((const char*)localname,IMRD_SDMD_TAG_INPUTMSG) == 0) + { + strcpy(message.Name,ctx->value); + if(((nd_status = ND_Index_Node_Find( &node_ptr, IMRG_SDM_Base.RootMsg, IMRD_SDMD_MSG_IDX_NAME, &message, NULL)) != NDS_OK)|| + (node_ptr == NULL)) + { + IMRD_LM_LOG_ERROR_1( "IN Msg lookup failed: [%s] !", ctx->value); + + snprintf(DescErr,sizeof(DescErr), SDMD_XML_LIB_ERROR_4,IMRD_SDMD_TAG_INPUTMSG,message.Name); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror),functionname,DescErr,SDMD_XML_CODE_ERROR_4); + } + else + { + ctx->CurrentMsgMap->Msg_Input_Ptr = node_ptr->Value; + } + } + else if (strcmp((const char*)localname,IMRD_SDMD_TAG_OUTPUTMSG) == 0) + { + strcpy(message.Name,ctx->value); + if( ( ( nd_status = ND_Index_Node_Find( &node_ptr, IMRG_SDM_Base.RootMsg, IMRD_SDMD_MSG_IDX_NAME,&message,NULL)) != NDS_OK)|| + ( node_ptr == NULL)) + { + IMRD_LM_LOG_ERROR_1( "OUT Msg lookup failed: [%s] !", ctx->value); + + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_4,IMRD_SDMD_TAG_OUTPUTMSG,message.Name); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror),functionname,DescErr,SDMD_XML_CODE_ERROR_4); + } + else + { + ctx->CurrentMsgMap->Msg_Output_Ptr = node_ptr->Value; + } + } + else if (strcmp((const char*)localname,IMRD_SDMD_TAG_INPUTFIELD) == 0) + { + strcpy(field.Name, ctx->value); + if( ( ( nd_status = ND_Index_Node_Find(&node_ptr, ctx->CurrentMsgMap->Msg_Input_Ptr->Field_Struct_Ptr, IMRD_SDMD_FIELD_IDX_NAME,&field,NULL)) != NDS_OK)|| + ( node_ptr == NULL)) + { + printf("\nErreur lors de la recherche du In Field <%s> %s\n",ctx->value, ctx->CurrentMsgMap->Msg_Input_Ptr->Name); + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_4,IMRD_SDMD_TAG_INPUTFIELD,field.Name); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror),functionname,DescErr,SDMD_XML_CODE_ERROR_4); + } + else + { + ctx->CurrentFieldMap->Field_Input_Ptr = node_ptr->Value; + } + } + else if (strcmp((const char*)localname,IMRD_SDMD_TAG_OUTPUTFIELD) == 0) + { + strcpy(field.Name, ctx->value); + if(((nd_status = ND_Index_Node_Find(&node_ptr, ctx->CurrentMsgMap->Msg_Output_Ptr->Field_Struct_Ptr, + IMRD_SDMD_FIELD_IDX_NAME,&field,NULL)) != NDS_OK)|| + (node_ptr == NULL)) + { + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_4,IMRD_SDMD_TAG_OUTPUTFIELD, field.Name); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror),functionname,DescErr,SDMD_XML_CODE_ERROR_4); + } + else + { + ctx->CurrentFieldMap->Field_Output_Ptr = node_ptr->Value; + } + } + else if (strcmp((const char*)localname,IMRD_SDMD_TAG_FIELDMAP) == 0) + { + ctx->CurrentFieldMap->Id = ctx->CptFieldMap; + + /*Creation de l'identifiant name de l'objet FieldMap*/ + if( ( nd_status = ND_DataStruct_Value_Add( ctx->CurrentMsgMap->FieldMap_Struct_Ptr, (void *)(ctx->CurrentFieldMap))) != NDS_OK) + { + IMRD_LM_LOG_ERROR_1( "FieldMap add failed: (%d) !", nd_status); + + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_2,IMRD_SDMD_TAG_FIELDMAP ); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), functionname , DescErr, SDMD_XML_CODE_ERROR_2 ); + } + else + { + ctx->CptFieldMap ++; + memset(ctx->PathArray[ctx->PresentLevelTag],0,sizeof(IMRD_SDMD_SIZE_TAG_SIZE)); + ctx->PresentLevelTag = ctx->PresentLevelTag - 1; + } + } + else if (strcmp((const char*)localname, IMRD_SDMD_TAG_MSGMAP) == 0) + { + ctx->CptMsgMap ++; + ctx->CurrentMsgMap->Id = ctx->CptMsgMap; + + /*Creation de l'identifiant name de l'objet MsgMap*/ + if( ( nd_status = ND_DataStruct_Value_Add( ctx->RootMsgMap, (void *)(ctx->CurrentMsgMap))) != NDS_OK) + { + IMRD_LM_LOG_ERROR_1( "MsgMap add failed: (%d) !", nd_status); + + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_2,IMRD_SDMD_TAG_MSGMAP ); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), functionname , DescErr, SDMD_XML_CODE_ERROR_2 ); + } + else + { + memset(ctx->PathArray[ctx->PresentLevelTag],0,sizeof(IMRD_SDMD_SIZE_TAG_SIZE)); + ctx->PresentLevelTag = ctx->PresentLevelTag - 1; + } + } + else if (strcmp((const char*)localname, IMRD_SDMD_TAG_FIELDMAPSTRUCT) == 0) + { + memset(ctx->PathArray[ctx->PresentLevelTag],0,sizeof(IMRD_SDMD_SIZE_TAG_SIZE)); + ctx->PresentLevelTag = ctx->PresentLevelTag - 1; + } + else if (strcmp((const char *)localname, IMRD_SDMD_TAG_VERSION) == 0) + { + IMRD_LM_LOG_INFO_1( "[MsgMap]: [%s]", ctx->value); + status_tmp = SDM_Set_Struct_Version((IMRT_Data_Version *)ctx->RootMsgMap->User_Ptr, (char *)ctx->value); + } + +} + + + + + +IMRT_Status Map_Info_characters(SDMT_MsgMap_Contexte * ctx , const xmlChar *ch, int len) +{ + char output[40]; + int i; + + memset(ctx->value,0, sizeof(ctx->value)); + + for (i = 0;(ivalue[i] = ch[i]; + ctx->value[i] = 0; + +} + +IMRT_Status SDM_XML_Load_MsgMap( char *demo_file, SDMT_MsgMap_Contexte *mycontexte) +{ + IMRT_Status status; + NDT_Status nd_status; + char * docname = NULL; + NDT_Index_Type *index_type_ptr; + xmlDocPtr doc = NULL; + xmlDtdPtr dtd; + xmlParserCtxtPtr ctxt =NULL; + xmlSAXHandlerPtr SAXHandler; + xmlSAXHandlerPtr SAXHandler_sav; + const char functionname[] ="SDM_XML_Load_MsgMap"; + char DescErr[IMRD_SDMD_DESCERR_LEN]; + IMRT_Data_Version *Data_Version_Ptr; + + LIBXML_TEST_VERSION + xmlKeepBlanksDefault(0); + xmlSAXDefaultVersion(2); + xmlLineNumbersDefault(1); + + status = IMRS_OK; + docname = demo_file; + ctxt = xmlNewParserCtxt(); + + /*initialisation des indexes*/ + index_type_ptr = MsgMap_Struct_initial_idx_tab; + + if(ctxt != NULL) + { + mycontexte->flagerror = IMRS_OK; + SAXHandler = &SaxMapHandlerStruct; + mycontexte->SaxCtxHdl = ctxt; + ctxt->userData = mycontexte; + SAXHandler_sav = ctxt->sax; + ctxt->sax = SAXHandler; + ctxt->sax2 = 1 ; + + Data_Version_Ptr = (IMRT_Data_Version *) malloc(sizeof(IMRT_Data_Version)); + Data_Version_Ptr->Label[0] = '\0'; + Data_Version_Ptr->Date[0] = '\0'; + if( ( nd_status = ND_DataStruct_Open(&(mycontexte->RootMsgMap), IMRD_SDMD_MSGMAP_STRUCT_IDX_NB, index_type_ptr, "SDM_MsgMap_Manager",SDM_MsgMap_Manager, NULL, NULL, NULL, NULL,0, Data_Version_Ptr)) != NDS_OK) + { + status = IMRS_KO; + + IMRD_LM_LOG_ERROR_1( "Can't open RootMsgMap: (%d) !", nd_status); + + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_5,IMRD_SDMD_TAG_MSGMAP); + SDM_RaiseError(mycontexte->SaxCtxHdl,&(mycontexte->FataError),&(mycontexte->flagerror), functionname, DescErr, SDMD_XML_CODE_ERROR_5 ); + } + else + { + doc = xmlCtxtReadFile(ctxt,docname,NULL,XML_PARSE_DTDATTR+XML_PARSE_DTDVALID); + if (ctxt->lastError.code != XML_ERR_OK) + { + status = IMRS_KO; + printf("Erreur de parsing du fichier %s.\n%s\n", docname, ctxt->lastError.message); + } + else if(mycontexte->flagerror != IMRS_OK) + { + status = IMRS_KO; + printf("%s\n", mycontexte->FataError.libError); + } + else + { + index_type_ptr = MsgMap_Struct_final_idx_tab; + status = SDM_DataStruct_Finalize(mycontexte->RootMsgMap,index_type_ptr, IMRD_SDMD_MSGMAP_STRUCT_IDX_NB); + /*SDM_DataStruct_Dump( mycontexte->RootMsgMap);*/ + } + } + + if((status != IMRS_OK)&&(mycontexte->RootMsgMap != NULL)) + { + if(mycontexte->CurrentMsgMap != NULL) + { + if(mycontexte->CurrentMsgMap->FieldMap_Struct_Ptr != NULL) + { + nd_status = ND_DataStruct_Close(mycontexte->CurrentMsgMap->FieldMap_Struct_Ptr); + } + if(nd_status = NDS_OK) + { + free(mycontexte->CurrentMsgMap); + } + } + + if(mycontexte->CurrentFieldMap != NULL) + { + free(mycontexte->CurrentFieldMap); + } + if(mycontexte->RootMsgMap != NULL) + { + nd_status = ND_DataStruct_Close(mycontexte->RootMsgMap); + } + } + + + ctxt->sax = SAXHandler_sav; + xmlFreeParserCtxt(ctxt); + } + else + { + status = IMRS_KO; + } + + return(status); +} + + + + + +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_XML_Dump_MsgMap_Header(FILE *dump_file) +{ + fprintf(dump_file, "\n"); + fprintf(dump_file, "\n"); + fprintf(dump_file, "<%s>\n", IMRD_SDMD_TAG_MSGMAP_STRUCT); + fprintf(dump_file, "@(#) VERSIONIMR: $Label: $ $Date: 2008/11/12 02:25:23 $ $Workfile: mapping_info_xml.c $\n", + ((IMRT_Data_Version *)IMRG_SDM_Base.RootMsgMap->User_Ptr)->Label, + ((IMRT_Data_Version *)IMRG_SDM_Base.RootMsgMap->User_Ptr)->Date); + return( IMRS_OK); + +} + + + + + +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_XML_Dump_MsgMap_Body(FILE *dump_file) +{ + IMRT_Status status; + NDT_Status nd_status; + + if( ( nd_status = ND_DataStruct_Traverse( IMRG_SDM_Base.RootMsgMap, IMRD_SDMD_CMD_API_XML_DUMP, dump_file)) != NDS_OK) + { + status = IMRS_KO; + printf( "XML Dump RootMsgMap failed (%d)...\n"); + } + else + { + status = IMRS_OK; + } + + return(status); +} + + + + + +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_XML_Dump_MsgMap_Footer(FILE *dump_file) +{ + fprintf(dump_file, "\n"); + fprintf(dump_file, "\n", IMRD_SDMD_TAG_MSGMAP_STRUCT); + + return( IMRS_OK); +} + + + + + +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_XML_Dump_MsgMap(void) +{ + IMRT_Status status; + char dump_filename[255]; + FILE *dump_file; + + strcpy(dump_filename, SDMD_MSGMAP_FILE); + + if( ( dump_file = fopen( dump_filename, "w")) == NULL) + { + status = IMRS_KO; + printf( "Can't open dump file (%s) !\n", dump_filename); + } + else + { + status = SDM_XML_Dump_MsgMap_Header(dump_file); + if(status == IMRS_OK) + { + status = SDM_XML_Dump_MsgMap_Body(dump_file); + if(status == IMRS_OK) + { + status = SDM_XML_Dump_MsgMap_Footer(dump_file); + } + } + + fclose( dump_file); + } + + return(status); +} + + + + + +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_XML_MapInfo_Dump(void) +{ + IMRT_Status status; + + status = SDM_XML_Dump_MsgMap(); + + return(status); +} + + + + + +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ diff --git a/src/libstatic_data_mng/src/mapping_info_xml.h b/src/libstatic_data_mng/src/mapping_info_xml.h new file mode 100644 index 0000000..6d3ffb3 --- /dev/null +++ b/src/libstatic_data_mng/src/mapping_info_xml.h @@ -0,0 +1,202 @@ +/*----------------------------------------------------------------------------*/ +/* File: mapping_info_xml.h */ +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#ifndef _MAPPING_INFO_XML_H_ +# define _MAPPING_INFO_XML_H_ + + + +/*----------------------------------------------------------------------------*/ +/* Global Include */ +/*----------------------------------------------------------------------------*/ + +# include + +/*----------------------------------------------------------------------------*/ +/* Local constantes */ +/*----------------------------------------------------------------------------*/ + +/*definition des tags xml pour le chargement des structure MsgMap et FieldMap*/ + +#define IMRD_SDMD_TAG_NAME "name" +#define IMRD_SDMD_TAG_INPUTMSG "inputmessage" +#define IMRD_SDMD_TAG_OUTPUTMSG "outputmessage" +#define IMRD_SDMD_TAG_FIELDMAP "fieldmap" +#define IMRD_SDMD_TAG_FIELDMAPSTRUCT "fieldmapstruct" +#define IMRD_SDMD_TAG_INPUTFIELD "inputfield" +#define IMRD_SDMD_TAG_OUTPUTFIELD "outputfield" +#define IMRD_SDMD_TAG_MSGFIELDMAPSTRUCT "msgfieldmapstruct" + + + +/*----------------------------------------------------------------------------*/ +/* Local Definition */ +/*----------------------------------------------------------------------------*/ + + +typedef struct SDMT_MsgMap_Contexte +{ + char value[IMRD_SDMD_VALUE_LEN]; + IMRT_Array_Xml_Path PathArray; + IMRT_Level_Tag PresentLevelTag; + IMRT_MsgMap_Id CptMsgMap; + IMRT_FieldMap_Id CptFieldMap; + IMRT_FieldMap * CurrentFieldMap; + IMRT_MsgMap * CurrentMsgMap; + NDT_Root * RootMsgMap; + xmlParserCtxt * SaxCtxHdl; + IMRT_Error FataError; + IMRT_Status flagerror; +}SDMT_MsgMap_Contexte; + +/*----------------------------------------------------------------------------*/ +/* Prototypes */ +/*----------------------------------------------------------------------------*/ + +# ifdef _MAPPING_INFO_XML_C_ + +static IMRT_Status error(SDMT_MsgMap_Contexte *ctx , const char *msg, ...); +IMRT_Status Map_Info_characters(SDMT_MsgMap_Contexte * ctx , const xmlChar *ch, int len); +IMRT_Status endElementNsMap( SDMT_MsgMap_Contexte * ctx, + const xmlChar *localname, + const xmlChar *prefix, + const xmlChar *URI); +IMRT_Status startElementNsMap( SDMT_MsgMap_Contexte * ctx , + const xmlChar *localname, + const xmlChar *prefix, + const xmlChar *URI, + int nb_namespaces, + const xmlChar **namespaces, + int nb_attributes, + int nb_defaulted, + const xmlChar **attributes); +IMRT_Status SDM_XML_Load_MsgMap( char *demo_file, SDMT_MsgMap_Contexte *mycontexte); +IMRT_Status SDM_MsgMap_Ctxt_Close(SDMT_MsgMap_Contexte * MsgMap_Ctx_Ptr); +IMRT_Status SDM_XML_MapInfo_Init(IMRT_Path Lib_Path); +IMRT_Status SDM_XML_Dump_MsgMap_Header(FILE *dump_file); +IMRT_Status SDM_XML_Dump_MsgMap_Body(FILE *dump_file); +IMRT_Status SDM_XML_Dump_MsgMap_Footer(FILE *dump_file); +IMRT_Status SDM_XML_Dump_MsgMap(void); +IMRT_Status SDM_XML_MapInfo_Dump(void); + +# else + +extern IMRT_Status SDM_XML_Load_MsgMap( char *demo_file, SDMT_MsgMap_Contexte *mycontexte); +extern IMRT_Status SDM_XML_MapInfo_Init(IMRT_Path Lib_Path); +extern IMRT_Status SDM_XML_Dump_MsgMap_Header(FILE *dump_file); +extern IMRT_Status SDM_XML_Dump_MsgMap_Body(FILE *dump_file); +extern IMRT_Status SDM_XML_Dump_MsgMap_Footer(FILE *dump_file); +extern IMRT_Status SDM_XML_Dump_MsgMap(void); +extern IMRT_Status SDM_XML_MapInfo_Dump(void); + +# endif + + +# ifdef _MAPPING_INFO_XML_C_ + + +/*xmlSAXHandler Map_Info_Error_SAX_Hdl_Struct = { + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + 1, + NULL, + NULL, + NULL, + NULL + };*/ + +xmlSAXHandler SaxMapHandlerStruct = { + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + (charactersSAXFunc)(Map_Info_characters), + NULL, + NULL, + NULL, + NULL, + (errorSAXFunc)(error), + NULL, + NULL, + NULL, + NULL, + 1, + NULL, + (startElementNsSAX2Func)(startElementNsMap), + (endElementNsSAX2Func)(endElementNsMap), + NULL +}; + + +# endif + + + + +/*----------------------------------------------------------------------------*/ + +#endif diff --git a/src/libstatic_data_mng/src/struct_info_mng.c b/src/libstatic_data_mng/src/struct_info_mng.c new file mode 100644 index 0000000..0ee2312 --- /dev/null +++ b/src/libstatic_data_mng/src/struct_info_mng.c @@ -0,0 +1,1684 @@ +/*----------------------------------------------------------------------------*/ +/* File: struct_info_mng.c */ +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#define _LIBSTATIC_DATA_MNG_ +#define _STRUCT_INFO_MNG_C_ + +#include "struct_info_mng.h" + + + + +/*----------------------------------------------------------------------------*/ +/* Cnv Manager */ +/*----------------------------------------------------------------------------*/ + +NDT_Status SDM_Cnv_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node *Node_Ptr, NDT_Command Command, va_list Args) +{ + NDT_Command_Name Command_Name; + + + switch( Command) + { + case NDD_CMD_MANAGER_VERSION: + { + NDT_Version_Name *Version_Name_Ptr = (NDT_Version_Name *)va_arg( Args, NDT_Version_Name *); + + + Command_Name = "NDD_CMD_MANAGER_VERSION"; + *Version_Name_Ptr = "Revision: 2.1 Name: libnode-2_0_4-1 Date: 2002/02/28 22:00:35 Author: agibert "; + + return( NDS_OK); + } + + case NDD_CMD_INDEX_GET: + { + /* + NDT_Index_Id *Reply_Index_Id_Ptr = (NDT_Index_Id *)va_arg( Args, NDT_Index_Id *); + NDT_Command *Reply_Command_Ptr = (NDT_Command *)va_arg( Args, NDT_Command *); + NDT_Command Cmd = (NDT_Command)va_arg( Args, NDT_Command); + void *Cnv_ptr = (void *)va_arg( Args, void *); + */ + NDT_Index_Id *Reply_Index_Id_Ptr = (NDT_Index_Id *)va_arg( Args, NDT_Index_Id *); + NDT_Command *Reply_Command_Ptr = (NDT_Command *)va_arg( Args, NDT_Command *); + NDT_Command Cmd = (NDT_Command)va_arg( Args, NDT_Command); + IMRT_Cnv *Cnv_ptr = (IMRT_Cnv *)va_arg( Args, IMRT_Cnv *); + + + Command_Name = "NDD_CMD_INDEX_GET"; + + switch(Cmd) + { + case IMRD_SDMD_CMD_INDEX0_PRINT: + { + *Reply_Index_Id_Ptr = 0; + *Reply_Command_Ptr = NDD_CMD_VALUE_PRINT; + + break; + } + + case IMRD_SDMD_CMD_API_SQL_DUMP: + { + *Reply_Index_Id_Ptr = IMRD_SDMD_CNV_IDX_ID; + *Reply_Command_Ptr = IMRD_SDMD_CMD_API_SQL_DUMP; + break; + } + + case IMRD_SDMD_CMD_API_XML_DUMP: + { + *Reply_Index_Id_Ptr = IMRD_SDMD_CNV_IDX_ID; + *Reply_Command_Ptr = IMRD_SDMD_CMD_API_XML_DUMP; + break; + } + + default: + { + *Reply_Index_Id_Ptr = Index_Id; + *Reply_Command_Ptr = Cmd; + + break; + } + } + + return( NDS_OK); + } + + case NDD_CMD_VALUE_ALLOC: + { + /* + void **Cnv_ptr_Ptr = (void **)va_arg( Args, void **); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + IMRT_Cnv **Cnv_ptr_Ptr = va_arg( Args, IMRT_Cnv **); + + + Command_Name = "NDD_CMD_VALUE_ALLOC"; + + if( ( *Cnv_ptr_Ptr = (IMRT_Cnv *)malloc( sizeof(IMRT_Cnv))) == NULL) + { + return( NDS_ERRMEM); + } + else + { + SDM_InitCnv(*Cnv_ptr_Ptr); + return( NDS_OK); + } + } + + case NDD_CMD_VALUE_FREE: + { + /* + void *Cnv_ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + IMRT_Cnv *Cnv_ptr = (IMRT_Cnv *)va_arg( Args, IMRT_Cnv *); + Command_Name = "NDD_CMD_VALUE_FREE"; + + free( Cnv_ptr); + + return( NDS_OK); + } + + case NDD_CMD_VALUE_COMP: + { + /* + void *Value1_Ptr = (void *)va_arg( Args, void *); + void *Value2_Ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + IMRT_Cnv *Value1_Ptr = va_arg( Args, IMRT_Cnv *); + IMRT_Cnv *Value2_Ptr = va_arg( Args, IMRT_Cnv *); + + + Command_Name = "NDD_CMD_VALUE_COMP"; + + switch( Index_Id) + { + case IMRD_SDMD_CNV_IDX_ID: + { + if( Value1_Ptr->Id < Value2_Ptr->Id) + { + return( NDS_LOWER); + } + else + { + if( Value1_Ptr->Id > Value2_Ptr->Id) + { + return( NDS_GREATER); + } + else + { + return( NDS_EQUAL); + } + } + } + + case IMRD_SDMD_CNV_IDX_NAME: + { + int rc; + + + rc=strcmp( Value1_Ptr->Name, Value2_Ptr->Name); + + if( rc <0) + { + return( NDS_LOWER); + } + else + { + if( rc > 0) + { + return( NDS_GREATER); + } + else + { + return( NDS_EQUAL); + } + } + } + + default: + { + printf( "Unknown COMP idx (%d) !\n", Index_Id); + + return( NDS_KO); + } + } + + return( NDS_OK); + } + + case NDD_CMD_VALUE_ADD: + { + /* + void *Cnv_ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + + Command_Name = "NDD_CMD_VALUE_ADD"; + + return( NDS_OK); + } + + case NDD_CMD_VALUE_REMOVE: + { + /* + void *Cnv_ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + + Command_Name = "NDD_CMD_VALUE_REMOVE"; + + return( NDS_OK); + } + + case NDD_CMD_VALUE_PRINT: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + va_list user_args = (va_list)va_arg( lib_args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + void *Cnv_ptr = Node_Ptr->Value; + */ + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + + IMRT_Cnv *Cnv_ptr = Node_Ptr->Value; + + + Command_Name = "NDD_CMD_VALUE_PRINT"; + + fprintf( Out, "Id: (%d) Name: (%s)\n", Cnv_ptr->Id, Cnv_ptr->Name); + return( NDS_OK); + + } + + case NDD_CMD_INFO_PRINT: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + va_list user_args = (va_list)va_arg( lib_args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + void *Cnv_ptr = Node_Ptr->Value; + */ + + Command_Name = "NDD_CMD_INFO_PRINT"; + + return( NDS_OK); + } + + case IMRD_SDMD_CMD_EXECUTE: + { /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + NDT_Recursive_Offset Recursive_Offset = (NDT_Recursive_Offset)va_arg( lib_args, NDT_Recursive_Offset); + va_list user_args = (va_list)va_arg( lib_args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + void *Cnv_ptr = Node_Ptr->Value; + */ + IMRT_Cnv * Cnv_ptr = (IMRT_Cnv*)Node_Ptr->Value; + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + IMRT_SDMCB_Cnv_Add * CnvProceedFunc = ( IMRT_SDMCB_Cnv_Add *)va_arg(lib_args, IMRT_SDMCB_Cnv_Add *); + + CnvProceedFunc(Cnv_ptr->Id, Cnv_ptr->Name, IMRG_SDM_Base.RootCnv->Index_Tab[NDD_INDEX_PRIMARY].Node_Number); + + return( NDS_OK); + } + + case IMRD_SDMD_CMD_API_SQL_DUMP: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + + void *Cnv_ptr = Node_Ptr->Value; + */ + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list user_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( user_args, FILE *); + + IMRT_Cnv *Cnv_Ptr = Node_Ptr->Value; + + + Command_Name = "IMRD_SDMD_CMD_API_SQL_DUMP"; + + fprintf( Out, "INSERT INTO IMR_CNV(CNV_ID, CNV_NAME) VALUES(%d, '%s');\n", + Cnv_Ptr->Id, Cnv_Ptr->Name); + + return( NDS_OK); + } + + case IMRD_SDMD_CMD_API_XML_DUMP: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + + void *Cnv_ptr = Node_Ptr->Value; + */ + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list user_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( user_args, FILE *); + + IMRT_Cnv *Cnv_Ptr = Node_Ptr->Value; + + + Command_Name = "IMRD_SDMD_CMD_API_XML_DUMP"; + + fprintf( Out, "\t<%s>\n", IMRD_SDMD_TAG_CNV); + + fprintf( Out, "\t\t<%s>%s\n", IMRD_SDMD_TAG_NAME, Cnv_Ptr->Name, IMRD_SDMD_TAG_NAME); + + fprintf( Out, "\t\n", IMRD_SDMD_TAG_CNV); + + + return( NDS_OK); + } + + default: + { + printf( "SDM_Cnv_Manager() called with an undefined command %d\n", Command); + return NDS_ERRAPI; + } + } + + printf( "SDM_Cnv_Manager() called with command %d (%s)\n", Command, Command_Name); + return NDS_OK; +} + + +/*----------------------------------------------------------------------------*/ +/* Field Manager */ +/*----------------------------------------------------------------------------*/ + +NDT_Status SDM_Field_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node *Node_Ptr, NDT_Command Command, va_list Args) +{ + NDT_Command_Name Command_Name; + NDT_Status status; + + + switch( Command) + { + case NDD_CMD_MANAGER_VERSION: + { + NDT_Version_Name *Version_Name_Ptr = (NDT_Version_Name *)va_arg( Args, NDT_Version_Name *); + + + Command_Name = "NDD_CMD_MANAGER_VERSION"; + + *Version_Name_Ptr = "Revision: 2.1 Name: libnode-2_0_4-1 Date: 2002/02/28 22:00:35 Author: agibert "; + + return( NDS_OK); + } + + case NDD_CMD_INDEX_GET: + { + /* + NDT_Index_Id *Reply_Index_Id_Ptr = (NDT_Index_Id *)va_arg( Args, NDT_Index_Id *); + NDT_Command *Reply_Command_Ptr = (NDT_Command *)va_arg( Args, NDT_Command *); + NDT_Command Cmd = (NDT_Command)va_arg( Args, NDT_Command); + void *Value_ptr = (void *)va_arg( Args, void *); + */ + NDT_Index_Id *Reply_Index_Id_Ptr = (NDT_Index_Id *)va_arg( Args, NDT_Index_Id *); + NDT_Command *Reply_Command_Ptr = (NDT_Command *)va_arg( Args, NDT_Command *); + NDT_Command Cmd = (NDT_Command)va_arg( Args, NDT_Command); + IMRT_Field * Field_ptr = (IMRT_Field *)va_arg( Args, IMRT_Field *); + + + Command_Name = "NDD_CMD_INDEX_GET"; + + switch(Cmd) + { + case IMRD_SDMD_CMD_INDEX0_PRINT: + { + *Reply_Index_Id_Ptr = 0; + *Reply_Command_Ptr = NDD_CMD_VALUE_PRINT; + + break; + } + + case IMRD_SDMD_CMD_EXECUTE: + { + *Reply_Index_Id_Ptr = 0; + *Reply_Command_Ptr = NDD_CMD_EXECUTE; + break; + } + + case IMRD_SDMD_CMD_API_SQL_DUMP: + { + *Reply_Index_Id_Ptr = IMRD_SDMD_FIELD_IDX_ID; + *Reply_Command_Ptr = IMRD_SDMD_CMD_API_SQL_DUMP; + break; + } + + case IMRD_SDMD_CMD_API_XML_DUMP: + { + *Reply_Index_Id_Ptr = IMRD_SDMD_FIELD_IDX_ID; + *Reply_Command_Ptr = IMRD_SDMD_CMD_API_XML_DUMP; + break; + } + + default: + { + *Reply_Index_Id_Ptr = Index_Id; + *Reply_Command_Ptr = Cmd; + + break; + } + } + + return( NDS_OK); + } + + case NDD_CMD_VALUE_ALLOC: + { + /* + void **Field_ptr_Ptr = (void **)va_arg( Args, void **); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + IMRT_Field **Field_ptr_Ptr = va_arg( Args, IMRT_Field **); + + + Command_Name = "NDD_CMD_VALUE_ALLOC"; + + if( ( *Field_ptr_Ptr = (IMRT_Field *)malloc( sizeof(IMRT_Field))) == NULL) + { + return( NDS_ERRMEM); + } + else + { + SDM_InitField(*Field_ptr_Ptr); + + return( NDS_OK); + } + } + + case NDD_CMD_VALUE_FREE: + { + /* + void *Field_ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + IMRT_Field *Field_ptr = (IMRT_Field *)va_arg( Args, IMRT_Field *); + + + Command_Name = "NDD_CMD_VALUE_FREE"; + + free( Field_ptr); + + return( NDS_OK); + } + + case NDD_CMD_VALUE_COMP: + { + /* + void *Value1_Ptr = (void *)va_arg( Args, void *); + void *Value2_Ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + IMRT_Field *Value1_Ptr = va_arg( Args, IMRT_Field *); + IMRT_Field *Value2_Ptr = va_arg( Args, IMRT_Field *); + + + Command_Name = "NDD_CMD_VALUE_COMP"; + + switch( Index_Id) + { + case IMRD_SDMD_FIELD_IDX_ID: + { + if( Value1_Ptr->Id < Value2_Ptr->Id) + { + return( NDS_LOWER); + } + else + { + if( Value1_Ptr->Id > Value2_Ptr->Id) + { + return( NDS_GREATER); + } + else + { + return( NDS_EQUAL); + } + } + } + + case IMRD_SDMD_FIELD_IDX_NAME: + { + int rc; + + + rc=strcmp( Value1_Ptr->Name, Value2_Ptr->Name); + + if( rc <0) + { + return( NDS_LOWER); + } + else + { + if( rc > 0) + { + return( NDS_GREATER); + } + else + { + return( NDS_EQUAL); + } + } + } + + default: + { + printf( "Unknown COMP idx (%d) !\n", Index_Id); + + return( NDS_KO); + } + } + + return( NDS_OK); + } + + case NDD_CMD_VALUE_ADD: + { + /* + void *Field_ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + + Command_Name = "NDD_CMD_VALUE_ADD"; + + return( NDS_OK); + } + + case NDD_CMD_VALUE_REMOVE: + { + /* + void *Field_ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + + Command_Name = "NDD_CMD_VALUE_REMOVE"; + return( NDS_OK); + } + + case NDD_CMD_VALUE_PRINT: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + va_list user_args = (va_list)va_arg( lib_args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + void *Field_ptr = Node_Ptr->Value; + */ + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + + IMRT_Field *Field_ptr = Node_Ptr->Value; + char Local_Exist; + + Command_Name = "NDD_CMD_VALUE_PRINT"; + + if (Field_ptr->Exist == IMRD_TRUE) + { + Local_Exist = IMRD_YES; + } + else + { + Local_Exist = IMRD_NO; + } + + fprintf( Out, "Name: (%s) Valueid: (%s) Exist: (%c)\n\tFixed - offset: (%d) size: (%d) Def_Val: (%s) Cnv_Name: (%s) Cnv_Attr: (%s)\n\tFML - tag: (%s) Def_Val: (%s) Cnv_Name: (%s) Cnv_Attr: (%s)\n\tXML - Tag: (%s) Def_Val: (%s) Cnv_Name: (%s) Cnv_Attr: (%s)\n\tTagged - Tag: (%s) Def_Val: (%s) Cnv_Name: (%s) Cnv_Attr: (%s)\n\tInternal - Tag: (%s) Def_Val: (%s) Cnv_Name: (%s) Cnv_Attr: (%s)\n\tDelimited - Id: (%d) Def_Val: (%s) Cnv_Name: (%s) Cnv_Attr: (%s)\n", + Field_ptr->Name, Field_ptr->Value_Id, Local_Exist, + Field_ptr->Fixed.Offset, Field_ptr->Fixed.Size, Field_ptr->Fixed.Def_Val, Field_ptr->Fixed.Cnv_Ptr->Name, Field_ptr->Fixed.Cnv_Attr, + Field_ptr->FML.Tag, Field_ptr->FML.Def_Val, Field_ptr->FML.Cnv_Ptr->Name, Field_ptr->FML.Cnv_Attr, + Field_ptr->XML.Tag, Field_ptr->XML.Def_Val, Field_ptr->XML.Cnv_Ptr->Name, Field_ptr->XML.Cnv_Attr, + Field_ptr->Tagged.Tag, Field_ptr->Tagged.Def_Val, Field_ptr->Tagged.Cnv_Ptr->Name, Field_ptr->Tagged.Cnv_Attr, + Field_ptr->Internal.Tag, Field_ptr->Internal.Def_Val, Field_ptr->Internal.Cnv_Ptr->Name, Field_ptr->Internal.Cnv_Attr, + Field_ptr->Delimited.Id, Field_ptr->Delimited.Def_Val, Field_ptr->Delimited.Cnv_Ptr->Name, Field_ptr->Delimited.Cnv_Attr); + + return( NDS_OK); + } + + case NDD_CMD_INFO_PRINT: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + va_list user_args = (va_list)va_arg( lib_args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + void *Field_ptr = Node_Ptr->Value; + */ + + Command_Name = "NDD_CMD_INFO_PRINT"; + + return( NDS_OK); + } + + case NDD_CMD_EXECUTE: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + va_list user_args = (va_list)va_arg( lib_args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + void *Field_ptr = Node_Ptr->Value; + */ + IMRT_Field * Field_ptr = (IMRT_Field *)Node_Ptr->Value; + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + va_list user_args = (va_list)va_arg( Args, va_list); + IMRT_SDM_IdentMessage * IdentStruct = (IMRT_SDM_IdentMessage *)va_arg(lib_args,IMRT_SDM_IdentMessage *); + + if(Field_ptr->Exist == IMRD_TRUE) + { + status = IdentStruct-> Ident_Field_ExistFunc_Ptr(Field_ptr); + + + /*if( ((Next_Node_Ptr == NULL) && (status == (NDT_Status)IMRS_NO_IDENT)) || (status == (NDT_Status)IMRS_KO)) + { + return( NDS_KO); + } + else if (status = (NDT_Status)IMRS_OK) + { + return(NDS_IDENT_OK); + }*/ + + if( status != IMRS_OK) + { + return(status); + } + } + + if(strcmp(Field_ptr->Value_Id, IMRD_SDMD_EMPTY_STRING) != 0) + { + status = IdentStruct-> Ident_Field_ValueFunc_Ptr(Field_ptr, Field_ptr->Value_Id); + + + /*if( ((Next_Node_Ptr == NULL) && (status == (NDT_Status)IMRS_NO_IDENT)) || (status == (NDT_Status)IMRS_KO) ) + { + return( NDS_KO); + } + else if (status == (NDT_Status)IMRS_OK) + { + return(NDS_IDENT_OK); + }*/ + + if( status != IMRS_OK) + { + return(status); + } + + } + + return(NDS_OK); + } + + case IMRD_SDMD_CMD_API_SQL_DUMP: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + + void *Field_ptr = Node_Ptr->Value; + */ + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list user_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( user_args, FILE *); + IMRT_Field_Id MsgId = (IMRT_Field_Id)va_arg( user_args, IMRT_Field_Id); + + IMRT_Field *Field_Ptr = Node_Ptr->Value; + + Command_Name = "IMRD_SDMD_CMD_API_SQL_DUMP"; + + fprintf( Out, "INSERT INTO IMR_FIELD(FIELD_ID, FIELD_NAME, MSG_ID, FIELD_VALUEID, FIELD_EXIST) VALUES(%d, '%s', %d, '%s', ", + Field_Ptr->Id, Field_Ptr->Name, MsgId, Field_Ptr->Value_Id); + + if(Field_Ptr->Exist == IMRD_TRUE) + { + fprintf( Out, "'%c');\n", IMRD_YES); + } + else + { + fprintf( Out, "'%c');\n", IMRD_NO); + } + + + + if(Field_Ptr->Fixed.Size != -1) + { + fprintf( Out, "INSERT INTO IMR_FIXEDFIELD(FIELD_ID, FIXED_FIELD_OFFSET, FIXED_FIELD_SIZE, FIXED_FIELD_CNV_ID, FIXED_FIELD_CNV_ATTR, FIXED_FIELD_DEF_VAL) VALUES(%d, %d, %d, ", + Field_Ptr->Id, Field_Ptr->Fixed.Offset, Field_Ptr->Fixed.Size); + + if(Field_Ptr->Fixed.Cnv_Ptr != NULL) + { + fprintf( Out, "%d, '%s', '%s');\n", + Field_Ptr->Fixed.Cnv_Ptr->Id, Field_Ptr->Fixed.Cnv_Attr, Field_Ptr->Fixed.Def_Val); + } + else + { + fprintf( Out, "NULL, '%s', '%s');\n", + Field_Ptr->Fixed.Cnv_Attr, Field_Ptr->Fixed.Def_Val); + } + } + + if(strcmp(Field_Ptr->FML.Tag, IMRD_SDMD_EMPTY_STRING) != 0) + { + fprintf( Out, "INSERT INTO IMR_FMLFIELD(FIELD_ID, FML_FIELD_TAG, FML_FIELD_CNV_ID, FML_FIELD_CNV_ATTR, FML_FIELD_DEF_VAL) VALUES(%d, '%s', ", + Field_Ptr->Id, Field_Ptr->FML.Tag); + + if(Field_Ptr->FML.Cnv_Ptr != NULL) + { + fprintf( Out, "%d, '%s', '%s');\n", + Field_Ptr->FML.Cnv_Ptr->Id, Field_Ptr->FML.Cnv_Attr, Field_Ptr->FML.Def_Val); + } + else + { + fprintf( Out, "NULL, '%s', '%s');\n", + Field_Ptr->FML.Cnv_Attr, Field_Ptr->FML.Def_Val); + } + } + + if(strcmp(Field_Ptr->XML.Tag, IMRD_SDMD_EMPTY_STRING) != 0) + { + fprintf( Out, "INSERT INTO IMR_XMLFIELD(FIELD_ID, XML_FIELD_TAG, XML_FIELD_CNV_ID, XML_FIELD_CNV_ATTR, XML_FIELD_DEF_VAL) VALUES(%d, '%s', ", + Field_Ptr->Id, Field_Ptr->XML.Tag); + + if(Field_Ptr->XML.Cnv_Ptr != NULL) + { + fprintf( Out, "%d, '%s', '%s');\n", + Field_Ptr->XML.Cnv_Ptr->Id, Field_Ptr->XML.Cnv_Attr, Field_Ptr->XML.Def_Val); + } + else + { + fprintf( Out, "NULL, '%s', '%s');\n", + Field_Ptr->XML.Cnv_Attr, Field_Ptr->XML.Def_Val); + } + } + + if(strcmp(Field_Ptr->Tagged.Tag, IMRD_SDMD_EMPTY_STRING) != 0) + { + fprintf( Out, "INSERT INTO IMR_TAGGEDFIELD(FIELD_ID, TAGGED_FIELD_TAG, TAGGED_FIELD_CNV_ID, TAGGED_FIELD_CNV_ATTR, TAGGED_FIELD_DEF_VAL) VALUES(%d, '%s', ", + Field_Ptr->Id, Field_Ptr->Tagged.Tag); + + if(Field_Ptr->Tagged.Cnv_Ptr != NULL) + { + fprintf( Out, "%d, '%s', '%s');\n", + Field_Ptr->Tagged.Cnv_Ptr->Id, Field_Ptr->Tagged.Cnv_Attr, Field_Ptr->Tagged.Def_Val); + } + else + { + fprintf( Out, "NULL, '%s', '%s');\n", + Field_Ptr->Tagged.Cnv_Attr, Field_Ptr->Tagged.Def_Val); + } + } + + if(strcmp(Field_Ptr->Internal.Tag, IMRD_SDMD_EMPTY_STRING) != 0) + { + fprintf( Out, "INSERT INTO IMR_INTERNALFIELD(FIELD_ID, INTERNAL_FIELD_TAG, INTERNAL_FIELD_CNV_ID, INTERNAL_FIELD_CNV_ATTR, INTERNAL_FIELD_DEF_VAL) VALUES(%d, '%s', ", + Field_Ptr->Id, Field_Ptr->Internal.Tag); + + if(Field_Ptr->Internal.Cnv_Ptr != NULL) + { + fprintf( Out, "%d, '%s', '%s');\n", + Field_Ptr->Internal.Cnv_Ptr->Id, Field_Ptr->Internal.Cnv_Attr, Field_Ptr->Internal.Def_Val); + } + else + { + fprintf( Out, "NULL, '%s', '%s');\n", + Field_Ptr->Internal.Cnv_Attr, Field_Ptr->Internal.Def_Val); + } + } + + if(Field_Ptr->Delimited.Id != IMRD_DELIMITED_ID_UNKNOWN) + { + fprintf( Out, "INSERT INTO IMR_DELIMITEDFIELD(FIELD_ID, DELIMITED_FIELD_ID, DELIMITED_FIELD_CNV_ID, DELIMITED_FIELD_CNV_ATTR, DELIMITED_FIELD_DEF_VAL) VALUES(%d, %d, ", + Field_Ptr->Id, Field_Ptr->Delimited.Id); + + if(Field_Ptr->Delimited.Cnv_Ptr != NULL) + { + fprintf( Out, "%d, '%s', '%s');\n", + Field_Ptr->Delimited.Cnv_Ptr->Id, Field_Ptr->Delimited.Cnv_Attr, Field_Ptr->Delimited.Def_Val); + } + else + { + fprintf( Out, "NULL, '%s', '%s');\n", + Field_Ptr->Delimited.Cnv_Attr, Field_Ptr->Delimited.Def_Val); + } + } + + return( NDS_OK); + } + + case IMRD_SDMD_CMD_API_XML_DUMP: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + + void *Field_ptr = Node_Ptr->Value; + */ + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list user_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( user_args, FILE *); + + IMRT_Field *Field_Ptr = Node_Ptr->Value; + + + Command_Name = "IMRD_SDMD_CMD_API_XML_DUMP"; + + fprintf( Out, "\t\t<%s>\n", IMRD_SDMD_TAG_FIELD); + + if(strcmp(Field_Ptr->Name, IMRD_SDMD_EMPTY_STRING) != 0) + { + fprintf( Out, "\t\t\t<%s>%s\n", IMRD_SDMD_TAG_NAME, Field_Ptr->Name, IMRD_SDMD_TAG_NAME); + } + + if(strcmp(Field_Ptr->Value_Id, IMRD_SDMD_EMPTY_STRING) != 0) + { + fprintf( Out, "\t\t\t<%s>%s\n", IMRD_SDMD_TAG_VALUEID, Field_Ptr->Value_Id, IMRD_SDMD_TAG_VALUEID); + } + + if(Field_Ptr->Exist == IMRD_TRUE) + { + fprintf( Out, "\t\t\t<%s>%c\n", IMRD_SDMD_TAG_EXIST, IMRD_YES, IMRD_SDMD_TAG_EXIST); + } + + if((Field_Ptr->Fixed.Size != -1)||(Field_Ptr->Fixed.Cnv_Ptr != NULL)||(strcmp(Field_Ptr->Fixed.Def_Val, IMRD_SDMD_EMPTY_STRING) != 0)) + { + fprintf( Out, "\t\t\t<%s>\n\t\t\t\t<%s>%d\n\t\t\t\t<%s>%d\n", IMRD_SDMD_TAG_FIXED, + IMRD_SDMD_TAG_OFFSET, Field_Ptr->Fixed.Offset, IMRD_SDMD_TAG_OFFSET, + IMRD_SDMD_TAG_SIZE, Field_Ptr->Fixed.Size, IMRD_SDMD_TAG_SIZE); + + if(Field_Ptr->Fixed.Cnv_Ptr != NULL) + { + fprintf( Out, "\t\t\t\t<%s>\n\t\t\t\t\t<%s>%s\n", + IMRD_SDMD_TAG_CNV, + IMRD_SDMD_TAG_NAME, Field_Ptr->Fixed.Cnv_Ptr->Name, IMRD_SDMD_TAG_NAME); + + if(strcmp(Field_Ptr->Fixed.Cnv_Attr, IMRD_SDMD_EMPTY_STRING) != 0) + { + fprintf( Out, "\t\t\t\t\t<%s>%s\n", + IMRD_SDMD_TAG_ATTRIBUTE, Field_Ptr->Fixed.Cnv_Attr, IMRD_SDMD_TAG_ATTRIBUTE); + } + + fprintf( Out, "\t\t\t\t\n", IMRD_SDMD_TAG_CNV); + } + + if(strcmp(Field_Ptr->Fixed.Def_Val, IMRD_SDMD_EMPTY_STRING) != 0) + { + fprintf( Out, "\t\t\t\t<%s>%s\n", + IMRD_SDMD_TAG_DEFVAL, Field_Ptr->Fixed.Def_Val, IMRD_SDMD_TAG_DEFVAL); + } + + fprintf( Out, "\t\t\t\n", IMRD_SDMD_TAG_FIXED); + } + + + if((strcmp(Field_Ptr->Tagged.Tag, IMRD_SDMD_EMPTY_STRING) != 0)|| + (Field_Ptr->Tagged.Cnv_Ptr != NULL)|| + (strcmp(Field_Ptr->Tagged.Def_Val, IMRD_SDMD_EMPTY_STRING) != 0)) + { + fprintf( Out, "\t\t\t<%s>\n\t\t\t\t<%s>%s\n", IMRD_SDMD_TAG_TAGGED, + IMRD_SDMD_TAG_NAME, Field_Ptr->Tagged.Tag, IMRD_SDMD_TAG_NAME); + + if(Field_Ptr->Tagged.Cnv_Ptr != NULL) + { + fprintf( Out, "\t\t\t\t<%s>\n\t\t\t\t\t<%s>%s\n", + IMRD_SDMD_TAG_CNV, + IMRD_SDMD_TAG_NAME, Field_Ptr->Tagged.Cnv_Ptr->Name, IMRD_SDMD_TAG_NAME); + + if(strcmp(Field_Ptr->Tagged.Cnv_Attr, IMRD_SDMD_EMPTY_STRING) != 0) + { + fprintf( Out, "\t\t\t\t\t<%s>%s\n", + IMRD_SDMD_TAG_ATTRIBUTE, Field_Ptr->Tagged.Cnv_Attr, IMRD_SDMD_TAG_ATTRIBUTE); + } + + fprintf( Out, "\t\t\t\t\n", IMRD_SDMD_TAG_CNV); + } + + if(strcmp(Field_Ptr->Tagged.Def_Val, IMRD_SDMD_EMPTY_STRING) != 0) + { + fprintf( Out, "\t\t\t\t<%s>%s\n", + IMRD_SDMD_TAG_DEFVAL, Field_Ptr->Tagged.Def_Val, IMRD_SDMD_TAG_DEFVAL); + } + + fprintf( Out, "\t\t\t\n", IMRD_SDMD_TAG_TAGGED); + + } + + if((strcmp(Field_Ptr->Internal.Tag, IMRD_SDMD_EMPTY_STRING) != 0)|| + (Field_Ptr->Internal.Cnv_Ptr != NULL)|| + (strcmp(Field_Ptr->Internal.Def_Val, IMRD_SDMD_EMPTY_STRING) != 0)) + { + fprintf( Out, "\t\t\t<%s>\n\t\t\t\t<%s>%s\n", IMRD_SDMD_TAG_INTERNE, + IMRD_SDMD_TAG_NAME, Field_Ptr->Internal.Tag, IMRD_SDMD_TAG_NAME); + + if(Field_Ptr->Internal.Cnv_Ptr != NULL) + { + fprintf( Out, "\t\t\t\t<%s>\n\t\t\t\t\t<%s>%s\n", + IMRD_SDMD_TAG_CNV, + IMRD_SDMD_TAG_NAME, Field_Ptr->Internal.Cnv_Ptr->Name, IMRD_SDMD_TAG_NAME); + + if(strcmp(Field_Ptr->Internal.Cnv_Attr, IMRD_SDMD_EMPTY_STRING) != 0) + { + fprintf( Out, "\t\t\t\t\t<%s>%s\n", + IMRD_SDMD_TAG_ATTRIBUTE, Field_Ptr->Internal.Cnv_Attr, IMRD_SDMD_TAG_ATTRIBUTE); + } + + fprintf( Out, "\t\t\t\t\n", IMRD_SDMD_TAG_CNV); + } + + if(strcmp(Field_Ptr->Internal.Def_Val, IMRD_SDMD_EMPTY_STRING) != 0) + { + fprintf( Out, "\t\t\t\t<%s>%s\n", + IMRD_SDMD_TAG_DEFVAL, Field_Ptr->Internal.Def_Val, IMRD_SDMD_TAG_DEFVAL); + } + + fprintf( Out, "\t\t\t\n", IMRD_SDMD_TAG_INTERNE); + + } + + + if((strcmp(Field_Ptr->FML.Tag, IMRD_SDMD_EMPTY_STRING) != 0)|| + (Field_Ptr->FML.Cnv_Ptr != NULL)|| + (strcmp(Field_Ptr->FML.Def_Val, IMRD_SDMD_EMPTY_STRING) != 0)) + { + fprintf( Out, "\t\t\t<%s>\n\t\t\t\t<%s>%s\n", IMRD_SDMD_TAG_FML, + IMRD_SDMD_TAG_NAME, Field_Ptr->FML.Tag, IMRD_SDMD_TAG_NAME); + + if(Field_Ptr->FML.Cnv_Ptr != NULL) + { + fprintf( Out, "\t\t\t\t<%s>\n\t\t\t\t\t<%s>%s\n", + IMRD_SDMD_TAG_CNV, + IMRD_SDMD_TAG_NAME, Field_Ptr->FML.Cnv_Ptr->Name, IMRD_SDMD_TAG_NAME); + + if(strcmp(Field_Ptr->FML.Cnv_Attr, IMRD_SDMD_EMPTY_STRING) != 0) + { + fprintf( Out, "\t\t\t\t\t<%s>%s\n", + IMRD_SDMD_TAG_ATTRIBUTE, Field_Ptr->FML.Cnv_Attr, IMRD_SDMD_TAG_ATTRIBUTE); + } + + fprintf( Out, "\t\t\t\t\n", IMRD_SDMD_TAG_CNV); + } + + if(strcmp(Field_Ptr->FML.Def_Val, IMRD_SDMD_EMPTY_STRING) != 0) + { + fprintf( Out, "\t\t\t\t<%s>%s\n", + IMRD_SDMD_TAG_DEFVAL, Field_Ptr->FML.Def_Val, IMRD_SDMD_TAG_DEFVAL); + } + + fprintf( Out, "\t\t\t\n", IMRD_SDMD_TAG_FML); + + } + + if((strcmp(Field_Ptr->XML.Tag, IMRD_SDMD_EMPTY_STRING) != 0)|| + (Field_Ptr->XML.Cnv_Ptr != NULL)|| + (strcmp(Field_Ptr->XML.Def_Val, IMRD_SDMD_EMPTY_STRING) != 0)) + { + fprintf( Out, "\t\t\t<%s>\n\t\t\t\t<%s>%s\n", IMRD_SDMD_TAG_XML, + IMRD_SDMD_TAG_NAME, Field_Ptr->XML.Tag, IMRD_SDMD_TAG_NAME); + + if(Field_Ptr->XML.Cnv_Ptr != NULL) + { + fprintf( Out, "\t\t\t\t<%s>\n\t\t\t\t\t<%s>%s\n", + IMRD_SDMD_TAG_CNV, + IMRD_SDMD_TAG_NAME, Field_Ptr->XML.Cnv_Ptr->Name, IMRD_SDMD_TAG_NAME); + + if(strcmp(Field_Ptr->XML.Cnv_Attr, IMRD_SDMD_EMPTY_STRING) != 0) + { + fprintf( Out, "\t\t\t\t\t<%s>%s\n", + IMRD_SDMD_TAG_ATTRIBUTE, Field_Ptr->XML.Cnv_Attr, IMRD_SDMD_TAG_ATTRIBUTE); + } + + fprintf( Out, "\t\t\t\t\n", IMRD_SDMD_TAG_CNV); + } + + if(strcmp(Field_Ptr->XML.Def_Val, IMRD_SDMD_EMPTY_STRING) != 0) + { + fprintf( Out, "\t\t\t\t<%s>%s\n", + IMRD_SDMD_TAG_DEFVAL, Field_Ptr->XML.Def_Val, IMRD_SDMD_TAG_DEFVAL); + } + + fprintf( Out, "\t\t\t\n", IMRD_SDMD_TAG_XML); + + } + + + if((Field_Ptr->Delimited.Id != IMRD_DELIMITED_ID_UNKNOWN)|| + (Field_Ptr->Delimited.Cnv_Ptr != NULL)|| + (strcmp(Field_Ptr->Delimited.Def_Val, IMRD_SDMD_EMPTY_STRING) != 0)) + { + fprintf( Out, "\t\t\t<%s>\n\t\t\t\t<%s>%d\n", IMRD_SDMD_TAG_DELIMITED, + IMRD_SDMD_TAG_ID, Field_Ptr->Delimited.Id, IMRD_SDMD_TAG_ID); + + if(Field_Ptr->Delimited.Cnv_Ptr != NULL) + { + fprintf( Out, "\t\t\t\t<%s>\n\t\t\t\t\t<%s>%s\n", + IMRD_SDMD_TAG_CNV, + IMRD_SDMD_TAG_NAME, Field_Ptr->Delimited.Cnv_Ptr->Name, IMRD_SDMD_TAG_NAME); + + if(strcmp(Field_Ptr->Delimited.Cnv_Attr, IMRD_SDMD_EMPTY_STRING) != 0) + { + fprintf( Out, "\t\t\t\t\t<%s>%s\n", + IMRD_SDMD_TAG_ATTRIBUTE, Field_Ptr->Delimited.Cnv_Attr, IMRD_SDMD_TAG_ATTRIBUTE); + } + + fprintf( Out, "\t\t\t\t\n", IMRD_SDMD_TAG_CNV); + } + + if(strcmp(Field_Ptr->Delimited.Def_Val, IMRD_SDMD_EMPTY_STRING) != 0) + { + fprintf( Out, "\t\t\t\t<%s>%s\n", + IMRD_SDMD_TAG_DEFVAL, Field_Ptr->Delimited.Def_Val, IMRD_SDMD_TAG_DEFVAL); + } + + fprintf( Out, "\t\t\t\n", IMRD_SDMD_TAG_DELIMITED); + } + + fprintf( Out, "\t\t\n", IMRD_SDMD_TAG_FIELD); + + return( NDS_OK); + } + + + default: + { + printf( "SDM_Field_Manager() called with an undefined command %d\n", Command); + + return( NDS_ERRAPI); + } + } + + printf( "SDM_Field_Manager() called with command %d (%s)\n", Command, Command_Name); + + return( NDS_OK); +} + + + + + +/*----------------------------------------------------------------------------*/ +/* Msg Manager */ +/*----------------------------------------------------------------------------*/ + +NDT_Status SDM_Msg_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node *Node_Ptr, NDT_Command Command, va_list Args) +{ + NDT_Command_Name Command_Name; + NDT_Status status; + + + switch( Command) + { + case NDD_CMD_MANAGER_VERSION: + { + NDT_Version_Name *Version_Name_Ptr = (NDT_Version_Name *)va_arg( Args, NDT_Version_Name *); + + + Command_Name = "NDD_CMD_MANAGER_VERSION"; + + *Version_Name_Ptr = "Revision: 2.1 Name: libnode-2_0_4-1 Date: 2002/02/28 22:00:35 Author: agibert "; + + return( NDS_OK); + } + + case NDD_CMD_INDEX_GET: + { + /* + NDT_Index_Id *Reply_Index_Id_Ptr = (NDT_Index_Id *)va_arg( Args, NDT_Index_Id *); + NDT_Command *Reply_Command_Ptr = (NDT_Command *)va_arg( Args, NDT_Command *); + NDT_Command Cmd = (NDT_Command)va_arg( Args, NDT_Command); + void *Value_ptr = (void *)va_arg( Args, void *); + */ + NDT_Index_Id *Reply_Index_Id_Ptr = (NDT_Index_Id *)va_arg( Args, NDT_Index_Id *); + NDT_Command *Reply_Command_Ptr = (NDT_Command *)va_arg( Args, NDT_Command *); + NDT_Command Cmd = (NDT_Command)va_arg( Args, NDT_Command); + IMRT_Msg *Msg_ptr = (IMRT_Msg *)va_arg( Args, IMRT_Msg *); + + + Command_Name = "NDD_CMD_INDEX_GET"; + + switch(Cmd) + { + case IMRD_SDMD_CMD_INDEX0_PRINT: + { + *Reply_Index_Id_Ptr = 0; + *Reply_Command_Ptr = NDD_CMD_VALUE_PRINT; + + break; + } + + case IMRD_SDMD_CMD_API_SQL_DUMP: + { + *Reply_Index_Id_Ptr = IMRD_SDMD_MSG_IDX_ID; + *Reply_Command_Ptr = IMRD_SDMD_CMD_API_SQL_DUMP; + break; + } + + case IMRD_SDMD_CMD_API_XML_DUMP: + { + *Reply_Index_Id_Ptr = IMRD_SDMD_MSG_IDX_ID; + *Reply_Command_Ptr = IMRD_SDMD_CMD_API_XML_DUMP; + break; + } + + default: + { + *Reply_Index_Id_Ptr = Index_Id; + *Reply_Command_Ptr = Cmd; + + break; + } + } + + return( NDS_OK); + } + + case NDD_CMD_VALUE_ALLOC: + { + /* + void **Msg_ptr_Ptr = (void **)va_arg( Args, void **); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + IMRT_Msg **Msg_ptr_Ptr = va_arg( Args, IMRT_Msg **); + NDT_Index_Type *index_type_ptr; + + + Command_Name = "NDD_CMD_VALUE_ALLOC"; + + if( ( *Msg_ptr_Ptr = (IMRT_Msg *)malloc( sizeof(IMRT_Msg))) == NULL) + { + return( NDS_ERRMEM); + } + else + { + + SDM_InitMessage(*Msg_ptr_Ptr); + + index_type_ptr = Msg_Struct_initial_idx_tab; + + if( ( status = ND_DataStruct_Open( &(*Msg_ptr_Ptr)->Field_Struct_Ptr, IMRD_SDMD_FIELD_STRUCT_IDX_NB, index_type_ptr, "SDM__Field_Manager", SDM_Field_Manager, NULL, NULL, NULL, NULL,0, NULL)) != NDS_OK) + { + printf( "ND_DataStruct_Open() Field failed (%d) !\n", status); + return(NDS_KO); + } + + return( NDS_OK); + } + } + + case NDD_CMD_VALUE_FREE: + { + /* + void *Msg_ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + IMRT_Msg *Msg_ptr = (IMRT_Msg *)va_arg( Args, IMRT_Msg *); + + + Command_Name = "NDD_CMD_VALUE_FREE"; + if(Msg_ptr->Field_Struct_Ptr != NULL) + { if( ( status = ND_DataStruct_Close(Msg_ptr->Field_Struct_Ptr)) != NDS_OK) + { + printf( "ND_DataStruct_Close() failed (%d) !\n", status); + return(status); + } + } + + free( Msg_ptr); + + return( NDS_OK); + } + + case NDD_CMD_VALUE_COMP: + { + /* + void *Value1_Ptr = (void *)va_arg( Args, void *); + void *Value2_Ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + IMRT_Msg *Value1_Ptr = va_arg( Args, IMRT_Msg *); + IMRT_Msg *Value2_Ptr = va_arg( Args, IMRT_Msg *); + + + Command_Name = "NDD_CMD_VALUE_COMP"; + + switch( Index_Id) + { + case IMRD_SDMD_MSG_IDX_ID: + { + if( Value1_Ptr->Id < Value2_Ptr->Id) + { + return( NDS_LOWER); + } + else + { + if( Value1_Ptr->Id > Value2_Ptr->Id) + { + return( NDS_GREATER); + } + else + { + return( NDS_EQUAL); + } + } + } + + case IMRD_SDMD_MSG_IDX_NAME: + { + int rc; + + rc = strcmp( Value1_Ptr->Name, Value2_Ptr->Name); + + if( rc < 0) + { + return( NDS_LOWER); + } + else + { + if( rc > 0) + { + return( NDS_GREATER); + } + else + { + return( NDS_EQUAL); + } + } + } + + default: + { + printf( "Unknown COMP idx (%d) !\n", Index_Id); + return( NDS_KO); + } + } + + return( NDS_OK); + } + + case NDD_CMD_VALUE_ADD: + { + /* + void *Msg_ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + + Command_Name = "NDD_CMD_VALUE_ADD"; + + return( NDS_OK); + } + + case NDD_CMD_VALUE_REMOVE: + { + /* + void *Msg_ptr = (void *)va_arg( Args, void *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + */ + + Command_Name = "NDD_CMD_VALUE_REMOVE"; + + return( NDS_OK); + } + + case NDD_CMD_VALUE_PRINT: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + NDT_Recursive_Offset Recursive_Offset = (NDT_Recursive_Offset)va_arg( lib_args, NDT_Recursive_Offset); + va_list user_args = (va_list)va_arg( lib_args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + + void *Msg_ptr = Node_Ptr->Value; + */ + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + NDT_Recursive_Offset Recursive_Offset = (NDT_Recursive_Offset)va_arg( lib_args, NDT_Recursive_Offset); + + IMRT_Msg *Msg_ptr = Node_Ptr->Value; + + + Command_Name = "NDD_CMD_VALUE_PRINT"; + + printf("Adresse avant traverse (%x)\n",Msg_ptr); + + fprintf( Out, "Type: (%s) Size: (%d) \n", + Msg_ptr->Name, Msg_ptr->Size); + + return( ND_DataStruct_Value_Print( Out, Msg_ptr->Field_Struct_Ptr, NDD_RECURSIVE_MODE_PARENT_CHILD, --Recursive_Depth, ++Recursive_Offset)); + + } + + case NDD_CMD_INFO_PRINT: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + NDT_Recursive_Offset Recursive_Offset = (NDT_Recursive_Offset)va_arg( lib_args, NDT_Recursive_Offset); + va_list user_args = (va_list)va_arg( lib_args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + + void *Msg_ptr = Node_Ptr->Value; + */ + + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list lib_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( lib_args, FILE *); + NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); + NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); + NDT_Recursive_Offset Recursive_Offset = (NDT_Recursive_Offset)va_arg( lib_args, NDT_Recursive_Offset); + + IMRT_Msg *Msg_Ptr = Node_Ptr->Value; + + + Command_Name = "NDD_CMD_INFO_PRINT"; + + + return( ND_DataStruct_Info_Print( Out, Msg_Ptr->Field_Struct_Ptr, NDD_RECURSIVE_MODE_PARENT_CHILD, --Recursive_Depth, ++Recursive_Offset)); + + } + + case IMRD_SDMD_CMD_API_SQL_DUMP: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + + void *Msg_ptr = Node_Ptr->Value; + */ + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list user_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( user_args, FILE *); + + IMRT_Msg *Msg_Ptr = Node_Ptr->Value; + + + Command_Name = "IMRD_SDMD_CMD_API_SQL_DUMP"; + + fprintf( Out, "INSERT INTO IMR_MSG(MSG_ID, MSG_NAME, MSG_SIZE) VALUES(%d, '%s', %d);\n", + Msg_Ptr->Id, Msg_Ptr->Name, Msg_Ptr->Size); + + if( ( status = ND_DataStruct_Traverse( Msg_Ptr->Field_Struct_Ptr, IMRD_SDMD_CMD_API_SQL_DUMP, Out, Msg_Ptr->Id)) != NDS_OK) + { + printf( "ND_DataStruct_Traverse failed (%d)...\n"); + return(NDS_KO); + } + + return( NDS_OK); + } + + case IMRD_SDMD_CMD_API_XML_DUMP: + { + /* + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list user_args = (va_list)va_arg( Args, va_list); + user_type user_data = (user_type)va_arg( user_args, user_type); + ... = (...)va_arg( user_args, ...); + + void *Msg_ptr = Node_Ptr->Value; + */ + NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); + va_list user_args = (va_list)va_arg( Args, va_list); + FILE *Out = (FILE *)va_arg( user_args, FILE *); + + IMRT_Msg *Msg_Ptr = Node_Ptr->Value; + + + Command_Name = "IMRD_SDMD_CMD_API_XML_DUMP"; + + fprintf( Out, "\t<%s>\n\t\t<%s>%s\n", IMRD_SDMD_TAG_MESSAGE, + IMRD_SDMD_TAG_NAME, Msg_Ptr->Name, IMRD_SDMD_TAG_NAME); + + if(Msg_Ptr->Size != 0) + { + fprintf( Out, "\t\t<%s>%ld\n", + IMRD_SDMD_TAG_SIZE, Msg_Ptr->Size, IMRD_SDMD_TAG_SIZE); + } + + if( ( status = ND_DataStruct_Traverse( Msg_Ptr->Field_Struct_Ptr, IMRD_SDMD_CMD_API_XML_DUMP, Out)) != NDS_OK) + { + printf( "ND_DataStruct_Traverse failed (%d)...\n"); + return(NDS_KO); + } + + fprintf( Out, "\t\n", IMRD_SDMD_TAG_MESSAGE); + + return( NDS_OK); + } + + default: + { + printf( "SDM_Msg_Manager() called with an undefined command %d\n", Command); + + return( NDS_ERRAPI); + } + } + + printf( "SDM_Msg_Manager() called with command %d (%s)\n", Command, Command_Name); + + return( NDS_OK); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_StructInfo_Init(IMRT_SDM_Config * Lib_Config_Ptr) +{ + IMRT_Status status; + + if(Lib_Config_Ptr->Flag == IMRD_SDM_FLAG_XML) + { + status= SDM_XML_StructInfo_Init(Lib_Config_Ptr->Lib_Path); + } + else + { +#ifdef ORACLE_SUPPORT + status = SDM_SQL_StructInfo_Init(); +#else + status = IMRS_OK; +#endif /* ORACLE_SUPPORT */ + } + + return(status); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_Close_RootCnv(void) +{ + IMRT_Status status; + NDT_Status nd_status; + + status = IMRS_OK; + + if(IMRG_SDM_Base.RootCnv != NULL) + { + if (IMRG_SDM_Base.RootCnv->User_Ptr != NULL) + { + free(IMRG_SDM_Base.RootCnv->User_Ptr); + } + + if( ( nd_status = ND_DataStruct_Close(IMRG_SDM_Base.RootCnv)) != NDS_OK) + { + printf( "RootCnv ND_DataStruct_Close() failed (%d) !\n", nd_status); + status = IMRS_KO; + } + } + + return(status); + +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_Close_RootMsg(void) +{ + IMRT_Status status; + NDT_Status nd_status; + + status = IMRS_OK; + + if(IMRG_SDM_Base.RootMsg != NULL) + { + if (IMRG_SDM_Base.RootMsg->User_Ptr != NULL) + { + free(IMRG_SDM_Base.RootMsg->User_Ptr); + } + + if( ( nd_status = ND_DataStruct_Close(IMRG_SDM_Base.RootMsg)) != NDS_OK) + { + printf( "RootMsg ND_DataStruct_Close() failed (%d) !\n", nd_status); + status = IMRS_KO; + } + } + + return(status); + +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_StructInfo_DInit(void) +{ + IMRT_Status status, StatusCnv, StatusMsg; + + status = IMRS_OK; + + StatusCnv = SDM_Close_RootCnv(); + StatusMsg = SDM_Close_RootMsg(); + + if((StatusCnv == IMRS_KO)||(StatusMsg == IMRS_KO)) + { + status = IMRS_KO; + } + + return(status); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_Cnv_Proceed( IMRT_SDMCB_Cnv_Add *CCB_Cnv_Add_Ptr) +{ + + IMRT_Status status; + NDT_Status nd_status; + + status = IMRS_OK; + if( ( nd_status = ND_DataStruct_Traverse( IMRG_SDM_Base.RootCnv, IMRD_SDMD_CMD_EXECUTE, stdout, NDD_RECURSIVE_MODE_PARENT, CCB_Cnv_Add_Ptr)) != NDS_OK) + { + printf( "ND_DataStruct_Traverse() failed (%d) !\n", nd_status); + status = IMRS_KO; + } + + return(status); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +void SDM_InitMessage(IMRT_Msg * mymessage) +{ + mymessage->Id = IMRD_MSG_ID_UNKNOWN; + memset(mymessage->Name,0,sizeof(mymessage->Name)); + mymessage->Size = 0; + mymessage->Field_Struct_Ptr = NULL; +} + +void SDM_InitField(IMRT_Field * myfield) +{ + memset(myfield->Name,0,sizeof(myfield->Name)); + memset(myfield->Value_Id,0,sizeof(myfield->Value_Id)); + myfield->Exist = IMRD_FALSE; + + myfield->Fixed.Offset = 0; + myfield->Fixed.Size = -1; + memset(myfield->Fixed.Def_Val,'\0',sizeof(myfield->Fixed.Def_Val)); + myfield->Fixed.Cnv_Ptr = NULL; + memset(myfield->Fixed.Cnv_Attr,0,sizeof(myfield->Fixed.Cnv_Attr)); + + memset(myfield->XML.Tag,0,sizeof(myfield->XML.Tag)); + memset(myfield->XML.Def_Val,'\0',sizeof(myfield->XML.Def_Val)); + myfield->XML.Cnv_Ptr = NULL; + memset(myfield->XML.Cnv_Attr,0,sizeof(myfield->XML.Cnv_Attr)); + + memset(myfield->FML.Tag,0,sizeof(myfield->FML.Tag)); + memset(myfield->FML.Def_Val,'\0',sizeof(myfield->FML.Def_Val)); + myfield->FML.Cnv_Ptr = NULL; + memset(myfield->FML.Cnv_Attr,0,sizeof(myfield->FML.Cnv_Attr)); + + memset(myfield->Tagged.Tag,0,sizeof(myfield->Tagged.Tag)); + memset(myfield->Tagged.Def_Val,'\0',sizeof(myfield->Tagged.Def_Val)); + myfield->Tagged.Cnv_Ptr = NULL; + memset(myfield->Tagged.Cnv_Attr,0,sizeof(myfield->Tagged.Cnv_Attr)); + + memset(myfield->Internal.Tag,0,sizeof(myfield->Internal.Tag)); + memset(myfield->Internal.Def_Val,'\0',sizeof(myfield->Internal.Def_Val)); + myfield->Internal.Cnv_Ptr = NULL; + memset(myfield->Internal.Cnv_Attr,0,sizeof(myfield->Internal.Cnv_Attr)); + + myfield->Delimited.Id = IMRD_DELIMITED_ID_UNKNOWN; + memset(myfield->Delimited.Def_Val,'\0',sizeof(myfield->Delimited.Def_Val)); + myfield->Delimited.Cnv_Ptr = NULL; + memset(myfield->Delimited.Cnv_Attr,0,sizeof(myfield->Delimited.Cnv_Attr)); +} + +void SDM_InitCnv(IMRT_Cnv * Cnv_Ptr) +{ + Cnv_Ptr->Id = IMRD_CNV_ID_UNKNOWN; + memset(Cnv_Ptr->Name,0,sizeof(Cnv_Ptr->Name)); +} + + diff --git a/src/libstatic_data_mng/src/struct_info_mng.h b/src/libstatic_data_mng/src/struct_info_mng.h new file mode 100644 index 0000000..1474f06 --- /dev/null +++ b/src/libstatic_data_mng/src/struct_info_mng.h @@ -0,0 +1,170 @@ +/*----------------------------------------------------------------------------*/ +/* File: struct_info_mng.h */ +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#ifndef _STRUCT_INFO_MNG_H_ +# define _STRUCT_INFO_MNG_H_ + + + +/*----------------------------------------------------------------------------*/ +/* Global Include */ +/*----------------------------------------------------------------------------*/ + +# include + + +/*----------------------------------------------------------------------------*/ +/* XML TAG */ +/*----------------------------------------------------------------------------*/ +#define IMRD_SDMD_TAG_CNV_STRUCT "cnv_struct" +#define IMRD_SDMD_TAG_MSG_STRUCT "msg_struct" + + +/* Nom des fichiers pour le chargement XML */ +#define SDMD_MSGFIELD_FILE "sd_msg_struct.xml" +#define SDMD_CNV_FILE "sd_cnv_struct.xml" + + +/********************************************************************/ +/* Les index du Manager SDM_Msg_Manager */ +/********************************************************************/ +#define IMRD_SDMD_MSG_STRUCT_IDX_NB (short)2 + +static NDT_Index_Type Msg_Struct_initial_idx_tab[IMRD_SDMD_MSG_STRUCT_IDX_NB] = +{ + (NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_LIST | NDD_INDEX_SUBTYPE_SORTED), + (NDD_INDEX_STATUS_CLOSED) +}; + +static NDT_Index_Type Msg_Struct_final_idx_tab[IMRD_SDMD_MSG_STRUCT_IDX_NB] = +{ + (NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_TREE | NDD_INDEX_SUBTYPE_BALANCED), + (NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_TREE | NDD_INDEX_SUBTYPE_BALANCED) +}; + +#define IMRD_SDMD_MSG_IDX_ID (short)0 +#define IMRD_SDMD_MSG_IDX_NAME (short)1 + + +/********************************************************************/ +/* Les index du Manager SDM_Field_Manager */ +/********************************************************************/ +#define IMRD_SDMD_FIELD_STRUCT_IDX_NB (short)2 + +static NDT_Index_Type Field_Struct_initial_idx_tab[IMRD_SDMD_FIELD_STRUCT_IDX_NB] = +{ + (NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_LIST | NDD_INDEX_SUBTYPE_SORTED), + (NDD_INDEX_STATUS_CLOSED) +}; + +static NDT_Index_Type Field_Struct_final_idx_tab[IMRD_SDMD_FIELD_STRUCT_IDX_NB] = +{ + (NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_TREE | NDD_INDEX_SUBTYPE_BALANCED), + (NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_TREE | NDD_INDEX_SUBTYPE_BALANCED) +}; + +#define IMRD_SDMD_FIELD_IDX_ID (short)0 +#define IMRD_SDMD_FIELD_IDX_NAME (short)1 + + +/********************************************************************/ +/* Les index du Manager SDM_Cnv_Manager */ +/********************************************************************/ +#define IMRD_SDMD_CNV_STRUCT_IDX_NB (short)2 + +static NDT_Index_Type Cnv_Struct_initial_idx_tab[IMRD_SDMD_CNV_STRUCT_IDX_NB] = +{ + (NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_LIST | NDD_INDEX_SUBTYPE_SORTED), + (NDD_INDEX_STATUS_CLOSED) +}; + +static NDT_Index_Type Cnv_Struct_final_idx_tab[IMRD_SDMD_CNV_STRUCT_IDX_NB] = +{ + (NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_TREE | NDD_INDEX_SUBTYPE_BALANCED), + (NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_TREE | NDD_INDEX_SUBTYPE_BALANCED) +}; + +#define IMRD_SDMD_CNV_IDX_ID (short)0 +#define IMRD_SDMD_CNV_IDX_NAME (short)1 + + + +/*----------------------------------------------------------------------------*/ +/* Prototypes */ +/*----------------------------------------------------------------------------*/ + +# ifdef _STRUCT_INFO_MNG_C_ + +NDT_Status SDM_Cnv_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list); +NDT_Status SDM_Field_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list); +NDT_Status SDM_Msg_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list); +IMRT_Status SDM_StructInfo_Init(IMRT_SDM_Config * Lib_Config_Ptr); +IMRT_Status SDM_Close_RootCnv(void); +IMRT_Status SDM_Close_RootMsg(void); +IMRT_Status SDM_StructInfo_DInit(void); +IMRT_Status SDM_Cnv_Proceed( IMRT_SDMCB_Cnv_Add *CCB_Cnv_Add_Ptr); +void SDM_InitMessage(IMRT_Msg * mymessage); +void SDM_InitField(IMRT_Field * myfield); +void SDM_InitCnv(IMRT_Cnv * Cnv_Ptr); + +# else + +extern NDT_Status SDM_Cnv_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list); +extern NDT_Status SDM_Field_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list); +extern NDT_Status SDM_Msg_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list); +extern IMRT_Status SDM_StructInfo_Init(IMRT_SDM_Config * Lib_Config_Ptr); +extern IMRT_Status SDM_Close_RootCnv(void); +extern IMRT_Status SDM_Close_RootMsg(void); +extern IMRT_Status SDM_StructInfo_DInit(void); +extern IMRT_Status SDM_Cnv_Proceed( IMRT_SDMCB_Cnv_Add *CCB_Cnv_Add_Ptr); + +# endif + + + + + +/*----------------------------------------------------------------------------*/ +/* Local Includes */ +/*----------------------------------------------------------------------------*/ + +# ifdef _STRUCT_INFO_MNG_C_ + +# include "struct_info_xml.h" +# include "struct_info_sql.h" + +# endif + + + + + +/*----------------------------------------------------------------------------*/ + +#endif diff --git a/src/libstatic_data_mng/src/struct_info_sql.h b/src/libstatic_data_mng/src/struct_info_sql.h new file mode 100644 index 0000000..673febc --- /dev/null +++ b/src/libstatic_data_mng/src/struct_info_sql.h @@ -0,0 +1,87 @@ +/*----------------------------------------------------------------------------*/ +/* File: struct_info_sql.h */ +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#ifndef _STRUCT_INFO_SQL_H_ +# define _STRUCT_INFO_SQL_H_ + + + +/*----------------------------------------------------------------------------*/ +/* Global Include */ +/*----------------------------------------------------------------------------*/ + +# include + + + + + +/*----------------------------------------------------------------------------*/ +/* Prototypes */ +/*----------------------------------------------------------------------------*/ + +# ifdef _STRUCT_INFO_SQL_PC_ + +IMRT_Status SDM_SQL_StructInfo_Init(void); +IMRT_Status SDM_SQL_Load_Cnv(NDT_Root **myRootCnv_Ptr_Ptr); +IMRT_Status SDM_SQL_Load_MsgAndField(NDT_Root **myRootMessage_Ptr_Ptr); +IMRT_Status SDM_SQL_LoadFieldMsg(IMRT_Msg *myMsg_Ptr); +IMRT_Status SDM_SQL_Dump_Msg_Header(FILE *dump_file); +IMRT_Status SDM_SQL_Dump_Msg_Body(FILE *dump_file); +IMRT_Status SDM_SQL_Dump_Msg_Footer(FILE *dump_file); +IMRT_Status SDM_SQL_Dump_Msg(void); +IMRT_Status SDM_SQL_Dump_Cnv_Header(FILE *dump_file); +IMRT_Status SDM_SQL_Dump_Cnv_Body(FILE *dump_file); +IMRT_Status SDM_SQL_Dump_Cnv_Footer(FILE *dump_file); +IMRT_Status SDM_SQL_Dump_Cnv(void); + +# else + +extern IMRT_Status SDM_SQL_StructInfo_Init(void); +extern IMRT_Status SDM_SQL_Load_Cnv(NDT_Root **myRootCnv_Ptr_Ptr); +extern IMRT_Status SDM_SQL_Load_MsgAndField(NDT_Root **myRootMessage_Ptr_Ptr); +extern IMRT_Status SDM_SQL_LoadFieldMsg(IMRT_Msg *myMsg_Ptr); +extern IMRT_Status SDM_SQL_Dump_Msg_Header(FILE *dump_file); +extern IMRT_Status SDM_SQL_Dump_Msg_Body(FILE *dump_file); +extern IMRT_Status SDM_SQL_Dump_Msg_Footer(FILE *dump_file); +extern IMRT_Status SDM_SQL_Dump_Msg(void); +extern IMRT_Status SDM_SQL_Dump_Cnv_Header(FILE *dump_file); +extern IMRT_Status SDM_SQL_Dump_Cnv_Body(FILE *dump_file); +extern IMRT_Status SDM_SQL_Dump_Cnv_Footer(FILE *dump_file); +extern IMRT_Status SDM_SQL_Dump_Cnv(void); + +# endif + + + + + +/*----------------------------------------------------------------------------*/ + +#endif diff --git a/src/libstatic_data_mng/src/struct_info_sql.pc b/src/libstatic_data_mng/src/struct_info_sql.pc new file mode 100644 index 0000000..efb33d6 --- /dev/null +++ b/src/libstatic_data_mng/src/struct_info_sql.pc @@ -0,0 +1,825 @@ +/*----------------------------------------------------------------------------*/ +/* File: struct_info_sql.pc */ +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#define _LIBSTATIC_DATA_MNG_ +#define _STRUCT_INFO_SQL_PC_ + +#include "struct_info_sql.h" + + +IMRT_Status SDM_SQL_StructInfo_Init(void) +{ + IMRT_Status status, StatusTmp; + + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_0, "Loading Cnv..."); + status = SDM_SQL_Load_Cnv(&(IMRG_SDM_Base.RootCnv)); + if(status == IMRS_OK) + { + IMRD_LM_LOG_INFO_1( "Cnv loaded: (%d)", IMRG_SDM_Base.RootCnv->Index_Tab[NDD_INDEX_PRIMARY].Node_Number); + + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_0, "Loading Msg and Field..."); + status = SDM_SQL_Load_MsgAndField(&(IMRG_SDM_Base.RootMsg)); + + if(status == IMRS_OK) + { + IMRD_LM_LOG_INFO_1( "Msg and Field loaded: (%d)", IMRG_SDM_Base.RootMsg->Index_Tab[NDD_INDEX_PRIMARY].Node_Number); + } + else + { + IMRD_LM_LOG_ERROR_0( "Can't load Msg and Field !"); + StatusTmp = SDM_Close_RootCnv(); + } + + } + else + { + IMRD_LM_LOG_ERROR_0( "Can't load Cnv !"); + } + + return(status); + +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_SQL_Load_Cnv(NDT_Root **myRootCnv_Ptr_Ptr) +{ + const char sFunctionName []="SDM_SQL_Load_Cnv"; + NDT_Status nd_status; + IMRT_Status status; + NDT_Index_Type *index_type_ptr; + IMRT_Cnv *myCnv_Ptr; + IMRT_Data_Version *Data_Version_Ptr; + + EXEC SQL BEGIN DECLARE SECTION; + IMRT_Cnv_Id hCnvId; + VARCHAR vCnvName[IMRD_CNV_NAME_SIZE]; + short hIndCnvId; + short hIndCnvName; + EXEC SQL END DECLARE SECTION; + + /*initialisation des indexes*/ + index_type_ptr = Cnv_Struct_initial_idx_tab; + + Data_Version_Ptr = (IMRT_Data_Version *) malloc(sizeof(IMRT_Data_Version)); + status = SDM_SQL_Set_Struct_Version(Data_Version_Ptr, "Cnv"); + if (status != IMRS_OK) + { + return(IMRS_KO); + } + + nd_status = ND_DataStruct_Open(myRootCnv_Ptr_Ptr, IMRD_SDMD_CNV_STRUCT_IDX_NB,index_type_ptr, "SDM_Cnv_Manager",SDM_Cnv_Manager, NULL, NULL, NULL, NULL,0, Data_Version_Ptr); + if(nd_status != NDS_OK) + { + IMRD_LM_LOG_ERROR_2( "%s : ND_DataStruct_Open -- SDM_Cnv_Manager failed (%d) !", sFunctionName, nd_status); + status = IMRS_KO; + } + else + { + EXEC SQL DECLARE cur_imr_cnv_hdr CURSOR FOR + SELECT CNV_ID, CNV_NAME + FROM IMR_CNV; + + EXEC SQL OPEN cur_imr_cnv_hdr; + do + { + memset(vCnvName.arr, '\0', (size_t) IMRD_CNV_NAME_SIZE); + + EXEC SQL FETCH cur_imr_cnv_hdr + INTO :hCnvId:hIndCnvId, + :vCnvName:hIndCnvName; + + if (sqlca.sqlcode == 0) + { + /* création d'un nouvelle objet CNV */ + nd_status = ND_Value_Alloc( *myRootCnv_Ptr_Ptr, (void **)&(myCnv_Ptr)); + if(nd_status != NDS_OK) + { + IMRD_LM_LOG_ERROR_2( "%s : ND_Value_Alloc -- SDM_Cnv_Manager failed (%d) !", sFunctionName, nd_status); + status = IMRS_KO; + } + else + { + /* Ajout de l'objet CNV */ + myCnv_Ptr->Id = hCnvId; + strcpy(myCnv_Ptr->Name, (char *) vCnvName.arr); + + nd_status = ND_DataStruct_Value_Add( *myRootCnv_Ptr_Ptr, (void *)(myCnv_Ptr)); + if(nd_status != NDS_OK) + { + IMRD_LM_LOG_ERROR_2( "%s : ND_DataStruct_Value_Add -- SDM_Cnv_Manager failed (%d) !", sFunctionName, nd_status); + status = IMRS_KO; + } + } + } + } while((sqlca.sqlcode == 0)&&(nd_status == NDS_OK)&&(status == IMRS_OK)); + + if (sqlca.sqlcode < 0) + { + IMRD_LM_LOG_ERROR_3( "Erreur %s. Erreur Oracle : %d - %s !", sFunctionName, sqlca.sqlcode, sqlca.sqlerrm.sqlerrmc); + status = IMRS_KO; + } + + EXEC SQL CLOSE cur_imr_cnv_hdr; + + if(status == IMRS_OK) + { + index_type_ptr = Cnv_Struct_final_idx_tab; + status = SDM_DataStruct_Finalize(*myRootCnv_Ptr_Ptr, index_type_ptr, IMRD_SDMD_CNV_STRUCT_IDX_NB); + /*SDM_DataStruct_Dump(*myRootCnv_Ptr_Ptr);*/ + } + else + { + nd_status = ND_DataStruct_Close(*myRootCnv_Ptr_Ptr); + if(nd_status != NDS_OK) + { + IMRD_LM_LOG_ERROR_1( "ND_DataStruct_Close() failed (%d) !", nd_status); + } + } + + } + return(status); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_SQL_Load_MsgAndField(NDT_Root **myRootMessage_Ptr_Ptr) +{ + const char sFunctionName []="SDM_SQL_Load_MsgAndField"; + NDT_Status nd_status; + IMRT_Status status; + NDT_Index_Type *index_type_ptr; + IMRT_Msg *myMsg_Ptr; + IMRT_Data_Version *Data_Version_Ptr; + + EXEC SQL BEGIN DECLARE SECTION; + IMRT_Msg_Id hMsgId; + VARCHAR vMsgName[IMRD_NAME_SIZE]; + short hMsgSize; + short hIndMsgId; + short hIndMsgName; + short hIndMsgSize; + EXEC SQL END DECLARE SECTION; + + /*initialisation des indexes*/ + index_type_ptr = Msg_Struct_initial_idx_tab; + + Data_Version_Ptr = (IMRT_Data_Version *) malloc(sizeof(IMRT_Data_Version)); + status = SDM_SQL_Set_Struct_Version(Data_Version_Ptr, "Msg-Field"); + if (status != IMRS_OK) + { + return(IMRS_KO); + } + + nd_status = ND_DataStruct_Open(myRootMessage_Ptr_Ptr, IMRD_SDMD_MSG_STRUCT_IDX_NB, index_type_ptr, "SDM_Msg_Manager",SDM_Msg_Manager, NULL, NULL, NULL, NULL,0, Data_Version_Ptr); + if (nd_status != NDS_OK) + { + IMRD_LM_LOG_ERROR_2( "%s : ND_DataStruct_Open -- SDM_Msg_Manager failed (%d) !", sFunctionName, nd_status); + status = IMRS_KO; + } + else + { + EXEC SQL DECLARE cur_imr_msg CURSOR FOR + SELECT MSG_ID, MSG_NAME, MSG_SIZE + FROM IMR_MSG; + + EXEC SQL OPEN cur_imr_msg; + do + { + memset(vMsgName.arr, '\0', (size_t) IMRD_NAME_SIZE); + EXEC SQL FETCH cur_imr_msg + INTO :hMsgId:hIndMsgId, + :vMsgName:hIndMsgName, + :hMsgSize:hIndMsgSize; + if (sqlca.sqlcode == 0) + { + nd_status = ND_Value_Alloc( *myRootMessage_Ptr_Ptr, (void **)&(myMsg_Ptr)); + if (nd_status != NDS_OK) + { + IMRD_LM_LOG_ERROR_2( "%s : ND_Value_Alloc -- SDM_Msg_Manager failed (%d) !", sFunctionName, nd_status); + status = IMRS_KO; + } + else + { + myMsg_Ptr->Id = hMsgId; + if (hIndMsgName >= 0) + strcpy(myMsg_Ptr->Name, (char *) vMsgName.arr); + if (hIndMsgSize >= 0) + myMsg_Ptr->Size = hMsgSize; + + status = SDM_SQL_LoadFieldMsg(myMsg_Ptr); + if (status == IMRS_OK) + { + /* Ajout du message */ + nd_status = ND_DataStruct_Value_Add( *myRootMessage_Ptr_Ptr, (void *)(myMsg_Ptr)); + if (nd_status != NDS_OK) + { + IMRD_LM_LOG_ERROR_2( "%s : ND_DataStruct_Value_Add -- SDM_Msg_Manager failed (%d) !", sFunctionName, nd_status); + status = IMRS_KO; + } + } + } + } + } while((sqlca.sqlcode == 0)&&(nd_status == NDS_OK)&&(status == IMRS_OK)); + + if (sqlca.sqlcode < 0) + { + IMRD_LM_LOG_ERROR_3( "Erreur %s. Erreur Oracle : %d - %s !", sFunctionName, sqlca.sqlcode, sqlca.sqlerrm.sqlerrmc); + status = IMRS_KO; + } + + EXEC SQL CLOSE cur_imr_msg; + + if(status == IMRS_OK) + { + index_type_ptr = Msg_Struct_final_idx_tab; + status = SDM_DataStruct_Finalize(*myRootMessage_Ptr_Ptr, index_type_ptr, IMRD_SDMD_MSG_STRUCT_IDX_NB); + /*SDM_DataStruct_Dump( *myRootMessage_Ptr_Ptr);*/ + } + else + { + if(myMsg_Ptr->Field_Struct_Ptr != NULL) + { + nd_status = ND_DataStruct_Close(myMsg_Ptr->Field_Struct_Ptr); + if(nd_status != NDS_OK) + { + IMRD_LM_LOG_ERROR_1( "ND_DataStruct_Close() failed (%d) !", nd_status); + } + } + + nd_status = ND_DataStruct_Close(*myRootMessage_Ptr_Ptr); + if(nd_status != NDS_OK) + { + IMRD_LM_LOG_ERROR_1( "ND_DataStruct_Close() failed (%d) !", nd_status); + } + } + } + + return(status); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_SQL_LoadFieldMsg(IMRT_Msg *myMsg_Ptr) +{ + const char sFunctionName []="SDM_SQL_LoadFieldMsg"; + NDT_Status nd_status; + IMRT_Status status; + IMRT_Field *myField_Ptr; + NDT_Node *node_ptr; + IMRT_Cnv myCnv; + + EXEC SQL BEGIN DECLARE SECTION; + IMRT_Field_Id hFieldId; + VARCHAR vFieldName[IMRD_NAME_SIZE]; + VARCHAR vFieldValueid[IMRD_VALUE_ID_SIZE]; + VARCHAR vFieldExist[IMRD_EXIST_SIZE]; + long hFieldFixedOffset; + long hFieldFixedSize; + VARCHAR vFieldFixedDefVal[IMRD_VALUE_SIZE]; + IMRT_Cnv_Id hFieldFixedCnvId; + VARCHAR vFieldFixedCnvAttr[IMRD_CNV_ATTR_SIZE]; + VARCHAR vFieldFmlTag[IMRD_FML_TAG_SIZE]; + VARCHAR vFieldFmlDefVal[IMRD_VALUE_SIZE]; + IMRT_Cnv_Id hFieldFmlCnvId; + VARCHAR vFieldFmlCnvAttr[IMRD_CNV_ATTR_SIZE]; + VARCHAR vFieldXmlTag[IMRD_XML_TAG_SIZE]; + VARCHAR vFieldXmlDefVal[IMRD_VALUE_SIZE]; + IMRT_Cnv_Id hFieldXmlCnvId; + VARCHAR vFieldXmlCnvAttr[IMRD_CNV_ATTR_SIZE]; + VARCHAR vFieldTaggedTag[IMRD_TAGGED_TAG_SIZE]; + VARCHAR vFieldTaggedDefVal[IMRD_VALUE_SIZE]; + IMRT_Cnv_Id hFieldTaggedCnvId; + VARCHAR vFieldTaggedCnvAttr[IMRD_CNV_ATTR_SIZE]; + VARCHAR vFieldInternalTag[IMRD_INTERNAL_TAG_SIZE]; + VARCHAR vFieldInternalDefVal[IMRD_VALUE_SIZE]; + IMRT_Cnv_Id hFieldInternalCnvId; + VARCHAR vFieldInternalCnvAttr[IMRD_CNV_ATTR_SIZE]; + IMRT_Delimited_Id hFieldDelimitedId; + VARCHAR vFieldDelimitedDefVal[IMRD_VALUE_SIZE]; + IMRT_Cnv_Id hFieldDelimitedCnvId; + VARCHAR vFieldDelimitedCnvAttr[IMRD_CNV_ATTR_SIZE]; + + short hIndFieldId; + short hIndFieldName; + short hIndFieldValueid; + short hIndFieldExist; + short hIndFieldFixedOffset; + short hIndFieldFixedSize; + short hIndFieldFixedDefVal; + short hIndFieldFixedCnvId; + short hIndFieldFixedCnvAttr; + short hIndFieldFmlTag; + short hIndFieldFmlDefVal; + short hIndFieldFmlCnvId; + short hIndFieldFmlCnvAttr; + short hIndFieldXmlTag; + short hIndFieldXmlDefVal; + short hIndFieldXmlCnvId; + short hIndFieldXmlCnvAttr; + short hIndFieldTaggedTag; + short hIndFieldTaggedDefVal; + short hIndFieldTaggedCnvId; + short hIndFieldTaggedCnvAttr; + short hIndFieldInternalTag; + short hIndFieldInternalDefVal; + short hIndFieldInternalCnvId; + short hIndFieldInternalCnvAttr; + short hIndFieldDelimitedId; + short hIndFieldDelimitedDefVal; + short hIndFieldDelimitedCnvId; + short hIndFieldDelimitedCnvAttr; + EXEC SQL END DECLARE SECTION; + + status = IMRS_OK; + + EXEC SQL DECLARE cur_imr_field CURSOR FOR + SELECT IMR_FIELD.FIELD_ID, + IMR_FIELD.FIELD_NAME, + IMR_FIELD.FIELD_VALUEID, + IMR_FIELD.FIELD_EXIST, + IMR_FIXEDFIELD.FIXED_FIELD_OFFSET, + IMR_FIXEDFIELD.FIXED_FIELD_SIZE, + IMR_FIXEDFIELD.FIXED_FIELD_CNV_ID, + IMR_FIXEDFIELD.FIXED_FIELD_CNV_ATTR, + IMR_FIXEDFIELD.FIXED_FIELD_DEF_VAL, + IMR_FMLFIELD.FML_FIELD_TAG, + IMR_FMLFIELD.FML_FIELD_CNV_ID, + IMR_FMLFIELD.FML_FIELD_CNV_ATTR, + IMR_FMLFIELD.FML_FIELD_DEF_VAL, + IMR_XMLFIELD.XML_FIELD_TAG, + IMR_XMLFIELD.XML_FIELD_CNV_ID, + IMR_XMLFIELD.XML_FIELD_CNV_ATTR, + IMR_XMLFIELD.XML_FIELD_DEF_VAL, + IMR_TAGGEDFIELD.TAGGED_FIELD_TAG, + IMR_TAGGEDFIELD.TAGGED_FIELD_CNV_ID, + IMR_TAGGEDFIELD.TAGGED_FIELD_CNV_ATTR, + IMR_TAGGEDFIELD.TAGGED_FIELD_DEF_VAL, + IMR_INTERNALFIELD.INTERNAL_FIELD_TAG, + IMR_INTERNALFIELD.INTERNAL_FIELD_CNV_ID, + IMR_INTERNALFIELD.INTERNAL_FIELD_CNV_ATTR, + IMR_INTERNALFIELD.INTERNAL_FIELD_DEF_VAL, + IMR_DELIMITEDFIELD.DELIMITED_FIELD_ID, + IMR_DELIMITEDFIELD.DELIMITED_FIELD_CNV_ID, + IMR_DELIMITEDFIELD.DELIMITED_FIELD_CNV_ATTR, + IMR_DELIMITEDFIELD.DELIMITED_FIELD_DEF_VAL + FROM IMR_FIELD, IMR_FIXEDFIELD, IMR_FMLFIELD, IMR_XMLFIELD, + IMR_TAGGEDFIELD, IMR_INTERNALFIELD, IMR_DELIMITEDFIELD + WHERE IMR_FIELD.FIELD_ID = IMR_FIXEDFIELD.FIELD_ID(+) + AND IMR_FIELD.FIELD_ID = IMR_FMLFIELD.FIELD_ID(+) + AND IMR_FIELD.FIELD_ID = IMR_XMLFIELD.FIELD_ID(+) + AND IMR_FIELD.FIELD_ID = IMR_TAGGEDFIELD.FIELD_ID(+) + AND IMR_FIELD.FIELD_ID = IMR_INTERNALFIELD.FIELD_ID(+) + AND IMR_FIELD.FIELD_ID = IMR_DELIMITEDFIELD.FIELD_ID(+) + AND IMR_FIELD.MSG_ID = :myMsg_Ptr->Id; + + EXEC SQL OPEN cur_imr_field; + do + { + memset(vFieldName.arr, '\0', (size_t) IMRD_NAME_SIZE); + memset(vFieldValueid.arr, '\0', (size_t) IMRD_VALUE_ID_SIZE); + memset(vFieldExist.arr, '\0', (size_t) IMRD_EXIST_SIZE); + memset(vFieldFixedDefVal.arr, '\0', (size_t) IMRD_VALUE_SIZE); + memset(vFieldFixedCnvAttr.arr, '\0', (size_t) IMRD_CNV_ATTR_SIZE); + memset(vFieldFmlTag.arr, '\0', (size_t) IMRD_FML_TAG_SIZE); + memset(vFieldFmlDefVal.arr, '\0', (size_t) IMRD_VALUE_SIZE); + memset(vFieldFmlCnvAttr.arr, '\0', (size_t) IMRD_CNV_ATTR_SIZE); + memset(vFieldXmlTag.arr, '\0', (size_t) IMRD_XML_TAG_SIZE); + memset(vFieldXmlDefVal.arr, '\0', (size_t) IMRD_VALUE_SIZE); + memset(vFieldXmlCnvAttr.arr, '\0', (size_t) IMRD_CNV_ATTR_SIZE); + memset(vFieldTaggedTag.arr, '\0', (size_t) IMRD_TAGGED_TAG_SIZE); + memset(vFieldTaggedDefVal.arr, '\0', (size_t) IMRD_VALUE_SIZE); + memset(vFieldTaggedCnvAttr.arr, '\0', (size_t) IMRD_CNV_ATTR_SIZE); + memset(vFieldInternalTag.arr, '\0', (size_t) IMRD_INTERNAL_TAG_SIZE); + memset(vFieldInternalDefVal.arr, '\0', (size_t) IMRD_VALUE_SIZE); + memset(vFieldInternalCnvAttr.arr, '\0', (size_t) IMRD_CNV_ATTR_SIZE); + memset(vFieldDelimitedDefVal.arr, '\0', (size_t) IMRD_VALUE_SIZE); + memset(vFieldDelimitedCnvAttr.arr, '\0', (size_t) IMRD_CNV_ATTR_SIZE); + + EXEC SQL FETCH cur_imr_field + INTO :hFieldId:hIndFieldId, + :vFieldName:hIndFieldName, + :vFieldValueid:hIndFieldValueid, + :vFieldExist:hIndFieldExist, + :hFieldFixedOffset:hIndFieldFixedOffset, + :hFieldFixedSize:hIndFieldFixedSize, + :hFieldFixedCnvId:hIndFieldFixedCnvId, + :vFieldFixedCnvAttr:hIndFieldFixedCnvAttr, + :vFieldFixedDefVal:hIndFieldFixedDefVal, + :vFieldFmlTag:hIndFieldFmlTag, + :hFieldFmlCnvId:hIndFieldFmlCnvId, + :vFieldFmlCnvAttr:hIndFieldFmlCnvAttr, + :vFieldFmlDefVal:hIndFieldFmlDefVal, + :vFieldXmlTag:hIndFieldXmlTag, + :hFieldXmlCnvId:hIndFieldXmlCnvId, + :vFieldXmlCnvAttr:hIndFieldXmlCnvAttr, + :vFieldXmlDefVal:hIndFieldXmlDefVal, + :vFieldTaggedTag:hIndFieldTaggedTag, + :hFieldTaggedCnvId:hIndFieldTaggedCnvId, + :vFieldTaggedCnvAttr:hIndFieldTaggedCnvAttr, + :vFieldTaggedDefVal:hIndFieldTaggedDefVal, + :vFieldInternalTag:hIndFieldInternalTag, + :hFieldInternalCnvId:hIndFieldInternalCnvId, + :vFieldInternalCnvAttr:hIndFieldInternalCnvAttr, + :vFieldInternalDefVal:hIndFieldInternalDefVal, + :hFieldDelimitedId:hIndFieldDelimitedId, + :hFieldDelimitedCnvId:hIndFieldDelimitedCnvId, + :vFieldDelimitedCnvAttr:hIndFieldDelimitedCnvAttr, + :vFieldDelimitedDefVal:hIndFieldDelimitedDefVal; + + if (sqlca.sqlcode == 0) + { + /* Allacation de ListField */ + nd_status = ND_Value_Alloc( myMsg_Ptr->Field_Struct_Ptr, (void **)&(myField_Ptr)); + if (nd_status != NDS_OK) + { + IMRD_LM_LOG_ERROR_2( "%s : ND_Value_Alloc -- Field failed (%d) !", sFunctionName, nd_status); + status = IMRS_KO; + } + else + { + /* Ajout du Field */ + myField_Ptr->Id = hFieldId; + strcpy(myField_Ptr->Name, (char *) vFieldName.arr); + if (hIndFieldValueid >= 0) + strcpy(myField_Ptr->Value_Id, (char *) vFieldValueid.arr); + if (hIndFieldExist >= 0) + { + if(vFieldExist.arr[0] == IMRD_YES) + { + myField_Ptr->Exist = IMRD_TRUE; + } + else + { + myField_Ptr->Exist = IMRD_FALSE; + } + } + + if (hIndFieldFixedOffset >= 0) + myField_Ptr->Fixed.Offset = hFieldFixedOffset; + if (hIndFieldFixedSize >= 0) + myField_Ptr->Fixed.Size = hFieldFixedSize; + if (hIndFieldFixedDefVal >= 0) + strcpy(myField_Ptr->Fixed.Def_Val, (char *) vFieldFixedDefVal.arr); + if (hIndFieldFixedCnvId >= 0) + { + myCnv.Id = hFieldFixedCnvId; + if(((nd_status = ND_Index_Node_Find( &node_ptr, IMRG_SDM_Base.RootCnv, + IMRD_SDMD_CNV_IDX_ID, &myCnv, NULL)) != NDS_OK)|| + (node_ptr == NULL)) + { + IMRD_LM_LOG_ERROR_1( "Erreur lors de la recherche de Cnv <%d> !", myCnv.Id); + status = IMRS_KO; + } + else + { + myField_Ptr->Fixed.Cnv_Ptr = node_ptr->Value; + } + } + + if (hIndFieldFixedCnvAttr >= 0) + strcpy(myField_Ptr->Fixed.Cnv_Attr, (char *) vFieldFixedCnvAttr.arr); + + if (hIndFieldFmlTag >= 0) + strcpy(myField_Ptr->FML.Tag, (char *) vFieldFmlTag.arr); + if (hIndFieldFmlDefVal >= 0) + strcpy(myField_Ptr->FML.Def_Val, (char *) vFieldFmlDefVal.arr); + if (hIndFieldFmlCnvId >= 0) + { + myCnv.Id = hFieldFmlCnvId; + if(((nd_status = ND_Index_Node_Find( &node_ptr, IMRG_SDM_Base.RootCnv, + IMRD_SDMD_CNV_IDX_ID, &myCnv, NULL)) != NDS_OK)|| + (node_ptr == NULL)) + { + IMRD_LM_LOG_ERROR_1( "Erreur lors de la recherche de Cnv <%d> !", myCnv.Id); + status = IMRS_KO; + } + else + { + myField_Ptr->FML.Cnv_Ptr = node_ptr->Value; + } + } + if (hIndFieldFmlCnvAttr >= 0) + strcpy(myField_Ptr->FML.Cnv_Attr, (char *) vFieldFmlCnvAttr.arr); + + if (hIndFieldXmlTag >= 0) + strcpy(myField_Ptr->XML.Tag, (char *) vFieldXmlTag.arr); + if (hIndFieldXmlDefVal >= 0) + strcpy(myField_Ptr->XML.Def_Val, (char *) vFieldXmlDefVal.arr); + if (hIndFieldXmlCnvId >= 0) + { + myCnv.Id = hFieldXmlCnvId; + if(((nd_status = ND_Index_Node_Find( &node_ptr, IMRG_SDM_Base.RootCnv, + IMRD_SDMD_CNV_IDX_ID, &myCnv, NULL)) != NDS_OK)|| + (node_ptr == NULL)) + { + IMRD_LM_LOG_ERROR_1( "Erreur lors de la recherche de Cnv <%d> !", myCnv.Id); + status = IMRS_KO; + } + else + { + myField_Ptr->XML.Cnv_Ptr = node_ptr->Value; + } + } + if (hIndFieldXmlCnvAttr >= 0) + strcpy(myField_Ptr->XML.Cnv_Attr, (char *) vFieldXmlCnvAttr.arr); + + if (hIndFieldTaggedTag >= 0) + strcpy(myField_Ptr->Tagged.Tag, (char *) vFieldTaggedTag.arr); + if (hIndFieldTaggedDefVal >= 0) + strcpy(myField_Ptr->Tagged.Def_Val, (char *) vFieldTaggedDefVal.arr); + if (hIndFieldTaggedCnvId >= 0) + { + myCnv.Id = hFieldTaggedCnvId; + if(((nd_status = ND_Index_Node_Find( &node_ptr, IMRG_SDM_Base.RootCnv, + IMRD_SDMD_CNV_IDX_ID, &myCnv, NULL)) != NDS_OK)|| + (node_ptr == NULL)) + { + IMRD_LM_LOG_ERROR_1( "Erreur lors de la recherche de Cnv <%d> !", myCnv.Id); + status = IMRS_KO; + } + else + { + myField_Ptr->Tagged.Cnv_Ptr = node_ptr->Value; + } + } + if (hIndFieldTaggedCnvAttr >= 0) + strcpy(myField_Ptr->Tagged.Cnv_Attr, (char *) vFieldTaggedCnvAttr.arr); + + if (hIndFieldInternalTag >= 0) + strcpy(myField_Ptr->Internal.Tag, (char *) vFieldInternalTag.arr); + if (hIndFieldInternalDefVal >= 0) + strcpy(myField_Ptr->Internal.Def_Val, (char *) vFieldInternalDefVal.arr); + if (hIndFieldInternalCnvId >= 0) + { + myCnv.Id = hFieldInternalCnvId; + if(((nd_status = ND_Index_Node_Find( &node_ptr, IMRG_SDM_Base.RootCnv, + IMRD_SDMD_CNV_IDX_ID, &myCnv, NULL)) != NDS_OK)|| + (node_ptr == NULL)) + { + IMRD_LM_LOG_ERROR_1( "Erreur lors de la recherche de Cnv <%d> !", myCnv.Id); + status = IMRS_KO; + } + else + { + myField_Ptr->Internal.Cnv_Ptr = node_ptr->Value; + } + } + if (hIndFieldInternalCnvAttr >= 0) + strcpy(myField_Ptr->Internal.Cnv_Attr, (char *) vFieldInternalCnvAttr.arr); + + if (hIndFieldDelimitedId >= 0) + myField_Ptr->Delimited.Id = hFieldDelimitedId; + if (hIndFieldDelimitedDefVal >= 0) + strcpy(myField_Ptr->Delimited.Def_Val, (char *) vFieldDelimitedDefVal.arr); + if (hIndFieldDelimitedCnvId >= 0) + { + myCnv.Id = hFieldDelimitedCnvId; + if(((nd_status = ND_Index_Node_Find( &node_ptr, IMRG_SDM_Base.RootCnv, + IMRD_SDMD_CNV_IDX_ID, &myCnv, NULL)) != NDS_OK)|| + (node_ptr == NULL)) + { + IMRD_LM_LOG_ERROR_1( "Erreur lors de la recherche de Cnv <%d> !", myCnv.Id); + status = IMRS_KO; + } + else + { + myField_Ptr->Delimited.Cnv_Ptr = node_ptr->Value; + } + } + if (hIndFieldDelimitedCnvAttr >= 0) + strcpy(myField_Ptr->Delimited.Cnv_Attr, (char *) vFieldDelimitedCnvAttr.arr); + + nd_status = ND_DataStruct_Value_Add( myMsg_Ptr->Field_Struct_Ptr, (void *)(myField_Ptr)); + if (nd_status != NDS_OK) + { + IMRD_LM_LOG_ERROR_2( "%s : ND_DataStruct_Value_Add -- Field failed (%d) !", sFunctionName, nd_status); + status = IMRS_KO; + } + } + } + } while((sqlca.sqlcode == 0)&&(nd_status == NDS_OK)&&(status == IMRS_OK)); + + if(status != IMRS_OK) + { + free(myField_Ptr); + } + + if (sqlca.sqlcode < 0) + { + IMRD_LM_LOG_ERROR_3( "Erreur %s. Erreur Oracle : %d - %s !", sFunctionName, sqlca.sqlcode, sqlca.sqlerrm.sqlerrmc); + status = IMRS_KO; + } + + EXEC SQL CLOSE cur_imr_field; + + return(status); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_SQL_Dump_Msg_Header(FILE *dump_file) +{ + fprintf(dump_file, "---------------------------------------------------------\n"); + fprintf(dump_file, "-- Init file of IMR_MSG & IMR_FIELD & IMR_FMLFIELD --\n"); + fprintf(dump_file, "-- IMR_XMLFIELD & IMR_DELIMITEDFIELD --\n"); + fprintf(dump_file, "-- IMR_FIXEDFIELD & IMR_TAGGEDFIELD --\n"); + fprintf(dump_file, "-- IMR_INTERNALFIELD --\n"); + fprintf(dump_file, "---------------------------------------------------------\n\n"); + fprintf(dump_file, "INSERT INTO IMR_DATA_VERSION(VERS_NAME, VERS_LABEL, VERS_DATE) VALUES('Msg-Field', '%s', '%s');\n\n", + ((IMRT_Data_Version *)IMRG_SDM_Base.RootMsg->User_Ptr)->Label, + ((IMRT_Data_Version *)IMRG_SDM_Base.RootMsg->User_Ptr)->Date); + fprintf(dump_file, "Delete IMR_INTERNALFIELD;\n\n"); + fprintf(dump_file, "Delete IMR_TAGGEDFIELD;\n\n"); + fprintf(dump_file, "Delete IMR_FIXEDFIELD;\n\n"); + fprintf(dump_file, "Delete IMR_DELIMITEDFIELD;\n\n"); + fprintf(dump_file, "Delete IMR_XMLFIELD;\n\n"); + fprintf(dump_file, "Delete IMR_FMLFIELD;\n\n"); + fprintf(dump_file, "Delete IMR_FIELD;\n\n"); + fprintf(dump_file, "Delete IMR_MSG;\n\n"); + return( IMRS_OK); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_SQL_Dump_Msg_Body(FILE *dump_file) +{ + IMRT_Status status; + NDT_Status nd_status; + + if( ( nd_status = ND_DataStruct_Traverse( IMRG_SDM_Base.RootMsg, IMRD_SDMD_CMD_API_SQL_DUMP, dump_file)) != NDS_OK) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0( "SQL Dump RootMsg failed !"); + } + else + { + status = IMRS_OK; + } + + return(status); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_SQL_Dump_Msg_Footer(FILE *dump_file) +{ + fprintf(dump_file, "\nCommit;\n"); + return( IMRS_OK); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_SQL_Dump_Msg(void) +{ + IMRT_Status status; + char dump_filename[255]; + FILE *dump_file; + + strcpy(dump_filename, "init_imr_msg.sql"); + + if( ( dump_file = fopen( dump_filename, "w")) == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_1( "Can't open dump file (%s) !", dump_filename); + } + else + { + status = SDM_SQL_Dump_Msg_Header(dump_file); + if(status == IMRS_OK) + { + status = SDM_SQL_Dump_Msg_Body(dump_file); + if(status == IMRS_OK) + { + status = SDM_SQL_Dump_Msg_Footer(dump_file); + } + } + + fclose( dump_file); + } + + return(status); + +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_SQL_Dump_Cnv_Header(FILE *dump_file) +{ + fprintf(dump_file, "---------------------------------------------------\n"); + fprintf(dump_file, "-- Init file of IMR_CNV --\n"); + fprintf(dump_file, "---------------------------------------------------\n\n"); + fprintf(dump_file, "INSERT INTO IMR_DATA_VERSION(VERS_NAME, VERS_LABEL, VERS_DATE) VALUES('Cnv', '%s', '%s');\n\n", + ((IMRT_Data_Version *)IMRG_SDM_Base.RootCnv->User_Ptr)->Label, + ((IMRT_Data_Version *)IMRG_SDM_Base.RootCnv->User_Ptr)->Date); + fprintf(dump_file, "Delete IMR_CNV;\n\n"); + return( IMRS_OK); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_SQL_Dump_Cnv_Body(FILE *dump_file) +{ + IMRT_Status status; + NDT_Status nd_status; + + if( ( nd_status = ND_DataStruct_Traverse( IMRG_SDM_Base.RootCnv, IMRD_SDMD_CMD_API_SQL_DUMP, dump_file)) != NDS_OK) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_0( "SQL Dump RootCnv failed !"); + } + else + { + status = IMRS_OK; + } + + return(status); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_SQL_Dump_Cnv_Footer(FILE *dump_file) +{ + fprintf(dump_file, "\nCommit;\n"); + return( IMRS_OK); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_SQL_Dump_Cnv(void) +{ + IMRT_Status status; + char dump_filename[255]; + FILE *dump_file; + + strcpy(dump_filename, "init_imr_cnv.sql"); + + if( ( dump_file = fopen( dump_filename, "w")) == NULL) + { + status = IMRS_KO; + IMRD_LM_LOG_ERROR_1( "Can't open dump file (%s) !", dump_filename); + } + else + { + status = SDM_SQL_Dump_Cnv_Header(dump_file); + if(status == IMRS_OK) + { + status = SDM_SQL_Dump_Cnv_Body(dump_file); + if(status == IMRS_OK) + { + status = SDM_SQL_Dump_Cnv_Footer(dump_file); + } + } + + fclose( dump_file); + } + + return(status); + +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_SQL_StructInfo_Dump(void) +{ + IMRT_Status status; + + status = SDM_SQL_Dump_Cnv(); + if(status == IMRS_OK) + { + status = SDM_SQL_Dump_Msg(); + } + + return(status); + +} + +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ diff --git a/src/libstatic_data_mng/src/struct_info_xml.c b/src/libstatic_data_mng/src/struct_info_xml.c new file mode 100644 index 0000000..7c4fb87 --- /dev/null +++ b/src/libstatic_data_mng/src/struct_info_xml.c @@ -0,0 +1,943 @@ +/*----------------------------------------------------------------------------*/ +/* File: struct_info_xml.c */ +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#define _LIBSTATIC_DATA_MNG_ +#define _STRUCT_INFO_XML_C_ + +#include "struct_info_xml.h" + + +IMRT_Status SDM_XML_StructInfo_Init(IMRT_Path Lib_Path) +{ + SDMT_StructInfo_Contexte StructInfo_Ctx; + IMRT_Status status, StatusTmp; + char Xml_File_Name[255]; + + StructInfo_Ctx.flagerror = 0; + StructInfo_Ctx.CptCnv = IMRD_CNV_ID_UNKNOWN; + + + + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_0, "Loading Cnv..."); + + memset(Xml_File_Name,0,sizeof(Xml_File_Name)); + strcpy(Xml_File_Name, Lib_Path); + strcat(Xml_File_Name, "/"); + strcat(Xml_File_Name, SDMD_CNV_FILE); + status = SDM_XML_Load_Cnv((char *)Xml_File_Name, &(StructInfo_Ctx)); + if(status != IMRS_OK) + { + IMRD_LM_LOG_ERROR_0( "Can't load Cnv !"); + } + else + { + IMRG_SDM_Base.RootCnv = StructInfo_Ctx.RootCnv; + + IMRD_LM_LOG_INFO_1( "Cnv loaded: (%d)", IMRG_SDM_Base.RootCnv->Index_Tab[NDD_INDEX_PRIMARY].Node_Number); + + StructInfo_Ctx.CptMsg = IMRD_MSG_ID_UNKNOWN; + StructInfo_Ctx.CptField = IMRD_FIELD_ID_UNKNOWN; + memset(StructInfo_Ctx.PathArray,0,sizeof(StructInfo_Ctx.PathArray)); + StructInfo_Ctx.PresentLevelTag = IMRD_SDMD_MIN_LEVEL_TAG; + + IMRD_LM_LOG_TRACE_0( IMRD_LOG_LEVEL_VERBOSE_0, "Loading Msg and Field..."); + + memset(Xml_File_Name,0,sizeof(Xml_File_Name)); + strcpy(Xml_File_Name, Lib_Path); + strcat(Xml_File_Name, "/"); + strcat(Xml_File_Name, SDMD_MSGFIELD_FILE); + + status = SDM_XML_Load_MsgAndField((char *)Xml_File_Name, &(StructInfo_Ctx)); + + if(status != IMRS_OK) + { + IMRD_LM_LOG_ERROR_0( "Can't load Msg and Field !"); + StatusTmp = SDM_Close_RootCnv(); + } + else + { + IMRG_SDM_Base.RootMsg = StructInfo_Ctx.RootMessage; + + IMRD_LM_LOG_INFO_1( "Msg and Field loaded: (%d)", IMRG_SDM_Base.RootMsg->Index_Tab[NDD_INDEX_PRIMARY].Node_Number); + } + } + + return(status); + +} + + +static IMRT_Status error(SDMT_StructInfo_Contexte *ctx , const char *msg, ...) +{ + xmlParserCtxt * SaxCtx; + + SaxCtx = ctx->SaxCtxHdl; + + IMRD_LM_LOG_ERROR_1( "CallBack error: <%s> !",msg); + + SaxCtx->sax = &ErrorSAXHandlerStruct; + ctx->flagerror = 1; + ctx->FataError.errorCode = SDMD_XML_CODE_ERROR_1; + strcpy(ctx->FataError.libError,msg) ; +} + + +IMRT_Status startElementNsCnv( SDMT_StructInfo_Contexte * ctx , + const xmlChar *localname, + const xmlChar *prefix, + const xmlChar *URI, + int nb_namespaces, + const xmlChar **namespaces, + int nb_attributes, + int nb_defaulted, + const xmlChar **attributes) +{ + NDT_Status status; + + if(strcmp((const char*)localname,IMRD_SDMD_TAG_CNV) == 0) + { + /*création d'un nouvelle objet Cnv*/ + if( ( status = ND_Value_Alloc( ctx->RootCnv, (void **)&(ctx->CurrentCnv)) != NDS_OK)) + { + IMRD_LM_LOG_ERROR_1( "ND_Value_Alloc() failed (%d) !", status); + } + } + +} + + +IMRT_Status startElementNS( SDMT_StructInfo_Contexte * ctx , + const xmlChar *localname, + const xmlChar *prefix, + const xmlChar *URI, + int nb_namespaces, + const xmlChar **namespaces, + int nb_attributes, + int nb_defaulted, + const xmlChar **attributes) +{ + NDT_Status status; + char DescErr[IMRD_SDMD_DESCERR_LEN]; + const char fonctionname [] = "startElementNS"; + + + if(strcmp((const char *)localname, IMRD_SDMD_TAG_MESSAGE) == 0) + { + /*création d'un objet msg*/ + if( ( status = ND_Value_Alloc( ctx->RootMessage, (void **)&(ctx->CurrentMessage))) != NDS_OK) + { + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_3,IMRD_SDMD_TAG_MESSAGE); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), fonctionname , DescErr,SDMD_XML_CODE_ERROR_3); + } + + ctx->PresentLevelTag = ctx->PresentLevelTag + 1; + strcpy(ctx->PathArray[ctx->PresentLevelTag], (char*)localname); + } + else if (strcmp((const char *)localname, IMRD_SDMD_TAG_FIELD) == 0) + { + if( ( status = ND_Value_Alloc( ctx->CurrentMessage->Field_Struct_Ptr, (void **)&(ctx->CurrentField))) != NDS_OK) + { + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_3,IMRD_SDMD_TAG_MESSAGE); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), fonctionname , DescErr, SDMD_XML_CODE_ERROR_3 ); + } + ctx->PresentLevelTag = ctx->PresentLevelTag + 1; + strcpy(ctx->PathArray[ctx->PresentLevelTag], (char*)localname); + } + else if ((strcmp((const char *)localname, IMRD_SDMD_TAG_FIXED) == 0) || + (strcmp((const char *)localname, IMRD_SDMD_TAG_INTERNE) == 0) || + (strcmp((const char *)localname, IMRD_SDMD_TAG_TAGGED) == 0) || + (strcmp((const char *)localname, IMRD_SDMD_TAG_XML) == 0) || + (strcmp((const char *)localname, IMRD_SDMD_TAG_DELIMITED)== 0) || + (strcmp((const char *)localname, IMRD_SDMD_TAG_FML) == 0) + ) + { + ctx->PresentLevelTag = ctx->PresentLevelTag + 1; + strcpy(ctx->PathArray[ctx->PresentLevelTag], (char*)localname); + } + else if (strcmp((const char *)localname, IMRD_SDMD_TAG_CNV) == 0) + { + ctx->PresentLevelTag = ctx->PresentLevelTag + 1; + strcpy(ctx->PathArray[ctx->PresentLevelTag], (char*)localname); + } + +} + + +IMRT_Status endElementNsCnv( SDMT_StructInfo_Contexte * ctx, + const xmlChar *localname, + const xmlChar *prefix, + const xmlChar *URI) +{ + IMRT_Status status_tmp; + NDT_Status status; + const char fonctionname [] ="endElementNsCnv"; + char DescErr[IMRD_SDMD_DESCERR_LEN]; + + if(strcmp((const char*)localname, IMRD_SDMD_TAG_CNV) == 0) + { + ctx->CurrentCnv->Id = ctx->CptCnv; + if( ( status = ND_DataStruct_Value_Add( ctx->RootCnv, (void *)(ctx->CurrentCnv))) != NDS_OK) + { + IMRD_LM_LOG_ERROR_1( "ND_Value_Alloc() failed (%d) !", status); + + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_3,IMRD_SDMD_TAG_CNV); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), fonctionname , DescErr, SDMD_XML_CODE_ERROR_3 ); + } + ctx->CptCnv ++; + } + + if(strcmp((const char*)localname, IMRD_SDMD_TAG_NAME) == 0) + { + strcpy(ctx->CurrentCnv->Name, ctx->value); + } + else if (strcmp((const char *)localname, IMRD_SDMD_TAG_VERSION) == 0) + { + IMRD_LM_LOG_INFO_1( "[Cnv]: [%s]", ctx->value); + status_tmp = SDM_Set_Struct_Version((IMRT_Data_Version *)ctx->RootCnv->User_Ptr, (char *)ctx->value); + } +} + + +IMRT_Status endElementNS( SDMT_StructInfo_Contexte * ctx, + const xmlChar *localname, + const xmlChar *prefix, + const xmlChar *URI) +{ + IMRT_Status status_tmp; + NDT_Status status; + xmlParserCtxt * SaxCtx; + char DescErr[IMRD_SDMD_DESCERR_LEN]; + const char fonctionname [] = "endElementNS"; + NDT_Node *node_ptr; + IMRT_Cnv myCnv; + NDT_Status nd_status; + NDT_Index_Type *index_type_ptr; + + if (strcmp((const char *)localname, IMRD_SDMD_TAG_NAME) == 0) + { + switch(ctx->PresentLevelTag) + { + case IMRD_SDMD_LEVEL_TAG_0: + { + strcpy(ctx->CurrentMessage->Name, ctx->value); + break; + } + case IMRD_SDMD_LEVEL_TAG_1: + { + strcpy(ctx->CurrentField->Name, ctx->value); + break; + } + case IMRD_SDMD_LEVEL_TAG_2: + { + if(strcmp(ctx->PathArray[ctx->PresentLevelTag], IMRD_SDMD_TAG_INTERNE) == 0) + { + strcpy(ctx->CurrentField->Internal.Tag, ctx->value); + } + else if(strcmp(ctx->PathArray[ctx->PresentLevelTag], IMRD_SDMD_TAG_TAGGED) == 0) + { + strcpy(ctx->CurrentField->Tagged.Tag, ctx->value); + } + else if(strcmp(ctx->PathArray[ctx->PresentLevelTag], IMRD_SDMD_TAG_XML) == 0) + { + strcpy(ctx->CurrentField->XML.Tag, ctx->value); + } + else if(strcmp(ctx->PathArray[ctx->PresentLevelTag], IMRD_SDMD_TAG_FML) == 0) + { + strcpy(ctx->CurrentField->FML.Tag, ctx->value); + } + + break; + } + case IMRD_SDMD_LEVEL_TAG_3: + { + if(strcmp(ctx->PathArray[ctx->PresentLevelTag-1], IMRD_SDMD_TAG_FIXED) == 0) + { + strcpy(myCnv.Name, ctx->value); + if(((nd_status = ND_Index_Node_Find( &node_ptr, ctx->RootCnv, + IMRD_SDMD_CNV_IDX_NAME, &myCnv, NULL)) != NDS_OK)|| + (node_ptr == NULL)) + { + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_4,IMRD_SDMD_TAG_CNV, myCnv.Name ); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), fonctionname , DescErr, SDMD_XML_CODE_ERROR_4 ); + } + else + { + ctx->CurrentField->Fixed.Cnv_Ptr = node_ptr->Value; + } + } + else if(strcmp(ctx->PathArray[ctx->PresentLevelTag-1], IMRD_SDMD_TAG_INTERNE) == 0) + { + strcpy(myCnv.Name, ctx->value); + if(((nd_status = ND_Index_Node_Find( &node_ptr, ctx->RootCnv, + IMRD_SDMD_CNV_IDX_NAME, &myCnv, NULL)) != NDS_OK)|| + (node_ptr == NULL)) + { + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_4,IMRD_SDMD_TAG_CNV, myCnv.Name ); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), fonctionname , DescErr, SDMD_XML_CODE_ERROR_4 ); + } + else + { + ctx->CurrentField->Internal.Cnv_Ptr = node_ptr->Value; + } + } + else if(strcmp(ctx->PathArray[ctx->PresentLevelTag-1], IMRD_SDMD_TAG_TAGGED) == 0) + { + strcpy(myCnv.Name, ctx->value); + if(((nd_status = ND_Index_Node_Find( &node_ptr, ctx->RootCnv, + IMRD_SDMD_CNV_IDX_NAME, &myCnv, NULL)) != NDS_OK)|| + (node_ptr == NULL)) + { + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_4,IMRD_SDMD_TAG_CNV, myCnv.Name ); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), fonctionname , DescErr, SDMD_XML_CODE_ERROR_4 ); + } + else + { + ctx->CurrentField->Tagged.Cnv_Ptr = node_ptr->Value; + } + } + else if(strcmp(ctx->PathArray[ctx->PresentLevelTag-1], IMRD_SDMD_TAG_XML) == 0) + { + strcpy(myCnv.Name, ctx->value); + if(((nd_status = ND_Index_Node_Find( &node_ptr, ctx->RootCnv, + IMRD_SDMD_CNV_IDX_NAME, &myCnv, NULL)) != NDS_OK)|| + (node_ptr == NULL)) + { + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_4,IMRD_SDMD_TAG_CNV, myCnv.Name ); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), fonctionname , DescErr, SDMD_XML_CODE_ERROR_4 ); + } + else + { + ctx->CurrentField->XML.Cnv_Ptr = node_ptr->Value; + } + } + else if(strcmp(ctx->PathArray[ctx->PresentLevelTag-1], IMRD_SDMD_TAG_FML) == 0) + { + strcpy(myCnv.Name, ctx->value); + if(((nd_status = ND_Index_Node_Find( &node_ptr, ctx->RootCnv, + IMRD_SDMD_CNV_IDX_NAME, &myCnv, NULL)) != NDS_OK)|| + (node_ptr == NULL)) + { + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_4,IMRD_SDMD_TAG_CNV, myCnv.Name ); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), fonctionname , DescErr, SDMD_XML_CODE_ERROR_4 ); + } + else + { + ctx->CurrentField->FML.Cnv_Ptr = node_ptr->Value; + } + } + else if(strcmp(ctx->PathArray[ctx->PresentLevelTag-1], IMRD_SDMD_TAG_DELIMITED) == 0) + { + strcpy(myCnv.Name, ctx->value); + if(((nd_status = ND_Index_Node_Find( &node_ptr, ctx->RootCnv, + IMRD_SDMD_CNV_IDX_NAME, &myCnv, NULL)) != NDS_OK)|| + (node_ptr == NULL)) + { + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_4,IMRD_SDMD_TAG_CNV, myCnv.Name ); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), fonctionname , DescErr, SDMD_XML_CODE_ERROR_4 ); + } + else + { + ctx->CurrentField->Delimited.Cnv_Ptr = node_ptr->Value; + } + } + + break; + } + default: + { + snprintf(DescErr, sizeof(DescErr), SDMD_XML_LIB_ERROR_10, SDMD_MSGFIELD_FILE); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), fonctionname , DescErr, SDMD_XML_CODE_ERROR_10); + } + } /* end switch */ + } + else if (strcmp((const char *)localname, IMRD_SDMD_TAG_SIZE) == 0) + { + switch(ctx->PresentLevelTag) + { + case IMRD_SDMD_LEVEL_TAG_0: + { + ctx->CurrentMessage->Size = atoi(ctx->value); + break; + } + case IMRD_SDMD_LEVEL_TAG_2: + { + ctx->CurrentField->Fixed.Size = atoi(ctx->value); + break; + } + default: + { + snprintf(DescErr, sizeof(DescErr), SDMD_XML_LIB_ERROR_10, SDMD_MSGFIELD_FILE); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), fonctionname , DescErr, SDMD_XML_CODE_ERROR_10); + } + } /* end switch */ + } + else if (strcmp((const char *)localname, IMRD_SDMD_TAG_ATTRIBUTE) == 0) + { + switch(ctx->PresentLevelTag) + { + case IMRD_SDMD_LEVEL_TAG_3: + { + if(strcmp(ctx->PathArray[ctx->PresentLevelTag-1], IMRD_SDMD_TAG_FIXED) == 0) + { + strcpy(ctx->CurrentField->Fixed.Cnv_Attr, ctx->value); + } + else if(strcmp(ctx->PathArray[ctx->PresentLevelTag-1], IMRD_SDMD_TAG_INTERNE) == 0) + { + strcpy(ctx->CurrentField->Internal.Cnv_Attr, ctx->value); + } + else if(strcmp(ctx->PathArray[ctx->PresentLevelTag-1], IMRD_SDMD_TAG_TAGGED) == 0) + { + strcpy(ctx->CurrentField->Tagged.Cnv_Attr, ctx->value); + } + else if(strcmp(ctx->PathArray[ctx->PresentLevelTag-1], IMRD_SDMD_TAG_XML) == 0) + { + strcpy(ctx->CurrentField->XML.Cnv_Attr, ctx->value); + } + else if(strcmp(ctx->PathArray[ctx->PresentLevelTag-1], IMRD_SDMD_TAG_FML) == 0) + { + strcpy(ctx->CurrentField->FML.Cnv_Attr, ctx->value); + } + else if(strcmp(ctx->PathArray[ctx->PresentLevelTag-1], IMRD_SDMD_TAG_DELIMITED) == 0) + { + strcpy(ctx->CurrentField->Delimited.Cnv_Attr, ctx->value); + } + + break; + } + default: + { + snprintf(DescErr, sizeof(DescErr), SDMD_XML_LIB_ERROR_10, SDMD_MSGFIELD_FILE); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), fonctionname , DescErr, SDMD_XML_CODE_ERROR_10); + } + } /* end switch */ + } + else if (strcmp((const char *)localname, IMRD_SDMD_TAG_DEFVAL) == 0) + { + switch(ctx->PresentLevelTag) + { + case IMRD_SDMD_LEVEL_TAG_2: + { + if(strcmp(ctx->PathArray[ctx->PresentLevelTag], IMRD_SDMD_TAG_FIXED) == 0) + { + strcpy(ctx->CurrentField->Fixed.Def_Val, ctx->value); + } + else if(strcmp(ctx->PathArray[ctx->PresentLevelTag], IMRD_SDMD_TAG_INTERNE) == 0) + { + strcpy(ctx->CurrentField->Internal.Def_Val, ctx->value); + } + else if(strcmp(ctx->PathArray[ctx->PresentLevelTag], IMRD_SDMD_TAG_TAGGED) == 0) + { + strcpy(ctx->CurrentField->Tagged.Def_Val, ctx->value); + } + else if(strcmp(ctx->PathArray[ctx->PresentLevelTag], IMRD_SDMD_TAG_XML) == 0) + { + strcpy(ctx->CurrentField->XML.Def_Val, ctx->value); + } + else if(strcmp(ctx->PathArray[ctx->PresentLevelTag], IMRD_SDMD_TAG_FML) == 0) + { + strcpy(ctx->CurrentField->FML.Def_Val, ctx->value); + } + else if(strcmp(ctx->PathArray[ctx->PresentLevelTag], IMRD_SDMD_TAG_DELIMITED) == 0) + { + strcpy(ctx->CurrentField->Delimited.Def_Val, ctx->value); + } + + break; + } + default: + { + snprintf(DescErr, sizeof(DescErr), SDMD_XML_LIB_ERROR_10, SDMD_MSGFIELD_FILE); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), fonctionname , DescErr, SDMD_XML_CODE_ERROR_10); + } + } /* end switch */ + } + else if (strcmp((const char *)localname, IMRD_SDMD_TAG_OFFSET) == 0) + { + ctx->CurrentField->Fixed.Offset = atoi(ctx->value); + } + else if (strcmp((const char *)localname, IMRD_SDMD_TAG_ID) == 0) + { + ctx->CurrentField->Delimited.Id = atoi(ctx->value); + } + else if (strcmp((const char *)localname, IMRD_SDMD_TAG_VALUEID) == 0) + { + strcpy(ctx->CurrentField->Value_Id, ctx->value); + } + else if (strcmp((const char *)localname, IMRD_SDMD_TAG_EXIST) == 0) + { + if(*(ctx->value) == IMRD_YES) + { + ctx->CurrentField->Exist = IMRD_TRUE; + } + else + { + ctx->CurrentField->Exist = IMRD_FALSE; + } + } + else if ( (strcmp((const char*)localname, IMRD_SDMD_TAG_MESSAGE)== 0) ) + { + + ctx->CurrentMessage->Id = ctx->CptMsg; + + index_type_ptr = Field_Struct_final_idx_tab; + status = SDM_DataStruct_Finalize(ctx->CurrentMessage->Field_Struct_Ptr, index_type_ptr, IMRD_SDMD_FIELD_STRUCT_IDX_NB); + if(status == IMRS_KO) + { + printf("Erreur lors de la finalisation de Field_Struct_Ptr \n"); + } + + if( ( nd_status = ND_DataStruct_Value_Add( ctx->RootMessage, (void *)(ctx->CurrentMessage))) != NDS_OK) + { + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_2,IMRD_SDMD_TAG_MESSAGE); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), fonctionname , DescErr, SDMD_XML_CODE_ERROR_2 ); + } + ctx->CptMsg++; + memset(ctx->PathArray[ctx->PresentLevelTag],0,sizeof(IMRD_SDMD_SIZE_TAG_SIZE)); + ctx->PresentLevelTag = ctx->PresentLevelTag - 1; + } + else if( (strcmp((const char*)localname, IMRD_SDMD_TAG_FIELD)== 0) ) + { + ctx->CptField++; + ctx->CurrentField->Id = ctx->CptField; + + if( ( nd_status = ND_DataStruct_Value_Add( ctx->CurrentMessage->Field_Struct_Ptr, (void *)(ctx->CurrentField))) != NDS_OK) + { + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_2,IMRD_SDMD_TAG_FIELD); + SDM_RaiseError(ctx->SaxCtxHdl,&(ctx->FataError),&(ctx->flagerror), fonctionname , DescErr, SDMD_XML_CODE_ERROR_2 ); + } + memset(ctx->PathArray[ctx->PresentLevelTag],0,sizeof(IMRD_SDMD_SIZE_TAG_SIZE)); + ctx->PresentLevelTag = ctx->PresentLevelTag - 1; + } + else if ((strcmp((const char *)localname, IMRD_SDMD_TAG_FIXED) == 0) || + (strcmp((const char *)localname, IMRD_SDMD_TAG_INTERNE) == 0) || + (strcmp((const char *)localname, IMRD_SDMD_TAG_TAGGED) == 0) || + (strcmp((const char *)localname, IMRD_SDMD_TAG_XML) == 0) || + (strcmp((const char *)localname, IMRD_SDMD_TAG_DELIMITED)== 0) || + (strcmp((const char *)localname, IMRD_SDMD_TAG_CNV) == 0) || + (strcmp((const char *)localname, IMRD_SDMD_TAG_FML) == 0) + ) + { + memset(ctx->PathArray[ctx->PresentLevelTag],0,sizeof(IMRD_SDMD_SIZE_TAG_SIZE)); + ctx->PresentLevelTag = ctx->PresentLevelTag - 1; + } + else if (strcmp((const char *)localname, IMRD_SDMD_TAG_VERSION) == 0) + { + IMRD_LM_LOG_INFO_1( "[Msg-Field]: [%s]", ctx->value); + status_tmp = SDM_Set_Struct_Version((IMRT_Data_Version *)ctx->RootMessage->User_Ptr, (char *)ctx->value); + } +} + +IMRT_Status charactersDebug(SDMT_StructInfo_Contexte * ctx , const xmlChar *ch, int len) +{ + char output[40]; + int i; + + memset(ctx->value,0, sizeof(ctx->value)); + + for (i = 0;(ivalue[i] = ch[i]; + ctx->value[i] = 0; + +} + + +IMRT_Status SDM_XML_Load_Cnv( char *demo_file, SDMT_StructInfo_Contexte *mycontexte) +{ + IMRT_Status status; + NDT_Status nd_status; + char * docname = NULL; + NDT_Index_Type *index_type_ptr; + xmlDocPtr doc = NULL; + xmlDtdPtr dtd; + xmlParserCtxtPtr ctxt =NULL; + xmlSAXHandlerPtr SAXHandler; + xmlSAXHandlerPtr SAXHandler_Sav; + const char functionname []="SDM_XML_Load_Cnv"; + char DescErr[IMRD_SDMD_DESCERR_LEN]; + IMRT_Data_Version *Data_Version_Ptr; + + LIBXML_TEST_VERSION + xmlKeepBlanksDefault(0); + xmlSAXDefaultVersion(2); + xmlLineNumbersDefault(1); + + status = IMRS_OK; + docname = demo_file; + ctxt = xmlNewParserCtxt(); + /*initialisation des indexes*/ + index_type_ptr = Appl_Struct_initial_idx_tab; + + + if(ctxt != NULL) + { + mycontexte->flagerror = IMRS_OK; + SAXHandler = &SaxCnvHandlerStruct; + mycontexte->SaxCtxHdl = ctxt; + ctxt->userData = mycontexte; + SAXHandler_Sav = ctxt->sax; + ctxt->sax = SAXHandler; + ctxt->sax2 = 1 ; + + Data_Version_Ptr = (IMRT_Data_Version *) malloc(sizeof(IMRT_Data_Version)); + Data_Version_Ptr->Label[0] = '\0'; + Data_Version_Ptr->Date[0] = '\0'; + if( ( nd_status = ND_DataStruct_Open(&(mycontexte->RootCnv),IMRD_SDMD_CNV_STRUCT_IDX_NB,index_type_ptr, "SDM_Cnv_Manager",SDM_Cnv_Manager, NULL, NULL, NULL, NULL,0, Data_Version_Ptr)) != NDS_OK) + { + status = IMRS_KO; + printf( "ND_DataStruct_Open() failed (%d) !\n", nd_status); + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_5,IMRD_SDMD_TAG_CNV); + SDM_RaiseError(mycontexte->SaxCtxHdl,&(mycontexte->FataError),&(mycontexte->flagerror), functionname, DescErr, SDMD_XML_CODE_ERROR_5 ); + } + else + { + /* DAHBI ND_DataStruct_Info_Print(stderr, mycontexte->RootCnv, NDD_RECURSIVE_MODE_PARENT_CHILD, 0, 0);*/ + doc = xmlCtxtReadFile(ctxt, docname, NULL, XML_PARSE_DTDATTR+XML_PARSE_DTDVALID); + if (ctxt->lastError.code != XML_ERR_OK) + { + status = IMRS_KO; + printf("Erreur de parsing du fichier %s.\n%s\n", docname, ctxt->lastError.message); + } + else if(mycontexte->flagerror != IMRS_OK) + { + status = IMRS_KO; + printf("%s\n", mycontexte->FataError.libError); + } + else + { + index_type_ptr = Cnv_Struct_final_idx_tab; + status = SDM_DataStruct_Finalize(mycontexte->RootCnv,index_type_ptr, IMRD_SDMD_CNV_STRUCT_IDX_NB); + /*SDM_DataStruct_Dump(mycontexte->RootCnv);*/ + } + } + + if((status != IMRS_OK)&&(mycontexte->RootCnv != NULL)) + { + if(mycontexte->CurrentCnv != NULL) + { + free(mycontexte->CurrentCnv); + } + nd_status = ND_DataStruct_Close(mycontexte->RootCnv); + } + + ctxt->sax = SAXHandler_Sav; + xmlFreeParserCtxt(ctxt); + } /* end if(ctxt != NULL) */ + else + { + status = IMRS_KO; + } + + return(status); + +} + + +IMRT_Status SDM_XML_Load_MsgAndField( char *demo_file, SDMT_StructInfo_Contexte * mycontexte) +{ + IMRT_Status status; + NDT_Status nd_status; + char * docname = NULL; + NDT_Index_Type *index_type_ptr; + xmlDocPtr doc = NULL; + xmlDtdPtr dtd; + xmlParserCtxtPtr ctxt =NULL; + xmlSAXHandlerPtr debugSAXHandler; + xmlSAXHandlerPtr SAXHandler_Sav; + const char functionname []="SDM_XML_Load_MsgAndField"; + char DescErr[IMRD_SDMD_DESCERR_LEN]; + IMRT_Data_Version *Data_Version_Ptr; + + LIBXML_TEST_VERSION + xmlKeepBlanksDefault(0); + xmlSAXDefaultVersion(2); + xmlLineNumbersDefault(1); + + status = IMRS_OK; + docname = demo_file; + ctxt = xmlNewParserCtxt(); + /*initialisation des indexes*/ + index_type_ptr = Msg_Struct_initial_idx_tab; + + if(ctxt != NULL) + { + mycontexte->flagerror = IMRS_OK; + debugSAXHandler = &debugSAXHandlerStruct; + mycontexte->SaxCtxHdl = ctxt; + ctxt->userData = mycontexte; + SAXHandler_Sav = ctxt->sax; + ctxt->sax = debugSAXHandler; + ctxt->sax2 = 1 ; + + /*xmlSetGenericErrorFunc(NULL,CatchError);*/ + Data_Version_Ptr = (IMRT_Data_Version *) malloc(sizeof(IMRT_Data_Version)); + Data_Version_Ptr->Label[0] = '\0'; + Data_Version_Ptr->Date[0] = '\0'; + if( ( nd_status = ND_DataStruct_Open(&(mycontexte->RootMessage),IMRD_SDMD_MSG_STRUCT_IDX_NB, index_type_ptr, "SDM__Msg_Manager",SDM_Msg_Manager, NULL, NULL, NULL, NULL,0, Data_Version_Ptr)) != NDS_OK) + { + status = IMRS_KO; + snprintf(DescErr,sizeof(DescErr),SDMD_XML_LIB_ERROR_5,IMRD_SDMD_TAG_MESSAGE); + SDM_RaiseError(mycontexte->SaxCtxHdl,&(mycontexte->FataError),&(mycontexte->flagerror), functionname, DescErr, SDMD_XML_CODE_ERROR_5 ); + } + else + { + doc = xmlCtxtReadFile(ctxt, docname, NULL, XML_PARSE_DTDATTR+XML_PARSE_DTDVALID); + if (ctxt->lastError.code != XML_ERR_OK) + { + status = IMRS_KO; + printf("Erreur de parsing du fichier %s.\n%s\n", docname, ctxt->lastError.message); + } + else if(mycontexte->flagerror != IMRS_OK) + { + status = IMRS_KO; + printf("%s\n", mycontexte->FataError.libError); + } + else + { + index_type_ptr = Msg_Struct_final_idx_tab; + status = SDM_DataStruct_Finalize(mycontexte->RootMessage, index_type_ptr, IMRD_SDMD_MSG_STRUCT_IDX_NB); + /*SDM_DataStruct_Dump( mycontexte->RootMessage);*/ + } + } + + if(status != IMRS_OK) + { + if( mycontexte->CurrentMessage != NULL) + { + if(mycontexte->CurrentMessage->Field_Struct_Ptr != NULL) + { + nd_status = ND_DataStruct_Close(mycontexte->CurrentMessage->Field_Struct_Ptr); + } + if( nd_status != NDS_OK) + { + free(mycontexte->CurrentMessage); + } + } + if(mycontexte->CurrentField != NULL) + { + free(mycontexte->CurrentField); + } + if(mycontexte->RootMessage != NULL) + { + nd_status = ND_DataStruct_Close(mycontexte->RootMessage); + } + /*if(mycontexte->RootCnv != NULL) + { + nd_status = ND_DataStruct_Close(mycontexte->RootCnv); + }*/ + } + + ctxt->sax = SAXHandler_Sav; + xmlFreeParserCtxt(ctxt); + } + else + { + status = IMRS_KO; + } + + return(status); + +} + + + +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_XML_Dump_Cnv_Header(FILE *dump_file) +{ + fprintf(dump_file, "\n"); + fprintf(dump_file, "\n"); + fprintf(dump_file, "<%s>\n", IMRD_SDMD_TAG_CNV_STRUCT); + fprintf(dump_file, "@(#) VERSIONIMR: $Label: $ $Date: 2008/11/12 02:25:23 $ $Workfile: struct_info_xml.c $\n", + ((IMRT_Data_Version *)IMRG_SDM_Base.RootCnv->User_Ptr)->Label, + ((IMRT_Data_Version *)IMRG_SDM_Base.RootCnv->User_Ptr)->Date); + return( IMRS_OK); + +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_XML_Dump_Cnv_Body(FILE *dump_file) +{ + IMRT_Status status; + NDT_Status nd_status; + + if( ( nd_status = ND_DataStruct_Traverse( IMRG_SDM_Base.RootCnv, IMRD_SDMD_CMD_API_XML_DUMP, dump_file)) != NDS_OK) + { + status = IMRS_KO; + printf( "XML Dump RootCnv failed (%d)...\n"); + } + else + { + status = IMRS_OK; + } + + return(status); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_XML_Dump_Cnv_Footer(FILE *dump_file) +{ + fprintf(dump_file, "\n"); + fprintf(dump_file, "\n", IMRD_SDMD_TAG_CNV_STRUCT); + return( IMRS_OK); + +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_XML_Dump_Cnv(void) +{ + IMRT_Status status; + char dump_filename[255]; + FILE *dump_file; + + strcpy(dump_filename, SDMD_CNV_FILE); + + if( ( dump_file = fopen( dump_filename, "w")) == NULL) + { + status = IMRS_KO; + printf( "Can't open dump file (%s) !\n", dump_filename); + } + else + { + status = SDM_XML_Dump_Cnv_Header(dump_file); + if(status == IMRS_OK) + { + status = SDM_XML_Dump_Cnv_Body(dump_file); + if(status == IMRS_OK) + { + status = SDM_XML_Dump_Cnv_Footer(dump_file); + } + } + + fclose( dump_file); + } + + return(status); + +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_XML_Dump_Msg_Header(FILE *dump_file) +{ + fprintf(dump_file, "\n"); + fprintf(dump_file, "\n"); + fprintf(dump_file, "<%s>\n", IMRD_SDMD_TAG_MSG_STRUCT); + fprintf(dump_file, "@(#) VERSIONIMR: $Label: $ $Date: 2008/11/12 02:25:23 $ $Workfile: struct_info_xml.c $\n", + ((IMRT_Data_Version *)IMRG_SDM_Base.RootMsg->User_Ptr)->Label, + ((IMRT_Data_Version *)IMRG_SDM_Base.RootMsg->User_Ptr)->Date); + return( IMRS_OK); + +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_XML_Dump_Msg_Body(FILE *dump_file) +{ + IMRT_Status status; + NDT_Status nd_status; + + if( ( nd_status = ND_DataStruct_Traverse( IMRG_SDM_Base.RootMsg, IMRD_SDMD_CMD_API_XML_DUMP, dump_file)) != NDS_OK) + { + status = IMRS_KO; + printf( "XML Dump RootMsg failed (%d)...\n"); + } + else + { + status = IMRS_OK; + } + + return(status); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_XML_Dump_Msg_Footer(FILE *dump_file) +{ + fprintf(dump_file, "\n"); + fprintf(dump_file, "\n", IMRD_SDMD_TAG_MSG_STRUCT); + return( IMRS_OK); + +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_XML_Dump_Msg(void) +{ + IMRT_Status status; + char dump_filename[255]; + FILE *dump_file; + + strcpy(dump_filename, SDMD_MSGFIELD_FILE); + + if( ( dump_file = fopen( dump_filename, "w")) == NULL) + { + status = IMRS_KO; + printf( "Can't open dump file (%s) !\n", dump_filename); + } + else + { + status = SDM_XML_Dump_Msg_Header(dump_file); + if(status == IMRS_OK) + { + status = SDM_XML_Dump_Msg_Body(dump_file); + if(status == IMRS_OK) + { + status = SDM_XML_Dump_Msg_Footer(dump_file); + } + } + + fclose( dump_file); + } + + return(status); +} +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +IMRT_Status SDM_XML_StructInfo_Dump(void) +{ + IMRT_Status status; + + status = SDM_XML_Dump_Cnv(); + + if(status == IMRS_OK) + { + status = SDM_XML_Dump_Msg(); + } + + return(status); +} + +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ diff --git a/src/libstatic_data_mng/src/struct_info_xml.h b/src/libstatic_data_mng/src/struct_info_xml.h new file mode 100644 index 0000000..9f6776f --- /dev/null +++ b/src/libstatic_data_mng/src/struct_info_xml.h @@ -0,0 +1,277 @@ +/*----------------------------------------------------------------------------*/ +/* File: struct_info_xml.h */ +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/* IMR - Interlinking Message Router */ +/* Copyright (C) 2005 Arnaud G. Gibert & Others (See ReadMe.txt) */ +/* mailto:arnaud@rx3.net */ +/* http://www.rx3.org/dvp/?dvp=imr */ +/*----------------------------------------------------------------------------*/ +/* This file is part of IMR */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/*----------------------------------------------------------------------------*/ + +#ifndef _STRUCT_INFO_XML_H_ +# define _STRUCT_INFO_XML_H_ + + + +/*----------------------------------------------------------------------------*/ +/* Global Include */ +/*----------------------------------------------------------------------------*/ + +# include + +/*----------------------------------------------------------------------------*/ +/* Local constantes */ +/*----------------------------------------------------------------------------*/ + +/*definition des tags xml pour le chargement des structure Msg et Field*/ +#define IMRD_SDMD_TAG_MESSAGE "message" +#define IMRD_SDMD_TAG_FIELD "field" +#define IMRD_SDMD_TAG_VALUEID "valueid" +#define IMRD_SDMD_TAG_FIXED "fixed" +#define IMRD_SDMD_TAG_OFFSET "offset" +#define IMRD_SDMD_TAG_SIZE "size" +#define IMRD_SDMD_TAG_TAGGED "tagged" +#define IMRD_SDMD_TAG_TAG "tag" +#define IMRD_SDMD_TAG_INTERNE "interne" +#define IMRD_SDMD_TAG_INTERNAL_NAME "internal_name" +#define IMRD_SDMD_TAG_FORMAT "format" +#define IMRD_SDMD_TAG_XML "xml" +#define IMRD_SDMD_TAG_FML "fml" +#define IMRD_SDMD_TAG_DELIMITED "delimited" +#define IMRD_SDMD_TAG_ID "id" +#define IMRD_SDMD_TAG_DEFVAL "defval" +#define IMRD_SDMD_TAG_CNV "cnv" +#define IMRD_SDMD_TAG_ATTRIBUTE "attribute" +#define IMRD_SDMD_TAG_EXIST "exist" + + +/*----------------------------------------------------------------------------*/ +/* Local Definition */ +/*----------------------------------------------------------------------------*/ + + + +typedef struct SDMT_StructInfo_Contexte +{ + char value[IMRD_SDMD_VALUE_LEN]; + IMRT_Array_Xml_Path PathArray; + IMRT_Level_Tag PresentLevelTag; + IMRT_Msg_Id CptMsg; + IMRT_Field_Id CptField; + IMRT_Cnv_Id CptCnv; + IMRT_Field * CurrentField; + IMRT_Msg * CurrentMessage; + IMRT_Cnv * CurrentCnv; + NDT_Root * RootMessage; + NDT_Root * RootCnv; + xmlParserCtxt * SaxCtxHdl; + IMRT_Error FataError; + IMRT_Status flagerror; +}SDMT_StructInfo_Contexte; + +/*----------------------------------------------------------------------------*/ +/* Prototypes */ +/*----------------------------------------------------------------------------*/ + +# ifdef _STRUCT_INFO_XML_C_ + +static IMRT_Status error(SDMT_StructInfo_Contexte *ctx , const char *msg, ...); + +IMRT_Status startElementNsCnv( SDMT_StructInfo_Contexte * ctx , + const xmlChar *localname, + const xmlChar *prefix, + const xmlChar *URI, + int nb_namespaces, + const xmlChar **namespaces, + int nb_attributes, + int nb_defaulted, + const xmlChar **attributes); + +IMRT_Status startElementNS( SDMT_StructInfo_Contexte * ctx , + const xmlChar *localname, + const xmlChar *prefix, + const xmlChar *URI, + int nb_namespaces, + const xmlChar **namespaces, + int nb_attributes, + int nb_defaulted, + const xmlChar **attributes); + +IMRT_Status endElementNsCnv( SDMT_StructInfo_Contexte * ctx, + const xmlChar *localname, + const xmlChar *prefix, + const xmlChar *URI); + +IMRT_Status endElementNS( SDMT_StructInfo_Contexte * ctx, + const xmlChar *localname, + const xmlChar *prefix, + const xmlChar *URI); + +IMRT_Status charactersDebug(SDMT_StructInfo_Contexte * ctx , const xmlChar *ch, int len); + +IMRT_Status SDM_XML_Load_Cnv( char *demo_file, SDMT_StructInfo_Contexte *mycontexte); +IMRT_Status SDM_XML_Load_MsgAndField( char *demo_file, SDMT_StructInfo_Contexte * mycontexte); +IMRT_Status SDM_XML_StructInfo_Init(IMRT_Path Lib_Path); +IMRT_Status SDM_XML_Dump_Cnv_Header(FILE *dump_file); +IMRT_Status SDM_XML_Dump_Cnv_Body(FILE *dump_file); +IMRT_Status SDM_XML_Dump_Cnv_Footer(FILE *dump_file); +IMRT_Status SDM_XML_Dump_Cnv(void); +IMRT_Status SDM_XML_Dump_Msg_Header(FILE *dump_file); +IMRT_Status SDM_XML_Dump_Msg_Body(FILE *dump_file); +IMRT_Status SDM_XML_Dump_Msg_Footer(FILE *dump_file); +IMRT_Status SDM_XML_Dump_Msg(void); +IMRT_Status SDM_XML_StructInfo_Dump(void); + +# else + +extern IMRT_Status SDM_XML_Load_Cnv( char *demo_file, SDMT_StructInfo_Contexte *mycontexte); +extern IMRT_Status SDM_XML_Load_MsgAndField( char *demo_file, SDMT_StructInfo_Contexte * mycontexte); +extern IMRT_Status SDM_XML_StructInfo_Init(IMRT_Path Lib_Path); +extern IMRT_Status SDM_XML_Dump_Cnv_Header(FILE *dump_file); +extern IMRT_Status SDM_XML_Dump_Cnv_Body(FILE *dump_file); +extern IMRT_Status SDM_XML_Dump_Cnv_Footer(FILE *dump_file); +extern IMRT_Status SDM_XML_Dump_Cnv(void); +extern IMRT_Status SDM_XML_Dump_Msg_Header(FILE *dump_file); +extern IMRT_Status SDM_XML_Dump_Msg_Body(FILE *dump_file); +extern IMRT_Status SDM_XML_Dump_Msg_Footer(FILE *dump_file); +extern IMRT_Status SDM_XML_Dump_Msg(void); +extern IMRT_Status SDM_XML_StructInfo_Dump(void); + +# endif + +/*----------------------------------------------------------------------------*/ +/* Globale Variables */ +/*----------------------------------------------------------------------------*/ + +# ifdef _STRUCT_INFO_XML_C_ + +/*xmlSAXHandler ErrorSAXHandlerStruct = { + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + 1, + NULL, + NULL, + NULL, + NULL + };*/ + +xmlSAXHandler SaxCnvHandlerStruct = { + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + (charactersSAXFunc)(charactersDebug), + NULL, + NULL, + NULL, + NULL, + (errorSAXFunc)error, + NULL, + NULL, + NULL, + NULL, + 1, + NULL, + (startElementNsSAX2Func)(startElementNsCnv), + (endElementNsSAX2Func)(endElementNsCnv), + NULL +}; +xmlSAXHandler debugSAXHandlerStruct = { + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + (charactersSAXFunc)(charactersDebug), + NULL, + NULL, + NULL, + NULL, + (errorSAXFunc)(error), + NULL, + NULL, + NULL, + NULL, + 1, + NULL, + (startElementNsSAX2Func)(startElementNS), + (endElementNsSAX2Func)(endElementNS), + NULL +}; + + + +# endif + +/*----------------------------------------------------------------------------*/ + +#endif diff --git a/src/libxml/AUTHORS b/src/libxml/AUTHORS new file mode 100644 index 0000000..cf2e9a6 --- /dev/null +++ b/src/libxml/AUTHORS @@ -0,0 +1,5 @@ +Daniel Veillard +Bjorn Reese +William Brack +Igor Zlatkovic for the Windows port +Aleksey Sanin diff --git a/src/libxml/COPYING b/src/libxml/COPYING new file mode 100644 index 0000000..417e955 --- /dev/null +++ b/src/libxml/COPYING @@ -0,0 +1,27 @@ +Except where otherwise noted in the source code (e.g. the files hash.c, +list.c and the trio files, which are covered by a similar licence but +with different Copyright notices) all the files are: + + Copyright (C) 1998-2003 Daniel Veillard. All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is fur- +nished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT- +NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +DANIEL VEILLARD BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON- +NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of Daniel Veillard shall not +be used in advertising or otherwise to promote the sale, use or other deal- +ings in this Software without prior written authorization from him. + diff --git a/src/libxml/ChangeLog b/src/libxml/ChangeLog new file mode 100644 index 0000000..09ed24a --- /dev/null +++ b/src/libxml/ChangeLog @@ -0,0 +1,20389 @@ +Sun Apr 18 23:45:46 CEST 2004 Daniel Veillard + + * configure.in: preparing 2.6.9 release + * doc/* News: updated and rebuilt the docs + +Sun Apr 18 22:51:43 CEST 2004 Daniel Veillard + + * xpath.c: relaxed id() to not check taht the name(s) passed + are actually NCName, decided this in agreement with Aleksey Sanin + since existing specs like Visa3D broke that conformance checking + and other tools seems to not implement it sigh... + * SAX2.c: check attribute decls for xml:id and the value is an + NCName. + * test/xmlid/id_err* result/xmlid/id_err*: added error testing + +Sun Apr 18 21:46:17 CEST 2004 Daniel Veillard + + * xpath.c: work around Microsoft compiler NaN bug raise reported + by Mark Vakoc + * xmlschemas.c include/libxml/schemasInternals.h + include/libxml/xmlerror.h: fixed a recusive extention schemas + compilation error raised by taihei goi + +Sun Apr 18 16:57:02 CEST 2004 Daniel Veillard + + * libxml.spec.in: keep the ChangeLog compressed + * xmlreader.c: fix a segfault when using Close() + * python/tests/Makefile.am python/tests/reader8.py: test for + the Close() reader API. + +Sat Apr 17 22:42:13 HKT 2004 William Brack + + * xmlschemas.c, xmlwriter.c, doc/examples/parse4.c, + doc/examples/io2.c: minor warning cleanup (no change to logic) + * xinclude: fixed return value for internal function + xmlXIncludeLoadFallback (now always 0 or -1) + +Sat Apr 17 21:32:32 HKT 2004 William Brack + + * valid.c: small enhancement to fix bug 139791 + +Fri Apr 16 18:44:47 CEST 2004 Daniel Veillard + + * xmlschemas.c include/libxml/schemasInternals.h + include/libxml/xmlerror.h: applied patches from Kasimier Buchcik + for the attribute use support + * test/schemas/attruse* result/schemas/attruse*: added the + tests to the regression suite. + +Fri Apr 16 18:22:25 CEST 2004 Daniel Veillard + + * xmlsave.c: move the TODO as comments as the function while not + finished are usable as-is + * xmlschemas.c include/libxml/xmlerror.h: patch from Kasimier Buchcik + implementing union + * test/schemas/union_0_0.x* result/schemas/union_0_0*: added example + * python/Makefile.am: applied fix from Mike Hommey + +Fri Apr 16 23:58:42 HKT 2004 William Brack + + * parser.c: fixed problem with detecting external dtd + encoding (bug 135229). + * Makefile.am: minor change to test label + +Fri Apr 16 16:09:31 HKT 2004 William Brack + + * xinclude.c: fixed problem causing duplicate fallback + execution (bug 139520) + * test/XInclude/docs/fallback2.xml result/XInclude/fallback2.*: + added testcase + +Fri Apr 9 23:49:37 CEST 2004 Daniel Veillard + + * SAX2.c include/libxml/tree.h: adding xml:id draft support + * Makefile.am test/xmlid/id_tst* result/xmlid/id_tst*: adding + 4 first regression tests + +Fri Apr 9 11:56:08 CEST 2004 Daniel Veillard + + * libxml.spec.in: fixing Red Hat bug #120482 , libxml2-python + should depend on the version of python used to compile it. + +Mon Apr 5 09:07:24 CEST 2004 Daniel Veillard + + * HTMLparser.c: applied patch from James Bursa, frameset should + close head. + +Fri Apr 2 22:02:24 HKT 2004 William Brack + + * relaxng.c: fixed problem in xmlRelaxNGCompareNameClasses + which was causing check-relaxng-test-suite.py test 351 to fail. + +Fri Apr 2 17:03:48 HKT 2004 William Brack + + * nanohttp.c: implemented fix for M$ IIS redirect provided + by Ian Hummel + * relaxng.c: fixed problem with notAllowed compilation + (bug 138793) + +Thu Apr 1 22:07:52 CEST 2004 Daniel Veillard + + * uri.c: fix for xmlUriEscape on "http://user@somewhere.com" + from Mark Vakoc. + +2004-04-01 Johan Dahlin + + * python/.cvsignore: Add generated files, to make cvs silent. + +Thu Apr 1 12:41:36 CEST 2004 Daniel Veillard + + * xmlschemas.c: small signed-ness patch from Steve Little + +Wed Mar 31 17:47:28 CEST 2004 Daniel Veillard + + * xmlregexp.c: patched a bug in parsing production 1 and 2 of + xmlschemas regexp that William pointed out while working on + #134120 + * test/regexp/branch result/regexp/branch: added a specific + regression test + +Wed Mar 31 09:50:32 HKT 2004 William Brack + + * Makefile.am: added PYTHONPATH to python tests for Schemas + and RelaxNG + * test/xsdtest/xsdtestsuite.xml: added testfile for + SchemasPythonTests + +Mon Mar 29 16:56:49 CEST 2004 Daniel Veillard + + * doc/examples/examples.xsl doc/examples/index.html: added + information about compiling on Unix + +Mon Mar 29 14:18:12 CEST 2004 Daniel Veillard + + * catalog.c: fixes the comments for xmlCatalogDump and xmlDumpACatalog + * doc/*: rebuilt to update + +Sun Mar 28 18:11:41 CEST 2004 Daniel Veillard + + * xmlsave.c: optimize indentation based on the new context + +Sun Mar 28 14:17:10 CEST 2004 Daniel Veillard + + * doc/examples/xpath2.c doc/examples/xpath2.res: handle and explain + a very tricky problem when modifying the tree based on an XPath + result query. + +Sat Mar 27 09:56:14 PST 2004 William Brack + + * relaxng.c: fixed problem with IS_COMPILABLE flag + (bug 130216) + +Fri Mar 26 18:28:32 CET 2004 Daniel Veillard + + * parser.c: applied patch from Dave Beckett to correct line number + errors when using push with CDATA + +Fri Mar 26 14:53:58 CET 2004 Daniel Veillard + + * doc/examples/xpath1.c: added a test template + * doc/examples/xpath2.c doc/examples/xpath2.res doc/examples/*: + added a new example, and make valgrind target + +Fri Mar 26 11:47:29 CET 2004 Daniel Veillard + + * parser.c: apply fix for #136693 + +Thu Mar 25 20:21:01 MST 2004 John Fleck + + * doc/examples/io2.c + * doc/examples/io2.res + add xmlDocDumpMemory example in response to mailing list FAQ + (rebuilt xml and html also) + +Thu Mar 25 10:33:05 CET 2004 Daniel Veillard + + * debugXML.c testXPath.c xmllint.c xmlschemastypes.c: applied + patch from Mark Vakoc avoiding using xmlParse* option and use + xmlRead* instead + * win32/Makefile.bcb: patch to Borland C++ builder from Eric Zurcher + to avoid problems with some pathnames. + +Tue Mar 23 12:35:08 CET 2004 Daniel Veillard + + * configure.in doc/* News: preparing 2.6.8 release, updated and rebuilt + the docs. + * Makefile.am: use valgring fro the new Python based regression tests + +Mon Mar 22 20:07:27 CET 2004 Daniel Veillard + + * relaxng.c: remove a memory leak on schemas type facets. + * check-relaxng-test-suite.py check-relaxng-test-suite2.py + check-xsddata-test-suite.py: reduce verbosity + * configure.in Makefile.am: incorporated the Python regressions + tests for Relax-NG and Schemas Datatype to "make tests" + +Mon Mar 22 16:16:18 CET 2004 Daniel Veillard + + * xmlwriter.c include/libxml/xmlwriter.h doc/* : applied patch from + Alfred Mickautsch for better DTD support. + * SAX2.c HTMLparser.c parser.c xinclude.c xmllint.c xmlreader.c + xmlschemas.c: fixed bug #137867 i.e. fixed properly the way + reference counting is handled in the XML parser which had the + side effect of removing a lot of hazardous cruft added to try + to fix the problems associated as they popped up. + * xmlIO.c: FILE * close fixup for stderr/stdout + +Sun Mar 21 19:19:41 HKT 2004 William Brack + + * relaxng.c: added an error message when an element is not + found within a (bug 126093) + +Sat Mar 20 22:25:18 HKT 2004 William Brack + + * xmlregexp.c: enhanced the logic of parsing char groups to + better handle initial or ending '-' (bug 135972) + +Sat Mar 20 19:26:03 HKT 2004 William Brack + + * relaxng.c: added check for external reference in + xmlRelaxNGGetElements (bug 137718) + * test/relaxng/rngbug-001.*, result/relaxng/rngbug-001*: added + regression test for above + +Wed Mar 17 16:37:22 HKT 2004 William Brack + + * nanohttp.c: added a close for the local file descriptor + (bug 137474) + +Mon Mar 15 15:46:59 CET 2004 Daniel Veillard + + * xmlsave.c: switched the output routines to use the new context. + +Mon Mar 15 10:37:18 HKT 2004 William Brack + + * relaxng.c: enhanced to ignore XML_XINCLUDE_START and XML_XINCLUDE_END + nodes (bug 137153) + +Sun Mar 14 13:19:20 CET 2004 Daniel Veillard + + * xmlschemastypes.c: applied patch from John Belmonte for anyURI. + +Wed Mar 10 17:22:48 CET 2004 Daniel Veillard + + * parser.c: fix bug reported by Holger Rauch + * test/att8 result/noent/att8 result/att8 result/att8.rdr + result/att8.sax: added the test to th regression suite + +Wed Mar 10 19:42:22 HKT 2004 William Brack + + * doc/search.php: Minor change for later verson of php requiring + $HTTP_GET_VARS. + +Wed Mar 10 00:12:31 HKT 2004 William Brack + + * tree.c: Changed the flag to xmlDocCopyNode (and similar routines), + previously used only for recursion, to use a value of '2' to + indicate copy properties & namespaces, but not children. + * xinclude.c: changed the handling of ranges to use the above new + facility. Fixes Bug 134268. + +Tue Mar 9 18:48:51 HKT 2004 William Brack + + * win32/Makefile.bcb, win32/Makefile.mingw, win32/Makefile.msvc: + added new module xmlsave with patch supplied by Eric Zurcher + (second attempt - don't know what happened to the first one!) + +Tue Mar 9 09:59:25 CET 2004 Daniel Veillard + + * python/libxml.c python/libxml.py: applied patch from Anthony Carrico + providing Python bindings for the Canonicalization C14N support. + +Mon Mar 8 11:12:23 CET 2004 Hagen Moebius + + * .cvsignore and python/.cvsignore patched + +Mon Mar 8 22:33:14 HKT 2004 William Brack + + * xinclude.c: enhanced to assure that if xpointer is called + for a document, the XML_PARSE_NOENT flag is set before parsing + the included document so that entities will automatically get + taken care of. + * xpointer.c: corrected code so that, if an XML_ENTITY_REF node + is encountered, it will log it and not crash (bug 135713) + +Sun Mar 7 19:03:48 HKT 2004 William Brack + + * xinclude.c: modified to make sub-includes inherit the + parse flags from the parent document (bug 132597) + +Fri Mar 5 01:13:22 CET 2004 Daniel Veillard + + * xmlschemas.c: QName handling fixes for the XML Schemas + support from Adam Dickmeiss + * test/schemas/po1_0.xsd: also fix the schemas + * test/schemas/ns[12]* result/schemas/ns[12]*: added the specific + regression tests + +Thu Mar 4 23:03:02 CET 2004 Daniel Veillard + + * configure.in doc/Makefile.am include/libxml/Makefile.am: + paalied patch from Julio M. Merino Vidal fixing bug #134751 + to fix --with-html-dir option. + * doc/*: rebuilt fully the docs + * doc/html/libxml-xmlsave.html: new file from new header. + +Thu Mar 4 16:57:50 CET 2004 Daniel Veillard + + * debugXML.c testHTML.c tree.c doc/examples/*.c + include/libxml/xmlsave.h: fixing compilation bug with some options + disabled as well as --with-minimum should fix #134695 + +Thu Mar 4 15:00:45 CET 2004 Daniel Veillard + + * xmlcatalog.c: allow fallback to URI lookup when SYSTEM fails, + should close #134092 + +Thu Mar 4 14:39:38 CET 2004 Daniel Veillard + + * Makefile.am tree.c xmlsave.c include/libxml/xmlsave.h: commiting + the new xmlsave module before the actuall big code change. + +Thu Mar 4 12:38:53 CET 2004 Daniel Veillard + + * xmlschemas.c: applied patch from Adam Dickmeiss for mixed content + * test/schemas/mixed* result/schemas/mixed*: added his regression + tests too. + +Mon Mar 1 15:22:06 CET 2004 Daniel Veillard + + * testSAX.c: fix a compilation problem about a missing timb include + +Sat Feb 28 22:35:32 HKT 2004 William Brack + + * testSAX.c: small enhancement to prevent trying to print + strings with null pointers (caused "make tests" errors on + HP-UX) + +Thu Feb 26 20:19:40 MST 2004 John Fleck + + * doc/xmllint.xml + * doc/xmllint.1 + * doc/xmllint.html + * doc/xmlcatalog_man.xml + * doc/xmlcatalog.1 + * doc/xmlcatalog_man.html + applying patch from Mike Hommey to clarify XML_CATALOG_FILES + use + +Thu Feb 26 23:47:43 CET 2004 Daniel Veillard + + * Makefile.am: patch for cross-compilation to Windows from + Christophe de VIENNE. + +Thu Feb 26 18:52:11 HKT 2004 William Brack + + * doc/*.html, doc/html/*.html: regenerated docs using older + version of xsltproc pending resolution of AVT problem + +Thu Feb 26 10:56:29 CET 2004 Daniel Veillard + + * Makefile.am: applied patch from Charles Bozeman to not use + the system xmllint. + +Wed Feb 25 18:07:05 CET 2004 Daniel Veillard + + * include/libxml/xmlexports.h: applied patch from Roland Schwingel + for MingW + +Wed Feb 25 13:57:25 CET 2004 Daniel Veillard + + * Makefile.am catalog.c configure.in: applied a cleanup patch + from Peter Breitenlohner + * tree.c: removed a doc build warning by fixing a param comment + * doc/* : rebuilt the docs + +Wed Feb 25 13:33:07 CET 2004 Daniel Veillard + + * valid.c HTMLparser.c: avoid ID error message if using + HTML_PARSE_NOERROR should fix #130762 + +Wed Feb 25 12:50:53 CET 2004 Daniel Veillard + + * debugXML.c relaxng.c valid.c xinclude.c xmllint.c xmlreader.c: + fixing compilation and link option when configuring with + --without-valid should fix #135309 + +Wed Feb 25 11:36:06 CET 2004 Daniel Veillard + + * catalog.c: fixed the main issues reported by Peter Breitenlohner + * parser.c: cleanup + * valid.c: speedup patch from Petr Pajas + +Wed Feb 25 16:07:14 HKT 2004 William Brack + + * xpath.c: fixed a memory leak (xmlXPathLangFunction) reported + on the list by Mike Hommey + +Mon Feb 23 17:28:34 CET 2004 Daniel Veillard + + * doc/* NEWS configure.in: preparing 2.6.7 release, updated and + rebuilt the documentation. + +Mon Feb 23 11:52:12 CET 2004 Daniel Veillard + + * python/tests/*.py: applied patch from Malcolm Tredinnick + to avoid tabs in python sources, should fix #135095 + +Sun Feb 22 23:16:23 CET 2004 Daniel Veillard + + * testSAX.c: add --timing option + * relaxng.c: use the psvi field of the nodes instead of _private + which may be used for other purposes. + +Sat Feb 21 16:57:48 CET 2004 Daniel Veillard + + * encoding.c: small patch to try to fix a warning with Sun One compiler + +Sat Feb 21 16:22:35 CET 2004 Daniel Veillard + + * encoding.c: small patch removing a warning with MS compiler. + +Sat Feb 21 13:52:30 CET 2004 Daniel Veillard + + * debugXML.c: added "relaxng" option to the debugging shell + * Makefile.am test/errors/* result/errors/*: some regression tests + for some error tests cases. + +Fri Feb 20 09:56:47 CET 2004 Daniel Veillard + + * tree.c: xmlAttrSerializeTxtContent don't segfault if NULL + is passed. + * test/att7 result//att7*: adding an old regression test + laying around on my laptop + +Thu Feb 19 17:33:36 CET 2004 Daniel Veillard + + * xmlreader.c: fixed xmllint --memory --stream memory consumption + on large file by using xmlParserInputBufferCreateStatic() with + the mmap'ed file + +Thu Feb 19 13:56:53 CET 2004 Daniel Veillard + + * tree.c: some clarification in xmlDocDumpMemory() documentation + * xmllint.c: fixed xmllint --stream --timing to get timings back + +Wed Feb 18 15:20:42 CET 2004 Daniel Veillard + + * parser.c: fixed a problem in push mode when attribute contains + unescaped '>' characters, fixes bug #134566 + * test/att6 result//att6*: added the test to the regression suite + +Tue Feb 17 17:26:31 CET 2004 Daniel Veillard + + * valid.c: removing a non-linear behaviour from ID/IDREF raised + by Petr Pajas. Call xmlListAppend instead of xmlListInsert in + xmlAddRef + +Tue Feb 17 13:27:27 CET 2004 Daniel Veillard + + * python/tests/indexes.py python/tests/reader.py: indicated + encoding of the test file, needed for python 2.3 + +Tue Feb 17 21:08:11 HKT 2004 William Brack + + * xpath.c: fixed problem with numbers having > 19 + fractional places (bug 133921) + +Tue Feb 17 12:47:20 CET 2004 Daniel Veillard + + * xpath.c: applied optimization patch from Petr Pajas + +Tue Feb 17 12:39:08 CET 2004 Daniel Veillard + + * xmlwriter.c include/libxml/xmlwriter.h: applied update + from Alfred Mickautsch and the added patch from Lucas Brasilino + +Sun Feb 15 12:01:30 CET 2004 Daniel Veillard + + * benchmark.png index.html xml.html: updating the benchmark + graph and using a PNG instead of a GIF + * xmlreader.c: updated the TODO + +Sat Feb 14 18:55:40 MST 2004 John Fleck + + * doc/tutorial/xmltutorial.xml + * doc/tutorial/xmltutorial.pdf + * doc/tutorial/*.html + Fix bug in XPath example in the tutorial, thanks to Carlos, whose + last name I don't know, for pointing this out + +Thu Feb 12 16:28:12 CET 2004 Daniel Veillard + + * NEWS configure.in: preparing release of 2.6.6 + * doc/*: updated the docs and rebuilt them + +Thu Feb 12 13:41:16 CET 2004 Daniel Veillard + + * xmlregexp.c: fixing bug #132930 with the provided patch, a bit + suspicious about it but this is fairly contained and regression + tests still passes. + * test/schemas/all1* result/schemas/all1*: added the test to + the regression suite. + +Thu Feb 12 12:54:26 CET 2004 Daniel Veillard + + * parser.c: fixed bug #132575 about finding the end of the + internal subset in push mode. + * test/intsubset.xml result/intsubset.xml* result/noent/intsubset.xml: + added the test to the regression suite + +Wed Feb 11 14:19:31 CET 2004 Daniel Veillard + + * parserInternals.c xmlIO.c encoding.c include/libxml/parser.h + include/libxml/xmlIO.h: added xmlByteConsumed() interface + * doc/*: updated the benchmark rebuilt the docs + * python/tests/Makefile.am python/tests/indexes.py: added a + specific regression test for xmlByteConsumed() + * include/libxml/encoding.h rngparser.c tree.c: small cleanups + +Wed Feb 11 08:13:58 HKT 2004 William Brack + + * encoding.c: applied patch supplied by Christophe Dubach + to fix problem with --with-minimum configuration + (bug 133773) + * nanoftp.c: fixed potential buffer overflow problem, + similar to fix just applied to nanohttp.c. + +Mon Feb 9 18:40:21 CET 2004 Igor Zlatkovic + + * nanohttp.c: fixed the fix for the buffer overflow, thanx + William :-) + +Mon Feb 9 22:37:14 HKT 2004 William Brack + + * acinclude.m4, configure.in: fixed problem concerning + determining SOCKLEN_T as pointed out by Daniel Richard G. + on the mailing list + +Mon Feb 9 15:31:24 CET 2004 Igor Zlatkovic + + * nanohttp.c: fixed buffer overflow reported by Yuuichi Teranishi + +Mon Feb 9 13:45:59 CET 2004 Daniel Veillard + + * xpath.c: small patch from Philip Ludlam to avoid warnings. + +Mon Feb 9 13:41:47 CET 2004 Daniel Veillard + + * encoding.c: applied a small patch from Alfred Mickautsch + to avoid an out of bound error in isolat1ToUTF8() + +Mon Feb 9 13:35:50 CET 2004 Daniel Veillard + + * xinclude.c: remove the warning on the 2001 namespace + * parser.c parserInternals.c xpath.c: remove some warnings + when compiling with MSVC6 + * nanohttp.c: applied a patch when using _WINSOCKAPI_ + +Sun Feb 8 12:09:55 HKT 2004 William Brack + + * xinclude.c: added a small hack to fix interference between + my fixes for bugs 132585 and 132588. + * python/libxml.c: fixed problem with serialization of namespace + reported on the mailing list by Anthony Carrico + +Sat Feb 7 16:53:11 HKT 2004 William Brack + + * xinclude.c: fixed problem with function xmlXIncludeCopyRange + (bug 133686). + +Fri Feb 6 21:03:41 HKT 2004 William Brack + + * xmlwriter.c: fixed problem with return value of + xmlTextWriterWriteIndent() (bug 133297) + +Fri Feb 6 19:07:04 HKT 2004 William Brack + + * xinclude.c: changed coding to output good XIncludes when + one or more bad ones are present (bug 132588) + +Fri Feb 6 17:34:21 HKT 2004 William Brack + + * xinclude.c: corrected handling of empty fallback condition + (bug 132585) + +Fri Feb 6 15:28:36 HKT 2004 William Brack + + * HTMLparser.c: added initialisation for ctxt->vctxt + in HTMLInitParser (bug 133127) + * valid.c: minor cosmetic change (removed ATTRIBUTE_UNUSED + from several function params) + +Tue Feb 3 16:48:57 PST 2004 William Brack + + * xinclude.c: fixed problem regarding freeing of dictionary + when there are errors within an XInclude file (bug 133106). + Thanks to Oleg Paraschenko for the assistance. + +Tue Feb 3 09:53:18 PST 2004 William Brack + + * xmlschemastypes.c: fixed validation of maxLength with no + content using patch submitted by Eric Haszlakiewicz + (bug 133259) + +Tue Feb 3 09:21:09 CET 2004 Igor Zlatkovic + + * include/libxml/xmlreader.h include/libxml/xmlmemory.h: added + calling convention to the public function prototypes (rep by + Cameron Johnson) + * include/libxml/xmlexports.h: fixed mingw+msys compilation + (rep by Mikhail Grushinskiy) + +Mon Feb 2 20:22:18 PST 2004 William Brack + + * xmlwriter.c: enhanced output indenting (bug 133264) + +Mon Feb 2 16:13:33 PST 2004 William Brack + + * xmlreader.c, include/libxml/xmlreader.h: applied patch from + Steve Ball to provide structured error reports. + +Sun Feb 1 01:48:14 PST 2004 William Brack + + * tree.c, include/libxml/tree.h: moved serialization of + attribute text data (xmlSerializeContent) into a separate + routine (xmlSerializeTxtContent) so it can be used by xmlwriter.c + * xmlwriter.c: changed handling of attribute string to use the + routine above (fixed bug 131548) + +Sat Jan 31 08:22:02 MST 2004 John Fleck 2.6, rebuild + html - this time doing it correctly :-) + +Fri Jan 30 20:45:36 MST 2004 John Fleck + + * doc/examples/examples.xml + * doc/examples/*.html + add note that reader examples need libmxl2 > 2.6, rebuild + html + +Thu Jan 29 23:51:48 PST 2004 William Brack + + * xpath.c: added (void *) type override to prevent + warning on Solaris (Bug 132671) + +Wed Jan 28 07:20:37 MST 2004 John Fleck + + * doc/examples/Makefile.am + per Jan. 15 email to the list from oliverst, the index.html + file from this directory wasn't making it into the tarball + +Mon Jan 26 18:01:00 CET 2004 Daniel Veillard + + * acinclude.m4: applied fix from Alexander Winston for a problem + related to automake-1.8 , c.f. #132513 and #129861 + +Mon Jan 26 12:53:11 CET 2004 Daniel Veillard + + * doc/examples/index.py: don't rely on . being on the path for + make tests, should keep Mr. Crozat quiet until next time... + +Sun Jan 25 21:45:03 CET 2004 Daniel Veillard + + * configure.in NEWS doc/*: preparing release 2.6.5, rebuilt the + docs, checked rngparser stuff does not end up in the tarball + +Sun Jan 25 20:59:20 CET 2004 Daniel Veillard + + * python/libxml.c: applied patch from Frederic Peters + fixing the wrong arg order in xpath callback in bug #130980 + +Sun Jan 25 20:52:09 CET 2004 Daniel Veillard + + * xinclude.c: fixing #130453 XInclude element with no href attribute + * relaxng.c rngparser.c include/libxml2/relaxng.h: fully integrating + the compact syntax will require more work, postponed for the + 2.6.5 release. + +Sat Jan 24 09:30:22 CET 2004 Daniel Veillard + + * include/libxml/schemasInternals.h xmlschemas.c: applied patch from + Steve Ball to avoid a double-free. + +Fri Jan 23 14:03:21 CET 2004 Daniel Veillard + + * doc/examples/*: added io1.c an example ox xmlIO usage and io1.res + test result, fixed a awful lot of memory leaks showing up in + testWriter.c, changed the examples and the Makefiles to test + memory leaks. + * xmlwriter.c: fixed a memory leak + * Makefile.am: run the doc/examples regression tests as part of + make tests + * xpath.c include/libxml/xpath.h: added xmlXPathCtxtCompile() to + compile an XPath expression within a context, currently the goal + is to be able to reuse the XSLT stylesheet dictionnary, but this + opens the door to others possible optimizations. + * dict.c include/libxml/dict.h: added xmlDictCreateSub() which allows + to build a new dictionnary based on another read-only dictionnary. + This is needed for XSLT to keep the stylesheet dictionnary read-only + while being able to reuse the strings for the transformation + dictionnary. + * xinclude.c: fixed a dictionnar reference counting problem occuring + when document parsing failed. + * testSAX.c: adding option --repeat for timing 100times the parsing + * doc/* : rebuilt all the docs + +Thu Jan 22 14:17:05 2004 Aleksey Sanin + + * xmlmemory.c: make xmlReallocLoc() accept NULL pointer + +Thu Jan 22 08:26:20 CET 2004 Daniel Veillard + + * xmlschemastypes.c: applied patch from John Belmonte for + normalizedString datatype support. + +Thu Jan 22 10:43:22 HKT 2004 William Brack + + * xpath.c: fixed problem with union when last() is used + in predicate (bug #131971) + * xpointer.c: minor change to comment for doc generation + +Wed Jan 21 17:03:17 CET 2004 Daniel Veillard + + * parser.c: fixed bug #131745 raised by Shaun McCance with the + suggested patch + +Wed Jan 21 10:59:55 CET 2004 Daniel Veillard + + * xmlwriter.c: applied patch from Alfred Mickautsch fixing a memory + leak reported on the list. + +Thu Jan 15 00:48:46 CET 2004 Daniel Veillard + + * python/generator.py python/tests/tstLastError.py: applied + patch from Stephane Bidoul to add enums to the Python bindings. + +Tue Jan 13 21:50:05 CET 2004 Daniel Veillard + + * testHTML.c: another small patch from Mark Vadoc + +Tue Jan 13 21:39:58 CET 2004 Daniel Veillard + + * HTMLparser.c relaxng.c testRelax.c testSchemas.c: applied + patch from Mark Vadoc to not use SAX1 unless necessary. + +Mon Jan 12 17:22:57 CET 2004 Daniel Veillard + + * dict.c parser.c xmlstring.c: some parser optimizations, + xmllint --memory --timing --repeat --stream ./db10000.xml + went down from 16.5 secs to 15.5 secs. + +Thu Jan 8 17:57:50 CET 2004 Daniel Veillard + + * xmlschemas.c: removed a memory leak remaining from the switch + to a dictionnary for string allocations c.f. #130891 + +Thu Jan 8 17:48:46 CET 2004 Daniel Veillard + + * xmlreader.c: fixing some problem if configured --without-xinclude + c.f. #130902 + +Thu Jan 8 17:42:48 CET 2004 Daniel Veillard + + * configure.in: changed AC_OUTPUT() macro to avoid a cygwin problem + c.f. #130896 + +Thu Jan 8 00:36:00 CET 2004 Daniel Veillard + + * win32/Makefile.bcb win32/Makefile.mingw win32/Makefile.msvc: + applying patch from Mark Vakoc for Windows + * doc/catalog.html doc/encoding.html doc/xml.html: applied doc + fixes from Sven Zimmerman + +Tue Jan 6 23:51:46 CET 2004 Daniel Veillard + + * python/libxml2-python-api.xml python/libxml_wrap.h python/types.c + python/tests/Makefile.am python/tests/tstLastError.py: applied + patch from Stephane Bidoul for structured error handling from + python, and the associated test + +Tue Jan 6 23:18:11 HKT 2004 William Brack + + * configure.in: fixed Bug130593 + * xmlwriter.c: fixed compilation warning + +Tue Jan 6 15:15:23 CET 2004 Daniel Veillard + + * include/libxml/xmlstring.h: fixed the comment in the header + * doc/*: rebuilt the docs + +Tue Jan 6 19:40:04 HKT 2004 William Brack + + * encoding.c, parser.c, xmlstring.c, Makefile.am, + include/libxml/Makefile.am, include/libxml/catalog.c, + include/libxml/chvalid.h, include/libxml/encoding.h, + include/libxml/parser.h, include/libxml/relaxng.h, + include/libxml/tree.h, include/libxml/xmlwriter.h, + include/libxml/xmlstring.h: + moved string and UTF8 routines out of parser.c and encoding.c + into a new module xmlstring.c with include file + include/libxml/xmlstring.h mostly using patches from Reid + Spencer. Since xmlChar now defined in xmlstring.h, several + include files needed to have a #include added for safety. + * doc/apibuild.py: added some additional sorting for various + references displayed in the APIxxx.html files. Rebuilt the + docs, and also added new file for xmlstring module. + * configure.in: small addition to help my testing; no effect on + normal usage. + * doc/search.php: added $_GET[query] so that persistent globals + can be disabled (for recent versions of PHP) + +Mon Jan 5 20:47:07 MST 2004 John Fleck + + * doc/tutorial/customfo.xsl + * doc/tutorial/customhtml.xsl + update custom tutorial-building stylesheets in preparation + for tutorial update + +Tue Jan 6 00:10:33 CET 2004 Daniel Veillard + + * rngparser.c: commiting the compact relax ng parser. It's not + completely finished, it's not integrated but I want to save the + current state + +Mon Jan 5 22:22:48 HKT 2004 William Brack + + * doc/apibuild.py, doc/APIconstructors.html, doc/libxml2-refs.xml, + win32/libxml2.def.src: fixed apibuild.py's generation of + "constructors" to be in alphabetical order (instead of previous + random sequence); regenerated resulting files. + +Mon Jan 5 14:03:59 CET 2004 Daniel Veillard + + * xmlwriter.c: applied patch from Lucas Brasilino fixing an indent + problem. + +Sun Jan 4 18:54:29 MST 2004 John Fleck + + * doc/newapi.xsl: change background color of function + declaration to improve readability + * doc/*: rebuild docs with new stylesheet + +Sun Jan 4 22:45:14 HKT 2004 William Brack + + * parser.c, include/libxml/parser.h: added a routine + xmlStrncatNew to create a new string from 2 frags. + * tree.c: added code to check if node content is from + dictionary before trying to change or concatenate. + +Sun Jan 4 08:57:51 HKT 2004 William Brack + + * xmlmemory.c: applied suggestion from Miloslav Trmac (see + Bug 130419) and eliminated xmlInitMemoryDone. More + improvement needed. + * xml2-config.in: added an additional flag (--exec-prefix) to + allow library directory to be different from include directory + (Bug 129558). + +Fri Jan 2 21:22:18 CET 2004 Daniel Veillard + + * error.c: applied patch from Stéphane Bidoul for structured error + reporting. + +Fri Jan 2 21:03:17 CET 2004 Daniel Veillard + + * include/libxml/xmlwriter.h xmlwriter.c: applied the patch from + Lucas Brasilino to add indentation support to xmlWriter + +Fri Jan 2 22:58:29 HKT 2004 William Brack + + * xinclude.c: fixed problem with "recursive" include (fallback + contains another include - Bug 129969) + +Fri Jan 2 11:40:06 CET 2004 Daniel Veillard + + * SAX2.c: found and fixed a bug misallocating some non + blank text node strings from the dictionnary. + * xmlmemory.c: fixed a problem with the memory debug mutex + release. + +Wed Dec 31 22:02:37 HKT 2003 William Brack + + * xinclude.c: fixed problem caused by wrong dictionary + reference count, reported on the list by Christopher + Grayce. + +Wed Dec 31 15:55:55 HKT 2003 William Brack + + * python/generator.py, python/libxml2class.txt: fixed problem + pointed out by Stéphane Bidoul on the list. + * xinclude.c, xpointer.c, xpath.c, include/libxml/xpointer.h: + completed modifications required to fix Bug 129967 (at last!). + Now wait to see how long before further trouble... + +Tue Dec 30 16:26:13 HKT 2003 William Brack + + * parser.c, xmlmemory.c, include/libxml/xmlmemory.h: Fixed + memory leak reported by Dave Beckett + * xmlschemas.c: Removed spurious comment reported on the mailing + list + * xinclude.c, xpath.c, xpointer.c, libxml/include/xpointer.h: + Further work on Bug 129967 concerning xpointer range handling + and range-to function; much better, but still not complete + +Mon Dec 29 18:08:05 CET 2003 Daniel Veillard + + * valid.c: xmlValidateElement could crash for element holding a + namespace declaration but not in a namespace. Oliver Fischer + provided the example. + +Mon Dec 29 11:29:31 CET 2003 Daniel Veillard + + * xmllint.c: issue validation status on stderr, not stdout as suggested + by Pawel Palucha + * result/relaxng/*: this change slightly all the output from RNG + regressions. + +Mon Dec 28 10:47:32 HKT 2003 William Brack + + * xmlschemas.c: edited a couple of comments in accordance with + posting on the mailing list (no logic change) + * xpointer.c: working on Bug 129967, added check for NULL + nodeset to prevent crash. Further work required. + * xpath.c: working on Bug 129967, added code to handle + XPATH_LOCATIONSET in RANGETO code, also added code to + handle it in xmlXPathEvaluatePredicateResult. Further + work required. + +Sat Dec 27 12:32:58 HKT 2003 William Brack + + * xmlschemas.c: added tests for xs:all to assure minOccurs + and maxOccurs <= 1 (Bug 130020) + +Sat Dec 27 09:53:06 HKT 2003 William Brack + + * xmlregexp.c: fixed xmlFAParseCharRange for Unicode ranges + with patch from Charles Bozeman. + +Fri Dec 26 14:03:41 HKT 2003 William Brack + + * xmlregexp.c: fixed problem causing segfault on validation error + condition (reported on mailing list) + +Thu Dec 25 21:16:22 HKT 2003 William Brack + + * xmlschemas.c: fixed missing dictionaries for Memory and Doc + parser contexts (problem reported on mailing list) + * doc/apibuild.py: small change to prevent duplicate lines + on API functions list. It will take effect the next time + the docs are rebuilt. + +Wed Dec 24 12:54:25 CET 2003 Daniel Veillard + + * configure.in NEWS doc/*: updated the docs and prepared a new + release 2.6.4 + +Wed Dec 24 12:07:52 CET 2003 Daniel Veillard + + * legacy.c: remove deprecated warning on startElement() + +Wed Dec 24 12:04:35 CET 2003 Daniel Veillard + + * xinclude.c result/XInclude/nodes2.*: XInclude xpointer support + was broken with the new namespace. Fixes #129932 + +Wed Dec 24 00:29:30 CET 2003 Daniel Veillard + + * xmlschemas.c include/libxml/schemasInternals.h: types might be + redefined in includes, quick fix to allow this but lacks the + equality of the redefinition test. + +Tue Dec 23 15:14:37 HKT 2003 William Brack + + * valid.c: fixed bug concerning validation using external + dtd of element with mutiple namespace declarations + (Bug 129821) + +Tue Dec 23 11:41:42 HKT 2003 William Brack + + * tree.c: inhibited production of "(null):" in xmlGetNodePath + when node has default namespace (Bug 129710) + +Tue Dec 23 09:29:14 HKT 2003 William Brack + + * xpath.c: small enhancement to xmlXPathCmpNodes to assure + document order for attributes is retained (Bug 129331) + +Mon Dec 22 19:06:16 CET 2003 Daniel Veillard + + * parser.c xmlreader.c: change xmlReadFd() xmlCtxtReadFd() + xmlReaderNewFd() xmlReaderForFd(), change those to not close + the file descriptor. Updated the comment, should close #129683 + +Mon Dec 22 00:34:09 CET 2003 Daniel Veillard + + * xinclude.c: fixed a serious problem in XInclude #129021 + +Sun Dec 21 13:59:54 CET 2003 Daniel Veillard + + * parser.c: fixed bug #129489, propagation of parsing flags + in entities. + * parser.c xmlreader.c: improved the comments of parsing options + +Sun Dec 21 18:14:04 HKT 2003 William Brack + + * python/Makefile.am, python/tests/Makefile.am, + doc/Makefile.am: applied fixes to allow build from + 'outside' directory (Bug 129172) + +Sat Dec 20 16:42:07 MST 2003 John Fleck + + * tree.c - add explanation of namespace inheritance when + ns is NULL to xmlNewChild and xmlNewTextChild API doc + +Sat Dec 20 18:17:28 HKT 2003 William Brack + + * include/libxml/xpathInternals.h: undid last change (my + bad). Put necessary fix in libxslt/libexslt instead. + * include/libxml/DOCBparser.h: put test for __GCC__ on + warning directive (Bug 129105) + +Sat Dec 20 10:48:37 HKT 2003 William Brack + + * include/libxml/xpathInternals.h: fixed xmlXPathReturnString + to cater for NULL pointer (bug 129561) + * globals.c: added comment to suppress documentation warning + * doc/apibuild.py: fixed problem which caused last APIchunkxx.html + to be lost. Rebuilt doc/* (including adding APIchunk26.html) + +Fri Dec 19 18:24:02 CET 2003 Daniel Veillard + + * xmlreader.c: trying to fix #129692 xmlTextReaderExpand() when + using an xmlReaderWalker() + +Thu Dec 18 20:10:34 MST 2003 John Fleck + + * tree.c: fix misc. typos in doc comments + * include/libxml/tree.h: elaborate on macro define doc comments + * doc/*: rebuild docs + +Wed Dec 17 16:07:33 CET 2003 Daniel Veillard + + * doc/examples/*: don't call the result files .out but .res as + the Makefiles tend to try generating binaries for .out targets... + +Tue Dec 16 20:53:54 MST 2003 John Fleck + + * doc/html/libxml-pattern.html: - cvs add API docs for new + pattern stuff + +Tue Dec 16 20:40:40 MST 2003 John Fleck + + * tree.c + * doc/*: + Elaborate in documentation discussion of xmlNewChild + and xmlNewTextChild. Thanks to Steve Lenti for pointing + out the usefulness of a more explicit explanation of the + reserved character escaping issue. + +Fri Dec 12 15:55:15 CET 2003 Daniel Veillard + + * xmlcatalog.c: applied patch from Stefan Kost + +Thu Dec 11 15:15:31 CET 2003 Daniel Veillard + + * doc/examples/testWriter.c: applied small fix from Lucas Brasilino + +Thu Dec 11 14:55:22 CET 2003 Igor Zlatkovic + + * win32/Makefile.* win32/configure.js: Added pattern support + +Wed Dec 10 14:11:20 CET 2003 Daniel Veillard + + * configure.in doc/* libxml.spec.in: preparing release of + libxml2-2.6.3, updated and regenerated the docs. + +Wed Dec 10 11:43:33 CET 2003 Daniel Veillard + + * SAX2.c pattern.c: removed some compilation warnings + +Wed Dec 10 11:16:29 CET 2003 Daniel Veillard + + * xmllint.c: fixing bug #119264 xmllint failing to report + serialization errors in some cases. + +Tue Dec 9 23:50:23 CET 2003 Daniel Veillard + + * entities.c: fixed an XML entites content serialization + potentially triggered by XInclude, see #126817 + +Tue Dec 9 16:12:50 CET 2003 Daniel Veillard + + * xmlwriter.c: applied the patch to xmlTextWriterStartPI() + suggested by Daniel Schulman in #128313 + +Tue Dec 9 15:18:32 CET 2003 Daniel Veillard + + * configure.in Makefile.am: another patch from Kenneth Haley + for Mingw, c.f. #128787 + +Tue Dec 9 15:07:09 CET 2003 Daniel Veillard + + * include/libxml/xmlexports.h: applied patch from Kenneth Haley + for compiling on Mingw see #128786 + +Tue Dec 9 14:52:59 CET 2003 Daniel Veillard + + * xmllint.c: some flags were not passed down correctly as + parsing options. Fixes #126806 + +Tue Dec 9 12:29:26 CET 2003 Daniel Veillard + + * xinclude.c xmllint.c xmlreader.c include/libxml/xinclude.h + include/libxml/xmlerror.h: augmented the XInclude API + to be able to pass XML parser flags down to the Inclusion + process. Also resynchronized with the Last Call W3C Working + Draft 10 November 2003 for the xpointer attribute. + * Makefile.am test/XInclude/docs/nodes[23].xml + result/XInclude/*: augmented the tests for the new namespace and + testing the xpointer attribute, changed the way error messages + are tested + * doc/*: regenerated the documentation + +Mon Dec 8 18:38:26 CET 2003 Daniel Veillard + + * error.c: filter warning messages if the global setting blocks them + * xinclude.c xmlreader.c include/libxml/xinclude.h + include/libxml/xmlerror.h: updated the change of namespace at + the XInclude level, raise a warning if the old one is found, + and some cleanup + +Mon Dec 8 13:09:39 CET 2003 Daniel Veillard + + * tree.c: tentative fix for #126117 character reference in + attributes output problem in some cornercase. + +Mon Dec 8 11:08:45 CET 2003 Daniel Veillard + + * python/libxml.py: tried to fix the problems reported in + bug #126735 + * xpath.c SAX2.c error.c parser.c valid.c include/libxml/xmlerror.h: + fixed again some problem trying to use the structured error + handlers, c.f. bug #126735 + * result/VC/ElementValid: tiny change due to the fix + +Sun Dec 7 22:27:31 CET 2003 Daniel Veillard + + * error.c: fixed __xmlRaiseError to use structured error handlers + defined by xmlSetStructuredErrorFunc(), fixes bug #126211 + +Sun Dec 7 20:30:53 CET 2003 Daniel Veillard + + * parser.c: attempt to fix #126211 ... + +Fri Dec 5 17:07:29 CET 2003 Daniel Veillard + + * pattern.c xmlreader.c xmllint.c include/libxml/pattern.h + include/libxml/xmlreader.h: fixed the pattern interfaces + but not yet the parser to handle the namespaces. + * doc/examples/reader3.c doc/*: fixed the example, rebuilt the docs. + +Fri Dec 5 15:49:44 CET 2003 Daniel Veillard + + * globals.c xmlwriter.c doc/apibuild.py include/libxml/globals.h + include/libxml/pattern.h include/libxml/schemasInternals.h + include/libxml/xmlexports.h include/libxml/xmlwriter.h: cleanup + the make rebuild in doc, this include new directive to stop + documentation warnings + * doc/* doc/html/*: rebuilt the docs + * pattern.c xmlreader.c include/libxml/pattern.h + include/libxml/xmlreader.h: adding xmlTextReaderPreservePattern() + to save nodes while scanning the tree with the reader, cleanup + the way element were freed, and xmlTextReaderPreserve() + implementation, the API might change for namespace binding support + when compiling patterns. + * doc/examples/*: added reader3.c exposing the xmlTextReaderPreserve() + +Thu Dec 4 15:10:57 CET 2003 Daniel Veillard + + * python/libxml.py: oops forgot to modify/commit the new code. + +Thu Dec 4 13:29:19 CET 2003 Daniel Veillard + + * python/generator.py python/libxml.c python/libxml_wrap.h: + cleanup the output buffer support to at least get the basic + to work + * python/tests/outbuf.py python/tests/serialize.py: fixes and + cleanup. + * include/libxml/xmlwriter.h: cleanup + +Wed Dec 3 21:38:56 MST 2003 John Fleck + + * include/libxml/xmlversion.h.in + * doc/*: add WITH_TRIO comment so it shows up in the docs, rebuild + docs + +Wed Dec 3 13:10:08 CET 2003 Daniel Veillard + + * config.h.in configure.in xmlregexp.c: fix bug #128401 affecting + regexp quantifiers + +Tue Dec 2 23:29:56 CET 2003 Daniel Veillard + + * pattern.c include/libxml/pattern.h: adding the pattern node + selection code. Inheried in part from libxslt but smaller. + * Makefile.am configure.in include/libxml/xmlversion.h.in: + integrated the pattern module, made it a configure time option + * xmllint.c: added --pattern to test when doing --stream + +Tue Dec 2 11:25:25 CET 2003 Daniel Veillard + + * xmlreader.c: fixed a problem in xmlreader validation when + streaming exposed by reader2 example. + +Mon Dec 1 20:40:51 MST 2003 John Fleck + + * doc/xml.html + * doc/docs.html: + add reference to the Code Examples page to docs.html list + of resources + +Mon Dec 1 12:30:28 CET 2003 Igor Zlatkovic + + * win32/Makefile.bcb win32/configure.js: Applied the BCB patch + from Eric + +Sun Nov 30 21:33:37 MST 2003 John Fleck + + * include/libxml/xinclude.h + * doc/*: Add comments for macro definitions in xinclude.h and + rebuild the docs + +Sun Nov 30 21:06:29 MST 2003 John Fleck + + * doc/docdescr.doc + Updating William's explanation of how to build docs, + reflecting Daniel's new docs build system + +Sat Nov 29 18:38:22 HKT 2003 William Brack + + * xmlmemory.c: enhanced by adding mutex to protect global + structures in a multi-threading environment. This fixed + some random errors on the Threads regression tests. + +Fri Nov 28 21:39:49 MST 2003 John Fleck + + * doc/xml.html doc/python.html: fix tst.py text, which didn't + import sys + +Fri Nov 28 17:28:47 HKT 2003 William Brack + + * encoding.c, include/libxml/encoding.h: Enhanced the handling of + UTF-16, UTF-16LE and UTF-16BE encodings. Now UTF-16 output is + handled internally by default, with proper BOM and UTF-16LE + encoding. Native UTF-16LE and UTF-16BE encoding will not generate + BOM on output, and will be automatically recognized on input. + * test/utf16lebom.xml, test/utf16bebom.xml, result/utf16?ebom*: + added regression tests for above. + +Thu Nov 27 19:25:10 CET 2003 Igor Zlatkovic + + * win32/Makefile.* win32/configure.js: Modified to allow coexistent + build with all compilers. Added C-Runtime option for MSVC. Included + xmlWriter. + * xmlwriter.c: Added IN_LIBXML macro + +Wed Nov 26 21:54:01 CET 2003 Igor Zlatkovic + + * win32/Makefile.bcb: applied patch from Eric + +Wed Nov 26 21:33:14 CET 2003 Daniel Veillard + + * include/libxml/tree.h: stefan on IRC pointed out that XML_GET_LINE + is broken on 2.6.x + +Tue Nov 25 18:39:44 CET 2003 Daniel Veillard + + * entities.c: fixed #127877, never output " in element content + * result/isolat3 result/slashdot16.xml result/noent/isolat3 + result/noent/slashdot16.xml result/valid/REC-xml-19980210.xml + result/valid/index.xml result/valid/xlink.xml: this changes the + output of a few tests + +Tue Nov 25 16:36:21 CET 2003 Daniel Veillard + + * include/libxml/schemasInternals.h include/libxml/xmlerror.h + testSchemas.c xmlschemas.c: added xsd:include support, fixed + testSchemas behaviour when a schemas failed to parse. + * test/schemas/vdv-* result/schemas/vdv-first5_0_0*: added one + test for xsd:include from Eric Van der Vlist + +Tue Nov 25 08:18:12 CET 2003 Daniel Veillard + + * parser.c: swapped the attribute defaulting and attribute checking + parts of parsing a new element start, fixes bug #127772 + * result/valid/127772.* test/valid/127772.xml + test/valid/dtds/127772.dtd: added the example in the regression tests + +Tue Nov 25 08:00:15 CET 2003 Daniel Veillard + + * parser.c: moved xmlCleanupThreads() to the end of xmlCleanupParser() + to avoid bug #127851 + +Mon Nov 24 15:26:21 CET 2003 Daniel Veillard + + * xmlregexp.c: fixing some Negative Character Group and + Character Class Subtraction handling. + +Mon Nov 24 14:01:57 CET 2003 Daniel Veillard + + * xmlregexp.c xmlschemas.c: more XML Schemas fixes based + on Eric van der Vlist examples + * result/schemas/vdv-first4* test/schemas/vdv-first4*: + added regression tests + * doc/examples/Makefile.am doc/examples/index.py: do not + regenerate the index on make all target, but only on + make rebuild to avoid troubles. + +Sat Nov 22 21:35:42 CET 2003 Daniel Veillard + + * xmlschemas.c xmlschemastypes.c include/libxml/xmlerror.h + include/libxml/schemasInternals.h: lot of bug fixes, cleanup, + starting to add proper namespace support too. + * test/schemas/* result/schemas/*: added a number of tests + fixed the result from some regression tests too. + +Fri Nov 21 20:50:59 MST 2003 John Fleck + + * doc/xml.html, docs.html: remove reference to gtk-doc now that + Daniel has removed it, fix link to George's IBM article, other + minor edits + +Fri Nov 21 01:26:00 CET 2003 Daniel Veillard + + * xmlschemas.c: applied patch from Robert Stepanek to start + import os schemas support, cleaned up stuff and the patch. + * test/schemas/import0_0.* result/schemas/import0_0_0*: added test + to regression, fixed a few regressions too. + +Thu Nov 20 22:58:00 CET 2003 Daniel Veillard + + * HTMLparser.c: applied two parsing fixes from James Bursa + +Thu Nov 20 19:20:46 CET 2003 Daniel Veillard + + * doc/examples/*: added two xmlReader examples + * xmlreader.c: cleaned up some bugs in the process + +Thu Nov 20 12:54:30 CET 2003 Daniel Veillard + + * xmlwriter.c include/libxml/xmlwriter.h: applied patch from + Alfred Mickautsch, bugfixes and comments + * doc/examples/*: added his test as the xmlWriter example + * doc/html/ doc/*.html: this resulted in some improvements + * include/libxml/hash.h: fixed an inclusion problem when + wasn't preceeded by + +Wed Nov 19 17:19:35 CET 2003 Daniel Veillard + + * xinclude.c: fix an error message + * doc/examples/*: added tree2 example from Lucas Brasilino + +Wed Nov 19 17:50:47 HKT 2003 William Brack + + * doc/newapi.xsl: improve the sort sequence for page content + * doc/html/*.html: regenerate the web pages + +Wed Nov 19 00:48:56 CET 2003 Daniel Veillard + + * Makefile.am: do not package cvs versioning temp files. + * doc/apibuild.py doc/libxml2-api.xml doc/newapi.xsl: more cleanup, + slightly improved the API xml format, fixed a lot of small + rendering problems + * doc/html/libxml*.html: rebuilt + +Tue Nov 18 21:51:15 CET 2003 Daniel Veillard + + * include/libxml/*.h include/libxml/*.h.in: modified the file + header to add more informations, painful... + * genChRanges.py genUnicode.py: updated to generate said changes + in headers + * doc/apibuild.py: extract headers, add them to libxml2-api.xml + * *.html *.xsl *.xml: updated the stylesheets to flag geprecated + APIs modules. Updated the stylesheets, some cleanups, regenerated + * doc/html/*.html: regenerated added back book1 and libxml-lib.html + +Tue Nov 18 14:43:16 CET 2003 Daniel Veillard + + * doc/Makefile.am doc/*.xsl doc/*.html doc/apibuild.py: cleaned up + the build process to remove all remains from the old gtk-doc + inherited, libxml2-refs.xml is now generated by apibuild.py, the + stylesheets have been improved, and the API*html now generated + are XHTML1 valid too + +Tue Nov 18 14:28:32 HKT 2003 William Brack + + * genChRanges.py, chvalid.c, include/libxml/chvalid.h: minor + enhancement to prevent comment with unreferenced variable. + * threads.c xmlreader.c xmlwriter.c: edited some comments to + improve auto-generation of documentation + * apibuild.py: minor change to an error message + +Mon Nov 17 17:55:51 CET 2003 Daniel Veillard + + * doc/apibuild.py doc/libxml2-api.xml doc/newapi.xsl: more cleanup, + improving navigation + * doc/html/*.html: updated the result + +Mon Nov 17 14:54:38 CET 2003 Daniel Veillard + + * doc/Makefile.am doc/apibuild.py doc/libxml2-api.xml doc/newapi.xsl: + improvement of the stylesheets, fixed a API generation problem, + switched the stylesheet and Makefile to build the HTML output. + * doc/html/*.html: complete update, ditched some old files, might + introduce some breakage... + +Mon Nov 17 12:50:28 CET 2003 Daniel Veillard + + * doc/newapi.xsl: lot of improvements, this starts looking good + enough to be usable. + +Mon Nov 17 00:58:09 CET 2003 Daniel Veillard + + * doc/newapi.xsl: stylesheet to build HTML pages from the + API XML description, Work in Progress + +Sun Nov 16 16:03:24 HKT 2003 William Brack + + * xpath.c: fixed bug 126976 (string != empty nodeset + should be false) + +Sun Nov 16 14:00:08 HKT 2003 William Brack + + * doc/html/*.html: Finally - found the problem with the + page generation (XMLPUBFUN not recognized by gtkdoc). + Re-created the pages using a temporary version of + include/libxml/*.h. + * testOOMlib.c,include/libxml/encoding.h, + include/libxml/schemasInternals.h,include/libxml/valid.h, + include/libxml/xlink.h,include/libxml/xmlwin32version.h, + include/libxml/xmlwin32version.h.in, + include/libxml/xpathInternals.h: minor edit of comments + to help automatic documentation generation + * doc/docdescr.doc: small elaboration + * doc/examples/test1.c,doc/examples/Makefile.am: re-commit + (messed up on last try) + * xmlreader.c: minor change to clear warning. + +Sat Nov 15 19:20:32 CET 2003 Daniel Veillard + + * Copyright: fixed some wording + * libxml.spec.in: make sure doc/examples is packaged + * include/libxml/tree.h valid.c xmlreader.c: fixed the really + annoying problem about xmlRemoveID and xmlReader streaming. + Thing looks fixed now, had to add a doc reference to the + xmlID structure though... + +Sat Nov 15 09:53:36 MST 2003 John Fleck + + * doc/docdescr.doc: added description of man page building + +Sat Nov 15 19:08:22 HKT 2003 William Brack + + * doc/html/libxml-chvalid.html, doc/html/libxml-dict.html, + doc/html/libxml-list.html, doc/html/libxml-testOOMlib.html, + doc/html/libxml-wincecompat, doc/html/winsockcompat.html, + doc/html/libxml-xmlexports.html, doc/html/libxml-xmlversion.html, + doc/html/libxml-xmlwin32version.html, doc/html/libxml-xmlwriter.html: + added missing pages for the website. + +Sat Nov 15 18:23:48 HKT 2003 William Brack + + * doc/Makefile.am doc/*.html doc/html/*.html: rebuilt the + generated pages (again), manually restored doc/html/index.html + and manually edited generated file doc/gnome-xml.xml to put + in appropriate headings. + * doc/docdescr.doc: new file to describe details of the + document generation (helps my memory for the next time) + * genChRanges.py,chvalid.c,include/libxml/chvalid.h: minor + enhancement to please the automatic documentation generation. + +Fri Nov 14 23:47:31 HKT 2003 William Brack + + * catalog.c,relaxng.c,testAutomata.c,xpointer.c,genChRanges.py, + chvalid.c,include/libxml/chvalid.h,doc/examples/test1.c: + minor error cleanup for gcc-3.3.[12] compilation warnings. + +Fri Nov 14 15:08:13 HKT 2003 William Brack + + * tree.c: minor changes to some comments + * doc/*.html: rebuilt the generated HTML pages for changes + from jfleck (bug 126945) + +Thu Nov 13 12:44:14 CET 2003 Daniel Veillard + + * doc/examples/*: added Dodji's example, added output handling + +Thu Nov 13 11:35:35 CET 2003 Daniel Veillard + + * doc/examples/*: added Aleksey XPath example, fixed bugs + in the indexer + +Wed Nov 12 23:48:26 CET 2003 Daniel Veillard + + * doc/*: integrating the examples in the navigation menus + * doc/examples/*: added make tests, updated the navigation, + added a new test, cleanups, updates. + +Wed Nov 12 17:50:36 CET 2003 Daniel Veillard + + * doc/*.html: rebuilt the generated HTML pages + * doc/examples/*: updated the stylesheets, added a synopsis, + Makefile.am is now generated by index.py + +Wed Nov 12 01:38:16 CET 2003 Daniel Veillard + + * doc/site.xsl doc/examples/Makefile.am doc/examples/index.html: + added autogeneration of a web page for the examples + * doc/examples/example1.c doc/examples/.cvsignore + doc/examples/examples.xml doc/examples/index.py: updated the + informations extracted, improved the format and indexing. + +Tue Nov 11 22:08:59 CET 2003 Daniel Veillard + + * check-xinclude-test-suite.py: less verbose on difference + * libxml.spec.in: cleanup + * parser.c: fixed xmlCleanupParser() doc + * doc/Makefile.am doc/apibuild.py doc/libxml2-api.xml + doc/examples/Makefile.am doc/examples/example1.c + doc/examples/examples.xml doc/examples/index.py + doc/examples/test1.xml: work on adding C examples and + generating automated information about those. examples.xml + is autogenerated describing the examples. + * example/Makefile.am: cleanup + +Mon Nov 10 23:47:03 HKT 2003 William Brack + + * genUnicode.py, xmlunicode.c, include/libxml/xmlunicode.h: + fixed missing '-' in block names, enhanced the hack for + ABI aliasing. + +Sun Nov 9 20:28:21 HKT 2003 William Brack + + * genUnicode.py, xmlunicode.c, include/libxml/xmlunicode.h, + python/libxml2class.txt: enhanced for range checking, + updated to Unicode version 4.0.1 (API docs also updated) + * python/generator.py: minor change to fix a warning + +Wed Nov 5 23:46:36 CET 2003 Daniel Veillard + + * Makefile.am: apply fix from Karl Eichwalder for script path + +Wed Nov 5 10:49:20 CET 2003 Daniel Veillard + + * win32/configure.js: applied patch from Mark Vakoc to simplify + his work from CVS checkouts. + +Tue Nov 4 21:16:47 MST 2003 John Fleck + + * doc/xmlreader.html: minor cleanups + +Tue Nov 4 15:52:28 PST 2003 William Brack + + * include/libxml/xmlversion.h.in: changed macro ATTRIBUTE_UNUSED + for gcc so that, if undefined, it's defined as + __attribute__((unused)) + +Tue Nov 4 15:28:07 PST 2003 William Brack + + * python/generator.py: small enhancement to assure ATTRIBUTE_UNUSED + appears after the variable declaration. + * valid.c: trivial change to eliminate a warning message + +Tue Nov 4 11:24:04 CET 2003 Daniel Veillard + + * configure.in NEWS doc/*: preparing release 2.6.2, updated and + rebuilt the docs + +Tue Nov 4 09:38:46 CET 2003 Daniel Veillard + + * xmllint.c: change --html to make sure we use the HTML serialization + rule by default when HTML parser is used, add --xmlout to allow to + force the XML serializer on HTML. + * HTMLtree.c: ugly tweak to fix the output on

element and + solve #125093 + * result/HTML/*: this changes the output of some tests + +Mon Nov 3 17:51:28 CET 2003 Daniel Veillard + + * xinclude.c: fixed bug #125812, about XPointer in XInclude + failing but not returning an error. + +Mon Nov 3 17:18:22 CET 2003 Daniel Veillard + + * valid.c: fixed bug #125811 related to DTD post validation + where the DTD doesn't pertain to a document. + +Mon Nov 3 15:25:58 CET 2003 Daniel Veillard + + * parser.c xmlIO.c include/libxml/parserInternals.h: implemented + the XML_PARSE_NONET parser option. + * xmllint.c: converted xmllint.c to use the option instead of + relying on the global resolver variable. + +Mon Nov 3 13:26:32 CET 2003 Daniel Veillard + + * xinclude.c xmlreader.c include/libxml/xinclude.h: adding XInclude + support to the reader interface. Lot of testing of the walker, + various bug fixes. + * xmllint.c: added --walker and made sure --xinclude --stream --debug + works as expected + * Makefile.am result/dtd11.rdr result/ent6.rdr test/dtd11 test/ent6 + result/XInclude/*.rdr: added regression tests for the walker and + XInclude xmlReader support, had to slightly change a couple of tests + because the walker can't distinguish from + +Sat Nov 1 17:42:27 CET 2003 Daniel Veillard + + * tree.c nanohttp.c threads.c: second BeOS patch from + Marcin 'Shard' Konicki + +Fri Oct 31 15:35:20 CET 2003 Daniel Veillard + + * parser.c: always generate line numbers + +Fri Oct 31 11:53:46 CET 2003 Daniel Veillard + + * parser.c: fixed another regression introduced in fixing #125823 + +Fri Oct 31 11:33:18 CET 2003 Daniel Veillard + + * python/libxml.c: previous fix for #124044 was broken, correct + fix provided. + * HTMLparser.c parser.c parserInternals.c xmlIO.c: fix xmlStopParser() + and the error handlers to address #125877 + +Thu Oct 30 23:10:46 CET 2003 Daniel Veillard + + * parser.c: side effect of #123105 patch, namespace resolution + would fail when defined in internal entities, fixes #125823 + +Thu Oct 30 14:10:42 CET 2003 Daniel Veillard + + * python/libxml.c: be more defensive in the xmlReader python bindings + fixing bug #124044 + +Thu Oct 30 11:14:31 CET 2003 Daniel Veillard + + * valid.c: the a-posteriori DTD validation code was not validating + the namespace declarations, this fixes #124110 + +Wed Oct 29 14:13:03 PDT 2003 William Brack + + * xmlIO.c: enhanced to bypass compression detection code + when input file is stdin (bug 125801) + +Wed Oct 29 18:21:00 CET 2003 Daniel Veillard + + * xmlIO.c: fix needed when HTTP is not compiled in by Mark Vakoc + +Wed Oct 29 18:05:53 CET 2003 Daniel Veillard + + * xpath.c: more fixes about unregistering objects + * include/libxml/relaxng.h: applied patch from Mark Vakoc + missing _cplusplus processing clause + +Wed Oct 29 07:49:52 2003 Aleksey Sanin + + * include/libxml/parser.h parser.c: added xmlStrVPrintf function + +Wed Oct 29 14:37:40 CET 2003 Daniel Veillard + + * nanoftp.c nanohttp.c testThreads.c threads.c: applied patch from + Marcin 'Shard' Konicki to provide BeOS thread support. + +Wed Oct 29 14:20:14 CET 2003 Daniel Veillard + + * xmlschemas.c include/libxml/xmlschemas.h: applied patch + from Steve Ball to make a schema parser from a preparsed document. + +Wed Oct 29 13:52:25 CET 2003 Daniel Veillard + + * tree.c: applied a couple of patches from Mark Lilback about text + nodes coalescing + +Wed Oct 29 12:16:52 CET 2003 Daniel Veillard + + * xpath.c: change suggested by Anthony Carrico when unregistering + a namespace prefix to a context + * hash.c: be more careful about calling callbacks with NULL payloads. + +Wed Oct 29 00:04:26 CET 2003 Daniel Veillard + + * configure.in NEWS doc/*: preparing release 2.6.1, updated and + regenerated docs and APIs + * parser.c: cleanup and last change to fix #123105 + +Tue Oct 28 23:02:29 CET 2003 Daniel Veillard + + * HTMLparser.c: Fix #124907 by simply backporting the same + fix as for the XML parser + * result/HTML/doc3.htm.err: change to ID detecting modified one + test result. + +Tue Oct 28 22:28:50 CET 2003 Daniel Veillard + + * parser.c include/libxml/parser.h: included a new function + to reuse a Push parser context, based on Graham Bennett original + code + * valid.c: in HTML, a name in an input is not an ID + * TODO: bug list update + +Tue Oct 28 19:54:37 CET 2003 Daniel Veillard + + * xpath.c: applied patch from nico@xtradyne.com for #125030 + +Tue Oct 28 16:42:16 CET 2003 Daniel Veillard + + * Makefile.am: cleanup + * error.c valid.c include/libxml/xmlerror.h: fixing bug #125653 + sometimes the error handlers can get a parser context on DTD + errors, and sometime they don't. So be very careful when trying + to grab those informations. + +Tue Oct 28 15:26:18 CET 2003 Daniel Veillard + + * tree.c: applied patch from Kasimier Buchcik which fixes a + problem in xmlSearchNs introduced in 2.6.0 + +Tue Oct 28 14:57:03 CET 2003 Daniel Veillard + + * parser.c: fixed #123263, the encoding is mandatory in a textdecl. + +Tue Oct 28 13:48:52 CET 2003 Daniel Veillard + + * tree.c: fix bug #125047 about serializing when finding a + document fragment node. + +Mon Oct 27 11:11:29 EST 2003 Daniel Veillard + + * testSAX.c: fix bug #125592 need a NULL check + * include/libxml/chvalid.h: rename a parameter + +Mon Oct 27 09:43:48 EST 2003 Daniel Veillard + + * parser.c: applied patch from #123105 about defaulted attributes + from element coming from an entity + +Mon Oct 27 21:12:27 HKT 2003 William Brack + + * xmllint.c: fixed warning message from IRIX (bug 125182) + * python/libxml.py: removed tabs, replaced with spaces + (bug 125572) + +Mon Oct 27 06:17:30 EST 2003 Daniel Veillard + + * libxml.h parserInternals.c xmlIO.c: make sure we report errors + if xmlNewInputFromFile() fails. + * xmlreader.c: avoid using _private for the node or document + elements. + +Sat Oct 25 17:33:59 CEST 2003 Igor Zlatkovic + + * win32/configure.js: added declaration for verMicroSuffix + +Fri Oct 24 23:08:17 CEST 2003 Daniel Veillard + + * libxml.m4: applied patch from Patrick Welche provided in + bug #125432 , future proofing the .m4 file. + * parser.c: resetting the context should also reset the error + * TODO: problem of conformance w.r.t. E20 was raised in the + XML Core telconf and libxml2 isn't conformant there. + +Wed Oct 22 14:33:05 CEST 2003 Daniel Veillard + + * xmlwriter.c: applied patch from Alfred Mickautsch fixing #125180 + +Wed Oct 22 10:50:31 CEST 2003 Daniel Veillard + + * chvalid.c genChRanges.py: Stephane Bidoul pointed out another + small glitch missing a const + +Wed Oct 22 10:43:21 CEST 2003 Daniel Veillard + + * chvalid.c genChRanges.py: Stephane Bidoul pointed out that + it doesn't define IN_LIBXML + +Tue Oct 21 21:14:55 CEST 2003 Daniel Veillard + + * win32/Makefile.mingw: typo pointed out by Stephane Bidoul + +Tue Oct 21 11:26:36 CEST 2003 Daniel Veillard + + * win32/Makefile.bcb win32/Makefile.mingw win32/Makefile.msvc + win32/configure.js: set of Win32 patches for 2.6.0 by Joachim Bauch + +Tue Oct 21 02:07:22 CEST 2003 Daniel Veillard + + * tree.c: last minute patch from Eric Zurcher making it into 2.6.0 + +Tue Oct 21 02:03:03 CEST 2003 Daniel Veillard + + * configure.in NEWS doc/libxml2.xsa: preparing libxml2-2.6.0 + * doc/*: updated and regenerated the docs and API + +Tue Oct 21 01:01:55 CEST 2003 Daniel Veillard + + * SAX2.c error.c tree.c: moved the line number to their proper + field in elements now. + +Tue Oct 21 00:28:20 CEST 2003 Daniel Veillard + + * configure.in xmlwriter.c Makefile.am include/libxml/xmlwriter.h + include/libxml/Makefile.am include/libxml/xmlversion.h.in: + added the xmlWriter module contributed by Alfred Mickautsch + * include/libxml/tree.h: added room for line and extra information + * xmlreader.c python/tests/reader6.py: bugfixing some problem some + of them introduced in September + * win32/libxml2.def.src doc/libxml2-api.xml: regenerated the API + +Mon Oct 20 19:02:53 CEST 2003 Daniel Veillard + + * Makefile.am configure.in xmldwalk.c xmlreader.c + include/libxml/Makefile.am include/libxml/xmldwalk.h + include/libxml/xmlversion.h.in: removing xmldwalk module + since it got merged with the xmlreader. + * parser.c: cleanup + * win32/libxml2.def.src python/libxml2class.txt doc/libxml2-api.xml: + rebuilt the API + * python/tests/Makefile.am python/tests/reader7.py + python/tests/walker.py: adding regression testing for the + new xmlreader APIs, new APIs for reader creation, including + makeing reader "walker" operating on preparsed document trees. + +Sun Oct 20 22:37:03 HKT 2003 William Brack + + * entities.c, valid.c: fixed problem reported on the mailing + list by Melvyn Sopacua - wrong argument order on functions + called through xmlHashScan. + +Sun Oct 19 23:57:45 CEST 2003 Daniel Veillard + + * valid.c xmlIO.c: fixes for compiling using --with-minimum + +Sun Oct 19 23:46:04 CEST 2003 Daniel Veillard + + * tree.c: cleanup xmlNodeGetContent() reusing xmlNodeBufGetContent(), + tested it through the xslt regression suite. + +Sun Oct 19 22:42:16 CEST 2003 Daniel Veillard + + * tree.c include/libxml/tree.h: adding xmlNodeBufGetContent() + allowing to grab the content without forcing allocations. + * python/libxml2class.txt doc/libxml2-api.xml: rebuilt the API + * xpath.c xmldwalk.c: removed a couple of comment errors. + +Sun Oct 19 16:39:36 CEST 2003 Daniel Veillard + + * parser.c: applied patch from Chris Anderson to change back + memcmp with CMPx() + +Sun Oct 19 16:24:19 CEST 2003 Daniel Veillard + + * HTMLparser.c: fixed to not send NULL to %s printing + * python/tests/error.py result/HTML/doc3.htm.err + result/HTML/test3.html.err result/HTML/wired.html.err + result/valid/t8.xml.err result/valid/t8a.xml.err: cleaning + up some of the regression tests error + +Sun Oct 19 15:31:43 CEST 2003 Daniel Veillard + + * include/libxml/nanohttp.h include/libxml/parserInternals.h + include/libxml/xmlIO.h nanohttp.c parserInternals.c xmlIO.c: + Fixed the HTTP<->parser interraction, which should fix 2 long + standing bugs #104790 and #124054 , this also fix the fact that + HTTP error code (> 400) should not generate data, we usually + don't want to parse the HTML error information instead of the + resource looked at. + +Sun Oct 19 19:20:48 HKT 2003 William Brack + + * doc/Makefile.am: enhanced the installation of tutorial files + to avoid installing CVS subdirectories (bug 122943) + +Sun Oct 19 17:33:27 HKT 2003 William Brack + + * xmlIO.c: fixed segfault when input file not present + * tree.c: changed output formatting of XML_CDATA_SECTION + (bug 120917) + +Sun Oct 19 00:15:38 HKT 2003 William Brack + + * include/libxml/parserInternals.h HTMLparser.c HTMLtree.c + SAX2.c catalog.c debugXML.c entities.c parser.c relaxng.c + testSAX.c tree.c valid.c xmlschemas.c xmlschemastypes.c + xpath.c: Changed all (?) occurences where validation macros + (IS_xxx) had single-byte arguments to use IS_xxx_CH instead + (e.g. IS_BLANK changed to IS_BLANK_CH). This gets rid of + many warning messages on certain platforms, and also high- + lights places in the library which may need to be enhanced + for proper UTF8 handling. + +Sat Oct 18 20:34:18 HKT 2003 William Brack + + * genChRanges.py, chvalid.c, include/libxml/chvalid.h, + doc/apibuild.py: enhanced to include enough comments to + make the api doc generation happy. + +Sat Oct 18 07:28:25 EDT 2003 Daniel Veillard + + * nanohttp.c xmlIO.c include/libxml/nanohttp.h: starting work + to fix the HTTP/XML parser integration. + +Sat Oct 18 11:04:32 CEST 2003 Daniel Veillard + + * xmlreader.c include/libxml/xmlreader.h: added new APIs + for creating reader from sources or reusing a reader with + a new source, like the xmlReadxx and xmlCtxtReadxxx + * win32/libxml2.def.src doc/libxml2-api.xml doc/apibuild.py + doc/Makefile.am: regenerated the APIs + * doc/xml.html: applied a patch from Stefan Kost for namesapce docs + +Sat Oct 18 12:46:02 HKT 2003 William Brack + + * genChRanges.py, chvalid.c, include/libxml/chvalid.h, + include/libxml/parserInternals.h: enhanced macros to avoid + breaking ABI from previous versions. + * catalog.c, parser.c, tree.c: modified to use IS_* macros + defined in parserInternals.h. Makes maintenance much easier. + * testHTML.c, testSAX.c, python/libxml.c: minor fixes to avoid + compilation warnings + * configuration.in: fixed pushHTML test error; enhanced for + better devel (me) testing + +Fri Oct 17 14:38:54 CEST 2003 Daniel Veillard + + * legacy.c: remove the warning for startDocument(), as it is used by + glade (or glade-python) + * parser.c relaxng.c xmlschemastypes.c: fixed an assorted set of + invalid accesses found by running some Python based regression + tests under valgrind. There is still a few leaks reported by the + relaxng regressions which need some attention. + * doc/Makefile.am: fixed a make install problem c.f. #124539 + * include/libxml/parserInternals.h: addition of xmlParserMaxDepth + patch from crutcher + +Wed Oct 15 12:47:33 CEST 2003 Daniel Veillard + + * parser.c: Marc Liyanage pointed out that xmlCleanupParser() + was missing xmlCleanupInputCallbacks and xmlCleanupOutputCallbacks + calls. + +Wed Oct 15 10:16:47 CEST 2003 Daniel Veillard + + * vms/build_libxml.com trionan.c: VMS patch from Craig A. Berry + +Mon Oct 13 21:46:25 CEST 2003 Daniel Veillard + + * Makefile.am: small fix from Bjorn Reese + +Mon Oct 13 15:59:25 CEST 2003 Daniel Veillard + + * valid.c: fix a call missing arguments + +Sun Oct 12 18:42:18 HKT 2003 William Brack + + * genChRanges.py, chvalid.c, include/libxml/chvalid.h: fixed + a bug in the range search; enhanced range generation (inline code + if a small number of intervals); enhanced the readability of the + output files. + +Sun Oct 12 00:52:14 CEST 2003 Daniel Veillard + + * chvalid.def chvalid.c include/libxml/chvalid.h: rebuilt + chvalid.def from scratch based on XML 2nd edition REC + and regenerated the code. + +Sat Oct 11 22:54:13 CEST 2003 Daniel Veillard + + * check-xml-test-suite.py: removed some annoying warnings + * chvalid.def chvalid.c include/libxml/chvalid.h: fixed a bug + in the PubidChars definition, regenerated, there is still + a bug left somewhere + * genChRanges.py: save the header directly in include/libxml/ + * configure.in: I generated a 2.6.0beta6 earlier today + +Sat Oct 11 23:32:47 HKT 2003 William Brack + + * fixed small error on previous commit (chvalid.h in + base dir instead of include directory) + +Sat Oct 11 23:11:22 HKT 2003 William Brack + + * genChRange.py, chvalid.def, chvalid.c, include/libxml/chvalid.h: + new files for a different method for doing range validation + of character data. + * Makefile.am, parserInternals.c, include/libxml/Makefile.am, + include/libxml/parserInternals.h: modified for new range method. + * catalog.c: small enhance for warning message (using one + of the new range routines) + +Sat Oct 11 13:24:57 CEST 2003 Daniel Veillard + + * valid.c include/libxml/valid.h: adding an serror field to + the validation context breaks the ABI for the xmlParserCtxt + structure since it's embedded by content and not by reference + +Sat Oct 11 12:46:49 CEST 2003 Daniel Veillard + + * configure.in: patch from Mike Hommey + * threads.c: applied Windows patch from Jesse Pelton and Stephane + Bidoul + * parser.c: fix the potentially nasty access to ctxt->serror + without checking first that the SAX block is version 2 + +Fri Oct 10 21:34:01 CEST 2003 Daniel Veillard + + * SAX2.c: fixed a nasty bug with interning some text strings + * configure.in: prepare for beta5 of 2.6.0 + * libxml.h nanoftp.c nanohttp.c xmlIO.c include/libxml/xmlerror.h: + better error handling for I/O and converted FTP and HTTP + * parser.c: fixed another bug + +Fri Oct 10 16:45:20 CEST 2003 Daniel Veillard + + * SAX2.c: fixed uninitialized new field. + * result/VC/OneID2 result/relaxng/*.err: fixed a typo updating + all messages + +Fri Oct 10 16:19:17 CEST 2003 Daniel Veillard + + * include/libxml/tree.h: make room in Doc, Element, Attributes + for PSVI type informations. + +Fri Oct 10 16:08:02 CEST 2003 Daniel Veillard + + * HTMLparser.c c14n.c catalog.c error.c globals.c parser.c + parserInternals.c relaxng.c valid.c xinclude.c xmlIO.c xmlregexp.c + xmlschemas.c xpath.c xpointer.c include/libxml/globals.h + include/libxml/parser.h include/libxml/valid.h + include/libxml/xmlerror.h: Setting up the framework for structured + error reporting, touches a lot of modules, but little code now + the error handling trail has been cleaned up. + +Fri Oct 10 14:29:42 CEST 2003 Daniel Veillard + + * c14n.c include/libxml/xmlerror.h: converted the C14N module too + +Fri Oct 10 13:40:51 CEST 2003 Daniel Veillard + + * xpath.c: cleanup + * xpointer.c include/libxml/xmlerror.h: migrated XPointer module + to the new error mechanism + +Fri Oct 10 12:49:53 CEST 2003 Daniel Veillard + + * error.c xmlschemas.c: a bit of cleanup + * result/schemas/*.err: updated with the new result strings + +Fri Oct 10 03:58:39 PDT 2003 William Brack + + * xpath.c: fixed bug 124061 + +Fri Oct 10 02:47:22 CEST 2003 Daniel Veillard + + * Makefile.am: cleanup + * encoding.c: fix a funny typo + * error.c xmlschemas.c xmlschemastypes.c include/libxml/xmlerror.h: + converted the Schemas code to the new error handling. PITA, + still need to check output from regression tests. + +Thu Oct 9 15:13:53 CEST 2003 Daniel Veillard + + * HTMLtree.c include/libxml/xmlerror.h: converted too + * tree.c: small cleanup + +Thu Oct 9 13:44:57 CEST 2003 Daniel Veillard + + * xinclude.c: comment fix + * catalog.c include/libxml/xmlerror.h: migrating the catalog code + to the new infrastructure + +Thu Oct 9 00:36:03 CEST 2003 Daniel Veillard + + * xmlIO.c: final error handling cleanup + * xinclude.c error.c: converted XInclude to the new error handling + * include/libxml/xmlerror.h: added XInclude errors + +Wed Oct 8 23:31:23 CEST 2003 Daniel Veillard + + * parser.c: bug in compression saving was crashing galeon + reported by teuf + +Wed Oct 8 21:18:12 CEST 2003 Daniel Veillard + + * error.c tree.c xmlIO.c xmllint.c: more cleanup through the + I/O error path + +Wed Oct 8 20:57:27 CEST 2003 Daniel Veillard + + * xmlIO.c: better handling of error cases + +Wed Oct 8 13:51:14 CEST 2003 Daniel Veillard + + * xmlIO.c xmllint.c include/libxml/xmlerror.h: first pass at + cleaning up error handling in the I/O module. + +Wed Oct 8 10:52:05 CEST 2003 Daniel Veillard + + * xmlregexp.c include/libxml/xmlerror.h: error handling + cleanup of the Regexp module. + +Wed Oct 8 01:09:05 CEST 2003 Daniel Veillard + + * tree.c: converting the tree module too + * error.c include/libxml/xmlerror.h: created a simpler internal + error reporting function. + +Tue Oct 7 23:19:39 CEST 2003 Daniel Veillard + + * error.c include/libxml/xmlerror.h include/libxml/xpath.h + include/libxml/xpathInternals.h xpath.c: cleaning up XPath + error reporting that time. + * threads.c: applied the two patches for TLS threads + on Windows from Jesse Pelton + * parser.c: tiny safety patch for xmlStrPrintf() make sure the + return is always zero terminated. Should also help detecting + passing wrong buffer size easilly. + * result/VC/* result/valid/rss.xml.err result/valid/xlink.xml.err: + updated the results to follow the errors string generated by + last commit. + +Tue Oct 7 14:16:45 CEST 2003 Daniel Veillard + + * relaxng.c include/libxml/xmlerror.h: last cleanup of error + handling in the Relax-NG module. + +Tue Oct 7 13:30:39 CEST 2003 Daniel Veillard + + * error.c relaxng.c include/libxml/xmlerror.h: switched Relax-NG + module to teh new error reporting. Better default report, adds + the element associated if found, context and node are included + in the xmlError + * python/tests/reader2.py: the error messages changed. + * result/relaxng/*: error message changed too. + +Mon Oct 6 10:46:35 CEST 2003 Daniel Veillard + + * win32/Makefile.bcb win32/Makefile.mingw win32/Makefile.msvc + win32/configure.js: applied patch from Stéphane Bidoul to + fix the compilation of 2.6.0 code on Win32 + +Mon Oct 6 10:16:30 CEST 2003 Daniel Veillard + + * check-xml-test-suite.py: fixing the script + * parser.c: replace sequences of RAW && NXT(.) == '.' with + memcmp calls, seems to not break conformance, slightly inflate + the size of the gcc generated code though. + +Sun Oct 5 23:30:48 CEST 2003 Daniel Veillard + + * parserInternals.c parser.c valid.c include/libxml/parserInternals.h: + more cleanup of error handling in parserInternals, sharing the + routine for memory errors. + +Sun Oct 5 15:49:14 CEST 2003 Daniel Veillard + + * HTMLparser.c Makefile.am legacy.c parser.c parserInternals.c + include/libxml/xmlerror.h: more code cleanup, especially around + error messages, the HTML parser has now been upgraded to the new + handling. + * result/HTML/*: a few changes in the resulting error messages + +Sat Oct 4 23:06:41 CEST 2003 Daniel Veillard + + * parser.c include/libxml/xmlerror.h: more error/warning + handling cleanups, the XML parser module should be okay now. + +Sat Oct 4 01:58:27 CEST 2003 Daniel Veillard + + * Makefile.am configure.in xmldwalk.c include/libxml/Makefile.am + include/libxml/xmldwalk.h include/libxml/xmlversion.h.in: + integrated the xmlDocWalker API given by Alfred Mickautsch, + and providing an xmlReader like API but working on a xmlDocPtr. + +Sat Oct 4 00:18:29 CEST 2003 Daniel Veillard + + * Makefile.am: more cleanup in make tests + * error.c valid.c parser.c include/libxml/xmlerror.h: more work + in the transition to the new error reporting strategy. + * python/tests/reader2.py result/VC/* result/valid/*: + few changes in the strings generated by the validation output + +Fri Oct 3 00:19:02 CEST 2003 Daniel Veillard + + * Makefile.am: changed 'make tests' to use a concise output, + scrolling to see where thing broke wasn't pleasant + * configure.in: some beta4 preparation, but not ready yet + * error.c globals.c include/libxml/globals.h include/libxml/xmlerror.h: + new error handling code, last error informations are stored + in the parsing context or a global variable, new APIs to + handle the xmlErrorPtr type. + * parser.c parserInternals.c valid.c : started migrating to the + new error handling code, it's a royal pain. + * include/libxml/parser.h include/libxml/parserInternals.h: + moved the definition of xmlNewParserCtxt() + * parser.c: small potential buffer access problem in push code + provided by Justin Fletcher + * result/*.sax result/VC/PENesting* result/namespaces/* + result/valid/*.err: some error messages were sligthly changed. + +Thu Oct 2 13:01:13 2003 Aleksey Sanin + + * include/libxml/parser.h parser.c: introduced xmlStrPrintf + function (wrapper around snprintf) + +Wed Oct 1 21:12:06 CEST 2003 Daniel Veillard + + * entities.c: Fix error on output of high codepoint charref like + 􏿿 , reported by Eric Hanchrow + +Wed Oct 1 14:20:10 CEST 2003 Daniel Veillard + + * DOCBparser.c include/libxml/DOCBparser.h: let's see how much + of a pain murrayc is really gonna be. + +Wed Oct 1 11:03:40 CEST 2003 Daniel Veillard + + * xmlreader.c: Applied fix for bug #123481 reported by Peter Derr + +Tue Sep 30 15:34:31 CEST 2003 Daniel Veillard + + * entities.c legacy.c parser.c: made the predefined entities + static predefined structures to avoid the work, memory and + hazards associated to initialization/cleanup. + +Tue Sep 30 14:30:47 CEST 2003 Daniel Veillard + + * HTMLparser.c Makefile.am configure.in legacy.c parser.c + parserInternals.c testHTML.c xmllint.c include/libxml/HTMLparser.h + include/libxml/parser.h include/libxml/parserInternals.h + include/libxml/xmlversion.h.in: added a new configure + option --with-push, some cleanups, chased code size anomalies. + Now a library configured --with-minimum is around 150KB, + sounds good enough. + +Tue Sep 30 12:31:00 AEST 2003 Malcolm Tredinnick + + * libxml-2.0-uninstalled.pc.in: New file for building against + uninstalled libxml2 builds. + * configure.in, Makefile.am: Support the *-uninstalled.pc file. + * .cvsignore: Ignore the new generated *.pc file. + +Tue Sep 30 02:38:16 CEST 2003 Daniel Veillard + + * Makefile.am SAX.c SAX2.c configure.in globals.c parser.c + parserInternals.c testReader.c testSAX.c xmlIO.c xmllint.c + xmlreader.c example/gjobread.c include/libxml/xmlversion.h.in: + added 2 new configure option: --with-reader --with-sax1 + to allow removing the reader or non-xmlReadxxx() interfaces. + +Mon Sep 29 19:58:26 CEST 2003 Daniel Veillard + + * configure.in entities.c tree.c valid.c xmllint.c + include/libxml/tree.h include/libxml/xmlversion.h.in: + Adding a configure option to remove tree manipulation + code which is not strictly needed by the parser. + +Mon Sep 29 15:23:41 CEST 2003 Daniel Veillard + + * nanoftp.c nanohttp.c: last finishing touch to the BeOS + patch from Marcin 'Shard' Konicki + +Mon Sep 29 15:15:08 CEST 2003 Daniel Veillard + + * HTMLtree.c SAX2.c c14n.c catalog.c configure.in debugXML.c + encoding.c entities.c nanoftp.c nanohttp.c parser.c relaxng.c + testAutomata.c testC14N.c testHTML.c testRegexp.c testRelax.c + testSchemas.c testXPath.c threads.c tree.c valid.c xmlIO.c + xmlcatalog.c xmllint.c xmlmemory.c xmlreader.c xmlschemas.c + example/gjobread.c include/libxml/HTMLtree.h include/libxml/c14n.h + include/libxml/catalog.h include/libxml/debugXML.h + include/libxml/entities.h include/libxml/nanohttp.h + include/libxml/relaxng.h include/libxml/tree.h + include/libxml/valid.h include/libxml/xmlIO.h + include/libxml/xmlschemas.h include/libxml/xmlversion.h.in + include/libxml/xpathInternals.h python/libxml.c: + Okay this is scary but it is just adding a configure option + to disable output, this touches most of the files. + +Mon Sep 29 12:53:56 CEST 2003 Daniel Veillard + + * xmlmemory.c: better fix, avoids breaking the python bindings + +Mon Sep 29 11:21:33 CEST 2003 Daniel Veillard + + * xmlmemory.c: fix a compilation problem when configuring + with debug but without mem-debug + +Sun Sep 28 20:53:17 CEST 2003 Daniel Veillard + + * Makefile.am: cleanup, creating a new legacy.c module, + made sure make tests ran in reduced conditions + * SAX.c SAX2.c configure.in entities.c globals.c parser.c + parserInternals.c tree.c valid.c xlink.c xmlIO.c xmlcatalog.c + xmlmemory.c xpath.c xmlmemory.c include/libxml/xmlversion.h.in: + increased the modularization, allow to configure out + validation code and legacy code, added a configuration + option --with-minimum compiling only the mandatory code + which then shrink to 200KB. + +Sun Sep 28 02:15:07 CEST 2003 Daniel Veillard + + * parser.c: fix a bug raised by the Mips compiler. + * include/libxml/SAX.h include/libxml/parser.h: move the + SAXv1 block definitions to parser.h fixes bug #123380 + * xmlreader.c include/libxml/xmlreader.h: reinstanciate + the attribute and element pool borken 2 commits ago. + Start playing with an entry point to preserve a subtree. + * entities.c: remove a warning. + +Sat Sep 27 12:19:38 PDT 2003 William Brack + + * encoding.c, parser.c, relaxng.c: further (final?) minor + changes for compilation warnings. No change to logic. + +Fri Sep 26 18:03:42 PDT 2003 William Brack + + * parser.c: fixed small problem with missing entities (test/ent2) + +Sat Sep 27 01:25:39 CEST 2003 Daniel Veillard + + * parser.c: William's change allowed to spot a nasty bug in xmlDoRead + if the result is not well formed that ctxt->myDoc is not NULL + and uses the context dictionnary. + +Fri Sep 26 21:09:34 CEST 2003 Daniel Veillard + + * parser.c: other patches from William Brack to avoid + compilation warnings on AIX. + +Fri Sep 26 11:03:08 PDT 2003 William Brack + + * HTMLparser.c, entities.c, xmlreader.c: minor change to + avoid compilation warnings on some (e.g. AIX) systems + +Fri Sep 26 16:49:25 CEST 2003 Daniel Veillard + + * parserInternals.c: fixed a backward compatibility problem + when formatting "deprecated SAXv1 function ignorableWhitespace" + could be reproduced by xmllint --format + +Fri Sep 26 15:50:44 CEST 2003 Daniel Veillard + + * doc/libxml2-api.xml: rebuilt the API + * xmllint.c doc/xmllint.1 doc/xmllint.xml: added the new options + --nocdata and --nsclean to remove CDATA section and surperfluous + namespace declarations + * parser.c SAX2.c: implementation of the 2 new options + +Fri Sep 26 14:41:53 CEST 2003 Daniel Veillard + + * HTMLparser.c testHTML.c xmllint.c include/libxml/HTMLparser.h: + added the same htmlRead APIs than their XML counterparts + * include/libxml/parser.h: new parser options, not yet implemented, + added an options field to the context. + * tree.c: patch from Shaun McCance to fix bug #123238 when ]]> + is found within a cdata section. + * result/noent/cdata2 result/cdata2 result/cdata2.rdr + result/cdata2.sax test/cdata2: add one more cdata test + +Thu Sep 25 23:03:23 CEST 2003 Daniel Veillard + + * parser.c xmllint.c doc/libxml2-api.xml include/libxml/parser.h: + Changed the new xmlRead/xmlCtxtRead APIs to have an extra + base URL parameter when not loading from a file or URL. + +Thu Sep 25 16:23:58 CEST 2003 Daniel Veillard + + * configure.in: preparing a beta3 solving the ABI problems + * globals.c parser.c parserInternals.c testHTML.c HTMLparser.c SAX.c + include/libxml/globals.h include/libxml/SAX.h: make sure the + global variables for the default SAX handler are V1 ones to + avoid ABI compat problems. + * xmlreader.c: cleanup of uneeded code + * hash.c: fix a comment + +Thu Sep 25 14:16:51 CEST 2003 Daniel Veillard + + * SAX2.c hash.c parser.c include/libxml/xmlexports.h + include/libxml/xmlmemory.h include/libxml/xmlversion.h.in: + fixing some comments to avoid warnings from apibuild.py + +Wed Sep 24 23:42:08 CEST 2003 Daniel Veillard + + * win32/configure.js: patch from Stephane Bidoul for configuring + the beta2 version #123104 + +Wed Sep 24 23:17:59 CEST 2003 Daniel Veillard + + * Makefile.am: adding repeated parsing and validating tests + * SAX2.c parser.c tree.c include/libxml/parser.h: make the new + DOM tree building interfaces use the dictionary from the + parsing context to build the element and attributes names + as well as formatting spaces and short text nodes + * include/libxml/dict.h dict.c: added some reference counting + for xmlDictPtr because they can be shared by documents and + a parser context. + * xmlreader.c: a bit of cleanup, remove the specific tree freeing + functions and use the standard ones now. + * xmllint.c: add --nodict + * python/libxml.c: fix a stupid bug so that ns() works on + attribute nodes. + +Tue Sep 23 23:07:45 CEST 2003 Daniel Veillard + + * parser.c include/libxml/parser.h: adding a new set of + API for parsing xmlReadDoc() xmlReadFile() ... xmlReadIO() + and xmlCtxtReadDoc() ... xmlCtxtReadIO(). That with + a clear define of xmlParserOption, xmlCtxtUseOptions() + should simplify custom parsing without being tempted to + use global variables, and xmlCtxtReset() should allow reuse + of a context for multiple parsing. + * xmllint.c: switched to use xmlReadXXX, allow options to + be used simultaneously with less troubles. + * tree.c: simple warning removal + * doc/apibuild.py: small fix + * doc/libxml2-api.xml win32/libxml2.def.src: updated + +Tue Sep 23 11:15:23 CEST 2003 Daniel Veillard + + * parser.c: revert xmlCreateDocParserCtxt() since this break + the parseDoc() python bindings + +Tue Sep 23 11:00:18 CEST 2003 Daniel Veillard + + * parser.c: make sure xmlDetectSAX2() is called only at + parsing time to avoid breaking apps changing the SAX + callbacks after context allocation, change xmlCreateDocParserCtxt() + to use an immutable buffer instead of a copy + +Tue Sep 23 09:40:33 CEST 2003 Daniel Veillard + + * xmlIO.c: applied patch from Markus Keim fixing a problem + with I/O callback registration. + * include/libxml/xmlerror.h: fixed #122994 comment numbering + for xmlParserErrors + +Mon Sep 22 12:21:11 CEST 2003 Daniel Veillard + + * tree.c include/libxml/tree.h: the uri arg to xmlNodeSetBase is + really a const xmlChar* + * xmlreader.c include/libxml/xmlreader.h: addin the + xmlTextReaderConstString() to get an interned string from + the reader + +Sun Sep 20 17:22:20 PDT 2003 William Brack + + * error.c: fixed a warning message (trivial) + * doc/search.php: removed incorrect warning message when word + search not found in last of multiple tables (bug 119535) + +Fri Sep 19 14:26:28 CEST 2003 Daniel Veillard + + * configure.in: preparing a 2.6.0-beta2 release + * xmlIO.c: avoid a warning + * tree.c: avoid duplicate code in xmlReplaceNode as pointed out + by Chris Ryland + * include/libxml/dict.h: add a QName access lookup to the + dictionary. + * xmlreader.c include/libxml/xmlreader.h: adding const access + based on the dictionary interface for string read from the + reader, the node content access is still TODO, it's too different + +Fri Sep 19 00:01:08 CEST 2003 Daniel Veillard + + * SAX2.c: fixing namespace DTD validations + * result/valid/ns2.xml result/valid/ns.xml: the output of defaulted + namespaces is slightly different now. + * Makefile.am: report the memory used in Timingtests (as well as time) + +Thu Sep 18 15:29:46 CEST 2003 Daniel Veillard + + * Makefile.am: add streaming on memory regression tests, found + bad bugs in the reader interface + * xmlreader.c: fixing bugs w.r.t. very large names, and special + condition in end of file. + * xmlIO.c tree.c include/libxml/tree.h include/libxml/xmlIO.h: + adding immutable buffers, and parser input based on those, + but this should not be used (yet) for general parsing + * parser.c: added a comment about using immutable buffers for + general parsing. + * result/bigname.xml.rdr result/bigname2.xml.rdr: fixing the + output of the regression tests + * xmllint.c: using the immutable buffers when streaming on + mmaped file (--stream --memory) + +Thu Sep 18 12:04:50 CEST 2003 Daniel Veillard + + * dict.c: the last patch broke unicity of returned strings, removed + +Thu Sep 18 00:31:02 CEST 2003 Daniel Veillard + + * Makefile.am: add a Timingtests target to check bad behaviour + from the streaming engine + * dbgen.pl dbgenattr.pl: perl script to generate big instances + * xmlreader.c: fix a bad behaviour on large buffer inputs + +Wed Sep 17 23:25:47 CEST 2003 Daniel Veillard + + * dict.c xmlreader.c: two small improvements + +Wed Sep 17 22:53:32 CEST 2003 Daniel Veillard + + * parserInternals.c: avoid a leak with previous patch + +Wed Sep 17 22:06:11 CEST 2003 Daniel Veillard + + * python/libxml.c: use stderr and not stdout for default errors + in python environment bug #122552 + +Wed Sep 17 21:33:57 CEST 2003 Daniel Veillard + + * parserInternals.c: small fix from Rob Richards for input filename + * xmllint.c: fixes for --repeat and --memory/--stream for speed tests + * xmlIO: adding a guard in one function + +Wed Sep 17 15:57:44 CEST 2003 Daniel Veillard + + * SAX2.c xmlreader.c include/libxml/parser.h: more performance hunting + reducing memory allocation and free and avoiding expensive routines + +Wed Sep 17 12:23:41 CEST 2003 Daniel Veillard + + * SAX2.c parser.c parserInternals.c xmlreader.c: started messing + seriously with per-document dict and element and attribute nodes + reuse in the xmlReader. This seems to lead to an interesting + speedup of the xmlReader already. + +Wed Sep 17 01:07:56 CEST 2003 Daniel Veillard + + * dict.c include/libxml/dict.h: do string allocations in large + pools, allowing to find if a string pertain to a dict quickly + * xmllint.c: fix --stream --repeat --timing + * Makefile.am: the testThreads run output should be seen. + +Mon Sep 15 16:46:28 CEST 2003 Daniel Veillard + + * SAX2.c include/libxml/parser.h: starting work on reusing the + parser dictionary for the element and attribute tag names. + Add pools for Element and Attributes in the parser context, + which should help speeding up the reader. + * Makefile.am result/*.rdr : adding non-python reader regression + tests. + +Mon Sep 15 14:54:42 CEST 2003 Daniel Veillard + + * SAX2.c parser.c valid.c: starting to cleanup some of the + problems exposed by the W3C/NIST regression suite. + * result/ent7.sax result/xml2.sax: small fixes. + +Mon Sep 15 11:46:47 CEST 2003 Daniel Veillard + + * parser.c: more parser error factoring + +Sun Sep 14 21:53:39 PDT 2003 William Brack + + * HTMLtree.c: Fixed bug 121394 - missing ns on attributes + +Sun Sep 14 21:43:32 CEST 2003 Daniel Veillard + + * parser.c include/libxml/xmlerror.h: factoring of more + error handling code, serious size reduction and more lisibility + of the resulting code. + * parserInternals.c parser.c include/libxml/parserInternals.h + include/libxml/parser.h: changing the way VC:Proper Group/PE Nesting + checks are done, use a counter for entities. Entities where freed and + reallocated at the same address failing the check. + * tree.c: avoid a warning + * result/valid/* result/VC/*: this slightly changes some validation + error messages. + +Sun Sep 14 11:03:27 PDT 2003 William Brack + + * valid.c: fixed bug 121759 - early declaration of + attribute-list in external DTD + +Sat Sep 13 14:42:11 CEST 2003 Daniel Veillard + + * parser.c include/libxml/xmlerror.h: starting cleaning up + error handling, factorize error processing + * doc/xmllint.html: update of the page, remove --sgml + +Sat Sep 13 02:13:50 CEST 2003 Daniel Veillard + + * Makefile.am DOCBparser.c parserInternals.c testDocbook.c + xmllint.c doc/xmllint.xml doc/xmllint.1: removing the + broken pseudo SGML DocBook parser code. + +Fri Sep 12 17:24:11 CEST 2003 Daniel Veillard + + * xpath.c: fix a problem with strcpy() in xmlXPathFormatNumber() + valgrind pointed out the strings overlapped. cleanup . + +Fri Sep 12 11:43:12 CEST 2003 Daniel Veillard + + * tree.c: applied speedup to xmlSearchNs() as suggested by + Luca Padovani. Cleaned up xmlSearchNsByHref() in the process + applying the same trick. + +Fri Sep 12 01:36:20 CEST 2003 Daniel Veillard + + * parser.c parserInternals.c tree.c include/libxml/parser.h + include/libxml/xmlerror.h: adding namespace checkings + while making sure they still parse as wellformed documents. + Add an nsWellFormed status report to the context, and + provide new appropriate error codes. + * Makefile.am result/namespaces/* test/namespaces/*: add + specific regression testing for the new namespace support + * test/att5 result/noent/att5 result/att5 result/att5.sax: + add more coverage for the attribute parsing and normalization + code. + +Fri Sep 12 01:34:19 CEST 2003 Daniel Veillard + + * threads.c: backport of a thread bugfix from 2_5_X branch + +Thu Sep 11 18:29:18 CEST 2003 Daniel Veillard + + * parser.c: fixed a bug in one corner case of attribute parsing. + +Thu Sep 11 16:21:53 CEST 2003 Daniel Veillard + + * configure.in doc/* : 2.6.0beta1 changes + * SAX2.c hash.c parser.c parserInternals.c: Fixing attribute + normalization, might not be totally fixed but this should + make sure SAX event provide the right strings for attributes + except entities for which libxml2 is different by default + This should fix #109564 + * result/attrib.xml.sax result/ent3.sax result/p3p.sax: minor changes + in attribute callback values + * result/c14n/with-comments/example-4 + result/c14n/without-comments/example-4: this also fixes a subtle + bug in the canonicalization tests. + +Wed Sep 10 12:38:44 CEST 2003 Daniel Veillard + + Time to commit 3 days of work rewriting the parser internal, + fixing bugs and migrating to SAX2 interface by default. There + is some work letf TODO, like namespace validation and attributes + normalization (this break C14N right now) + * Makefile.am: fixed the test rules + * include/libxml/SAX2.h include/libxml/parser.h + include/libxml/parserInternals.h SAX2.c parser.c + parserInternals.c: changing the parser, migrating to SAX2, + adding new interface to switch back to SAX1 or initialize a + SAX block for v1 or v2. Most of the namespace work is done + below SAX, as well as attribute defaulting + * globals.c: changed initialization of the default SAX handlers + * hash.c tree.c include/libxml/hash.h: added QName specific handling + * xmlIO.c: small fix + * xmllint.c testSAX.c: provide a --sax1 switch to test the old + version code path + * result/p3p result/p3p.sax result/noent/p3p test/p3p: the new code + pointed out a typo in a very old test namespace + +Sun Sep 7 19:58:33 PTD 2003 William Brack + + * xmlIO.c include/libxml/xmlIO.h parser.c: Implemented detection + of compressed files, setting doc->compressed appropriately + (bug #120503). + +Sun Sep 7 22:53:06 CEST 2003 Daniel Veillard + + * parser.c: try to cope with the fact that apps may still + have allocated smaller SAX callbak block + +Sun Sep 7 11:11:45 CEST 2003 Daniel Veillard + + * dict.c: allow to give -1 for undefined length in lookups + * include/libxml/parser.h parser.c parserInternals.c testSAX.c: + first round of work on the new SAX2 interfaces, the API + will change but commiting before changing for historical + reference. + +Sat Sep 6 10:55:01 PTD 2003 William Brack + + * SAX2.c, xmlIO.c: fixed bug #121210 (callback to sax->error, + sax->warning with wrong params). + +Fri Sep 5 10:33:42 CEST 2003 Daniel Veillard + + * include/libxml/globals.h: patch from Stéphane Bidoul to export + globals entry points to the python bindings + +Wed Sep 3 15:24:41 CEST 2003 Daniel Veillard + + * HTMLparser.c: when creating a DOCTYPE use "html" lowercase + by default instead of "HTML" + * parser.c xmlreader.c: optimization, gain a few % parsing speed by + avoiding calls to "areBlanks" when not needed. + * include/libxml/parser.h include/libxml/tree.h: some structure + extensions for future work on using per-document dictionaries. + +Wed Sep 3 15:08:06 CEST 2003 Daniel Veillard + + * Makefile.am results/*.sax SAXResult/*: removing the SAXresults + tree, keeping result in the same tree, added SAXtests to the + default "make tests" + +Tue Sep 2 15:59:04 CEST 2003 Igor Zlatkovic + + * include/libxml/xmlexports.h: defined additional macros which + affect exports and added mingw section + +Mon Sep 1 15:15:18 PDT 2003 William Brack + + * doc/index.py: fixed problem parsing xhtml docs + * doc/xmlreader.html,doc/guidelines.html: small modification + to avoid problem in python parsing. + * doc/search.php: fixed upper case filename problem for XSLT docs + +Mon Sep 1 22:55:09 CEST 2003 Daniel Veillard + + * xinclude.c: patch from Mark Vakoc that allows compiling + with XInclude but without XPointer support. + +Mon Sep 1 22:31:38 CEST 2003 Daniel Veillard + + * configure.in xml2-config.in: Applied a patch from Kevin P. Fleming + to add --libtool-libs option to xml2-config script. + +Sun Aug 31 21:52:12 PDT 2003 William Brack + + * doc/README.docs, doc/Makefile.am: new file added, + giving some description of the documentation generation process + * doc/search.php: fixed problem with upper case on filenames + +Fri Aug 29 12:25:01 CEST 2003 Igor Zlatkovic + + * win32/Makefile.bcb: updates by Eric Zurcher + +Thu Aug 28 22:58:38 PDT 2003 William Brack + + * doc/apibuild.py, doc/libxml2-api.xml: enhanced code + to compensate for pollution from Igor's header taint + (quick before Daniel notices) + +Thu Aug 28 23:01:36 CEST 2003 Daniel Veillard + + * SAX2.c: fixed a namespace error on attribute reporting bug + pointed out by Tobias Reif + * test/p3p result/p3p result/noent/p3p: this test case was wrong + using xmlsn instead of xmlns... + +Thu Aug 28 18:25:07 CEST 2003 Igor Zlatkovic + + * include/libxml/globals.h include/libxml/xmlexports.h: fixed + typos reported by Mark Vakoc + +Thu Aug 28 08:59:51 MDT 2003 John Fleck + + add: + * doc/tutorial/api.html + * doc/tutorial/ar01s09.html + * doc/tutorial/includexpath.c + updated + * doc/tutorial/*.html + fix my bad - forgot to check in new files when I last + updated + + +Thu Aug 28 14:31:13 CEST 2003 Igor Zlatkovic + + * win32/Makefile.bcb: new file, support for Borland C++ + * xmllint.c: fixed time inclusion for various compilers + +Thu Aug 28 12:32:59 CEST 2003 Igor Zlatkovic + + * parser.c parserInternals.c DOCBparser.c HTMLparser.c: added + few casts to shut the compiler warnings + +Thu Aug 28 12:23:51 CEST 2003 Igor Zlatkovic + + * win32/Makefile.* win32/configure.js: fixed for mingw + +Thu Aug 28 10:01:44 CEST 2003 Daniel Veillard + + * globals.c threads.c: fixing bug #120870 try to avoid problem + with uninitialized mutexes + +Wed Aug 27 16:12:41 CEST 2003 Daniel Veillard + + * relaxng.c: fixed an error reporting bug in Relax-NG when we end + up with multiple states, select the "best" one. Fix #120682 + * result/relaxng/tutor11_2_3.err: small change resulting + +Wed Aug 27 11:25:25 CEST 2003 Daniel Veillard + + * xmlschemastypes.c: applied base64 support patch from Anthony Carrico + +Wed Aug 27 10:58:51 CEST 2003 Igor Zlatkovic + + * include/libxml/[threads-xpointer].h: realigned parameters + after taint + +Wed Aug 27 09:59:54 CEST 2003 Igor Zlatkovic + + * include/libxml/xmlexports.h: fixed defs for Borland compiler, + as reported by Eric Zurcher + +Tue Aug 26 15:54:04 CEST 2003 Daniel Veillard + + * relaxng.c: fixed bug #120386 again a problem introduced when + trying to reuse automata for content validation. Fix a bug report + problem on zeroOrMore + * result/relaxng/tutor3_7_err: change slightly error reporting. + +Mon Aug 25 13:24:57 CEST 2003 Daniel Veillard + + * include/libxml/Makefile.am: make sure the new header will + be included when generating a new distribution. + +Mon Aug 25 12:37:05 CEST 2003 Daniel Veillard + + * relaxng.c: fixed a couple of stupid bugs in the state allocation + routines which led to bug #120040 and the ones reported by + Martijn Faassen + +Mon Aug 25 12:37:23 CEST 2003 Igor Zlatkovic + + * include/libxml/parserInternals.h include/libxml/relaxng.h + include/libxml/SAX.h include/libxml/SAX2.h: realigned the + parameters after taint. + +Mon Aug 25 11:16:01 CEST 2003 Igor Zlatkovic + + * include/libxml/xmlversion.h.in: moved export defs to a separate + file for consistency. + * include/libxml/xmlexports.h: new file, contains export defs. + +Mon Aug 25 11:01:49 CEST 2003 Igor Zlatkovic + + * include/libxml/*.h genUnicode.py: exportability taint + of the headers. + +Thu Aug 21 12:37:46 CEST 2003 Daniel Veillard + + * SAX.c: make the deprecated interfaces log an error message + to be sure it won't get used. + +Thu Aug 21 00:50:32 CEST 2003 Daniel Veillard + + * Makefile.am SAX2.c include/libxml/Makefile.am include/libxml/SAX2.h: + Adding new version of the SAX interface, it's not there yet, + currently just preparing the work + * globals.c parser.c SAX.c include/libxml/SAX.h + include/libxml/globals.h include/libxml/parser.h: doing some + refactoring of the SAXv1 interfaces, obsoleting a bunch of them + while keeping functionalities, preparing SAX2 integration. + * dict.c: small cleanup. + +Wed Aug 20 00:20:01 CEST 2003 Daniel Veillard + + * tree.c: fixes a small bug introduced in last commit and detected + by valgrind. + +Tue Aug 19 16:54:18 CEST 2003 Daniel Veillard + + * dict.c hash.c: optimization when freeing hash tables. + * parser.c xmlIO.c include/libxml/tree.h: some tuning of buffer + allocations + * parser.c parserInternals.c include/libxml/parser.h: keep a + single allocated block for all the attributes callbacks, + avoid useless malloc()/free() + * tree.c: do not realloc() when growing a buffer if the buffer + ain't full, malloc/memcpy/free avoid copying memory. + +Mon Aug 18 18:37:01 CEST 2003 Daniel Veillard + + * xmllint.c doc/xmllint.xml doc/xmllint.1: added option + --dtdvalidfpi for Tobias Reif + +Mon Aug 18 14:03:03 CEST 2003 Daniel Veillard + + * dict.c include/libxml/dict.h Makefile.am include/libxml/Makefile.am: + new dictionary module to keep a single instance of the names used + by the parser + * DOCBparser.c HTMLparser.c parser.c parserInternals.c valid.c: + switched all parsers to use the dictionary internally + * include/libxml/HTMLparser.h include/libxml/parser.h + include/libxml/parserInternals.h include/libxml/valid.h: + Some of the interfaces changed as a result to receive or return + "const xmlChar *" instead of "xmlChar *", this is either + insignificant from an user point of view or when the returning + value changed, those function are really parser internal methods + that no user code should really change + * doc/libxml2-api.xml doc/html/*: the API interface changed and + the docs were regenerated + +Sun Aug 17 23:05:38 CEST 2003 Daniel Veillard + + * parser.c: applied patch to xmlCleanupParser from Dave Beckett + +Sat Aug 16 22:53:42 HKT 2003 William Brack + + * doc/parsedecl.py, doc/libxml2-refs.xml, doc/API*.html: + fixed part (2) of bug 119535 (wrong alpha case on filenames) + +Sat Aug 16 20:35:28 HKT 2003 William Brack + + * doc/API*.html, doc/html/*: regenerated API documentation + for xmlsoft.org (part of Bug 119535) + +Fri Aug 15 14:58:37 HKT 2003 William Brack + + * encoding.c, threads.c, include/libxml/HTMLparser.h, + doc/libxml2-api.xml: Minor changes to comments, etc. for + improving documentation generation + * doc/Makefile.am: further adjustment to auto-generation of + win32/libxml2.def.src + +Fri Aug 15 02:24:20 CEST 2003 Daniel Veillard + + * News configure.in: preparing libxml2-2.5.10 release + * doc/* : updated the doc and rebuilt + +Fri Aug 15 01:55:53 CEST 2003 Daniel Veillard + + * parser.c: fixing the xmlSAXParseDTD bug #119536 raised by + Malcolm Tredinnick with the patch he suggested. + +Fri Aug 15 01:37:10 CEST 2003 Daniel Veillard + + * HTMLparser.c: allocation error #119784 raised by Oliver Stoeneberg + +Fri Aug 15 00:41:58 CEST 2003 Daniel Veillard + + * uri.c: fixing an use of strcpy() where both strings overlap + pointed out by valgrind. + +Thu Aug 14 17:10:39 CEST 2003 Daniel Veillard + + * DOCBparser.c globals.c include/libxml/xmlmemory.h: get rid of + some compilation warnings. + * xinclude.c: fix the performance problem reported by Kevin Ruscoe + plus some cleanup and better error reporting. + +Thu Aug 14 14:13:43 CEST 2003 Daniel Veillard + + * encoding.c: applied UTF-16 encoding handling patch provided by + Mark Itzcovitz + * encoding.c parser.c: more cleanup and fixes for UTF-16 when + not having iconv support. + +Thu Aug 14 03:19:08 CEST 2003 Daniel Veillard + + * Makefile.am configure.in example/Makefile.am libxml.h nanoftp.c + nanohttp.c xmllint.c: Applied patch from Mikhail Grushinskiy for + mingw compiler on Windows. + +Thu Aug 14 02:28:36 CEST 2003 Daniel Veillard + + * parser.c: fixed the serious CPU usage problem reported by + Grant Goodale + * HTMLparser.c: applied patch from Oliver Stoeneberg about a free + missing in htmlSAXParseDoc + +Tue Aug 12 22:48:10 HKT 2003 William Brack + + * doc/Makefile.am: Removed dependency from libxml2.def.src + +Tue Aug 12 18:55:08 HKT 2003 William Brack + + * autogen.sh: took away the requirement for automake-1.4, + changed the messages for getting auto* tools to current + gnu pages. + * configure.in: added check for Linux Dec alpha requiring + -ieee flag, fixed test for ipv6 + * trionan.c: fixed problem for compiling on Linux Dec alpha + using native compiler + * doc/Makefile.am: implemented regeneration of win32/libxml2.def.src + whenever libxml2-api.xml is changed. + +Mon Aug 11 17:02:23 CEST 2003 Daniel Veillard + + * parser.c: cleaning up a problem when parsing UTF-16 and libiconv + is not used. + +Sun Aug 10 08:13:22 HKT 2003 William Brack + + * win32/libxml2.def.src: renerated with fixed libxml2-api.xml + +Sun Aug 10 00:22:55 CEST 2003 Daniel Veillard + + * News configure.in: preparing libxml2-2.5.9 release + * doc/* : updated the doc and rebuilt + +Sat Aug 9 20:00:13 CEST 2003 Daniel Veillard + + * include/libxml/xmlreader.h doc/libxml2-api.xml: changing an enum + definition to get a correct API XML description. This was apparently + breaking Windows build. + +Sat Aug 9 13:41:21 CEST 2003 Daniel Veillard + + * HTMLparser.c: fixed a nasty bug #119387, bad heuristic from + the progressive HTML parser front-end on large character data + island leading to an erroneous end of data detection by the + parser. Some cleanup too to get closer from the XML progressive + parser. + +Sat Aug 9 00:42:47 HKT 2003 William Brack + + * win32/configure.js: Added in support for the ISO8859X + module (patch provided by Jesse Pelton) + +Fri Aug 8 15:56:32 CEST 2003 Daniel Veillard + + * HTMLtree.c tree.c threads.c: hum try to avoid some troubles + when the library is not initialized and one try to save, the + locks in threaded env might not been initialized, playing safe + * xmlschemastypes.c: apply patch for hexBinary from Charles Bozeman + * test/schemas/hexbinary_* result/schemas/hexbinary_*: also added + his tests to the regression suite. + +Fri Aug 8 18:47:38 HKT 2003 William Brack + + * win32/defgen.xsl, win32/libxml2.def.src: Bug 119343 + (with apologies to Igor) - Enhanced handling of docb and + nanohttp. + +Thu Aug 7 21:13:22 HKT 2003 William Brack + + * encoding.c: further small changes for warnings when + configured with --with-iconv=no + +Wed Aug 6 12:32:11 HKT 2003 William Brack + + * error.c trionan.[ch] testThreads.c python/generator.py: + further small changes to elminate most of the remaining + warnings. + +Tue Aug 5 23:51:21 HKT 2003 William Brack + + * error.c HTMLparser.c testC14N.c testHTML.c testURI.c + xmlcatalog.c xmlmemory.c xmlreader.c xmlschemastypes.c + python/libxml.c include/libxml/xmlmemory.h: small changes + to syntax to get rid of compiler warnings. No changes + to logic. + +Mon Aug 4 22:40:54 CEST 2003 Daniel Veillard + + * doc/libxml2-api.xml doc/html/*: rebuilt the API and docs. + +Mon Aug 4 21:40:34 CEST 2003 Daniel Veillard + + * tree.c: fixed a small problem in the patch for #118763 + * result/HTML/doc3.htm*: this reverts back to the previous result + +Sun Aug 3 21:41:49 EDT 2003 Daniel Veillard + + * doc/FAQ.html doc/xml.html: applied doc patch to xml.html + and rebuilt, apparently some C++ wrappers are not available, + c.f. bug #118943 + +Sun Aug 3 21:30:31 EDT 2003 Daniel Veillard + + * tree.c: fixing HTML attribute serialization bug #118763 + applying a modified version of the patch from Bacek + * result/HTML/doc3.htm*: this modifies the output from one test + +Sun Aug 3 21:02:30 EDT 2003 Daniel Veillard + + * tree.c include/libxml/tree.h: added a new API to split a + QName without generating any memory allocation + * valid.c: fixed another problem with namespaces on element + in mixed content case + * python/tests/reader2.py: updated the testcase with + Bjorn Reese fix to reader for unsignificant white space + * parser.c HTMLparser.c: cleanup. + +Sun Aug 3 20:55:40 EDT 2003 Daniel Veillard + + * catalog.c: trying to fix #118754 of possible recursion in the + catalogs. Not fantastically happy about the current fix since + it's likely to break under very thread intensive concurrent + access to the catalog. Better solution might to keep the depth + an extra argument to the resolution functions. + +Sun Aug 3 18:56:54 EDT 2003 Daniel Veillard + + * valid.c: fixed bug #118712 about mixed content, and namespaced + element names. + * test/valid/mixed_ns.xml result/valid/mixed_ns*: added a check + in the regression tests + +Fri Aug 1 23:55:23 HKT 2003 William Brack + + Coninuing work on bug 118559 + * DOCBparser.c: removed 2 unsed vars + * xmlregexp.c: changed some numeric const to their enum symbols + * xmlreader.c: changed one var define from int to enum + (a little more to be done, awaiting co-ordination) + * relaxng.c: deleted one unused var + * xmllint.c: deleted some unused vars, changed one arg + val from int to enum + * testHTML.c, testDocbook.c: changed some arg vals to enum const + * xmlIO.c: fixed typo from last night (small warning msg) + +Thu Jul 31 22:44:33 HKT 2003 William Brack + + Working on bug 118559 + * error.c: deleted unused variable + * parserInternals.c: deleted unneeded 'const' qualifier + * parser.c: changed variable type for enum temp storage + * xmlIO.c: changed debugging var to be inside #ifdef + * valid.c: removed unused variable + * HTMLparser.c: removed some unneeded 'const' qualifiers + * xpath.c: added some type casts, removed some unused vars + * xinclude.c: added one type cast + * nanohttp.c: repositioned some #ifdef to avoid unused var + * nanoftp.c: removed unused var + +Wed Jul 30 14:57:55 EDT 2003 Daniel Veillard + + * HTMLparser.c: applied a patch from William Brack about + the problem of parsing very large HTML instance with comments + as raised by Nick Kew + +Wed Jul 30 12:29:38 EDT 2003 Daniel Veillard + + * xmlreader.c include/libxml/xmlreader.h: applying cleanup + patch from Bjorn Reese for xmlTextReaderNodeType() and + significant whitespace. There is an enum for node type + values now. + +Wed Jul 30 11:08:21 EDT 2003 Daniel Veillard + + * encoding.c: applying patch from Peter Jacobi to added + ISO-8859-x encoding support when iconv is not available + * configure.in include/libxml/xmlversion.h.in + include/libxml/xmlwin32version.h.in: added the glue needed + at the configure level and made it the default for Windows + +Tue Jul 29 16:43:48 EDT 2003 Daniel Veillard + + * python/generator.py python/libxml.c python/libxml2class.txt: + patch from Joachim Bauch + cleanup for Relax NG error callbacks + in python + +Tue Jul 29 12:46:08 EDT 2003 Daniel Veillard + + * parser.c parserInternals.c tree.c: applied Peter Jacobi encoding + cleanup patch, and also avoided a possible memory leak + +Tue Jul 29 09:28:09 EDT 2003 Daniel Veillard + + * encoding.c: fix the previous commit + +Tue Jul 29 12:28:17 HKT 2003 William Brack + + * HTMLparser.c: fixed problem with comments reported by Nick Kew + * encoding.c: added routines xmlUTF8Size and xmlUTF8Charcmp for + some future cleanup of UTF8 handling + +Mon Jul 28 16:39:14 EDT 2003 Daniel Veillard + + * xpath.c: applied a change suggested by Sean Griffin in bug + #118494 about a memory leak in EXSLT + +Sun Jul 27 14:30:56 EDT 2003 Daniel Veillard + + * relaxng.c: fixed a Relax-NG compilation/streaming bug introduced + when fixing the previous Relax-NG bugs + * result/relaxng/*: This slightly changes the output messages of + some regression tests. + * configure.in: added support of -with-fexceptions for nested C++ + support. + +Thu Jul 24 15:46:02 MDT 2003 John Fleck + + * doc/tutorial/apa.html + * doc/tutorial/apb.html + * doc/tutorial/apc.html + * doc/tutorial/apd.html + * doc/tutorial/ape.html + * doc/tutorial/apf.html + * doc/tutorial/apg.html + * doc/tutorial/aph.html + * doc/tutorial/ar01s02.html + * doc/tutorial/ar01s03.html + * doc/tutorial/ar01s04.html + * doc/tutorial/ar01s05.html + * doc/tutorial/ar01s06.html + * doc/tutorial/ar01s07.html + * doc/tutorial/ar01s08.html + * doc/tutorial/index.html + * doc/tutorial/ix01.html + * doc/tutorial/xmltutorial.pdf + * doc/tutorial/xmltutorial.xml + update tutorial with XPath example + + +Thu Jul 24 17:07:06 IST 2003 Daniel Veillard + + * SAX.c parser.c: fixing a bug about a special case of namespace + handling, this closes bug #116841 + +Wed Jul 23 20:52:36 IST 2003 Daniel Veillard + + * relaxng.c result/relaxng/*: checked and fixed the compilation + of RNG schemas, fixes a couple of bugs #117097 and #117001 . + This slightly changes the output messages of some regression tests. + +Wed Jul 23 15:15:08 IST 2003 Daniel Veillard + + * xmlreader.c: fixed an out of bound error #118052 , the good + part if that base64 code was not in use yet ... + +Tue Jul 22 19:42:15 MDT 2003 John Fleck + + * doc/xmllint.html + include html version of the xmllint man page, so an + up-to-date version is visible on the Web + +Mon Jul 21 21:53:43 IST 2003 Daniel Veillard + + * xinclude.c include/libxml/xinclude.h: added a new API + xmlXIncludeProcessTree() to process XInclude only on a subtree + this should fix bug #115385 + +Fri Jul 18 17:11:42 CEST 2003 Daniel Veillard + + * relaxng.c include/libxml/relaxng.h: adding Get interface for + the error callback and parameters of parsing and validation + contexts + * xmlreader.c: patch to fix bug #117702 about incomplete Read() + on text nodes. + +Wed Jul 16 23:15:53 CEST 2003 Daniel Veillard + + * parserInternals.c: patch from Dodji Seketeli about UTF16 BOM + when using the push XML parser. + * result/utf16bom.xml result/noent/utf16bom.xml test/utf16bom.xml: + added the test to the regression suite. + +Tue Jul 15 22:03:13 CEST 2003 Daniel Veillard + + * globals.c: add xmlThrDefMutex = NULL in xmlCleanupGlobals() + as suggested by Rob Richards + +Tue Jul 15 15:30:55 CEST 2003 Daniel Veillard + + * DOCBparser.c HTMLparser.c entities.c parser.c relaxng.c + xmlschemas.c xpath.c: removed some warnings by casting xmlChar + to unsigned int and a couple of others. + +Fri Jul 11 16:44:22 CEST 2003 Daniel Veillard + + * xmlschemastypes.c: fixes a segfault on empty hexBinary strings + +Thu Jul 10 16:02:47 CEST 2003 Daniel Veillard + + * nanoftp.c nanohttp.c: cleanup patches from Peter Breitenlohner + +Tue Jul 8 16:02:19 CEST 2003 Daniel Veillard + + * globals.c threads.c: fixes some problem when freeing unititialized + mutexes + +Tue Jul 8 14:15:07 CEST 2003 Daniel Veillard + + * nanoftp.c nanohttp.c: the modules should not import + directly, some cleanups + * xmlschemas.c: Peter Sobisch found a nasty bug in the Schemas + validation code. + +Mon Jul 7 18:00:51 CEST 2003 Daniel Veillard + + * win32/configure.js: Jesse Pelton pointed out a problem in the + javascript code. + +Mon Jul 7 16:39:31 CEST 2003 Daniel Veillard + + * NEWS doc/*: regenerated + * nanoftp.c nanohttp.c: might fix includes problems with the + Ipv6 support on solaris + * tree.c: patch from Markus Keim about xmlHasNsProp() on attributes + defined as #IMPLIED + +Sun Jul 6 23:09:13 CEST 2003 Daniel Veillard + + * configure.in doc/*: preparing release 2.5.8 + * nanohttp.c: changed some preprocessor block + * xmlschemastypes.c: applied patch from Charles Bozeman adding + hexBinary schema datatype and adding support for totalDigits and + fractionDigits facets. + +Sun Jul 6 19:56:18 CEST 2003 Daniel Veillard + + * debugXML.c xpath.c: fixed 2 bugs pointed in #116448 + +Sun Jul 6 19:34:17 CEST 2003 Daniel Veillard + + * xinclude.c: fixed bug #116095 removing the error message when + reapplying XInclude to a document. + +Sat Jul 5 22:40:23 CEST 2003 Daniel Veillard + + * xmlIO.c: applied small changes to portability layer for + compilation on DJGPP Ms-DOS compiler. + +Sat Jul 5 22:30:25 CEST 2003 Daniel Veillard + + * parser.c HTMLparser.c: use the character() SAX callback + if the cdataBlock ain't defined. + * xpath.c: fix bug #115349 allowing compilation when configured + with --without-xpath since the Schemas code needs NAN and co. + +Sat Jul 5 00:51:30 HKT 2003 William Brack + + Fixed problem with multi-threading, shown by the test program + testThreads. After fix, ran mutiple tests on various speed + machines (single and dual processor X86), which all seem okay. + + * catalog.c: added missing xmlRMutexUnlock in xmlLoadCatalog + + * threads.c: added missing initialisation for condition variable + in xmlNewRMutex. + +Sat Jun 21 16:10:24 CEST 2003 Daniel Veillard + + Applying IPv6 patch from Archana Shah + closing bug #114837 + + * configure.in: Added checks for IPv6 support and getaddrinfo(). + + * acconfig.h: Defined HAVE_GETADDRINFO and SUPPORT_IP6. + + * config.h.in: Defined HAVE_GETADDRINFO and SUPPORT_IP6. + + * nanoftp.c: Structure xmlNanoFTPCtxt contains either sockaddr_storage + field or sockaddr_in field, depending upon the availability of IPv6 + support. + have_ipv6(): Added to check for run-time IPv6 support. + (xmlNanoFTPScanURL), (xmlNanoFTPUpdateURL), (xmlNanoFTPScanProxy): + Modified to parse a URI with IPv6 address given in []. + (xmlNanoFTPConnect): Changed to use getaddrinfo for address + resolution, if it is available on the system, as gethostbyname + does not return IPv6 addresses on some platforms. + (xmlNanoFTPGetConnection): Modified type of dataAddr variable to + sockaddr_storage or sockaddr_in depending upon the IPv6 support. + Sending EPSV, EPRT or PASV, PORT depending upon the type of address + we are dealing with. + + * nanohttp.c: (have_ipv6): Added to check for run-time IPv6 support. + (xmlNanoHTTPScanURL), (xmlNanoHTTPScanProxy): Modified to parse + a URI with IPv6 address given in []. + (xmlNanoHTTPConnectHost): Modified to use getaddrinfo if it is + available on the system. Also IPv6 addresses will be resolved by + gethostbyname only if IPv6 run-time support is available. + (xmlNanoHTTPConnectAttempt): Modified to deal with IPv6 address. + +Sat Jun 14 18:46:51 CEST 2003 Igor Zlatkovic + + * win32/configure.js include/win32config.h + include/libxml/xmlversion.h.in: Applied the patch for BCB + by Eric Zurcher. + +Fri Jun 13 14:27:19 CEST 2003 Daniel Veillard + + * doc/Makefile.am doc/html/*: reverted back patch for #113521, + due to #115104 and while fixing #115101 . HTML URLs must not + be version dependant. + +Fri Jun 13 12:03:30 CEST 2003 Daniel Veillard + + * entities.c: do not generate " for " outside of attributes + * result//*: this changes the output of some tests + +Mon Jun 9 12:28:58 CEST 2003 Daniel Veillard + + * parser.c xmlIO.c: trying to fix #114277 about when file + remapping and escaping should really be attempted. + +Mon Jun 9 11:06:09 CEST 2003 Daniel Veillard + + * doc/*: applied a patch from Gman for building docs + * valid.c xmllint.c include/libxml/valid.h: applied a patch from + Gary Pennington to provide an allocator for xmlValidCtxt + * xmlreader.c: applied patch from Jacek Konieczny fixing bug + #113580 about data not being passed immediately. + +Thu Jun 5 11:31:02 CEST 2003 Daniel Veillard + + * tree.c: applied a couple of patches from Mark Itzcovitz + to handle saving back "UTF-16" documents. + +Mon Jun 2 21:56:15 MVT 2003 Daniel Veillard + + * relaxng.c xmlschemas.c include/libxml/schemasInternals.h: commiting + some work done while in the Maldives (hence the timezone on the + laptop !) + * result/schemas/length3* test/schemas/deter0_* + test/schemas/group0_*: some tests added too + +Mon Jun 2 15:34:17 CEST 2003 Daniel Veillard + + * encoding.c: small fix + * xmlIO.c: fixed an error message + +Tue May 20 14:21:23 CEST 2003 Daniel Veillard + + * parserInternals.c: fixing Red Hat bug #91013 where xmllint was + accepting an improper UTF8 sequence + +Sat May 17 12:53:11 CEST 2003 Igor Zlatkovic + + * threads.c: applied the patch from Stéphane Bidoul for getting + rid of extra threads in a dynamic library. + * win32/configure.js: threads default to 'native' now. + +Fri May 16 13:17:52 EDT 2003 Daniel Veillard + + * HTMLtree.c: fixing bug #112904: html output method escaped + plus sign character in URI attribute. + +Thu May 15 18:06:18 EDT 2003 Daniel Veillard + + * build_glob.py global.data globals.c parser.c + include/libxml/globals.h: patch from Stéphane Bidoul for setting + up threads global defaults. + * doc/libxml2-api.xml: this extends the API with new functions + * python/tests/Makefile.am python/tests/reader2.py + python/tests/thread2.py: integrated the associated testcase and + fixed the error string used in reader2 + +Wed May 14 14:56:46 EDT 2003 Daniel Veillard + + * configure.in libxml.spec.in python/Makefile.am: trying + to conciliate --with-python= requirements and RPM builds, + a PITA really... + +Tue May 13 18:30:34 EDT 2003 Daniel Veillard + + * HTMLparser.c: oops last commit introduced a memory leak. + +Tue May 13 18:10:38 EDT 2003 Daniel Veillard + + * xmllint.c doc/xmllint.xml: added --nonet option + * doc/Makefile.am: fixing #112803 by adding --nonet when calling + xsltproc or xmllint + * doc/xmllint.xml doc/xmllint.1: also added --schema doc and + rebuilt + * HTMLparser.c: cleaned up the HTML parser context build when + using an URL + +Tue May 13 16:35:04 EDT 2003 Daniel Veillard + + * libxml.spec.in: added a comment about bug #112902 + +Mon May 12 21:58:00 EDT 2003 William Brack + + * minor cleanup of configure '--help' display + * error.c: enhanced xmlParserPrintFileContext to fix bug #109942 + +Mon May 12 17:53:30 EDT 2003 Daniel Veillard + + * tree.c: PI nodes in external subset were not freed :-\ + fixes bug #112842 + +Mon May 12 11:23:27 EDT 2003 Daniel Veillard + + * xmllint.c: added --schema option to run WXS schema validation + * xmlschemas.c xmlschemastypes.c include/libxml/schemasInternals.h: + tried to improve error reporting in the Schema code, some cleanup + too. + +Sun May 11 16:13:20 EDT 2003 Daniel Veillard + + * xmlschemas.c: fixed some problems in the handling of errors, + and attributes addressed by references. + * test/schemas/* result/schemas/*: dropped the verbosity level + and added a couple of new tests + +Sat May 10 16:01:21 EDT 2003 Daniel Veillard + + * relaxng.c: Stéphane Bidoul found an off by one addressing + error on the error handling. + +Fri May 9 19:08:20 EDT 2003 Daniel Veillard + + * xmlschemastypes.c: trying to fix #112673 + +Fri May 9 18:14:16 EDT 2003 Daniel Veillard + + * DOCBparser.c catalog.c parser.c relaxng.c: removed multiple + warning, this fixed a bug and should close #111574 + +Fri May 9 15:34:32 EDT 2003 Daniel Veillard + + * xmlschemas.c: fixing bug #104081 with xs:all with an element + holding minOccurs="0" + * test/schemas/all_* result/schemas/all_*: added some regression + tests for that bug + * xmllint.c xmlreader.c: patches from Joerg Schmitz-Linneweber and + Garry Pennington to compile without schemas support. + +Thu May 1 10:02:35 CEST 2003 Daniel Veillard + + * tree.c: fixed a problem with xmlUnlinkNode() for DTDs. + +Wed Apr 30 14:16:08 CEST 2003 Daniel Veillard + + * xml2-config.in: try to fix Red hat bug #89957, do not + output -L/usr/lib64 + * xmlreader.c: fixed a typo in a comment + +Tue Apr 29 07:32:02 MDT 2003 John Fleck + + * doc/tutorial/aph.html, ix01.html + forgot to cvs add the new files. Thanks to Roland van Laar + for pointing this out + +Tue Apr 29 14:36:49 CEST 2003 Daniel Veillard + + * xmlschemas.c doc/libxml2-api.xml: fixing a function comment + * doc/Makefile.am doc/apibuild.py doc/gnome-xml.sgml: switching + to the XML/XSLT doc generation closing #111799 + * doc/html/*: complete update of the HTML results + +Mon Apr 28 14:51:41 CEST 2003 Igor Zlatkovic + + * win32/defgen.xsl: fixed the conditional for unicode map, + removed hardcoded schema entries + +Mon Apr 28 02:19:00 CEST 2003 Igor Zlatkovic + + * win32/defgen.xsl: new file, stylesheet for generating + win32/libxml2.def.src from doc/libxml2-api.xml + * win32/libxml2.def.src: is autogenerated from now on, changes + to this file will not appear here anymore + +Mon Apr 28 00:12:11 CEST 2003 Daniel Veillard + + * win32/configure.js python/setup.py.in: applied patch + from Stéphane Bidoul for the Python bindings on the new + release. + +Sun Apr 27 17:56:21 CEST 2003 Igor Zlatkovic + + * debugXML.c: included libxml/uri.h for xmlCanonicPath + declaration + * win32/configure.js: thread-enabled build is now default + * win32/libxml2.def.src: added more exports + +Sun Apr 27 00:23:05 CEST 2003 Daniel Veillard + + * NEWS doc/*.xsl doc/*.html: updated the web site separated + developers from common pages, made the transition to XHTML1, + added validity checking to the makefile rules. + +Sat Apr 26 23:17:51 CEST 2003 Daniel Veillard + + * parser.c: fix for xmlIOParseDTD same as previous and reported + by Petr Pajas + +Sat Apr 26 15:26:04 CEST 2003 Daniel Veillard + + * parser.c: applied fix to xmlSAXParseDTD from Malcolm Tredinnick + closing #111638 + +Sat Apr 26 14:00:58 CEST 2003 Daniel Veillard + + * python/generator.py: fixed a problem in the generator where + the way functions are remapped as methods on classes was + not symetric and dependant on python internal hash order, + as reported by Stéphane Bidoul + +Fri Apr 25 21:52:33 MDT 2003 John Fleck + + * doc/tutorial: + xmltutorial.xml + xmltutorial.pdf + *.html + add appendix on generating compiler flags, more indexing + +Sat Apr 26 01:10:48 CEST 2003 Daniel Veillard + + * triodef.h vms/build_libxml.com: applied patch from Craig A. Berry + to get libxml-2.5.7 to compile on OpenVMS + +Fri Apr 25 18:42:35 CEST 2003 Daniel Veillard + + * parser.c: fixing an xmlParseDTD bug raised by Petr Pajas + +Fri Apr 25 15:20:29 CEST 2003 Daniel Veillard + + * doc/Makefile.am doc/xmlcatalog.1 doc/xmlcatalog_man.xml + doc/xmllint.1 doc/xmllint.xml: automated the generation of the + man page based on xsltproc and a stylesheet PI in the XML. + +Fri Apr 25 12:37:33 CEST 2003 Daniel Veillard + + * doc/xmllint.*: trying to fix #110541 where   generated + character preventing rendering by the man command. + +Fri Apr 25 01:09:23 CEST 2003 Daniel Veillard + + * NEWS configure.in: preparing release 2.5.7 + * doc/*: updated and rebuilt the docs + * doc/apibuild.py: fixed the script + +Thu Apr 24 19:11:12 CEST 2003 Daniel Veillard + + * Makefile.am doc/apibuild.py: make sure the OOM code don't + get in the way of the builds + * doc/libxml2-api.xml python/libxml2class.txt: automatic update + +Thu Apr 24 18:01:46 CEST 2003 Daniel Veillard + + * Makefile.am testOOM.c testOOMlib.[ch] : integrated the Out Of + Memory test from Havoc Pennington #109368 + * SAX.c parser.c parserInternals.c tree.c uri.c valid.c + xmlmemory.c xmlreader.c xmlregexp.c include/libxml/tree.h + include/libxml/parser.h: a lot of memory allocation cleanups + based on the results of the OOM testing + * check-relaxng-test-suite2.py: seems I forgot to commit the + script. + +Wed Apr 23 17:16:41 CEST 2003 Daniel Veillard + + * xmlschemastypes.c: trivial fix for 109774 removing a warning + +Wed Apr 23 15:49:32 CEST 2003 Daniel Veillard + + * DOCBparser.c SAX.c catalog.c debugXML.c parser.c: try to find + more places where xmlCanonicPath() must be used to convert + filenames to URLs, trying to fix #111088 + +Wed Apr 23 09:35:12 CEST 2003 Daniel Veillard + + * python/libxml.c python/libxml.py: applied patch from + Brent M Hendricks adding binding for xmlCatalogAddLocal + +Tue Apr 22 15:18:01 CEST 2003 Daniel Veillard + + * HTMLparser.c: tried to fix #98879 again in a more solid + way. + +Tue Apr 22 13:58:43 CEST 2003 Igor Zlatkovic + + * win32/libxml2.def.src: added more exports from the relaxng and + xmlreader clan + +Tue Apr 22 10:35:13 CEST 2003 Daniel Veillard + + * SAX.c test/valid/ns* test/result/ns*: applied the patch + provided by Brent Hendricks fixing #105992 and integrated the + examples in the testsuite. + +Tue Apr 22 01:06:09 CEST 2003 Daniel Veillard + + * TODO: updated a bit + * configure.in: fixed the comment, threads now default to on + * parserInternals.c: fixed an erroneous xmlMallocAtomic() call + +Mon Apr 21 23:33:38 CEST 2003 Daniel Veillard + + * globals.c libxml.h parser.c parserInternals.c tree.c xmllint.c + xmlreader.c include/libxml/parser.h: a lot of performance work + especially the speed of streaming through the reader and push + interface. Some thread related optimizations. Nearly doubled the + speed of parsing through the reader. + +Sun Apr 20 10:36:05 MDT 2003 John Fleck + + * doc/xmllint.xml + * doc/xmllint.1 + update man page to explain use of --stream + +Sat Apr 19 02:03:24 CEST 2003 Daniel Veillard + + * DOCBparser.c HTMLparser.c c14n.c catalog.c encoding.c globals.c + nanohttp.c parser.c parserInternals.c relaxng.c tree.c uri.c + xmlmemory.c xmlreader.c xmlregexp.c xpath.c xpointer.c + include/libxml/globals.h include/libxml/xmlmemory.h: added + xmlMallocAtomic() to be used when allocating blocks which + do not contains pointers, add xmlGcMemSetup() and xmlGcMemGet() + to allow registering the full set of functions needed by + a garbage collecting allocator like libgc, ref #109944 + +Fri Apr 18 16:37:41 CEST 2003 Daniel Veillard + + * configure.in: switched to have thread support enabled by default, + didn't got troubles with ABI compatibility on Linux, hope it + won't break on strange OSes, if yes, report the system ID + * doc/libxml2-api.xml: just rebuilt the API + +Fri Apr 18 14:31:15 CEST 2003 Daniel Veillard + + * libxml.h include/libxml/parser.h parser.c xmlIO.c DOCBparser.c: + added support for large file, tested with a 3+GB instance, + and some cleanup. + * catalog.c: added a TODO + * Makefile.am: added some "make tests" comments + +Thu Apr 17 14:51:57 CEST 2003 Daniel Veillard + + * relaxng.c: some cleanups + * doc/xmlreader.html: extended the document to cover RelaxNG and + tree operations + * python/tests/Makefile.am python/tests/reader[46].py: added some + xmlReader example/regression tests + * result/relaxng/tutor*.err: updated the output of a number of tests + +Thu Apr 17 11:35:37 CEST 2003 Daniel Veillard + + * relaxng.c: valgrind pointed out an uninitialized variable error. + +Thu Apr 17 11:06:28 CEST 2003 Daniel Veillard + + * include/libxml/relaxng.h relaxng.c include/libxml/xmlreader.h + xmlreader.c: augnemting the APIs, cleanups. + * parser.c: cleanup bug #111005 + * xmlIO.c: added some missing comments + +Wed Apr 16 17:46:50 CEST 2003 Daniel Veillard + + * relaxng.c xmllint.c: more work on RelaxNG streaming validation + trying to improve the subset compiled, and more testing. + * doc/downloads.html doc/xml.html doc/xmlmem.html: some updates on the + documentation + * test/relaxng/tutor11_1_3.xml: fixes the DTD path + * result/relaxng/*.err: fix some of the outputs + +Wed Apr 16 01:28:15 CEST 2003 Daniel Veillard + + * relaxng.c xmlreader.c xmllint.c include/libxml/relaxng.h + include/libxml/xmlreader.h: implemented streaming of + RelaxNG (when possible) on top of the xmlReader interface, + provided it as xmllint --stream --relaxng .rng .xml + This seems to mostly work. + * Makefile.am: updated to test RelaxNG streaming + +Mon Apr 14 18:08:33 CEST 2003 Daniel Veillard + + * relaxng.c include/libxml/relaxng.h: integrated the regexp + based validity checking of fragments of the document for + which the RNG can be compiled to regexps. Works on all regression + tests, only fix needed is related to error messages. + +Sun Apr 13 21:51:00 CEST 2003 Daniel Veillard + + * relaxng.c xmlregexp.c include/libxml/xmlautomata.h + include/libxml/xmlregexp.h: Starting work precompiling + parts of RelaxNG schemas. Not plugged onto validity checking + yet, just the regexp building part. Needed to extend some + of the automata and regexp APIs. + +Fri Apr 11 21:36:21 CEST 2003 Daniel Veillard + + * xmllint.c xmlreader.c include/libxml/xmlreader.h: make sure + xmllint --stream and xmllint --stream --valid returns errors + code appropriately + +Fri Apr 11 10:59:24 CEST 2003 Daniel Veillard + + * xmlreader.c include/libxml/xmlreader.h: Added the Expand() + and Next() operation to work on subtrees within the reader + framework. + * doc/libxml2-api.xml python/libxml2class.txt: resulting updates + * python/tests/reader5.py: added an example for those new + functions of the reader. + +Thu Apr 10 23:38:13 CEST 2003 Daniel Veillard + + * HTMLtree.c: patch from Vasily Tchekalkin to fix #109865 + +Thu Apr 10 15:32:44 CEST 2003 Daniel Veillard + + * xmlreader.c: fixing HasValue for namespace as raised by + Denys Duchier + +Wed Apr 9 14:07:18 CEST 2003 Daniel Veillard + + * HTMLparser.c include/libxml/HTMLparser.h: exported + htmlCreateMemoryParserCtxt() it was static + +Wed Apr 9 13:21:48 CEST 2003 Daniel Veillard + + * xmlschemas.c xmlschemastypes.c include/libxml/xmlschemas.h: + update from Charles Bozeman for date and duration types + * test/schemas/date_0.* test/schemas/dur_0.* + result/schemas/date_0.* result/schemas/dur_0.*: updated too + +Mon Apr 7 12:19:26 CEST 2003 Daniel Veillard + + * tree.c valid.c xpath.c include/libxml/tree.h include/libxml/valid.h: + fixing bug #107129, removing excessive allocation and calls + to *printf in the code to build QName strings. + +Sat Apr 5 11:41:36 CEST 2003 Igoe Zlatkovic + + * win32/libxml2.def.src: fixed conditional exports, reported by + Luke Murray. + +Fri Apr 4 18:08:00 CEST 2003 Daniel Veillard + + * parser.c: fixed a possible problem with xmlRecoverMemory() + +Thu Apr 3 17:24:44 CEST 2003 Daniel Veillard + + * trio.c trio.h triodef.h trionan.c trionan.h triop.h triostr.c + triostr.h: Bjorn sent an update for the TRIO portability layer. + +Tue Apr 1 21:57:26 CEST 2003 Igor Zlatkovic + + * win32/libxml2.def.src: exported new functions + +Tue Apr 1 13:09:46 CEST 2003 Daniel Veillard + + * configure.in NEWS: preparing release 2.5.6 + * doc/*: updated and rebuilt the docs + +Tue Apr 1 11:52:15 CEST 2003 Daniel Veillard + + * SAX.c: fixed an uninitialized memory access pointed by valgrind + on C14Ntests + +Tue Apr 1 00:12:28 CEST 2003 Daniel Veillard + + * relaxng.c: one more fixup of error message reporting + +Mon Mar 31 18:36:32 CEST 2003 Daniel Veillard + + * relaxng.c: more work on bug #109225, and fixed an uninitialized + variable pointed out by valgrind + +Mon Mar 31 18:05:22 CEST 2003 Daniel Veillard + + * relaxng.c: try to work on bug #109225 and provide better + error reports. + * result/relaxng/* : this change the output of a number of tests + * xinclude.c: fixing the parsed entity redefinition problem + raised on the list. + * test/schemas/date_0.xsd: updated the date test c.f. E2-12 + +Mon Mar 31 13:19:04 CEST 2003 Daniel Veillard + + * xmlschemastypes.c: fixed date comparison to handle the tzo + The only failures left are disagreements on Notations and + '+1' not being allowed for ulong, uint, ushort and ubyte. + +Mon Mar 31 12:11:47 CEST 2003 Daniel Veillard + + * xmlschemastypes.c: fixed gMonth parsing routine accordingly + to the XML Schemas errata + http://www.w3.org/2001/05/xmlschema-errata#e2-12 + +Sun Mar 30 23:04:18 CEST 2003 Daniel Veillard + + * relaxng.c xmlschemastypes.c: more work on XML Schemas datatypes + and facets support. Currently only schemas with binHex or + base64 don't compile. A few error left in the test suite: + found 1035 test instances: 919 success 23 failures + most are gdate or gdateyear failing check, and a few cases where + James clark tests results are strange. + * valid.c: allow to reuse the Notation checking routine without + having a validation context. + * SAX.c: removed a #if 0 + +Sat Mar 29 17:35:05 CET 2003 Daniel Veillard + + * xinclude.c: forgot to apply one check from #106931 patch + * xmlschemastypes.c: more work on XML Schemas datatypes + +Sat Mar 29 11:49:25 CET 2003 Daniel Veillard + + * relaxng.c include/libxml/relaxng.h xmlschemastypes.c: more work + on cleaning up XML Schemas datatypes based on James Clark tests + test/xsdtest/xsdtest.xml + +Fri Mar 28 14:24:08 CET 2003 Daniel Veillard + + * relaxng.c: implemented comparisons for Schemas values. + * xmlschemastypes.c include/libxml/xmlschemastypes.h: fixed + some bugs in duration handling, comparisons for durations + and decimals, removed all memory leaks pointed out by James + testsuite. Current status is now + found 238 test schemas: 197 success 41 failures + found 1035 test instances: 803 success 130 failures + +Fri Mar 28 00:41:55 CET 2003 Daniel Veillard + + * xmlschemas.c include/libxml/xmlschemas.h: fixed bugs and memory + leaks in the W3C XML Schemas code + * xmlschemastypes.c: implemented nonPositiveInteger + * test/schemas/length2_0.xsd result/schemas/length2_0_0.err: + fixed the test and result. + +Thu Mar 27 22:23:07 CET 2003 Daniel Veillard + + * HTMLparser.c tree.c: two patches from James Bursa on the HTML + parser and a typo + * xmlschemastypes.c: reindenting, fixing a memory access + problem with dates. + +Thu Mar 27 15:53:35 CET 2003 Daniel Veillard + + * parser.c: fixing #109227 providing more context in case of + start/end tag mismatch + * python/tests/ctxterror.py python/tests/readererr.py: update the + tests accordingly + +Thu Mar 27 15:22:41 CET 2003 Daniel Veillard + + * xinclude.c: should fix #109327 errors on memory accesses + +Thu Mar 27 15:06:13 CET 2003 Daniel Veillard + + * HTMLtree.c: Fixed reopening of #78662

+ is an URI reference + +Wed Mar 26 22:38:39 CET 2003 Daniel Veillard + + * xpath.c: fixed bug #109160 on non-ASCII IDs + +Wed Mar 26 17:30:37 CET 2003 Daniel Veillard + + * parser.c: Norm suggested a nicer error message for xml:space values + errors + +Wed Mar 26 01:34:19 CET 2003 Daniel Veillard + + * xpath.c include/libxml/xpath.h: first part of the fix to + performance bug #108905, adds xmlXPathOrderDocElems() providing + document order for nodes. + * python/libxml.c: Python may require TRIO as Albert Chin pointed out + +Tue Mar 25 16:07:00 CET 2003 Daniel Veillard + + * xmlschemastypes.c: removing a warning with Sun compiler + bug #109154 + +Tue Mar 25 07:02:56 MST 2003 John Fleck + + * doc/xmllint.xml + * doc/xmllint.1 + update xmllint man page with --relaxng option + +Tue Mar 25 12:07:03 CET 2003 Daniel Veillard + + * python/setup.py.in : was missing "drv_libxml2.py" + +Mon Mar 24 19:38:05 CET 2003 Daniel Veillard + + * tree.c xpath.c: some changes related to the new way of + handling Result Value Tree, before 2.5.5 + +Mon Mar 24 16:36:23 CET 2003 Daniel Veillard + + * configure.in NEWS: preparing release 2.5.5 + * doc/* : updated the documentation and regenerated it. + +Mon Mar 24 14:56:01 CET 2003 Daniel Veillard + + * xpath.c: fixed some problems related to #75813 about handling + of Result Value Trees + +Sun Mar 23 22:57:20 CET 2003 Daniel Veillard + + * uri.c: applied a set of patches from Lorenzo Viali correcting + URI parsing errors. + +Sun Mar 23 22:00:14 CET 2003 Daniel Veillard + + * parser.c: validity status was not passed back when validating in + entities, but raised by Oliver Fischer + +Sun Mar 23 21:30:50 CET 2003 Daniel Veillard + + * HTMLtree.c: avoid escaping ',' in URIs + +Sun Mar 23 12:57:00 CET 2003 Daniel Veillard + + * parser.c: fixing bug #108976 get the ID/REFs to reference + the ID in the document content and not in the entity copy + * SAX.c include/libxml/parser.h: more checking of the ID/REF + stuff, better solution for #107208 + * xmlregexp.c: removed a direct printf, dohhh + * xmlreader.c: fixed a bug on streaming validation of empty + elements in entities + * result/VC/ElementValid8 test/VCM/v20.xml result/valid/xhtml1.xhtml: + cleanup of the validation tests + * test/valid/id* test/valid/dtds/destfoo.ent result/valid/id*: + added more ID/IDREF tests to the suite + +Sat Mar 22 23:38:08 CET 2003 Daniel Veillard + + * xmlreader.c: fixed #107043 removing 2 warnings with Sun One + compiler. + +Sat Mar 22 18:50:45 CET 2003 Daniel Veillard + + * relaxng.c: valgrind'ed and cleaned up a couple of memory issues. + +Sat Mar 22 16:15:50 CET 2003 Daniel Veillard + + * SAX.c: fix bug #107208 avoid false duplicates when ID/REFs are + defined in entities content + +Sat Mar 22 15:53:27 CET 2003 Daniel Veillard + + * SAX.c: Fixed validation bug #108858 on namespace names using + entities and reported by Brent Hendricks + * xmllint.c: report xmlTextReaderHasValue() result in --stream + --debug output. + +Sat Mar 22 13:32:39 CET 2003 Daniel Veillard + + * xmlreader.c: fixed bug #108801 reported by Malcolm Tredinnick + about the DocType node not being reported sometimes. + * python/tests/reader.py: added to test to the regression checks + +Sat Mar 22 01:57:40 CET 2003 Daniel Veillard + + * xmlreader.c: fixed bug #108546 on long CDATA (or text nodes) + reported by Edd Dumbill + +Sat Mar 23 01:00:24 CET 2003 Daniel Veillard + + * HTMLparser.c parser.c parserInternals.c: patch from + johan@evenhuis.nl for #107937 fixing some line counting + problems, and some other cleanups. + * result/HTML/: this result in some line number changes + +Fri Mar 21 22:19:14 CET 2003 Daniel Veillard + + * configure.in Makefile.am: fixed Red Hat bug #86118 use libxml2.spec + instead of libxml.spec + * relaxng.c: fixed some of the error reporting excessive + verbosity + * catalog.c debugXML.c valid.c xmlreader.c xmlschemas.c xpath.c + xmlschemastypes.c: removed some warnings from gcc + * doc/libxml2-api.xml: rebuilt + +Fri Mar 21 17:25:23 CET 2003 Daniel Veillard + + * relaxng.c: another optimization, for choice this time + * result/relaxng/spec1* result/relaxng/tutor12_1* + result/relaxng/tutor3_7: cleanups. + +Fri Mar 21 13:41:23 CET 2003 Daniel Veillard + + * relaxng.c: fixed xmlRelaxNGNodeMatchesList + * test/relaxng/testsuite.xml: augmented the test suite + * result/relaxng/spec1* result/relaxng/tutor12_1*: this fixes + some schemas validation tests in the presence of foreign + namespaces. + +Fri Mar 21 02:23:34 CET 2003 Daniel Veillard + + * relaxng.c: added another interleave speedup. + +Thu Mar 20 17:22:00 CET 2003 Daniel Veillard + + * xmlschemastypes.c: added integer and fixed one of the + IDREFS regression tests pbm + * result/relaxng/docbook_0.err: updated + +Wed Mar 19 21:58:47 CET 2003 Daniel Veillard + + * valid.c xmlschemastypes.c: attempt to cope with ID/IDREF(S) + declared both in the DTD and in the Schemas + * relaxng.c: more debug, added a big optimization for + * test/relaxng/testsuite.xml: augmented the testsuite + * test/relaxng/ result/relaxng: added the RelaxNG spec and a + DocBook example to the regression tests + +Wed Mar 19 11:34:10 CET 2003 Daniel Veillard + + * check-xsddata-test-suite.py: cosmetic change for output + * relaxng.c: try to minimize calls to malloc/free for states. + +Tue Mar 18 17:50:31 CET 2003 Daniel Veillard + + * tree.c: removed a warning + * xmlschemastypes.c: more cleanup, added ENTITY and ENTITIES + support + * check-relaxng-test-suite.py check-xsddata-test-suite.py: + cleanup/improvements of the regression tests batch + * test/relaxng/testsuite.xml: augmented libxml2 own testsuite + +Tue Mar 18 12:36:22 CET 2003 Daniel Veillard + + * relaxng.c: fixed error msg cleanup deallocation + * xmlschemastypes.c: added a function to handle lists of + atomic types, added support for IDREFS + +Tue Mar 18 01:28:15 CET 2003 Daniel Veillard + + * relaxng.c valid.c xmlschemastypes.c: added Datatype ID + and IDREF, usable from RelaxNG now + * include/libxml/xmlschemastypes.h: need to add a new interface + because the validation modifies the infoset + * test/relaxng/testsuite.xml: extended the testsuite + +Mon Mar 17 16:34:07 CET 2003 Daniel Veillard + + * relaxng.c: fixed the last core RelaxNG bug known #107083, + shemas datatype ID/IDREF support still missing though. + * xmlreader.c: fix a crashing bug with prefix raised by + Merijn Broeren + * test/relaxng/testsuite.xml: augmented the testsuite with + complex inheritance tests + +Sun Mar 16 18:45:50 CET 2003 Daniel Veillard + + * relaxng.c: switched back to the previous Relax-NG code base, + the derivation algorithm need severe constraining code to avoid + combinatorial explosion. Fixed the problem with Sebastian Rahtz + TEI based example and other bugs + * result/relaxng/*err: updated the results + * test/relaxng/testsuite.xml: started a new test suite + +Sat Mar 15 22:26:46 CET 2003 Daniel Veillard + + * relaxng.c include/libxml/relaxng.h: After coming to the conclusion + that the original RelaxNG validation code was un-fixeable, it got + rewritten to use the derivation algorithm from James Clark and + redebugged it (nearly) from scratch: + found 373 test schemas: 372 success 1 failures + found 529 test instances: 529 success 0 failures + +Tue Mar 11 12:08:23 CET 2003 Daniel Veillard + + * SAX.c parser.c: fix some recursion problems introduced in the + last release. + * relaxng.c: more debugging of the RNG validation engine, still + problems though. + +Mon Mar 10 14:10:47 CET 2003 Daniel Veillard + + * Makefile.am: stop generating wrong result file with * in name + * relaxng.c: fixing the include bug raised by Sebastian Rahtz + * result/relaxng/demo* test/relaxng/demo: added the tests from + Sebastian reproducing the problem. + +Sun Mar 9 18:02:31 MST 2003 John Fleck + + * doc/xmllint.1: regenerating man page from xmllint.xml to pick + up Aleksey's change + +Sun Mar 9 13:53:16 2003 Aleksey Sanin + + * xmllint.c doc/xmllint.xml: use $XMLLINT_INDENT environment + variable to control the indentation for the xmllint "--format" + option + +Sat Mar 8 14:27:43 CET 2003 Igor Zlatkovic + + * encoding.c: applied Gennady's patch against buffer overrun + +Fri Mar 7 19:29:40 CET 2003 Daniel Veillard + + * test/xsdtest/xsdtest.xml uri.c: after and exchange with James + Clark it appeared I had bug in URI parsing code ... + * relaxng.c include/libxml/relaxng.h: completely revamped error + reporting to not loose message from optional parts. + * xmllint.c: added timing for RNG validation steps + * result/relaxng/*: updated the result, all error messages changed + +Fri Mar 7 15:18:32 CET 2003 Daniel Veillard + + * xpath.c: fix bug #107804, the algorithm used for document order + computation was failing on attributes. + +Thu Mar 6 22:35:50 CET 2003 Daniel Veillard + + * valid.c: fix bug #107764 , possibility of buffer overflow + in xmlValidDebug() + +Wed Mar 5 17:41:37 CET 2003 Daniel Veillard + + * nanoftp.c include/libxml/nanoftp.h: adding xmlNanoFTPDele() + from Philipp Dunkel + +Wed Mar 5 10:57:09 CET 2003 Daniel Veillard + + * xmlschemastype.c: made powten array static it should not be exported + * HTMLparser.c: fix bug #107361 by reusing the code from the XML + parser function. + * testHTML.c: get rid of valgrind messages on the HTML SAX tests + +Fri Feb 28 00:23:00 CET 2003 Daniel Veillard + + * tree.c: fixed a node dump crash on attributes + * test/xsdtest/xsdtest.xml test/xsdtest/xsdtest.xsl: fixed + an URI test bug and get better output. + +Thu Feb 27 22:28:40 CET 2003 Daniel Veillard + + * check-xsddata-test-suite.py: give more infos + * relaxng.c: fix a bug reported by Sebastian Rahtz and + REF->DEF in attribute values. + +Thu Feb 27 21:09:32 CET 2003 Daniel Veillard + + * check-xsddata-test-suite.py test/xsdtest/xsdtest.xml + test/xsdtest/xsdtest.xsl: import of the XSD Datatype + regression tests from James Clark. + +Thu Feb 27 18:40:04 CET 2003 Daniel Veillard + + * relaxng.c xmlschemas.c xmlschemastypes.c + include/libxml/xmlschemastypes.h: added param support for relaxng + type checking, started to increment the pool of simple types + registered, still much work to be done on simple types and + facets checkings. + +Wed Feb 26 16:45:39 CET 2003 Daniel Veillard + + * entities.c: fixes again one of the problem raised by + James Clark in #106788 + +Wed Feb 26 15:46:48 CET 2003 Daniel Veillard + + * relaxng.c: Fixed a couple of problem raised by James Clark + in bug #107083, the support for ID/IDREF/IDREFS at the WXS + datatype level still not fixed though. + +Mon Feb 24 21:09:19 CET 2003 Daniel Veillard + + * configure.in: preparing release 2.5.4 + * doc/*: updated and rebuilt the docs + * relaxng.c: removed warnings + * result/relaxng/*: updated the results + +Mon Feb 24 20:53:17 CET 2003 Daniel Veillard + + * valid.c: fixes a DTD regexp generation problem. + +Mon Feb 24 20:12:57 CET 2003 Daniel Veillard + + * parser.c: fixes bug #105998 about false detection of + attribute consumption loop. + +Mon Feb 24 19:14:57 CET 2003 Daniel Veillard + + * xinclude.c: Fixes bug #106931 in XInclude entities merging. + +Mon Feb 24 18:50:35 CET 2003 Daniel Veillard + + * SAX.c: fixed bug #105992 + +Mon Feb 24 18:14:16 CET 2003 Daniel Veillard + + * tree.c: fixed xmlSetProp and al. when the node passed is not an + element. + * relaxng.c: fixed bugs 7.3 (though not complete) and memory leaks + found 373 test schemas: 369 success 4 failures + found 529 test instances: 525 success 4 failures + * check-relaxng-test-suite.py: added memory debug reporting + +Mon Feb 24 12:41:54 CET 2003 Daniel Veillard + + * uri.c parser.c: some warning removal on Igor's patch + * tree.c: seems I messed up with #106788 fix + * python/libxml.c: fixed some base problems when Python provides + the resolver. + * relaxng.c: fixed the interleave algorithm + found 373 test schemas: 364 success 9 failures + found 529 test instances: 525 success 4 failures + the resulting failures are bug in the algorithm from 7.3 and + lack of support for params + +Sun Feb 23 14:49:39 CET 2003 Daniel Veillard + + * parser.c: another fix for nodeinfo in entities problem + * tree.c entities.c: fixed bug #106788 from James Clark + some spaces need to be serialized as character references. + +Sat Feb 22 18:28:16 CET 2003 Igor Zlatkovic + + * parser.c uri.c: fixed the bug I introduced in the path + handling, reported by Sebastian Bergmann + +Sat Feb 22 00:19:48 CET 2003 Daniel Veillard + + * parser.c: fixing some nodeinfo in entities problem raised + by Glenn W. Bach + * relaxng.c: implemented the first section 7.3 check + * result/relaxng/*: updated the results + +Fri Feb 21 18:12:19 CET 2003 Daniel Veillard + + * relaxng.c: fixed some problems in the previous commit + and finished implementing 4.16 rules checking + found 373 test schemas: 353 success 20 failures + found 529 test instances: 519 success 6 failures + * result/relaxng/*: updated the results + +Fri Feb 21 16:37:39 CET 2003 Daniel Veillard + + * relaxng.c: implemented checks from section 7.2 + +Thu Feb 20 16:00:31 CET 2003 Daniel Veillard + + * relaxng.c: implemented the checks from section 7.1, fixed + some of the 4.20 and 4.21 problems. + found 373 test schemas: 338 success 35 failures + found 529 test instances: 519 success 6 failures + * result/relaxng/*: updated the results + +Thu Feb 20 01:09:24 CET 2003 Daniel Veillard + + * relaxng.c: implemented the 4.20 and 4.21 simplification rules. + * result/relaxng/*: updated the results + +Wed Feb 19 18:30:30 CET 2003 Daniel Veillard + + * relaxng.c: more bugfixes + * result/relaxng/*: updated the results + +Wed Feb 19 15:39:56 CET 2003 Igor Zlatkovic + + * DOCBparser.c: obsoleted xmlNormalizeWindowsPath + * HTMLparser.c: obsoleted xmlNormalizeWindowsPath + * SAX.c: ensured xmlDoc.URL is always canonic + * parser.c: obsoleted xmlNormalizeWindowsPath + * uri.c include/libxml/uri.h: introduced xmlCanonicPath + * xmlIO.c include/libxml/xmlIO.h: obsoleted xmlNormalizeWindowsPath + * win32/libxml2.def.src: added few exports + + +Wed Feb 19 14:26:51 CET 2003 Daniel Veillard + + * Makefile.am configure.in: patched to have shared libraries + for Python regression tests and static binaries for gdb debug + in my development environment + * relaxng.c: more bugfixes + found 373 test schemas: 296 success 77 failures + found 529 test instances: 516 success 8 failures + * result/relaxng/*: updated the results + +Wed Feb 19 01:17:48 CET 2003 Daniel Veillard + + * relaxng.c: guess what ! Relax-NG bugfixing, what a surprize... + +Tue Feb 18 22:09:50 CET 2003 Daniel Veillard + + * xmlschemastypes.c: float/double check bugfix + * tree.c include/libxml/tree.h: exported a function for NMTOKEN + validation + * xmlreader.c: add a TODO for Jody + * relaxng.c: bugfix bugfix bugfix + found 373 test schemas: 300 success 73 failures + found 529 test instances: 507 success 10 failures + * result/relaxng/*: updated the results + +Tue Feb 18 00:33:17 CET 2003 Daniel Veillard + + * relaxng.c check-relaxng-test-suite.py: more RelaxNG bug hunting + +Mon Feb 17 18:23:32 CET 2003 Daniel Veillard + + * relaxng.c check-relaxng-test-suite.py: more work on the + RelaxNG implementation conformance testing. + found 373 test schemas: 284 success 89 failures + found 529 test instances: 448 success 47 failures + * result/relaxng/*: updated the results + +Sun Feb 16 16:48:38 CET 2003 Daniel Veillard + + * ChangeLog tree.c doc/libxml-doc.el doc/libxml2-api.xml: applied + a patch from Kjartan Maraas to fix some typos + +Sun Feb 16 16:40:52 CET 2003 Daniel Veillard + + * relaxng.c: more bug-hunting + * testRelax.c include/libxml/relaxng.h: added --tree to dump the + intermediate rng tree + * python/generator.py: patch from Stephane Bidoul to fix the generator + on python < 2.2 + +Fri Feb 14 17:49:26 CET 2003 Daniel Veillard + + * check-relaxng-test-suite.py relaxng.c: more testing on the + Relax-NG front, cleaning up the regression tests failures + current state and I forgot support for "mixed": + found 373 test schemas: 280 success 93 failures + found 529 test instances: 401 success 68 failures + * tree.c include/libxml/tree.h xmlschemastypes.c: finished and + moved the Name, NCName and QName validation routine in tree.c + * uri.c: fixed handling of URI ending up with #, i.e. having + an empty fragment ID. + * result/relaxng/*: updated the results + +Thu Feb 13 16:49:24 CET 2003 Daniel Veillard + + * check-xinclude-test-suite.py: improved the script accordingly + to the XInclude regression tests updates + * xpointer.c: Implemented XPointer element() Scheme W3C PR of 13 + November 2002 + * result/XPath/xptr/chapterschildseq result/XPath/xptr/vidchildseq + test/XPath/xptr/chapterschildseq test/XPath/xptr/vidchildseq: + augmented the Xpointer testsuite for the element() scheme + +Thu Feb 13 12:00:30 CET 2003 Daniel Veillard + + * relaxng.c: added TODO for the DTD compatibility spec + * xinclude.c: more bug fixes driven by the testsuite + +Tue Feb 11 19:01:02 CET 2003 Daniel Veillard + + * check-xinclude-test-suite.py xinclude.c: Work on the W3C/NIST + regression tests for XInclude, improved the script, improving + XInclude error reporting mechanism + +Mon Feb 10 17:19:14 CET 2003 Daniel Veillard + + * NEWS doc/* configure.in: preparing release 2.5.3 + +Mon Feb 10 17:11:22 CET 2003 Daniel Veillard + + * tree.c: trying to fix #104934 about some XHTML1 serialization + issues. + +Mon Feb 10 16:41:13 CET 2003 Daniel Veillard + + * encoding.c xmlIO.c: fixing bug #104646 about iconv based + encoding conversion when the input buffer stops in the + middle of a multibyte char + +Mon Feb 10 15:24:47 CET 2003 Daniel Veillard + + * test/relaxng/OASIS/spectest.xml: OASIS RelaxNG testsuite + * check-relaxng-test-suite.py: python script to run regression + against OASIS RelaxNG testsuite + * relaxng.c: some cleanup tweaks + * HTMLparser.c globals.c: cleanups in comments + * doc/libxml2-api.xml: updated the API + * result/relaxng/*: errors moved files, so large diffs but + no changes at the semantic level. + +Mon Feb 10 01:00:31 CET 2003 Daniel Veillard + + * tree.c: fixing #105678 problem when dumping a namespace node. + +Mon Feb 10 00:30:01 CET 2003 Daniel Veillard + + * xpath.c: fixed doc comment problems + * python/generator.py python/libxml_wrap.h python/types.c: adding + RelaxNG wrappers + * python/tests/Makefile.am python/tests/relaxng.py: added a specific + test of those early Python RelaxNG bindings + +Sun Feb 9 15:18:43 CET 2003 Daniel Veillard + + * libxml.spec.in: fixes a libtool problem on AMD 64bits builds + * relaxng.c: found the validation problem I had with interleave + when not covering all remaining siblings + * Makefile.am test.relaxng/* result/relaxng/*: augmented the + testsuite and check the RNG schemas against the RNG schemas + given in appendix A + +Sat Feb 8 18:55:43 CET 2003 Igor Zlatkovic + + * win32/Makefile.msvc: updates for RelaxNG + * win32/Makefile.mingw: updates for RelaxNG + * win32/libxml2.def.src: added RelaxNG exports + +Fri Feb 7 14:00:53 CET 2003 Daniel Veillard + + * xinclude.c: applied another bug fix from Sean Chittenden + +Fri Feb 7 13:34:08 CET 2003 Daniel Veillard + + * configure.in xmllint.c: I f...ed up the default configuration + of schemas and --relaxng option display in xmllint, pointed by + Morus Walter. + * xlink.c: Sean Chittenden pointed a couple of errors in the XLink + detection module, fixes bug #105374. + +Fri Feb 7 01:43:38 CET 2003 Daniel Veillard + + * xmlschemastypes.c: added the boolean base type. + +Thu Feb 6 10:23:52 CET 2003 Daniel Veillard + + * xmlschemastypes.c: started implementing some of the missing + default simple types + * result/relaxng/*: updated the results + +Wed Feb 5 15:28:04 CET 2003 Daniel Veillard + + * NEWS doc/*: updated the docs, ready for 2.5.2 release + +Wed Feb 5 14:15:59 CET 2003 Daniel Veillard + + * HTMLparser.c tree.c xmlIO.c: comments cleanups + * Makefile.am: use xmllint for doing the RelaxNG tests + * configure.in: preparing 2.5.2 made schemas support default to + on instead of off + * relaxng.c: removed the verbosity + * xmllint.c: added --relaxng option + * python/generator.py python/libxml_wrap.h: prepared the integration + of the new RelaxNG module and schemas + * result/relaxng/*: less verbose output + +Wed Feb 5 12:00:36 CET 2003 Daniel Veillard + + * valid.c: do not run content model validation if the + content is not determinist + +Wed Feb 5 11:43:58 CET 2003 Daniel Veillard + + * SAX.c: added the redefinition of namespaced attribute + check that was missing as Fabrice Desré pointed out. + +Wed Feb 5 11:09:29 CET 2003 Daniel Veillard + + * HTMLparser.c include/libxml/HTMLparser.h: applied HTML + improvements from Nick Kew, allowing to do more checking + to HTML elements and attributes. + +Tue Feb 4 23:47:06 CET 2003 Daniel Veillard + + * xinclude.c: fixing bug #105137 about entities declaration + needing to be copied to the including document. + +Tue Feb 4 20:26:22 CET 2003 Daniel Veillard + + * catalog.c: fixed bug #104817 with delegateURI + * xpath.c: fixing bugs #104123 and #104125 + +Tue Feb 4 17:12:56 CET 2003 Daniel Veillard + + * configure.in valid.c xmlreader.c python/libxml_wrap.h + python/types.c: fixing #104096 to compile without regexps + +Tue Feb 4 16:31:55 CET 2003 Daniel Veillard + + * valid.c: fixing bug #103969 forgot to add an epsilon transition + when building the automata for elem* + +Tue Feb 4 16:21:07 CET 2003 Daniel Veillard + + * HTMLparser.c: applied patch from Arne de Bruijn fixing + bug #103827 + +Tue Feb 4 16:17:09 CET 2003 Daniel Veillard + + * HTMLparser.c: updating a comment, fixing #103776 + +Tue Feb 4 16:05:53 CET 2003 Daniel Veillard + + * parser.c: fixing bug 105049 for validity checking of content + within recursive entities. + +Tue Feb 4 15:40:54 CET 2003 Daniel Veillard + + * HTMLparser.c: try to fix # 105049 + * relaxng.c xmlschemastypes.c: a couple of changes and extensions + * tree.c: updated a function comment + +Tue Feb 4 00:20:58 CET 2003 Daniel Veillard + + * relaxng: more work on grammars and refs/defs + * test/relaxng/* result/relaxng/*: augmented/updated the + regression tests + +Mon Feb 3 14:16:59 CET 2003 Daniel Veillard + + * relaxng: more work on name classes, except support + * test/relaxng/* result/relaxng/*: augmented/updated the + regression tests + +Mon Feb 3 11:56:05 CET 2003 Daniel Veillard + + * relaxng: more work on name classes, the "validate all" schemas + seems to work now. + * test/relaxng/* result/relaxng/*: augmented/updated the + regression tests + +Mon Feb 3 09:50:26 CET 2003 Daniel Veillard + + * python/libxml.c: removed an unprotedted debug message Aleksi Suhonen + * parser.c: put a guard against infinite document depth, basically + trying to avoid another kind of DoS attack. + * relaxng.c: some code w.r.t. nameClasses + +Sun Feb 2 17:01:43 CET 2003 Daniel Veillard + + * test/relaxng/* result/relaxng/*: check all the namespace support + was actually correct based on tutorial section 10. + +Sun Feb 2 15:33:38 CET 2003 Daniel Veillard + + * relaxng: include seems to work okay now + * test/relaxng/* result/relaxng/*: augmented/updated the + regression tests + +Sat Feb 1 19:44:58 CET 2003 Daniel Veillard + + * relaxng.c: a bit of work done in the train back. + * test/relaxng/*: added one of the include tests + +Thu Jan 30 14:06:55 CET 2003 Daniel Veillard + + * relaxng: more work done in the train + * test/relaxng/* result/relaxng/*: augmented/updated the + regression tests + +Wed Jan 29 23:44:58 CET 2003 Daniel Veillard + + * relaxng.c: debugging of externalRef + * test/relaxng/* result/relaxng/*: augmented/updated the + regression tests + +Wed Jan 29 22:06:04 CET 2003 Daniel Veillard + + * relaxng.c: more work on Relax-NG, implementing externalRef + * test/relaxng/* result/relaxng/*: augmented/updated the + regression tests + * Makefile.am: cleanup to Relaxtests target + +Wed Jan 29 00:08:38 CET 2003 Daniel Veillard + + * relaxng.c: more work on Relax-NG, implementing interleave + * test/relaxng/* result/relaxng/*: augmented/updated the + regression tests + +Tue Jan 28 21:56:49 CET 2003 Daniel Veillard + + * relaxng.c: more work on Relax-NG, implementing interleave + * test/relaxng/* result/relaxng/*: augmented/updated the + regression tests + +Mon Jan 27 07:35:29 MST 2003 John Fleck + + * doc/tutorial/customfo.xsl + * doc/tutorial/customhtml.xsl + adding stylesheet customizations used to generate fo + for pdf and html + +Mon Jan 27 13:29:43 CET 2003 Daniel Veillard + + * relaxng.c: more work on Relax-NG + * test/relaxng/* result/relaxng/*: augmented/updated the + regression tests + * xmlschemastypes.c: added a number of base type definition but not + the associated checks, those are still TODOs + +Sun Jan 26 17:37:06 MST 2003 John Fleck + + in docs/tutorial: + * apa.html + * apb.html + * apc.html + * apd.html + * ape.html + * apf.html + * apg.html + * ar01s02.html + * ar01s03.html + * ar01s04.html + * ar01s05.html + * ar01s06.html + * ar01s07.html + * ar01s08.html + * index.html + * xmltutorial.pdf + * xmltutorial.xml + add index to tutorial + +Sun Jan 26 17:02:29 MST 2003 John Fleck + + * doc/xmlcatalog.1 + * doc/xmlcatalog_man.html + * doc/xmlcatalog_man.xml + belatedly fixing bug #93622 (adds rewriteURI type to + "--add" option in xmlcatalog man page + +Sun Jan 26 20:47:26 CET 2003 Daniel Veillard + + * xmlcatalog.c xmllint.c: applied patch for NetBSD by + Julio Merino, closing #104475 + +Sun Jan 26 20:38:43 CET 2003 Daniel Veillard + + * relaxng.c: more work on Relax-NG + * test/relaxng/* result/relaxng/*: augmented/updated the + regression tests + +Sun Jan 26 01:49:58 CET 2003 Daniel Veillard + + * relaxng.c: more work on Relax-NG + * test/relaxng/* result/relaxng/*: augmented/updated the + regression tests + +Sat Jan 25 18:59:54 CET 2003 Daniel Veillard + + * README: updated the policy on private mail answers + * relaxng.c: more work on Relax-NG + * test/relaxng/* result/relaxng/*: augmented/updated the + regression tests + +Fri Jan 24 15:12:44 CET 2003 Daniel Veillard + + * error.c parser.c tree.c: applied a documentation patch from + Stefan Kost + +Fri Jan 24 02:00:50 CET 2003 Daniel Veillard + + * relaxng.c: more work on Relax-NG + * doc/*: regenerated the docs + * test/relaxng/* result/relaxng/*: updated and augmented the + Relax-NG regression tests and results + +Thu Jan 23 19:26:20 CET 2003 Daniel Veillard + + * Makefile.am configure.in relaxng.c include/libxml/relaxng.h: + First commit of the new Relax-NG validation code, not generally + useful yet. + * test/relaxng/* result/relaxng/*: current state of the regression + tests + +Thu Jan 23 19:22:54 CET 2003 Daniel Veillard + + * tree.c: minimized the memory allocated for GetContent + and a bit of cleanup. + +Thu Jan 23 17:41:37 CET 2003 Daniel Veillard + + * python/generator.py: seems there is no good reasons to + not generate bindings for XPointer + +Tue Jan 21 13:19:35 CET 2003 Daniel Veillard + + * xmlreader.c doc/apibuild.py: applied a new patch from + Stéphane Bidoul for cleanups + * doc/libxml2-api.xml: rebuilt the API description with + new entry points + +Mon Jan 20 23:25:00 CET 2003 Daniel Veillard + + * xmlreader.c python/drv_libxml2.py python/generator.py + python/libxml.c python/libxml.py python/libxml_wrap.h + python/types.c: patch from Stéphane Bidoul for better per + context error message APIs + * python/tests/ctxterror.py python/tests/readererr.py: + update of the tests + +Sun Jan 19 17:09:28 MST 2003 John Fleck + + * doc/guidelines.html + grammar and spelling cleanup + +Fri Jan 17 00:31:30 CET 2003 Daniel Veillard + + * xmlreader.c include/libxml/xmlreader.h python/generator.py + python/libxml.c python/libxml.py win32/libxml2.def.src: applied + a patch from Stéphane Bidoul to allow per XMLtextReader error + and warning handling + * python/tests/Makefile.am python/tests/readererr.py: adding the + specific regression test + +Tue Jan 14 17:00:08 CET 2003 Daniel Veillard + + * xpath.c: Alexey Efimov pointed out that concat('a', 'b', ) + should raise a syntax error + +Tue Jan 14 15:39:14 CET 2003 Daniel Veillard + + * python/libxml.c: cleanup patch from Stéphane Bidoul + +Tue Jan 14 14:41:18 CET 2003 Daniel Veillard + + * encoding.c: fixing bug #103100 with a dummy UTF8ToUTF8 copy + +Tue Jan 14 12:40:29 CET 2003 Daniel Veillard + + * python/generator.py python/libxml.c python/libxml.py + python/libxml_wrap.h python/types.c: applied and fixed a patch + from Stéphane Bidoul to provide per parser error handlers at the + Python level. + * python/tests/Makefile.am python/tests/ctxterror.py: added a + regression test for it. + +Tue Jan 14 01:15:04 CET 2003 Daniel Veillard + + * xmlreader.c: fixed the streaming property of the reader, + it was generating tree faster than consuming it. Pointed out + by Nate Myers + * tree.c: fixed a bug in xmlSaveFormatFileEnc if passed a NULL doc + +Sun Jan 12 22:18:02 CET 2003 Igor Zlatkovic + + * win32/libxml2.def.src: added more xmlreader and other exports + +Fri Jan 10 18:04:32 CET 2003 Daniel Veillard + + * xpath.c: fix to the XPath implementation for parent and + ancestors axis when operating on a Result Value Tree. + Fixes bug #100271 + +Fri Jan 10 17:07:01 CET 2003 Daniel Veillard + + * nanoftp.c nanohttp.c xmlIO.c: patch from Stefano Zacchiroli + to fix some URI/file escaping problems + +Fri Jan 10 16:20:34 CET 2003 Daniel Veillard + + * python/generator.py: fixed a bug raised by Raymond Wiker, + docSetRootElement() should not raise an exception if the + return is None + +Fri Jan 10 14:13:03 CET 2003 Daniel Veillard + + * python/libxml.py python/libxml.c python/libxml2-python-api.xml: + fixed bug #102181 by applying the suggested change and fixing + the generation/registration problem. + +Fri Jan 10 13:47:55 CET 2003 Daniel Veillard + + * HTMLparser.c: fixed bug #102960 by reusing the XML name parsing + routines. + +Fri Jan 10 00:16:49 CET 2003 Daniel Veillard + + * parser.c: one more IsEmptyElement crazyness, that time in + external parsed entities if substitution is asked. + * python/tests/reader3.py: added a specific test. + +Thu Jan 9 22:35:31 CET 2003 Daniel Veillard + + * python/drv_libxml2.py: update from Stéphane Bidoul: python 2.1 + support and improved error handler registration + +Thu Jan 9 14:16:38 CET 2003 Daniel Veillard + + * HTMLtree.c tree.c: fixes #102920 about namespace handling in + HTML output and section 16.2 "HTML Output Method" of XSLT-1.0 + * README: fixed a link + +Wed Jan 8 18:32:25 CET 2003 Daniel Veillard + + * configure.in doc/* NEWS: preparing 2.5.1 release + * SAX.c parser.c: fixing XmlTextReader bug + +Wed Jan 8 00:13:01 CET 2003 Daniel Veillard + + * SAX.c: fuck, I introduced a memory leak on external parsed + entities in 2.5.0 :-( + +Tue Jan 7 12:12:45 CET 2003 Daniel Veillard + + * xmllint.c: another fix needed as pointed by Christophe Merlet + for --stream --debug if compiled without debug support. + +Mon Jan 6 20:53:08 MST 2003 John Fleck + + * doc/xmllint.xml + * doc/xmllint.1: + update man page with --stream and --chkregister + +Tue Jan 7 01:17:26 CET 2003 Daniel Veillard + + * globals.c: fixed --with-threads compile + * xmllint.c: fixed --without-debug compile + * include/libxml/globals.h: cleanup + * include/libxml/schemasInternals.h: add a missing include + +Mon Jan 6 14:06:07 CET 2003 Daniel Veillard + + * configure.in NEWS: preparing 2.5.0 release + * SAX.c: only warn in pedantic mode about namespace name + brokeness + * globals.c: fix a doc generation problem + * uri.c: fix #101520 + * doc/*: updated and rebuilt the doc for the release, includuding + stylesheet update + * python/Makefile.am: fix a filename bug + +Mon Jan 6 12:05:12 CET 2003 Daniel Veillard + + * doc/tutorial/* : fixed #101894 if doc == NULL xmlFreeDoc + should not be called. + +Mon Jan 6 11:59:09 CET 2003 Daniel Veillard + + * libxml-2.0.pc.in: applied the patch to fix #101894 + +Sun Jan 5 23:35:47 CET 2003 Daniel Veillard + + * tree.c : applied patch from Lukas Schroeder for register callbacks + * valid.c: modified patch from Lukas Schroeder to test + register callbacks with --chkregister + +Sun Jan 5 02:23:20 CET 2003 Daniel Veillard + + * xmlreader.c: seriously changed the way data are pushed to + the underlying parser, go by block of 512 bytes instead of + tryng to detect tag boundaries at that level. Changed the + way empty element are detected and tagged. + * python/tests/reader.py python/tests/reader2.py + python/tests/reader3.py: small changes mostly due to context + reporting being different and DTD node being reported. Some + errors previously undetected are now caught and fixed. + * doc/xmlreader.html: flagged last section as TODO + +Sat Jan 4 20:40:28 CET 2003 Daniel Veillard + + * python/libxml.py: integrated the Python 2.2 optimizations + from Hannu Krosing, while maintaining compatibility with + 1.5 and 2.1 + +Sat Jan 4 17:33:17 CET 2003 Daniel Veillard + + * xmllint.c: a bit of cleanup + * xmlreader.c: small fix + * doc/xmlreader.html: more work on the XmlTextReader tutorial + * python/libxml.py: a few fixes pointed out by Hannu Krosing + +Sat Jan 4 13:46:14 CET 2003 Daniel Veillard + + * python/setup.py.in: patch from Stéphane Bidoul to include + drv_libxml2.py in setup.py + +Sat Jan 4 01:43:06 CET 2003 Daniel Veillard + + * doc/xmlreader.html: starting documenting the new XmlTextReader + interface. + +Fri Jan 3 17:18:32 CET 2003 Daniel Veillard + + * xmllint.c: added the --stream flag to use the TextReader API + * xmlreader.c: small performance tweak + +Fri Jan 3 13:50:55 CET 2003 Daniel Veillard + + * xmlreader.c python/tests/reader2py: okay the DTD validation + code on top of the XMLTextParser API should be solid now. + +Fri Jan 3 02:17:18 CET 2003 Daniel Veillard + + * xmlreader.c python/tests/reader2py: Fixing some more mess + with validation and recursive entities while using the + reader interface, it's getting a bit messy... + +Thu Jan 2 15:15:26 CET 2003 Daniel Veillard + + * xmlreader.c python/tests/reader.py: another couple of problem + related to IsEmptyElement reported by Stéphane Bidoul needed + some fixes. + +Thu Jan 2 13:57:07 CET 2003 Daniel Veillard + + * libxml.spec.in python/Makefile.am python/drv_libxml2.py: + integrated drv_libxml2.py Python xml.sax driver from Stéphane Bidoul + based on the python XmlTextReader interface. + +Wed Jan 1 22:05:40 CET 2003 Daniel Veillard + + * tree.c: backing out one change in the last patch which broke the + regression tests + +Wed Jan 1 21:57:28 CET 2003 Daniel Veillard + + * global.data globals.c tree.c include/libxml/globals.h: applied + an old patch from Lukas Schroeder to track node creation and + destruction. Probably missing a lot of references at the moment + and not usable reliably. + +Wed Jan 1 20:12:07 CET 2003 Daniel Veillard + + * NEWS doc/Makefile.am doc/news.xsl: generate the NEWS file + from doc/news.html and a stylesheet + +Wed Jan 1 16:09:57 CET 2003 Daniel Veillard + + * xmlreader.c python/tests/reader.py: fixed another couple of + xmlreader bugs reported by Stéphane Bidoul and added tests. + +Wed Jan 1 15:42:54 CET 2003 Daniel Veillard + + * xmlreader.c python/tests/reader2.py: fixed another validity + checking in external parsed entities raised by Stéphane Bidoul + and added a specific regression test. + * python/tests/reader3.py: cleanup + +Tue Dec 31 15:44:02 CET 2002 Daniel Veillard + + * xmlreader.c python/tests/reader2.py: fixed a problem with + validation within entities pointed by Stéphane Bidoul, augmented + the tests to catch those. + +Tue Dec 31 12:15:37 CET 2002 Daniel Veillard + + * python/generator.py: modified the generator to allow keeping + class references when creating new classes, needed to fix a bug + pointed by Stéphane Bidoul where the input buffer of the + xmlTextReader instance gets destroyed if the python wrapper for + the input is not referenced anymore. + +Mon Dec 30 19:39:36 CET 2002 Daniel Veillard + + * xmlreader.c python/tests/reader.py: fixed another pair of problem + pointed by Stéphane Bidoul: depth start at 0 and a parse problem. + +Mon Dec 30 13:36:50 CET 2002 Daniel Veillard + + * xmlreader.c python/tests/reader.py: fixed another problem + pointed by Stéphane Bidoul + +Mon Dec 30 12:39:55 CET 2002 Daniel Veillard + + * xmlreader.c python/tests/reader.py: fixed a limit case problem + with "" + +Mon Dec 30 11:53:44 CET 2002 Daniel Veillard + + * SAX.c: warn on xmlns:prefix="foo" + * xmlreader.c python/tests/reader.py: fixed a couple of problem + for namespace attributes handling. + +Mon Dec 30 00:59:07 CET 2002 Daniel Veillard + + * entities.c parser.c tree.c include/libxml/entities.h: Fixed + a really nasty problem raised by a DocBook XSLT transform + provided by Sebastian Bergmann + +Sun Dec 29 12:13:18 CET 2002 Daniel Veillard + + * xmlreader.c python/tests/reader.py: fixed a bug pointed out + by Stéphane Bidoul and integrated it into the tests + +Sat Dec 28 23:49:12 CET 2002 Daniel Veillard + + * xmlreader.c include/libxml/xmlreader.h doc/libxml2-api.xml: + extended the XmlTextReader API a bit, addding accessors for + the current doc and node, and an entity substitution mode for + the parser. + * python/libxml.py python/libxml2class.txt: related updates + * python/tests/Makefile.am python/tests/reader.py + python/tests/reader2.py python/tests/reader3.py: updated a bit + the old tests and added a new one to test the entities handling + +Sat Dec 28 22:11:57 CET 2002 Daniel Veillard + + * python/generator.py python/libxml2class.txt + python/tests/reader.py python/tests/reader2.py: changed the + generator to provide casing for the XmlTextReader similar to + C# so that examples and documentation are more directly transposable. + Fixed the couple of tests in the suite. + +Sat Dec 28 15:55:32 CET 2002 Daniel Veillard + + * doc/guidelines.html: added a document on guildeline for + publishing and deploying XML + +Fri Dec 27 20:35:15 CET 2002 Daniel Veillard + + * valid.c xmlreader.c: final touch running DTD validation + on the XmlTextReader + * python/tests/Makefile.am python/tests/reader2.py: added a + specific run based on the examples from test/valid/*.xml + +Fri Dec 27 15:17:20 CET 2002 Daniel Veillard + + * python/libxml.py: added a few predefined xmlTextReader parser + configuration values. + +Fri Dec 27 12:57:22 CET 2002 Daniel Veillard + + * python/libxml_wrap.h: trying to fix #102037 + +Fri Dec 27 12:18:14 CET 2002 Daniel Veillard + + * SAX.c: fixing bug #95296, when the predefined entities + are redefined in the DTD the default one must be used + instead anyway. + +Wed Dec 25 19:22:06 MST 2002 John Fleck + + * doc/xmllint.xml + * doc/xmllint.1 + Add discussion of XML_DEBUG_CATALOG to xmllint man + page - bug #100907 + + +Mon Dec 23 16:54:22 CET 2002 Daniel Veillard + + * xmlreader.c: Fixed the empty node detection to avoid reporting + an inexistant close tag. + +Mon Dec 23 15:42:24 CET 2002 Daniel Veillard + + * python/libxml.c python/setup.py.in: patch from Stéphane Bidoul + for Python 2.1 + +Sun Dec 22 11:24:06 CET 2002 Daniel Veillard + + * testC14N.c vms/config.vms: applied Craig A. Berry patches for VMS + +Fri Dec 20 11:27:49 CET 2002 Daniel Veillard + + * doc/libxml2-api.xml python/tests/reader.py: one really need + to provide the base URI information when creating a reader parser + from an input stream. Updated the API and the example using it. + +Fri Dec 20 01:11:30 CET 2002 Daniel Veillard + + * testReader.c xmlreader.c valid.c include/libxml/tree.h + include/libxml/valid.h include/libxml/xmlreader.h: working on + DTD validation on top of xml reader interfaces. Allows to + validate arbitrary large instances. This required some extensions + to the valid module interface and augmenting the size of xmlID + and xmlRef structs a bit. + * uri.c xmlregexp.c: simple cleanup. + +Wed Dec 18 15:51:22 CET 2002 Daniel Veillard + + * xmlreader.c include/libxml/xmlreader.h doc/libxml2-api.xml: more + work on the xml reader interfaces. + * AUTHORS MAINTAINERS doc/* win32/*: updated Igor's mail and the + Web page for the Windows binaries. + +Tue Dec 17 19:31:07 CET 2002 Daniel Veillard + + * xmlIO.c: applied a patch for VMS following the report by + Nigel Hall + +Tue Dec 17 11:29:41 CET 2002 Daniel Veillard + + * parser.c: the parseStartTag bug fix wasn't complete. + +Mon Dec 16 23:00:05 CET 2002 Daniel Veillard + + * parser.c: Vyacheslav Pindyura managed to trigger a bug in + parseStartTag, fixing it. + * test/att4 result/att4 result/noent/att4: adding the test + * xmlreader.c include/libxml/xmlreader.h doc/libxml2-api.xml: added + more methods to XmlTextReader. + +Mon Dec 16 19:31:16 CET 2002 Igor Zlatkovic + + * win32/libxml2.def.src: added more xml reader exports + * win32/Makefile.msvc win32/Makefile.mingw: added xml reader interface + to the build + +Mon Dec 16 06:36:54 MST 2002 John Fleck + + * doc/tutorial/xmltutorial.xml + plus generated html and pdf + Updating tutorial again based on further comments from Niraj + Tolia on the last iteration + +Sun Dec 15 21:27:30 MST 2002 John Fleck + + * doc/tutorial/xmltutorial.xml + * doc/tutorial/includekeyword.c + * doc/tutorial/includegetattribute.c + plus generated html and pdf + Adding fix from Niraj Tolia to tutorial to properly free memory. + + +Mon Dec 16 00:34:25 CET 2002 Daniel Veillard + + * xmlreader.c include/libxml/xmlreader.h doc/libxml2-api.xml: added + more methods of XmlTextReader. + * python/libxml2class.txt python/tests/reader.py: this increased the + methods in the bndings, augmented the test to check those new + functions. + +Sat Dec 14 23:57:39 CET 2002 Daniel Veillard + + * xmlreader.c doc/libxml2-api.xml: added the close and getattribute + methods of XmlTextReader. + * python/generator.py python/libxml_wrap.h python/types.c + python/libxml2class.txt: added the reader to the Python bindings + * python/tests/Makefile.am python/tests/reader.py: added a specific + test for the Python bindings of the Reader APIs + * parser.c: small cleanup. + +Fri Dec 13 11:39:44 CET 2002 Daniel Veillard + + * xinclude.c: fallback was only copying the first child not the + full child list of the fallback element, closes #89684 as reopened + by Bernd Kuemmerlen + +Thu Dec 12 13:34:59 CET 2002 Igor Zlatkovic + + * win32/libxml2.def.src: exported htmlNodeDumpOutput + +Thu Dec 12 10:59:11 CET 2002 Daniel Veillard + + * configure.in: preparing release of 2.4.30 + * doc/apibuild.py doc/libxml2-api.xml: fixups to the api builder, + gives enum values, fix functype return type, put back fields in + structs + * doc/*: updated the docs rebuilt + +Thu Dec 12 01:09:34 CET 2002 Daniel Veillard + + * HTMLtree.c include/libxml/HTMLtree.h: patch from Mark Vadok + about htmlNodeDumpOutput location. + * xpath.c: removed an undefined function signature + * doc/apibuild.py doc/libxml2-api.xml: the script was exporting + too many symbols in the API breaking the python bindings. + Updated with the libxslt/libexslt changes. + +Wed Dec 11 20:26:15 CET 2002 Daniel Veillard + + * configure.in: preparing release of 2.4.29 + * doc/*: rebuilt the docs and API + * xmlreader.c: a few more fixes for the XmlTextReader API + +Wed Dec 11 18:01:15 CET 2002 Igor Zlatkovic + + * include/win32config.h: applied mingw patch from Magnus Henoch + +Wed Dec 11 16:58:48 CET 2002 Daniel Veillard + + * catalog.c doc/libxml2-api.xml: a bit more cleanup + +Wed Dec 11 14:54:47 CET 2002 Daniel Veillard + + * doc/apibuild.py doc/libxml2-api.xml doc/Makefile.am: new API + building Python script, does the C parsing directly, generates + a better API description including structure fieds defs and + enums. Still a couple of bugs, but good enough for the python + wrappers now. + * DOCBparser.c SAX.c nanohttp.c parser.c parserInternals.c tree.c + valid.c xmlIO.c xmlmemory.c xmlreader.c xmlregexp.c xmlschemas.c + include/libxml/schemasInternals.h include/libxml/tree.h: more + cleanup based on the python analysis script reports. + * libxml.spec.in: make sure the API XML description is part of the + devel package. + +Tue Dec 10 16:16:34 CET 2002 Daniel Veillard + + * DOCBparser.c HTMLparser.c c14n.c debugXML.c encoding.c hash.c + nanoftp.c nanohttp.c parser.c parserInternals.c testC14N.c + testDocbook.c threads.c tree.c valid.c xmlIO.c xmllint.c xmlmemory.c + xmlreader.c xmlregexp.c xmlschemas.c xmlschemastypes.c xpath.c: + code cleanup, especially the function comments. + * tree.c: fixed a small bug when freeing nodes which are XInclude ones. + +Mon Dec 9 15:08:17 CET 2002 Daniel Veillard + + * Makefile.am xmlreader.c include/libxml/Makefile.am + include/libxml/xmlreader.h: Adding a new set of APIs based on + the C# TextXmlReader API but converted to C. Allow to parse + in constant memory usage, far simpler to program and explain + than the SAX like APIs, unfinished but working. + * testReader.c: test program + +Sun Dec 8 18:36:01 CET 2002 Igor Zlatkovic + + * win32/libxml2.def.src: applied YALDSP from Mark Vakoc + +Wed Dec 4 16:08:49 CET 2002 Daniel Veillard + + * tree.c: Chip turner indicated that XHTML1 serialization + rule for style actually break on both IE and Mozilla, + try to avoid the rule if escaping ain't necessary + +Wed Dec 4 12:43:28 CET 2002 Daniel Veillard + + * nanhttp.c: handle HTTP URL escaping, problem reported by + Glen Nakamura and Stefano Zacchiroli + +Sat Nov 30 12:19:17 CET 2002 Daniel Veillard + + * DOCBparser.c HTMLparser.c parser.c valid.c xpath.c: code cleanup + +Thu Nov 28 12:53:22 CET 2002 Daniel Veillard + + * uri.c: Johann Richard pointed out some XPointer problems for + URN based URI references in XInclude. Modified the URI parsing + and saving routines to allow correct parsing and saving of + XPointers, especially when attached to "opaque" scheme accordingly + to RFC 2396 + +Wed Nov 27 20:36:08 CET 2002 Daniel Veillard + + * HTMLtree.c include/libxml/HTMLtree.h: applied the same kind + of refactoring to the HTML saving code. + * doc/libxml2-*.xml doc/API*.html: slight API changes got reflected + in the doc. + +Wed Nov 27 12:40:16 CET 2002 Daniel Veillard + + * tree.c include/libxml/tree.h: refactored the XML dump of a node + to a buffer API to reuse the generic dump to an OutputIO layer, + this reduces code, fixes xmlNodeDump() for XHTML, also made + xmlNodeDump() now return the number of byte written. + +Wed Nov 27 09:00:00 CET 2002 Daniel Veillard + + * python/setup.py.in: another patch from Stéphane Bidoul for + Python bindings on Windows + * doc/parsedecl.py: small cleanup + +Mon Nov 25 17:28:53 CET 2002 Daniel Veillard + + * libxml.spec.in configure.in: add a line in %changelog for releases + +Mon Nov 25 14:18:27 CET 2002 Daniel Veillard + + * parser.c: patch from Marcus Clarke fixing a problem in entities + parsing that was detected in KDe documentations environment. + +Mon Nov 24 14:13:21 CET 2002 ERDI Gergo + + * python/libxml.c (libxml_prev): Return the previous as opposed to + the next node (I guess this is the result of some cut & paste programming:) + +Sat Nov 23 17:22:22 CET 2002 Daniel Veillard + + * doc/Makefile.am: Jan Rafaj pointed a bug in the Makefile. + +Sat Nov 23 12:21:24 CET 2002 Daniel Veillard + + * python/generator.py python/libxml.c python/setup.py.in: trying + to fix the Python bindings build on Windows (Stéphane Bidoul) + +Fri Nov 22 22:41:34 CEST 2002 Igor Zlatkovic + + * win32/configure.js: added option for python bindings + * win32/libxml2.def.src: added more exports + +Fri Nov 22 18:50:34 CET 2002 Igor Zlatkovic + + * win32/Makefile.mingw: fixed unresolved symbols when linking with + pthreads + * win32/wince/*: applied updates to Windows CE port from Javier + +Fri Nov 22 15:51:22 CET 2002 Daniel Veillard + + * configure.in: preparing 2.4.28 + * libxml.spec.in doc/Makefile.am: some cleanup + * doc/*: updated the news and regenerated. + +Fri Nov 22 14:15:14 CET 2002 Daniel Veillard + + * HTMLparser.c: final touch at closing #87235

end tags + need to be generated. + * result/HTML/cf_128.html result/HTML/test2.html result/HTML/test3.html: + this change slightly the output of a few tests + * doc/*: regenerated + +Fri Nov 22 13:26:19 CET 2002 Daniel Veillard + + * parserInternals.c: fixing bug #99190 when UTF8 document are + parsed using the progressive parser and the end of the chunk + is in the middle of an UTF8 multibyte character. + +Fri Nov 22 13:13:00 HKT 2002 William Brack + + * threads.c: fixed initialization problem in xmlNewGlobalState + which was causing crash. + * globals.c: removed duplicate call to initxmlDefaultSAXHandler + in xmlInitializeGlobalState. + * parserInternals.c: cleaned up ctxt->sax initialisation. + +Thu Nov 21 15:05:45 CET 2002 Daniel Veillard + + * tree.c include/libxml/tree.h: modified the existing APIs + to handle XHTML1 serialization rules automatically, also add + xmlIsXHTML() to libxml2 API. Some tweaking to make sure + libxslt serialization uses it when needed without changing + the library API. + * test/xhtml1 result/noent/xhtml1 result/valid/xhtml1.xhtml + result/xhtml1: added a new test specifically for xhtml1 output + and updated the result of one XHTML1 test + +Wed Nov 20 14:24:56 CET 2002 Daniel Veillard + + * xinclude.c parserInternals.c encoding.c: fixed #99082 + for xi:include encoding="..." support on text includes. + * result/XInclude/tstencoding.xml test/XInclude/docs/tstencoding.xml + test/XInclude/ents/isolatin.txt : added a specific regression test + * python/generator.py python/libxml2class.txt: fixed the generator + the new set of comments generated for doc/libxml2-api.xml were + breaking the python generation. + +Tue Nov 19 23:25:47 CET 2002 Daniel Veillard + + * doc/Makefile.am: repair some problem if gtk-doc fail or such + * configure.in: patch for Solaris on new autoconf closes #98880 + * doc/parsedecl.py: repair the frigging API building script, + did I say that python xmllib sucks ? + * doc/libxml2-api.xml doc/libxml2-refs.xml: regenerated, reordering + and some comment are no more truncated. + +Tue Nov 19 09:09:04 CET 2002 Daniel Veillard + + * parser.c: Martin Stoilov pointed out a potential leak in + xmlCreateMemoryParserCtxt + +Mon Nov 18 16:05:51 CET 2002 Daniel Veillard + + * HTMLparser.c: fixed bug #98879 a corner case when 0 is + included in HTML documents and using the push parser. + +Mon Nov 18 00:11:24 CET 2002 ERDI Gergo + + * configure.in (PYTHON_SITE_PACKAGES): If --with-python is + specified, look for the Python interpreter not just in the + specified root but also in the specified location. Fixes #98825 + +Sun Nov 17 23:36:06 CET 2002 Daniel Veillard + + * python/libxml.c: fixing bug #98792 , node may have no doc + and dereferencing without checking ain't good ... + +Sun Nov 17 10:25:43 CET 2002 Daniel Veillard + + * configure.in: preparing release 2.4.27 + * doc/* : updated and rebuilt the docs + * doc/Makefile.am libxml.spec.in: try to make sure the tutorial + and all the docs are actually packaged and in the final RPMs + * parser.c parserInternals.c include/libxml/parser.h: restore + xmllint --recover feature. + +Sat Nov 16 16:30:25 CET 2002 Daniel Veillard + + * parser.c xpath.c: fixing #96925 wich was also dependent on the + processing of parsed entities, and XPath computation on sustitued + entities. + * testXPath.c: make sure entities are substitued. + +Fri Nov 15 16:22:54 CET 2002 Daniel Veillard + + * parser.c: fixed #96594, which was totally dependent on the + processing of internal parsed entities, which had to be changed. + +Fri Nov 15 12:16:07 CET 2002 Daniel Veillard + + * Makefile.am python/Makefile.am python/tests/Makefile.am: + trying to fix bug #98517 about building outside the source tree + * doc/xml.html doc/FAQ.html: fixed the link to libiconv #94585 + +Thu Nov 14 18:41:55 CEST 2002 Igor Zlatkovic + + * include/win32config.h: cleanup + * win32/Makefile.mingw: integrated mingw in JScript configure + * win32/Makefile.msvc: modified to allow mingw coexistence + * win32/configure.js: integrated mingw + * win32/Readme.txt: cleanup + +Tue Nov 12 22:06:45 CET 2002 Daniel Veillard + + * HTMLparser.c: strengthen the guard in the Pop macros, + like in the XML parser, closes bug #97315 + +Tue Nov 12 21:56:39 CET 2002 Daniel Veillard + + * include/libxml/parser.h: fixed bug #98338 , fatalError SAX + callback is never used. + +Tue Nov 12 13:32:50 CET 2002 Daniel Veillard + + * parserInternals.c: fixed the initialization of the SAX structure + which was breaking xsltproc + * xpath.c: patch from Petr Pajas for CDATA nodes + * tree.c: patch from Petr Pajas improving xmlGetNodePath() + * parser.c include/libxml/parser.h: patch from Peter Jones + removing a leak in xmlSAXParseMemory() and adding the + function xmlSAXParseMemoryWithData() + +Mon Nov 11 20:47:03 MST 2002 John Fleck + + adding pdf of tutorial, changing web page to link to it + * doc/tutorial/xmltutorial.pdf + * doc/xml.html + * doc/docs.html + +Sun Nov 10 20:48:57 MST 2002 John Fleck + + * doc/tutorial/ar01s08.html + adding file what I forgot for tutorial + + +Sun Nov 10 20:33:13 MST 2002 John Fleck + + Adding encoding discussion to tutorial + Added: + * doc/tutorial/images/*.png: DocBook admonition image files + * doc/tutorial/apf.html, apg.html: new generated html + * doc/tutorial/includeconvert.c: conversion code entity file + changed: + * doc/tutorial/xmltutorial.xml: DocBook original + * doc/tutorial/*.html: generated html + +Fri Nov 8 17:59:32 CEST 2002 Igor Zlatkovic + + * include/libxml/*.h: retired xmlwin32version.h + * doc/Makefile.am: retired xmlwin32version.h + * win32/configure.js: retired xmlwin32version.h + +Fri Nov 8 16:55:47 CEST 2002 Igor Zlatkovic + + * win32/libxml2.def.src: exported additional symbols + * include/libxml/xmlmemory.h: exported the rest of the xmlMem* + sisterhood + +Fri Nov 8 16:08:13 CET 2002 Daniel Veillard + + * globals.c: fixed a typo pointed out by Igor + * xpath.c: try to speed up node compare using line numbers + if available. + +Thu Nov 7 15:16:02 CET 2002 Daniel Veillard + + * tree.c: make xmlFreeNode() handle attributes correctly. + +Wed Nov 6 23:51:11 CET 2002 Igor Zlatkovic + + * catalog.c: completed the #96963 fix, as reported by Karl + Eichwalder + +Wed Nov 6 16:48:44 CET 2002 Daniel Veillard + + * xpointer.c: tried to fix bug #97852 reported by Nicolas Noffke + +Sun Nov 3 10:43:44 CET 2002 Daniel Veillard + + * Makefile.am: switched the order of a couple of includes + to fix bugs #97100 + +Thu Oct 31 17:11:46 CEST 2002 Igor Zlatkovic + + * catalog.c: fixed bug #96963, reverted to the old behaviour of + xmlLoadCatalogs that used to separate directories with a ':'. + +Thu Oct 31 16:55:21 CEST 2002 Igor Zlatkovic + + * threads.c: improvements to the Windows-side of thread handling + * testThreads.c: conditionally excluded unistd.h + * testThradsWin32.c: broke overlong lines + * include/win32config.h: adapted thread-related macros to the new + scheme and for pthreads on Windows + * win32/Makefile.msvc: introduced a more flexible thread build, + added testThreads[Win32].c to the build + * win32/configure.js: introduced a more flexible thread config + +2002-10-31 John Fleck + + * doc/xml.html (and, by implication, FAQ.html) + added UTF-8 conversaion FAQ from Marcus Labib Iskander + +Tue Oct 29 18:32:33 CET 2002 Igor Zlatkovic + + * configure.in: removed xmlwin32version.h + * include/libxml/Makefile.am: removed xmlwin32version.h + +Mon Oct 28 14:01:29 CET 2002 Daniel Veillard + + * tree.c: applied patch from Brian Stafford to fix a bug + in xmlReconciliateNs() + +Mon Oct 28 13:51:55 CET 2002 Daniel Veillard + + * tree.c: applied patch from Christian Glahn to allow + xmlNewChild() on document fragment nodes + +Sat Oct 26 15:27:00 CEST 2002 Daniel Veillard + + * parser.c: Christian Glahn found a problem with a recent + patch to xmlParseBalancedChunkMemoryRecover() + * xmlschemas.c: Charles Bozeman fixed some Schemas validation + problems + * result/schemas/elem* result/schemas/seq* test/schemas.elem* + test/schemas/seq*: added the test cases from Charles + +Wed Oct 23 16:42:29 CEST 2002 Daniel Veillard + + * Makefile.am config.h.in libxml.spec.in doc/Makefile.am: + serious cleanup of the spec file and associated changes + in the Makefiles. + * valid.c: try to remove some warnings on x86_64 + +Wed Oct 23 10:53:42 CEST 2002 Daniel Veillard + + * include/Makefile.am: added winsockcompat.h to EXTRA_DIST to + fix bug #96586 + +Tue Oct 22 21:13:06 CEST 2002 Daniel Veillard + + * HTMLparser.c: Mikhail Sogrine pointed out a bug in HTML + parsing, applied his patch + * result/HTML/attrents.html result/HTML/attrents.html.err + result/HTML/attrents.html.sax test/HTML/attrents.html: + added the test and result case provided by Mikhail Sogrine + +Tue Oct 22 19:33:20 CEST 2002 Daniel Veillard + + * vms/build_libxml.com vms/config.vms vms/readme.vms + include/libxml/parser.h include/libxml/parserInternals.h + include/libxml/tree.h include/libxml/xmlIO.h + HTMLparser.c catalog.c debugXML.c parser.c parserInternals.c + tree.c triodef.h trionan.c uri.c xmlIO.c xpath.c: + Applied the VMS update patch from Craig A. Berry + * doc/*.html: update + +Tue Oct 22 16:27:31 CEST 2002 Daniel Veillard + + * include/libxml/encoding.h encoding.c: made xmlGetUTF8Char public + +Tue Oct 22 16:25:18 CEST 2002 Daniel Veillard + + * debugXML.c: adding a grep command to --shell in xmllint + for T.V. Raman + +Tue Oct 22 16:23:57 CEST 2002 Daniel Veillard + + * xmlcatalog.c: tried to fix some of the problem with --sgml + +Mon Oct 21 09:57:10 CEST 2002 Daniel Veillard + + * parser.c: tried to fix bug #91500 where doc->children may + be overriden by a call to xmlParseBalancedChunkMemory() + +Mon Oct 21 09:04:32 CEST 2002 Daniel Veillard + + * catalog.c: tried to fix bug #90945 w.r.t. parsing of system + identifiers in SGML catalogs containing '&' + +Sun Oct 20 23:31:47 CEST 2002 Daniel Veillard + + * python/types.c: fixed bugs when passing result value tree + to Python functions. + +Fri Oct 18 13:18:53 CEST 2002 Daniel Veillard + + * configure.in: preparing the release of 2.4.26 + * doc/*: updated and rebuilt the documentation + +Wed Oct 16 20:01:46 CEST 2002 Daniel Veillard + + * parser.c: fixed a XML Namespace compliance bug reported by + Alexander Grimalovsky + +Wed Oct 16 17:18:42 CEST 2002 Daniel Veillard + + * HTMLtree.c: fixed serialization of script and style when + they are not lowercase (i.e. added using the API to the tree). + +Wed Oct 16 16:31:05 CEST 2002 Daniel Veillard + + * valid.c: make xmlValidateDocument emit a warning msg if there + is no DTD, pointed by Christian Glahn + +Wed Oct 16 16:05:38 CEST 2002 Daniel Veillard + + * xmlregexp.c xmlschemas.c: fixed the validation of sequences + content model when some of the blocks have min or max, and a couple + of bugs found in the process. + * result/schemas/list0* test/schemas/list0*: added some specific + regression tests + +Tue Oct 15 12:41:01 CEST 2002 Daniel Veillard + + * README: updated the contact informations + +Tue Oct 15 10:35:57 CEST 2002 Daniel Veillard + + * Makefile.am: use test -f instead of test -e since Solaris /bin/sh + misses it, reported by Peter Bray. + +Mon Oct 14 17:37:32 CEST 2002 Daniel Veillard + + * tree.c: investigating xmlNodeGetContent() on namespace nodes + and removed a few warnings + +Mon Oct 14 13:12:55 CEST 2002 Daniel Veillard + + * parser.c: Christian Glahn found a small bug in the push parser. + * xmlIO.c include/libxml/xmlIO.h: cleaned up and made xmlCheckFilename + public + +Wed Oct 9 23:11:02 CEST 2002 Daniel Veillard + + * xmlschemas.c include/libxml/xmlschemas.h: added + xmlSchemaNewMemParserCtxt to parse a schemas from a memory area + * testSchemas.c: added --memory to test the new interface + +Wed Oct 9 16:22:54 CEST 2002 Daniel Veillard + + * doc/index.py doc/search.php: integrated the XSLT indexing, + a few fixed in the indexer, added a scope selection at the + search level. + +Wed Oct 9 12:18:37 CEST 2002 Daniel Veillard + + * valid.c: Joe Marcus Clarke reported a segfault on FBsd + this was due to uninitialized parts of the validation context + +Tue Oct 8 23:24:20 CEST 2002 Daniel Veillard + + * debugXML.c: applied patch from Mark Vakoc except the API + change, preserved it. + * doc/*: updated the docs to point to the search engine for + information lookup or before bug/help reports. + +Tue Oct 8 18:53:31 CEST 2002 Daniel Veillard + + * doc/index.py doc/search.php: added mailing-list archives + indexing and lookup + +Tue Oct 8 10:25:07 CEST 2002 Daniel Veillard + + * tree.c: patch from Mark Vakoc to fix xmlNodeGetPath() + +Mon Oct 7 13:12:03 CEST 2002 Daniel Veillard + + * doc/index.py: improved HTML indexing + * doc/search.php: make the queries also lookup the HTML based indexes + +Sun Oct 6 23:50:29 CEST 2002 Daniel Veillard + + * doc/index.py: added HTML page indexing + +Fri Oct 4 15:33:55 CEST 2002 Igor Zlatkovic + + * xmlIO.c: extended Windows path normalisation to fix the base + problem in libxslt. + * catalog.c: fixed list handling in XML_CATALOG_FILES + +Fri Oct 4 13:43:02 CEST 2002 Daniel Veillard + + * valid.c: typo/bug found by Christian Glahn + +Sun Sep 29 19:44:10 CEST 2002 Igor Zlatkovic + + * xmlIO.c: applied Windows CE patch from Javier. + * win32/wince: new directory, contains support for the PocketPC + with Windows CE from Javier. + * include/win32config.h: reorganised, removed duplicate + definitions and applied WinCE patch from Javier. + * include/wsockcompat.h: new file, now contains WinSock + compatibility macros. + * win32/Makefile.msvc: introduced double-run compilation. + +Thu Sep 26 19:48:06 CEST 2002 Daniel Veillard + + * configure.in include/libxml/xmlwin32version.h: preparing release + of 2.4.25 + * doc/*: updated and regenerated teh docs and web pages. + +Thu Sep 26 17:33:46 CEST 2002 Daniel Veillard + + * SAX.c valid.c include/libxml/valid.h: fixed bug #92518 validation + error were not covering namespace declarations. + * result/valid/dia.xml test/valid/dia.xml: the test wasn't valid, + it was missing the attribute declaration for the namespace + * result/VC/NS3: the fix now report breakages in that test + +Thu Sep 26 14:39:07 CEST 2002 Daniel Veillard + + * HTMLtree.c: fixing bug #94241 on HTML boolean attributes + +Thu Sep 26 14:25:33 CEST 2002 Daniel Veillard + + * doc/*: added the 3 new modules xmlregexp xmlautomata and xmlunicode + and regenerated the docs and web site + +Thu Sep 26 11:45:42 CEST 2002 Daniel Veillard + + * xinclude.c xmlschemas.c xmlschemastypes.c xpath.c: make sure + ATTRIBUTE_UNUSED is always put after the attribute declaration, + not before + +Thu Sep 26 11:33:28 CEST 2002 Daniel Veillard + + * python/generator.py python/libxml2class.txt: fixed a stupid error + breaking the python API + +Thu Sep 26 00:31:46 CEST 2002 Daniel Veillard + + * trio.c trio.h triodef.h trionan.c trionan.h triop.h + triostr.c triostr.h: applied a trio update patch from + Bjorn Reese which should work with MinGW + +Thu Sep 26 00:21:18 CEST 2002 Daniel Veillard + + * tree.c: improving some documentation comments + * xmlregexp.c: found and fixed a mem leak with python regression tests + * doc/*: rebuilt the doc and the API XML file including the + xmlregexp.h xmlautomata.h and xmlunicode.h headers + * python/generator.py python/libxml2class.txt python/libxml_wrap.h + python/types.c: added access to the XML Schemas regexps from + python + * python/tests/Makefile.am python/tests/regexp.py: added a + simple regexp bindings test + +Tue Sep 24 08:10:48 MDT 2002 John Fleck + + * doc/xml.html: + fixing ftp links - thanks to Vitaly Ostanin + +Tue Sep 24 16:08:17 CEST 2002 Daniel Veillard + + * xmlregexp.c: fixed the data callback on transition functionality + which was broken when using the compact form + * result/schemas/*: updated the results, less verbose, all tests + pass like before + * DOCBparser.c testAutomata.c testC14N.c testSchemas.c testThreads.c + testXPath.c valid.c xinclude.c xmllint.c xmlregexp.c xmlschemas.c + xmlschemastypes.c xpath.c python/libxml.c: removed a bunch of + annoying warnings + * xpath.c: try to provide better error report when possible + +Sat Sep 21 14:56:37 CEST 2002 Daniel Veillard + + * Makefile.am: fixed a breakage raised by Jacob + +Fri Sep 20 20:08:18 CEST 2002 Igor Zlatkovic + + * include/win32config.h: added HAVE_ERRNO_H definition for parts + which don't use sockets + +Fri Sep 20 18:40:50 CEST 2002 Igor Zlatkovic + + * win32/Makefile.msvc: applied zlib patch from Daniel Gehriger + * win32/configure.js: applied zlib patch from Daniel Gehriger + +Fri Sep 20 15:40:14 CEST 2002 Igor Zlatkovic + + * win32/configure.js: applied the patch from Mark Vakoc for + regexp support + * win32/libxml2.def.src: applied the patch from Mark Vakoc + for regexp support + +Fri Sep 20 15:35:33 CEST 2002 Daniel Veillard + + * xmlschemastypes.c: as pointed by Igor Float and Double + parsing ain't finished yet + +Fri Sep 20 14:00:16 CEST 2002 Daniel Veillard + + * Makefile.am configure.in: trying to fix #88412 by bypassing + all the python subdir if python ain't detected + +Thu Sep 19 21:46:53 CEST 2002 Daniel Veillard + + * Makefile.am configure.in include/libxml/xmlversion.h.in: + made configuring with regexps/automata/unicode the default + but without schemas ATM + * testRegexp.c valid.c xmlregexp.c include/libxml/xmlregexp.h: + fixed the regexp based DTD validation performance and memory + problem by switching to a compact form for determinist regexps + and detecting the determinism property in the process. Seems + as fast as the old DTD validation specific engine :-) despite + the regexp built and compaction process. + +Wed Sep 18 18:27:26 CEST 2002 Daniel Veillard + + * valid.c: determinism is debugged, new DTD checking code now works + but xmlFAComputesDeterminism takes far too much CPU and the whole + set usues too much memory to be really usable as-is + +Wed Sep 18 00:54:30 CEST 2002 Daniel Veillard + + * tree.c: fixed another stupid bug in xmlGetNodePath() + * xmllint.c: --version now report the options compiled in + +Tue Sep 17 23:48:07 CEST 2002 Daniel Veillard + + * HTMLparser.c: small cleanup + * valid.c xmlregexp.c: switched DTD validation to use only regexp + when configured with them. A bit of debugging around the determinism + checks is still needed + +Tue Sep 17 21:22:25 CEST 2002 Daniel Veillard + + * python/libxml_wrap.h: stupid bug found by mattam@netcourrier.com + +Tue Sep 17 19:58:26 CEST 2002 Daniel Veillard + + * xmlIO.c: small portability glitch fixed. + +Mon Sep 17 12:38:08 CEST 2002 Daniel Veillard + + * xmlschemastypes.c: incomplete steps for real/double support + * testAutomata.c include/libxml/xmlautomata.h + include/libxml/xmlregexp.h: avoiding a compilation problem + * valid.c include/libxml/valid.h: starting the work toward using + the regexps for actual DTD validation + +Fri Sep 13 16:46:14 CEST 2002 Daniel Veillard + + * hash.c: cosmetic cleanup + * valid.c include/libxml/tree.h include/libxml/valid.h: started + integrating a DTD validation layer based on the regexps + +Thu Sep 12 18:01:29 CEST 2002 Daniel Veillard + + * xmlregexp.c xmlschemas.c: fixed a bug reported by Jeff Goff, + the determinism was tested before eliminating the epsilon + transitions :-( + +Thu Sep 12 16:57:45 CEST 2002 Daniel Veillard + + * python/generator.py python/libxml.c python/libxml.py + python/libxml2-python-api.xml python/libxml2class.txt + python/libxml_wrap.h python/types.c: updated the python + bindings, added code for easier File I/O, and the ability to + define a resolver from Python fixing bug #91635 + * python/tests/Makefile.am python/tests/inbuf.py + python/tests/outbuf.py python/tests/pushSAXhtml.py + python/tests/resolver.py python/tests/serialize.py: updated + and augmented the set of Python tests. + +Tue Sep 10 21:05:28 CEST 2002 Igor Zlatkovic + + * win32/configure.js: added more readme info for the binary + package. + +Tue Sep 10 14:15:18 CEST 2002 Daniel Veillard + + * xmlIO.c: fixed a stupid out of bound array error + +Tue Sep 10 13:09:14 CEST 2002 Daniel Veillard + + * include/libxml/xmlIO.h xmlIO.c parser.c HTMLparser.c DOCBparser.c: + messing around with support for Windows path, cleanups, + trying to identify and fix the various code path to the + filename access. Added xmlNormalizeWindowsPath() + +Thu Sep 5 16:19:18 CEST 2002 Daniel Veillard + + * error.c valid.c: working on better error reporting of validity + errors, especially providing an accurate context. + * result/valid/xlink.xml.err result/valid/rss.xml.err: better + error reports in those cases. + +Thu Sep 5 13:29:47 CEST 2002 Daniel Veillard + + * DOCBparser.c HTMLparser.c c14n.c entities.c list.c + parser.c parserInternals.c xmlIO.c: get rid of all the + perror() calls made in the library execution paths. This + should fix both #92059 and #92385 + +Thu Sep 5 13:13:17 CEST 2002 Daniel Veillard + + * xmllint.c: memory leak reporting was broken after a change + of the preprocessor symbol used to activate it. + +Thu Sep 5 13:10:57 CEST 2002 Daniel Veillard + + * tree.c: try to make the copy function work for node of + type XML_DOCUMENT_FRAG_NODE, they are only created by the + DOM layers though, not libxml2 itself. + +Thu Sep 5 12:57:38 CEST 2002 Daniel Veillard + + * valid.c: try to provide file and line informations, not all + messages are covered, but it's a (good) start + +Thu Sep 5 12:49:35 CEST 2002 Daniel Veillard + + * xinclude.c: reimplemented a large part of the XInclude + processor, trying to minimize resources used, James Henstridge + provided a huge test case which was exhibiting severe memory + consumption problems. + +Thu Sep 5 10:07:13 CEST 2002 Daniel Veillard + + * python/Makefile.am: applied patch from Christophe Merlet to + reestablish DESTDIR + +Wed Sep 4 14:13:34 CEST 2002 Daniel Veillard + + * libxml.spec.in: fixes libary path for x86_64 AMD + +Tue Sep 3 21:14:19 MDT 2002 John Fleck + + * doc/tutorial/includekeyword.c + * doc/tutorial/xmltutorial.xml: + (plus resulting generated html files) + fixing one spot I missed in the tutorial where I hadn't freed + memory properly + +Sat Aug 31 19:31:17 MDT 2002 John Fleck + + * doc/tutorial/includeaddattribute.c + * doc/tutorial/includeaddkeyword.c + * doc/tutorial/includegetattribute.c + * doc/tutorial/includekeyword.c + * doc/tutorial/xmltutorial.xml + * doc/tutorial/*.html: + update tutorial to properly free memory (thanks to Christopher + R. Harris for pointing out that this needs to be done) + * doc/tutorial/images/callouts/*.png: + added image files so the callouts are graphical, making it + easier to read ( use "--param callout.graphics 1" to generate + html with graphical callouts) + +Wed Aug 28 13:44:54 CEST 2002 Daniel Veillard + + * doc/Libxml2-Logo-180x168.gif doc/Libxml2-Logo-90x34.gif: + nice logos generated by Marc Liyanage + * doc/site.xsl *.html: changed the stylesheet to show the new + logo and regenerated the pages + +Sun Aug 25 16:38:05 CEST 2002 Daniel Veillard + + * xmlIO.c: handle Windows sepecific file://localhost/ semantic ... + +Thu Aug 22 22:03:19 CEST 2002 Daniel Veillard + + * xpath.c: possible mem leak patch from Jason Adams + +Thu Aug 22 17:27:30 CEST 2002 Daniel Veillard + + * xpath.c: integrated xf:escape-uri() from Wesley Terpstra + in the XQuery namespace + * configure.in: preparing 2.4.24 + * doc/*.html: updated the web pages + +Thu Aug 22 16:19:42 CEST 2002 Daniel Veillard + + * python/generator.py: closing bug #85258 by generating conditional + compile check to avoid linking to routines not configured in. + +2002-08-22 Havoc Pennington + + * autogen.sh: update error message for missing automake + +Thu Aug 22 11:45:50 CEST 2002 Daniel Veillard + + * python/Makefile.am: typo in target name resulted in libxml2.py + to not be rebuilt. fixed DESTDIR similary to the libxslt one. + +Thu Aug 22 09:15:00 CEST 2002 Daniel Veillard + + * win32/win32/Makefile.mingw: updated with version from + Elizabeth Barham at http://soggytrousers.net/repository/ + +Tue Aug 20 16:40:48 CEST 2002 Igor Zlatkovic + + * win32/Makefile.msvc: added the prefix location to the include + and lib search path. + +2002-08-18 Havoc Pennington + + * autogen.sh: hardcode aclocal-1.4/automake-1.4 so that users with + both automake 1.6 and 1.4 installed get the right automake. Means + compilation from CVS will now require the latest automake 1.4 + release, or manually creating symlinks called "automake-1.4" and + "aclocal-1.4" + +Wed Aug 14 18:54:19 CEST 2002 Daniel Veillard + + * configure.in python/Makefile.am: more AMD 64 induced changes from + Frederic Crozat + +Wed Aug 14 16:43:53 CEST 2002 Daniel Veillard + + * xinclude.c: oops I was missing the xml:base fixup too + * result/XInclude/*.xml: this adds xml:base attributes to most + results of the tests + +Wed Aug 14 16:05:37 CEST 2002 Daniel Veillard + + * xinclude.c: quick but apparently working implementation of + xi:fallback, should close bug #89684 + * Makefile.am test/XInclude/docs/fallback.xml + result/XInclude/fallback.xml: added a basic test for fallback, + and run with --nowarning to avoid a spurious warning + * configure.in: applied patch from Frederic Crozat for python + bindings on AMD 64bits machines. + +Wed Aug 14 10:47:46 CEST 2002 Daniel Veillard + + * parser.c: xmlSAXUserParseMemory() really ought to fail if + the caller don't pass a SAX callback block. + +Wed Aug 14 10:29:02 CEST 2002 Daniel Veillard + + * tree.c: applied the same fix for the XML-1.0 namespace to + xmlSearchNsByHref() as was done for xmlSearchNs() + +Mon Aug 12 16:52:08 CEST 2002 Daniel Veillard + + * libxml.3: small cleanup of the man page + * HTMLtree.c: fixed a potential problem raised by Petr Vandrovec + when serializing HREF attributes generated by XSLT. + +Mon Aug 12 15:24:05 CEST 2002 Daniel Veillard + + * HTMLtree.c include/libxml/HTMLtree.h: integrated a cleaned up + version of Marc Liyanage' patch for boolean attributes in HTML + output + +Mon Aug 12 14:11:59 CEST 2002 Daniel Veillard + + * python/tests/serialize.py: fixed the test results, indenting + behaviour changed slightly + +Thu Aug 8 11:00:26 2002 Aleksey Sanin + + * win32/dsp/libxml2.def.src win32/libxml2.def.src: added + new c14n function to Windows def files + +Fri Aug 2 16:46:46 2002 Aleksey Sanin + + * c14n.c: fixed a memory leak in c14n code + +Sat Aug 3 00:15:06 CEST 2002 Daniel Veillard + + * parser.c include/libxml/parser.h: adding a new API for Christian + Glahn: xmlParseBalancedChunkMemoryRecover + * valid.c: patch from Rick Jones for some grammar cleanup in + validation messages + * result/VC/* result/valid/*: this slightly change some of the + regression tests outputs + +Thu Aug 1 14:50:28 CEST 2002 Daniel Veillard + + * tree.c: trying to fix a problem in namespaced attribute handling + raised by Christian Glahn + +Thu Aug 1 12:17:30 CEST 2002 Daniel Veillard + + * encoding.c include/libxml/encoding.h: Opening the interface + xmlNewCharEncodingHandler as requested in #89415 + * python/generator.py python/setup.py.in: applied cleanup + patches from Marc-Andre Lemburg + * tree.c: fixing bug #89332 on a specific case of loosing + the XML-1.0 namespace on xml:xxx attributes + +Wed Jul 31 23:27:42 2002 Aleksey Sanin + + * c14n.c include/libxml/c14n.h: fixed one more c14n + namespaces + corner case from new Merlin's test suite and added a callback + that will be used to improve xmlsec performance + + +Mon Jul 29 18:22:00 CEST 2002 Daniel Veillard + + * HTMLtree.c: trying to fix the