From 828ab1006dfc152349d766ed8538500b2ced0329 Mon Sep 17 00:00:00 2001 From: alexhudson Date: Fri, 10 Jul 2009 08:34:06 +0000 Subject: [PATCH] Merge memmgr-glib experiment onto trunk --- CMakeLists.txt | 63 + Makefile.am | 212 - Makefile.am.subdir | 17 - acinclude.m4 | 260 -- autogen.sh | 202 - bongo.pc.in | 11 - cmake/BongoCompiler.cmake | 27 + cmake/DefineInstallationPaths.cmake | 130 + cmake/Directories.cmake | 40 + cmake/Distribution.cmake | 11 + cmake/FindLog4C.cmake | 77 + cmake/Legacy.cmake | 17 + cmake/Requirements.cmake | 103 + config.h.cmake | 63 + config.rpath | 571 --- configure.ac | 778 ---- import/log4c/COPYING | 504 --- import/log4c/Makefile.am | 6 - import/log4c/example/Makefile.am | 11 - import/log4c/example/example.c | 127 - import/log4c/example/log4crc | 24 - import/log4c/log4c.h | 81 - import/log4c/log4c/Makefile.am | 51 - import/log4c/log4c/appender.c | 298 -- import/log4c/log4c/appender.h | 192 - import/log4c/log4c/appender_type_audit.c | 171 - import/log4c/log4c/appender_type_audit.h | 65 - import/log4c/log4c/appender_type_mmap.c | 157 - import/log4c/log4c/appender_type_mmap.h | 54 - import/log4c/log4c/appender_type_stream.c | 65 - import/log4c/log4c/appender_type_stream.h | 67 - import/log4c/log4c/appender_type_stream2.c | 211 - import/log4c/log4c/appender_type_stream2.h | 130 - import/log4c/log4c/appender_type_syslog.c | 129 - import/log4c/log4c/appender_type_syslog.h | 52 - import/log4c/log4c/audit_logevent.h | 499 --- import/log4c/log4c/buffer.h | 45 - import/log4c/log4c/category.c | 350 -- import/log4c/log4c/category.h | 587 --- import/log4c/log4c/config-win32.h | 32 - import/log4c/log4c/defs.h | 33 - import/log4c/log4c/init.c | 125 - import/log4c/log4c/init.h | 34 - import/log4c/log4c/layout.c | 197 - import/log4c/log4c/layout.h | 154 - import/log4c/log4c/layout_type_basic.c | 39 - import/log4c/log4c/layout_type_basic.h | 38 - import/log4c/log4c/layout_type_basic_r.c | 46 - import/log4c/log4c/layout_type_basic_r.h | 38 - import/log4c/log4c/layout_type_dated.c | 60 - import/log4c/log4c/layout_type_dated.h | 41 - import/log4c/log4c/layout_type_dated_r.c | 65 - import/log4c/log4c/layout_type_dated_r.h | 41 - import/log4c/log4c/location_info.h | 63 - import/log4c/log4c/log4c.c | 33 - import/log4c/log4c/logging_event.c | 43 - import/log4c/log4c/logging_event.h | 86 - import/log4c/log4c/priority.c | 58 - import/log4c/log4c/priority.h | 56 - import/log4c/log4c/rc.c | 213 - import/log4c/log4c/rc.h | 64 - import/log4c/log4c/version.c | 25 - import/log4c/log4c/version.h | 57 - import/log4c/sd/Makefile.am | 36 - import/log4c/sd/defs.h | 19 - import/log4c/sd/domnode-xml-parser.c | 1283 ------ import/log4c/sd/domnode-xml-parser.h | 21 - import/log4c/sd/domnode-xml-parser.y | 204 - import/log4c/sd/domnode-xml-scanner.c | 3805 ----------------- import/log4c/sd/domnode-xml-scanner.h | 882 ---- import/log4c/sd/domnode-xml.c | 149 - import/log4c/sd/domnode-xml.h | 33 - import/log4c/sd/domnode.c | 249 -- import/log4c/sd/domnode.h | 65 - import/log4c/sd/error.c | 66 - import/log4c/sd/error.h | 50 - import/log4c/sd/factory.c | 131 - import/log4c/sd/factory.h | 43 - import/log4c/sd/hash.c | 331 -- import/log4c/sd/hash.h | 166 - import/log4c/sd/list.c | 332 -- import/log4c/sd/list.h | 190 - import/log4c/sd/malloc.c | 138 - import/log4c/sd/malloc.h | 43 - import/log4c/sd/sd_xplatform.c | 104 - import/log4c/sd/sd_xplatform.h | 73 - import/log4c/sd/sprintf.c | 58 - import/log4c/sd/sprintf.h | 59 - import/log4c/sd/sprintf.osf.c | 44 - import/log4c/sd/stack.c | 164 - import/log4c/sd/stack.h | 41 - import/log4c/sd/test.c | 234 - import/log4c/sd/test.h | 44 - include/Bongo.rules | 43 - include/Makefile.am | 17 - include/bongocheck.h | 3 - include/connio.h | 4 +- include/logger.h | 212 +- include/memmgr.h | 122 +- include/msgapi.h | 2 +- include/xplthread.h | 182 +- include/xplutil.h | 149 +- m4/codeset.m4 | 21 - m4/gcc_stack_protect.m4 | 114 - m4/gettext.m4 | 549 --- m4/glibc2.m4 | 30 - m4/glibc21.m4 | 30 - m4/gmime.m4 | 40 - m4/iconv.m4 | 101 - m4/intdiv0.m4 | 70 - m4/intmax.m4 | 30 - m4/inttypes-pri.m4 | 30 - m4/inttypes.m4 | 25 - m4/inttypes_h.m4 | 26 - m4/isc-posix.m4 | 24 - m4/lcmessage.m4 | 30 - m4/lib-ld.m4 | 110 - m4/lib-link.m4 | 553 --- m4/lib-prefix.m4 | 153 - m4/libcurl.m4 | 239 -- m4/longdouble.m4 | 28 - m4/longlong.m4 | 23 - m4/nls.m4 | 51 - m4/po.m4 | 429 -- m4/printf-posix.m4 | 44 - m4/progtest.m4 | 92 - m4/signed.m4 | 17 - m4/size_max.m4 | 59 - m4/sqlite3.m4 | 86 - m4/stdint_h.m4 | 26 - m4/uintmax_t.m4 | 30 - m4/ulonglong.m4 | 23 - m4/wchar_t.m4 | 20 - m4/wint_t.m4 | 20 - m4/xsize.m4 | 13 - macros/ax_prefix_config_h.m4 | 173 - man/Bongo.rules | 53 - man/Makefile.am | 17 - mkinstalldirs | 158 - po/Bongo.rules | 50 - po/Makefile.am | 19 - src/agents/alarm/Bongo.rules | 33 - src/agents/alarm/Makefile.am | 17 - src/agents/antispam/Bongo.rules | 25 - src/agents/antispam/CMakeLists.txt | 16 + src/agents/antispam/Makefile.am | 17 - src/agents/antispam/antispam.c | 8 +- src/agents/avirus/Bongo.rules | 24 - src/agents/avirus/CMakeLists.txt | 15 + src/agents/avirus/Makefile.am | 17 - src/agents/avirus/avirus.c | 2 +- src/agents/calcmd/Bongo.rules | 24 - src/agents/calcmd/Makefile.am | 17 - src/agents/collector/Bongo.rules | 33 - src/agents/collector/Makefile.am | 17 - src/agents/connmgr/Bongo.rules | 35 - src/agents/connmgr/Makefile.am | 17 - .../connmgr/cmmodules/lists/Bongo.rules | 19 - .../connmgr/cmmodules/lists/Makefile.am | 17 - src/agents/connmgr/cmmodules/rbl/Bongo.rules | 23 - src/agents/connmgr/cmmodules/rbl/Makefile.am | 17 - src/agents/connmgr/cmmodules/rdns/Bongo.rules | 23 - src/agents/connmgr/cmmodules/rdns/Makefile.am | 17 - src/agents/connmgr/cmmodules/user/Bongo.rules | 19 - src/agents/connmgr/cmmodules/user/Makefile.am | 17 - src/agents/connmgr/connmgr.c | 10 +- src/agents/generic/Bongo.rules | 23 - src/agents/generic/Makefile.am | 17 - src/agents/generic/generic.c | 2 +- src/agents/imap/Bongo.rules | 37 - src/agents/imap/CMakeLists.txt | 24 + src/agents/imap/Makefile.am | 17 - src/agents/imap/imapd.c | 62 +- src/agents/imap/session.c | 13 +- src/agents/imap/tests/Bongo.rules | 20 - src/agents/imap/tests/Makefile.am | 17 - src/agents/itip/Bongo.rules | 25 - src/agents/itip/Makefile.am | 17 - src/agents/itip/itip.c | 2 +- src/agents/mailprox/Bongo.rules | 25 - src/agents/mailprox/Makefile.am | 17 - src/agents/mailprox/mailprox.c | 13 +- src/agents/pluspack/Bongo.rules | 23 - src/agents/pluspack/Makefile.am | 17 - src/agents/pluspack/pluspack.c | 8 +- src/agents/pop/Bongo.rules | 23 - src/agents/pop/CMakeLists.txt | 15 + src/agents/pop/Makefile.am | 17 - src/agents/pop/pop3.c | 18 +- src/agents/queue/Bongo.rules | 32 - src/agents/queue/CMakeLists.txt | 19 + src/agents/queue/Makefile.am | 17 - src/agents/queue/queued.c | 2 +- src/agents/queue/queued.h | 6 +- src/agents/rules/Bongo.rules | 25 - src/agents/rules/CMakeLists.txt | 16 + src/agents/rules/Makefile.am | 17 - src/agents/rules/rules.c | 2 +- src/agents/smtp/Bongo.rules | 42 - src/agents/smtp/CMakeLists.txt | 30 + src/agents/smtp/Makefile.am | 17 - src/agents/smtp/smtpc.c | 2 +- src/agents/smtp/smtpd.c | 8 +- src/agents/store/Bongo.rules | 76 - src/agents/store/CMakeLists.txt | 44 + src/agents/store/Makefile.am | 17 - .../{create-store.s => create-store.s.cmake} | 2 +- src/agents/store/guid.c | 61 +- src/agents/store/{main.cpp => main.c} | 0 src/agents/store/object-model.c | 2 +- src/agents/store/query-builder.c | 2 +- src/agents/store/query-builder.h | 2 +- src/agents/store/stored.c | 2 +- src/agents/store/tests/Bongo.rules | 45 - src/agents/store/tests/Makefile.am | 17 - src/apps/CMakeLists.txt | 13 + src/apps/admin/Bongo.rules | 33 - src/apps/admin/Makefile.am | 17 - src/apps/backup/Bongo.rules | 27 - src/apps/backup/Makefile.am | 17 - src/apps/config/Bongo.rules | 48 - src/apps/config/CMakeLists.txt | 24 + src/apps/config/Makefile.am | 17 - src/apps/config/config.c | 126 +- src/apps/config/config.h | 13 +- src/apps/manager/Bongo.rules | 21 - src/apps/manager/CMakeLists.txt | 14 + src/apps/manager/Makefile.am | 17 - src/apps/queuetool/Bongo.rules | 10 - src/apps/queuetool/CMakeLists.txt | 1 + src/apps/queuetool/Makefile.am | 17 - src/apps/sendmail/Bongo.rules | 23 - src/apps/sendmail/Makefile.am | 17 - src/apps/storetool/Bongo.rules | 38 - src/apps/storetool/Makefile.am | 17 - src/apps/storetool/demo/Bongo.rules | 83 - src/apps/storetool/demo/Makefile.am | 17 - src/apps/testtool/Bongo.rules | 26 - src/apps/testtool/CMakeLists.txt | 14 + src/apps/testtool/Makefile.am | 17 - src/apps/testtool/testtool.c | 1 - src/libs/bongoutil/Bongo.rules | 23 - src/libs/bongoutil/CMakeLists.txt | 14 + src/libs/bongoutil/Makefile.am | 17 - src/libs/bongoutil/tests/Bongo.rules | 22 - src/libs/bongoutil/tests/Makefile.am | 17 - src/libs/cal/Bongo.rules | 35 - src/libs/cal/CMakeLists.txt | 26 + src/libs/cal/Makefile.am | 17 - src/libs/cal/bongo-cal-instance.c | 8 +- src/libs/cal/bongo-cal-recur.c | 46 +- src/libs/cal/bongo-import-tz.c | 2 +- src/libs/cal/tests/Bongo.rules | 23 - src/libs/cal/tests/Makefile.am | 17 - src/libs/calcmd/Bongo.rules | 34 - src/libs/calcmd/Makefile.am | 17 - src/libs/calcmd/tests/Bongo.rules | 13 - src/libs/calcmd/tests/Makefile.am | 17 - src/libs/connio/Bongo.rules | 15 - src/libs/connio/CMakeLists.txt | 14 + src/libs/connio/Makefile.am | 17 - src/libs/connio/addrpool.c | 2 +- src/libs/connio/tests/Bongo.rules | 21 - src/libs/connio/tests/Makefile.am | 17 - src/libs/connio/unix-ip.c | 6 +- src/libs/connmgr/Bongo.rules | 10 - src/libs/connmgr/Makefile.am | 17 - src/libs/json/Bongo.rules | 10 - src/libs/json/CMakeLists.txt | 6 + src/libs/json/Makefile.am | 17 - src/libs/logger/Bongo.rules | 21 - src/libs/logger/Makefile.am | 17 - src/libs/logger/bongo.lsc | 148 - src/libs/logger/logger-format.c | 288 -- src/libs/logger/logger-format.pl | 129 - src/libs/logger/logger-syslog.c | 90 - src/libs/logger/logger.c | 59 - src/libs/logger/loggerp.h | 33 - src/libs/logger/logs.conf | 31 - src/libs/logging/CMakeLists.txt | 5 + src/libs/logging/logging.c | 40 + src/libs/management/Bongo.rules | 12 - src/libs/management/Makefile.am | 17 - src/libs/mdb-file/Bongo.rules | 19 - src/libs/mdb-file/Makefile.am | 17 - src/libs/mdb-xldap/Bongo.rules | 33 - src/libs/mdb-xldap/Makefile.am | 17 - src/libs/mdb/Bongo.rules | 21 - src/libs/mdb/Makefile.am | 17 - src/libs/memmgr/Bongo.rules | 12 - src/libs/memmgr/CMakeLists.txt | 11 + src/libs/memmgr/Makefile.am | 17 - src/libs/memmgr/allocator.c | 60 + src/libs/memmgr/memmgr.c | 2690 ------------ src/libs/memmgr/memstack.c | 6 +- src/libs/memmgr/pools.c | 65 + src/libs/msgapi/Bongo.rules | 74 - src/libs/msgapi/CMakeLists.txt | 24 + src/libs/msgapi/Makefile.am | 17 - src/libs/msgapi/auth-backends/CMakeLists.txt | 4 + src/libs/msgapi/msgapi.c | 1 - src/libs/msgapi/msgcollector.c | 33 +- src/libs/msgapi/msgdate.c | 3 +- src/libs/nmap/Bongo.rules | 18 - src/libs/nmap/CMakeLists.txt | 19 + src/libs/nmap/Makefile.am | 17 - src/libs/nmap/bongoagent.c | 16 +- src/libs/python/Bongo.rules | 158 - src/libs/python/Makefile.am | 17 - src/libs/python/bongo/CMakeLists.txt | 8 + src/libs/python/bongo/Makefile.am | 17 - src/libs/python/libbongo/Bongo.rules | 79 - src/libs/python/libbongo/CMakeLists.txt | 42 + src/libs/python/libbongo/Makefile.am | 17 - src/libs/python/libbongo/bongoutil.c | 1 - src/libs/python/libbongo/bootstrap.c | 1 - src/libs/python/libbongo/cal.c | 2 - src/libs/python/libbongo/calcmd.c | 1 - src/libs/python/libbongo/json.c | 1 - src/libs/python/libbongo/libs.c | 1 - src/libs/python/libbongo/msgapi-defs.h | 1 - src/libs/python/libbongo/msgapi.c | 1 - src/libs/python/libbongo/streamio.c | 1 - src/libs/python/libbongo/tests.c | 2 - src/libs/streamio/Bongo.rules | 18 - src/libs/streamio/CMakeLists.txt | 6 + src/libs/streamio/Makefile.am | 17 - src/libs/streamio/codec/Bongo.rules | 75 - src/libs/streamio/codec/Makefile.am | 17 - src/libs/xpl/Bongo.rules | 21 - src/libs/xpl/CMakeLists.txt | 19 + src/libs/xpl/Makefile.am | 17 - src/libs/xpl/fsys.c | 4 +- src/libs/xpl/hash.c | 1 + src/libs/xpl/tests/Bongo.rules | 19 - src/libs/xpl/tests/Makefile.am | 17 - src/www/Bongo.rules | 478 --- src/www/Makefile.am | 17 - zoneinfo/Bongo.rules | 405 -- zoneinfo/Makefile.am | 17 - 340 files changed, 1408 insertions(+), 28291 deletions(-) create mode 100644 CMakeLists.txt delete mode 100644 Makefile.am delete mode 100644 Makefile.am.subdir delete mode 100644 acinclude.m4 delete mode 100755 autogen.sh delete mode 100644 bongo.pc.in create mode 100644 cmake/BongoCompiler.cmake create mode 100644 cmake/DefineInstallationPaths.cmake create mode 100644 cmake/Directories.cmake create mode 100644 cmake/Distribution.cmake create mode 100644 cmake/FindLog4C.cmake create mode 100644 cmake/Legacy.cmake create mode 100644 cmake/Requirements.cmake create mode 100644 config.h.cmake delete mode 100755 config.rpath delete mode 100644 configure.ac delete mode 100644 import/log4c/COPYING delete mode 100644 import/log4c/Makefile.am delete mode 100644 import/log4c/example/Makefile.am delete mode 100644 import/log4c/example/example.c delete mode 100644 import/log4c/example/log4crc delete mode 100644 import/log4c/log4c.h delete mode 100644 import/log4c/log4c/Makefile.am delete mode 100644 import/log4c/log4c/appender.c delete mode 100644 import/log4c/log4c/appender.h delete mode 100644 import/log4c/log4c/appender_type_audit.c delete mode 100644 import/log4c/log4c/appender_type_audit.h delete mode 100644 import/log4c/log4c/appender_type_mmap.c delete mode 100644 import/log4c/log4c/appender_type_mmap.h delete mode 100644 import/log4c/log4c/appender_type_stream.c delete mode 100644 import/log4c/log4c/appender_type_stream.h delete mode 100644 import/log4c/log4c/appender_type_stream2.c delete mode 100644 import/log4c/log4c/appender_type_stream2.h delete mode 100644 import/log4c/log4c/appender_type_syslog.c delete mode 100644 import/log4c/log4c/appender_type_syslog.h delete mode 100644 import/log4c/log4c/audit_logevent.h delete mode 100644 import/log4c/log4c/buffer.h delete mode 100644 import/log4c/log4c/category.c delete mode 100644 import/log4c/log4c/category.h delete mode 100644 import/log4c/log4c/config-win32.h delete mode 100644 import/log4c/log4c/defs.h delete mode 100644 import/log4c/log4c/init.c delete mode 100644 import/log4c/log4c/init.h delete mode 100644 import/log4c/log4c/layout.c delete mode 100644 import/log4c/log4c/layout.h delete mode 100644 import/log4c/log4c/layout_type_basic.c delete mode 100644 import/log4c/log4c/layout_type_basic.h delete mode 100644 import/log4c/log4c/layout_type_basic_r.c delete mode 100644 import/log4c/log4c/layout_type_basic_r.h delete mode 100644 import/log4c/log4c/layout_type_dated.c delete mode 100644 import/log4c/log4c/layout_type_dated.h delete mode 100644 import/log4c/log4c/layout_type_dated_r.c delete mode 100644 import/log4c/log4c/layout_type_dated_r.h delete mode 100644 import/log4c/log4c/location_info.h delete mode 100644 import/log4c/log4c/log4c.c delete mode 100644 import/log4c/log4c/logging_event.c delete mode 100644 import/log4c/log4c/logging_event.h delete mode 100644 import/log4c/log4c/priority.c delete mode 100644 import/log4c/log4c/priority.h delete mode 100644 import/log4c/log4c/rc.c delete mode 100644 import/log4c/log4c/rc.h delete mode 100644 import/log4c/log4c/version.c delete mode 100644 import/log4c/log4c/version.h delete mode 100644 import/log4c/sd/Makefile.am delete mode 100644 import/log4c/sd/defs.h delete mode 100644 import/log4c/sd/domnode-xml-parser.c delete mode 100644 import/log4c/sd/domnode-xml-parser.h delete mode 100644 import/log4c/sd/domnode-xml-parser.y delete mode 100644 import/log4c/sd/domnode-xml-scanner.c delete mode 100644 import/log4c/sd/domnode-xml-scanner.h delete mode 100644 import/log4c/sd/domnode-xml.c delete mode 100644 import/log4c/sd/domnode-xml.h delete mode 100644 import/log4c/sd/domnode.c delete mode 100644 import/log4c/sd/domnode.h delete mode 100644 import/log4c/sd/error.c delete mode 100644 import/log4c/sd/error.h delete mode 100644 import/log4c/sd/factory.c delete mode 100644 import/log4c/sd/factory.h delete mode 100644 import/log4c/sd/hash.c delete mode 100644 import/log4c/sd/hash.h delete mode 100644 import/log4c/sd/list.c delete mode 100644 import/log4c/sd/list.h delete mode 100644 import/log4c/sd/malloc.c delete mode 100644 import/log4c/sd/malloc.h delete mode 100644 import/log4c/sd/sd_xplatform.c delete mode 100644 import/log4c/sd/sd_xplatform.h delete mode 100644 import/log4c/sd/sprintf.c delete mode 100644 import/log4c/sd/sprintf.h delete mode 100644 import/log4c/sd/sprintf.osf.c delete mode 100644 import/log4c/sd/stack.c delete mode 100644 import/log4c/sd/stack.h delete mode 100644 import/log4c/sd/test.c delete mode 100644 import/log4c/sd/test.h delete mode 100644 include/Bongo.rules delete mode 100644 include/Makefile.am delete mode 100644 m4/codeset.m4 delete mode 100644 m4/gcc_stack_protect.m4 delete mode 100644 m4/gettext.m4 delete mode 100644 m4/glibc2.m4 delete mode 100644 m4/glibc21.m4 delete mode 100644 m4/gmime.m4 delete mode 100644 m4/iconv.m4 delete mode 100644 m4/intdiv0.m4 delete mode 100644 m4/intmax.m4 delete mode 100644 m4/inttypes-pri.m4 delete mode 100644 m4/inttypes.m4 delete mode 100644 m4/inttypes_h.m4 delete mode 100644 m4/isc-posix.m4 delete mode 100644 m4/lcmessage.m4 delete mode 100644 m4/lib-ld.m4 delete mode 100644 m4/lib-link.m4 delete mode 100644 m4/lib-prefix.m4 delete mode 100644 m4/libcurl.m4 delete mode 100644 m4/longdouble.m4 delete mode 100644 m4/longlong.m4 delete mode 100644 m4/nls.m4 delete mode 100644 m4/po.m4 delete mode 100644 m4/printf-posix.m4 delete mode 100644 m4/progtest.m4 delete mode 100644 m4/signed.m4 delete mode 100644 m4/size_max.m4 delete mode 100644 m4/sqlite3.m4 delete mode 100644 m4/stdint_h.m4 delete mode 100644 m4/uintmax_t.m4 delete mode 100644 m4/ulonglong.m4 delete mode 100644 m4/wchar_t.m4 delete mode 100644 m4/wint_t.m4 delete mode 100644 m4/xsize.m4 delete mode 100644 macros/ax_prefix_config_h.m4 delete mode 100644 man/Bongo.rules delete mode 100644 man/Makefile.am delete mode 100755 mkinstalldirs delete mode 100644 po/Bongo.rules delete mode 100644 po/Makefile.am delete mode 100644 src/agents/alarm/Bongo.rules delete mode 100644 src/agents/alarm/Makefile.am delete mode 100644 src/agents/antispam/Bongo.rules create mode 100644 src/agents/antispam/CMakeLists.txt delete mode 100644 src/agents/antispam/Makefile.am delete mode 100644 src/agents/avirus/Bongo.rules create mode 100644 src/agents/avirus/CMakeLists.txt delete mode 100755 src/agents/avirus/Makefile.am delete mode 100644 src/agents/calcmd/Bongo.rules delete mode 100644 src/agents/calcmd/Makefile.am delete mode 100644 src/agents/collector/Bongo.rules delete mode 100644 src/agents/collector/Makefile.am delete mode 100644 src/agents/connmgr/Bongo.rules delete mode 100644 src/agents/connmgr/Makefile.am delete mode 100644 src/agents/connmgr/cmmodules/lists/Bongo.rules delete mode 100644 src/agents/connmgr/cmmodules/lists/Makefile.am delete mode 100644 src/agents/connmgr/cmmodules/rbl/Bongo.rules delete mode 100644 src/agents/connmgr/cmmodules/rbl/Makefile.am delete mode 100644 src/agents/connmgr/cmmodules/rdns/Bongo.rules delete mode 100644 src/agents/connmgr/cmmodules/rdns/Makefile.am delete mode 100644 src/agents/connmgr/cmmodules/user/Bongo.rules delete mode 100644 src/agents/connmgr/cmmodules/user/Makefile.am delete mode 100644 src/agents/generic/Bongo.rules delete mode 100644 src/agents/generic/Makefile.am delete mode 100644 src/agents/imap/Bongo.rules create mode 100644 src/agents/imap/CMakeLists.txt delete mode 100644 src/agents/imap/Makefile.am delete mode 100644 src/agents/imap/tests/Bongo.rules delete mode 100644 src/agents/imap/tests/Makefile.am delete mode 100644 src/agents/itip/Bongo.rules delete mode 100644 src/agents/itip/Makefile.am delete mode 100644 src/agents/mailprox/Bongo.rules delete mode 100644 src/agents/mailprox/Makefile.am delete mode 100644 src/agents/pluspack/Bongo.rules delete mode 100644 src/agents/pluspack/Makefile.am delete mode 100644 src/agents/pop/Bongo.rules create mode 100644 src/agents/pop/CMakeLists.txt delete mode 100644 src/agents/pop/Makefile.am delete mode 100644 src/agents/queue/Bongo.rules create mode 100644 src/agents/queue/CMakeLists.txt delete mode 100644 src/agents/queue/Makefile.am delete mode 100644 src/agents/rules/Bongo.rules create mode 100644 src/agents/rules/CMakeLists.txt delete mode 100644 src/agents/rules/Makefile.am delete mode 100644 src/agents/smtp/Bongo.rules create mode 100644 src/agents/smtp/CMakeLists.txt delete mode 100644 src/agents/smtp/Makefile.am delete mode 100644 src/agents/store/Bongo.rules create mode 100644 src/agents/store/CMakeLists.txt delete mode 100644 src/agents/store/Makefile.am rename src/agents/store/{create-store.s => create-store.s.cmake} (66%) rename src/agents/store/{main.cpp => main.c} (100%) delete mode 100644 src/agents/store/tests/Bongo.rules delete mode 100644 src/agents/store/tests/Makefile.am create mode 100644 src/apps/CMakeLists.txt delete mode 100644 src/apps/admin/Bongo.rules delete mode 100644 src/apps/admin/Makefile.am delete mode 100644 src/apps/backup/Bongo.rules delete mode 100644 src/apps/backup/Makefile.am delete mode 100644 src/apps/config/Bongo.rules create mode 100644 src/apps/config/CMakeLists.txt delete mode 100644 src/apps/config/Makefile.am delete mode 100644 src/apps/manager/Bongo.rules create mode 100644 src/apps/manager/CMakeLists.txt delete mode 100644 src/apps/manager/Makefile.am delete mode 100644 src/apps/queuetool/Bongo.rules create mode 100644 src/apps/queuetool/CMakeLists.txt delete mode 100644 src/apps/queuetool/Makefile.am delete mode 100644 src/apps/sendmail/Bongo.rules delete mode 100644 src/apps/sendmail/Makefile.am delete mode 100644 src/apps/storetool/Bongo.rules delete mode 100644 src/apps/storetool/Makefile.am delete mode 100644 src/apps/storetool/demo/Bongo.rules delete mode 100644 src/apps/storetool/demo/Makefile.am delete mode 100644 src/apps/testtool/Bongo.rules create mode 100644 src/apps/testtool/CMakeLists.txt delete mode 100644 src/apps/testtool/Makefile.am delete mode 100644 src/libs/bongoutil/Bongo.rules create mode 100644 src/libs/bongoutil/CMakeLists.txt delete mode 100644 src/libs/bongoutil/Makefile.am delete mode 100644 src/libs/bongoutil/tests/Bongo.rules delete mode 100644 src/libs/bongoutil/tests/Makefile.am delete mode 100644 src/libs/cal/Bongo.rules create mode 100644 src/libs/cal/CMakeLists.txt delete mode 100644 src/libs/cal/Makefile.am delete mode 100644 src/libs/cal/tests/Bongo.rules delete mode 100644 src/libs/cal/tests/Makefile.am delete mode 100644 src/libs/calcmd/Bongo.rules delete mode 100644 src/libs/calcmd/Makefile.am delete mode 100644 src/libs/calcmd/tests/Bongo.rules delete mode 100644 src/libs/calcmd/tests/Makefile.am delete mode 100644 src/libs/connio/Bongo.rules create mode 100644 src/libs/connio/CMakeLists.txt delete mode 100644 src/libs/connio/Makefile.am delete mode 100644 src/libs/connio/tests/Bongo.rules delete mode 100644 src/libs/connio/tests/Makefile.am delete mode 100644 src/libs/connmgr/Bongo.rules delete mode 100644 src/libs/connmgr/Makefile.am delete mode 100644 src/libs/json/Bongo.rules create mode 100644 src/libs/json/CMakeLists.txt delete mode 100644 src/libs/json/Makefile.am delete mode 100644 src/libs/logger/Bongo.rules delete mode 100644 src/libs/logger/Makefile.am delete mode 100644 src/libs/logger/bongo.lsc delete mode 100644 src/libs/logger/logger-format.c delete mode 100755 src/libs/logger/logger-format.pl delete mode 100644 src/libs/logger/logger-syslog.c delete mode 100644 src/libs/logger/logger.c delete mode 100644 src/libs/logger/loggerp.h delete mode 100644 src/libs/logger/logs.conf create mode 100644 src/libs/logging/CMakeLists.txt create mode 100644 src/libs/logging/logging.c delete mode 100644 src/libs/management/Bongo.rules delete mode 100644 src/libs/management/Makefile.am delete mode 100644 src/libs/mdb-file/Bongo.rules delete mode 100644 src/libs/mdb-file/Makefile.am delete mode 100644 src/libs/mdb-xldap/Bongo.rules delete mode 100644 src/libs/mdb-xldap/Makefile.am delete mode 100644 src/libs/mdb/Bongo.rules delete mode 100644 src/libs/mdb/Makefile.am delete mode 100644 src/libs/memmgr/Bongo.rules create mode 100644 src/libs/memmgr/CMakeLists.txt delete mode 100644 src/libs/memmgr/Makefile.am create mode 100644 src/libs/memmgr/allocator.c create mode 100644 src/libs/memmgr/pools.c delete mode 100644 src/libs/msgapi/Bongo.rules create mode 100644 src/libs/msgapi/CMakeLists.txt delete mode 100644 src/libs/msgapi/Makefile.am create mode 100644 src/libs/msgapi/auth-backends/CMakeLists.txt delete mode 100644 src/libs/nmap/Bongo.rules create mode 100644 src/libs/nmap/CMakeLists.txt delete mode 100644 src/libs/nmap/Makefile.am delete mode 100644 src/libs/python/Bongo.rules delete mode 100644 src/libs/python/Makefile.am create mode 100644 src/libs/python/bongo/CMakeLists.txt delete mode 100644 src/libs/python/bongo/Makefile.am delete mode 100644 src/libs/python/libbongo/Bongo.rules create mode 100644 src/libs/python/libbongo/CMakeLists.txt delete mode 100644 src/libs/python/libbongo/Makefile.am delete mode 100644 src/libs/streamio/Bongo.rules create mode 100644 src/libs/streamio/CMakeLists.txt delete mode 100644 src/libs/streamio/Makefile.am delete mode 100644 src/libs/streamio/codec/Bongo.rules delete mode 100644 src/libs/streamio/codec/Makefile.am delete mode 100644 src/libs/xpl/Bongo.rules create mode 100644 src/libs/xpl/CMakeLists.txt delete mode 100644 src/libs/xpl/Makefile.am delete mode 100644 src/libs/xpl/tests/Bongo.rules delete mode 100644 src/libs/xpl/tests/Makefile.am delete mode 100644 src/www/Bongo.rules delete mode 100644 src/www/Makefile.am delete mode 100644 zoneinfo/Bongo.rules delete mode 100644 zoneinfo/Makefile.am diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..02a7fa5 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,63 @@ +# Global build file for Bongo +project(bongo C) + +# set version of cmake required, and module path +cmake_minimum_required(VERSION 2.6) +cmake_policy(VERSION 2.6) +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/") + +# arguments we can supply to the build system - TODO +set(BONGO_USER "root" CACHE STRING "User account Bongo should run under") +option(CONN_TRACE "Enable connection tracing" OFF) +include(cmake/BongoCompiler.cmake) + +# find our various build requirements +include(cmake/Requirements.cmake) + +# define RPATH for debug/etc. builds - allows us to install libraries +# in non-system location and the binaries still link to them +set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") +set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + +# set up defines for build directories +include(cmake/DefineInstallationPaths.cmake) +include(cmake/Directories.cmake) + +# any legacy defines which we want to get rid of eventually +include(cmake/Legacy.cmake) + +# output header files etc. specifically configured for this build +configure_file(config.h.cmake include/config.h @ONLY) +configure_file(src/agents/store/create-store.s.cmake src/agents/store/createstore.s @ONLY) + +# tell compiler where to find Bongo's header files +include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include/) +include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/include/) + +# now build our various libraries, agents, binaries. +foreach (LIBRARY xpl streamio logging msgapi memmgr connio bongoutil + json cal nmap python/libbongo python/bongo) + add_subdirectory (src/libs/${LIBRARY}) +endforeach (LIBRARY) + +foreach (AGENT antispam avirus imap pop queue rules smtp store) + add_subdirectory (src/agents/${AGENT}) +endforeach (AGENT) + +foreach (EXECUTABLE config manager testtool queuetool) + add_subdirectory (src/apps/${EXECUTABLE}) +endforeach (EXECUTABLE) + +# install various other files +install(DIRECTORY include/ + DESTINATION "${CMAKE_INSTALL_PREFIX}/include/bongo" + FILES_MATCHING PATTERN "*.h" + PATTERN ".svn" EXCLUDE) + +install(DIRECTORY zoneinfo + DESTINATION ${XPL_DEFAULT_DATA_DIR} + FILES_MATCHING PATTERN "*.zone" + PATTERN ".svn" EXCLUDE) + +# include rules for make distribution tarballs +include(cmake/Distribution.cmake) diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index 617407f..0000000 --- a/Makefile.am +++ /dev/null @@ -1,212 +0,0 @@ -# -# This is a non-recursive (except for imports) automake file. -# -# The style was inspired by Robert Collins, as mentioned here: -# -# http://sources.redhat.com/ml/automake/2001-08/msg00061.html -# -# And the original Recursive Make Considered Harmful: -# -# http://www.pcug.org.au/~millerp/rmch/recu-make-cons-harm.html -# - -AUTOMAKE_OPTIONS = subdir-objects -ACLOCAL_AMFLAGS = -I m4 -I macros - -NULL = - -bin_PROGRAMS = -sbin_PROGRAMS = -noinst_PROGRAMS = -check_PROGRAMS = - -sbin_SCRIPTS = - -dist_sbin_SCRIPTS = -dist_noinst_SCRIPTS = -dist_pkglibexec_SCRIPTS = - -lib_LTLIBRARIES = - -nobase_dist_pkgdata_DATA = -dist_noinst_DATA = -noinst_DATA = - -noinst_HEADERS = - -BUILT_SOURCES = -CLEANFILES = - -TESTS = - -AM_CPPFLAGS = $(ALL_CFLAGS) \ - $(NO_POINTER_SIGN_WARNINGS) \ - $(PTHREAD_CFLAGS) \ - -I$(top_srcdir)/include $(GNUTLS_CFLAGS) - -EXTRA_DIST = \ - config.rpath \ - bongo.pc.in \ - HACKING \ - include/bongo-buildinfo.h \ - init/bongo.init.fc4.in \ - init/bongo.init.sles9.in \ - init/bongo.init.suse10.in \ - init/bongo.init.debian.in \ - init/bongobongo-manager.default.debian \ - init/bongo.xml.solaris-smf \ - init/http-bongo.xml.solaris-smf \ - init/http-bongo.solaris-smf.in \ - init/svc-bongo.solaris-smf.in \ - mkinstalldirs - -localedir = $(datadir)/locale -DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@ - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = bongo.pc - -pkglibexecdir = $(libexecdir)/$(PACKAGE) - -install-data-hook:: - $(mkinstalldirs) $(DESTDIR)$(XPL_DEFAULT_CACHE_DIR) - -SUBDIRS = \ - $(IMPORT_SUBDIRS) \ - import/log4c \ - po - -doxygen/html: - if test "$(DOXYGEN)" != NO_DOXYGEN; then \ - $(DOXYGEN) ./doxygen/doxygen.conf; \ - else \ - echo "No doxygen available"; \ - fi - -doxygen/diagrams: - mkdir -p doxygen/diagrams - find src/ -name \*.dot -printf "-o doxygen/diagrams/%f %h/%f" | xargs -l1 dot -Tpng -Nfontname="Bitstream Vera Sans" -Nfontsize=12 - for i in doxygen/diagrams/*.dot; do mv "$$i" "$${i/.dot}".png; done - -docs: doxygen/html doxygen/diagrams - -clean: clean-recursive clean-docs - -clean-docs: - rm -rf ./doxygen/html ./doxygen/latex ./doxygen/diagrams - -# disabled agents -# src/agents/mailprox -# src/agents/calcmd - -include_subdirs = \ - include \ - src/libs/xpl \ - src/libs/xpl/tests \ - src/libs/memmgr \ - src/libs/bongoutil \ - src/libs/bongoutil/tests \ - src/libs/connio \ - src/libs/connio/tests \ - src/libs/json \ - src/libs/logger \ - src/libs/streamio \ - src/libs/streamio/codec \ - src/libs/cal \ - src/libs/cal/tests \ - src/libs/nmap \ - src/libs/msgapi \ - src/libs/calcmd \ - src/libs/calcmd/tests \ - src/libs/python \ - src/libs/python/libbongo \ - src/agents/alarm \ - src/agents/antispam \ - src/agents/avirus \ - src/agents/collector \ - src/agents/generic \ - src/agents/imap \ - src/agents/imap/tests \ - src/agents/itip \ - src/agents/pop \ - src/agents/queue \ - src/agents/rules \ - src/agents/smtp \ - src/agents/store \ - src/agents/store/tests \ - src/apps/backup \ - src/apps/config \ - src/apps/manager \ - src/apps/sendmail \ - src/apps/queuetool \ - src/apps/storetool \ - src/apps/storetool/demo \ - src/apps/testtool \ - src/www \ - zoneinfo \ - man \ - po - -# src/apps/migrate - -DIST_SUBDIRS = $(SUBDIRS) $(include_subdirs) - -include include/Bongo.rules -include src/libs/xpl/Bongo.rules -include src/libs/xpl/tests/Bongo.rules -include src/libs/memmgr/Bongo.rules -include src/libs/bongoutil/Bongo.rules -include src/libs/bongoutil/tests/Bongo.rules -include src/libs/connio/Bongo.rules -include src/libs/connio/tests/Bongo.rules -include src/libs/json/Bongo.rules -include src/libs/logger/Bongo.rules -include src/libs/streamio/Bongo.rules -include src/libs/streamio/codec/Bongo.rules -include src/libs/cal/Bongo.rules -include src/libs/cal/tests/Bongo.rules -include src/libs/nmap/Bongo.rules -include src/libs/msgapi/Bongo.rules -include src/libs/calcmd/Bongo.rules -include src/libs/calcmd/tests/Bongo.rules -include src/libs/python/Bongo.rules -include src/libs/python/libbongo/Bongo.rules -include src/agents/alarm/Bongo.rules -include src/agents/antispam/Bongo.rules -include src/agents/avirus/Bongo.rules -#include src/agents/calcmd/Bongo.rules -include src/agents/collector/Bongo.rules -include src/agents/generic/Bongo.rules -include src/agents/imap/Bongo.rules -include src/agents/imap/tests/Bongo.rules -include src/agents/itip/Bongo.rules -#include src/agents/mailprox/Bongo.rules -include src/agents/pop/Bongo.rules -include src/agents/queue/Bongo.rules -include src/agents/rules/Bongo.rules -include src/agents/smtp/Bongo.rules -include src/agents/store/Bongo.rules -include src/agents/store/tests/Bongo.rules -include src/apps/backup/Bongo.rules -include src/apps/config/Bongo.rules -include src/apps/manager/Bongo.rules -include src/apps/sendmail/Bongo.rules -# include src/apps/migrate/Bongo.rules -include src/apps/queuetool/Bongo.rules -include src/apps/storetool/Bongo.rules -include src/apps/storetool/demo/Bongo.rules -include src/apps/testtool/Bongo.rules -include src/www/Bongo.rules -include zoneinfo/Bongo.rules -include man/Bongo.rules -include po/Bongo.rules - -update-makefiles: - @for dir in $(include_subdirs) ; do \ - echo " cp $(top_srcdir)/Makefile.am.subdir $(top_srcdir)/$$dir/Makefile.am" ; \ - cp "$(top_srcdir)/Makefile.am.subdir" "$(top_srcdir)/$$dir/Makefile.am" || exit 1 ; \ - if test "$$dir" == "po" ; then \ - echo "" >> "$(top_srcdir)/$$dir/Makefile.am" || exit 1 ; \ - echo "distclean:" >> "$(top_srcdir)/$$dir/Makefile.am" || exit 1 ; \ - fi ; \ - done diff --git a/Makefile.am.subdir b/Makefile.am.subdir deleted file mode 100644 index 8830401..0000000 --- a/Makefile.am.subdir +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/acinclude.m4 b/acinclude.m4 deleted file mode 100644 index e23b0b5..0000000 --- a/acinclude.m4 +++ /dev/null @@ -1,260 +0,0 @@ -dnl as-ac-expand.m4 0.1.0 -dnl autostars m4 macro for expanding directories using configure's prefix -dnl thomas@apestaart.org - -dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR) -dnl -dnl example -dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir) -dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local - -AC_DEFUN([AS_AC_EXPAND], -[ - EXP_VAR=[$1] - FROM_VAR=[$2] - - dnl first expand prefix and exec_prefix if necessary - prefix_save=$prefix - exec_prefix_save=$exec_prefix - - dnl if no prefix given, then use /usr/local, the default prefix - if test "x$prefix" = "xNONE"; then - prefix=$ac_default_prefix - fi - dnl if no exec_prefix given, then use prefix - if test "x$exec_prefix" = "xNONE"; then - exec_prefix=$prefix - fi - - full_var="$FROM_VAR" - dnl loop until it doesn't change anymore - while true; do - new_full_var="`eval echo $full_var`" - if test "x$new_full_var"="x$full_var"; then break; fi - full_var=$new_full_var - done - - dnl clean up - full_var=$new_full_var - AC_SUBST([$1], "$full_var") - - dnl restore prefix and exec_prefix - prefix=$prefix_save - exec_prefix=$exec_prefix_save -]) - -dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not) -dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page -dnl also defines GSTUFF_PKG_ERRORS on error -AC_DEFUN([PKG_CHECK_MODULES], [ - succeeded=no - - if test -z "$PKG_CONFIG"; then - AC_PATH_PROG(PKG_CONFIG, pkg-config, no) - fi - - if test "$PKG_CONFIG" = "no" ; then - echo "*** The pkg-config script could not be found. Make sure it is" - echo "*** in your path, or set the PKG_CONFIG environment variable" - echo "*** to the full path to pkg-config." - echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config." - else - PKG_CONFIG_MIN_VERSION=0.9.0 - if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - AC_MSG_CHECKING(for $2) - - if $PKG_CONFIG --exists "$2" ; then - AC_MSG_RESULT(yes) - succeeded=yes - - AC_MSG_CHECKING($1_CFLAGS) - $1_CFLAGS=`$PKG_CONFIG --cflags "$2"` - AC_MSG_RESULT($$1_CFLAGS) - - AC_MSG_CHECKING($1_LIBS) - $1_LIBS=`$PKG_CONFIG --libs "$2"` - AC_MSG_RESULT($$1_LIBS) - else - $1_CFLAGS="" - $1_LIBS="" - ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` - ifelse([$4], ,echo $$1_PKG_ERRORS,) - fi - - AC_SUBST($1_CFLAGS) - AC_SUBST($1_LIBS) - else - echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer." - echo "*** See http://www.freedesktop.org/software/pkgconfig" - fi - fi - - if test $succeeded = yes; then - ifelse([$3], , :, [$3]) - else - ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4]) - fi -]) - - - -dnl a macro to check for ability to create python extensions -dnl AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE]) -dnl function also defines PYTHON_INCLUDES -AC_DEFUN([AM_CHECK_PYTHON_HEADERS], -[AC_REQUIRE([AM_PATH_PYTHON]) -AC_MSG_CHECKING(for headers required to compile python extensions) -dnl deduce PYTHON_INCLUDES -py_prefix=`$PYTHON -c "import sys; print sys.prefix"` -py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"` -PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}" -if test "$py_prefix" != "$py_exec_prefix"; then - PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}" -fi -AC_SUBST(PYTHON_INCLUDES) -dnl check if the headers exist: -save_CPPFLAGS="$CPPFLAGS" -CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES" -AC_TRY_CPP([#include ],dnl -[AC_MSG_RESULT(found) -$1],dnl -[AC_MSG_RESULT(not found) -$2]) -CPPFLAGS="$save_CPPFLAGS" -]) - -dnl AM_PATH_CHECK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) -dnl Test for check, and define CHECK_CFLAGS and CHECK_LIBS -dnl - -AC_DEFUN([AM_PATH_CHECK], -[ - AC_ARG_WITH([check], - [ --with-check=PATH prefix where check is installed [default=auto]]) - - min_check_version=ifelse([$1], ,0.8.2,$1) - - AC_MSG_CHECKING(for check - version >= $min_check_version) - - if test x$with_check = xno; then - AC_MSG_RESULT(disabled) - ifelse([$3], , AC_MSG_ERROR([disabling check is not supported]), [$3]) - else - if test "x$with_check" != x; then - CHECK_CFLAGS="-I$with_check/include" - CHECK_LIBS="-L$with_check/lib -lcheck" - else - CHECK_CFLAGS="" - CHECK_LIBS="-lcheck" - fi - - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - - CFLAGS="$CFLAGS $CHECK_CFLAGS" - LIBS="$CHECK_LIBS $LIBS" - - rm -f conf.check-test - AC_TRY_RUN([ -#include -#include - -#include - -int main () -{ - int major, minor, micro; - char *tmp_version; - - system ("touch conf.check-test"); - - /* HP/UX 9 (%@#!) writes to sscanf strings */ - tmp_version = strdup("$min_check_version"); - if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { - printf("%s, bad version string\n", "$min_check_version"); - return 1; - } - - if ((CHECK_MAJOR_VERSION != check_major_version) || - (CHECK_MINOR_VERSION != check_minor_version) || - (CHECK_MICRO_VERSION != check_micro_version)) - { - printf("\n*** The check header file (version %d.%d.%d) does not match\n", - CHECK_MAJOR_VERSION, CHECK_MINOR_VERSION, CHECK_MICRO_VERSION); - printf("*** the check library (version %d.%d.%d).\n", - check_major_version, check_minor_version, check_micro_version); - return 1; - } - - if ((check_major_version > major) || - ((check_major_version == major) && (check_minor_version > minor)) || - ((check_major_version == major) && (check_minor_version == minor) && (check_micro_version >= micro))) - { - return 0; - } - else - { - printf("\n*** An old version of check (%d.%d.%d) was found.\n", - check_major_version, check_minor_version, check_micro_version); - printf("*** You need a version of check being at least %d.%d.%d.\n", major, minor, micro); - printf("***\n"); - printf("*** If you have already installed a sufficiently new version, this error\n"); - printf("*** probably means that the wrong copy of the check library and header\n"); - printf("*** file is being found. Rerun configure with the --with-check=PATH option\n"); - printf("*** to specify the prefix where the correct version was installed.\n"); - } - - return 1; -} -],, no_check=yes, [echo $ac_n "cross compiling; assumed OK... $ac_c"]) - - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - - if test "x$no_check" = x ; then - AC_MSG_RESULT(yes) - ifelse([$2], , :, [$2]) - else - AC_MSG_RESULT(no) - if test -f conf.check-test ; then - : - else - echo "*** Could not run check test program, checking why..." - CFLAGS="$CFLAGS $CHECK_CFLAGS" - LIBS="$CHECK_LIBS $LIBS" - AC_TRY_LINK([ -#include -#include - -#include -], , [ echo "*** The test program compiled, but did not run. This usually means" - echo "*** that the run-time linker is not finding check. You'll need to set your" - echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" - echo "*** to the installed location Also, make sure you have run ldconfig if that" - echo "*** is required on your system" - echo "***" - echo "*** If you have an old version installed, it is best to remove it, although" - echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], - [ echo "*** The test program failed to compile or link. See the file config.log for" - echo "*** the exact error that occured." ]) - - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - - CHECK_CFLAGS="" - CHECK_LIBS="" - - rm -f conf.check-test - ifelse([$3], , AC_MSG_ERROR([check not found]), [$3]) - fi - - AC_SUBST(CHECK_CFLAGS) - AC_SUBST(CHECK_LIBS) - - rm -f conf.check-test - - fi -]) diff --git a/autogen.sh b/autogen.sh deleted file mode 100755 index 70bb3d5..0000000 --- a/autogen.sh +++ /dev/null @@ -1,202 +0,0 @@ -#!/bin/sh -# Run this to generate all the initial makefiles, etc. - -srcdir=`dirname $0` -test -z "$srcdir" && srcdir=. - -ORIGDIR=`pwd` -cd $srcdir -PROJECT=Bongo - -DIE=0 - -# some terminal codes ... -boldface="`tput bold 2>/dev/null`" -normal="`tput sgr0 2>/dev/null`" -printbold() { - echo "$boldface$@$normal" -} -printerr() { - echo "$@" >&2 -} - -have_libtool=false -LIBTOOLIZE=libtoolize -if $LIBTOOLIZE --version < /dev/null > /dev/null 2>&1 ; then - libtool_version=`libtoolize --version | sed 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'` - case $libtool_version in 1.4*|1.5*|2.2*) - have_libtool=true - ;; - esac -fi -if $have_libtool ; then : ; else - echo - echo "You must have libtool 1.4 installed to compile $PROJECT." - echo "Install the appropriate package for your distribution," - echo "or get the source tarball at http://ftp.gnu.org/gnu/libtool/" - DIE=1 -fi - -(autoconf --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "You must have autoconf installed to compile $PROJECT." - echo "Install the appropriate package for your distribution," - echo "or get the source tarball at http://ftp.gnu.org/gnu/autoconf/" - DIE=1 -} - -if automake-1.8 --version < /dev/null > /dev/null 2>&1 ; then - AUTOMAKE=automake-1.8 - ACLOCAL=aclocal-1.8 -elif automake-1.9 --version < /dev/null > /dev/null 2>&1 ; then - AUTOMAKE=automake-1.9 - ACLOCAL=aclocal-1.9 -elif automake-1.10 --version < /dev/null > /dev/null 2>&1 ; then - AUTOMAKE=automake-1.10 - ACLOCAL=aclocal-1.10 -else - echo - echo "You must have automake 1.8.x installed to compile $PROJECT." - echo "Install the appropriate package for your distribution," - echo "or get the source tarball at http://ftp.gnu.org/gnu/automake/" - DIE=1 -fi - -# need to check these binaries exist... -AUTOCONF=autoconf -AUTOHEADER=autoheader - -if test "$DIE" -eq 1; then - exit 1 -fi - -test -f configure.ac || { - echo "You must run this script in the top-level $PROJECT directory" - exit 1 -} - -if test -z "$AUTOGEN_SUBDIR_MODE"; then - if test -z "$*"; then - echo "I am going to run ./configure with no arguments - if you wish " - echo "to pass any to it, please specify them on the $0 command line." - fi -fi - -$ACLOCAL $ACLOCAL_FLAGS -I m4 -I macros || exit $? - -$LIBTOOLIZE --force || exit $? - -$AUTOHEADER || exit $? - -$AUTOMAKE --add-missing || exit $? -autoconf || exit $? -cd $ORIGDIR || exit $? - -SVNREV="`svnversion . 2>/dev/null`" -if test x$SVNREV = x; then - echo Unable to discern build version - echo \#define BONGO_BUILD_BRANCH \"unknown\" > ./include/bongo-buildinfo.h - echo \#define BONGO_BUILD_VSTR \"\" >> ./include/bongo-buildinfo.h - echo \#define BONGO_BUILD_VER \"0\" >> ./include/bongo-buildinfo.h -else - echo SVN Rev at $SVNREV - echo \#define BONGO_BUILD_BRANCH \"trunk\" > ./include/bongo-buildinfo.h - echo \#define BONGO_BUILD_VSTR \"r\" >> ./include/bongo-buildinfo.h - echo \#define BONGO_BUILD_VER \"$SVNREV\" >> ./include/bongo-buildinfo.h -fi - -# configure sub-projects -configure_files="`find $srcdir -name 'bongo-*' -prune -name '{arch}' -prune -o -name configure.ac -print -o -name configure.in -print`" -for arg in $@; do - case $arg in - --with-sqlite3=*import*) - rm -f import/sqlite3/NO-AUTO-GEN - ;; - --with-sqlite3=*) - touch import/sqlite3/NO-AUTO-GEN - echo "Flagging import/sqlite3 as no auto-gen as source is external" - ;; - esac -done - -topdir=`pwd` -for configure_ac in $configure_files; do - dirname=`dirname $configure_ac` - basename=`basename $configure_ac` - if test -f $dirname/NO-AUTO-GEN; then - echo skipping $dirname -- flagged as no auto-gen - else - printbold "Processing $configure_ac" - cd $dirname - - # Note that the order these tools are called should match what - # autoconf's "autoupdate" package does. See bug 138584 for - # details. - - # programs that might install new macros get run before aclocal - if grep "^A[CM]_PROG_LIBTOOL" $basename >/dev/null; then - printbold "Running $LIBTOOLIZE..." - $LIBTOOLIZE --force || exit 1 - fi - - if grep "^AM_GLIB_GNU_GETTEXT" $basename >/dev/null; then - printbold "Running $GLIB_GETTEXTIZE... Ignore non-fatal messages." - echo "no" | $GLIB_GETTEXTIZE --force --copy || exit 1 - elif grep "^AM_GNU_GETTEXT" $basename >/dev/null; then - if grep "^AM_GNU_GETTEXT_VERSION" $basename > /dev/null; then - printbold "Running autopoint..." - autopoint --force || exit 1 - else - printbold "Running $GETTEXTIZE... Ignore non-fatal messages." - echo "no" | $GETTEXTIZE --force --copy --no-changelog || exit 1 - fi - fi - - if grep "^AC_PROG_INTLTOOL" $basename >/dev/null; then - printbold "Running $INTLTOOLIZE..." - $INTLTOOLIZE --force --automake || exit 1 - fi - - # Now run aclocal to pull in any additional macros needed - aclocalinclude="$ACLOCAL_FLAGS" - if test -d m4; then - aclocalinclude="$aclocalinclude -I m4" - fi - if test -d macros; then - aclocalinclude="$aclocalinclude -I macros" - fi - - printbold "Running $ACLOCAL $aclocalinclude ..." - - $ACLOCAL $aclocalinclude || exit 1 - - # Now that all the macros are sorted, run autoconf and autoheader ... - printbold "Running $AUTOCONF..." - $AUTOCONF || exit 1 - if grep "^A[CM]_CONFIG_HEADER" $basename >/dev/null; then - printbold "Running $AUTOHEADER..." - $AUTOHEADER || exit 1 - # this prevents automake from thinking config.h.in is out of - # date, since autoheader doesn't touch the file if it doesn't - # change. - test -f config.h.in && touch config.h.in - fi - - if test -f Makefile.am; then - # Finally, run automake to create the makefiles ... - printbold "Running $AUTOMAKE..." - $AUTOMAKE --gnu --add-missing || exit 1 - fi - - cd "$topdir" - fi -done -# end configure sub-projects - -if test -z "$AUTOGEN_SUBDIR_MODE"; then - $srcdir/configure --enable-maintainer-mode $AUTOGEN_CONFIGURE_ARGS "$@" || exit $? - - echo - echo "Now type 'make' to compile $PROJECT." -fi - diff --git a/bongo.pc.in b/bongo.pc.in deleted file mode 100644 index 0ab1feb..0000000 --- a/bongo.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@/bongo - -Name: Bongo -Description: A fast and scalable email and calendar server -Version: @VERSION@ -Libs: -L${libdir} -lbongostreamio -lbongomanagement -lbongonmap -lbongoconnmgr -lbongomsgapi -lbongomdb -lbongologger -lbongoconnio -lbongoutil -lbongomemmgr -lbongoxpl -lbongocalcmd -lbongocal -lbongo-json -Cflags: -I${includedir} -Requires: gnutls diff --git a/cmake/BongoCompiler.cmake b/cmake/BongoCompiler.cmake new file mode 100644 index 0000000..fbb4930 --- /dev/null +++ b/cmake/BongoCompiler.cmake @@ -0,0 +1,27 @@ +# function to attempt to turn on as many security flags as possible +# by default, we turn on as much as possible + +include(CheckCCompilerFlag) + +option(BONGO_SECURITY "Enable compiler flags which help protect against attacks" ON) +if (BONGO_SECURITY) + # check for -lssp ? + + # check for -fstack-protector + check_c_compiler_flag (-fstack-protector-all GCC_STACK_PROTECTOR_ALL) + if (GCC_STACK_PROTECTOR_ALL) + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector-all" PARENT_SCOPE) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector-all" PARENT_SCOPE) + endif (GCC_STACK_PROTECTOR_ALL) +endif (BONGO_SECURITY) + +option(DEBUG "Enable debugging infrastructure" OFF) +if (DEBUG) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -g3 -ggdb -O0" PARENT_SCOPE) + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -g3 -ggdb -O0" PARENT_SCOPE) +endif (DEBUG) + +function (StrictCompile) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Werror -std=c99" PARENT_SCOPE) + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror -std=c++98" PARENT_SCOPE) +endfunction (StrictCompile) diff --git a/cmake/DefineInstallationPaths.cmake b/cmake/DefineInstallationPaths.cmake new file mode 100644 index 0000000..057b5e6 --- /dev/null +++ b/cmake/DefineInstallationPaths.cmake @@ -0,0 +1,130 @@ +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +if (UNIX) + IF (NOT APPLICATION_NAME) + MESSAGE(STATUS "${PROJECT_NAME} is used as APPLICATION_NAME") + SET(APPLICATION_NAME ${PROJECT_NAME}) + ENDIF (NOT APPLICATION_NAME) + + # Suffix for Linux + SET(LIB_SUFFIX + CACHE STRING "Define suffix of directory name (32/64)" + ) + + SET(EXEC_INSTALL_PREFIX + "${CMAKE_INSTALL_PREFIX}" + CACHE PATH "Base directory for executables and libraries" + ) + SET(SHARE_INSTALL_PREFIX + "${CMAKE_INSTALL_PREFIX}/share" + CACHE PATH "Base directory for files which go to share/" + ) + SET(DATA_INSTALL_PREFIX + "${SHARE_INSTALL_PREFIX}/${APPLICATION_NAME}" + CACHE PATH "The parent directory where applications can install their data") + + # The following are directories where stuff will be installed to + SET(BIN_INSTALL_DIR + "${EXEC_INSTALL_PREFIX}/bin" + CACHE PATH "The ${APPLICATION_NAME} binary install dir (default prefix/bin)" + ) + SET(SBIN_INSTALL_DIR + "${EXEC_INSTALL_PREFIX}/sbin" + CACHE PATH "The ${APPLICATION_NAME} sbin install dir (default prefix/sbin)" + ) + SET(LIB_INSTALL_DIR + "${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX}" + CACHE PATH "The subdirectory relative to the install prefix where libraries will be installed (default is prefix/lib)" + ) + SET(LIBEXEC_INSTALL_DIR + "${EXEC_INSTALL_PREFIX}/libexec" + CACHE PATH "The subdirectory relative to the install prefix where libraries will be installed (default is prefix/libexec)" + ) + SET(PLUGIN_INSTALL_DIR + "${LIB_INSTALL_DIR}/${APPLICATION_NAME}" + CACHE PATH "The subdirectory relative to the install prefix where plugins will be installed (default is prefix/lib/${APPLICATION_NAME})" + ) + SET(INCLUDE_INSTALL_DIR + "${CMAKE_INSTALL_PREFIX}/include" + CACHE PATH "The subdirectory to the header prefix (default prefix/include)" + ) + + SET(DATA_INSTALL_DIR + "${DATA_INSTALL_PREFIX}" + CACHE PATH "The parent directory where applications can install their data (default prefix/share/${APPLICATION_NAME})" + ) + SET(HTML_INSTALL_DIR + "${DATA_INSTALL_PREFIX}/doc/HTML" + CACHE PATH "The HTML install dir for documentation (default data/doc/html)" + ) + SET(ICON_INSTALL_DIR + "${DATA_INSTALL_PREFIX}/icons" + CACHE PATH "The icon install dir (default data/icons/)" + ) + SET(SOUND_INSTALL_DIR + "${DATA_INSTALL_PREFIX}/sounds" + CACHE PATH "The install dir for sound files (default data/sounds)" + ) + + SET(LOCALE_INSTALL_DIR + "${SHARE_INSTALL_PREFIX}/locale" + CACHE PATH "The install dir for translations (default prefix/share/locale)" + ) + + SET(XDG_APPS_DIR + "${SHARE_INSTALL_PREFIX}/applications/" + CACHE PATH "The XDG apps dir" + ) + SET(XDG_DIRECTORY_DIR + "${SHARE_INSTALL_PREFIX}/desktop-directories" + CACHE PATH "The XDG directory" + ) + + SET(SYSCONF_INSTALL_DIR + "${EXEC_INSTALL_PREFIX}/etc" + CACHE PATH "The ${APPLICATION_NAME} sysconfig install dir (default prefix/etc)" + ) + SET(MAN_INSTALL_DIR + "${SHARE_INSTALL_PREFIX}/man" + CACHE PATH "The ${APPLICATION_NAME} man install dir (default prefix/man)" + ) + SET(INFO_INSTALL_DIR + "${SHARE_INSTALL_PREFIX}/info" + CACHE PATH "The ${APPLICATION_NAME} info install dir (default prefix/info)" + ) +endif (UNIX) + +if (WIN32) + # Same same + set(BIN_INSTALL_DIR "." CACHE PATH "-") + set(SBIN_INSTALL_DIR "." CACHE PATH "-") + set(LIB_INSTALL_DIR "lib" CACHE PATH "-") + set(INCLUDE_INSTALL_DIR "include" CACHE PATH "-") + set(PLUGIN_INSTALL_DIR "plugins" CACHE PATH "-") + set(HTML_INSTALL_DIR "doc/HTML" CACHE PATH "-") + set(ICON_INSTALL_DIR "." CACHE PATH "-") + set(SOUND_INSTALL_DIR "." CACHE PATH "-") + set(LOCALE_INSTALL_DIR "lang" CACHE PATH "-") +endif (WIN32) + diff --git a/cmake/Directories.cmake b/cmake/Directories.cmake new file mode 100644 index 0000000..42d8cfe --- /dev/null +++ b/cmake/Directories.cmake @@ -0,0 +1,40 @@ +# various directory definitions we use throughout Bongo + +# 'default' locations for where objects get built +set(BINDIR ${PROJECT_BINARY_DIR}/bin) +set(SBINDIR ${PROJECT_BINARY_DIR}/sbin) +set(LIBDIR ${LIBRARY_OUTPUT_PATH}) +set(LIBEXECDIR ${PROJECT_BINARY_DIR}/libexec) +set(DATAROOTDIR ${PROJECT_BINARY_DIR}/share) +set(DATADIR ${PROJECT_BINARY_DIR}/share) +set(LOCALSTATEDIR ${PROJECT_BINARY_DIR}/var) +set(INCLUDEDIR ${PROJECT_BINARY_DIR}/include) + +# various paths for where objects get installed / work from +set(XPL_DEFAULT_DATA_DIR ${CMAKE_INSTALL_PREFIX}/share/bongo) +set(XPL_DEFAULT_STATE_DIR ${CMAKE_INSTALL_PREFIX}/var/bongo) + +set(XPL_DEFAULT_BIN_DIR ${CMAKE_INSTALL_PREFIX}/sbin) +set(XPL_DEFAULT_LIB_DIR ${CMAKE_INSTALL_PREFIX}/lib) +set(XPL_DEFAULT_CONF_DIR ${CMAKE_INSTALL_PREFIX}/etc/bongo) +set(XPL_DEFAULT_NLS_DIR ${CMAKE_INSTALL_PREFIX}/share/bongo/nls) + +set(XPL_DEFAULT_DBF_DIR ${XPL_DEFAULT_STATE_DIR}/dbf) +set(XPL_DEFAULT_WORK_DIR ${XPL_DEFAULT_STATE_DIR}/work) +set(XPL_DEFAULT_CACHE_DIR ${XPL_DEFAULT_STATE_DIR}/cache) +set(XPL_DEFAULT_SCMS_DIR ${XPL_DEFAULT_STATE_DIR}/scms) +set(XPL_DEFAULT_SPOOL_DIR ${XPL_DEFAULT_STATE_DIR}/spool) +set(XPL_DEFAULT_STORE_SYSTEM_DIR ${XPL_DEFAULT_STATE_DIR}/system) +set(XPL_DEFAULT_SYSTEM_DIR ${XPL_DEFAULT_STATE_DIR}/system) +set(XPL_DEFAULT_MAIL_DIR ${XPL_DEFAULT_STATE_DIR}/users) +set(XPL_DEFAULT_COOKIE_DIR ${XPL_DEFAULT_STATE_DIR}/dbf/cookies) + +set(XPL_DEFAULT_CERT_PATH ${XPL_DEFAULT_STATE_DIR}/dbf/osslcert.pem) +set(XPL_DEFAULT_RSAPARAMS_PATH ${XPL_DEFAULT_STATE_DIR}/dbf/rsaparams.pem) +set(XPL_DEFAULT_DHPARAMS_PATH ${XPL_DEFAULT_STATE_DIR}/dbf/dhparams.pem) +set(XPL_DEFAULT_RANDSEED_PATH ${XPL_DEFAULT_STATE_DIR}/dbf/randomseed) +set(XPL_DEFAULT_KEY_PATH ${XPL_DEFAULT_STATE_DIR}/dbf/osslpriv.pem) + +# FIXME: where did these get defined before? +set(LOCALEDIR ${CMAKE_INSTALL_PREFIX}/share/locale) +set(ZONEINFODIR ${XPL_DEFAULT_DATA_DIR}/zoneinfo) diff --git a/cmake/Distribution.cmake b/cmake/Distribution.cmake new file mode 100644 index 0000000..e2782e4 --- /dev/null +++ b/cmake/Distribution.cmake @@ -0,0 +1,11 @@ +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Mail and calendering made simple") +set(CPACK_PACKAGE_VENDOR "Bongo Project") +set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README") +set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING") +set(CPACK_PACKAGE_VERSION_MAJOR "0") +set(CPACK_PACKAGE_VERSION_MINOR "1") +set(CPACK_PACKAGE_VERSION_PATCH "0") +set(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}") + + +include(CPack) diff --git a/cmake/FindLog4C.cmake b/cmake/FindLog4C.cmake new file mode 100644 index 0000000..c072e19 --- /dev/null +++ b/cmake/FindLog4C.cmake @@ -0,0 +1,77 @@ +# - Try to find Log4C +# Once done this will define +# +# LOG4C_FOUND - system has Log4C +# LOG4C_INCLUDE_DIRS - the Log4C include directory +# LOG4C_LIBRARIES - Link these to use Log4C +# LOG4C_DEFINITIONS - Compiler switches required for using Log4C +# +# Copyright (c) 2009 Andreas Schneider +# +# Redistribution and use is allowed according to the terms of the New +# BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. +# + + +if (LOG4C_LIBRARIES AND LOG4C_INCLUDE_DIRS) + # in cache already + set(LOG4C_FOUND TRUE) +else (LOG4C_LIBRARIES AND LOG4C_INCLUDE_DIRS) + + find_path(LOG4C_INCLUDE_DIR + NAMES + log4c.h + PATHS + /usr/include + /usr/local/include + /opt/local/include + /sw/include + ) + mark_as_advanced(LOG4C_INCLUDE_DIR) + + find_library(LOG4C_LIBRARY + NAMES + log4c + PATHS + /usr/lib + /usr/local/lib + /opt/local/lib + /sw/lib + ) + mark_as_advanced(LOG4C_LIBRARY) + + if (LOG4C_LIBRARY) + set(LOG4C_FOUND TRUE CACHE INTERNAL "Wether the log4c library has been found" FORCE) + endif (LOG4C_LIBRARY) + + set(LOG4C_INCLUDE_DIRS + ${LOG4C_INCLUDE_DIR} + ) + + if (LOG4C_FOUND) + set(LOG4C_LIBRARIES + ${LOG4C_LIBRARIES} + ${LOG4C_LIBRARY} + ) + endif (LOG4C_FOUND) + + if (LOG4C_INCLUDE_DIRS AND LOG4C_LIBRARIES) + set(LOG4C_FOUND TRUE) + endif (LOG4C_INCLUDE_DIRS AND LOG4C_LIBRARIES) + + if (LOG4C_FOUND) + if (NOT Log4C_FIND_QUIETLY) + message(STATUS "Found Log4C: ${LOG4C_LIBRARIES}") + endif (NOT Log4C_FIND_QUIETLY) + else (LOG4C_FOUND) + if (Log4C_FIND_REQUIRED) + message(FATAL_ERROR "Could not find Log4C") + endif (Log4C_FIND_REQUIRED) + endif (LOG4C_FOUND) + + # show the LOG4C_INCLUDE_DIRS and LOG4C_LIBRARIES variables only in the advanced view + mark_as_advanced(LOG4C_INCLUDE_DIRS LOG4C_LIBRARIES) + +endif (LOG4C_LIBRARIES AND LOG4C_INCLUDE_DIRS) + diff --git a/cmake/Legacy.cmake b/cmake/Legacy.cmake new file mode 100644 index 0000000..03a6f61 --- /dev/null +++ b/cmake/Legacy.cmake @@ -0,0 +1,17 @@ + +set(PACKAGE CMAKE_PROJECT_NAME) + +set(LINUX TRUE) + +if(HAVE_TIME_H) + set(HAVE_NANOSLEEP 1) +endif(HAVE_TIME_H) + +set(_BONGO_XPL_BIG_ENDIAN FALSE) +set(_BONGO_XPL_LITTLE_ENDIAN TRUE) +set(_BONGO_HAVE_DLFCN_H TRUE) + + +set(BONGO_BUILD_BRANCH "trunk") +set(BONGO_BUILD_VSTR "r") +set(BONGO_BUILD_VER "10") diff --git a/cmake/Requirements.cmake b/cmake/Requirements.cmake new file mode 100644 index 0000000..e0cf7a7 --- /dev/null +++ b/cmake/Requirements.cmake @@ -0,0 +1,103 @@ +# include here the requirements to build Bongo +# anything which isn't necessary should be marked [optional] + +include(CheckIncludeFile) +include(CheckLibraryExists) +include(FindPkgConfig) + +# look for header files we need first +check_include_file(inttypes.h HAVE_INTTYPES_H) +check_include_file(sys/kstat.h HAVE_KSTAT_H) +check_include_file(sys/vfs.h HAVE_SYS_VFS_H) +check_include_file(sys/stat.h HAVE_SYS_STAT_H) +check_include_file(sys/statvfs.h HAVE_SYS_STATVFS_H) +check_include_file(time.h HAVE_TIME_H) +check_include_file(semaphore.h HAVE_SEMAPHORE_H) + +# look for PThreads +include(FindThreads) +if (NOT CMAKE_USE_PTHREADS_INIT) + message(FATAL_ERROR "Bongo requires a platform with PThreads") +endif (NOT CMAKE_USE_PTHREADS_INIT) + +# check for LDAP [optional] +check_include_file(ldap.h HAVE_LDAP_H) +if (HAVE_LDAP_H) + check_library_exists(ldap ldap_init "" HAVE_LDAP) +endif (HAVE_LDAP_H) + +# check for ODBC [optional] +check_include_file(odbcinst.h HAVE_ODBCINST_H) +if (HAVE_ODBCINST_H) + check_library_exists(odbc SQLConnect "" HAVE_ODBC) +endif (HAVE_ODBCINST_H) + +# check for resolv +#check_library_exists(resolv res_init "" HAVE_RESOLV) +#if (NOT HAVE_RESOLV) +# message(FATAL_ERROR "Cannot find resolv library") +#endif (NOT HAVE_RESOLV) + +# check for gettext +check_include_file(libintl.h HAVE_LIBINTL_H) +include (FindGettext) +if (NOT GETTEXT_FOUND) + message(FATAL_ERROR "Bongo needs Gettext developer support available") +endif (NOT GETTEXT_FOUND) + +check_include_file(kstat.h HAVE_KSTAT_H) + +# check for log4c +include(cmake/FindLog4C.cmake) +include_directories(AFTER ${CMAKE_CURRENT_SOURCE_DIR}/import/log4c/) + +# check for glib +pkg_check_modules (GLIB2 REQUIRED glib-2.0>=2.10) +include_directories(AFTER ${GLIB2_INCLUDE_DIRS}) + +# check for GMime +pkg_search_module (GMIME2 REQUIRED gmime-2.6 gmime-2.4 gmime-2.2 gmime-2.0 gmime) +include_directories(AFTER ${GMIME2_INCLUDE_DIRS}) + +# check for gcrypt +# pkg_check_module + +# check for gnutls +pkg_check_modules (GNUTLS REQUIRED gnutls) + +# check for sqlite3 +pkg_check_modules (SQLITE REQUIRED sqlite3) + +# check for curl +pkg_check_modules (CURL REQUIRED libcurl) + +# check for libical +pkg_check_modules (LIBICAL REQUIRED libical) + +# check for Python +include(FindPythonLibs) +if (NOT PYTHONLIBS_FOUND) + message(FATAL_ERROR "Bongo requires Python development libraries installed") +endif (NOT PYTHONLIBS_FOUND) + +execute_process(COMMAND python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()" + RESULT_VARIABLE PYTHON_SITEPACKAGES_FOUND + OUTPUT_VARIABLE PYTHON_SITEPACKAGES_PATH_RAW +) +string(STRIP "${PYTHON_SITEPACKAGES_PATH_RAW}" PYTHON_SITEPACKAGES_PATH_RAW) + +string(LENGTH "${CMAKE_INSTALL_PREFIX}" CMAKE_INSTALL_PREFIX_LEN) +string(SUBSTRING "${PYTHON_SITEPACKAGES_PATH_RAW}" 0 ${CMAKE_INSTALL_PREFIX_LEN} PYTHON_SITEPACKAGES_PATH_RAW_PREFIX) + +if (PYTHON_SITEPACKAGES_FOUND EQUAL 0) + if (PYTHON_SITEPACKAGES_PATH_RAW_PREFIX STREQUAL CMAKE_INSTALL_PREFIX) + set(PYTHON_SITEPACKAGES_PATH "${PYTHON_SITEPACKAGES_PATH_RAW}") + else () + set(PYTHON_SITEPACKAGES_PATH "${CMAKE_INSTALL_PREFIX}/${PYTHON_SITEPACKAGES_PATH_RAW}") + endif () +else (PYTHON_SITEPACKAGES_FOUND EQUAL 0) + message(FATAL_ERROR "Couldn't determine where to install Python modules") +endif (PYTHON_SITEPACKAGES_FOUND EQUAL 0) + +# check for Doxygen [optional] +include(FindDoxygen) diff --git a/config.h.cmake b/config.h.cmake new file mode 100644 index 0000000..e6d0f48 --- /dev/null +++ b/config.h.cmake @@ -0,0 +1,63 @@ +/* The username which bongo runs as. */ +#cmakedefine BONGO_USER "root" + +// our package name +#cmakedefine PACKAGE "@CMAKE_PROJECT_NAME@" + +// include defines +#cmakedefine HAVE_INTTYPES_H +#cmakedefine HAVE_SYS_STATVFS_H +#cmakedefine HAVE_SYS_STAT_H +#cmakedefine HAVE_SYS_VFS_H +#cmakedefine HAVE_KSTAT_H +#cmakedefine HAVE_SEMAPHORE_H + +// Directories.txt + +#cmakedefine BINDIR "@BINDIR@" +#cmakedefine SBINDIR "@SBINDIR@" +#cmakedefine LIBDIR "@LIBDIR@" +#cmakedefine LIBEXECDIR "@LIBEXECDIR@" +#cmakedefine DATAROOTDIR "@DATAROOTDIR@" +#cmakedefine DATADIR "@DATADIR@" +#cmakedefine LOCALSTATEDIR "@LOCALSTATEDIR@" +#cmakedefine INCLUDEDIR "@INCLUDEDIR@" + +#cmakedefine XPL_DEFAULT_DATA_DIR "@XPL_DEFAULT_DATA_DIR@" +#cmakedefine XPL_DEFAULT_STATE_DIR "@XPL_DEFAULT_STATE_DIR@" + +#cmakedefine XPL_DEFAULT_BIN_DIR "@XPL_DEFAULT_BIN_DIR@" +#cmakedefine XPL_DEFAULT_LIB_DIR "@XPL_DEFAULT_LIB_DIR@" +#cmakedefine XPL_DEFAULT_CONF_DIR "@XPL_DEFAULT_CONF_DIR@" +#cmakedefine XPL_DEFAULT_NLS_DIR "@XPL_DEFAULT_NLS_DIR@" + +#cmakedefine XPL_DEFAULT_DBF_DIR "@XPL_DEFAULT_DBF_DIR@" +#cmakedefine XPL_DEFAULT_WORK_DIR "@XPL_DEFAULT_WORK_DIR@" +#cmakedefine XPL_DEFAULT_CACHE_DIR "@XPL_DEFAULT_CACHE_DIR@" +#cmakedefine XPL_DEFAULT_SCMS_DIR "@XPL_DEFAULT_SCMS_DIR@" +#cmakedefine XPL_DEFAULT_STORE_SYSTEM_DIR "@XPL_DEFAULT_STORE_SYSTEM_DIR@" +#cmakedefine XPL_DEFAULT_SPOOL_DIR "@XPL_DEFAULT_SPOOL_DIR@" +#cmakedefine XPL_DEFAULT_SYSTEM_DIR "@XPL_DEFAULT_SYSTEM_DIR@" +#cmakedefine XPL_DEFAULT_MAIL_DIR "@XPL_DEFAULT_MAIL_DIR@" +#cmakedefine XPL_DEFAULT_COOKIE_DIR "@XPL_DEFAULT_COOKIE_DIR@" + +#cmakedefine XPL_DEFAULT_CERT_PATH "@XPL_DEFAULT_CERT_PATH@" +#cmakedefine XPL_DEFAULT_RSAPARAMS_PATH "@XPL_DEFAULT_RSAPARAMS_PATH@" +#cmakedefine XPL_DEFAULT_DHPARAMS_PATH "@XPL_DEFAULT_DHPARAMS_PATH@" +#cmakedefine XPL_DEFAULT_RANDSEED_PATH "@XPL_DEFAULT_RANDSEED_PATH@" +#cmakedefine XPL_DEFAULT_KEY_PATH "@XPL_DEFAULT_KEY_PATH@" + +#cmakedefine LOCALEDIR "@LOCALEDIR@" +#cmakedefine ZONEINFODIR "@ZONEINFODIR@" + +#cmakedefine BONGO_BUILD_BRANCH "@BONGO_BUILD_BRANCH@" +#cmakedefine BONGO_BUILD_VSTR "@BONGO_BUILD_VSTR@" +#cmakedefine BONGO_BUILD_VER "@BONGO_BUILD_VER@" + +// Legacy defines below +#cmakedefine LINUX +#cmakedefine UNIX +#cmakedefine HAVE_NANOSLEEP +#cmakedefine _BONGO_XPL_BIG_ENDIAN +#cmakedefine _BONGO_XPL_LITTLE_ENDIAN +#cmakedefine _BONGO_HAVE_DLFCN_H diff --git a/config.rpath b/config.rpath deleted file mode 100755 index 3f1bef3..0000000 --- a/config.rpath +++ /dev/null @@ -1,571 +0,0 @@ -#! /bin/sh -# Output a system dependent set of variables, describing how to set the -# run time search path of shared libraries in an executable. -# -# Copyright 1996-2005 Free Software Foundation, Inc. -# Taken from GNU libtool, 2001 -# Originally by Gordon Matzigkeit , 1996 -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. -# -# The first argument passed to this file is the canonical host specification, -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld -# should be set by the caller. -# -# The set of defined variables is at the end of this script. - -# Known limitations: -# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer -# than 256 bytes, otherwise the compiler driver will dump core. The only -# known workaround is to choose shorter directory names for the build -# directory and/or the installation directory. - -# All known linkers require a `.a' archive for static linking (except M$VC, -# which needs '.lib'). -libext=a -shrext=.so - -host="$1" -host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` - -cc_basename=`echo "$CC" | sed -e 's%^.*/%%'` - -# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC. - -wl= -if test "$GCC" = yes; then - wl='-Wl,' -else - case "$host_os" in - aix*) - wl='-Wl,' - ;; - darwin*) - case "$cc_basename" in - xlc*) - wl='-Wl,' - ;; - esac - ;; - mingw* | pw32* | os2*) - ;; - hpux9* | hpux10* | hpux11*) - wl='-Wl,' - ;; - irix5* | irix6* | nonstopux*) - wl='-Wl,' - ;; - newsos6) - ;; - linux*) - case $cc_basename in - icc* | ecc*) - wl='-Wl,' - ;; - pgcc | pgf77 | pgf90) - wl='-Wl,' - ;; - ccc*) - wl='-Wl,' - ;; - como) - wl='-lopt=' - ;; - esac - ;; - osf3* | osf4* | osf5*) - wl='-Wl,' - ;; - sco3.2v5*) - ;; - solaris*) - wl='-Wl,' - ;; - sunos4*) - wl='-Qoption ld ' - ;; - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - wl='-Wl,' - ;; - sysv4*MP*) - ;; - unicos*) - wl='-Wl,' - ;; - uts4*) - ;; - esac -fi - -# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS. - -hardcode_libdir_flag_spec= -hardcode_libdir_separator= -hardcode_direct=no -hardcode_minus_L=no - -case "$host_os" in - cygwin* | mingw* | pw32*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - openbsd*) - with_gnu_ld=no - ;; -esac - -ld_shlibs=yes -if test "$with_gnu_ld" = yes; then - case "$host_os" in - aix3* | aix4* | aix5*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - ld_shlibs=no - fi - ;; - amigaos*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - # Samuel A. Falvo II reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we cannot use - # them. - ld_shlibs=no - ;; - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - : - else - ld_shlibs=no - fi - ;; - cygwin* | mingw* | pw32*) - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec='-L$libdir' - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - : - else - ld_shlibs=no - fi - ;; - netbsd*) - ;; - solaris* | sysv5*) - if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then - ld_shlibs=no - elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - : - else - ld_shlibs=no - fi - ;; - sunos4*) - hardcode_direct=yes - ;; - linux*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - : - else - ld_shlibs=no - fi - ;; - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - : - else - ld_shlibs=no - fi - ;; - esac - if test "$ld_shlibs" = yes; then - # Unlike libtool, we use -rpath here, not --rpath, since the documented - # option of GNU ld is called -rpath, not --rpath. - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - fi -else - case "$host_os" in - aix3*) - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L=yes - if test "$GCC" = yes; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct=unsupported - fi - ;; - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - else - aix_use_runtimelinking=no - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix5*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - esac - fi - hardcode_direct=yes - hardcode_libdir_separator=':' - if test "$GCC" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - hardcode_direct=yes - else - # We have old collect2 - hardcode_direct=unsupported - hardcode_minus_L=yes - hardcode_libdir_flag_spec='-L$libdir' - hardcode_libdir_separator= - fi - esac - fi - # Begin _LT_AC_SYS_LIBPATH_AIX. - echo 'int main () { return 0; }' > conftest.c - ${CC} ${LDFLAGS} conftest.c -o conftest - aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` - if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` - fi - if test -z "$aix_libpath"; then - aix_libpath="/usr/lib:/lib" - fi - rm -f conftest.c conftest - # End _LT_AC_SYS_LIBPATH_AIX. - if test "$aix_use_runtimelinking" = yes; then - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' - else - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - fi - fi - ;; - amigaos*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - # see comment about different semantics on the GNU ld section - ld_shlibs=no - ;; - bsdi[45]*) - ;; - cygwin* | mingw* | pw32*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec=' ' - libext=lib - ;; - darwin* | rhapsody*) - hardcode_direct=no - if test "$GCC" = yes ; then - : - else - case "$cc_basename" in - xlc*) - ;; - *) - ld_shlibs=no - ;; - esac - fi - ;; - dgux*) - hardcode_libdir_flag_spec='-L$libdir' - ;; - freebsd1*) - ld_shlibs=no - ;; - freebsd2.2*) - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - ;; - freebsd2*) - hardcode_direct=yes - hardcode_minus_L=yes - ;; - freebsd* | kfreebsd*-gnu | dragonfly*) - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - ;; - hpux9*) - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - ;; - hpux10* | hpux11*) - if test "$with_gnu_ld" = no; then - case "$host_cpu" in - hppa*64*) - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_direct=no - ;; - ia64*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_direct=no - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - ;; - *) - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - ;; - esac - fi - ;; - irix5* | irix6* | nonstopux*) - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - netbsd*) - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - ;; - newsos6) - hardcode_direct=yes - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - openbsd*) - hardcode_direct=yes - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - else - case "$host_os" in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - hardcode_libdir_flag_spec='-R$libdir' - ;; - *) - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - ;; - esac - fi - ;; - os2*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - ;; - osf3*) - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - osf4* | osf5*) - if test "$GCC" = yes; then - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - else - # Both cc and cxx compiler support -rpath directly - hardcode_libdir_flag_spec='-rpath $libdir' - fi - hardcode_libdir_separator=: - ;; - sco3.2v5*) - ;; - solaris*) - hardcode_libdir_flag_spec='-R$libdir' - ;; - sunos4*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_direct=yes - hardcode_minus_L=yes - ;; - sysv4) - case $host_vendor in - sni) - hardcode_direct=yes # is this really true??? - ;; - siemens) - hardcode_direct=no - ;; - motorola) - hardcode_direct=no #Motorola manual says yes, but my tests say they lie - ;; - esac - ;; - sysv4.3*) - ;; - sysv4*MP*) - if test -d /usr/nec; then - ld_shlibs=yes - fi - ;; - sysv4.2uw2*) - hardcode_direct=yes - hardcode_minus_L=no - ;; - sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) - ;; - sysv5*) - hardcode_libdir_flag_spec= - ;; - uts4*) - hardcode_libdir_flag_spec='-L$libdir' - ;; - *) - ld_shlibs=no - ;; - esac -fi - -# Check dynamic linker characteristics -# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER. -libname_spec='lib$name' -case "$host_os" in - aix3*) - ;; - aix4* | aix5*) - ;; - amigaos*) - ;; - beos*) - ;; - bsdi[45]*) - ;; - cygwin* | mingw* | pw32*) - shrext=.dll - ;; - darwin* | rhapsody*) - shrext=.dylib - ;; - dgux*) - ;; - freebsd1*) - ;; - kfreebsd*-gnu) - ;; - freebsd*) - ;; - gnu*) - ;; - hpux9* | hpux10* | hpux11*) - case "$host_cpu" in - ia64*) - shrext=.so - ;; - hppa*64*) - shrext=.sl - ;; - *) - shrext=.sl - ;; - esac - ;; - irix5* | irix6* | nonstopux*) - case "$host_os" in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;; - *) libsuff= shlibsuff= ;; - esac - ;; - esac - ;; - linux*oldld* | linux*aout* | linux*coff*) - ;; - linux*) - ;; - knetbsd*-gnu) - ;; - netbsd*) - ;; - newsos6) - ;; - nto-qnx*) - ;; - openbsd*) - ;; - os2*) - libname_spec='$name' - shrext=.dll - ;; - osf3* | osf4* | osf5*) - ;; - sco3.2v5*) - ;; - solaris*) - ;; - sunos4*) - ;; - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - ;; - sysv4*MP*) - ;; - uts4*) - ;; -esac - -sed_quote_subst='s/\(["`$\\]\)/\\\1/g' -escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` -shlibext=`echo "$shrext" | sed -e 's,^\.,,'` -escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` - -LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' </dev/null`"; then - AC_MSG_ERROR([Could not locate a suitable lexical generator. Install flex.]) -fi - -AC_PROG_YACC - -if test "$YACC" = "yacc" -a -z "`which $YACC 2>/dev/null`"; then - AC_MSG_ERROR([Could not locate a suitable parser generator. Install bison.]) -fi - -AC_CHECK_FUNCS(strcasecmp strncasecmp stricmp strnicmp gettimeofday vsnprintf _vsnprintf consoleprintf ungetcharacter RingTheBell dlopen dlsym _commit fsync FEFlushWrite dos2calendar _ConvertDOSTimeToCalendar delay statfs statvfs getpwnam_r snprintf _snprintf gmtime_r localtime_r usleep nanosleep) - -AC_CHECK_HEADERS(syslog.h sys/param.h sys/sys/mount.h semaphore.h sys/socket.h netinet/in.h resolv.h sys/sysinfo.h) - -AC_CHECK_HEADERS(sys/mount.h sys/statvfs.h sys/vfs.h alloca.h) - -AC_CHECK_DECLS([ns_c_in],,,[#include ]) - -ALL_CFLAGS='-I$(top_builddir) -I$(top_builddir)/include -I$(top_srcdir)/import/log4c' -ALL_LIBS= - -AC_SUBST(ALL_CFLAGS) -AC_SUBST(ALL_LIBS) - -DL_LIBS= -AC_CHECK_LIB(c, dlopen, DL_LIBS="", [AC_CHECK_LIB(dl, dlopen, DL_LIBS="-ldl")]) -AC_SUBST(DL_LIBS) - -AC_PATH_PROG(PKG_CONFIG, pkg-config, no) -if test "x$PKG_CONFIG" = "xno"; then - AC_MSG_ERROR([Bongo requires pkg-config to be installed]) -fi - -have_check=no -info_check="No. Unit tests will not be run." -AM_PATH_CHECK(0.9.0, - [ - have_check=yes - info_check="Yes." - AC_DEFINE(BONGO_HAVE_CHECK, [], [Controls how tests that depend on check compile.]) - ], - [ - AC_MSG_WARN([The check C unit testing framework is not installed,]) - AC_MSG_WARN([or is not sufficiently up to date.]) - AC_MSG_WARN([Tests relying on it in the make check target will not run.]) - ] -) -AM_CONDITIONAL(HAVE_CHECK, test x$have_check = xyes) - -dnl The "manual" configuration is because a couple of old distros don't have -dnl the GNUTLS m4 thing. Centos 4, RHEL 4, Mandriva 2006(?) -PKG_CHECK_MODULES(GNUTLS, gnutls, - echo Using pkg-config GNUTLS configuration, - echo Trying to configure GNUTLS manually - GNUTLS_LIBS="-lgnutls" - GNUTLS_CFLAGS="" -) - -AM_PATH_GLIB_2_0(2.6.0, , - AC_MSG_ERROR(Bongo requires GLib v2.6 or better installed with development headers.), - gobject gmodule gthread) - - -AM_PATH_LIBGCRYPT() - -AC_CHECK_GMIME() - -AM_PATH_PYTHON(2.3) -PYTHON_INST_PREFIX=`$PYTHON -c 'import sys; print sys.prefix'` -PYTHON_CPPFLAGS="-I$PYTHON_INST_PREFIX/include/python$PYTHON_VERSION" -case "$host" in - *darwin*) - PYTHON_LIBS="-framework Python" - ;; - *freebsd*) - PYTHON_LIBS="-L$PYTHON_INST_PREFIX/lib -lpython$PYTHON_VERSION" - ;; - *) - # this is the correct way to find the python libdir, but - # people should just set LDFLAGS or whatever instead: -# PYTHON_LIBS=`$PYTHON -c 'import sys -#try: -# print sys.lib -#except: -# print "lib" -#'` -# PYTHON_LIBS="-L$PYTHON_INST_PREFIX/$PYTHON_LIBS -lpython$PYTHON_VERSION" - PYTHON_LIBS="-lpython$PYTHON_VERSION" - ;; -esac - -dnl Check for ElementTree lxml -prog=" -import lxml.etree as et -" - -if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC -then - AC_MSG_RESULT([Found ElementTree lxml]) - info_lxml="Yes." -else - AC_MSG_RESULT([Couldn't find ElementTree lxml module for python]) - info_lxml="No. CalDAV runtime requires this library" -fi - -LIBS_save="$LIBS" -CPPFLAGS_save="$CPPFLAGS" - -LIBS="$LIBS $PYTHON_LIBS" -CPPFLAGS="$CPPFLAGS $PYTHON_CPPFLAGS" - -have_python="no" -AC_CHECK_FUNC(PyArg_Parse, [ - AC_CHECK_HEADERS(Python.h, [have_python="yes"]) -]) -if test x$have_python != xyes ; then - AC_MSG_ERROR([Dragonfly requires python-devel, or python built with shared library support (--enable-shared)]) -fi - -LIBS="$LIBS_save" -CPPFLAGS="$CPPFLAGS_save" - -AC_SUBST(CFLAGS_save) - -AC_SUBST(PYTHON_LIBS) -AC_SUBST(PYTHON_CPPFLAGS) - -AS_AC_EXPAND(PYTHONDIR, $pythondir) -AS_AC_EXPAND(PYEXECDIR, $pyexecdir) - -# Check for openldap's slapd -AC_ARG_WITH([slapd], - AC_HELP_STRING([--with-slapd=FILE], - [Path to slapd binary]), - [DEFAULT_SLAPD_PATH="$with_slapd"], - [AC_PATH_PROG(DEFAULT_SLAPD_PATH,[slapd],[/usr/libexec/slapd],[$PATH:/sbin:/usr/sbin:/usr/libexec:/usr/lib/openldap:/opt/sfw/libexec:/opt/csw/libexec:/usr/local/libexec])]) - -DEFAULT_SLAPD_SCHEMA_DIR="/etc/openldap/schema" -# Check for openldap's schema files -AC_ARG_WITH([slapd-schema], - AC_HELP_STRING([--with-slapd-schema=DIR], - [Path to slapd schema directory]), - [DEFAULT_SLAPD_SCHEMA_DIR=$withval], - [ - for conf in /etc /opt/sfw/etc /opt/csw/etc /usr/local/etc; do - for ldap in openldap ldap; do - if test -e "${conf}/${ldap}/schema/core.schema"; then - DEFAULT_SLAPD_SCHEMA_DIR="${conf}/${ldap}/schema" - break 2 - fi - done - done - ]) -AC_SUBST(DEFAULT_SLAPD_SCHEMA_DIR) - -# Check for apache's apxs -AC_PATH_PROG(APXS,[apxs],no,[$PATH:/sbin:/usr/sbin:/usr/local/apache2/bin:/usr/apache2/bin:/usr/lib/apache2/bin:/usr/local/apache/bin:/usr/lib/apache/bin:/usr/pkg/sbin:/opt/csw/apache/bin]) - -APACHE_MOD_DIR="/usr/local/apache2/libexec" -# Look for apache's module dir -AC_ARG_WITH([apache-modules], - AC_HELP_STRING([--with-apache-modules=DIR], - [Path to apache module directory]), - [APACHE_MOD_DIR=$withval], - [ - if test "x$APXS" != "xno"; then - APACHE_MOD_DIR="`${APXS} -q LIBEXECDIR`" - else - for apache in apache2 apache; do - for lib in lib64 lib; do - APACHE_MOD_DIR="/usr/${lib}/${apache}" - if test -d ${APACHE_MOD_DIR}; then - break 2 - fi - done - done - fi - ]) -AC_SUBST(APACHE_MOD_DIR) -AC_MSG_CHECKING([for Apache module directory]) -AC_MSG_RESULT([$APACHE_MOD_DIR]) - -htl10n_jsfiles= -for lang in en `cd po && cd bongo-web && ls *.po | sed s/.po$//`; do - htl10n_jsfiles="$htl10n_jsfiles src/www/l10n/$lang.js" -done -AC_SUBST(htl10n_jsfiles) - -POFILES= -for file in `find po -name *.po`; do - POFILES="$POFILES $file" -done -AC_SUBST(POFILES) - -PTHREAD_CFLAGS= -PTHREAD_LIBS= -# Check taken from glib -AC_MSG_NOTICE(for pthread flags) - -PTHREAD_LIBS="-pthread -lpthread" - -case "$host" in - *-freebsd*) - AC_MSG_CHECKING(FreeBSD Release Date) - if test -x /sbin/sysctl; then - os_version=`/sbin/sysctl -n kern.osreldate` - else - os_version=000000 - fi - AC_MSG_RESULT($os_version) - # 502102 is when libc_r switched to libpthread (aka libkse). - if test $os_version -ge "502102"; then - PTHREAD_CFLAGS="-pthread" - PTHREAD_LIBS="-pthread -lpthread" - else - PTHREAD_CFLAGS="-pthread -D_THREAD_SAFE -D_REENTRANT" - PTHREAD_LIBS="-pthread -lc_r" - fi - ;; - *darwin*) - #As of 10.4.2, POSIX Unnamed Semaphores are not implemented, use Carbon Semaphores instead - PTHREAD_LIBS="-lpthread -Wl,-framework -Wl,Carbon" - PTHREAD_CFLAGS="-I/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers" - CFLAGS="$CFLAGS -DMACOSX -I/opt/local/include" - ;; - *solaris*) - if test "x$GCC" = "xyes"; then - PTHREAD_CFLAGS="-pthreads" - else - PTHREAD_CFLAGS="-mt" - fi - PTHREAD_LIBS="-pthread -lpthread" - ;; -esac -AC_MSG_CHECKING(pthread cflags) -AC_MSG_RESULT($PTHREAD_CFLAGS) -AC_MSG_CHECKING(pthread libs) -AC_MSG_RESULT($PTHREAD_LIBS) - -AC_SUBST(PTHREAD_CFLAGS) -AC_SUBST(PTHREAD_LIBS) - -case xyes in -x$ac_cv_c_bigendian) -XPL_BIG_ENDIAN=1 -XPL_LITTLE_ENDIAN=0 -;; -*) -XPL_BIG_ENDIAN=0 -XPL_LITTLE_ENDIAN=1 -;; -esac - -AC_DEFINE_UNQUOTED(XPL_BIG_ENDIAN, $XPL_BIG_ENDIAN, [Whether the system is big endian]) -AC_DEFINE_UNQUOTED(XPL_LITTLE_ENDIAN, $XPL_LITTLE_ENDIAN, [Whether the system is little endian]) - -AC_ARG_WITH([user], - AC_HELP_STRING([--with-user=USERNAME], - [run bongo as unprivileged user USERNAME])) -BONGO_USER="$with_user" -AC_DEFINE_UNQUOTED(BONGO_USER,"$BONGO_USER", [The username which bongo runs as.]) -AC_SUBST(BONGO_USER) -info_bongo_user=$BONGO_USER -if test "x$BONGO_USER" = "x"; then - info_bongo_user="(unspecified)" -fi - -AC_ARG_ENABLE([conntrace], - AC_HELP_STRING([--enable-conntrace], - [enable verbose connection tracing]), - [if test "x$enableval" != "x"; then - AC_DEFINE_UNQUOTED([CONN_TRACE], [1], [enable verbose connection tracing]) - fi]) - -AC_ARG_ENABLE([memmgrleakreporting], - AC_HELP_STRING([--enable-memmgrleakreporting], - [enable leak tracking and reporting in memmgr]), - [if test "x$enableval" != "x"; then - AC_DEFINE_UNQUOTED([MEMMGR_DEBUG], [1], [enable leak tracking and reporting in memmgr]) - fi]) - -AC_ARG_ENABLE([mdbdebug], - AC_HELP_STRING([--enable-mdbdebug], - [enable highly insecure protocol commands that can be used to scale test mdb]), - [if test "x$enableval" != "x"; then - AC_DEFINE_UNQUOTED([MDB_DEBUG], [1], [enable highly insecure protocol commands that can be used to scale test mdb]) - fi]) - -AC_ARG_ENABLE([system-malloc], - AC_HELP_STRING ([--enable-system-malloc], - [do not use memmgr pools]), - [if test "x$enableval" != "x"; then - AC_DEFINE_UNQUOTED([SYSTEM_MALLOC], [1], [do not use memmgr pools]) - fi]) - -info_debug_cflags="no" -AC_ARG_ENABLE([debug-cflags], - AC_HELP_STRING([--enable-debug-cflags], - [enable compile flags that make things work better in gdb]), - [if test "x$enableval" != "x"; then - # this may need to switch on the operating system to set the - # appropriate flags on non-Linux systems - CFLAGS="$CFLAGS -g -g3 -O0 -gdwarf-2" ; export CFLAGS - CXXFLAGS="$CXXFLAGS -g -g3 -O0 -gdwarf-2" ; export CXXFLAGS - info_debug_cflags="yes" - fi]) - -AC_CHECK_SIZEOF(char*) -AC_CHECK_SIZEOF(void*) -AC_CHECK_SIZEOF(int) -AC_CHECK_SIZEOF(long) - -AC_DEFINE_UNQUOTED(SQLITE_PTR_SZ, $ac_cv_sizeof_charp, [Size of a char *]) - -case $ac_cv_sizeof_voidp in -$ac_cv_sizeof_long) pi_cast='(long)' pui_cast='(unsigned long)' ;; -*) pi_cast='' pui_cast='' ;; -esac -AC_MSG_RESULT($pi_cast $pui_cast) - -AC_DEFINE_UNQUOTED(XPL_POINTER_TO_INT_CAST, $pi_cast, [How to cast a pointer to an int]) -AC_DEFINE_UNQUOTED(XPL_POINTER_TO_UINT_CAST, $pui_cast, [How to cast an unsigned pointer to an int]) - -LIBCURL_CHECK_CONFIG() -if test "x$LIBCURL" = "x"; then - AC_MSG_ERROR(Cannot find cURL. Please install the cURL development library.) -else - AC_MSG_RESULT(Using system cURL) - info_curl="system" - AC_SUBST(LIBCURL_CFLAGS, $LIBCURL_CPPFLAGS) - AC_SUBST(LIBCURL_LIBS, $LIBCURL) -fi - -# import libraries - -AC_CHECK_SQLITE3() -case "x$SQLITE_LIBS" in - x) - info_sqlite="import" - ;; - *import*) - info_sqlite="import" - ;; - *) - info_sqlite="system" - ;; -esac -if test "x$info_sqlite" = "ximport"; then - AC_MSG_RESULT(Using imported SQLite) - AC_CONFIG_SUBDIRS([import/sqlite3]) - AC_SUBST(SQLITE_CFLAGS, "-I\$(top_srcdir)/import/sqlite3") - AC_SUBST(SQLITE_LIBS, "\$(top_srcdir)/import/sqlite3/libbongosqlite3.la") -else - AC_MSG_RESULT(Using system SQLite) -fi - -have_libical="no" -info_libical="import" -AC_CHECK_HEADER(ical.h,[ - AC_CHECK_LIB(ical, icalparser_parse_string, [ - have_libical="yes" - info_libical="system" - ]) -]) -AM_CONDITIONAL(HAVE_LIBICAL,test "$have_odbc" = "yes") -AC_SUBST(LIBICAL_LIBS) -if test "x$info_libical" = "ximport"; then - AC_MSG_RESULT(Using imported libical) - AC_CONFIG_SUBDIRS([import/libical]) - AC_SUBST(LIBICAL_CFLAGS, "-I\$(top_srcdir)/import/libical/src -I\$(top_srcdir)/import/libical/src/libical") - AC_SUBST(LIBICAL_LIBS, "\$(top_srcdir)/import/libical/src/libical/libical-bongo.la") -else - AC_MSG_RESULT(Using system libical) - AC_SUBST(LIBICAL_LIBS, "-lical") - AC_SUBST(LIBICAL_CFLAGS, "") -fi - -AC_SUBST(IMPORT_SUBDIRS, $subdirs) - -# check for doxygen -AC_PATH_PROG(DOXYGEN, doxygen, NO_DOXYGEN) -if test "$DOXYGEN" = NO_DOXYGEN; then - AC_MSG_NOTICE([Couldn't find Doxygen - documentation cannot be built]) -fi - -ac_configure_args="$ac_configure_args --enable-threadsafe --enable-cross-thread-connections --disable-tcl" - -# disabled agents -# src/agents/mailprox/Makefile -# src/agents/pluspack/Makefile -# src/agents/calcmd/Makefile - -AC_OUTPUT([ -Makefile -bongo.pc -import/log4c/Makefile -import/log4c/sd/Makefile -import/log4c/log4c/Makefile -include/Makefile -init/bongo.init.fc4 -init/bongo.init.sles9 -init/bongo.init.suse10 -init/bongo.init.rpl -init/bongo.init.debian -init/bongoinit.conf.rpl -init/http-bongo.solaris-smf -init/svc-bongo.solaris-smf -src/agents/alarm/Makefile -src/agents/antispam/Makefile -src/agents/avirus/Makefile -src/agents/collector/Makefile -src/agents/generic/Makefile -src/agents/imap/Makefile -src/agents/imap/tests/Makefile -src/agents/itip/Makefile -src/agents/pop/Makefile -src/agents/queue/Makefile -src/agents/rules/Makefile -src/agents/smtp/Makefile -src/agents/store/Makefile -src/agents/store/tests/Makefile -src/apps/manager/Makefile -src/apps/config/Makefile -src/apps/sendmail/Makefile -src/apps/backup/Makefile -src/apps/queuetool/Makefile -src/apps/storetool/Makefile -src/apps/storetool/demo/Makefile -src/apps/testtool/Makefile -src/libs/cal/Makefile -src/libs/cal/tests/Makefile -src/libs/calcmd/Makefile -src/libs/calcmd/tests/Makefile -src/libs/connio/Makefile -src/libs/connio/tests/Makefile -src/libs/json/Makefile -src/libs/streamio/Makefile -src/libs/streamio/codec/Makefile -src/libs/logger/Makefile -src/libs/memmgr/Makefile -src/libs/msgapi/Makefile -src/libs/nmap/Makefile -src/libs/python/Makefile -src/libs/python/bongo-python-wrapper -src/libs/python/libbongo/Makefile -src/libs/python/bongo/Xpl.py -src/libs/bongoutil/Makefile -src/libs/bongoutil/tests/Makefile -src/libs/xpl/Makefile -src/libs/xpl/tests/Makefile -src/www/Makefile -src/www/bongo.conf -zoneinfo/Makefile -man/Makefile -po/Makefile -]) - -info_bongo_version=`$AWK '{ if ($ 1 == "#define" && $ 2 == "BONGO_BUILD_VER") print $ 3; }' < "$(top_srcdir)/include/bongo-buildinfo.h" | tr -d '"'` - -AC_MSG_NOTICE([Configured to build Bongo: - - Bongo version: ${info_bongo_version} - Install prefix: ${prefix} - Compiler: ${CC} - Bongo user: ${info_bongo_user} - Debug CFLAGS: ${info_debug_cflags} - -Required libraries: - CURL: ${info_curl} - SQLite: ${info_sqlite} - libical: ${info_libical} - -Optional libraries: - LDAP: ${info_ldap} - ODBC: ${info_odbc} - Check: ${info_check} - lxml: ${info_lxml} -]) diff --git a/import/log4c/COPYING b/import/log4c/COPYING deleted file mode 100644 index b1e3f5a..0000000 --- a/import/log4c/COPYING +++ /dev/null @@ -1,504 +0,0 @@ - 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/import/log4c/Makefile.am b/import/log4c/Makefile.am deleted file mode 100644 index 623f61f..0000000 --- a/import/log4c/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -SUBDIRS = sd log4c - -bongoincludedir=$(includedir)/bongo - -bongoinclude_HEADERS = \ - log4c.h diff --git a/import/log4c/example/Makefile.am b/import/log4c/example/Makefile.am deleted file mode 100644 index 3214488..0000000 --- a/import/log4c/example/Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ -INCLUDES = \ - -I../../../import/log4c - $(ALL_CFLAGS) - -noinst_PROGRAMS = example - -example_SOURCES = \ - example.c - -example_LDADD = \ - ../../../import/log4c/log4c/libbongolog4c.la diff --git a/import/log4c/example/example.c b/import/log4c/example/example.c deleted file mode 100644 index 549ecef..0000000 --- a/import/log4c/example/example.c +++ /dev/null @@ -1,127 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2005 Novell, Inc. - * All Rights Reserved. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2.1 of the GNU Lesser General Public - * License as published by the Free Software Foundation. - * - * 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, contact Novell, Inc. - * - * To contact Novell about this file by physical or electronic mail, - * you may find current contact information at www.novell.com - * - ****************************************************************************/ -/* - * Follow the bouncing comments in this file to see how Log4c can be used - * within Bongo. See also Makefile.am for setting up INCLUDES and _LDADD. - * - * - * The Log4c library looks for logging configuration files in: - * ${LOG4C_RCPATH}/log4crc - * SYSCONFDIR/bongo/log4crc (/opt/bongo/etc. or similar) - * ./log4crc - * The example config file for this program has two categories defined, - * "root" which is the parent for everything (all events bubble to it), - * and "funtest", a category representing events from this code. - * "root" is set to output to syslog, but only LOG_FATAL severity messages. - * "funtest" outputs to stderr, any severity. - * I would leave these notes in the config file, but Log4c's XML parser - * seems to choke on comments. - */ - -#define LOGGERNAME "funtest" -/* - * recommended: - * define LOGGERNAME in your source file to categorize logging output - * alternately, specify a category during each logging call (see below) - * default: - * LOGGERNAME will be "root" if you do not define it - */ - -#include -#include -/* - * required: - * include log4c.h for necessary logging functions - */ - -int main(int argc, char** argv) -{ - int i = 0; - - /* - * required: - * call LogStartup() before making any logging calls - */ - LogStartup (); - - printf ("logging some one-liner events...\n"); - - /* - * simplest logging: - * Log (level, message, ...) implies LOGGERNAME as the category - */ - Log (LOG_DEBUG, "this is a quick warning event"); - Log (LOG_DEBUG, "this is a quick warning event2"); - Log (LOG_DEBUG, "this is a quick warning event3"); - Log (LOG_DEBUG, "this is a quick warning event4"); - Log (LOG_DEBUG, "printf-style formatting %d %s", 123, "cool"); - - /* - * legacy-style logging: - * LogWithID (id, level, message, ...) uses event IDs for Novell Audit - * 0 is a safe and meaningless event ID to pass in. - * (Audit will recieve such events as ID 0x0002ffff, an unspecified - * NetMail event) - * Note about Audit logging: - * the first two string and first two numeric arguments get picked up - * and the format string gets disregarded when using the "audit" - * appender, with Log() as well as LogWithID(). - * Any other appender disregards any ID and logs the formatted string. - */ - #define NAUDIT_EVENT_MEANING_OF_LIFE 0x0002002A - LogWithID (NAUDIT_EVENT_MEANING_OF_LIFE, - LOG_FATAL, - "Discovered the meaning of life: %s %s %d %d", - "free Bongo", - "free Beer", - 2006, - 2002); - - /* - * LogMsg (category, id, level, message, ...) uses an expressed category - */ - LogMsg ("root", 0, LOG_FATAL, "This is a quick event to root"); - LogMsg ("root", 0, LOG_ALERT, "brought to you by the number %d...", i); - LogMsg ("root", 0, LOG_FATAL, "...and the letter %s", "H"); - - printf("spinning through categories...\n"); - for (i = 0; i < LOG_UNKNOWN; i++) { - Log(i*100, "this is a %s event", log4c_priority_to_string(i*100)); - /* - * log4c provides a bunch of other functions beyond the bongo-wrapped - * Log and LogMsg, if those are not detailed enough. I won't get - * into those here though. - */ - } - - printf("quitting\n"); - - LogShutdown(); - /* - * required: - * call LogShutdown() when done logging - * beware: - * if Log4c is outputting to stdout or stderr, the stream will be closed - */ - - return 0; -} diff --git a/import/log4c/example/log4crc b/import/log4c/example/log4crc deleted file mode 100644 index e9995be..0000000 --- a/import/log4c/example/log4crc +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - 0 - - 0 - - - - - - - - - - - - - - - diff --git a/import/log4c/log4c.h b/import/log4c/log4c.h deleted file mode 100644 index 068902e..0000000 --- a/import/log4c/log4c.h +++ /dev/null @@ -1,81 +0,0 @@ -/* $Id: log4c.h,v 1.3 2003/09/12 21:06:45 legoater Exp $ - * - * log4c.h - * - * Copyright 2001-2002, Meiosys (www.meiosys.com). All rights reserved. - * - * See the COPYING file for the terms of usage and distribution. - */ -/**************************************************************************** - * - * Copyright (c) 2005 Novell, Inc. - * All Rights Reserved. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2.1 of the GNU Lesser General Public - * License as published by the Free Software Foundation. - * - * 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, contact Novell, Inc. - * - * To contact Novell about this file by physical or electronic mail, - * you may find current contact information at www.novell.com - * - ****************************************************************************/ - -#ifndef bongo_log4c_h -#define bongo_log4c_h - -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -#ifndef LOGGERNAME -#define LOGGERNAME "root" -#endif - -#define LOG_FATAL LOG4C_PRIORITY_FATAL -#define LOG_ALERT LOG4C_PRIORITY_ALERT -#define LOG_CRIT LOG4C_PRIORITY_CRIT -#define LOG_CRITICAL LOG4C_PRIORITY_CRIT -#define LOG_ERROR LOG4C_PRIORITY_ERROR -#define LOG_WARN LOG4C_PRIORITY_WARN -#define LOG_WARNING LOG4C_PRIORITY_WARN -#define LOG_NOTICE LOG4C_PRIORITY_NOTICE -#define LOG_INFO LOG4C_PRIORITY_INFO -#define LOG_DEBUG LOG4C_PRIORITY_DEBUG -#define LOG_TRACE LOG4C_PRIORITY_TRACE -#define LOG_NOTSET LOG4C_PRIORITY_NOTSET -#define LOG_UNKNOWN LOG4C_PRIORITY_UNKNOWN - -#define LOGIP(X) inet_ntoa(X.sin_addr) - -#define LogFailure(message) Log(LOG_ERROR, "Internal Failure (%s:%d) " message, __FILE__, __LINE__) -#define LogFailureF(message, ...) Log(LOG_ERROR, "Internal Failure (%s:%d) " message, __FILE__, __LINE__, __VA_ARGS__) -#define LogAssert(test, message) if (!(test)) { Log(LOG_ERROR, "Internal Failure (%s:%d) " message, __FILE__, __LINE__); } -#define LogAssertF(test, message, ...) if(!(test)) { Log(LOG_ERROR, "Assert:%s:%d " message, __FILE__, __LINE__, __VA_ARGS__); } - -#define Log(...) LogMsg(LOGGERNAME, 0, __VA_ARGS__) -#define LogWithID(...) LogMsg(LOGGERNAME, __VA_ARGS__) -#define LogStart() LoggerOpen(LOGGERNAME); -#define LogStartup() log4c_init() -#define LogShutdown() log4c_fini() - - -void LogMsg(const char*, int, int, char*, ...); - - -#endif - diff --git a/import/log4c/log4c/Makefile.am b/import/log4c/log4c/Makefile.am deleted file mode 100644 index bf08151..0000000 --- a/import/log4c/log4c/Makefile.am +++ /dev/null @@ -1,51 +0,0 @@ -INCLUDES = \ - -I$(srcdir)/../ \ - -DLOG4C_RCPATH="\"$(sysconfdir)/bongo\"" - -lib_LTLIBRARIES = libbongolog4c.la - -libbongolog4c_la_SOURCES = \ - rc.c \ - init.c \ - appender_type_stream.c \ - appender_type_stream2.c \ - appender_type_syslog.c \ - appender_type_mmap.c \ - appender_type_audit.c \ - layout_type_basic.c \ - layout_type_dated.c \ - version.c \ - logging_event.c \ - priority.c \ - appender.c \ - layout.c \ - category.c \ - log4c.c - -libbongolog4c_la_LIBADD = \ - ../sd/libbongolog4c_sd.la - -LIBS = \ - $(LIBLOGEVENT) - -bongolog4cincludedir=$(includedir)/bongo/log4c - -bongolog4cinclude_HEADERS = \ - rc.h \ - init.h \ - defs.h \ - version.h \ - location_info.h \ - logging_event.h \ - priority.h \ - layout_type_basic.h \ - layout_type_dated.h \ - layout.h \ - appender_type_stream.h \ - appender_type_stream2.h \ - appender_type_syslog.h \ - appender_type_mmap.h \ - appender_type_audit.h \ - appender.h \ - category.h \ - buffer.h diff --git a/import/log4c/log4c/appender.c b/import/log4c/log4c/appender.c deleted file mode 100644 index b47d060..0000000 --- a/import/log4c/log4c/appender.c +++ /dev/null @@ -1,298 +0,0 @@ -static const char version[] = "$Id: appender.c,v 1.5 2005/12/15 21:36:34 rbyrne Exp $"; - -/* - * appender.c - * - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * - * See the COPYING file for the terms of usage and distribution. - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -struct __log4c_appender -{ - char* app_name; - const log4c_layout_t* app_layout; - const log4c_appender_type_t* app_type; - int app_isopen; - void* app_udata; -}; - -sd_factory_t* log4c_appender_factory = NULL; - -/*******************************************************************************/ -static sd_hash_t* log4c_appender_types(void) -{ - static sd_hash_t* types = NULL; - - if (!types) { - types = sd_hash_new(20, NULL); - } - - return types; -} - -/*******************************************************************************/ -extern const log4c_appender_type_t* log4c_appender_type_get(const char* a_name) -{ - sd_hash_iter_t* i; - - if (!a_name) { - return NULL; - } - if ( (i = sd_hash_lookup(log4c_appender_types(), a_name)) != NULL) { - return i->data; - } - - return NULL; -} - -/*******************************************************************************/ -extern const log4c_appender_type_t* log4c_appender_type_set( - const log4c_appender_type_t* a_type) -{ - sd_hash_iter_t* i = NULL; - void* previous = NULL; - - if (!a_type) { - return NULL; - } - if ( (i = sd_hash_lookadd(log4c_appender_types(), a_type->name)) == NULL) { - return NULL; - } - - previous = i->data; - i->data = (void*) a_type; - return previous; -} - -/*******************************************************************************/ -extern log4c_appender_t* log4c_appender_get(const char* a_name) -{ - static const sd_factory_ops_t log4c_appender_factory_ops = { - (void*) log4c_appender_new, - (void*) log4c_appender_delete, - (void*) log4c_appender_print, - }; - log4c_appender_t* app_t = NULL; - - if (!log4c_appender_factory) { - log4c_appender_factory = sd_factory_new("log4c_appender_factory", - &log4c_appender_factory_ops); - - /* build default appenders */ - log4c_appender_set_udata(log4c_appender_get("stderr"), stderr); - log4c_appender_set_udata(log4c_appender_get("stdout"), stdout); - log4c_appender_set_type(log4c_appender_get("syslog"), - &log4c_appender_type_syslog); - log4c_appender_set_type(log4c_appender_get("audit"), - &log4c_appender_type_audit); - } - - if(!strcmp(a_name, "")) { - app_t = sd_factory_get (log4c_appender_factory, "syslog"); - } else { - app_t = sd_factory_get (log4c_appender_factory, a_name); - } - return app_t; -} - -/*******************************************************************************/ -extern log4c_appender_t* log4c_appender_new(const char* a_name) -{ - log4c_appender_t* this; - - if (!a_name) { - return NULL; - } - - this = sd_calloc(1, sizeof(log4c_appender_t)); - this->app_name = sd_strdup(a_name); - this->app_type = &log4c_appender_type_stream; - this->app_layout = log4c_layout_get("basic"); - this->app_isopen = 0; - this->app_udata = NULL; - return this; -} - -/*******************************************************************************/ -extern void log4c_appender_delete(log4c_appender_t* this) -{ - if (!this) { - return; - } - - log4c_appender_close(this); - free(this->app_name); - free(this); -} - -/*******************************************************************************/ -extern const char* log4c_appender_get_name(const log4c_appender_t* this) -{ - return (this ? this->app_name : "(nil)"); -} - -/*******************************************************************************/ -extern const log4c_appender_type_t* log4c_appender_get_type( - const log4c_appender_t* this) -{ - return (this ? this->app_type : NULL); -} - -/*******************************************************************************/ -extern const log4c_layout_t* log4c_appender_get_layout(const log4c_appender_t* this) -{ - return (this ? this->app_layout : NULL); -} - -/*******************************************************************************/ -extern void* log4c_appender_get_udata(const log4c_appender_t* this) -{ - return (this ? this->app_udata : NULL); -} - -/*******************************************************************************/ -extern const log4c_appender_type_t* log4c_appender_set_type( - log4c_appender_t* this, - const log4c_appender_type_t* a_type) -{ - const log4c_appender_type_t* previous; - - if (!this) { - return NULL; - } - - previous = this->app_type; - this->app_type = a_type; - return previous; -} - -/*******************************************************************************/ -extern const log4c_layout_t* log4c_appender_set_layout( - log4c_appender_t* this, - const log4c_layout_t* a_layout) -{ - const log4c_layout_t* previous; - - if (!this) { - return NULL; - } - - previous = this->app_layout; - this->app_layout = a_layout; - return previous; -} - -/*******************************************************************************/ -extern void* log4c_appender_set_udata(log4c_appender_t* this, void* a_udata) -{ - void* previous; - - if (!this) { - return NULL; - } - - previous = this->app_udata; - this->app_udata = a_udata; - return previous; -} - -/*******************************************************************************/ -extern int log4c_appender_open(log4c_appender_t* this) -{ - if (!this) { - return -1; - } - if (this->app_isopen) { - return 0; - } - if (!this->app_type) { - return 0; - } - if (!this->app_type->open) { - return 0; - } - if (this->app_type->open(this) == -1) { - return -1; - } - - this->app_isopen++; - return 0; -} - -/** - * @bug is this the right place to open an appender ? - */ - -/*******************************************************************************/ -extern int log4c_appender_append( - log4c_appender_t* this, - log4c_logging_event_t* a_event) -{ - if (!this) { - return -1; - } - if (!this->app_type) { - return 0; - } - if (!this->app_type->append) { - return 0; - } - if (!this->app_isopen) { - if (log4c_appender_open(this) == -1) { - return -1; - } - } - if ( (a_event->evt_rendered_msg = - log4c_layout_format(this->app_layout, a_event)) == NULL) { - a_event->evt_rendered_msg = a_event->evt_msg; - } - - return this->app_type->append(this, a_event); -} - -/*******************************************************************************/ -extern int log4c_appender_close(log4c_appender_t* this) -{ - if (!this) { - return -1; - } - if (!this->app_isopen) { - return 0; - } - if (!this->app_type) { - return 0; - } - if (!this->app_type->close) { - return 0; - } - if (this->app_type->close(this) == -1) { - return -1; - } - - this->app_isopen--; - return 0; -} - -/*******************************************************************************/ -extern void log4c_appender_print(const log4c_appender_t* this, FILE* a_stream) -{ - if (!this) { - return; - } - fprintf(a_stream, "{ name:'%s' type:'%s' layout:'%s' isopen:%d udata:%p}", - this->app_name, - this->app_type ? this->app_type->name : "(not set)", - log4c_layout_get_name(this->app_layout), - this->app_isopen, - this->app_udata); -} diff --git a/import/log4c/log4c/appender.h b/import/log4c/log4c/appender.h deleted file mode 100644 index 187f693..0000000 --- a/import/log4c/log4c/appender.h +++ /dev/null @@ -1,192 +0,0 @@ -/* $Id: appender.h,v 1.4 2005/12/13 22:12:49 legoater Exp $ - * - * appender.h - * - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * - * See the COPYING file for the terms of usage and distribution. - */ - -#ifndef log4c_appender_h -#define log4c_appender_h - -/** - * @file appender.h - * - * @brief Implement this interface for your own strategies for printing log - * statements. - * - * @todo the appender interface needs a better configuration system - * depending on the layout type. The udata field is a just a trick. - **/ - -#include -#include -#include -#include -#include -#include - -__LOG4C_BEGIN_DECLS - -struct __log4c_appender; - -/** - * log4c appender class - **/ -typedef struct __log4c_appender log4c_appender_t; - -/** - * @brief log4c appender type class - * - * Attributes description: - * - * @li @c name appender type name - * @li @c open - * @li @c append - * @li @c close - **/ -typedef struct log4c_appender_type { - const char* name; - int (*open) (log4c_appender_t*); - int (*append) (log4c_appender_t*, const log4c_logging_event_t*); - int (*close) (log4c_appender_t*); -} log4c_appender_type_t; - -/** - * Get a pointer to an existing appender type. - * - * @param a_name the name of the appender type to return. - * @returns a pointer to an existing appender type, or NULL if no appender - * type with the specified name exists. - **/ -LOG4C_API const log4c_appender_type_t* log4c_appender_type_get(const char* a_name); - -/** - * Set an appender type. - * - * @param a_type a pointer to the new appender type to set. - * @returns a pointer to the previous appender type of same name. - **/ -LOG4C_API const log4c_appender_type_t* log4c_appender_type_set( - const log4c_appender_type_t* a_type); - -/** - * Get a pointer to an existing appender. - * - * @param a_name the name of the appender to return. - * @returns a pointer to an existing appender, or NULL if no appender - * with the specfied name exists. - **/ -LOG4C_API log4c_appender_t* log4c_appender_get(const char* a_name); - -/** - * Constructor for log4c_appender_t. - **/ -LOG4C_API log4c_appender_t* log4c_appender_new(const char* a_name); - -/** - * Destructor for log4c_appender_t. - **/ -LOG4C_API void log4c_appender_delete(log4c_appender_t* a_appender); - -/** - * @param a_appender the log4c_appender_t object - * @return the appender name - **/ -LOG4C_API const char* log4c_appender_get_name(const log4c_appender_t* a_appender); - -/** - * @param a_appender the log4c_appender_t object - * @return the appender operations - **/ -LOG4C_API const log4c_appender_type_t* log4c_appender_get_type( - const log4c_appender_t* a_appender); - -/** - * @param a_appender the log4c_appender_t object - * @return the appender layout - **/ -LOG4C_API const log4c_layout_t* log4c_appender_get_layout( - const log4c_appender_t* a_appender); - -/** - * @param a_appender the log4c_appender_t object - * @return the appender user data - **/ -LOG4C_API void* log4c_appender_get_udata(const log4c_appender_t* a_appender); - -/** - * sets the appender type - * - * @param a_appender the log4c_appender_t object - * @param a_type the new appender type - * @return the previous appender type - **/ -LOG4C_API const log4c_appender_type_t* log4c_appender_set_type( - log4c_appender_t* a_appender, - const log4c_appender_type_t* a_type); - -/** - * sets the appender user data - * - * @param a_appender the log4c_appender_t object - * @param a_udata the new appender user data - * @return the previous appender user data - **/ -LOG4C_API void* log4c_appender_set_udata(log4c_appender_t* a_appender, - void* a_udata); - -/** - * sets the appender layout - * - * @param a_appender the log4c_appender_t object - * @param a_layout the new appender layout - * @return the previous appender layout - **/ -LOG4C_API const log4c_layout_t* log4c_appender_set_layout( - log4c_appender_t* a_appender, - const log4c_layout_t* a_layout); - -/** - * opens the appender. - * - * @param a_appender the log4c_appender_t object - **/ -LOG4C_API int log4c_appender_open(log4c_appender_t* a_appender); - -/** - * log in appender specific way. - * - * @param a_appender the log4c_appender object - * @param a_event the log4c_logging_event_t object to log. - **/ -LOG4C_API int log4c_appender_append( - log4c_appender_t* a_appender, - log4c_logging_event_t* a_event); - -/** - * closes the appender - * - * @param a_appender the log4c_appender_t object - **/ -LOG4C_API int log4c_appender_close(log4c_appender_t* a_appender); - -/** - * prints the appender on a stream - * - * @param a_appender the log4c_appender_t object - * @param a_stream the stream - **/ -LOG4C_API void log4c_appender_print(const log4c_appender_t* a_appender, - FILE* a_stream); - -/** - * @internal - **/ -struct __sd_factory; -LOG4C_API struct __sd_factory* log4c_appender_factory; - -__LOG4C_END_DECLS - -#endif diff --git a/import/log4c/log4c/appender_type_audit.c b/import/log4c/log4c/appender_type_audit.c deleted file mode 100644 index 5cc4c7c..0000000 --- a/import/log4c/log4c/appender_type_audit.c +++ /dev/null @@ -1,171 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2005 Novell, Inc. - * All Rights Reserved. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2.1 of the GNU Lesser General Public - * License as published by the Free Software Foundation. - * - * 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, contact Novell, Inc. - * - * To contact Novell about this file by physical or electronic mail, - * you may find current contact information at www.novell.com - * - ****************************************************************************/ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#include - -#ifdef HAVE_LIBLOGEVENT -#include "audit_logevent.h" - -static LOGHANDLE audit_handle; - -/*******************************************************************************/ -static int log4c_to_audit_priority(int a_priority) -{ - static int priorities[] = { - LE_EMERGENCY, - LE_ALERT, - LE_CRITICAL, - LE_ERROR, - LE_WARNING, - LE_NOTICE, - LE_INFO, - LE_DEBUG - }; - int result; - - a_priority++; - a_priority /= 100; - - if (a_priority < 0) { - result = LOG_EMERG; - } else if (a_priority > 7) { - result = LOG_DEBUG; - } else { - result = priorities[a_priority]; - } - - return result; -} - -/* - * readfile - read a text file into a string. - * note: returned string must be free()d later - */ -static unsigned char* readfile(char* filename) -{ - int filehandle = 0; - int filepos = 0; - int pos = 0; - int size = 0; - unsigned char* string = NULL; - filehandle = open (filename, O_RDONLY); - if (filehandle) { - do { - size += 10; - string = realloc (string, size * sizeof (*string)); - pos = read (filehandle, string + (filepos * sizeof (*string)), 9); - filepos += pos; - } while(pos > 0); - string[filepos] = '\0'; - close(filehandle); - } - return string; -} - -/*******************************************************************************/ -static int audit_open(log4c_appender_t* this) -{ - char filename[256]; - unsigned char* cert = NULL; - unsigned char* pkey = NULL; - snprintf (filename, sizeof (filename) - 1, "%s/bongocert.pem", - getenv("LOG4C_RCPATH") ? getenv("LOG4C_RCPATH") : LOG4C_RCPATH); - cert = readfile(filename); - snprintf (filename, sizeof (filename) - 1, "%s/bongopkey.pem", - getenv("LOG4C_RCPATH") ? getenv("LOG4C_RCPATH") : LOG4C_RCPATH); - pkey = readfile(filename); - audit_handle = LogOpen (cert, pkey, 0, NULL); - free (cert); - free (pkey); - return 0; -} - -/*******************************************************************************/ -static int audit_append(log4c_appender_t* this, - const log4c_logging_event_t* a_event) -{ - LogEventDirect (audit_handle, - (unsigned char*)a_event->evt_category, - a_event->evt_audit_id ? - a_event->evt_audit_id : NAUDIT_EVENT_NETMAIL_UNSPECIFIED, - log4c_to_audit_priority(a_event->evt_priority), - 0, - 0, - (unsigned char*)a_event->evt_audit_s1, - (unsigned char*)a_event->evt_audit_s2, - a_event->evt_audit_d1, - a_event->evt_audit_d2, - 0, - 0, - NULL); - return 0; -} - -/*******************************************************************************/ -static int audit_close(log4c_appender_t* this) -{ - LogClose (audit_handle); - return 0; -} - -#else - -/*******************************************************************************/ -static int audit_open(log4c_appender_t* this) -{ - return 0; -} - -/*******************************************************************************/ -static int audit_append(log4c_appender_t* this, - const log4c_logging_event_t* a_event) -{ - return 0; -} - -/*******************************************************************************/ -static int audit_close(log4c_appender_t* this) -{ - return 0; -} -#endif - - -/*******************************************************************************/ -const log4c_appender_type_t log4c_appender_type_audit = { - "audit", - audit_open, - audit_append, - audit_close, -}; - -/* -log4c_appender_type_define(log4c_appender_type_syslog); -*/ diff --git a/import/log4c/log4c/appender_type_audit.h b/import/log4c/log4c/appender_type_audit.h deleted file mode 100644 index eafc879..0000000 --- a/import/log4c/log4c/appender_type_audit.h +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2005 Novell, Inc. - * All Rights Reserved. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2.1 of the GNU Lesser General Public - * License as published by the Free Software Foundation. - * - * 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, contact Novell, Inc. - * - * To contact Novell about this file by physical or electronic mail, - * you may find current contact information at www.novell.com - * - ****************************************************************************/ - -#ifndef log4c_appender_type_audit_h -#define log4c_appender_type_audit_h - -/** - * @file appender_type_syslog.h - * - * @brief Log4c syslog(3) appender interface. - * - * The audit appender uses the Novell Audit interface for logging. The log4c - * priorities are mapped to the Audit priorities and the appender name is - * used as an Audit identifier. 1 default Audit appender is defined: @c - * "audit". - * - * The following examples shows how to define and use audit appenders. - * - * @code - * - * log4c_appender_t* myappender; - * - * myappender = log4c_appender_get("myappender"); - * log4c_appender_set_type(myappender, &log4c_appender_type_audit); - * - * @endcode - * - **/ - -#include -#include - -__LOG4C_BEGIN_DECLS - -/** - * Audit appender type definition. - * - * This should be used as a parameter to the log4c_appender_set_type() - * routine to set the type of the appender. - * - **/ -extern const log4c_appender_type_t log4c_appender_type_audit; - -__LOG4C_END_DECLS - -#endif diff --git a/import/log4c/log4c/appender_type_mmap.c b/import/log4c/log4c/appender_type_mmap.c deleted file mode 100644 index 9cc3eee..0000000 --- a/import/log4c/log4c/appender_type_mmap.c +++ /dev/null @@ -1,157 +0,0 @@ -static const char version[] = "$Id: appender_type_mmap.c,v 1.5 2005/12/13 22:02:42 legoater Exp $"; - -/* - * appender_mmap.c - * - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * - * See the COPYING file for the terms of usage and distribution. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef HAVE_UNISTD_H -#include -#endif - -/* This could be public */ -struct mmap_info { - const char* name; - int fd; - size_t length; - void* addr; - void* ptr; - struct stat st; -}; - -static int mmap_info_delete(struct mmap_info* a_minfo); -static struct mmap_info* mmap_info_new(const char* a_name); - -/*******************************************************************************/ -static struct mmap_info* mmap_info_new(const char* a_name) -{ - struct mmap_info* minfo = NULL; - - minfo = sd_calloc(1, sizeof(*minfo)); - minfo->name = a_name; - - if ( (minfo->fd = open(minfo->name, O_RDWR, 0644)) == -1) { - sd_oserror("open", minfo->name); - mmap_info_delete(minfo); - return NULL; - } - - if (fstat(minfo->fd, &minfo->st) == -1) { - sd_oserror("fstat", minfo->name); - mmap_info_delete(minfo); - return NULL; - } - - minfo->length = minfo->st.st_size; - - if (!minfo->length) { - sd_error("file %s is empty", minfo->name); - mmap_info_delete(minfo); - return NULL; - } - - return minfo; -} -/*******************************************************************************/ -static int mmap_info_delete(struct mmap_info* a_minfo) -{ - if (!a_minfo) - return -1; - - close(a_minfo->fd); - free(a_minfo); - return 0; -} - -/*******************************************************************************/ -static int mmap_open(log4c_appender_t* this) -{ - struct mmap_info* minfo = log4c_appender_get_udata(this); - - if (minfo) - return 0; - - if ( (minfo = mmap_info_new(log4c_appender_get_name(this))) == NULL) - return -1; - - minfo->addr = mmap(NULL, minfo->length, PROT_READ|PROT_WRITE, - MAP_SHARED, minfo->fd, 0); - if (minfo->addr == NULL) { - sd_oserror("mmap", minfo->name); - mmap_info_delete(minfo); - return -1; - } - - minfo->ptr = minfo->addr; - log4c_appender_set_udata(this, minfo); - return 0; -} - -/*******************************************************************************/ -static int mmap_append(log4c_appender_t* this, - const log4c_logging_event_t* a_event) -{ - size_t size, available; - struct mmap_info* minfo = log4c_appender_get_udata(this); - - if (!minfo && !minfo->ptr) - return 0; - - size = strlen(a_event->evt_rendered_msg); - available = (minfo->addr + minfo->length) - minfo->ptr; - - if (size > available) { - memcpy(minfo->ptr, a_event->evt_rendered_msg, available); - minfo->ptr = minfo->addr; - size -= available; - } - - memcpy(minfo->ptr, a_event->evt_rendered_msg, size); - minfo->ptr += size; - return 0; -} - -/*******************************************************************************/ -static int mmap_close(log4c_appender_t* this) -{ - struct mmap_info* minfo = log4c_appender_get_udata(this); - - if (!minfo) - return 0; - - if (munmap(minfo->addr, minfo->length) == -1) - sd_oserror("munmap", minfo->name); - - mmap_info_delete(minfo); - - log4c_appender_set_udata(this, NULL); - return 0; -} - -/*******************************************************************************/ -const log4c_appender_type_t log4c_appender_type_mmap = { - "mmap", - mmap_open, - mmap_append, - mmap_close, -}; - -/* -log4c_appender_type_define(log4c_appender_type_mmap); -*/ diff --git a/import/log4c/log4c/appender_type_mmap.h b/import/log4c/log4c/appender_type_mmap.h deleted file mode 100644 index 508549e..0000000 --- a/import/log4c/log4c/appender_type_mmap.h +++ /dev/null @@ -1,54 +0,0 @@ -/* $Id: appender_type_mmap.h,v 1.3 2003/09/12 21:06:45 legoater Exp $ - * - * appender_type_mmap.h - * - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * - * See the COPYING file for the terms of usage and distribution. - */ - -#ifndef log4c_appender_type_mmap_h -#define log4c_appender_type_mmap_h - -/** - * @file appender_type_mmap.h - * - * @brief Log4c mmap(2) appender interface. - * - * The mmap appender uses a fixed length memory mapped file for - * logging. The appender's name is used as the file name which will be - * opened and mapped to memory at first use. The memory mapped file is then - * used as a rotating buffer in which logging events are written. - * - * The following examples shows how to define and use mmap appenders. - * - * @code - * - * log4c_appender_t* myappender; - * - * myappender = log4c_appender_get("myfile.log"); - * log4c_appender_set_type(myappender, &log4c_appender_type_mmap); - * - * @endcode - * - * @warning the file is not created at first use. It should already exist - * and have a reasonable size, a mutilple of a page size. - * - **/ -#include -#include - -__LOG4C_BEGIN_DECLS - -/** - * Mmap appender type definition. - * - * This should be used as a parameter to the log4c_appender_set_type() - * routine to set the type of the appender. - * - **/ -extern const log4c_appender_type_t log4c_appender_type_mmap; - -__LOG4C_END_DECLS - -#endif diff --git a/import/log4c/log4c/appender_type_stream.c b/import/log4c/log4c/appender_type_stream.c deleted file mode 100644 index a85b64f..0000000 --- a/import/log4c/log4c/appender_type_stream.c +++ /dev/null @@ -1,65 +0,0 @@ -static const char version[] = "$Id: appender_type_stream.c,v 1.5 2005/12/06 09:07:05 legoater Exp $"; - -/* - * appender_stream.c - * - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * - * See the COPYING file for the terms of usage and distribution. - */ - -#include -#include -#include - -/*******************************************************************************/ -static int stream_open(log4c_appender_t* this) -{ - FILE* fp = log4c_appender_get_udata(this); - - if (fp) - return 0; - - if ( (fp = fopen(log4c_appender_get_name(this), "w+")) == NULL) - fp = stderr; - - /* unbuffered mode */ - setbuf(fp, NULL); - - log4c_appender_set_udata(this, fp); - return 0; -} - -/*******************************************************************************/ -static int stream_append(log4c_appender_t* this, - const log4c_logging_event_t* a_event) -{ - FILE* fp = log4c_appender_get_udata(this); - - return fprintf(fp, "[%s] %s", log4c_appender_get_name(this), - a_event->evt_rendered_msg); -} - -/*******************************************************************************/ -static int stream_close(log4c_appender_t* this) -{ - FILE* fp = log4c_appender_get_udata(this); - - - if (!fp || fp == stdout || fp == stderr) - return 0; - - return fclose(fp); -} - -/*******************************************************************************/ -const log4c_appender_type_t log4c_appender_type_stream = { - "stream", - stream_open, - stream_append, - stream_close, -}; - -/* -log4c_appender_type_define(log4c_appender_type_stream); -*/ diff --git a/import/log4c/log4c/appender_type_stream.h b/import/log4c/log4c/appender_type_stream.h deleted file mode 100644 index 8dc4f8f..0000000 --- a/import/log4c/log4c/appender_type_stream.h +++ /dev/null @@ -1,67 +0,0 @@ -/* $Id: appender_type_stream.h,v 1.3 2003/09/12 21:06:45 legoater Exp $ - * - * appender_type_stream.h - * - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * - * See the COPYING file for the terms of usage and distribution. - */ - -#ifndef log4c_appender_type_stream_h -#define log4c_appender_type_stream_h - -/** - * @file appender_type_stream.h - * - * @brief Log4c stream appender interface. - * - * The stream appender uses a file handle @c FILE* for logging. The - * appender's name is used as the file name which will be opened at first - * log. An appender can also be associated to an opened file handle using - * the log4c_appender_set_udata() method to update the appender user data - * field. In this last case, the appender name has no meaning. 2 default - * stream appenders are defined: @c "stdout" and @c "stderr". - * - * The following examples shows how to define and use stream appenders. - * - * @li the simple way - * @code - * - * log4c_appender_t* myappender; - * - * myappender = log4c_appender_get("myfile.log"); - * log4c_appender_set_type(myappender, &log4c_appender_type_stream); - * - * @endcode - * - * @li the sophisticated way - * @code - * - * log4c_appender_t* myappender; - * - * myappender = log4c_appender_get("myappender"); - * - * log4c_appender_set_type(myappender, &log4c_appender_type_stream); - * log4c_appender_set_udata(myappender, fopen("myfile.log", "w")); - * - * @endcode - * - **/ - -#include -#include - -__LOG4C_BEGIN_DECLS - -/** - * Stream appender type definition. - * - * This should be used as a parameter to the log4c_appender_set_type() - * routine to set the type of the appender. - * - **/ -extern const log4c_appender_type_t log4c_appender_type_stream; - -__LOG4C_END_DECLS - -#endif diff --git a/import/log4c/log4c/appender_type_stream2.c b/import/log4c/log4c/appender_type_stream2.c deleted file mode 100644 index 1923e8f..0000000 --- a/import/log4c/log4c/appender_type_stream2.c +++ /dev/null @@ -1,211 +0,0 @@ -static const char version[] = "$Id: appender_type_stream2.c,v 1.2 2005/11/07 23:16:15 rbyrne Exp $"; - -/* - * appender_stream2.c - * - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * - * See the COPYING file for the terms of usage and distribution. - */ -#include -#include - -#include - -#include -#include - -typedef struct stream2_udata { - FILE * s2u_fp; - int s2u_flags; -#define STREAM2_MY_FP 0x01 - int s2u_state; -} log4c_stream2_udata_t; - -/* xxx would be nice to run-time check the type here */ -#define stream2_get_udata(this) \ - (log4c_stream2_udata_t *)log4c_appender_get_udata(this) - -/*******************************************************************************/ -static log4c_stream2_udata_t* stream2_make_udata(void); -static void stream2_free_udata(log4c_stream2_udata_t* s2up); -static log4c_stream2_udata_t * stream2_get_or_make_udata(log4c_appender_t* this); -static int stream2_init(log4c_appender_t* this); - -/*******************************************************************************/ -static int stream2_init(log4c_appender_t* this){ - log4c_stream2_udata_t *s2up = stream2_make_udata(); - - log4c_appender_set_udata(this, s2up); - - return(0); -} - -/*******************************************************************************/ -static int stream2_open(log4c_appender_t* this) -{ - log4c_stream2_udata_t *s2up = NULL; - FILE * fp = NULL; - int flags = 0; - - if ( !this){ - return(-1); - } - s2up = stream2_get_or_make_udata(this); - //s2up = stream2_get_udata(this); - - fp = s2up->s2u_fp; - flags = s2up->s2u_flags; - - if ( !fp ) { - if ( (fp = fopen(log4c_appender_get_name(this), "w+")) == NULL){ - fp = stderr; - } else { - s2up->s2u_state |= STREAM2_MY_FP; - } - s2up->s2u_fp = fp; - } - - if ( flags & LOG4C_STREAM2_UNBUFFERED){/* unbuffered mode by default */ - setbuf(fp, NULL); - } - - return 0; -} - -/*******************************************************************************/ -static int stream2_append(log4c_appender_t* this, - const log4c_logging_event_t* a_event) -{ - log4c_stream2_udata_t *s2up = log4c_appender_get_udata(this); - - if ( !s2up ) { - return(-1); - } - - return fprintf(s2up->s2u_fp, "[%s] %s", log4c_appender_get_name(this), - a_event->evt_rendered_msg); -} - -/*******************************************************************************/ -static int stream2_close(log4c_appender_t* this) -{ - log4c_stream2_udata_t *s2up = log4c_appender_get_udata(this); - int rc = -1; - - if ( !this){ - return rc; - } - s2up = stream2_get_udata(this); - if ( !s2up){ - return(rc); - } - - if ( s2up->s2u_fp && (s2up->s2u_state & STREAM2_MY_FP) ){ - rc = fclose(s2up->s2u_fp); - } else { - rc = 0; - } - /* Free up and reset any data associated with this stream2 appender */ - stream2_free_udata(s2up); - log4c_appender_set_udata(this, NULL); - - return (rc); -} - -/*******************************************************************************/ - -static log4c_stream2_udata_t* stream2_make_udata(){ - - log4c_stream2_udata_t* s2up = - (log4c_stream2_udata_t*) sd_calloc(1, sizeof(log4c_stream2_udata_t*)); - return(s2up); -} - -/*******************************************************************************/ - -static void stream2_free_udata(log4c_stream2_udata_t* s2up){ - - free(s2up); -} - -/*******************************************************************************/ - -static log4c_stream2_udata_t * stream2_get_or_make_udata(log4c_appender_t* this){ - log4c_stream2_udata_t *s2up; - int rc = 0; - - s2up = log4c_appender_get_udata(this); - - if ( !s2up) { - rc = stream2_init(this); - } - - return(stream2_get_udata(this)); -} - -/*******************************************************************************/ -extern void log4c_stream2_set_fp(log4c_appender_t* this, FILE *fp){ - log4c_stream2_udata_t *s2up; - - if ( !this){ - return; - } - s2up = stream2_get_or_make_udata(this); - - s2up->s2u_fp = fp; - s2up->s2u_state &= !(STREAM2_MY_FP); -} -/*******************************************************************************/ -extern FILE* log4c_stream2_get_fp(log4c_appender_t* this){ - log4c_stream2_udata_t *s2up; - - if ( !this){ - return NULL; - } - s2up = stream2_get_udata(this); - if ( s2up){ - return s2up->s2u_fp; - } else { - return NULL; - } -} -/*******************************************************************************/ -extern int log4c_stream2_get_flags(log4c_appender_t* this){ - log4c_stream2_udata_t *s2up; - - if ( !this){ - return -1; - } - s2up = stream2_get_udata(this); - if ( s2up){ - return s2up->s2u_flags; - } else { - return -1; - } -} -/*******************************************************************************/ -extern void log4c_stream2_set_flags(log4c_appender_t* this, int flags){ - log4c_stream2_udata_t *s2up; - - if ( !this){ - return; - } - s2up = stream2_get_or_make_udata(this); - if ( !s2up){ - return; - } - s2up->s2u_flags = flags; -} - -/*******************************************************************************/ -const log4c_appender_type_t log4c_appender_type_stream2 = { - "stream2", - stream2_open, - stream2_append, - stream2_close, -}; - -/* -log4c_appender_type_define(log4c_appender_type_stream2); -*/ diff --git a/import/log4c/log4c/appender_type_stream2.h b/import/log4c/log4c/appender_type_stream2.h deleted file mode 100644 index b404604..0000000 --- a/import/log4c/log4c/appender_type_stream2.h +++ /dev/null @@ -1,130 +0,0 @@ -/* - * - * appender_type_stream.h - * - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * - * See the COPYING file for the terms of usage and distribution. - */ - -#ifndef log4c_appender_type_stream2_h -#define log4c_appender_type_stream2_h - -/** - * @file appender_type_stream2.h - * - * @brief Log4c stream2 appender interface. - * - * The stream2 appender uses a file handle @c FILE* for logging. - * It can be used with @c stdout, @c stderr or a normal file. - * It is pretty primitive as it does not do file rotation, or have a maximum - * configurable file size etc. It improves on the stream appender in a few - * ways that make it a better starting point for new stream based appenders. - * - * It enhances the stream appender by allowing - * the default file pointer to be used in buffered or unbuffered mode. - * Also when you set the file pointer stream2 will not attempt to close - * it on exit which avoids it fighting with the owner of the file pointer. - * stream2 is configured via setter functions--the udata is - * not exposed directly. This means that new options (eg. configure the open - * mode ) could be added to stream2 while maintaining backward compatability. - * - * The appender can be used with default values, for example as follows: - * - * @code - * log4c_appender_t* myappender; - * - * myappender = log4c_appender_get("/var/logs/mylog.log"); - * log4c_appender_set_type(myappender,log4c_appender_type_get("stream2")); - * - * @endcode - * - * In this case the appender will be configured automatically with default - * values: - * @li the filename is the same as the name of the appender, - * @c "/var/logs/mymlog.log" - * @li the file is opened in "w+" mode - * @li the default system buffer is used (cf; @c setbuf() ) in buffered mode - * - * The stream2 appender can be configured by passing it a file pointer - * to use. In this case you manage the file pointer yourself--open, - * option setting, closing. If you set the file pointer log4c will - * not close the file on exiting--you must do this: - * - * @code - * log4c_appender_t* myappender; - * FILE * fp = fopen("myfile.log", "w"); - * - * myappender = log4c_appender_get("myappender"); - * log4c_appender_set_type(myappender, log4c_appender_type_get("stream2")); - * log4c_stream2_set_fp(stream2_appender,myfp); - * - * @endcode - * - * The default file pointer can be configured to use unbuffered mode. - * Buffered mode is typically 25%-50% faster than unbuffered mode but - * unbuffered mode is useful if your preference is for a more synchronized - * log file: - * - * @code log4c_appender_t* myappender; - * - * myappender = log4c_appender_get("/var/logs/mylog.log"); - * log4c_appender_set_type(myappender,log4c_appender_type_get("stream2")); - * log4c_stream2_set_flags(myappender, LOG4C_STREAM2_UNBUFFERED); - * - * @endcode - * - **/ - -#include -#include - -__LOG4C_BEGIN_DECLS - -/** - * Stream2 appender type definition. - * - * This should be used as a parameter to the log4c_appender_set_type() - * routine to set the type of the appender. - * - **/ -LOG4C_API const log4c_appender_type_t log4c_appender_type_stream2; - -/** - * Set the file pointer for this appender. - * @param this a pointer to the appender - * @param fp the file pointer this appender will use. The caller is - * responsible for managing the file pointer (open, option setting, closing). - */ -LOG4C_API void log4c_stream2_set_fp(log4c_appender_t* this, FILE *fp); - -/** - * Get the file pointer for this appender. - * @param this a pointer to the appender - * @return the file pointer for this appender. If there's a problem - * returns NULL. - * - */ -LOG4C_API FILE * log4c_stream2_get_fp(log4c_appender_t* this); - - -/** - * Set the flags for this appender. - * @param this a pointer to the appender - * @param the flags to set. These will overwrite the existing flags. - * Currently supported flags: LOG4C_STREAM2_UNBUFFERED - * - */ -LOG4C_API void log4c_stream2_set_flags(log4c_appender_t* this, int flags); -#define LOG4C_STREAM2_UNBUFFERED 0x01 - -/** - * Get the flags for this appender. - * @param this a pointer to the appender - * @return the flags for this appender. returns -1 if there was a problem. - */ -LOG4C_API int log4c_stream2_get_flags(log4c_appender_t* this); - -__LOG4C_END_DECLS - -#endif diff --git a/import/log4c/log4c/appender_type_syslog.c b/import/log4c/log4c/appender_type_syslog.c deleted file mode 100644 index 683f0d4..0000000 --- a/import/log4c/log4c/appender_type_syslog.c +++ /dev/null @@ -1,129 +0,0 @@ -static const char version[] = "$Id: appender_type_syslog.c,v 1.5 2005/12/13 20:48:36 legoater Exp $"; - -/* - * appender_syslog.c - * - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * - * See the COPYING file for the terms of usage and distribution. - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include - -#ifdef HAVE_SYSLOG_H -#include - -/*******************************************************************************/ -static int log4c_to_syslog_priority(int a_priority) -{ - static int priorities[] = { - LOG_EMERG, - LOG_ALERT, - LOG_CRIT, - LOG_ERR, - LOG_WARNING, - LOG_NOTICE, - LOG_INFO, - LOG_DEBUG - }; - int result; - - a_priority++; - a_priority /= 100; - - if (a_priority < 0) { - result = LOG_EMERG; - } else if (a_priority > 7) { - result = LOG_DEBUG; - } else { - result = priorities[a_priority]; - } - - return result; -} - -/*******************************************************************************/ -static int syslog_open(log4c_appender_t* this) -{ - openlog(log4c_appender_get_name(this), LOG_PID, LOG_USER); - return 0; -} - -/*******************************************************************************/ -static int syslog_append(log4c_appender_t* this, - const log4c_logging_event_t* a_event) -{ - const char *source; - char *origdest, *dest; - - // we want to remove any '%' formatting characters from the - // log string, since syslog will try to interpolate them - source = a_event->evt_rendered_msg; - dest = (char *)sd_malloc((strlen(source)*2) + 1); - if (dest == NULL) return -1; // out of memory - *dest = '\0'; - origdest = dest; - - while (*source != '\0') { - *dest = *source; - if ((*source == '%') || (*source == '\\')) { - dest++; - *dest = *source; - } - dest++; - source++; - } - *dest = '\0'; - - syslog(log4c_to_syslog_priority(a_event->evt_priority) | LOG_USER, - origdest); - free(origdest); - return 0; -} - -/*******************************************************************************/ -static int syslog_close(log4c_appender_t* this) -{ - closelog(); - return 0; -} - -#else - -/*******************************************************************************/ -static int syslog_open(log4c_appender_t* this) -{ - return 0; -} - -/*******************************************************************************/ -static int syslog_append(log4c_appender_t* this, - const log4c_logging_event_t* a_event) -{ - return 0; -} - -/*******************************************************************************/ -static int syslog_close(log4c_appender_t* this) -{ - return 0; -} -#endif - - -/*******************************************************************************/ -const log4c_appender_type_t log4c_appender_type_syslog = { - "syslog", - syslog_open, - syslog_append, - syslog_close, -}; - -/* -log4c_appender_type_define(log4c_appender_type_syslog); -*/ diff --git a/import/log4c/log4c/appender_type_syslog.h b/import/log4c/log4c/appender_type_syslog.h deleted file mode 100644 index b0846b6..0000000 --- a/import/log4c/log4c/appender_type_syslog.h +++ /dev/null @@ -1,52 +0,0 @@ -/* $Id: appender_type_syslog.h,v 1.3 2003/09/12 21:06:45 legoater Exp $ - * - * appender_type_syslog.h - * - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * - * See the COPYING file for the terms of usage and distribution. - */ - -#ifndef log4c_appender_type_syslog_h -#define log4c_appender_type_syslog_h - -/** - * @file appender_type_syslog.h - * - * @brief Log4c syslog(3) appender interface. - * - * The syslog appender uses the syslog(3) interface for logging. The log4c - * priorities are mapped to the syslog priorities and the appender name is - * used as a syslog identifier. 1 default syslog appender is defined: @c - * "syslog". - * - * The following examples shows how to define and use syslog appenders. - * - * @code - * - * log4c_appender_t* myappender; - * - * myappender = log4c_appender_get("myappender"); - * log4c_appender_set_type(myappender, &log4c_appender_type_syslog); - * - * @endcode - * - **/ - -#include -#include - -__LOG4C_BEGIN_DECLS - -/** - * Syslog appender type definition. - * - * This should be used as a parameter to the log4c_appender_set_type() - * routine to set the type of the appender. - * - **/ -extern const log4c_appender_type_t log4c_appender_type_syslog; - -__LOG4C_END_DECLS - -#endif diff --git a/import/log4c/log4c/audit_logevent.h b/import/log4c/log4c/audit_logevent.h deleted file mode 100644 index 82b06dc..0000000 --- a/import/log4c/log4c/audit_logevent.h +++ /dev/null @@ -1,499 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2005 Novell, Inc. - * All Rights Reserved. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2.1 of the GNU Lesser General Public - * License as published by the Free Software Foundation. - * - * 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, contact Novell, Inc. - * - * To contact Novell about this file by physical or electronic mail, - * you may find current contact information at www.novell.com - * - ****************************************************************************/ - -#ifndef _LOGEVENT_H_ -#define _LOGEVENT_H_ - -#ifndef BOOL -#define BOOL int -#endif -#define NAUDIT_EVENT_NETMAIL_UNSPECIFIED 0x0002ffff - -/** Wire protocol **/ -/* Port */ -#define LOGENGINE_PORT 289 -#define LOGCACHE_PORT 288 -#define LE_PROTOCOL_VERSION 1 -#define LE_CACHE_PROTOCOL_VERSION 0x0100474c - -/* Commands: */ -#define LE_CMD_EVENT 'E' -#define LE_CMD_TERMINATE 'Q' -#define LE_CMD_STARTTLS 'T' -#define LE_CMD_PERFORM_AUTH 'A' -#define LE_CMD_STOPTLS 'N' -#define LE_CMD_ADD_MONITOR 'D' -#define LE_CMD_REMOVE_MONITOR 'X' -#define LE_CMD_RESET_MONITOR 'S' -#define LE_CMD_GET_MONITORS 'M' -#define LE_CMD_WAIT_OK 'W' -#define LE_CMD_GET_CONFIG 'C' -#define LE_CMD_GET_SCHEMA 'G' - -/* Responses */ -#define LE_CMD_OK '+' -#define LE_CMD_ERR '-' -#define LE_CMD_TLS_OK '1' - -#define LE_CMD_OK_STRING "+" -#define LE_CMD_ERR_STRING "-" -#define LE_CMD_TLS_OK_STRING "1" - -/* Flags */ -#define LE_FLAG_HAVE_TEXT1 (1<<0) -#define LE_FLAG_HAVE_TEXT2 (1<<1) -#define LE_FLAG_HAVE_DATA (1<<4) -#define LE_FLAG_SYNCHRONOUS (1<<5) - -#define MAX_LOGEVENT_COMPONENT_SIZE 255 -#define MAX_LOGEVENT_TEXT1_SIZE 255 -#define MAX_LOGEVENT_TEXT2_SIZE 255 -#define MAX_LOGEVENT_DATA_SIZE 3072 - -typedef struct -{ - unsigned long Command; - unsigned long PayloadSize; -} CmdRequestStruct; - -typedef struct _EventStruct -{ - unsigned long Flags; - unsigned long ComponentSize; - unsigned long Text1Size; - unsigned long Text2Size; - unsigned long DataSize; - unsigned long ClientTimestamp; - unsigned long ClientMilliSeconds; - unsigned long ID; - unsigned long Severity; - unsigned long GroupID; - unsigned long Value1; - unsigned long Value2; - unsigned long MIMEHint; - unsigned char Buffer[MAX_LOGEVENT_COMPONENT_SIZE + - MAX_LOGEVENT_TEXT1_SIZE + MAX_LOGEVENT_TEXT2_SIZE + - MAX_LOGEVENT_DATA_SIZE]; - unsigned long ServerTimestamp; - unsigned long SourceIP; - unsigned char *Description; - unsigned char *Component; - unsigned char *Text1; - unsigned char *Text2; - unsigned char *Data; - struct _EventStruct *Next; -} EventStruct; - -#define STATIC_EVENT_PART_SIZE (sizeof(Event->Flags)+sizeof(Event->ComponentSize)+sizeof(Event->Text1Size)+sizeof(Event->Text2Size)+sizeof(Event->DataSize)+sizeof(Event->ClientTimestamp)+sizeof(Event->ID)+sizeof(Event->Severity)+sizeof(Event->Value1)+sizeof(Event->Value2)+sizeof(Event->MIMEHint)) - -typedef struct -{ - unsigned long EventID; - unsigned long Count; -} MonitorListStruct; - -/** Schema **/ -/* Classes */ -#define NAUDIT_C_ROOT "NAuditServices" -#define NAUDIT_C_SERVER "NAuditServer" -#define NAUDIT_C_CHANNEL_CONTAINER "NAuditChannelContainer" -#define NAUDIT_C_LOGAPP_CONTAINER "NAuditLogAppContainer" -#define NAUDIT_C_FILTER_CONTAINER "NAuditFilterContainer" -#define NAUDIT_C_CHANNEL "NAuditChannel" -#define NAUDIT_C_FILTER "NAuditFilter" -#define NAUDIT_C_HEARTBEAT "NAuditHeartbeat" -#define NAUDIT_C_LOGGING_APPLICATION "NAuditLogApp" -#define NAUDIT_C_MYSQL_CHANNEL "NAuditMySQL" -#define NAUDIT_C_FILE_CHANNEL "NAuditFile" -#define NAUDIT_C_ORACLE_CHANNEL "NAuditOracle" -#define NAUDIT_C_SYSLOG_CHANNEL "NAuditSyslog" -#define NAUDIT_C_SMTP_CHANNEL "NAuditSMTP" -#define NAUDIT_C_JAVA_CHANNEL "NAuditJava" -#define NAUDIT_C_CVR_CHANNEL "NAuditCVR" -#define NAUDIT_C_SNMP_CHANNEL "NAuditSNMP" - -/* Names */ -#define NAUDIT_N_ROOT "Logging Services" - -#define NAUDIT_N_CHANNEL_CONTAINER "Channels" -#define NAUDIT_N_FILTER_CONTAINER "Notifications" -#define NAUDIT_N_LOGAPP_CONTAINER "Applications" - -#define NAUDIT_N_FILE_DRIVER "File" -#define NAUDIT_N_FILE_DRIVER_BINARY "lgdfile" - -#define NAUDIT_N_MYSQL_DRIVER "MySQL" -#define NAUDIT_N_MYSQL_DRIVER_BINARY "lgdmsql" - -#define NAUDIT_N_ORACLE_DRIVER "Oracle" -#define NAUDIT_N_ORACLE_DRIVER_BINARY "lgdora" - -#define NAUDIT_N_SMTP_DRIVER "SMTP" -#define NAUDIT_N_SMTP_DRIVER_BINARY "lgdsmtp" - -#define NAUDIT_N_SNMP_DRIVER "SNMP" -#define NAUDIT_N_SNMP_DRIVER_BINARY "lgdsnmp" - -#define NAUDIT_N_SYSLOG_DRIVER "Syslog" -#define NAUDIT_N_SYSLOG_DRIVER_BINARY "lgdsyslg" - -#define NAUDIT_N_CVR_DRIVER "Critical Value Reset" -#define NAUDIT_N_CVR_DRIVER_BINARY "lgdcvr" - -#define NAUDIT_N_JAVA_DRIVER "Java Interface" -#define NAUDIT_N_JAVA_DRIVER_BINARY "lgdjava" - -/* eDir instrumentation driver */ -#define NAUDIT_N_EDIR_INSTRUMENTATION "eDirectory Instrumentation" -#define NAUDIT_N_EDIR_APPNAME "eDirInst" -#define NAUDIT_N_EDIR_APPID "000B" - -/* NetWare instrumentation driver */ -#define NAUDIT_N_NW_INSTRUMENTATION "NetWare Instrumentation" -#define NAUDIT_N_NW_APPNAME "NetWareInst" -#define NAUDIT_N_NW_APPID "000A" - -/* Attributes */ -/* Host */ -#define NAUDIT_A_LOGGING_SERVER "NAuditLoggingServer" - -/* Common */ -#define NAUDIT_A_CONFIGURATION "NAuditConfiguration" -#define NAUDIT_A_INSTRUMENTATION "NAuditInstrumentation" -#define NAUDIT_A_DISABLED "NAuditDisabled" -#define NAUDIT_A_CONFIG_VERSION "NAuditConfigVersion" - -/* Log Server */ -#define NAUDIT_A_HOST "NAuditHost" -#define NAUDIT_A_IDENTIFIER "NAuditIdentifier" -#define NAUDIT_A_EVENTCACHE_MIN "NAuditEventCacheMin" -#define NAUDIT_A_EVENTCACHE_NORMAL "NAuditEventCacheNormal" -#define NAUDIT_A_EVENTCACHE_MAX "NAuditEventCacheMax" -#define NAUDIT_A_EVENTCACHE_RETRIES "NAuditEventCacheRetries" -#define NAUDIT_A_EVENTCACHE_DELAY "NAuditEventCacheDelay" -#define NAUDIT_A_EVENTCACHE_BLOCKDELAY "NAuditEventCacheBlockDelay" -#define NAUDIT_A_CHANNEL "NAuditChannel" -#define NAUDIT_A_DRIVER_DIRECTORY "NAuditDriverDirectory" -#define NAUDIT_A_SNMP_DESCRIPTION "NAuditSNMPDescription" -#define NAUDIT_A_SNMP_ORGANIZATION "NAuditSNMPOrganization" -#define NAUDIT_A_SNMP_LOCATION "NAuditSNMPLocation" -#define NAUDIT_A_SNMP_CONTACT "NAuditSNMPContact" -#define NAUDIT_A_SNMP_NAME "NAuditSNMPName" -#define NAUDIT_A_NLS_DIRECTORY "NAuditNLSDirectory" -#define NAUDIT_A_BIN_DIRECTORY "NAuditBinDirectory" -#define NAUDIT_A_TMP_DIRECTORY "NAuditTmpDirectory" -#define NAUDIT_A_APPCONTAINERS "NAuditAppContainers" -#define NAUDIT_A_CHANNELCONTAINERS "NAuditChannelContainers" -#define NAUDIT_A_FILTERCONTAINERS "NAuditFilterContainers" -#define NAUDIT_A_ANONYMOUS "NAuditAnonymousPassword" -#define NAUDIT_A_CERTIFICATE "NAuditCertificate" -#define NAUDIT_A_PRIVATEKEY "NAuditPrivateKey" - -/* Log channel */ -#define NAUDIT_A_DRIVER_NAME "NAuditDriverName" -#define NAUDIT_A_DRIVER_ARGUMENTS "NAuditDriverArguments" -#define NAUDIT_A_DRIVER_STATUS "NAuditDriverStatus" -#define NAUDIT_A_EXPIRE_CONFIG "NAuditExpireConfig" - -/* Logging application / Logging cache */ -#define NAUDIT_A_APPNAME "NAuditAppName" -#define NAUDIT_A_APPID "NAuditAppID" -#define NAUDIT_A_APP_SCHEMA_BASE "NAuditAppSchema" -#define NAUDIT_A_APP_SCHEMA_EN "NAuditAppSchemaEn" -#define NAUDIT_A_APP_SCHEMA_PT "NAuditAppSchemaPt" -#define NAUDIT_A_APP_SCHEMA_FR "NAuditAppSchemaFr" -#define NAUDIT_A_APP_SCHEMA_IT "NAuditAppSchemaIt" -#define NAUDIT_A_APP_SCHEMA_DE "NAuditAppSchemaDe" -#define NAUDIT_A_APP_SCHEMA_ES "NAuditAppSchemaEs" -#define NAUDIT_A_APP_SCHEMA_RU "NAuditAppSchemaRu" - -#define NAUDIT_A_CREDENTIALS "NAuditCredentials" -#define NAUDIT_A_CACHE_DIR "NAuditCacheDirectory" -#define NAUDIT_A_CACHE_PORT "NAuditCachePort" -#define NAUDIT_A_CACHE_RECONNECT_INTERVAL "NAuditCacheReconnectInterval" -#define NAUDIT_A_CACHE_SECURE "NAuditCacheSecure" -#define NAUDIT_A_RESMON_METHOD "NAuditResMonMethod" -#define NAUDIT_A_RESMON_HOST "NAuditResMonHost" -#define NAUDIT_A_RESMON_FROM "NAuditResMonFrom" -#define NAUDIT_A_RESMON_TO "NAuditResMonTo" -#define NAUDIT_A_RESMON_SUBJECT "NAuditResMonSubject" -#define NAUDIT_A_RESMON_ID "NAuditResMonID" -#define NAUDIT_A_RESMON_BODY "NAuditResMonBody" -#define NAUDIT_A_MONITOR_READ "NAuditMonitorRead" -#define NAUDIT_A_MONITOR_CONTROL "NAuditMonitorControl" -#define NAUDIT_A_NOTIFY_CONTROL "NAuditNotifyControl" - -/* Log Filter */ -#define NAUDIT_A_FILTER "NAuditFilter" -/*#define NAUDIT_A_CHANNEL "NAuditChannel"*/ - -/* File driver */ -#define NAUDIT_A_FILE_LOGDIR "NAuditFileLogDir" -#define NAUDIT_A_FILE_MAX_AGE "NAuditFileMaxAge" -#define NAUDIT_A_FILE_MAX_SIZE "NAuditFileMaxSize" - -/* MySQL driver */ -#define NAUDIT_A_MYSQL_HOST "NAuditSQLHost" -#define NAUDIT_A_MYSQL_USER "NAuditSQLUser" -#define NAUDIT_A_MYSQL_PASSWORD "NAuditSQLPassword" -#define NAUDIT_A_MYSQL_DATABASE "NAuditSQLDatabase" -#define NAUDIT_A_MYSQL_TABLE "NAuditSQLTable" -#define NAUDIT_A_MYSQL_CREATE_SQL "NAuditSQLCreateSQL" -#define NAUDIT_A_MYSQL_EXPIRE_SQL "NAuditSQLExpireSQL" - -/* Oracle driver */ -#define NAUDIT_A_ORACLE_HOST NAUDIT_A_MYSQL_HOST -#define NAUDIT_A_ORACLE_USER NAUDIT_A_MYSQL_USER -#define NAUDIT_A_ORACLE_PASSWORD NAUDIT_A_MYSQL_PASSWORD -#define NAUDIT_A_ORACLE_DATABASE NAUDIT_A_MYSQL_DATABASE -#define NAUDIT_A_ORACLE_TABLE NAUDIT_A_MYSQL_TABLE -#define NAUDIT_A_ORACLE_CREATE_SQL NAUDIT_A_MYSQL_CREATE_SQL -#define NAUDIT_A_ORACLE_EXPIRE_SQL NAUDIT_A_MYSQL_EXPIRE_SQL - -/* SMTP driver */ -#define NAUDIT_A_SMTP_OPTIONS "NAuditSMTPOptions" -#define NAUDIT_A_SMTP_HOST "NAuditSMTPHost" -#define NAUDIT_A_SMTP_USER "NAuditSMTPUser" -#define NAUDIT_A_SMTP_PASSWORD "NAuditSMTPPassword" -#define NAUDIT_A_SMTP_SENDER "NAuditSMTPSender" -#define NAUDIT_A_SMTP_RECIPIENT "NAuditSMTPRecipient" -#define NAUDIT_A_SMTP_SUBJECT "NAuditSMTPSubject" -#define NAUDIT_A_SMTP_MESSAGE "NAuditSMTPMessage" - -/* Syslog driver */ -#define NAUDIT_A_SYSLOG_FACILITY "NAuditSyslogFacility" - -/* Critical Value Reset driver */ -#define NAUDIT_A_CVR_OBJECT "NAuditCVRObject" -#define NAUDIT_A_CVR_CREDENTIALS "NAuditCVRCredentials" -#define NAUDIT_A_CVR_RESETLIST "NAuditCVRResetList" - -/* Java driver */ -#define NAUDIT_A_JAVA_PATH "NAuditJavaPath" -#define NAUDIT_A_JAVA_DRIVER "NAuditJavaDriver" - -/* SNMP driver */ -#define NAUDIT_A_SNMP_TARGET "NAuditSNMPTarget" -#define NAUDIT_A_SNMP_TRAPOID "NAuditSNMPTrapOID" -#define NAUDIT_A_SNMP_MESSAGE "NAuditSNMPMessage" -#define NAUDIT_A_SNMP_COMMUNITY "NAuditSNMPCommunity" - - -/** Server API **/ - -/* Log drivers */ -typedef struct -{ - void *AuthHandle; - unsigned char ConfigObject[1024]; - unsigned char ErrorText[256]; - void *DriverData; -} DriverInitStruct; - - -typedef BOOL (*DriverInitFunc) (DriverInitStruct * LDI); -typedef BOOL (*DriverShutdownFunc) (void *DriverData); -typedef BOOL (*DriverProcessEventFunc) (EventStruct * Event, - void *DriverData); - - -/** Client API **/ - -#ifndef LOGEVENT_INTERNAL -typedef void *LOGHANDLE; -#endif - -#define LE_EMERGENCY 1 -#define LE_ALERT 2 -#define LE_CRITICAL 3 -#define LE_ERROR 4 -#define LE_WARNING 5 -#define LE_NOTICE 6 -#define LE_INFO 7 -#define LE_DEBUG 8 - -/* Compatibility to syslog; assumes we're included after syslog */ -#if !defined(LOG_ERR) -#define LOG_EMERG 1 -#define LOG_EMERGENCY 1 -#define LOG_ALERT 2 -#define LOG_CRIT 3 -#define LOG_CRITICAL 3 -#define LOG_ERR 4 -#define LOG_ERROR 4 -#define LOG_WARN 5 -#define LOG_WARNING 5 -#define LOG_NOTICE 6 -#define LOG_INFO 7 -#define LOG_DEBUG 8 -#endif - -/* LogOpen API Flags */ -#define LE_NO_BLOCKING (1<<0) -#define LE_NO_CACHING (1<<1) -#define LE_FILE_CREDENTIALS (1<<2) -#define LE_PASSWORD_CREDENTIALS (1<<3) -#define LE_ASN1_CREDENTIALS (1<<4) -#define LE_SIGNED_CHAIN (1<<5) -#define LE_TRUNCATE_OVERSIZED (1<<6) - -typedef struct -{ - unsigned char *Data; - unsigned long Size; -} LogOpenASN1Struct; - -/* LogEvent API Flags */ -#define LE_SYNCHRONOUS (1<<0) -#define LE_CONSOLE (1<<1) - -/* Error codes */ -#define LE_ERR_STRING_TOO_LONG 1 -#define LE_ERR_DATA_TOO_LARGE 2 -#define LE_ERR_COMPONENT_TOO_LONG 3 -#define LE_ERR_WRONG_SERVER_VERSION 4 -#define LE_ERR_BAD_SERVER_CREDENTIALS 5 -#define LE_ERR_COMMUNICATION_ERROR 6 -#define LE_ERR_BUFFER_TOO_SMALL 7 -#define LE_ERR_NOT_ENOUGH_MEMORY 8 -#define LE_ERR_LOGSERVER_OFFLINE 9 -#define LE_ERR_BAD_INSTANCE 10 -#define LE_ERR_NOT_LOGGED_COMM_ERR 11 -#define LE_ERR_NOT_LOGGED_REMOTE_ERR 12 -#define LE_ERR_LOGGED_TO_CACHE 13 -#define LE_ERR_CANNOT_LOAD_CERTIFICATE 14 -#define LE_ERR_CANNOT_LOAD_PRIVATEKEY 15 -#define LE_ERR_INVALID_CERTIFICATE 16 -#define LE_ERR_INVALID_PRIVATEKEY 17 -#define LE_ERR_FAILED_TLS_SWITCH 18 -#define LE_ERR_FAILED_SSL_INIT 19 -#define LE_ERR_FAILED_SSL_HANDSHAKE 20 - -/* Special Application ID macros */ -#define MARK_TRANSIENT(AppID) (AppID | 0x80000000) - -/* MIME Types - most common */ -#define MIME_UNKNOWN 0 -#define MIME_TEXT_PLAIN 1 -#define MIME_TEXT_HTML 2 -#define MIME_TEXT_XML 3 -#define MIME_APPLICATION_OCTET_STREAM 4 - -/* MIME Types - non vnd. */ -#define MIME_TEXT_RICHTEXT 100 -#define MIME_TEXT_ENRICHED 101 -#define MIME_TEXT_TAB_SEPARATED_VALUES 102 -#define MIME_TEXT_SGML 103 -#define MIME_TEXT_XML_EXTERNAL_PARSED_ENTITY 104 -#define MIME_TEXT_RTF 105 -#define MIME_TEXT_T140 106 -#define MIME_TEXT_DIRECTORY 107 -#define MIME_TEXT_CALENDAR 108 -#define MIME_MESSAGE_RFC822 200 -#define MIME_MESSAGE_PARTIAL 201 -#define MIME_MESSAGE_EXTERNAL_BODY 202 -#define MIME_MESSAGE_NEWS 203 -#define MIME_MESSAGE_HTTP 204 -#define MIME_MESSAGE_DELIVERY_STATUS 205 -#define MIME_MESSAGE_DISPOSITION_NOTIFICATION 206 -#define MIME_MESSAGE_S_HTTP 207 -#define MIME_APPLICATION_POSTSCRIPT 300 -#define MIME_APPLICATION_MSWORD 301 -#define MIME_APPLICATION_PDF 302 -#define MIME_APPLICATION_ZIP 303 -#define MIME_APPLICATION_SGML 304 -#define MIME_APPLICATION_PGP_KEYS 305 -#define MIME_IMAGE_JPEG 400 -#define MIME_IMAGE_GIF 401 -#define MIME_IMAGE_TIFF 402 -#define MIME_IMAGE_G3FAX 403 -#define MIME_IMAGE_CGM 404 -#define MIME_IMAGE_PNG 405 -#define MIME_AUDIO_BASIC 500 -#define MIME_AUDIO_MPEG 501 -#define MIME_AUDIO_32KADPCM 502 -#define MIME_AUDIO_L16 503 -#define MIME_AUDIO_TONE 504 -#define MIME_AUDIO_PARITYFEC 505 -#define MIME_AUDIO_MP4A_LATM 506 -#define MIME_AUDIO_G_722_1 507 -#define MIME_AUDIO_MPA_ROBUST 508 -#define MIME_AUDIO_L20 509 -#define MIME_AUDIO_L24 510 -#define MIME_VIDEO_MPEG 600 -#define MIME_VIDEO_QUICKTIME 601 -#define MIME_VIDEO_POINTER 602 -#define MIME_VIDEO_PARITYFEC 603 - -/* MIME Types - X- */ -#define MIME_APPLICATION_X_NETADDRESS 30000 - - - -/* "Fake" prototypes - macros */ -#define LogEventText(Handle, Component, LogID, LogLevel, Flags, Name1, Name2) LogEventDirect(Handle, Component, LogID, LogLevel, 0, Flags, Name1, Name2, 0, 0, 0, 0, NULL) -#define LogEventNameValue(Handle, Component, LogID, LogLevel, Flags, Name, Value) LogEventDirect(Handle, Component, LogID, LogLevel, 0, Flags, Name, NULL, Value, 0, 0, 0, NULL) -#define LogEventLong(Handle, Component, LogID, LogLevel, Flags, Value1, Value2) LogEventDirect(Handle, Component, LogID, LogLevel, 0, Flags, NULL, NULL, Value1, Value2, 0, 0, NULL) -#define LogEventRaw(Handle, Component, LogID, LogLevel, Flags, MIMEHint, Size, Data) LogEventDirect(Handle, Component, LogID, LogLevel, 0, Flags, NULL, NULL, 0, 0, MIMEHint, Size, Data) - -/* Fun with macros */ -#if defined(WIN32) -# define LEEXPORT(Ret) __declspec(dllexport) Ret __stdcall -#else -# define LEEXPORT(Ret) Ret -#endif - -/* Prototypes */ -LEEXPORT (LOGHANDLE) LogOpen (unsigned char *Cert, unsigned char *PKey, - unsigned long Flags, unsigned long *Error); -LEEXPORT (LOGHANDLE) LogOpenSimple (unsigned char *AppName, - unsigned char *Password, - unsigned long Flags, - unsigned long *Error); -LEEXPORT (void) -LogClose (LOGHANDLE Handle); -LEEXPORT (unsigned long) -LogGetError (LOGHANDLE Handle); - -/* Logevent replaces "syslog()" */ -LEEXPORT (BOOL) LogEvent (LOGHANDLE Handle, unsigned char *Component, - unsigned long ID, unsigned long Level, - unsigned long Flags, unsigned char *Message, ...); - -/* Fastest */ -LEEXPORT (BOOL) LogEventDirect (LOGHANDLE Handle, unsigned char *Component, - unsigned long ID, unsigned long Level, - unsigned long Grouping, unsigned long Flags, - unsigned char *Text1, unsigned char *Text2, - unsigned long Value1, unsigned long Value2, - unsigned long MIMEHint, - unsigned long DataSize, void *Data); - -/* "Advanced" API */ -LEEXPORT (BOOL) LogAddMonitor (LOGHANDLE Handle, unsigned long EventID); -LEEXPORT (BOOL) LogRemoveMonitor (LOGHANDLE Handle, unsigned long EventID); -LEEXPORT (BOOL) LogRemoveMonitorList (LOGHANDLE Handle); -LEEXPORT (BOOL) LogRequestMonitors (LOGHANDLE Handle, - unsigned long *ListCount, - MonitorListStruct * MonitorList); - -#endif /* _LOGEVENT_H_ */ diff --git a/import/log4c/log4c/buffer.h b/import/log4c/log4c/buffer.h deleted file mode 100644 index 8d4cab0..0000000 --- a/import/log4c/log4c/buffer.h +++ /dev/null @@ -1,45 +0,0 @@ -/* $Id$ - * - * buffer.h - * - * See the COPYING file for the terms of usage and distribution. - */ - -#ifndef __log4c_buffer_h -#define __log4c_buffer_h - -/** - * @file buffer.h - * - * @brief log4c buffer - * - **/ - -#include -#include - -__LOG4C_BEGIN_DECLS - -/** - * @brief buffer object - * - * Attributes description: - * - * @li @c size current size of the buffer - * @li @c maxsize maximum size of the buffer. 0 means no limitation. - * @li @c data raw data - **/ -typedef struct -{ - size_t buf_size; - size_t buf_maxsize; - char* buf_data; - -} log4c_buffer_t; - -#define LOG4C_BUFFER_SIZE_DEFAULT 512 - - -__LOG4C_END_DECLS - -#endif diff --git a/import/log4c/log4c/category.c b/import/log4c/log4c/category.c deleted file mode 100644 index d267d8a..0000000 --- a/import/log4c/log4c/category.c +++ /dev/null @@ -1,350 +0,0 @@ -static const char version[] = "$Id: category.c,v 1.9 2005/12/15 19:39:51 legoater Exp $"; - -/* - * category.c - * - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * - * See the COPYING file for the terms of usage and distribution. - */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include -#ifndef va_copy -#define va_copy __va_copy -#endif -#ifdef HAVE_ALLOCA_H -#include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -struct __log4c_category { - char* cat_name; - int cat_priority; - int cat_additive; - const log4c_category_t* cat_parent; - log4c_appender_t* cat_appender; -}; - -sd_factory_t* log4c_category_factory = NULL; - -static const char LOG4C_CATEGORY_DEFAULT[] = "root"; - - -/** - * @bug the root category name should be "" not "root". * - */ - -/*******************************************************************************/ -extern log4c_category_t* log4c_category_get(const char* a_name) -{ - static const sd_factory_ops_t log4c_category_factory_ops = { - (void*) log4c_category_new, - (void*) log4c_category_delete, - (void*) log4c_category_print, - }; - - if (!log4c_category_factory) { - log4c_category_factory = sd_factory_new("log4c_category_factory", - &log4c_category_factory_ops); - } - - return sd_factory_get(log4c_category_factory, a_name); -} - -/*******************************************************************************/ -extern int log4c_category_list(log4c_category_t** a_cats, int a_ncats) -{ - return sd_factory_list(log4c_category_factory, (void**) a_cats, a_ncats); -} - -/*******************************************************************************/ -static const char* dot_dirname(char* a_string); - -extern log4c_category_t* log4c_category_new(const char* a_name) -{ - log4c_category_t* this; - - if (!a_name) - return NULL; - - this = sd_calloc(1, sizeof(log4c_category_t)); - this->cat_name = sd_strdup(a_name); - this->cat_priority = LOG4C_PRIORITY_NOTSET; - this->cat_additive = 1; - this->cat_appender = NULL; - this->cat_parent = NULL; - - /* skip root category because it has a NULL parent */ - if (strcmp(LOG4C_CATEGORY_DEFAULT, a_name)) { - char* tmp = sd_strdup(this->cat_name); - - this->cat_parent = log4c_category_get(dot_dirname(tmp)); - free(tmp); - } - return this; -} - -/*******************************************************************************/ -extern void log4c_category_delete(log4c_category_t* this) -{ - if (!this) - return; - - free(this->cat_name); - free(this); -} - -/*******************************************************************************/ -extern const char* log4c_category_get_name(const log4c_category_t* this) -{ - return (this ? this->cat_name : "(nil)"); -} - -/*******************************************************************************/ -extern int log4c_category_get_priority(const log4c_category_t* this) -{ - return (this ? this->cat_priority : LOG4C_PRIORITY_UNKNOWN); -} - -/*******************************************************************************/ -extern int log4c_category_get_chainedpriority(const log4c_category_t* this) -{ - const log4c_category_t* cat = this; - - if (!this) - return LOG4C_PRIORITY_UNKNOWN; - - while (cat->cat_priority == LOG4C_PRIORITY_NOTSET && cat->cat_parent) - cat = cat->cat_parent; - - return cat->cat_priority; -} - -/*******************************************************************************/ -extern const log4c_appender_t* log4c_category_get_appender(const log4c_category_t* this) -{ - return (this ? this->cat_appender : NULL); -} - -/*******************************************************************************/ -extern int log4c_category_get_additivity(const log4c_category_t* this) -{ - return (this ? this->cat_additive : -1); -} - -/*******************************************************************************/ -extern int log4c_category_set_priority(log4c_category_t* this, int a_priority) -{ - int previous; - - if (!this) - return LOG4C_PRIORITY_UNKNOWN; - - previous = this->cat_priority; - this->cat_priority = a_priority; - return previous; -} - -/** - * @todo need multiple appenders per category - */ - -/*******************************************************************************/ -extern const log4c_appender_t* log4c_category_set_appender( - log4c_category_t* this, - log4c_appender_t* a_appender) -{ - log4c_appender_t* previous; - - if (!this) - return NULL; - - previous = this->cat_appender; - this->cat_appender = a_appender; - return previous; -} - -/*******************************************************************************/ -extern int log4c_category_set_additivity(log4c_category_t* this, int a_additivity) -{ - int previous; - - if (!this) - return -1; - - previous = this->cat_additive; - this->cat_additive = a_additivity; - return previous; -} - -/*******************************************************************************/ -extern void log4c_category_print(const log4c_category_t* this, FILE* a_stream) -{ - if (!this) - return; - - fprintf(a_stream, "{ name:'%s' priority:%s additive:%d appender:'%s' parent:'%s' }", - this->cat_name, - log4c_priority_to_string(this->cat_priority), - this->cat_additive, - log4c_appender_get_name(this->cat_appender), - log4c_category_get_name(this->cat_parent) - ); -} - -/*******************************************************************************/ -extern void __log4c_category_vlog(const log4c_category_t* this, - const log4c_location_info_t* a_locinfo, - int id, - int a_priority, - const char* a_format, - va_list a_args) -{ - char* message; - log4c_logging_event_t evt; - const log4c_category_t* cat; - int yes = 0; - va_list audit_args; - unsigned int i = 0; - int audit_escape = 0; - char audit_format = '\0'; - int audit_d1 = 0; - int audit_d2 = 0; - char* audit_s1 = NULL; - char* audit_s2 = NULL; - if (!this) { - return; - } - - /* check if an appender is defined in the category hierarchy */ - for (cat = this; cat; cat = cat->cat_parent) { - if (cat->cat_appender) { - yes++; - } - } - - if (!yes) { - return; - } - - - /* when there is no limit on the buffer size, we use malloc() to - * give the user the possiblity to reallocate if necessary. When - * the buffer is limited in size, we use alloca() for more - * efficiency. - */ - evt.evt_buffer.buf_maxsize = log4c_rc->config.bufsize; - - if (!strcmp(log4c_appender_get_name(this->cat_appender), "audit")) { - /* parse through and grab two strings, two ints from the args */ - /* audit_format = malloc((strlen(a_format)+1)*sizeof(*audit_format));*/ -#ifdef HAVE_LIBLOGEVENT - va_copy (audit_args, a_args); - for(i = 0; i < strlen(a_format); i++) { - audit_format = a_format[i * sizeof(*a_format)]; - if(audit_escape) { - switch(audit_format) { - case 's': - if(audit_s1) { - audit_s2 = va_arg(audit_args, char*); - } else { - audit_s1 = va_arg(audit_args, char*); - } - break; - case 'd': - if(audit_d1) { - audit_d2 = va_arg(audit_args, int); - } else { - audit_d1 = va_arg(audit_args, int); - } - break; - } - audit_escape = 0; - } else { - audit_escape = (audit_format == '%') ? 1 : 0; - } - } - evt.evt_audit_id = id; - evt.evt_audit_s1 = audit_s1; - evt.evt_audit_s2 = audit_s2; - evt.evt_audit_d1 = audit_d1; - evt.evt_audit_d2 = audit_d2; - va_end(audit_args); -#endif - } else { - evt.evt_audit_id = 0; - evt.evt_audit_s1 = NULL; - evt.evt_audit_s2 = NULL; - evt.evt_audit_d1 = 0; - evt.evt_audit_d2 = 0; - } - - if (!evt.evt_buffer.buf_maxsize) { - evt.evt_buffer.buf_size = LOG4C_BUFFER_SIZE_DEFAULT; - evt.evt_buffer.buf_data = sd_malloc(evt.evt_buffer.buf_size); - message = sd_vsprintf(a_format, a_args); - } else { - int n; - - evt.evt_buffer.buf_size = evt.evt_buffer.buf_maxsize; - evt.evt_buffer.buf_data = alloca(evt.evt_buffer.buf_size); - message = alloca(evt.evt_buffer.buf_size); - - if ( (n = vsnprintf(message, evt.evt_buffer.buf_size, a_format, a_args)) - >= (int)evt.evt_buffer.buf_size) { - sd_error("truncating message of %d bytes (bufsize = %d)", n, - evt.evt_buffer.buf_size); - } - } - - evt.evt_category = this->cat_name; - evt.evt_priority = a_priority; - evt.evt_msg = message; - evt.evt_loc = a_locinfo; - SD_GETTIMEOFDAY(&evt.evt_timestamp, NULL); - - for (cat = this; cat; cat = cat->cat_parent) { - if (cat->cat_appender) - log4c_appender_append(cat->cat_appender, &evt); - - if (!cat->cat_additive) break; - } - - if (!evt.evt_buffer.buf_maxsize) { - free(message); - free(evt.evt_buffer.buf_data); - } - - return; -} - -/*******************************************************************************/ -static const char* dot_dirname(char* a_string) -{ - char* p; - - if (!a_string) - return NULL; - - if ( (p = strrchr(a_string, '.')) == NULL) - return LOG4C_CATEGORY_DEFAULT; - - *p = '\0'; - return a_string; -} - diff --git a/import/log4c/log4c/category.h b/import/log4c/log4c/category.h deleted file mode 100644 index 25a1e1d..0000000 --- a/import/log4c/log4c/category.h +++ /dev/null @@ -1,587 +0,0 @@ -/* $Id: category.h,v 1.5 2005/12/15 19:39:51 legoater Exp $ - * - * category.h - * - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * - * See the COPYING file for the terms of usage and distribution. - */ - -#ifndef log4c_category_h -#define log4c_category_h - -/** - * @file category.h - * - * @brief central class in the log4c package. - * - * One of the distintive features of log4j (and hence log4c) are - * hierarchical categories and their evaluation. - * - **/ - -#include -#include -#include -#include -#include - -__LOG4C_BEGIN_DECLS - -struct __log4c_appender; -struct __log4c_category; - -/** - * log4c category class - **/ -typedef struct __log4c_category log4c_category_t; - -/** - * Instantiate a log4c_category_t with name @a name. This method - * does not set priority of the category which is by default @c - * LOG4C_PRIORITY_NOTSET. - * - * @param a_name The name of the category to retrieve. - **/ -LOG4C_API log4c_category_t* log4c_category_get(const char* a_name); - -/** - * Fill in an array with the log4c categories. - * - * @param a_cats array of categories that will be filled - * @param a_name number of categories in the array - * - * @returns -1 if it fails or the number of available categories in - * log4c. - **/ -LOG4C_API int log4c_category_list(log4c_category_t** a_cats, int a_ncats); - -/** - * Constructor for a log4c_category_t. - * - * @param a_name the category name - * @returns a log4c_category object - * @warning this method should not be called directly. You should use the - * log4c_category_get() method in order to preserve the categories - * hierarchy. - **/ -LOG4C_API log4c_category_t* log4c_category_new(const char* a_name); - -/** - * Destructor for a log4c_category_t. - * - * @param a_category the log4c_category_t object - **/ -LOG4C_API void log4c_category_delete(log4c_category_t* a_category); - -/** - * Return the category name. - * @param a_category the log4c_category_t object - * @returns the category name. - */ -LOG4C_API const char* log4c_category_get_name(const log4c_category_t* a_category); - -/** - * Returns the Appender for this log4c_category_t, or NULL if no Appender has - * been set. - * @param a_category the log4c_category_t object - * @returns The Appender. - **/ -LOG4C_API const struct __log4c_appender* log4c_category_get_appender( - const log4c_category_t* a_category); - -/** - * Get the additivity flag for this log4c_category_t.. - * - * @param a_category the log4c_category_t object - * @return the category additivity - **/ -LOG4C_API int log4c_category_get_additivity(const log4c_category_t* a_category); - -/** - * Returns the assigned Priority, if any, for this log4c_category_t. - * @param a_category the log4c_category_t object - * @return Priority - the assigned Priority, can be LOG4C_PRIORITY_NOTSET - **/ -LOG4C_API int log4c_category_get_priority(const log4c_category_t* a_category); - -/** - * Starting from this category, search the category hierarchy for a set - * priority and return it. Otherwise, return the priority of the root - * category. - * - * @param a_category the log4c_category_t object - * - * @todo the log4c_category_t is designed so that this method executes as - * quickly as possible. It could even be faster if the set priority was - * propagated through the children hierarchy of a category. - **/ -LOG4C_API int log4c_category_get_chainedpriority(const log4c_category_t* a_category); - -/** - * Sets a new appender for this category. - * - * @param a_category the log4c_category_t object - * @param a_appender the new category appender - * @return the previous category appender - **/ -LOG4C_API const struct __log4c_appender* log4c_category_set_appender( - log4c_category_t* a_category, - struct __log4c_appender* a_appender); -/** - * Sets a new priority of this category. - * - * @param a_category the log4c_category_t object - * @param a_priority the new priority to set. Use LOG4C_PRIORITY_NOTSET to - * let the category use its parents priority as effective priority. - * @return the previous category priority - **/ -LOG4C_API int log4c_category_set_priority(log4c_category_t* a_category, - int a_priority); - -/** - * Sets a new additivity flag for this category. - * - * @param a_category the log4c_category_t object - * @param a_additivity the new category additivity - * @return the previous category additivity - **/ -LOG4C_API int log4c_category_set_additivity(log4c_category_t* a_category, - int a_additivity); -/** - * prints the log4c_category_t object on a stream - * - * @param a_category the log4c_category_t object - * @param a_stream The stream - **/ -LOG4C_API void log4c_category_print(const log4c_category_t* a_category, FILE* a_stream); - -/** - * Returns true if the chained priority of the log4c_category_t is equal to - * or higher than given priority. - * @param a_category the log4c_category_t object - * @param a_priority The priority to compare with. - * @returns whether logging is enable for this priority. - **/ -#ifndef _WIN32 -static inline int log4c_category_is_priority_enabled(const log4c_category_t* a_category, - int a_priority) -{ - return log4c_category_get_chainedpriority(a_category) >= a_priority; -} -#else -#define log4c_category_is_priority_enabled(a,b) \ - (log4c_category_get_chainedpriority(a) >= b) -#endif - -/** - * Return true if the category will log messages with priority @c - * LOG4C_PRIORITY_FATAL. - * - * @param a_category the log4c_category_t object - * @returns Whether the category will log. - **/ -#ifndef _WIN32 -static inline int log4c_category_is_fatal_enabled(const log4c_category_t* a_category) -{ - return log4c_category_is_priority_enabled(a_category, LOG4C_PRIORITY_FATAL); -} -#else -#define log4c_category_is_fatal_enabled(a) \ - (log4c_category_is_priority_enabled(a,LOG4C_PRIORITY_FATAL)) -#endif - -/** - * Return true if the category will log messages with priority @c - * LOG4C_PRIORITY_ALERT. - * - * @param a_category the log4c_category_t object - * @returns Whether the category will log. - **/ -#ifndef _WIN32 -static inline int log4c_category_is_alert_enabled(const log4c_category_t* a_category) -{ - return log4c_category_is_priority_enabled(a_category, LOG4C_PRIORITY_ALERT); -} -#else -#define log4c_category_is_alert_enabled(a) \ - (log4c_category_is_priority_enabled(a,LOG4C_PRIORITY_ALERT)) -#endif - -/** - * Return true if the category will log messages with priority @c - * LOG4C_PRIORITY_CRIT. - * - * @param a_category the log4c_category_t object - * @returns Whether the category will log. - **/ -#ifndef _WIN32 -static inline int log4c_category_is_crit_enabled(const log4c_category_t* a_category) -{ - return log4c_category_is_priority_enabled(a_category, LOG4C_PRIORITY_CRIT); -} -#else -#define log4c_category_is_crit_enabled(a) \ - (log4c_category_is_priority_enabled(a, LOG4C_PRIORITY_CRIT)) -#endif - -/** - * Return true if the category will log messages with priority @c - * LOG4C_PRIORITY_ERROR. - * - * @param a_category the log4c_category_t object - * @returns Whether the category will log. - **/ -#ifndef _WIN32 -static inline int log4c_category_is_error_enabled(const log4c_category_t* a_category) -{ - return log4c_category_is_priority_enabled(a_category, LOG4C_PRIORITY_ERROR); -} -#else -#define log4c_category_is_error_enabled(a) \ - (log4c_category_is_priority_enabled(a, LOG4C_PRIORITY_ERROR)) -#endif - -/** - * Return true if the category will log messages with priority @c - * LOG4C_PRIORITY_WARN. - * - * @param a_category the log4c_category_t object - * @returns Whether the category will log. - **/ -#ifndef _WIN32 -static inline int log4c_category_is_warn_enabled(const log4c_category_t* a_category) -{ - return log4c_category_is_priority_enabled(a_category, LOG4C_PRIORITY_WARN); -} -#else -#define log4c_category_is_warn_enabled(a) \ - log4c_category_is_warn_enabled(a) \ - (log4c_category_is_priority_enabled(a, LOG4C_PRIORITY_WARN)) -#endif - -/** - * Return true if the category will log messages with priority @c - * LOG4C_PRIORITY_NOTICE. - * - * @param a_category the log4c_category_t object - * @returns Whether the category will log. - **/ -#ifndef _WIN32 -static inline int log4c_category_is_notice_enabled(const log4c_category_t* a_category) -{ - return log4c_category_is_priority_enabled(a_category, LOG4C_PRIORITY_NOTICE); -} -#else -#define log4c_category_is_notice_enabled(a) \ - (log4c_category_is_priority_enabled(a, LOG4C_PRIORITY_NOTICE)) -#endif - -/** - * Return true if the category will log messages with priority @c - * LOG4C_PRIORITY_INFO. - * - * @param a_category the log4c_category_t object - * @returns Whether the category will log. - **/ -#ifndef _WIN32 -static inline int log4c_category_is_info_enabled(const log4c_category_t* a_category) -{ - return log4c_category_is_priority_enabled(a_category, LOG4C_PRIORITY_INFO); -} -#else -#define log4c_category_is_info_enabled(a) \ - (log4c_category_is_priority_enabled(a, LOG4C_PRIORITY_INFO)) -#endif - -/** - * Return true if the category will log messages with priority @c - * LOG4C_PRIORITY_DEBUG. - * - * @param a_category the log4c_category_t object - * @returns Whether the category will log. - **/ -#ifndef _WIN32 -static inline int log4c_category_is_debug_enabled(const log4c_category_t* a_category) -{ - return log4c_category_is_priority_enabled(a_category, LOG4C_PRIORITY_DEBUG); -} -#else -#define log4c_category_is_debug_enabled(a) \ - (log4c_category_is_priority_enabled(a, LOG4C_PRIORITY_DEBUG)) -#endif - -/** - * Return true if the category will log messages with priority @c - * LOG4C_PRIORITY_TRACE. - * - * @param a_category the log4c_category_t object - * @returns Whether the category will log. - **/ -#ifndef _WIN32 -static inline int log4c_category_is_trace_enabled(const log4c_category_t* a_category) -{ - return log4c_category_is_priority_enabled(a_category, LOG4C_PRIORITY_TRACE); -} -#else -#define log4c_category_is_trace_enabled(a) \ - (log4c_category_is_priority_enabled(a, LOG4C_PRIORITY_TRACE)) -#endif - -/** - * @internal - **/ -LOG4C_API void __log4c_category_vlog(const log4c_category_t* a_category, - const log4c_location_info_t* a_locinfo, - int id, - int a_priority, - const char* a_format, - va_list a_args); - -/** - * @internal - * - * @bug the log4c_location_info_t object is not set correctly. A macro is - * needed. - **/ - -/* msvc doesn't allow "inline" nor variable args in a macro - * so cannot #define these ones. - */ - -static LOG4C_INLINE void log4c_category_vlog(const log4c_category_t* a_category, - int id, - int a_priority, - const char* a_format, - va_list a_args) -{ - const log4c_location_info_t locinfo = LOG4C_LOCATION_INFO_INITIALIZER; - - __log4c_category_vlog(a_category, &locinfo, id, a_priority, a_format, a_args); -} - -/** - * Log a message with the specified priority. - * @param a_category the log4c_category_t object - * @param id the ID of the event for backwards compatibility, or 0 - * @param a_priority The priority of this log message. - * @param a_format Format specifier for the string to write - * in the log file. - * @param ... The arguments for a_format - **/ -static LOG4C_INLINE void log4c_category_log(const log4c_category_t* a_category, - int id, - int a_priority, - const char* a_format, - ...) -{ - if (log4c_category_is_priority_enabled(a_category, a_priority)) { - va_list va; - va_start(va, a_format); - log4c_category_vlog(a_category, id, a_priority, a_format, va); - va_end(va); - } -} - -/** - * Log a message with fatal priority. - * @param a_category the log4c_category_t object - * @param id the ID of the event for backwards compatibility, or 0 - * @param a_format Format specifier for the string to write - * in the log file. - * @param ... The arguments for a_format - **/ -static LOG4C_INLINE void log4c_category_fatal(const log4c_category_t* a_category, - int id, - const char* a_format, - ...) -{ - if (log4c_category_is_priority_enabled(a_category, LOG4C_PRIORITY_FATAL)) { - va_list va; - va_start(va, a_format); - log4c_category_vlog(a_category, id, LOG4C_PRIORITY_FATAL, a_format, va); - va_end(va); - } -} - -/** - * Log a message with alert priority. - * @param a_category the log4c_category_t object - * @param id the ID of the event for backwards compatibility, or 0 - * @param a_format Format specifier for the string to write - * in the log file. - * @param ... The arguments for a_format - **/ -static LOG4C_INLINE void log4c_category_alert(const log4c_category_t* a_category, - int id, - const char* a_format, - ...) -{ - if (log4c_category_is_priority_enabled(a_category, LOG4C_PRIORITY_ALERT)) { - va_list va; - va_start(va, a_format); - log4c_category_vlog(a_category, id, LOG4C_PRIORITY_ALERT, a_format, va); - va_end(va); - } -} - -/** - * Log a message with crit priority. - * @param a_category the log4c_category_t object - * @param id the ID of the event for backwards compatibility, or 0 - * @param a_format Format specifier for the string to write - * in the log file. - * @param ... The arguments for a_format - **/ -static LOG4C_INLINE void log4c_category_crit(const log4c_category_t* a_category, - int id, - const char* a_format, - ...) -{ - if (log4c_category_is_priority_enabled(a_category, LOG4C_PRIORITY_CRIT)) { - va_list va; - va_start(va, a_format); - log4c_category_vlog(a_category, id, LOG4C_PRIORITY_CRIT, a_format, va); - va_end(va); - } -} - -/** - * Log a message with error priority. - * @param a_category the log4c_category_t object - * @param id the ID of the event for backwards compatibility, or 0 - * @param a_format Format specifier for the string to write - * in the log file. - * @param ... The arguments for a_format - **/ -static LOG4C_INLINE void log4c_category_error(const log4c_category_t* a_category, - int id, - const char* a_format, - ...) -{ - if (log4c_category_is_priority_enabled(a_category, LOG4C_PRIORITY_ERROR)) { - va_list va; - va_start(va, a_format); - log4c_category_vlog(a_category, id, LOG4C_PRIORITY_ERROR, a_format, va); - va_end(va); - } -} - -/** - * Log a message with warn priority. - * @param a_category the log4c_category_t object - * @param id the ID of the event for backwards compatibility, or 0 - * @param a_format Format specifier for the string to write - * in the log file. - * @param ... The arguments for a_format - **/ -static LOG4C_INLINE void log4c_category_warn(const log4c_category_t* a_category, - int id, - const char* a_format, - ...) -{ - if (log4c_category_is_priority_enabled(a_category, LOG4C_PRIORITY_WARN)) { - va_list va; - va_start(va, a_format); - log4c_category_vlog(a_category, id, LOG4C_PRIORITY_WARN, a_format, va); - va_end(va); - } -} - -/** - * Log a message with notice priority. - * @param a_category the log4c_category_t object - * @param id the ID of the event for backwards compatibility, or 0 - * @param a_format Format specifier for the string to write - * in the log file. - * @param ... The arguments for a_format - **/ -static LOG4C_INLINE void log4c_category_notice(const log4c_category_t* a_category, - int id, - const char* a_format, - ...) -{ - if (log4c_category_is_priority_enabled(a_category, LOG4C_PRIORITY_NOTICE)) { - va_list va; - va_start(va, a_format); - log4c_category_vlog(a_category, id, LOG4C_PRIORITY_NOTICE, a_format, va); - va_end(va); - } -} - -/** - * Log a message with info priority. - * @param a_category the log4c_category_t object - * @param id the ID of the event for backwards compatibility, or 0 - * @param a_format Format specifier for the string to write - * in the log file. - * @param ... The arguments for a_format - **/ -static LOG4C_INLINE void log4c_category_info(const log4c_category_t* a_category, - int id, - const char* a_format, - ...) -{ - if (log4c_category_is_priority_enabled(a_category, LOG4C_PRIORITY_INFO)) { - va_list va; - va_start(va, a_format); - log4c_category_vlog(a_category, id, LOG4C_PRIORITY_INFO, a_format, va); - va_end(va); - } -} - -/** - * Log a message with debug priority. - * @param a_category the log4c_category_t object - * @param id the ID of the event for backwards compatibility, or 0 - * @param a_format Format specifier for the string to write - * in the log file. - * @param ... The arguments for a_format - **/ -static LOG4C_INLINE void log4c_category_debug(const log4c_category_t* a_category, - int id, - const char* a_format, - ...) -{ - if (log4c_category_is_priority_enabled(a_category, LOG4C_PRIORITY_DEBUG)) { - va_list va; - va_start(va, a_format); - log4c_category_vlog(a_category, id, LOG4C_PRIORITY_DEBUG, a_format, va); - va_end(va); - } -} - -/** - * Log a message with trace priority. - * @param a_category the log4c_category_t object - * @param id the ID of the event for backwards compatibility, or 0 - * @param a_format Format specifier for the string to write - * in the log file. - * @param ... The arguments for a_format - **/ -static LOG4C_INLINE void __log4c_category_trace(const log4c_category_t* a_category, - int id, - const char* a_format, - ...) -{ - if (log4c_category_is_priority_enabled(a_category, LOG4C_PRIORITY_TRACE)) { - va_list va; - va_start(va, a_format); - log4c_category_vlog(a_category, id, LOG4C_PRIORITY_TRACE, a_format, va); - va_end(va); - } -} - -#define log4c_category_trace __log4c_category_trace - -#define log4c_category_define(a_category, a_name) - -/** - * @internal - **/ -struct __sd_factory; -LOG4C_API struct __sd_factory* log4c_category_factory; - -__LOG4C_END_DECLS - -#endif diff --git a/import/log4c/log4c/config-win32.h b/import/log4c/log4c/config-win32.h deleted file mode 100644 index 12650bd..0000000 --- a/import/log4c/log4c/config-win32.h +++ /dev/null @@ -1,32 +0,0 @@ -/* $Id$ - * - * See the COPYING file for the terms of usage and distribution. - */ - -/* This file defines some labels as required for - compiling with Microsoft Visual C++ 6 -*/ - -#ifndef __log4c_config_win32_h -#define __log4c_config_win32_h - -#include -#include -#include - -#undef LOG4C_API -#ifdef LOG4C_EXPORTS -# define LOG4C_API __declspec(dllexport) -#else -# define LOG4C_API extern __declspec(dllimport) -#endif - -/* This is defined to be 'inline' by default, - but with msvc6 undef it so that inlined - functions are just normal functions. -*/ -#undef LOG4C_INLINE -#define LOG4C_INLINE - - -#endif /* __log4c_config_win32_h */ diff --git a/import/log4c/log4c/defs.h b/import/log4c/log4c/defs.h deleted file mode 100644 index b45b3d6..0000000 --- a/import/log4c/log4c/defs.h +++ /dev/null @@ -1,33 +0,0 @@ -/* $Id: defs.h,v 1.4 2005/12/13 22:10:49 legoater Exp $ - * - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * - * See the COPYING file for the terms of usage and distribution. - */ - -#ifndef __log4c_defs_h -#define __log4c_defs_h - -/** - * @file defs.h - * - * @brief types and declarations enclosures for C++. - * - **/ - -#ifdef __cplusplus -# define __LOG4C_BEGIN_DECLS extern "C" { -# define __LOG4C_END_DECLS } -#else -# define __LOG4C_BEGIN_DECLS -# define __LOG4C_END_DECLS -#endif - -#define LOG4C_INLINE inline -#define LOG4C_API extern - -#ifdef _WIN32 -# include -#endif - -#endif /* __log4c_defs_h */ diff --git a/import/log4c/log4c/init.c b/import/log4c/log4c/init.c deleted file mode 100644 index bfa3eb6..0000000 --- a/import/log4c/log4c/init.c +++ /dev/null @@ -1,125 +0,0 @@ -static const char version[] = "$Id: init.c,v 1.9 2005/12/15 22:05:09 rbyrne Exp $"; - -/* - * init.c - * - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * - * See the COPYING file for the terms of usage and distribution. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "appender_type_stream.h" -#include "appender_type_stream2.h" -#include "appender_type_mmap.h" -#include "appender_type_syslog.h" -#include "appender_type_audit.h" -#include "layout_type_basic.h" -#include "layout_type_dated.h" - -#if defined(__LOG4C_DEBUG__) && defined(__GLIBC__) -#include -#endif - -/** - * @bug (hpux) the constructor needs to be first extern symbol. - * Otherwise, it is not called .. why ??? - */ - -/******************************************************************************/ -extern int log4c_init(void) -{ - int ret = 0; - - /* activate GLIBC allocation debugging */ -#if defined(__LOG4C_DEBUG__) && defined(__GLIBC__) - mtrace(); -#endif - - log4c_appender_type_set(&log4c_appender_type_stream); - log4c_appender_type_set(&log4c_appender_type_stream2); - log4c_appender_type_set(&log4c_appender_type_mmap); - log4c_appender_type_set(&log4c_appender_type_syslog); - log4c_appender_type_set(&log4c_appender_type_audit); - log4c_layout_type_set(&log4c_layout_type_basic); - log4c_layout_type_set(&log4c_layout_type_dated); - - /* load configuration files */ - { - static char rcfiles[][256] = { - "$LOG4C_RCPATH/log4crc", - "./log4crc" - }; - static const int nrcfiles = sizeof(rcfiles) / sizeof(rcfiles[0]); - int i; - - snprintf(rcfiles[0], sizeof(rcfiles[0]) - 1, "%s/log4crc", - getenv("LOG4C_RCPATH") ? getenv("LOG4C_RCPATH") : LOG4C_RCPATH); - for (i = 0; i < nrcfiles; i++) { - if (log4c_load(rcfiles[i]) == -1) { - sd_error("loading %s failed", rcfiles[i]); - ret = -1; - } else { - sd_debug("loading %s succeeded", rcfiles[i]); - } - } - } - - /* override configuration with environment variables */ - { - const char* priority; - const char* appender; - - if ( (priority = getenv("LOG4C_PRIORITY")) != NULL) - log4c_category_set_priority(log4c_category_get("root"), - log4c_priority_to_int(priority)); - - if ( (appender = getenv("LOG4C_APPENDER")) != NULL) - log4c_category_set_appender(log4c_category_get("root"), - log4c_appender_get(appender)); - } - - return ret; -} - -/******************************************************************************/ -extern int log4c_fini(void) -{ - if (log4c_rc->config.nocleanup) - return -1; - - sd_debug("cleaning up"); - - if (log4c_category_factory) { - sd_factory_delete(log4c_category_factory); - log4c_category_factory = NULL; - } - - if (log4c_appender_factory) { - sd_factory_delete(log4c_appender_factory); - log4c_appender_factory = NULL; - } - - if (log4c_layout_factory) { - sd_factory_delete(log4c_layout_factory); - log4c_layout_factory = NULL; - } - -#if defined(__LOG4C_DEBUG__) && defined(__GLIBC__) - muntrace(); -#endif - - return 0; -} - -/******************************************************************************/ diff --git a/import/log4c/log4c/init.h b/import/log4c/log4c/init.h deleted file mode 100644 index 0fcb71b..0000000 --- a/import/log4c/log4c/init.h +++ /dev/null @@ -1,34 +0,0 @@ -/* $Id: init.h,v 1.4 2005/12/13 22:12:49 legoater Exp $ - * - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * - * See the COPYING file for the terms of usage and distribution. - */ - -#ifndef __log4c_init_h -#define __log4c_init_h - -#include - -/** - * @file init.h - * - * @brief log4c constructors and destructors - * - **/ - -/** - * constructor - * - * @returns 0 for success - **/ -LOG4C_API int log4c_init(void); - -/** - * destructor - * - * @returns 0 for success - **/ -LOG4C_API int log4c_fini(void); - -#endif diff --git a/import/log4c/log4c/layout.c b/import/log4c/log4c/layout.c deleted file mode 100644 index 53c2f2f..0000000 --- a/import/log4c/log4c/layout.c +++ /dev/null @@ -1,197 +0,0 @@ -static const char version[] = "$Id: layout.c,v 1.4 2003/09/13 16:52:32 legoater Exp $"; - -/* - * layout.c - * - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * - * See the COPYING file for the terms of usage and distribution. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -struct __log4c_layout -{ - char* lo_name; - const log4c_layout_type_t* lo_type; - void* lo_udata; -}; - -sd_factory_t* log4c_layout_factory = NULL; - -/** - * @bug log4c_appender_type hash is not freed in destructor - */ - -/*******************************************************************************/ -static sd_hash_t* log4c_layout_types(void) -{ - static sd_hash_t* types = NULL; - - if (!types) - types = sd_hash_new(20, NULL); - - return types; -} - -/*******************************************************************************/ -extern const log4c_layout_type_t* log4c_layout_type_get(const char* a_name) -{ - sd_hash_iter_t* i; - - if (!a_name) - return NULL; - - if ( (i = sd_hash_lookup(log4c_layout_types(), a_name)) != NULL) - return i->data; - - return NULL; -} - -/*******************************************************************************/ -extern const log4c_layout_type_t* log4c_layout_type_set( - const log4c_layout_type_t* a_type) -{ - sd_hash_iter_t* i = NULL; - void* previous = NULL; - - if (!a_type) - return NULL; - - if ( (i = sd_hash_lookadd(log4c_layout_types(), a_type->name)) == NULL) - return NULL; - - previous = i->data; - i->data = (void*) a_type; - - return previous; -} -/*******************************************************************************/ -extern log4c_layout_t* log4c_layout_get(const char* a_name) -{ - static const sd_factory_ops_t log4c_layout_factory_ops = { - (void*) log4c_layout_new, - (void*) log4c_layout_delete, - (void*) log4c_layout_print, - }; - - if (!log4c_layout_factory) { - log4c_layout_factory = sd_factory_new("log4c_layout_factory", - &log4c_layout_factory_ops); - /* build default layouts */ - log4c_layout_set_type(log4c_layout_get("dated"), &log4c_layout_type_dated); - log4c_layout_set_type(log4c_layout_get("basic"), &log4c_layout_type_basic); - } - - return sd_factory_get(log4c_layout_factory, a_name); -} - -/*******************************************************************************/ -extern log4c_layout_t* log4c_layout_new(const char* a_name) -{ - log4c_layout_t* this; - - if (!a_name) - return NULL; - - this = sd_calloc(1, sizeof(log4c_layout_t)); - this->lo_name = sd_strdup(a_name); - this->lo_type = &log4c_layout_type_basic; - this->lo_udata = NULL; - - return this; -} - -/*******************************************************************************/ -extern void log4c_layout_delete(log4c_layout_t* this) -{ - if (!this) - return; - - free(this->lo_name); - free(this); -} - -/*******************************************************************************/ -extern const char* log4c_layout_get_name(const log4c_layout_t* this) -{ - return (this ? this->lo_name : NULL); -} - -/*******************************************************************************/ -extern const log4c_layout_type_t* log4c_layout_get_type(const log4c_layout_t* this) -{ - return (this ? this->lo_type : NULL); -} - -/*******************************************************************************/ -extern const log4c_layout_type_t* log4c_layout_set_type( - log4c_layout_t* this, - const log4c_layout_type_t* a_type) -{ - const log4c_layout_type_t* previous; - - if (!this) - return NULL; - - previous = this->lo_type; - this->lo_type = a_type; - return previous; -} - -/*******************************************************************************/ -extern void* log4c_layout_get_udata(const log4c_layout_t* this) -{ - return (this ? this->lo_udata : NULL); -} - -/*******************************************************************************/ -extern void* log4c_layout_set_udata(log4c_layout_t* this, void* a_udata) -{ - void* previous; - - if (!this) - return NULL; - - previous = this->lo_udata; - this->lo_udata = a_udata; - return previous; -} - -/*******************************************************************************/ -extern const char* log4c_layout_format( - const log4c_layout_t* this, - const log4c_logging_event_t*a_event) -{ - if (!this) - return NULL; - - if (!this->lo_type) - return NULL; - - if (!this->lo_type->format) - return NULL; - - return this->lo_type->format(this, a_event); -} - -/*******************************************************************************/ -extern void log4c_layout_print(const log4c_layout_t* this, FILE* a_stream) -{ - if (!this) - return; - - fprintf(a_stream, "{ name:'%s' type:'%s' udata:%p }", - this->lo_name, - this->lo_type ? this->lo_type->name : "(no set)", - this->lo_udata); -} diff --git a/import/log4c/log4c/layout.h b/import/log4c/log4c/layout.h deleted file mode 100644 index 7ade9a6..0000000 --- a/import/log4c/log4c/layout.h +++ /dev/null @@ -1,154 +0,0 @@ -/* $Id: layout.h,v 1.4 2005/12/13 22:12:49 legoater Exp $ - * - * layout.h - * - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * - * See the COPYING file for the terms of usage and distribution. - */ - -#ifndef log4c_layout_h -#define log4c_layout_h - -/** - * @file layout.h - * - * @brief Interface for user specific layout format of log4c_logging_event - * events. - * - * @todo the layout interface needs a better configuration system - * depending on the layout type. The udata field is a just a trick. - * - * @todo a pattern layout would be welcomed !! - **/ - -#include -#include -#include - -__LOG4C_BEGIN_DECLS - -struct __log4c_layout; - -/** - * log4c layout class - **/ -typedef struct __log4c_layout log4c_layout_t; - -/** - * @brief log4c layout type class - * - * Attributes description: - * - * @li @c name layout type name - * @li @c format - **/ -typedef struct log4c_layout_type { - const char* name; - const char* (*format) (const log4c_layout_t*, const log4c_logging_event_t*); -} log4c_layout_type_t; - -/** - * Get a pointer to an existing layout type. - * - * @param a_name the name of the layout type to return. - * @returns a pointer to an existing layout type, or NULL if no layout - * type with the specified name exists. - **/ -LOG4C_API const log4c_layout_type_t* log4c_layout_type_get(const char* a_name); - -/** - * Set an layout type. - * - * @param a_type a pointer to the new layout type to set. - * @returns a pointer to the previous layout type of same name. - **/ -LOG4C_API const log4c_layout_type_t* log4c_layout_type_set( - const log4c_layout_type_t* a_type); - -/** - * Get a pointer to an existing layout. - * - * @param a_name the name of the layout to return. - * @returns a pointer to an existing layout, or NULL if no layout - * with the specfied name exists. - **/ -LOG4C_API log4c_layout_t* log4c_layout_get(const char* a_name); - -/** - * Constructor for layout. - **/ -LOG4C_API log4c_layout_t* log4c_layout_new(const char* a_name); - -/** - * Destructor for layout. - **/ -LOG4C_API void log4c_layout_delete(log4c_layout_t* a_layout); - -/** - * @param a_layout the log4c_layout_t object - * @return the layout name - **/ -LOG4C_API const char* log4c_layout_get_name(const log4c_layout_t* a_layout); - -/** - * @param a_layout the log4c_layout_t object - * @return a log4c_layout_type_t object - **/ -LOG4C_API const log4c_layout_type_t* log4c_layout_get_type( - const log4c_layout_t* a_layout); - -/** - * sets the layout type - * - * @param a_layout the log4c_layout_t object - * @param a_type the new layout type - * @return the previous layout type - **/ -LOG4C_API const log4c_layout_type_t* log4c_layout_set_type( - log4c_layout_t* a_layout, - const log4c_layout_type_t* a_type); - -/** - * @param a_layout the log4c_layout_t object - * @return the layout user data - **/ -LOG4C_API void* log4c_layout_get_udata(const log4c_layout_t* a_layout); - -/** - * sets the layout user data - * - * @param a_layout the log4c_layout_t object - * @param a_udata the new layout user data - * @return the previous layout user data - **/ -LOG4C_API void* log4c_layout_set_udata(log4c_layout_t* a_layout, - void* a_udata); -/** - * format a log4c_logging_event events to a string. - * - * @param a_layout the log4c_layout_t object - * @param a_event a logging_event_t object - * @returns an appendable string. - **/ -LOG4C_API const char* log4c_layout_format( - const log4c_layout_t* a_layout, - const log4c_logging_event_t* a_event); - -/** - * prints the layout on a stream - * @param a_layout the log4c_layout_t object - * @param a_stream the stream - **/ -LOG4C_API void log4c_layout_print( - const log4c_layout_t* a_layout, FILE* a_stream); - -/** - * @internal - **/ -struct __sd_factory; -LOG4C_API struct __sd_factory* log4c_layout_factory; - -__LOG4C_END_DECLS - -#endif diff --git a/import/log4c/log4c/layout_type_basic.c b/import/log4c/log4c/layout_type_basic.c deleted file mode 100644 index 6ddb774..0000000 --- a/import/log4c/log4c/layout_type_basic.c +++ /dev/null @@ -1,39 +0,0 @@ -static const char version[] = "$Id: layout_type_basic.c,v 1.5 2005/12/15 22:05:09 rbyrne Exp $"; - -/* - * layout.c - * - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * - * See the COPYING file for the terms of usage and distribution. - */ - -#include -#include -#include -#include -#include - -/*******************************************************************************/ -static const char* basic_format( - const log4c_layout_t* a_layout, - const log4c_logging_event_t* a_event) -{ - static char buffer[1024]; - - snprintf(buffer, sizeof(buffer), "%-8s %s - %s\n", - log4c_priority_to_string(a_event->evt_priority), - a_event->evt_category, a_event->evt_msg); - - return buffer; -} - -/*******************************************************************************/ -const log4c_layout_type_t log4c_layout_type_basic = { - "basic", - basic_format, -}; - -/* -log4c_layout_type_define(log4c_layout_type_basic); -*/ diff --git a/import/log4c/log4c/layout_type_basic.h b/import/log4c/log4c/layout_type_basic.h deleted file mode 100644 index b3fb4ad..0000000 --- a/import/log4c/log4c/layout_type_basic.h +++ /dev/null @@ -1,38 +0,0 @@ -/* $Id: layout_type_basic.h,v 1.3 2003/09/12 21:06:45 legoater Exp $ - * - * layout_type_basic.h - * - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * - * See the COPYING file for the terms of usage and distribution. - */ - -#ifndef log4c_layout_type_basic_h -#define log4c_layout_type_basic_h - -/** - * @file layout_type_basic.h - * - * @brief Implement a basic layout. - * - * In @c log4j.PatternLayout conventions, the basic layout has the following - * conversion pattern: @c "%P %c - %m\n". - * - * Where - * @li @c "%P" is the priority of the logging event - * @li @c "%c" is the category of the logging event - * @li @c "%m" is the application supplied message associated with the - * logging event - * - **/ - -#include -#include - -__LOG4C_BEGIN_DECLS - -extern const log4c_layout_type_t log4c_layout_type_basic; - -__LOG4C_END_DECLS - -#endif diff --git a/import/log4c/log4c/layout_type_basic_r.c b/import/log4c/log4c/layout_type_basic_r.c deleted file mode 100644 index d94cc52..0000000 --- a/import/log4c/log4c/layout_type_basic_r.c +++ /dev/null @@ -1,46 +0,0 @@ -static const char version[] = "$Id$"; - -/* - * layout.c - * - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * - * See the COPYING file for the terms of usage and distribution. - */ - -#include -#include -#include -#include - -/*******************************************************************************/ -static const char* basic_r_format( - const log4c_layout_t* a_layout, - const log4c_logging_event_t* a_event) -{ - int n, i; - - n = snprintf(a_event->evt_buffer.buf_data, a_event->evt_buffer.buf_size, - "%-8s %s - %s\n", - log4c_priority_to_string(a_event->evt_priority), - a_event->evt_category, a_event->evt_msg); - - if (n >= a_event->evt_buffer.buf_size) { - /* - * append '...' at the end of the message to show it was - * trimmed - */ - for (i = 0; i < 3; i++) - a_event->evt_buffer.buf_data[a_event->evt_buffer.buf_size - 4 + i] = '.'; - } - - return a_event->evt_buffer.buf_data; -} - -/*******************************************************************************/ -const log4c_layout_type_t log4c_layout_type_basic_r = { - "basic_r", - basic_r_format, -}; - -log4c_layout_type_define(log4c_layout_type_basic_r); diff --git a/import/log4c/log4c/layout_type_basic_r.h b/import/log4c/log4c/layout_type_basic_r.h deleted file mode 100644 index 8e5b26f..0000000 --- a/import/log4c/log4c/layout_type_basic_r.h +++ /dev/null @@ -1,38 +0,0 @@ -/* $Id$ - * - * layout_type_basic_r.h - * - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * - * See the COPYING file for the terms of usage and distribution. - */ - -#ifndef log4c_layout_type_basic_r_h -#define log4c_layout_type_basic_r_h - -/** - * @file layout_type_basic_r.h - * - * @brief Implement a basic_r layout. - * - * In @c log4j.PatternLayout conventions, the basic_r layout has the following - * conversion pattern: @c "%P %c - %m\n". - * - * Where - * @li @c "%P" is the priority of the logging event - * @li @c "%c" is the category of the logging event - * @li @c "%m" is the application supplied message associated with the - * logging event - * - **/ - -#include -#include - -__LOG4C_BEGIN_DECLS - -extern const log4c_layout_type_t log4c_layout_type_basic_r; - -__LOG4C_END_DECLS - -#endif diff --git a/import/log4c/log4c/layout_type_dated.c b/import/log4c/log4c/layout_type_dated.c deleted file mode 100644 index a72c9ba..0000000 --- a/import/log4c/log4c/layout_type_dated.c +++ /dev/null @@ -1,60 +0,0 @@ -static const char version[] = "$Id: layout_type_dated.c,v 1.6 2005/12/15 22:05:09 rbyrne Exp $"; - -/* - * layout.c - * - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * - * See the COPYING file for the terms of usage and distribution. - */ - -#include -#include -#include -#include -#include -#include -#include - -/*******************************************************************************/ -static const char* dated_format( - const log4c_layout_t* a_layout, - const log4c_logging_event_t*a_event) -{ - static char buffer[1024]; - - struct tm tm; - - -#ifndef _WIN32 -#warning gmtime() routine should be defined in sd_xplatform - gmtime_r(&a_event->evt_timestamp.tv_sec, &tm); -#else - /* xxx Need a CreateMutex/ReleaseMutex or something here - */ - { - struct tm *tmp = NULL; - tmp = gmtime(&a_event->evt_timestamp.tv_sec); - tm = *tmp; /* struct copy */ - } -#endif - - snprintf(buffer, sizeof(buffer), "%04d%02d%02d %02d:%02d:%02d.%03ld %-8s %s - %s\n", - tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, - tm.tm_hour, tm.tm_min, tm.tm_sec, - a_event->evt_timestamp.tv_usec / 1000, - log4c_priority_to_string(a_event->evt_priority), - a_event->evt_category, a_event->evt_msg); - - return buffer; -} - -/*******************************************************************************/ -const log4c_layout_type_t log4c_layout_type_dated = { - "dated", - dated_format, -}; - -/* -log4c_layout_type_define(log4c_layout_type_dated); -*/ diff --git a/import/log4c/log4c/layout_type_dated.h b/import/log4c/log4c/layout_type_dated.h deleted file mode 100644 index 538645e..0000000 --- a/import/log4c/log4c/layout_type_dated.h +++ /dev/null @@ -1,41 +0,0 @@ -/* $Id: layout_type_dated.h,v 1.3 2003/09/12 21:06:45 legoater Exp $ - * - * layout_type_dated.h - * - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * - * See the COPYING file for the terms of usage and distribution. - */ - -#ifndef log4c_layout_type_dated_h -#define log4c_layout_type_dated_h - -/** - * @file layout_type_dated.h - * - * @brief Implement a dated layout. - * - * In @c log4j.PatternLayout conventions, the dated layout has the following - * conversion pattern: @c "%d %P %c - %m\n". - * - * Where - * @li @c "%d" is the date of the logging event - * @li @c "%P" is the priority of the logging event - * @li @c "%c" is the category of the logging event - * @li @c "%m" is the application supplied message associated with the - * logging event - * - * - * - **/ - -#include -#include - -__LOG4C_BEGIN_DECLS - -extern const log4c_layout_type_t log4c_layout_type_dated; - -__LOG4C_END_DECLS - -#endif diff --git a/import/log4c/log4c/layout_type_dated_r.c b/import/log4c/log4c/layout_type_dated_r.c deleted file mode 100644 index 39b39d4..0000000 --- a/import/log4c/log4c/layout_type_dated_r.c +++ /dev/null @@ -1,65 +0,0 @@ -static const char version[] = "$Id$"; - -/* - * layout.c - * - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * - * See the COPYING file for the terms of usage and distribution. - */ - -#include -#include -#include -#include -#include -#include - -/*******************************************************************************/ -static const char* dated_r_format( - const log4c_layout_t* a_layout, - const log4c_logging_event_t*a_event) -{ - int n, i; - struct tm tm; - -#warning gmtime() routine should be defined in sd_xplatform -#ifndef _WIN32 - gmtime_r(&a_event->evt_timestamp.tv_sec, &tm); -#else - /* xxx Need a CreateMutex/ReleaseMutex or something here - */ - { - struct tm *tmp = NULL; - tmp = gmtime(&a_event->evt_timestamp.tv_sec); - tm = *tmp; /* struct copy */ - } -#endif - - n = snprintf(a_event->evt_buffer.buf_data, a_event->evt_buffer.buf_size, - "%04d%02d%02d %02d:%02d:%02d.%03ld %-8s %s - %s\n", - tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, - tm.tm_hour, tm.tm_min, tm.tm_sec, - a_event->evt_timestamp.tv_usec / 1000, - log4c_priority_to_string(a_event->evt_priority), - a_event->evt_category, a_event->evt_msg); - - if (n >= a_event->evt_buffer.buf_size) { - /* - * append '...' at the end of the message to show it was - * trimmed - */ - for (i = 0; i < 3; i++) - a_event->evt_buffer.buf_data[a_event->evt_buffer.buf_size - 4 + i] = '.'; - } - - return a_event->evt_buffer.buf_data; -} - -/*******************************************************************************/ -const log4c_layout_type_t log4c_layout_type_dated_r = { - "dated_r", - dated_r_format, -}; - -log4c_layout_type_define(log4c_layout_type_dated_r); diff --git a/import/log4c/log4c/layout_type_dated_r.h b/import/log4c/log4c/layout_type_dated_r.h deleted file mode 100644 index fa0f03a..0000000 --- a/import/log4c/log4c/layout_type_dated_r.h +++ /dev/null @@ -1,41 +0,0 @@ -/* $Id$ - * - * layout_type_dated_r.h - * - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * - * See the COPYING file for the terms of usage and distribution. - */ - -#ifndef log4c_layout_type_dated_r_h -#define log4c_layout_type_dated_r_h - -/** - * @file layout_type_dated_r.h - * - * @brief Implement a dated_r layout. - * - * In @c log4j.PatternLayout conventions, the dated_r layout has the following - * conversion pattern: @c "%d %P %c - %m\n". - * - * Where - * @li @c "%d" is the date of the logging event - * @li @c "%P" is the priority of the logging event - * @li @c "%c" is the category of the logging event - * @li @c "%m" is the application supplied message associated with the - * logging event - * - * - * - **/ - -#include -#include - -__LOG4C_BEGIN_DECLS - -extern const log4c_layout_type_t log4c_layout_type_dated_r; - -__LOG4C_END_DECLS - -#endif diff --git a/import/log4c/log4c/location_info.h b/import/log4c/log4c/location_info.h deleted file mode 100644 index 6903e0b..0000000 --- a/import/log4c/log4c/location_info.h +++ /dev/null @@ -1,63 +0,0 @@ -/* $Id: location_info.h,v 1.3 2003/09/12 21:06:45 legoater Exp $ - * - * location_info.h - * - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - - - * See the COPYING file for the terms of usage and distribution. - */ - -#ifndef log4c_location_info_h -#define log4c_location_info_h - -/** - * @file location_info.h - * - * @brief The internal representation of caller location information. - * - * When a affirmative logging decision is made a log4c_location_info_t is - * created and is passed around the different log4c components. - **/ - -#include - -__LOG4C_BEGIN_DECLS - -/** - * @brief logging location information - * - * Attributes description: - * - * @li @c loc_file file name - * @li @c loc_line file line - * @li @c loc_function function name - * - * @todo this is not used - **/ -typedef struct -{ - const char* loc_file; - int loc_line; - const char* loc_function; - -} log4c_location_info_t; - -/** - * log4c_location_info_t initializer - **/ -# define LOG4C_LOCATION_INFO_INITIALIZER { __FILE__, __LINE__, "(nil)" } - -#define __log4c_str(n) #n - -# define __log4c_location(n) __FILE__ ":" __log4c_str(n) - -/** - * This macro returns the literal representation of a logging event - * location - **/ -#define log4c_location __log4c_location(__LINE__) - -__LOG4C_END_DECLS - -#endif diff --git a/import/log4c/log4c/log4c.c b/import/log4c/log4c/log4c.c deleted file mode 100644 index bacde80..0000000 --- a/import/log4c/log4c/log4c.c +++ /dev/null @@ -1,33 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2005 Novell, Inc. - * All Rights Reserved. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2.1 of the GNU Lesser General Public - * License as published by the Free Software Foundation. - * - * 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, contact Novell, Inc. - * - * To contact Novell about this file by physical or electronic mail, - * you may find current contact information at www.novell.com - * - ****************************************************************************/ -#include "log4c.h" - -void LogMsg(const char* loggerName, int id, int level, char* msg, ...) -{ - log4c_category_t* cat = log4c_category_get(loggerName); - va_list va; - if (log4c_category_is_priority_enabled(cat, level)) { - va_start(va, msg); - log4c_category_vlog(cat, id, level, msg, va); - va_end(va); - } -} diff --git a/import/log4c/log4c/logging_event.c b/import/log4c/log4c/logging_event.c deleted file mode 100644 index f24014b..0000000 --- a/import/log4c/log4c/logging_event.c +++ /dev/null @@ -1,43 +0,0 @@ -static const char version[] = "$Id: logging_event.c,v 1.4 2005/12/13 21:41:38 legoater Exp $"; - -/* - * logging_event.c - * - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * - * See the COPYING file for the terms of usage and distribution. - */ - -#include -#include -#include -#include -#include - -/*******************************************************************************/ -extern log4c_logging_event_t* log4c_logging_event_new( - const char* a_category, - int a_priority, - const char* a_message) -{ - log4c_logging_event_t* evt; - - evt = sd_calloc(1, sizeof(log4c_logging_event_t)); - evt->evt_category = a_category; - evt->evt_priority = a_priority; - evt->evt_msg = a_message; - - SD_GETTIMEOFDAY(&evt->evt_timestamp, NULL); - - return evt; -} - -/*******************************************************************************/ -extern void log4c_logging_event_delete(log4c_logging_event_t* this) -{ - if (!this) - return; - - free(this); -} - diff --git a/import/log4c/log4c/logging_event.h b/import/log4c/log4c/logging_event.h deleted file mode 100644 index 3183062..0000000 --- a/import/log4c/log4c/logging_event.h +++ /dev/null @@ -1,86 +0,0 @@ -/* $Id: logging_event.h,v 1.8 2005/12/15 22:23:35 rbyrne Exp $ - * - * logging_event.h - * - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * - * See the COPYING file for the terms of usage and distribution. - */ - -#ifndef log4c_logging_event_h -#define log4c_logging_event_h - -/** - * @file logging_event.h - * - * @brief the internal representation of logging events. - * - * When a affirmative logging decision is made a log4c_logging_event - * instance is created. This instance is passed around the different log4c - * components. - **/ - -#include -#include -#include -#ifndef _WIN32 -#include -#endif - -__LOG4C_BEGIN_DECLS - -struct __log4c_category; - -/** - * @brief logging event object - * - * Attributes description: - * - * @li @c evt_category category name. - * @li @c evt_priority priority of logging event. - * @li @c evt_msg The application supplied message of logging event. - * @li @c evt_buffer a pre allocated buffer to be used by layouts to - * format in a multi-thread environment. - * @li @c evt_rendered_msg The application supplied message after layout format. - * @li @c evt_timestamp The number of seconds elapsed since the epoch - * (1/1/1970 00:00:00 UTC) until logging event was created. - * @li @c evt_loc The event's location information - **/ -typedef struct -{ - const char* evt_category; - int evt_priority; - const char* evt_msg; - const char* evt_rendered_msg; - log4c_buffer_t evt_buffer; - struct timeval evt_timestamp; - const log4c_location_info_t* evt_loc; - int evt_audit_id; - const char* evt_audit_s1; - const char* evt_audit_s2; - int evt_audit_d1; - int evt_audit_d2; -} log4c_logging_event_t; - -/** - * Constructor for a logging event. - * - * @param a_category the category name - * @param a_priority the category initial priority - * @param a_message the message of this event - * - * @todo need to handle multi-threading (NDC) - **/ -LOG4C_API log4c_logging_event_t* log4c_logging_event_new( - const char* a_category, - int a_priority, - const char* a_message); -/** - * Destructor for a logging event. - * @param a_event the logging event object - **/ -LOG4C_API void log4c_logging_event_delete(log4c_logging_event_t* a_event); - -__LOG4C_END_DECLS - -#endif diff --git a/import/log4c/log4c/priority.c b/import/log4c/log4c/priority.c deleted file mode 100644 index e03faab..0000000 --- a/import/log4c/log4c/priority.c +++ /dev/null @@ -1,58 +0,0 @@ -static const char version[] = "$Id: priority.c,v 1.4 2005/12/15 22:05:09 rbyrne Exp $"; - -/* - * priority.c - * - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * - * See the COPYING file for the terms of usage and distribution. - */ - -#include -#include -#include - -static const char* const priorities[] = { - "FATAL", - "ALERT", - "CRIT", - "ERROR", - "WARN", - "NOTICE", - "INFO", - "DEBUG", - "TRACE", - "NOTSET", - "UNKNOWN" -}; - -static const size_t npriorities = sizeof(priorities) / sizeof(priorities[0]); - -/*******************************************************************************/ -extern const char* log4c_priority_to_string(int a_priority) -{ - a_priority /= 100; - if ( (a_priority < 0) || (a_priority > 10) ) - a_priority = 10; - - return priorities[a_priority]; -} - -/*******************************************************************************/ -extern int log4c_priority_to_int(const char* a_priority_name) -{ - unsigned int i; - - if (a_priority_name) { - for (i = 0; i < npriorities; i++) { - if (!strncasecmp(priorities[i], - a_priority_name, - strlen(priorities[i]))) { - return i * 100; - } - } - } - - return LOG4C_PRIORITY_UNKNOWN; -} - diff --git a/import/log4c/log4c/priority.h b/import/log4c/log4c/priority.h deleted file mode 100644 index e566199..0000000 --- a/import/log4c/log4c/priority.h +++ /dev/null @@ -1,56 +0,0 @@ -/* $Id: priority.h,v 1.4 2005/12/13 22:12:49 legoater Exp $ - * - * priority.h - * - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * - * See the COPYING file for the terms of usage and distribution. - */ - -#ifndef log4c_priority_h -#define log4c_priority_h - -/** - * @file priority.h - * - * @brief The priority class provides importance levels with which one can - * categorize log messages. - **/ - -#include - -__LOG4C_BEGIN_DECLS - -/** - * Predefined Levels of priorities. These correspond to the priority levels - * used by syslog(3). - **/ -typedef enum { - /** . */ LOG4C_PRIORITY_FATAL = 000, - /** . */ LOG4C_PRIORITY_ALERT = 100, - /** . */ LOG4C_PRIORITY_CRIT = 200, - /** . */ LOG4C_PRIORITY_ERROR = 300, - /** . */ LOG4C_PRIORITY_WARN = 400, - /** . */ LOG4C_PRIORITY_NOTICE = 500, - /** . */ LOG4C_PRIORITY_INFO = 600, - /** . */ LOG4C_PRIORITY_DEBUG = 700, - /** . */ LOG4C_PRIORITY_TRACE = 800, - /** . */ LOG4C_PRIORITY_NOTSET = 900, - /** . */ LOG4C_PRIORITY_UNKNOWN = 1000 -} log4c_priority_level_t; - -/** - * @param a_priority a numeric value of the priority. - * @returns the given priority string name. - **/ -LOG4C_API const char* log4c_priority_to_string(int a_priority); - -/** - * @param a_priority_name a priority string name. - * @returns the given numeric value of the priority. - **/ -LOG4C_API int log4c_priority_to_int(const char* a_priority_name); - -__LOG4C_END_DECLS - -#endif diff --git a/import/log4c/log4c/rc.c b/import/log4c/log4c/rc.c deleted file mode 100644 index cdfeba6..0000000 --- a/import/log4c/log4c/rc.c +++ /dev/null @@ -1,213 +0,0 @@ -static const char version[] = "$Id: rc.c,v 1.7 2005/12/15 22:05:09 rbyrne Exp $"; - -/* - * rc.c - * - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * - * See the COPYING file for the terms of usage and distribution. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -static log4c_rc_t __log4c_rc = { { 0, 0, 0 } }; - -log4c_rc_t* const log4c_rc = &__log4c_rc; - -/******************************************************************************/ -static int config_load(log4c_rc_t* this, sd_domnode_t* anode) -{ - sd_list_iter_t* i = NULL; - - for (i = sd_list_begin(anode->children); i != sd_list_end(anode->children); - i = sd_list_iter_next(i)) - { - sd_domnode_t* node = i->data; - - if (!strcmp(node->name, "nocleanup")) { - this->config.nocleanup = atoi(node->value); - if (this->config.nocleanup) - sd_debug("deactivating log4c cleanup"); - } - - if (!strcmp(node->name, "bufsize")) { - this->config.bufsize = atoi(node->value); - - if (this->config.bufsize) - sd_debug("using fixed buffer size of %d bytes", - this->config.bufsize); - else - sd_debug("using dynamic allocated buffer"); - } - - if (!strcmp(node->name, "debug")) { - sd_domnode_t* level = sd_domnode_attrs_get(node, "level"); - - if (level) { - this->config.debug = atoi(level->value); - sd_debug("activating log4c debugging. level = %d", this->config.debug); - } - } - } - - return 0; -} - -/******************************************************************************/ -static int category_load(log4c_rc_t* this, sd_domnode_t* anode) -{ - sd_domnode_t* name = sd_domnode_attrs_get(anode, "name"); - sd_domnode_t* priority = sd_domnode_attrs_get(anode, "priority"); - sd_domnode_t* additivity = sd_domnode_attrs_get(anode, "additivity"); - sd_domnode_t* appender = sd_domnode_attrs_get(anode, "appender"); - log4c_category_t* cat = NULL; - - if (!name) { - sd_error("attribute \"name\" is missing"); - return -1; - } - - cat = log4c_category_get(name->value); - - if (priority) - log4c_category_set_priority( - cat, log4c_priority_to_int(priority->value)); - - if (additivity) { - if (!strcasecmp(additivity->value, "false")) { - log4c_category_set_additivity(cat, 0); - } else if (!strcasecmp(additivity->value, "true")) { - log4c_category_set_additivity(cat, 1); - } else { - sd_error("additivity value is invalid : %s", additivity->value); - } - } - - if (appender) - log4c_category_set_appender( - cat, log4c_appender_get(appender->value)); - - return 0; -} - -/******************************************************************************/ -static int appender_load(log4c_rc_t* this, sd_domnode_t* anode) -{ - sd_domnode_t* name = sd_domnode_attrs_get(anode, "name"); - sd_domnode_t* type = sd_domnode_attrs_get(anode, "type"); - sd_domnode_t* layout = sd_domnode_attrs_get(anode, "layout"); - log4c_appender_t* app = NULL; - - if (!name) { - sd_error("attribute \"name\" is missing"); - return -1; - } - - app = log4c_appender_get(name->value); - - if (type) { - log4c_appender_set_type(app, log4c_appender_type_get(type->value)); - // printf("set to type %s\n", type->value); - } - - if (layout) - log4c_appender_set_layout(app, log4c_layout_get(layout->value)); - - return 0; -} - -/******************************************************************************/ -static int layout_load(log4c_rc_t* this, sd_domnode_t* anode) -{ - sd_domnode_t* name = sd_domnode_attrs_get(anode, "name"); - sd_domnode_t* type = sd_domnode_attrs_get(anode, "type"); - log4c_layout_t* layout = NULL; - - if (!name) { - sd_error("attribute \"name\" is missing"); - return -1; - } - - layout = log4c_layout_get(name->value); - - if (type) - log4c_layout_set_type(layout, log4c_layout_type_get(type->value)); - - return 0; -} - -/******************************************************************************/ -extern int log4c_rc_load(log4c_rc_t* this, const char* a_filename) -{ - sd_list_iter_t* i = NULL; - sd_domnode_t* node = NULL; - sd_domnode_t* root_node = NULL; - - if (!this) - return -1; - - root_node = sd_domnode_new(NULL, NULL); - - if (sd_domnode_load(root_node, a_filename) == -1) { - sd_domnode_delete(root_node); - return -1; - } - - /* Check configuration file root node */ - if (strcmp(root_node->name, "log4c")) { - sd_error("invalid root name %s", root_node->name); - sd_domnode_delete(root_node); - return -1; - } - - /* Check configuration file revision */ - if ( (node = sd_domnode_attrs_get(root_node, "version")) != NULL) - if (strcmp(VERSION, node->value)) { - sd_error("version mismatch: %s != %s", VERSION, node->value); - printf("version mismatch %s, %s", VERSION, node->value); - sd_domnode_delete(root_node); - return -1; - } - - /* backward compatibility. */ - if ( (node = sd_domnode_attrs_get(root_node, "cleanup")) != NULL) { - sd_debug("attribute \"cleanup\" is deprecated"); - this->config.nocleanup = !atoi(node->value); - } - - /* load configuration elements */ - for (i = sd_list_begin(root_node->children); - i != sd_list_end(root_node->children); - i = sd_list_iter_next(i)) - { - sd_domnode_t* node = i->data; - - if (!strcmp(node->name, "category")) category_load(this, node); - if (!strcmp(node->name, "appender")) appender_load(this, node); - if (!strcmp(node->name, "layout")) layout_load(this, node); - if (!strcmp(node->name, "config")) config_load(this, node); - } - - sd_domnode_delete(root_node); - return 0; -} - -/******************************************************************************/ -extern int log4c_load(const char* a_filename) -{ - return log4c_rc_load(&__log4c_rc, a_filename); -} diff --git a/import/log4c/log4c/rc.h b/import/log4c/log4c/rc.h deleted file mode 100644 index cfcc869..0000000 --- a/import/log4c/log4c/rc.h +++ /dev/null @@ -1,64 +0,0 @@ -/* $Id: rc.h,v 1.7 2005/12/13 22:12:49 legoater Exp $ - * - * rc.h - * - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * - * See the COPYING file for the terms of usage and distribution. - */ - -#ifndef __log4c_rc_h -#define __log4c_rc_h - -/** - * @file rc.h - * - * @brief log4c resource configuration - * - **/ - -#include - -__LOG4C_BEGIN_DECLS - -/** - * @brief resource configuration object - * - * Attributes description: - * - * @li @c nocleanup don't perform memory cleanup in log4c library - * destructor or in log4c_fini() - * @li @c bufsize maximum logging buffer size. 0 for no limits - * @li @c debug activate log4c debugging - **/ -typedef struct -{ - struct - { - int nocleanup; - int bufsize; - int debug; - } config; - -} log4c_rc_t; - -/** - * default log4c resource configuration object - **/ -LOG4C_API log4c_rc_t * const log4c_rc; - -/** - * load log4c resource configuration file - * - * @param a_filename name of file to load - **/ -LOG4C_API int log4c_load(const char* a_filename); - -/** - * @internal - **/ -LOG4C_API int log4c_rc_load(log4c_rc_t* a_rc, const char* a_filename); - -__LOG4C_END_DECLS - -#endif diff --git a/import/log4c/log4c/version.c b/import/log4c/log4c/version.c deleted file mode 100644 index 0a81028..0000000 --- a/import/log4c/log4c/version.c +++ /dev/null @@ -1,25 +0,0 @@ -static const char version[] = "$Id: version.c,v 1.3 2003/09/12 21:06:45 legoater Exp $"; - -/* - * version.c - * - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * - * See the COPYING file for the terms of usage and distribution. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -const int log4c_major_version = LOG4C_MAJOR_VERSION; -const int log4c_minor_version = LOG4C_MINOR_VERSION; -const int log4c_micro_version = LOG4C_MICRO_VERSION; - -/*******************************************************************************/ -extern const char* log4c_version(void) -{ - return VERSION; -} diff --git a/import/log4c/log4c/version.h b/import/log4c/log4c/version.h deleted file mode 100644 index 38d2a4e..0000000 --- a/import/log4c/log4c/version.h +++ /dev/null @@ -1,57 +0,0 @@ -/* $Id: version.h.in,v 1.3 2003/09/12 21:06:45 legoater Exp $ - * - * version.h - * - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * - * See the COPYING file for the terms of usage and distribution. - */ - -#ifndef log4c_version_h -#define log4c_version_h - -/** - * @file version.h - * - * @brief log4c version information - **/ - -#include - -__LOG4C_BEGIN_DECLS - -/** - * constant macro holding the major version of log4c - **/ -#define LOG4C_MAJOR_VERSION 1 -/** - * constant macro holding the minor version of log4c - **/ -#define LOG4C_MINOR_VERSION 0 -/** - * constant macro holding the micro version of log4c - **/ -#define LOG4C_MICRO_VERSION 12 - -/** - * constant variable holding the major version of log4c - **/ -extern const int log4c_major_version; -/** - * constant variable holding the minor version of log4c - **/ -extern const int log4c_minor_version; -/** - * constant variable holding the micro version of log4c - **/ -extern const int log4c_micro_version; - -/** - * @return a string containing the full log4c version - **/ -extern const char* log4c_version(void); - -__LOG4C_END_DECLS - -#endif - diff --git a/import/log4c/sd/Makefile.am b/import/log4c/sd/Makefile.am deleted file mode 100644 index b4ba586..0000000 --- a/import/log4c/sd/Makefile.am +++ /dev/null @@ -1,36 +0,0 @@ -INCLUDES = \ - -I$(srcdir)/../ - -noinst_LTLIBRARIES = libbongolog4c_sd.la - -libbongolog4c_sd_la_SOURCES = \ - error.h \ - defs.h \ - stack.h \ - stack.c \ - list.h \ - list.c \ - malloc.h \ - malloc.c \ - domnode.h \ - domnode-xml.h \ - domnode-xml.c \ - domnode-xml-parser.h \ - domnode-xml-parser.c \ - domnode-xml-scanner.h \ - domnode-xml-scanner.c \ - domnode.c \ - factory.h \ - factory.c \ - hash.h \ - hash.c \ - sd_xplatform.h \ - sprintf.h \ - sprintf.c \ - test.h \ - test.c -libbongolog4c_sd_la_LDFLAGS = - -EXTRA_libbongolog4c_sd_la_SOURCES = \ - sprintf.osf.c - diff --git a/import/log4c/sd/defs.h b/import/log4c/sd/defs.h deleted file mode 100644 index 0ad2b6e..0000000 --- a/import/log4c/sd/defs.h +++ /dev/null @@ -1,19 +0,0 @@ -/* $Id: defs.h,v 1.3 2003/09/12 21:06:45 legoater Exp $ - * - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * - * See the COPYING file for the terms of usage and distribution. - */ - -#ifndef __sd_defs_h -#define __sd_defs_h - -#ifdef __cplusplus -# define __SD_BEGIN_DECLS extern "C" { -# define __SD_END_DECLS } -#else -# define __SD_BEGIN_DECLS -# define __SD_END_DECLS -#endif - -#endif diff --git a/import/log4c/sd/domnode-xml-parser.c b/import/log4c/sd/domnode-xml-parser.c deleted file mode 100644 index 6209f35..0000000 --- a/import/log4c/sd/domnode-xml-parser.c +++ /dev/null @@ -1,1283 +0,0 @@ -/* A Bison parser, made from ../../../src/sd/domnode-xml-parser.y - by GNU bison 1.35. */ - -#define YYBISON 1 /* Identify Bison output. */ - -#define yyparse __sd_domnode_xml_parse -#define yylex __sd_domnode_xml_lex -#define yyerror __sd_domnode_xml_error -#define yylval __sd_domnode_xml_lval -#define yychar __sd_domnode_xml_char -#define yydebug __sd_domnode_xml_debug -#define yynerrs __sd_domnode_xml_nerrs -# define ENDDEF 257 -# define EQ 258 -# define SLASH 259 -# define CLOSE 260 -# define END 261 -# define NAME 262 -# define VALUE 263 -# define DATA 264 -# define COMMENT 265 -# define START 266 - -#line 1 "../../../src/sd/domnode-xml-parser.y" - -#include -#include -#include -#include -#include "error.h" -#include "malloc.h" -#include "domnode-xml.h" - -/* Generated by bison(1) */ -#include "domnode-xml-parser.h" - -/* Generated by flex(1) */ -#define YY_HEADER_NO_UNDEFS 1 -#include "domnode-xml-scanner.h" - -#define YYPARSE_PARAM __a_maker -#define a_maker ((struct __sd_domnode_xml_maker*) YYPARSE_PARAM) -#define YYLEX_PARAM (a_maker->scanner) - -#ifdef strdup -# undef strdup -#endif -#define strdup sd_strdup -#ifdef malloc -# undef malloc -#endif -#define malloc sd_malloc -#ifdef calloc -# undef calloc -#endif -#define calloc sd_calloc -#ifdef realloc -# undef realloc -#endif -#define realloc sd_realloc -#ifdef yyerror -# undef yyerror -#endif -#define yyerror sd_error - -static void domnode_attribute(struct __sd_domnode_xml_maker*, const char*, - const char*); - -#line 52 "../../../src/sd/domnode-xml-parser.y" -#ifndef YYSTYPE -typedef union { char *s; } yystype; -# define YYSTYPE yystype -# define YYSTYPE_IS_TRIVIAL 1 -#endif -#ifndef YYDEBUG -# define YYDEBUG 1 -#endif - - - -#define YYFINAL 27 -#define YYFLAG -32768 -#define YYNTBASE 13 - -/* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */ -#define YYTRANSLATE(x) ((unsigned)(x) <= 266 ? yytranslate[x] : 23) - -/* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */ -static const char yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 3, 4, 5, - 6, 7, 8, 9, 10, 11, 12 -}; - -#if YYDEBUG -static const short yyprhs[] = -{ - 0, 0, 4, 7, 8, 10, 11, 16, 19, 25, - 28, 31, 34, 35, 37, 40, 41, 43 -}; -static const short yyrhs[] = -{ - 14, 16, 14, 0, 14, 15, 0, 0, 11, 0, - 0, 12, 17, 21, 18, 0, 5, 6, 0, 6, - 19, 7, 20, 6, 0, 19, 10, 0, 19, 16, - 0, 19, 15, 0, 0, 8, 0, 21, 22, 0, - 0, 8, 0, 8, 4, 9, 0 -}; - -#endif - -#if YYDEBUG -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const short yyrline[] = -{ - 0, 61, 65, 66, 70, 84, 84, 118, 126, 146, - 156, 157, 158, 162, 169, 170, 174, 180 -}; -#endif - - -#if (YYDEBUG) || defined YYERROR_VERBOSE - -/* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */ -static const char *const yytname[] = -{ - "$", "error", "$undefined.", "ENDDEF", "EQ", "SLASH", "CLOSE", "END", - "NAME", "VALUE", "DATA", "COMMENT", "START", "document", "misc", - "comment", "element", "@1", "empty_or_content", "content", "name", - "attribute_seq_opt", "attribute", 0 -}; -#endif - -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const short yyr1[] = -{ - 0, 13, 14, 14, 15, 17, 16, 18, 18, 19, - 19, 19, 19, 20, 21, 21, 22, 22 -}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const short yyr2[] = -{ - 0, 3, 2, 0, 1, 0, 4, 2, 5, 2, - 2, 2, 0, 1, 2, 0, 1, 3 -}; - -/* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE - doesn't specify something else to do. Zero means the default is an - error. */ -static const short yydefact[] = -{ - 3, 0, 4, 5, 2, 3, 15, 1, 0, 0, - 12, 16, 6, 14, 7, 0, 0, 0, 9, 11, - 10, 17, 13, 0, 8, 0, 0, 0 -}; - -static const short yydefgoto[] = -{ - 25, 1, 4, 5, 6, 12, 15, 23, 8, 13 -}; - -static const short yypact[] = -{ - -32768, -10,-32768,-32768,-32768,-32768,-32768, -3, 1, 4, - -32768, 7,-32768,-32768,-32768, -7, 3, 5,-32768,-32768, - -32768,-32768,-32768, 8,-32768, 15, 16,-32768 -}; - -static const short yypgoto[] = -{ - -32768, 12, 6, 9,-32768,-32768,-32768,-32768,-32768,-32768 -}; - - -#define YYLAST 24 - - -static const short yytable[] = -{ - 17, 2, 3, 18, 2, 3, 9, 10, 2, 11, - 14, 16, 21, 22, 24, 26, 27, 7, 0, 0, - 0, 19, 0, 0, 20 -}; - -static const short yycheck[] = -{ - 7, 11, 12, 10, 11, 12, 5, 6, 11, 8, - 6, 4, 9, 8, 6, 0, 0, 5, -1, -1, - -1, 15, -1, -1, 15 -}; -#define YYPURE 1 - -/* -*-C-*- Note some compilers choke on comments on `#line' lines. */ -#line 3 "/usr/share/bison/bison.simple" - -/* Skeleton output parser for bison, - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software - Foundation, Inc. - - 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, 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. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -/* This is the parser code that is written into each bison parser when - the %semantic_parser declaration is not specified in the grammar. - It was written by Richard Stallman by simplifying the hairy parser - used when %semantic_parser is specified. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -#if ! defined (yyoverflow) || defined (YYERROR_VERBOSE) - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# if YYSTACK_USE_ALLOCA -# define YYSTACK_ALLOC alloca -# else -# ifndef YYSTACK_USE_ALLOCA -# if defined (alloca) || defined (_ALLOCA_H) -# define YYSTACK_ALLOC alloca -# else -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) -# else -# if defined (__STDC__) || defined (__cplusplus) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# endif -# define YYSTACK_ALLOC malloc -# define YYSTACK_FREE free -# endif -#endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */ - - -#if (! defined (yyoverflow) \ - && (! defined (__cplusplus) \ - || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - short yyss; - YYSTYPE yyvs; -# if YYLSP_NEEDED - YYLTYPE yyls; -# endif -}; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# if YYLSP_NEEDED -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ - + 2 * YYSTACK_GAP_MAX) -# else -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAX) -# endif - -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - register YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (0) -# endif -# endif - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack, Stack, yysize); \ - Stack = &yyptr->Stack; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (0) - -#endif - - -#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) -# define YYSIZE_T __SIZE_TYPE__ -#endif -#if ! defined (YYSIZE_T) && defined (size_t) -# define YYSIZE_T size_t -#endif -#if ! defined (YYSIZE_T) -# if defined (__STDC__) || defined (__cplusplus) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# endif -#endif -#if ! defined (YYSIZE_T) -# define YYSIZE_T unsigned int -#endif - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY -2 -#define YYEOF 0 -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrlab1 -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ -#define YYFAIL goto yyerrlab -#define YYRECOVERING() (!!yyerrstatus) -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - yychar1 = YYTRANSLATE (yychar); \ - YYPOPSTACK; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror ("syntax error: cannot back up"); \ - YYERROR; \ - } \ -while (0) - -#define YYTERROR 1 -#define YYERRCODE 256 - - -/* YYLLOC_DEFAULT -- Compute the default location (before the actions - are run). - - When YYLLOC_DEFAULT is run, CURRENT is set the location of the - first token. By default, to implement support for ranges, extend - its range to the last symbol. */ - -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - Current.last_line = Rhs[N].last_line; \ - Current.last_column = Rhs[N].last_column; -#endif - - -/* YYLEX -- calling `yylex' with the right arguments. */ - -#if YYPURE -# if YYLSP_NEEDED -# ifdef YYLEX_PARAM -# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) -# else -# define YYLEX yylex (&yylval, &yylloc) -# endif -# else /* !YYLSP_NEEDED */ -# ifdef YYLEX_PARAM -# define YYLEX yylex (&yylval, YYLEX_PARAM) -# else -# define YYLEX yylex (&yylval) -# endif -# endif /* !YYLSP_NEEDED */ -#else /* !YYPURE */ -# define YYLEX yylex () -#endif /* !YYPURE */ - - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (0) -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -#endif /* !YYDEBUG */ - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#if YYMAXDEPTH == 0 -# undef YYMAXDEPTH -#endif - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - -#ifdef YYERROR_VERBOSE - -# ifndef yystrlen -# if defined (__GLIBC__) && defined (_STRING_H) -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -static YYSIZE_T -# if defined (__STDC__) || defined (__cplusplus) -yystrlen (const char *yystr) -# else -yystrlen (yystr) - const char *yystr; -# endif -{ - register const char *yys = yystr; - - while (*yys++ != '\0') - continue; - - return yys - yystr - 1; -} -# endif -# endif - -# ifndef yystpcpy -# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -static char * -# if defined (__STDC__) || defined (__cplusplus) -yystpcpy (char *yydest, const char *yysrc) -# else -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -# endif -{ - register char *yyd = yydest; - register const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif -#endif - -#line 315 "/usr/share/bison/bison.simple" - - -/* The user can define YYPARSE_PARAM as the name of an argument to be passed - into yyparse. The argument should have type void *. - It should actually point to an object. - Grammar actions can access the variable by casting it - to the proper pointer type. */ - -#ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -# define YYPARSE_PARAM_ARG void *YYPARSE_PARAM -# define YYPARSE_PARAM_DECL -# else -# define YYPARSE_PARAM_ARG YYPARSE_PARAM -# define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; -# endif -#else /* !YYPARSE_PARAM */ -# define YYPARSE_PARAM_ARG -# define YYPARSE_PARAM_DECL -#endif /* !YYPARSE_PARAM */ - -/* Prevent warning if -Wstrict-prototypes. */ -#ifdef __GNUC__ -# ifdef YYPARSE_PARAM -int yyparse (void *); -# else -int yyparse (void); -# endif -#endif - -/* YY_DECL_VARIABLES -- depending whether we use a pure parser, - variables are global, or local to YYPARSE. */ - -#define YY_DECL_NON_LSP_VARIABLES \ -/* The lookahead symbol. */ \ -int yychar; \ - \ -/* The semantic value of the lookahead symbol. */ \ -YYSTYPE yylval; \ - \ -/* Number of parse errors so far. */ \ -int yynerrs; - -#if YYLSP_NEEDED -# define YY_DECL_VARIABLES \ -YY_DECL_NON_LSP_VARIABLES \ - \ -/* Location data for the lookahead symbol. */ \ -YYLTYPE yylloc; -#else -# define YY_DECL_VARIABLES \ -YY_DECL_NON_LSP_VARIABLES -#endif - - -/* If nonreentrant, generate the variables here. */ - -#if !YYPURE -YY_DECL_VARIABLES -#endif /* !YYPURE */ - -int -yyparse (YYPARSE_PARAM_ARG) - YYPARSE_PARAM_DECL -{ - /* If reentrant, generate the variables here. */ -#if YYPURE - YY_DECL_VARIABLES -#endif /* !YYPURE */ - - register int yystate; - register int yyn; - int yyresult; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - /* Lookahead token as an internal (translated) token number. */ - int yychar1 = 0; - - /* Three stacks and their tools: - `yyss': related to states, - `yyvs': related to semantic values, - `yyls': related to locations. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - short yyssa[YYINITDEPTH]; - short *yyss = yyssa; - register short *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - register YYSTYPE *yyvsp; - -#if YYLSP_NEEDED - /* The location stack. */ - YYLTYPE yylsa[YYINITDEPTH]; - YYLTYPE *yyls = yylsa; - YYLTYPE *yylsp; -#endif - -#if YYLSP_NEEDED -# define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) -#else -# define YYPOPSTACK (yyvsp--, yyssp--) -#endif - - YYSIZE_T yystacksize = YYINITDEPTH; - - - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; -#if YYLSP_NEEDED - YYLTYPE yyloc; -#endif - - /* When reducing, the number of symbols on the RHS of the reduced - rule. */ - int yylen; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - - yyssp = yyss; - yyvsp = yyvs; -#if YYLSP_NEEDED - yylsp = yyls; -#endif - goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. - */ - yyssp++; - - yysetstate: - *yyssp = yystate; - - if (yyssp >= yyss + yystacksize - 1) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - short *yyss1 = yyss; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. */ -# if YYLSP_NEEDED - YYLTYPE *yyls1 = yyls; - /* This used to be a conditional around just the two extra args, - but that might be undefined if yyoverflow is a macro. */ - yyoverflow ("parser stack overflow", - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yyls1, yysize * sizeof (*yylsp), - &yystacksize); - yyls = yyls1; -# else - yyoverflow ("parser stack overflow", - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); -# endif - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyoverflowlab; -# else - /* Extend the stack our own way. */ - if (yystacksize >= YYMAXDEPTH) - goto yyoverflowlab; - yystacksize *= 2; - if (yystacksize > YYMAXDEPTH) - yystacksize = YYMAXDEPTH; - - { - short *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyoverflowlab; - YYSTACK_RELOCATE (yyss); - YYSTACK_RELOCATE (yyvs); -# if YYLSP_NEEDED - YYSTACK_RELOCATE (yyls); -# endif -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; -#if YYLSP_NEEDED - yylsp = yyls + yysize - 1; -#endif - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); - - if (yyssp >= yyss + yystacksize - 1) - YYABORT; - } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - - goto yybackup; - - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - -/* Do appropriate processing given the current state. */ -/* Read a lookahead token if we need one and don't already have one. */ -/* yyresume: */ - - /* First try to decide what to do without reference to lookahead token. */ - - yyn = yypact[yystate]; - if (yyn == YYFLAG) - goto yydefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* yychar is either YYEMPTY or YYEOF - or a valid token in external form. */ - - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; - } - - /* Convert token to internal form (in yychar1) for indexing tables with */ - - if (yychar <= 0) /* This means end of input. */ - { - yychar1 = 0; - yychar = YYEOF; /* Don't call YYLEX any more */ - - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yychar1 = YYTRANSLATE (yychar); - -#if YYDEBUG - /* We have to keep this `#if YYDEBUG', since we use variables - which are defined only if `YYDEBUG' is set. */ - if (yydebug) - { - YYFPRINTF (stderr, "Next token is %d (%s", - yychar, yytname[yychar1]); - /* Give the individual parser a way to print the precise - meaning of a token, for further debugging info. */ -# ifdef YYPRINT - YYPRINT (stderr, yychar, yylval); -# endif - YYFPRINTF (stderr, ")\n"); - } -#endif - } - - yyn += yychar1; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) - goto yydefault; - - yyn = yytable[yyn]; - - /* yyn is what to do for this token type in this state. - Negative => reduce, -yyn is rule number. - Positive => shift, yyn is new state. - New state is final state => don't bother to shift, - just return success. - 0, or most negative number => error. */ - - if (yyn < 0) - { - if (yyn == YYFLAG) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - else if (yyn == 0) - goto yyerrlab; - - if (yyn == YYFINAL) - YYACCEPT; - - /* Shift the lookahead token. */ - YYDPRINTF ((stderr, "Shifting token %d (%s), ", - yychar, yytname[yychar1])); - - /* Discard the token being shifted unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; - - *++yyvsp = yylval; -#if YYLSP_NEEDED - *++yylsp = yylloc; -#endif - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - yystate = yyn; - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. - - Otherwise, the following line sets YYVAL to the semantic value of - the lookahead token. This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - -#if YYLSP_NEEDED - /* Similarly for the default location. Let the user run additional - commands if for instance locations are ranges. */ - yyloc = yylsp[1-yylen]; - YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); -#endif - -#if YYDEBUG - /* We have to keep this `#if YYDEBUG', since we use variables which - are defined only if `YYDEBUG' is set. */ - if (yydebug) - { - int yyi; - - YYFPRINTF (stderr, "Reducing via rule %d (line %d), ", - yyn, yyrline[yyn]); - - /* Print the symbols being reduced, and their result. */ - for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++) - YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); - YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]); - } -#endif - - switch (yyn) { - -case 4: -#line 71 "../../../src/sd/domnode-xml-parser.y" -{ - sd_domnode_t* node = sd_stack_peek(a_maker->elements); - - if (node) { - sd_debug("COMMENT: add comment '%s' to node '%s'\n", yyvsp[0].s, node->name); - sd_list_append(node->children, __sd_domnode_new("#comment", yyvsp[0].s, 0)); - /* $1 was obtain with strdup() */ - free(yyvsp[0].s); - } -; - break;} -case 5: -#line 85 "../../../src/sd/domnode-xml-parser.y" -{ - sd_domnode_t* parent = sd_stack_peek(a_maker->elements); - sd_domnode_t* node = __sd_domnode_new(yyvsp[0].s, 0, 1); - -#ifdef __SD_DEBUG__ - { - static void* __debug = 0; - if (! __debug) { - __debug = getenv("SD_DEBUG"); - if (__debug) - yydebug = 1; - else - __debug = (void*) 0x1; - } - } -#endif - - if (parent) { - sd_debug("START: add child '%s' to node '%s'\n", yyvsp[0].s, parent->name); - sd_list_append(parent->children, node); - } else { - sd_debug("START: add root'%s'\n", yyvsp[0].s); - a_maker->root = node; - } - - sd_stack_push(a_maker->elements, node); - free(yyvsp[0].s); -; - break;} -case 7: -#line 119 "../../../src/sd/domnode-xml-parser.y" -{ - sd_domnode_t* node = sd_stack_peek(a_maker->elements); - assert(node != 0); - - sd_debug("END: simple node '%s'\n", node->name); - sd_stack_pop(a_maker->elements); -; - break;} -case 8: -#line 127 "../../../src/sd/domnode-xml-parser.y" -{ - sd_domnode_t* node = sd_stack_peek(a_maker->elements); - assert(node != 0); - - sd_debug("END: node '%s'\n", yyvsp[-1].s); - - if (strcmp(node->name, yyvsp[-1].s)) { - yyerror("got instead of \n", yyvsp[-1].s, node->name); - YYERROR; - } - - /* $4 was obtain with strdup() */ - free(yyvsp[-1].s); - - sd_stack_pop(a_maker->elements); -; - break;} -case 9: -#line 147 "../../../src/sd/domnode-xml-parser.y" -{ - sd_domnode_t* node = sd_stack_peek(a_maker->elements); - assert(node != 0); - - sd_debug("CONTENT: add cvalue '%s' to node '%s'\n", yyvsp[0].s, node->name); - - /* $2 was obtain with strdup() */ - node->value = yyvsp[0].s; -; - break;} -case 13: -#line 163 "../../../src/sd/domnode-xml-parser.y" -{ - yyval.s = yyvsp[0].s; -; - break;} -case 16: -#line 175 "../../../src/sd/domnode-xml-parser.y" -{ - domnode_attribute(a_maker, yyvsp[0].s, ""); - /* $1 was obtain with strdup() */ - free(yyvsp[0].s); -; - break;} -case 17: -#line 181 "../../../src/sd/domnode-xml-parser.y" -{ - domnode_attribute(a_maker, yyvsp[-2].s, yyvsp[0].s); - /* $1 was obtain with strdup() */ - free(yyvsp[-2].s); - /* $3 was obtain with strdup() */ - free(yyvsp[0].s); -; - break;} -} - -#line 705 "/usr/share/bison/bison.simple" - - - yyvsp -= yylen; - yyssp -= yylen; -#if YYLSP_NEEDED - yylsp -= yylen; -#endif - -#if YYDEBUG - if (yydebug) - { - short *yyssp1 = yyss - 1; - YYFPRINTF (stderr, "state stack now"); - while (yyssp1 != yyssp) - YYFPRINTF (stderr, " %d", *++yyssp1); - YYFPRINTF (stderr, "\n"); - } -#endif - - *++yyvsp = yyval; -#if YYLSP_NEEDED - *++yylsp = yyloc; -#endif - - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTBASE] + *yyssp; - if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTBASE]; - - goto yynewstate; - - -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ -yyerrlab: - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; - -#ifdef YYERROR_VERBOSE - yyn = yypact[yystate]; - - if (yyn > YYFLAG && yyn < YYLAST) - { - YYSIZE_T yysize = 0; - char *yymsg; - int yyx, yycount; - - yycount = 0; - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - for (yyx = yyn < 0 ? -yyn : 0; - yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) - if (yycheck[yyx + yyn] == yyx) - yysize += yystrlen (yytname[yyx]) + 15, yycount++; - yysize += yystrlen ("parse error, unexpected ") + 1; - yysize += yystrlen (yytname[YYTRANSLATE (yychar)]); - yymsg = (char *) YYSTACK_ALLOC (yysize); - if (yymsg != 0) - { - char *yyp = yystpcpy (yymsg, "parse error, unexpected "); - yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]); - - if (yycount < 5) - { - yycount = 0; - for (yyx = yyn < 0 ? -yyn : 0; - yyx < (int) (sizeof (yytname) / sizeof (char *)); - yyx++) - if (yycheck[yyx + yyn] == yyx) - { - const char *yyq = ! yycount ? ", expecting " : " or "; - yyp = yystpcpy (yyp, yyq); - yyp = yystpcpy (yyp, yytname[yyx]); - yycount++; - } - } - yyerror (yymsg); - YYSTACK_FREE (yymsg); - } - else - yyerror ("parse error; also virtual memory exhausted"); - } - else -#endif /* defined (YYERROR_VERBOSE) */ - yyerror ("parse error"); - } - goto yyerrlab1; - - -/*--------------------------------------------------. -| yyerrlab1 -- error raised explicitly by an action | -`--------------------------------------------------*/ -yyerrlab1: - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - /* return failure if at end of input */ - if (yychar == YYEOF) - YYABORT; - YYDPRINTF ((stderr, "Discarding token %d (%s).\n", - yychar, yytname[yychar1])); - yychar = YYEMPTY; - } - - /* Else will try to reuse lookahead token after shifting the error - token. */ - - yyerrstatus = 3; /* Each real token shifted decrements this */ - - goto yyerrhandle; - - -/*-------------------------------------------------------------------. -| yyerrdefault -- current state does not do anything special for the | -| error token. | -`-------------------------------------------------------------------*/ -yyerrdefault: -#if 0 - /* This is wrong; only states that explicitly want error tokens - should shift them. */ - - /* If its default is to accept any token, ok. Otherwise pop it. */ - yyn = yydefact[yystate]; - if (yyn) - goto yydefault; -#endif - - -/*---------------------------------------------------------------. -| yyerrpop -- pop the current state because it cannot handle the | -| error token | -`---------------------------------------------------------------*/ -yyerrpop: - if (yyssp == yyss) - YYABORT; - yyvsp--; - yystate = *--yyssp; -#if YYLSP_NEEDED - yylsp--; -#endif - -#if YYDEBUG - if (yydebug) - { - short *yyssp1 = yyss - 1; - YYFPRINTF (stderr, "Error: state stack now"); - while (yyssp1 != yyssp) - YYFPRINTF (stderr, " %d", *++yyssp1); - YYFPRINTF (stderr, "\n"); - } -#endif - -/*--------------. -| yyerrhandle. | -`--------------*/ -yyerrhandle: - yyn = yypact[yystate]; - if (yyn == YYFLAG) - goto yyerrdefault; - - yyn += YYTERROR; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) - goto yyerrdefault; - - yyn = yytable[yyn]; - if (yyn < 0) - { - if (yyn == YYFLAG) - goto yyerrpop; - yyn = -yyn; - goto yyreduce; - } - else if (yyn == 0) - goto yyerrpop; - - if (yyn == YYFINAL) - YYACCEPT; - - YYDPRINTF ((stderr, "Shifting error token, ")); - - *++yyvsp = yylval; -#if YYLSP_NEEDED - *++yylsp = yylloc; -#endif - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -/*---------------------------------------------. -| yyoverflowab -- parser overflow comes here. | -`---------------------------------------------*/ -yyoverflowlab: - yyerror ("parser stack overflow"); - yyresult = 2; - /* Fall through. */ - -yyreturn: -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif - return yyresult; -} -#line 190 "../../../src/sd/domnode-xml-parser.y" - -#undef a_maker - -/******************************************************************************/ -static void domnode_attribute(struct __sd_domnode_xml_maker* a_maker, - const char* a_name, const char* a_value) -{ - sd_domnode_t* node = sd_stack_peek(a_maker->elements); - assert(node != 0); - - sd_debug("ATTR: add atrribute '%s'='%s' to node '%s'\n", a_name, a_value, - node->name); - - sd_list_append(node->attrs, __sd_domnode_new(a_name, a_value, 0)); -} diff --git a/import/log4c/sd/domnode-xml-parser.h b/import/log4c/sd/domnode-xml-parser.h deleted file mode 100644 index 750be0c..0000000 --- a/import/log4c/sd/domnode-xml-parser.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef BISON_DOMNODE_XML_PARSER_H -# define BISON_DOMNODE_XML_PARSER_H - -#ifndef YYSTYPE -typedef union { char *s; } yystype; -# define YYSTYPE yystype -# define YYSTYPE_IS_TRIVIAL 1 -#endif -# define ENDDEF 257 -# define EQ 258 -# define SLASH 259 -# define CLOSE 260 -# define END 261 -# define NAME 262 -# define VALUE 263 -# define DATA 264 -# define COMMENT 265 -# define START 266 - - -#endif /* not BISON_DOMNODE_XML_PARSER_H */ diff --git a/import/log4c/sd/domnode-xml-parser.y b/import/log4c/sd/domnode-xml-parser.y deleted file mode 100644 index 689d88d..0000000 --- a/import/log4c/sd/domnode-xml-parser.y +++ /dev/null @@ -1,204 +0,0 @@ -%{ -#include -#include -#include -#include -#include "error.h" -#include "malloc.h" -#include "domnode-xml.h" - -/* Generated by bison(1) */ -#include "domnode-xml-parser.h" - -/* Generated by flex(1) */ -#define YY_HEADER_NO_UNDEFS 1 -#include "domnode-xml-scanner.h" - -#define YYPARSE_PARAM __a_maker -#define a_maker ((struct __sd_domnode_xml_maker*) YYPARSE_PARAM) -#define YYLEX_PARAM (a_maker->scanner) - -#ifdef strdup -# undef strdup -#endif -#define strdup sd_strdup -#ifdef malloc -# undef malloc -#endif -#define malloc sd_malloc -#ifdef calloc -# undef calloc -#endif -#define calloc sd_calloc -#ifdef realloc -# undef realloc -#endif -#define realloc sd_realloc -#ifdef yyerror -# undef yyerror -#endif -#define yyerror sd_error - -static void domnode_attribute(struct __sd_domnode_xml_maker*, const char*, - const char*); -%} - -%name-prefix="__sd_domnode_xml_" -%pure_parser -%debug -%defines -%output="domnode-xml-parser.c" - -%union { char *s; } - -%token ENDDEF EQ SLASH CLOSE END -%token NAME VALUE DATA COMMENT START -%type name - -%% - -document -: misc element misc -; - -misc -: misc comment -| /* empty */ -; - -comment -: COMMENT -{ - sd_domnode_t* node = sd_stack_peek(a_maker->elements); - - if (node) { - sd_debug("COMMENT: add comment '%s' to node '%s'\n", $1, node->name); - sd_list_append(node->children, __sd_domnode_new("#comment", $1, 0)); - /* $1 was obtain with strdup() */ - free($1); - } -} -; - -element -: START -{ - sd_domnode_t* parent = sd_stack_peek(a_maker->elements); - sd_domnode_t* node = __sd_domnode_new($1, 0, 1); - -#ifdef __SD_DEBUG__ - { - static void* __debug = 0; - if (! __debug) { - __debug = getenv("SD_DEBUG"); - if (__debug) - yydebug = 1; - else - __debug = (void*) 0x1; - } - } -#endif - - if (parent) { - sd_debug("START: add child '%s' to node '%s'\n", $1, parent->name); - sd_list_append(parent->children, node); - } else { - sd_debug("START: add root'%s'\n", $1); - a_maker->root = node; - } - - sd_stack_push(a_maker->elements, node); - free($1); -} -attribute_seq_opt -empty_or_content -; - -empty_or_content -: SLASH CLOSE -{ - sd_domnode_t* node = sd_stack_peek(a_maker->elements); - assert(node != 0); - - sd_debug("END: simple node '%s'\n", node->name); - sd_stack_pop(a_maker->elements); -} -| CLOSE content END name CLOSE -{ - sd_domnode_t* node = sd_stack_peek(a_maker->elements); - assert(node != 0); - - sd_debug("END: node '%s'\n", $4); - - if (strcmp(node->name, $4)) { - yyerror("got instead of \n", $4, node->name); - YYERROR; - } - - /* $4 was obtain with strdup() */ - free($4); - - sd_stack_pop(a_maker->elements); -} -; - -content -: content DATA -{ - sd_domnode_t* node = sd_stack_peek(a_maker->elements); - assert(node != 0); - - sd_debug("CONTENT: add cvalue '%s' to node '%s'\n", $2, node->name); - - /* $2 was obtain with strdup() */ - node->value = $2; -} -| content element -| content comment -| /*empty*/ -; - -name -: NAME -{ - $$ = $1; -} -; - -attribute_seq_opt -: attribute_seq_opt attribute -| /*empty*/ -; - -attribute -: NAME -{ - domnode_attribute(a_maker, $1, ""); - /* $1 was obtain with strdup() */ - free($1); -} -| NAME EQ VALUE -{ - domnode_attribute(a_maker, $1, $3); - /* $1 was obtain with strdup() */ - free($1); - /* $3 was obtain with strdup() */ - free($3); -} -; - -%% -#undef a_maker - -/******************************************************************************/ -static void domnode_attribute(struct __sd_domnode_xml_maker* a_maker, - const char* a_name, const char* a_value) -{ - sd_domnode_t* node = sd_stack_peek(a_maker->elements); - assert(node != 0); - - sd_debug("ATTR: add atrribute '%s'='%s' to node '%s'\n", a_name, a_value, - node->name); - - sd_list_append(node->attrs, __sd_domnode_new(a_name, a_value, 0)); -} diff --git a/import/log4c/sd/domnode-xml-scanner.c b/import/log4c/sd/domnode-xml-scanner.c deleted file mode 100644 index 969dbba..0000000 --- a/import/log4c/sd/domnode-xml-scanner.c +++ /dev/null @@ -1,3805 +0,0 @@ -#define YY_REENTRANT 1 -#define YY_BISON_BRIDGE 1 -#ifndef YY_REENTRANT -#define yytext __sd_domnode_xml_text -#define yyleng __sd_domnode_xml_leng -#define yyin __sd_domnode_xml_in -#define yyout __sd_domnode_xml_out -#define yy_flex_debug __sd_domnode_xml__flex_debug -#endif -#define yy_create_buffer __sd_domnode_xml__create_buffer -#define yy_delete_buffer __sd_domnode_xml__delete_buffer -#define yy_scan_buffer __sd_domnode_xml__scan_buffer -#define yy_scan_string __sd_domnode_xml__scan_string -#define yy_scan_bytes __sd_domnode_xml__scan_bytes -#define yy_init_buffer __sd_domnode_xml__init_buffer -#define yy_flush_buffer __sd_domnode_xml__flush_buffer -#define yy_load_buffer_state __sd_domnode_xml__load_buffer_state -#define yy_switch_to_buffer __sd_domnode_xml__switch_to_buffer -#define yylex __sd_domnode_xml_lex -#define yyrestart __sd_domnode_xml_restart -#define yylex_init __sd_domnode_xml_lex_init -#define yylex_destroy __sd_domnode_xml_lex_destroy -#define yyget_debug __sd_domnode_xml_get_debug -#define yyset_debug __sd_domnode_xml_set_debug -#define yyget_extra __sd_domnode_xml_get_extra -#define yyset_extra __sd_domnode_xml_set_extra -#define yyget_in __sd_domnode_xml_get_in -#define yyset_in __sd_domnode_xml_set_in -#define yyget_out __sd_domnode_xml_get_out -#define yyset_out __sd_domnode_xml_set_out -#define yyget_leng __sd_domnode_xml_get_leng -#define yyget_text __sd_domnode_xml_get_text -#define yyget_lineno __sd_domnode_xml_get_lineno -#define yyset_lineno __sd_domnode_xml_set_lineno -#ifdef YY_BISON_BRIDGE -#define yyget_lval __sd_domnode_xml_get_lval -#define yyset_lval __sd_domnode_xml_set_lval -#define yyget_lloc __sd_domnode_xml_get_lloc -#define yyset_lloc __sd_domnode_xml_set_lloc -#endif -#define yyalloc __sd_domnode_xml_alloc -#define yyrealloc __sd_domnode_xml_realloc -#define yyfree __sd_domnode_xml_free - -#line 46 "domnode-xml-scanner.c" -#define YY_INT_ALIGNED short int - - -/* A lexical scanner generated by flex */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 27 -#if YY_FLEX_SUBMINOR_VERSION > 0 -#define FLEX_BETA -#endif - -/* First, we deal with platform-specific or compiler-specific issues. */ - -/* begin standard C headers. */ -#include -#include -#include -#include - -/* end standard C headers. */ - -#include - -/* flex integer type definitions */ - -#ifndef FLEXINT_H -#define FLEXINT_H - -/* C99 systems have . Non-C99 systems may or may not. */ - -#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L -#include -typedef int8_t flex_int8_t; -typedef uint8_t flex_uint8_t; -typedef int16_t flex_int16_t; -typedef uint16_t flex_uint16_t; -typedef int32_t flex_int32_t; -typedef uint32_t flex_uint32_t; -#else -typedef signed char flex_int8_t; -typedef short int flex_int16_t; -typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; -typedef unsigned short int flex_uint16_t; -typedef unsigned int flex_uint32_t; -#endif /* ! C99 */ - -/* Limits of integral types. */ -#ifndef INT8_MIN -#define INT8_MIN (-128) -#endif -#ifndef INT16_MIN -#define INT16_MIN (-32767-1) -#endif -#ifndef INT32_MIN -#define INT32_MIN (-2147483647-1) -#endif -#ifndef INT8_MAX -#define INT8_MAX (127) -#endif -#ifndef INT16_MAX -#define INT16_MAX (32767) -#endif -#ifndef INT32_MAX -#define INT32_MAX (2147483647) -#endif -#ifndef UINT8_MAX -#define UINT8_MAX (255U) -#endif -#ifndef UINT16_MAX -#define UINT16_MAX (65535U) -#endif -#ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) -#endif - - -#endif /* ! FLEXINT_H */ - - - -#ifdef __cplusplus - -/* C++ compilers don't understand traditional function definitions. */ -#ifdef YY_TRADITIONAL_FUNC_DEFS -#undef YY_TRADITIONAL_FUNC_DEFS -#endif - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -/* We're not in a C++ compiler, so by default, - we generate C99 function defs, unless you explicitly ask - for traditional defs by defining YY_TRADITIONAL_FUNC_DEFS */ - -#if __STDC__ - -#define YY_USE_CONST - -#endif /* __STDC__ */ -#endif /* ! __cplusplus */ - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - -/* For compilers that can't handle prototypes. - * e.g., - * The function prototype - * int foo(int x, char* y); - * - * ...should be written as - * int foo YY_PARAMS((int x, char* y)); - * - * ...which could possibly generate - * int foo (); - */ -#ifdef YY_NO_PROTOS -#define YY_PARAMS(proto) () -#else -#define YY_PARAMS(proto) proto -#endif - - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) - - -/* An opaque pointer. */ -#ifndef YY_TYPEDEF_YY_SCANNER_T -#define YY_TYPEDEF_YY_SCANNER_T -typedef void* yyscan_t; -#endif - -/* For use wherever a Global is accessed or assigned. */ -#define YY_G(var) (((struct yyguts_t*)yyscanner)->var) - -/* For use in function prototypes to append the additional argument. */ -#define YY_PROTO_LAST_ARG , yyscan_t yyscanner -#define YY_PROTO_ONLY_ARG yyscan_t yyscanner - -/* For use in function definitions to append the additional argument. */ -#ifdef YY_TRADITIONAL_FUNC_DEFS -#define YY_DEF_LAST_ARG , yyscanner -#define YY_DEF_ONLY_ARG yyscanner -#else -#define YY_DEF_LAST_ARG , yyscan_t yyscanner -#define YY_DEF_ONLY_ARG yyscan_t yyscanner -#endif -#define YY_DECL_LAST_ARG yyscan_t yyscanner; - -/* For use in function calls to pass the additional argument. */ -#define YY_CALL_LAST_ARG , yyscanner -#define YY_CALL_ONLY_ARG yyscanner - -/* For convenience, these vars (plus the bison vars far below) - are macros in the reentrant scanner. */ -#define yyin YY_G(yyin_r) -#define yyout YY_G(yyout_r) -#define yyextra YY_G(yyextra_r) -#define yyleng YY_G(yyleng_r) -#define yytext YY_G(yytext_r) -#define yylineno YY_G(yylineno_r) -#define yy_flex_debug YY_G(yy_flex_debug_r) - -int yylex_init YY_PARAMS((yyscan_t* scanner)); - - - -/* For compilers that need traditional function definitions. - * e.g., - * The function prototype taking 2 arguments - * int foo (int x, char* y) - * - * ...should be written as - * int foo YYFARGS2(int,x, char*,y) - * - * ...which could possibly generate - * int foo (x,y,yyscanner) - * int x; - * char * y; - * yyscan_t yyscanner; - */ -#ifdef YY_TRADITIONAL_FUNC_DEFS -/* Generate traditional function defs */ -#define YYFARGS0(v) (YY_DEF_ONLY_ARG) YY_DECL_LAST_ARG -#define YYFARGS1(t1,n1) (n1 YY_DEF_LAST_ARG) t1 n1; YY_DECL_LAST_ARG -#define YYFARGS2(t1,n1,t2,n2) (n1,n2 YY_DEF_LAST_ARG) t1 n1; t2 n2; YY_DECL_LAST_ARG -#define YYFARGS3(t1,n1,t2,n2,t3,n3) (n1,n2,n3 YY_DEF_LAST_ARG) t1 n1; t2 n2; t3 n3; YY_DECL_LAST_ARG -#else -/* Generate C99 function defs. */ -#define YYFARGS0(v) (YY_DEF_ONLY_ARG) -#define YYFARGS1(t1,n1) (t1 n1 YY_DEF_LAST_ARG) -#define YYFARGS2(t1,n1,t2,n2) (t1 n1,t2 n2 YY_DEF_LAST_ARG) -#define YYFARGS3(t1,n1,t2,n2,t3,n3) (t1 n1,t2 n2,t3 n3 YY_DEF_LAST_ARG) -#endif - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN YY_G(yy_start) = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START ((YY_G(yy_start) - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart( yyin YY_CALL_LAST_ARG ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#ifndef YY_BUF_SIZE -#define YY_BUF_SIZE 16384 -#endif - - -#ifndef YY_TYPEDEF_YY_BUFFER_STATE -#define YY_TYPEDEF_YY_BUFFER_STATE -typedef struct yy_buffer_state *YY_BUFFER_STATE; -#endif - - - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - -#ifdef YY_USE_LINENO -/* Note: We specifically omit the test for yy_rule_can_match_eol because it requires - * access to the local variable yy_act. Since yyless() is a macro, it would break - * existing scanners that call yyless() from OUTSIDE yylex. - * One obvious solution it to make yy_act a global. I tried that, and saw - * a 5% performance hit in a non-yylineno scanner, because yy_act is - * normally declared as a register variable-- so it's not worth it. - */ -#define YY_LESS_LINENO(n) \ - do { \ - int yyl;\ - for ( yyl = n; yyl < yyleng; ++yyl )\ - if ( yytext[yyl] == '\n' )\ - --yylineno;\ - }while(0) -#else -#define YY_LESS_LINENO(n) -#endif - -/* The funky do-while in the following #define is used to turn the definition - * int a single C statement (which needs a semi-colon terminator). This - * avoids problems with code like: - * - * if ( condition_holds ) - * yyless( 5 ); - * else - * do_something_else(); - * - * Prior to using the do-while the compiler would get upset at the - * "else" because it interpreted the "if" statement as being all - * done when it reached the ';' after the yyless() call. - */ - -/* Return all but the first 'n' matched characters back to the input stream. */ - -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - *yy_cp = YY_G(yy_hold_char); \ - YY_RESTORE_YY_MORE_OFFSET \ - YY_G(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) - -#define unput(c) yyunput( c, YY_G(yytext_ptr) YY_CALL_LAST_ARG ) - -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ - -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef unsigned int yy_size_t; -#endif - -#ifndef YY_STRUCT_YY_BUFFER_STATE -#define YY_STRUCT_YY_BUFFER_STATE -struct yy_buffer_state - { - FILE *yy_input_file; - - - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - }; -#endif /* !YY_STRUCT_YY_BUFFER_STATE */ - -#ifndef __sd_domnode_xml_IN_HEADER /* YY-DISCARD-FROM-HEADER */ -#endif /* !__sd_domnode_xml_IN_HEADER YY-END-DISCARD-FROM-HEADER */ - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - */ -#define YY_CURRENT_BUFFER yy_current_buffer - - -#ifndef __sd_domnode_xml_IN_HEADER /* YY-DISCARD-FROM-HEADER */ -#endif /* !__sd_domnode_xml_IN_HEADER YY-END-DISCARD-FROM-HEADER */ - -void yyrestart YY_PARAMS(( FILE *input_file YY_PROTO_LAST_ARG )); - - -void yy_switch_to_buffer YY_PARAMS(( YY_BUFFER_STATE new_buffer YY_PROTO_LAST_ARG )); -void yy_load_buffer_state YY_PARAMS(( YY_PROTO_ONLY_ARG )); -YY_BUFFER_STATE yy_create_buffer YY_PARAMS(( FILE *file, int size YY_PROTO_LAST_ARG )); -void yy_delete_buffer YY_PARAMS(( YY_BUFFER_STATE b YY_PROTO_LAST_ARG )); -void yy_init_buffer YY_PARAMS(( YY_BUFFER_STATE b, FILE *file YY_PROTO_LAST_ARG )); -void yy_flush_buffer YY_PARAMS(( YY_BUFFER_STATE b YY_PROTO_LAST_ARG )); - -#define YY_FLUSH_BUFFER yy_flush_buffer( YY_G(yy_current_buffer) YY_CALL_LAST_ARG) - -YY_BUFFER_STATE yy_scan_buffer YY_PARAMS(( char *base, yy_size_t size YY_PROTO_LAST_ARG )); -YY_BUFFER_STATE yy_scan_string YY_PARAMS(( yyconst char *yy_str YY_PROTO_LAST_ARG )); -YY_BUFFER_STATE yy_scan_bytes YY_PARAMS(( yyconst char *bytes, int len YY_PROTO_LAST_ARG )); - - -void *yyalloc YY_PARAMS(( yy_size_t YY_PROTO_LAST_ARG )); -void *yyrealloc YY_PARAMS(( void *, yy_size_t YY_PROTO_LAST_ARG )); -void yyfree YY_PARAMS(( void * YY_PROTO_LAST_ARG )); - -#define yy_new_buffer yy_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! YY_G(yy_current_buffer) ) \ - YY_G(yy_current_buffer) = \ - yy_create_buffer( yyin, YY_BUF_SIZE YY_CALL_LAST_ARG); \ - YY_G(yy_current_buffer)->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! YY_G(yy_current_buffer) ) \ - YY_G(yy_current_buffer) = \ - yy_create_buffer( yyin, YY_BUF_SIZE YY_CALL_LAST_ARG); \ - YY_G(yy_current_buffer)->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (YY_G(yy_current_buffer)->yy_at_bol) - - -#define yywrap(n) 1 -#define YY_SKIP_YYWRAP -#ifndef __sd_domnode_xml_IN_HEADER /* YY-DISCARD-FROM-HEADER */ -typedef unsigned char YY_CHAR; -#endif /* !__sd_domnode_xml_IN_HEADER YY-END-DISCARD-FROM-HEADER */ -#ifndef __sd_domnode_xml_IN_HEADER /* YY-DISCARD-FROM-HEADER */ -#ifndef YY_REENTRANT -FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; -#endif -#endif /* !__sd_domnode_xml_IN_HEADER YY-END-DISCARD-FROM-HEADER */ -#ifndef __sd_domnode_xml_IN_HEADER /* YY-DISCARD-FROM-HEADER */ -typedef yyconst struct yy_trans_info *yy_state_type; -#endif /* !__sd_domnode_xml_IN_HEADER YY-END-DISCARD-FROM-HEADER */ -#define yytext_ptr yytext_r - -#ifndef __sd_domnode_xml_IN_HEADER /* YY-DISCARD-FROM-HEADER */ -static yy_state_type yy_get_previous_state YY_PARAMS(( YY_PROTO_ONLY_ARG )); -static yy_state_type yy_try_NUL_trans YY_PARAMS(( yy_state_type current_state YY_PROTO_LAST_ARG)); -static int yy_get_next_buffer YY_PARAMS(( YY_PROTO_ONLY_ARG )); -static void yy_fatal_error YY_PARAMS(( yyconst char msg[] YY_PROTO_LAST_ARG )); -#endif /* !__sd_domnode_xml_IN_HEADER YY-END-DISCARD-FROM-HEADER */ - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - YY_G(yytext_ptr) = yy_bp; \ - yyleng = (size_t) (yy_cp - yy_bp); \ - YY_G(yy_hold_char) = *yy_cp; \ - *yy_cp = '\0'; \ - YY_G(yy_c_buf_p) = yy_cp; - -#ifndef __sd_domnode_xml_IN_HEADER /* YY-DISCARD-FROM-HEADER */ -#define YY_NUM_RULES 15 -#define YY_END_OF_BUFFER 16 -struct yy_trans_info - { - flex_int16_t yy_verify; - flex_int16_t yy_nxt; - }; -static yyconst struct yy_trans_info yy_transition[7736] = - { - { 0, 0 }, { 0,7480 }, { 0, 0 }, { 0,7478 }, { 1,1032 }, - { 2,1032 }, { 3,1032 }, { 4,1032 }, { 5,1032 }, { 6,1032 }, - { 7,1032 }, { 8,1032 }, { 9,1034 }, { 10,1036 }, { 11,1032 }, - { 12,1032 }, { 13,1041 }, { 14,1032 }, { 15,1032 }, { 16,1032 }, - { 17,1032 }, { 18,1032 }, { 19,1032 }, { 20,1032 }, { 21,1032 }, - { 22,1032 }, { 23,1032 }, { 24,1032 }, { 25,1032 }, { 26,1032 }, - { 27,1032 }, { 28,1032 }, { 29,1032 }, { 30,1032 }, { 31,1032 }, - { 32,1034 }, { 33,1032 }, { 34,1103 }, { 35,1032 }, { 36,1032 }, - { 37,1032 }, { 38,1032 }, { 39,1361 }, { 40,1032 }, { 41,1032 }, - { 42,1032 }, { 43,1032 }, { 44,1032 }, { 45,1032 }, { 46,1032 }, - - { 47,1038 }, { 48,1032 }, { 49,1032 }, { 50,1032 }, { 51,1032 }, - { 52,1032 }, { 53,1032 }, { 54,1032 }, { 55,1032 }, { 56,1032 }, - { 57,1032 }, { 58,1032 }, { 59,1032 }, { 60,1619 }, { 61,1053 }, - { 62,1061 }, { 63,1079 }, { 64,1032 }, { 65,1876 }, { 66,1876 }, - { 67,1876 }, { 68,1876 }, { 69,1876 }, { 70,1876 }, { 71,1876 }, - { 72,1876 }, { 73,1876 }, { 74,1876 }, { 75,1876 }, { 76,1876 }, - { 77,1876 }, { 78,1876 }, { 79,1876 }, { 80,1876 }, { 81,1876 }, - { 82,1876 }, { 83,1876 }, { 84,1876 }, { 85,1876 }, { 86,1876 }, - { 87,1876 }, { 88,1876 }, { 89,1876 }, { 90,1876 }, { 91,1032 }, - { 92,1032 }, { 93,1032 }, { 94,1032 }, { 95,1876 }, { 96,1032 }, - - { 97,1876 }, { 98,1876 }, { 99,1876 }, { 100,1876 }, { 101,1876 }, - { 102,1876 }, { 103,1876 }, { 104,1876 }, { 105,1876 }, { 106,1876 }, - { 107,1876 }, { 108,1876 }, { 109,1876 }, { 110,1876 }, { 111,1876 }, - { 112,1876 }, { 113,1876 }, { 114,1876 }, { 115,1876 }, { 116,1876 }, - { 117,1876 }, { 118,1876 }, { 119,1876 }, { 120,1876 }, { 121,1876 }, - { 122,1876 }, { 123,1032 }, { 124,1032 }, { 125,1032 }, { 126,1032 }, - { 127,1032 }, { 128,1876 }, { 129,1876 }, { 130,1876 }, { 131,1876 }, - { 132,1876 }, { 133,1876 }, { 134,1876 }, { 135,1876 }, { 136,1876 }, - { 137,1876 }, { 138,1876 }, { 139,1876 }, { 140,1876 }, { 141,1876 }, - { 142,1876 }, { 143,1876 }, { 144,1876 }, { 145,1876 }, { 146,1876 }, - - { 147,1876 }, { 148,1876 }, { 149,1876 }, { 150,1876 }, { 151,1876 }, - { 152,1876 }, { 153,1876 }, { 154,1876 }, { 155,1876 }, { 156,1876 }, - { 157,1876 }, { 158,1876 }, { 159,1876 }, { 160,1876 }, { 161,1876 }, - { 162,1876 }, { 163,1876 }, { 164,1876 }, { 165,1876 }, { 166,1876 }, - { 167,1876 }, { 168,1876 }, { 169,1876 }, { 170,1876 }, { 171,1876 }, - { 172,1876 }, { 173,1876 }, { 174,1876 }, { 175,1876 }, { 176,1876 }, - { 177,1876 }, { 178,1876 }, { 179,1876 }, { 180,1876 }, { 181,1876 }, - { 182,1876 }, { 183,1876 }, { 184,1876 }, { 185,1876 }, { 186,1876 }, - { 187,1876 }, { 188,1876 }, { 189,1876 }, { 190,1876 }, { 191,1876 }, - { 192,1876 }, { 193,1876 }, { 194,1876 }, { 195,1876 }, { 196,1876 }, - - { 197,1876 }, { 198,1876 }, { 199,1876 }, { 200,1876 }, { 201,1876 }, - { 202,1876 }, { 203,1876 }, { 204,1876 }, { 205,1876 }, { 206,1876 }, - { 207,1876 }, { 208,1876 }, { 209,1876 }, { 210,1876 }, { 211,1876 }, - { 212,1876 }, { 213,1876 }, { 214,1876 }, { 215,1876 }, { 216,1876 }, - { 217,1876 }, { 218,1876 }, { 219,1876 }, { 220,1876 }, { 221,1876 }, - { 222,1876 }, { 223,1876 }, { 224,1876 }, { 225,1876 }, { 226,1876 }, - { 227,1876 }, { 228,1876 }, { 229,1876 }, { 230,1876 }, { 231,1876 }, - { 232,1876 }, { 233,1876 }, { 234,1876 }, { 235,1876 }, { 236,1876 }, - { 237,1876 }, { 238,1876 }, { 239,1876 }, { 240,1876 }, { 241,1876 }, - { 242,1876 }, { 243,1876 }, { 244,1876 }, { 245,1876 }, { 246,1876 }, - - { 247,1876 }, { 248,1876 }, { 249,1876 }, { 250,1876 }, { 251,1876 }, - { 252,1876 }, { 253,1876 }, { 254,1876 }, { 255,1876 }, { 256,1032 }, - { 0, 0 }, { 0,7220 }, { 1, 774 }, { 2, 774 }, { 3, 774 }, - { 4, 774 }, { 5, 774 }, { 6, 774 }, { 7, 774 }, { 8, 774 }, - { 9, 776 }, { 10, 778 }, { 11, 774 }, { 12, 774 }, { 13, 783 }, - { 14, 774 }, { 15, 774 }, { 16, 774 }, { 17, 774 }, { 18, 774 }, - { 19, 774 }, { 20, 774 }, { 21, 774 }, { 22, 774 }, { 23, 774 }, - { 24, 774 }, { 25, 774 }, { 26, 774 }, { 27, 774 }, { 28, 774 }, - { 29, 774 }, { 30, 774 }, { 31, 774 }, { 32, 776 }, { 33, 774 }, - { 34, 845 }, { 35, 774 }, { 36, 774 }, { 37, 774 }, { 38, 774 }, - - { 39,1103 }, { 40, 774 }, { 41, 774 }, { 42, 774 }, { 43, 774 }, - { 44, 774 }, { 45, 774 }, { 46, 774 }, { 47, 780 }, { 48, 774 }, - { 49, 774 }, { 50, 774 }, { 51, 774 }, { 52, 774 }, { 53, 774 }, - { 54, 774 }, { 55, 774 }, { 56, 774 }, { 57, 774 }, { 58, 774 }, - { 59, 774 }, { 60,1361 }, { 61, 795 }, { 62, 803 }, { 63, 821 }, - { 64, 774 }, { 65,1618 }, { 66,1618 }, { 67,1618 }, { 68,1618 }, - { 69,1618 }, { 70,1618 }, { 71,1618 }, { 72,1618 }, { 73,1618 }, - { 74,1618 }, { 75,1618 }, { 76,1618 }, { 77,1618 }, { 78,1618 }, - { 79,1618 }, { 80,1618 }, { 81,1618 }, { 82,1618 }, { 83,1618 }, - { 84,1618 }, { 85,1618 }, { 86,1618 }, { 87,1618 }, { 88,1618 }, - - { 89,1618 }, { 90,1618 }, { 91, 774 }, { 92, 774 }, { 93, 774 }, - { 94, 774 }, { 95,1618 }, { 96, 774 }, { 97,1618 }, { 98,1618 }, - { 99,1618 }, { 100,1618 }, { 101,1618 }, { 102,1618 }, { 103,1618 }, - { 104,1618 }, { 105,1618 }, { 106,1618 }, { 107,1618 }, { 108,1618 }, - { 109,1618 }, { 110,1618 }, { 111,1618 }, { 112,1618 }, { 113,1618 }, - { 114,1618 }, { 115,1618 }, { 116,1618 }, { 117,1618 }, { 118,1618 }, - { 119,1618 }, { 120,1618 }, { 121,1618 }, { 122,1618 }, { 123, 774 }, - { 124, 774 }, { 125, 774 }, { 126, 774 }, { 127, 774 }, { 128,1618 }, - { 129,1618 }, { 130,1618 }, { 131,1618 }, { 132,1618 }, { 133,1618 }, - { 134,1618 }, { 135,1618 }, { 136,1618 }, { 137,1618 }, { 138,1618 }, - - { 139,1618 }, { 140,1618 }, { 141,1618 }, { 142,1618 }, { 143,1618 }, - { 144,1618 }, { 145,1618 }, { 146,1618 }, { 147,1618 }, { 148,1618 }, - { 149,1618 }, { 150,1618 }, { 151,1618 }, { 152,1618 }, { 153,1618 }, - { 154,1618 }, { 155,1618 }, { 156,1618 }, { 157,1618 }, { 158,1618 }, - { 159,1618 }, { 160,1618 }, { 161,1618 }, { 162,1618 }, { 163,1618 }, - { 164,1618 }, { 165,1618 }, { 166,1618 }, { 167,1618 }, { 168,1618 }, - { 169,1618 }, { 170,1618 }, { 171,1618 }, { 172,1618 }, { 173,1618 }, - { 174,1618 }, { 175,1618 }, { 176,1618 }, { 177,1618 }, { 178,1618 }, - { 179,1618 }, { 180,1618 }, { 181,1618 }, { 182,1618 }, { 183,1618 }, - { 184,1618 }, { 185,1618 }, { 186,1618 }, { 187,1618 }, { 188,1618 }, - - { 189,1618 }, { 190,1618 }, { 191,1618 }, { 192,1618 }, { 193,1618 }, - { 194,1618 }, { 195,1618 }, { 196,1618 }, { 197,1618 }, { 198,1618 }, - { 199,1618 }, { 200,1618 }, { 201,1618 }, { 202,1618 }, { 203,1618 }, - { 204,1618 }, { 205,1618 }, { 206,1618 }, { 207,1618 }, { 208,1618 }, - { 209,1618 }, { 210,1618 }, { 211,1618 }, { 212,1618 }, { 213,1618 }, - { 214,1618 }, { 215,1618 }, { 216,1618 }, { 217,1618 }, { 218,1618 }, - { 219,1618 }, { 220,1618 }, { 221,1618 }, { 222,1618 }, { 223,1618 }, - { 224,1618 }, { 225,1618 }, { 226,1618 }, { 227,1618 }, { 228,1618 }, - { 229,1618 }, { 230,1618 }, { 231,1618 }, { 232,1618 }, { 233,1618 }, - { 234,1618 }, { 235,1618 }, { 236,1618 }, { 237,1618 }, { 238,1618 }, - - { 239,1618 }, { 240,1618 }, { 241,1618 }, { 242,1618 }, { 243,1618 }, - { 244,1618 }, { 245,1618 }, { 246,1618 }, { 247,1618 }, { 248,1618 }, - { 249,1618 }, { 250,1618 }, { 251,1618 }, { 252,1618 }, { 253,1618 }, - { 254,1618 }, { 255,1618 }, { 256, 774 }, { 0, 0 }, { 0,6962 }, - { 1,1617 }, { 2,1617 }, { 3,1617 }, { 4,1617 }, { 5,1617 }, - { 6,1617 }, { 7,1617 }, { 8,1617 }, { 9,1875 }, { 10,2133 }, - { 11,1617 }, { 12,1617 }, { 13,2195 }, { 14,1617 }, { 15,1617 }, - { 16,1617 }, { 17,1617 }, { 18,1617 }, { 19,1617 }, { 20,1617 }, - { 21,1617 }, { 22,1617 }, { 23,1617 }, { 24,1617 }, { 25,1617 }, - { 26,1617 }, { 27,1617 }, { 28,1617 }, { 29,1617 }, { 30,1617 }, - - { 31,1617 }, { 32,1875 }, { 33,1617 }, { 34,1617 }, { 35,1617 }, - { 36,1617 }, { 37,1617 }, { 38, 516 }, { 39,1617 }, { 40,1617 }, - { 41,1617 }, { 42,1617 }, { 43,1617 }, { 44,1617 }, { 45,1617 }, - { 46,1617 }, { 47,1617 }, { 48,1617 }, { 49,1617 }, { 50,1617 }, - { 51,1617 }, { 52,1617 }, { 53,1617 }, { 54,1617 }, { 55,1617 }, - { 56,1617 }, { 57,1617 }, { 58,1617 }, { 59,1617 }, { 60,1103 }, - { 61,1617 }, { 62,1617 }, { 63,1617 }, { 64,1617 }, { 65,1617 }, - { 66,1617 }, { 67,1617 }, { 68,1617 }, { 69,1617 }, { 70,1617 }, - { 71,1617 }, { 72,1617 }, { 73,1617 }, { 74,1617 }, { 75,1617 }, - { 76,1617 }, { 77,1617 }, { 78,1617 }, { 79,1617 }, { 80,1617 }, - - { 81,1617 }, { 82,1617 }, { 83,1617 }, { 84,1617 }, { 85,1617 }, - { 86,1617 }, { 87,1617 }, { 88,1617 }, { 89,1617 }, { 90,1617 }, - { 91,1617 }, { 92,1617 }, { 93,1617 }, { 94,1617 }, { 95,1617 }, - { 96,1617 }, { 97,1617 }, { 98,1617 }, { 99,1617 }, { 100,1617 }, - { 101,1617 }, { 102,1617 }, { 103,1617 }, { 104,1617 }, { 105,1617 }, - { 106,1617 }, { 107,1617 }, { 108,1617 }, { 109,1617 }, { 110,1617 }, - { 111,1617 }, { 112,1617 }, { 113,1617 }, { 114,1617 }, { 115,1617 }, - { 116,1617 }, { 117,1617 }, { 118,1617 }, { 119,1617 }, { 120,1617 }, - { 121,1617 }, { 122,1617 }, { 123,1617 }, { 124,1617 }, { 125,1617 }, - { 126,1617 }, { 127,1617 }, { 128,1617 }, { 129,1617 }, { 130,1617 }, - - { 131,1617 }, { 132,1617 }, { 133,1617 }, { 134,1617 }, { 135,1617 }, - { 136,1617 }, { 137,1617 }, { 138,1617 }, { 139,1617 }, { 140,1617 }, - { 141,1617 }, { 142,1617 }, { 143,1617 }, { 144,1617 }, { 145,1617 }, - { 146,1617 }, { 147,1617 }, { 148,1617 }, { 149,1617 }, { 150,1617 }, - { 151,1617 }, { 152,1617 }, { 153,1617 }, { 154,1617 }, { 155,1617 }, - { 156,1617 }, { 157,1617 }, { 158,1617 }, { 159,1617 }, { 160,1617 }, - { 161,1617 }, { 162,1617 }, { 163,1617 }, { 164,1617 }, { 165,1617 }, - { 166,1617 }, { 167,1617 }, { 168,1617 }, { 169,1617 }, { 170,1617 }, - { 171,1617 }, { 172,1617 }, { 173,1617 }, { 174,1617 }, { 175,1617 }, - { 176,1617 }, { 177,1617 }, { 178,1617 }, { 179,1617 }, { 180,1617 }, - - { 181,1617 }, { 182,1617 }, { 183,1617 }, { 184,1617 }, { 185,1617 }, - { 186,1617 }, { 187,1617 }, { 188,1617 }, { 189,1617 }, { 190,1617 }, - { 191,1617 }, { 192,1617 }, { 193,1617 }, { 194,1617 }, { 195,1617 }, - { 196,1617 }, { 197,1617 }, { 198,1617 }, { 199,1617 }, { 200,1617 }, - { 201,1617 }, { 202,1617 }, { 203,1617 }, { 204,1617 }, { 205,1617 }, - { 206,1617 }, { 207,1617 }, { 208,1617 }, { 209,1617 }, { 210,1617 }, - { 211,1617 }, { 212,1617 }, { 213,1617 }, { 214,1617 }, { 215,1617 }, - { 216,1617 }, { 217,1617 }, { 218,1617 }, { 219,1617 }, { 220,1617 }, - { 221,1617 }, { 222,1617 }, { 223,1617 }, { 224,1617 }, { 225,1617 }, - { 226,1617 }, { 227,1617 }, { 228,1617 }, { 229,1617 }, { 230,1617 }, - - { 231,1617 }, { 232,1617 }, { 233,1617 }, { 234,1617 }, { 235,1617 }, - { 236,1617 }, { 237,1617 }, { 238,1617 }, { 239,1617 }, { 240,1617 }, - { 241,1617 }, { 242,1617 }, { 243,1617 }, { 244,1617 }, { 245,1617 }, - { 246,1617 }, { 247,1617 }, { 248,1617 }, { 249,1617 }, { 250,1617 }, - { 251,1617 }, { 252,1617 }, { 253,1617 }, { 254,1617 }, { 255,1617 }, - { 256,1617 }, { 0, 0 }, { 0,6704 }, { 1,1359 }, { 2,1359 }, - { 3,1359 }, { 4,1359 }, { 5,1359 }, { 6,1359 }, { 7,1359 }, - { 8,1359 }, { 9,1617 }, { 10,1875 }, { 11,1359 }, { 12,1359 }, - { 13,1937 }, { 14,1359 }, { 15,1359 }, { 16,1359 }, { 17,1359 }, - { 18,1359 }, { 19,1359 }, { 20,1359 }, { 21,1359 }, { 22,1359 }, - - { 23,1359 }, { 24,1359 }, { 25,1359 }, { 26,1359 }, { 27,1359 }, - { 28,1359 }, { 29,1359 }, { 30,1359 }, { 31,1359 }, { 32,1617 }, - { 33,1359 }, { 34,1359 }, { 35,1359 }, { 36,1359 }, { 37,1359 }, - { 38, 258 }, { 39,1359 }, { 40,1359 }, { 41,1359 }, { 42,1359 }, - { 43,1359 }, { 44,1359 }, { 45,1359 }, { 46,1359 }, { 47,1359 }, - { 48,1359 }, { 49,1359 }, { 50,1359 }, { 51,1359 }, { 52,1359 }, - { 53,1359 }, { 54,1359 }, { 55,1359 }, { 56,1359 }, { 57,1359 }, - { 58,1359 }, { 59,1359 }, { 60, 845 }, { 61,1359 }, { 62,1359 }, - { 63,1359 }, { 64,1359 }, { 65,1359 }, { 66,1359 }, { 67,1359 }, - { 68,1359 }, { 69,1359 }, { 70,1359 }, { 71,1359 }, { 72,1359 }, - - { 73,1359 }, { 74,1359 }, { 75,1359 }, { 76,1359 }, { 77,1359 }, - { 78,1359 }, { 79,1359 }, { 80,1359 }, { 81,1359 }, { 82,1359 }, - { 83,1359 }, { 84,1359 }, { 85,1359 }, { 86,1359 }, { 87,1359 }, - { 88,1359 }, { 89,1359 }, { 90,1359 }, { 91,1359 }, { 92,1359 }, - { 93,1359 }, { 94,1359 }, { 95,1359 }, { 96,1359 }, { 97,1359 }, - { 98,1359 }, { 99,1359 }, { 100,1359 }, { 101,1359 }, { 102,1359 }, - { 103,1359 }, { 104,1359 }, { 105,1359 }, { 106,1359 }, { 107,1359 }, - { 108,1359 }, { 109,1359 }, { 110,1359 }, { 111,1359 }, { 112,1359 }, - { 113,1359 }, { 114,1359 }, { 115,1359 }, { 116,1359 }, { 117,1359 }, - { 118,1359 }, { 119,1359 }, { 120,1359 }, { 121,1359 }, { 122,1359 }, - - { 123,1359 }, { 124,1359 }, { 125,1359 }, { 126,1359 }, { 127,1359 }, - { 128,1359 }, { 129,1359 }, { 130,1359 }, { 131,1359 }, { 132,1359 }, - { 133,1359 }, { 134,1359 }, { 135,1359 }, { 136,1359 }, { 137,1359 }, - { 138,1359 }, { 139,1359 }, { 140,1359 }, { 141,1359 }, { 142,1359 }, - { 143,1359 }, { 144,1359 }, { 145,1359 }, { 146,1359 }, { 147,1359 }, - { 148,1359 }, { 149,1359 }, { 150,1359 }, { 151,1359 }, { 152,1359 }, - { 153,1359 }, { 154,1359 }, { 155,1359 }, { 156,1359 }, { 157,1359 }, - { 158,1359 }, { 159,1359 }, { 160,1359 }, { 161,1359 }, { 162,1359 }, - { 163,1359 }, { 164,1359 }, { 165,1359 }, { 166,1359 }, { 167,1359 }, - { 168,1359 }, { 169,1359 }, { 170,1359 }, { 171,1359 }, { 172,1359 }, - - { 173,1359 }, { 174,1359 }, { 175,1359 }, { 176,1359 }, { 177,1359 }, - { 178,1359 }, { 179,1359 }, { 180,1359 }, { 181,1359 }, { 182,1359 }, - { 183,1359 }, { 184,1359 }, { 185,1359 }, { 186,1359 }, { 187,1359 }, - { 188,1359 }, { 189,1359 }, { 190,1359 }, { 191,1359 }, { 192,1359 }, - { 193,1359 }, { 194,1359 }, { 195,1359 }, { 196,1359 }, { 197,1359 }, - { 198,1359 }, { 199,1359 }, { 200,1359 }, { 201,1359 }, { 202,1359 }, - { 203,1359 }, { 204,1359 }, { 205,1359 }, { 206,1359 }, { 207,1359 }, - { 208,1359 }, { 209,1359 }, { 210,1359 }, { 211,1359 }, { 212,1359 }, - { 213,1359 }, { 214,1359 }, { 215,1359 }, { 216,1359 }, { 217,1359 }, - { 218,1359 }, { 219,1359 }, { 220,1359 }, { 221,1359 }, { 222,1359 }, - - { 223,1359 }, { 224,1359 }, { 225,1359 }, { 226,1359 }, { 227,1359 }, - { 228,1359 }, { 229,1359 }, { 230,1359 }, { 231,1359 }, { 232,1359 }, - { 233,1359 }, { 234,1359 }, { 235,1359 }, { 236,1359 }, { 237,1359 }, - { 238,1359 }, { 239,1359 }, { 240,1359 }, { 241,1359 }, { 242,1359 }, - { 243,1359 }, { 244,1359 }, { 245,1359 }, { 246,1359 }, { 247,1359 }, - { 248,1359 }, { 249,1359 }, { 250,1359 }, { 251,1359 }, { 252,1359 }, - { 253,1359 }, { 254,1359 }, { 255,1359 }, { 256,1359 }, { 0, 13 }, - { 0,6446 }, { 0, 1 }, { 0,6444 }, { 0, 1 }, { 0,6442 }, - { 0, 2 }, { 0,6440 }, { 0, 0 }, { 0, 1 }, { 0,6437 }, - { 0, 0 }, { 9,1935 }, { 10,1935 }, { 9,1933 }, { 10,1933 }, - - { 13,1935 }, { 0, 0 }, { 13,1933 }, { 9,1928 }, { 10,2187 }, - { 0, 3 }, { 0,6425 }, { 13,1928 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 4 }, { 0,6417 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 32,1935 }, - { 0, 0 }, { 32,1933 }, { 0, 0 }, { 9, 560 }, { 10, 560 }, - { 0, 0 }, { 32,1928 }, { 13, 560 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 13 }, { 0,6399 }, { 0, 6 }, { 0,6397 }, - { 0, 9 }, { 0,6395 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 32, 560 }, { 60,1937 }, { 0, 0 }, { 60,1935 }, - - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 60,1930 }, - { 0, 13 }, { 0,6375 }, { 1,2187 }, { 2,2187 }, { 3,2187 }, - { 4,2187 }, { 5,2187 }, { 6,2187 }, { 7,2187 }, { 8,2187 }, - { 9,2187 }, { 10,2187 }, { 11,2187 }, { 12,2187 }, { 13,2187 }, - { 14,2187 }, { 15,2187 }, { 16,2187 }, { 17,2187 }, { 18,2187 }, - { 19,2187 }, { 20,2187 }, { 21,2187 }, { 22,2187 }, { 23,2187 }, - { 24,2187 }, { 25,2187 }, { 26,2187 }, { 27,2187 }, { 28,2187 }, - { 29,2187 }, { 30,2187 }, { 31,2187 }, { 32,2187 }, { 33,2187 }, - { 34, -22 }, { 35,2187 }, { 36,2187 }, { 37,2187 }, { 62, 547 }, - { 39,2187 }, { 40,2187 }, { 41,2187 }, { 42,2187 }, { 43,2187 }, - - { 44,2187 }, { 45,2187 }, { 46,2187 }, { 47,2187 }, { 48,2187 }, - { 49,2187 }, { 50,2187 }, { 51,2187 }, { 52,2187 }, { 53,2187 }, - { 54,2187 }, { 55,2187 }, { 56,2187 }, { 57,2187 }, { 58,2187 }, - { 59,2187 }, { 60,2187 }, { 61,2187 }, { 62,2187 }, { 63,2187 }, - { 64,2187 }, { 65,2187 }, { 66,2187 }, { 67,2187 }, { 68,2187 }, - { 69,2187 }, { 70,2187 }, { 71,2187 }, { 72,2187 }, { 73,2187 }, - { 74,2187 }, { 75,2187 }, { 76,2187 }, { 77,2187 }, { 78,2187 }, - { 79,2187 }, { 80,2187 }, { 81,2187 }, { 82,2187 }, { 83,2187 }, - { 84,2187 }, { 85,2187 }, { 86,2187 }, { 87,2187 }, { 88,2187 }, - { 89,2187 }, { 90,2187 }, { 91,2187 }, { 92,2187 }, { 93,2187 }, - - { 94,2187 }, { 95,2187 }, { 96,2187 }, { 97,2187 }, { 98,2187 }, - { 99,2187 }, { 100,2187 }, { 101,2187 }, { 102,2187 }, { 103,2187 }, - { 104,2187 }, { 105,2187 }, { 106,2187 }, { 107,2187 }, { 108,2187 }, - { 109,2187 }, { 110,2187 }, { 111,2187 }, { 112,2187 }, { 113,2187 }, - { 114,2187 }, { 115,2187 }, { 116,2187 }, { 117,2187 }, { 118,2187 }, - { 119,2187 }, { 120,2187 }, { 121,2187 }, { 122,2187 }, { 123,2187 }, - { 124,2187 }, { 125,2187 }, { 126,2187 }, { 127,2187 }, { 128,2187 }, - { 129,2187 }, { 130,2187 }, { 131,2187 }, { 132,2187 }, { 133,2187 }, - { 134,2187 }, { 135,2187 }, { 136,2187 }, { 137,2187 }, { 138,2187 }, - { 139,2187 }, { 140,2187 }, { 141,2187 }, { 142,2187 }, { 143,2187 }, - - { 144,2187 }, { 145,2187 }, { 146,2187 }, { 147,2187 }, { 148,2187 }, - { 149,2187 }, { 150,2187 }, { 151,2187 }, { 152,2187 }, { 153,2187 }, - { 154,2187 }, { 155,2187 }, { 156,2187 }, { 157,2187 }, { 158,2187 }, - { 159,2187 }, { 160,2187 }, { 161,2187 }, { 162,2187 }, { 163,2187 }, - { 164,2187 }, { 165,2187 }, { 166,2187 }, { 167,2187 }, { 168,2187 }, - { 169,2187 }, { 170,2187 }, { 171,2187 }, { 172,2187 }, { 173,2187 }, - { 174,2187 }, { 175,2187 }, { 176,2187 }, { 177,2187 }, { 178,2187 }, - { 179,2187 }, { 180,2187 }, { 181,2187 }, { 182,2187 }, { 183,2187 }, - { 184,2187 }, { 185,2187 }, { 186,2187 }, { 187,2187 }, { 188,2187 }, - { 189,2187 }, { 190,2187 }, { 191,2187 }, { 192,2187 }, { 193,2187 }, - - { 194,2187 }, { 195,2187 }, { 196,2187 }, { 197,2187 }, { 198,2187 }, - { 199,2187 }, { 200,2187 }, { 201,2187 }, { 202,2187 }, { 203,2187 }, - { 204,2187 }, { 205,2187 }, { 206,2187 }, { 207,2187 }, { 208,2187 }, - { 209,2187 }, { 210,2187 }, { 211,2187 }, { 212,2187 }, { 213,2187 }, - { 214,2187 }, { 215,2187 }, { 216,2187 }, { 217,2187 }, { 218,2187 }, - { 219,2187 }, { 220,2187 }, { 221,2187 }, { 222,2187 }, { 223,2187 }, - { 224,2187 }, { 225,2187 }, { 226,2187 }, { 227,2187 }, { 228,2187 }, - { 229,2187 }, { 230,2187 }, { 231,2187 }, { 232,2187 }, { 233,2187 }, - { 234,2187 }, { 235,2187 }, { 236,2187 }, { 237,2187 }, { 238,2187 }, - { 239,2187 }, { 240,2187 }, { 241,2187 }, { 242,2187 }, { 243,2187 }, - - { 244,2187 }, { 245,2187 }, { 246,2187 }, { 247,2187 }, { 248,2187 }, - { 249,2187 }, { 250,2187 }, { 251,2187 }, { 252,2187 }, { 253,2187 }, - { 254,2187 }, { 255,2187 }, { 256,2187 }, { 0, 13 }, { 0,6117 }, - { 1,2187 }, { 2,2187 }, { 3,2187 }, { 4,2187 }, { 5,2187 }, - { 6,2187 }, { 7,2187 }, { 8,2187 }, { 9,2187 }, { 10,2187 }, - { 11,2187 }, { 12,2187 }, { 13,2187 }, { 14,2187 }, { 15,2187 }, - { 16,2187 }, { 17,2187 }, { 18,2187 }, { 19,2187 }, { 20,2187 }, - { 21,2187 }, { 22,2187 }, { 23,2187 }, { 24,2187 }, { 25,2187 }, - { 26,2187 }, { 27,2187 }, { 28,2187 }, { 29,2187 }, { 30,2187 }, - { 31,2187 }, { 32,2187 }, { 33,2187 }, { 34,2187 }, { 35,2187 }, - - { 36,2187 }, { 37,2187 }, { 0, 0 }, { 39,-280 }, { 40,2187 }, - { 41,2187 }, { 42,2187 }, { 43,2187 }, { 44,2187 }, { 45,2187 }, - { 46,2187 }, { 47,2187 }, { 48,2187 }, { 49,2187 }, { 50,2187 }, - { 51,2187 }, { 52,2187 }, { 53,2187 }, { 54,2187 }, { 55,2187 }, - { 56,2187 }, { 57,2187 }, { 58,2187 }, { 59,2187 }, { 60,2187 }, - { 61,2187 }, { 62,2187 }, { 63,2187 }, { 64,2187 }, { 65,2187 }, - { 66,2187 }, { 67,2187 }, { 68,2187 }, { 69,2187 }, { 70,2187 }, - { 71,2187 }, { 72,2187 }, { 73,2187 }, { 74,2187 }, { 75,2187 }, - { 76,2187 }, { 77,2187 }, { 78,2187 }, { 79,2187 }, { 80,2187 }, - { 81,2187 }, { 82,2187 }, { 83,2187 }, { 84,2187 }, { 85,2187 }, - - { 86,2187 }, { 87,2187 }, { 88,2187 }, { 89,2187 }, { 90,2187 }, - { 91,2187 }, { 92,2187 }, { 93,2187 }, { 94,2187 }, { 95,2187 }, - { 96,2187 }, { 97,2187 }, { 98,2187 }, { 99,2187 }, { 100,2187 }, - { 101,2187 }, { 102,2187 }, { 103,2187 }, { 104,2187 }, { 105,2187 }, - { 106,2187 }, { 107,2187 }, { 108,2187 }, { 109,2187 }, { 110,2187 }, - { 111,2187 }, { 112,2187 }, { 113,2187 }, { 114,2187 }, { 115,2187 }, - { 116,2187 }, { 117,2187 }, { 118,2187 }, { 119,2187 }, { 120,2187 }, - { 121,2187 }, { 122,2187 }, { 123,2187 }, { 124,2187 }, { 125,2187 }, - { 126,2187 }, { 127,2187 }, { 128,2187 }, { 129,2187 }, { 130,2187 }, - { 131,2187 }, { 132,2187 }, { 133,2187 }, { 134,2187 }, { 135,2187 }, - - { 136,2187 }, { 137,2187 }, { 138,2187 }, { 139,2187 }, { 140,2187 }, - { 141,2187 }, { 142,2187 }, { 143,2187 }, { 144,2187 }, { 145,2187 }, - { 146,2187 }, { 147,2187 }, { 148,2187 }, { 149,2187 }, { 150,2187 }, - { 151,2187 }, { 152,2187 }, { 153,2187 }, { 154,2187 }, { 155,2187 }, - { 156,2187 }, { 157,2187 }, { 158,2187 }, { 159,2187 }, { 160,2187 }, - { 161,2187 }, { 162,2187 }, { 163,2187 }, { 164,2187 }, { 165,2187 }, - { 166,2187 }, { 167,2187 }, { 168,2187 }, { 169,2187 }, { 170,2187 }, - { 171,2187 }, { 172,2187 }, { 173,2187 }, { 174,2187 }, { 175,2187 }, - { 176,2187 }, { 177,2187 }, { 178,2187 }, { 179,2187 }, { 180,2187 }, - { 181,2187 }, { 182,2187 }, { 183,2187 }, { 184,2187 }, { 185,2187 }, - - { 186,2187 }, { 187,2187 }, { 188,2187 }, { 189,2187 }, { 190,2187 }, - { 191,2187 }, { 192,2187 }, { 193,2187 }, { 194,2187 }, { 195,2187 }, - { 196,2187 }, { 197,2187 }, { 198,2187 }, { 199,2187 }, { 200,2187 }, - { 201,2187 }, { 202,2187 }, { 203,2187 }, { 204,2187 }, { 205,2187 }, - { 206,2187 }, { 207,2187 }, { 208,2187 }, { 209,2187 }, { 210,2187 }, - { 211,2187 }, { 212,2187 }, { 213,2187 }, { 214,2187 }, { 215,2187 }, - { 216,2187 }, { 217,2187 }, { 218,2187 }, { 219,2187 }, { 220,2187 }, - { 221,2187 }, { 222,2187 }, { 223,2187 }, { 224,2187 }, { 225,2187 }, - { 226,2187 }, { 227,2187 }, { 228,2187 }, { 229,2187 }, { 230,2187 }, - { 231,2187 }, { 232,2187 }, { 233,2187 }, { 234,2187 }, { 235,2187 }, - - { 236,2187 }, { 237,2187 }, { 238,2187 }, { 239,2187 }, { 240,2187 }, - { 241,2187 }, { 242,2187 }, { 243,2187 }, { 244,2187 }, { 245,2187 }, - { 246,2187 }, { 247,2187 }, { 248,2187 }, { 249,2187 }, { 250,2187 }, - { 251,2187 }, { 252,2187 }, { 253,2187 }, { 254,2187 }, { 255,2187 }, - { 256,2187 }, { 0, 13 }, { 0,5859 }, { 0, 4 }, { 0,5857 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 7 }, { 0,5852 }, - { 0, 0 }, { 9,2187 }, { 10,2187 }, { 9, 0 }, { 10, 0 }, - { 13,2187 }, { 0, 0 }, { 13, 0 }, { 9, 20 }, { 10, 20 }, - { 0, 0 }, { 0,5840 }, { 13, 20 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 7 }, { 0,5832 }, - - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 32,2187 }, - { 33,2444 }, { 32, 0 }, { 0, 0 }, { 9, 0 }, { 10, 0 }, - { 0, 0 }, { 32, 20 }, { 13, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 47,-536 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 32, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 63,2702 }, { 45,4808 }, { 65,2960 }, { 66,2960 }, { 67,2960 }, - { 68,2960 }, { 69,2960 }, { 70,2960 }, { 71,2960 }, { 72,2960 }, - { 73,2960 }, { 74,2960 }, { 75,2960 }, { 76,2960 }, { 77,2960 }, - - { 78,2960 }, { 79,2960 }, { 80,2960 }, { 81,2960 }, { 82,2960 }, - { 83,2960 }, { 84,2960 }, { 85,2960 }, { 86,2960 }, { 87,2960 }, - { 88,2960 }, { 89,2960 }, { 90,2960 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 95,2960 }, { 0, 0 }, { 97,2960 }, - { 98,2960 }, { 99,2960 }, { 100,2960 }, { 101,2960 }, { 102,2960 }, - { 103,2960 }, { 104,2960 }, { 105,2960 }, { 106,2960 }, { 107,2960 }, - { 108,2960 }, { 109,2960 }, { 110,2960 }, { 111,2960 }, { 112,2960 }, - { 113,2960 }, { 114,2960 }, { 115,2960 }, { 116,2960 }, { 117,2960 }, - { 118,2960 }, { 119,2960 }, { 120,2960 }, { 121,2960 }, { 122,2960 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - - { 128,2960 }, { 129,2960 }, { 130,2960 }, { 131,2960 }, { 132,2960 }, - { 133,2960 }, { 134,2960 }, { 135,2960 }, { 136,2960 }, { 137,2960 }, - { 138,2960 }, { 139,2960 }, { 140,2960 }, { 141,2960 }, { 142,2960 }, - { 143,2960 }, { 144,2960 }, { 145,2960 }, { 146,2960 }, { 147,2960 }, - { 148,2960 }, { 149,2960 }, { 150,2960 }, { 151,2960 }, { 152,2960 }, - { 153,2960 }, { 154,2960 }, { 155,2960 }, { 156,2960 }, { 157,2960 }, - { 158,2960 }, { 159,2960 }, { 160,2960 }, { 161,2960 }, { 162,2960 }, - { 163,2960 }, { 164,2960 }, { 165,2960 }, { 166,2960 }, { 167,2960 }, - { 168,2960 }, { 169,2960 }, { 170,2960 }, { 171,2960 }, { 172,2960 }, - { 173,2960 }, { 174,2960 }, { 175,2960 }, { 176,2960 }, { 177,2960 }, - - { 178,2960 }, { 179,2960 }, { 180,2960 }, { 181,2960 }, { 182,2960 }, - { 183,2960 }, { 184,2960 }, { 185,2960 }, { 186,2960 }, { 187,2960 }, - { 188,2960 }, { 189,2960 }, { 190,2960 }, { 191,2960 }, { 192,2960 }, - { 193,2960 }, { 194,2960 }, { 195,2960 }, { 196,2960 }, { 197,2960 }, - { 198,2960 }, { 199,2960 }, { 200,2960 }, { 201,2960 }, { 202,2960 }, - { 203,2960 }, { 204,2960 }, { 205,2960 }, { 206,2960 }, { 207,2960 }, - { 208,2960 }, { 209,2960 }, { 210,2960 }, { 211,2960 }, { 212,2960 }, - { 213,2960 }, { 214,2960 }, { 215,2960 }, { 216,2960 }, { 217,2960 }, - { 218,2960 }, { 219,2960 }, { 220,2960 }, { 221,2960 }, { 222,2960 }, - { 223,2960 }, { 224,2960 }, { 225,2960 }, { 226,2960 }, { 227,2960 }, - - { 228,2960 }, { 229,2960 }, { 230,2960 }, { 231,2960 }, { 232,2960 }, - { 233,2960 }, { 234,2960 }, { 235,2960 }, { 236,2960 }, { 237,2960 }, - { 238,2960 }, { 239,2960 }, { 240,2960 }, { 241,2960 }, { 242,2960 }, - { 243,2960 }, { 244,2960 }, { 245,2960 }, { 246,2960 }, { 247,2960 }, - { 248,2960 }, { 249,2960 }, { 250,2960 }, { 251,2960 }, { 252,2960 }, - { 253,2960 }, { 254,2960 }, { 255,2960 }, { 0, 5 }, { 0,5602 }, - { 0, 11 }, { 0,5600 }, { 0, 11 }, { 0,5598 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 9, 2 }, { 10, 2 }, { 9, 0 }, { 10, 0 }, { 13, 2 }, - { 0, 0 }, { 13, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0,5573 }, { 0, 10 }, - { 0,5571 }, { 0, 0 }, { 0, 0 }, { 32, 2 }, { 0, 0 }, - { 32, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 9, 744 }, - { 10, 744 }, { 0, 0 }, { 0, 0 }, { 13, 744 }, { 45,2960 }, - { 46,2960 }, { 0, 0 }, { 48,2960 }, { 49,2960 }, { 50,2960 }, - { 51,2960 }, { 52,2960 }, { 53,2960 }, { 54,2960 }, { 55,2960 }, - { 56,2960 }, { 57,2960 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 32, 744 }, { 0, 0 }, { 65,2960 }, - { 66,2960 }, { 67,2960 }, { 68,2960 }, { 69,2960 }, { 70,2960 }, - - { 71,2960 }, { 72,2960 }, { 73,2960 }, { 74,2960 }, { 75,2960 }, - { 76,2960 }, { 77,2960 }, { 78,2960 }, { 79,2960 }, { 80,2960 }, - { 81,2960 }, { 82,2960 }, { 83,2960 }, { 84,2960 }, { 85,2960 }, - { 86,2960 }, { 87,2960 }, { 88,2960 }, { 89,2960 }, { 90,2960 }, - { 62, 2 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 95,2960 }, - { 0, 0 }, { 97,2960 }, { 98,2960 }, { 99,2960 }, { 100,2960 }, - { 101,2960 }, { 102,2960 }, { 103,2960 }, { 104,2960 }, { 105,2960 }, - { 106,2960 }, { 107,2960 }, { 108,2960 }, { 109,2960 }, { 110,2960 }, - { 111,2960 }, { 112,2960 }, { 113,2960 }, { 114,2960 }, { 115,2960 }, - { 116,2960 }, { 117,2960 }, { 118,2960 }, { 119,2960 }, { 120,2960 }, - - { 121,2960 }, { 122,2960 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 128,2960 }, { 129,2960 }, { 130,2960 }, - { 131,2960 }, { 132,2960 }, { 133,2960 }, { 134,2960 }, { 135,2960 }, - { 136,2960 }, { 137,2960 }, { 138,2960 }, { 139,2960 }, { 140,2960 }, - { 141,2960 }, { 142,2960 }, { 143,2960 }, { 144,2960 }, { 145,2960 }, - { 146,2960 }, { 147,2960 }, { 148,2960 }, { 149,2960 }, { 150,2960 }, - { 151,2960 }, { 152,2960 }, { 153,2960 }, { 154,2960 }, { 155,2960 }, - { 156,2960 }, { 157,2960 }, { 158,2960 }, { 159,2960 }, { 160,2960 }, - { 161,2960 }, { 162,2960 }, { 163,2960 }, { 164,2960 }, { 165,2960 }, - { 166,2960 }, { 167,2960 }, { 168,2960 }, { 169,2960 }, { 170,2960 }, - - { 171,2960 }, { 172,2960 }, { 173,2960 }, { 174,2960 }, { 175,2960 }, - { 176,2960 }, { 177,2960 }, { 178,2960 }, { 179,2960 }, { 180,2960 }, - { 181,2960 }, { 182,2960 }, { 183,2960 }, { 184,2960 }, { 185,2960 }, - { 186,2960 }, { 187,2960 }, { 188,2960 }, { 189,2960 }, { 190,2960 }, - { 191,2960 }, { 192,2960 }, { 193,2960 }, { 194,2960 }, { 195,2960 }, - { 196,2960 }, { 197,2960 }, { 198,2960 }, { 199,2960 }, { 200,2960 }, - { 201,2960 }, { 202,2960 }, { 203,2960 }, { 204,2960 }, { 205,2960 }, - { 206,2960 }, { 207,2960 }, { 208,2960 }, { 209,2960 }, { 210,2960 }, - { 211,2960 }, { 212,2960 }, { 213,2960 }, { 214,2960 }, { 215,2960 }, - { 216,2960 }, { 217,2960 }, { 218,2960 }, { 219,2960 }, { 220,2960 }, - - { 221,2960 }, { 222,2960 }, { 223,2960 }, { 224,2960 }, { 225,2960 }, - { 226,2960 }, { 227,2960 }, { 228,2960 }, { 229,2960 }, { 230,2960 }, - { 231,2960 }, { 232,2960 }, { 233,2960 }, { 234,2960 }, { 235,2960 }, - { 236,2960 }, { 237,2960 }, { 238,2960 }, { 239,2960 }, { 240,2960 }, - { 241,2960 }, { 242,2960 }, { 243,2960 }, { 244,2960 }, { 245,2960 }, - { 246,2960 }, { 247,2960 }, { 248,2960 }, { 249,2960 }, { 250,2960 }, - { 251,2960 }, { 252,2960 }, { 253,2960 }, { 254,2960 }, { 255,2960 }, - { 0, 12 }, { 0,5345 }, { 1,2960 }, { 2,2960 }, { 3,2960 }, - { 4,2960 }, { 5,2960 }, { 6,2960 }, { 7,2960 }, { 8,2960 }, - { 9,2960 }, { 0, 0 }, { 11,2960 }, { 12,2960 }, { 13,2960 }, - - { 14,2960 }, { 15,2960 }, { 16,2960 }, { 17,2960 }, { 18,2960 }, - { 19,2960 }, { 20,2960 }, { 21,2960 }, { 22,2960 }, { 23,2960 }, - { 24,2960 }, { 25,2960 }, { 26,2960 }, { 27,2960 }, { 28,2960 }, - { 29,2960 }, { 30,2960 }, { 31,2960 }, { 32,2960 }, { 33,2960 }, - { 34,2960 }, { 35,2960 }, { 36,2960 }, { 37,2960 }, { 0, 0 }, - { 39,2960 }, { 40,2960 }, { 41,2960 }, { 42,2960 }, { 43,2960 }, - { 44,2960 }, { 45,2960 }, { 46,2960 }, { 47,2960 }, { 48,2960 }, - { 49,2960 }, { 50,2960 }, { 51,2960 }, { 52,2960 }, { 53,2960 }, - { 54,2960 }, { 55,2960 }, { 56,2960 }, { 57,2960 }, { 58,2960 }, - { 59,2960 }, { 0, 0 }, { 61,2960 }, { 62,2960 }, { 63,2960 }, - - { 64,2960 }, { 65,2960 }, { 66,2960 }, { 67,2960 }, { 68,2960 }, - { 69,2960 }, { 70,2960 }, { 71,2960 }, { 72,2960 }, { 73,2960 }, - { 74,2960 }, { 75,2960 }, { 76,2960 }, { 77,2960 }, { 78,2960 }, - { 79,2960 }, { 80,2960 }, { 81,2960 }, { 82,2960 }, { 83,2960 }, - { 84,2960 }, { 85,2960 }, { 86,2960 }, { 87,2960 }, { 88,2960 }, - { 89,2960 }, { 90,2960 }, { 91,2960 }, { 92,2960 }, { 93,2960 }, - { 94,2960 }, { 95,2960 }, { 96,2960 }, { 97,2960 }, { 98,2960 }, - { 99,2960 }, { 100,2960 }, { 101,2960 }, { 102,2960 }, { 103,2960 }, - { 104,2960 }, { 105,2960 }, { 106,2960 }, { 107,2960 }, { 108,2960 }, - { 109,2960 }, { 110,2960 }, { 111,2960 }, { 112,2960 }, { 113,2960 }, - - { 114,2960 }, { 115,2960 }, { 116,2960 }, { 117,2960 }, { 118,2960 }, - { 119,2960 }, { 120,2960 }, { 121,2960 }, { 122,2960 }, { 123,2960 }, - { 124,2960 }, { 125,2960 }, { 126,2960 }, { 127,2960 }, { 128,2960 }, - { 129,2960 }, { 130,2960 }, { 131,2960 }, { 132,2960 }, { 133,2960 }, - { 134,2960 }, { 135,2960 }, { 136,2960 }, { 137,2960 }, { 138,2960 }, - { 139,2960 }, { 140,2960 }, { 141,2960 }, { 142,2960 }, { 143,2960 }, - { 144,2960 }, { 145,2960 }, { 146,2960 }, { 147,2960 }, { 148,2960 }, - { 149,2960 }, { 150,2960 }, { 151,2960 }, { 152,2960 }, { 153,2960 }, - { 154,2960 }, { 155,2960 }, { 156,2960 }, { 157,2960 }, { 158,2960 }, - { 159,2960 }, { 160,2960 }, { 161,2960 }, { 162,2960 }, { 163,2960 }, - - { 164,2960 }, { 165,2960 }, { 166,2960 }, { 167,2960 }, { 168,2960 }, - { 169,2960 }, { 170,2960 }, { 171,2960 }, { 172,2960 }, { 173,2960 }, - { 174,2960 }, { 175,2960 }, { 176,2960 }, { 177,2960 }, { 178,2960 }, - { 179,2960 }, { 180,2960 }, { 181,2960 }, { 182,2960 }, { 183,2960 }, - { 184,2960 }, { 185,2960 }, { 186,2960 }, { 187,2960 }, { 188,2960 }, - { 189,2960 }, { 190,2960 }, { 191,2960 }, { 192,2960 }, { 193,2960 }, - { 194,2960 }, { 195,2960 }, { 196,2960 }, { 197,2960 }, { 198,2960 }, - { 199,2960 }, { 200,2960 }, { 201,2960 }, { 202,2960 }, { 203,2960 }, - { 204,2960 }, { 205,2960 }, { 206,2960 }, { 207,2960 }, { 208,2960 }, - { 209,2960 }, { 210,2960 }, { 211,2960 }, { 212,2960 }, { 213,2960 }, - - { 214,2960 }, { 215,2960 }, { 216,2960 }, { 217,2960 }, { 218,2960 }, - { 219,2960 }, { 220,2960 }, { 221,2960 }, { 222,2960 }, { 223,2960 }, - { 224,2960 }, { 225,2960 }, { 226,2960 }, { 227,2960 }, { 228,2960 }, - { 229,2960 }, { 230,2960 }, { 231,2960 }, { 232,2960 }, { 233,2960 }, - { 234,2960 }, { 235,2960 }, { 236,2960 }, { 237,2960 }, { 238,2960 }, - { 239,2960 }, { 240,2960 }, { 241,2960 }, { 242,2960 }, { 243,2960 }, - { 244,2960 }, { 245,2960 }, { 246,2960 }, { 247,2960 }, { 248,2960 }, - { 249,2960 }, { 250,2960 }, { 251,2960 }, { 252,2960 }, { 253,2960 }, - { 254,2960 }, { 255,2960 }, { 256,2960 }, { 0, 12 }, { 0,5087 }, - { 1,2702 }, { 2,2702 }, { 3,2702 }, { 4,2702 }, { 5,2702 }, - - { 6,2702 }, { 7,2702 }, { 8,2702 }, { 9,2960 }, { 10,3218 }, - { 11,2702 }, { 12,2702 }, { 13,2960 }, { 14,2702 }, { 15,2702 }, - { 16,2702 }, { 17,2702 }, { 18,2702 }, { 19,2702 }, { 20,2702 }, - { 21,2702 }, { 22,2702 }, { 23,2702 }, { 24,2702 }, { 25,2702 }, - { 26,2702 }, { 27,2702 }, { 28,2702 }, { 29,2702 }, { 30,2702 }, - { 31,2702 }, { 32,2960 }, { 33,2702 }, { 34,2702 }, { 35,2702 }, - { 36,2702 }, { 37,2702 }, { 0, 0 }, { 39,2702 }, { 40,2702 }, - { 41,2702 }, { 42,2702 }, { 43,2702 }, { 44,2702 }, { 45,2702 }, - { 46,2702 }, { 47,2702 }, { 48,2702 }, { 49,2702 }, { 50,2702 }, - { 51,2702 }, { 52,2702 }, { 53,2702 }, { 54,2702 }, { 55,2702 }, - - { 56,2702 }, { 57,2702 }, { 58,2702 }, { 59,2702 }, { 60, 580 }, - { 61,2702 }, { 62,2702 }, { 63,2702 }, { 64,2702 }, { 65,2702 }, - { 66,2702 }, { 67,2702 }, { 68,2702 }, { 69,2702 }, { 70,2702 }, - { 71,2702 }, { 72,2702 }, { 73,2702 }, { 74,2702 }, { 75,2702 }, - { 76,2702 }, { 77,2702 }, { 78,2702 }, { 79,2702 }, { 80,2702 }, - { 81,2702 }, { 82,2702 }, { 83,2702 }, { 84,2702 }, { 85,2702 }, - { 86,2702 }, { 87,2702 }, { 88,2702 }, { 89,2702 }, { 90,2702 }, - { 91,2702 }, { 92,2702 }, { 93,2702 }, { 94,2702 }, { 95,2702 }, - { 96,2702 }, { 97,2702 }, { 98,2702 }, { 99,2702 }, { 100,2702 }, - { 101,2702 }, { 102,2702 }, { 103,2702 }, { 104,2702 }, { 105,2702 }, - - { 106,2702 }, { 107,2702 }, { 108,2702 }, { 109,2702 }, { 110,2702 }, - { 111,2702 }, { 112,2702 }, { 113,2702 }, { 114,2702 }, { 115,2702 }, - { 116,2702 }, { 117,2702 }, { 118,2702 }, { 119,2702 }, { 120,2702 }, - { 121,2702 }, { 122,2702 }, { 123,2702 }, { 124,2702 }, { 125,2702 }, - { 126,2702 }, { 127,2702 }, { 128,2702 }, { 129,2702 }, { 130,2702 }, - { 131,2702 }, { 132,2702 }, { 133,2702 }, { 134,2702 }, { 135,2702 }, - { 136,2702 }, { 137,2702 }, { 138,2702 }, { 139,2702 }, { 140,2702 }, - { 141,2702 }, { 142,2702 }, { 143,2702 }, { 144,2702 }, { 145,2702 }, - { 146,2702 }, { 147,2702 }, { 148,2702 }, { 149,2702 }, { 150,2702 }, - { 151,2702 }, { 152,2702 }, { 153,2702 }, { 154,2702 }, { 155,2702 }, - - { 156,2702 }, { 157,2702 }, { 158,2702 }, { 159,2702 }, { 160,2702 }, - { 161,2702 }, { 162,2702 }, { 163,2702 }, { 164,2702 }, { 165,2702 }, - { 166,2702 }, { 167,2702 }, { 168,2702 }, { 169,2702 }, { 170,2702 }, - { 171,2702 }, { 172,2702 }, { 173,2702 }, { 174,2702 }, { 175,2702 }, - { 176,2702 }, { 177,2702 }, { 178,2702 }, { 179,2702 }, { 180,2702 }, - { 181,2702 }, { 182,2702 }, { 183,2702 }, { 184,2702 }, { 185,2702 }, - { 186,2702 }, { 187,2702 }, { 188,2702 }, { 189,2702 }, { 190,2702 }, - { 191,2702 }, { 192,2702 }, { 193,2702 }, { 194,2702 }, { 195,2702 }, - { 196,2702 }, { 197,2702 }, { 198,2702 }, { 199,2702 }, { 200,2702 }, - { 201,2702 }, { 202,2702 }, { 203,2702 }, { 204,2702 }, { 205,2702 }, - - { 206,2702 }, { 207,2702 }, { 208,2702 }, { 209,2702 }, { 210,2702 }, - { 211,2702 }, { 212,2702 }, { 213,2702 }, { 214,2702 }, { 215,2702 }, - { 216,2702 }, { 217,2702 }, { 218,2702 }, { 219,2702 }, { 220,2702 }, - { 221,2702 }, { 222,2702 }, { 223,2702 }, { 224,2702 }, { 225,2702 }, - { 226,2702 }, { 227,2702 }, { 228,2702 }, { 229,2702 }, { 230,2702 }, - { 231,2702 }, { 232,2702 }, { 233,2702 }, { 234,2702 }, { 235,2702 }, - { 236,2702 }, { 237,2702 }, { 238,2702 }, { 239,2702 }, { 240,2702 }, - { 241,2702 }, { 242,2702 }, { 243,2702 }, { 244,2702 }, { 245,2702 }, - { 246,2702 }, { 247,2702 }, { 248,2702 }, { 249,2702 }, { 250,2702 }, - { 251,2702 }, { 252,2702 }, { 253,2702 }, { 254,2702 }, { 255,2702 }, - - { 256,2702 }, { 0, 14 }, { 0,4829 }, { 0, 10 }, { 0,4827 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 9,2960 }, { 10,2960 }, { 9, 0 }, { 10, 0 }, - { 13,2960 }, { 0, 0 }, { 13, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 32,2960 }, - { 0, 0 }, { 32, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 60, 322 }, { 0, 12 }, { 0,4767 }, - { 1,2382 }, { 2,2382 }, { 3,2382 }, { 4,2382 }, { 5,2382 }, - { 6,2382 }, { 7,2382 }, { 8,2382 }, { 9,2640 }, { 10,2900 }, - { 11,2382 }, { 12,2382 }, { 13,2640 }, { 14,2382 }, { 15,2382 }, - { 16,2382 }, { 17,2382 }, { 18,2382 }, { 19,2382 }, { 20,2382 }, - { 21,2382 }, { 22,2382 }, { 23,2382 }, { 24,2382 }, { 25,2382 }, - { 26,2382 }, { 27,2382 }, { 28,2382 }, { 29,2382 }, { 30,2382 }, - { 31,2382 }, { 32,2640 }, { 33,2382 }, { 34,2382 }, { 35,2382 }, - - { 36,2382 }, { 37,2382 }, { 0, 0 }, { 39,2382 }, { 40,2382 }, - { 41,2382 }, { 42,2382 }, { 43,2382 }, { 44,2382 }, { 45,2382 }, - { 46,2382 }, { 47,2382 }, { 48,2382 }, { 49,2382 }, { 50,2382 }, - { 51,2382 }, { 52,2382 }, { 53,2382 }, { 54,2382 }, { 55,2382 }, - { 56,2382 }, { 57,2382 }, { 58,2382 }, { 59,2382 }, { 60, 260 }, - { 61,2382 }, { 62,2382 }, { 63,2382 }, { 64,2382 }, { 65,2382 }, - { 66,2382 }, { 67,2382 }, { 68,2382 }, { 69,2382 }, { 70,2382 }, - { 71,2382 }, { 72,2382 }, { 73,2382 }, { 74,2382 }, { 75,2382 }, - { 76,2382 }, { 77,2382 }, { 78,2382 }, { 79,2382 }, { 80,2382 }, - { 81,2382 }, { 82,2382 }, { 83,2382 }, { 84,2382 }, { 85,2382 }, - - { 86,2382 }, { 87,2382 }, { 88,2382 }, { 89,2382 }, { 90,2382 }, - { 91,2382 }, { 92,2382 }, { 93,2382 }, { 94,2382 }, { 95,2382 }, - { 96,2382 }, { 97,2382 }, { 98,2382 }, { 99,2382 }, { 100,2382 }, - { 101,2382 }, { 102,2382 }, { 103,2382 }, { 104,2382 }, { 105,2382 }, - { 106,2382 }, { 107,2382 }, { 108,2382 }, { 109,2382 }, { 110,2382 }, - { 111,2382 }, { 112,2382 }, { 113,2382 }, { 114,2382 }, { 115,2382 }, - { 116,2382 }, { 117,2382 }, { 118,2382 }, { 119,2382 }, { 120,2382 }, - { 121,2382 }, { 122,2382 }, { 123,2382 }, { 124,2382 }, { 125,2382 }, - { 126,2382 }, { 127,2382 }, { 128,2382 }, { 129,2382 }, { 130,2382 }, - { 131,2382 }, { 132,2382 }, { 133,2382 }, { 134,2382 }, { 135,2382 }, - - { 136,2382 }, { 137,2382 }, { 138,2382 }, { 139,2382 }, { 140,2382 }, - { 141,2382 }, { 142,2382 }, { 143,2382 }, { 144,2382 }, { 145,2382 }, - { 146,2382 }, { 147,2382 }, { 148,2382 }, { 149,2382 }, { 150,2382 }, - { 151,2382 }, { 152,2382 }, { 153,2382 }, { 154,2382 }, { 155,2382 }, - { 156,2382 }, { 157,2382 }, { 158,2382 }, { 159,2382 }, { 160,2382 }, - { 161,2382 }, { 162,2382 }, { 163,2382 }, { 164,2382 }, { 165,2382 }, - { 166,2382 }, { 167,2382 }, { 168,2382 }, { 169,2382 }, { 170,2382 }, - { 171,2382 }, { 172,2382 }, { 173,2382 }, { 174,2382 }, { 175,2382 }, - { 176,2382 }, { 177,2382 }, { 178,2382 }, { 179,2382 }, { 180,2382 }, - { 181,2382 }, { 182,2382 }, { 183,2382 }, { 184,2382 }, { 185,2382 }, - - { 186,2382 }, { 187,2382 }, { 188,2382 }, { 189,2382 }, { 190,2382 }, - { 191,2382 }, { 192,2382 }, { 193,2382 }, { 194,2382 }, { 195,2382 }, - { 196,2382 }, { 197,2382 }, { 198,2382 }, { 199,2382 }, { 200,2382 }, - { 201,2382 }, { 202,2382 }, { 203,2382 }, { 204,2382 }, { 205,2382 }, - { 206,2382 }, { 207,2382 }, { 208,2382 }, { 209,2382 }, { 210,2382 }, - { 211,2382 }, { 212,2382 }, { 213,2382 }, { 214,2382 }, { 215,2382 }, - { 216,2382 }, { 217,2382 }, { 218,2382 }, { 219,2382 }, { 220,2382 }, - { 221,2382 }, { 222,2382 }, { 223,2382 }, { 224,2382 }, { 225,2382 }, - { 226,2382 }, { 227,2382 }, { 228,2382 }, { 229,2382 }, { 230,2382 }, - { 231,2382 }, { 232,2382 }, { 233,2382 }, { 234,2382 }, { 235,2382 }, - - { 236,2382 }, { 237,2382 }, { 238,2382 }, { 239,2382 }, { 240,2382 }, - { 241,2382 }, { 242,2382 }, { 243,2382 }, { 244,2382 }, { 245,2382 }, - { 246,2382 }, { 247,2382 }, { 248,2382 }, { 249,2382 }, { 250,2382 }, - { 251,2382 }, { 252,2382 }, { 253,2382 }, { 254,2382 }, { 255,2382 }, - { 256,2382 }, { 0, 1 }, { 0,4509 }, { 0, 0 }, { 0,4507 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 9, 0 }, { 10, 0 }, { 9, 835 }, { 10, 835 }, - { 13, 0 }, { 0, 0 }, { 13, 835 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 32, 0 }, - { 0, 0 }, { 32, 835 }, { 33,1092 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 47,-1888 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 60, 2 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 63,1350 }, { 0, 0 }, { 65,1608 }, - { 66,1608 }, { 67,1608 }, { 68,1608 }, { 69,1608 }, { 70,1608 }, - { 71,1608 }, { 72,1608 }, { 73,1608 }, { 74,1608 }, { 75,1608 }, - - { 76,1608 }, { 77,1608 }, { 78,1608 }, { 79,1608 }, { 80,1608 }, - { 81,1608 }, { 82,1608 }, { 83,1608 }, { 84,1608 }, { 85,1608 }, - { 86,1608 }, { 87,1608 }, { 88,1608 }, { 89,1608 }, { 90,1608 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 95,1608 }, - { 0, 0 }, { 97,1608 }, { 98,1608 }, { 99,1608 }, { 100,1608 }, - { 101,1608 }, { 102,1608 }, { 103,1608 }, { 104,1608 }, { 105,1608 }, - { 106,1608 }, { 107,1608 }, { 108,1608 }, { 109,1608 }, { 110,1608 }, - { 111,1608 }, { 112,1608 }, { 113,1608 }, { 114,1608 }, { 115,1608 }, - { 116,1608 }, { 117,1608 }, { 118,1608 }, { 119,1608 }, { 120,1608 }, - { 121,1608 }, { 122,1608 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - - { 0, 0 }, { 0, 0 }, { 128,1608 }, { 129,1608 }, { 130,1608 }, - { 131,1608 }, { 132,1608 }, { 133,1608 }, { 134,1608 }, { 135,1608 }, - { 136,1608 }, { 137,1608 }, { 138,1608 }, { 139,1608 }, { 140,1608 }, - { 141,1608 }, { 142,1608 }, { 143,1608 }, { 144,1608 }, { 145,1608 }, - { 146,1608 }, { 147,1608 }, { 148,1608 }, { 149,1608 }, { 150,1608 }, - { 151,1608 }, { 152,1608 }, { 153,1608 }, { 154,1608 }, { 155,1608 }, - { 156,1608 }, { 157,1608 }, { 158,1608 }, { 159,1608 }, { 160,1608 }, - { 161,1608 }, { 162,1608 }, { 163,1608 }, { 164,1608 }, { 165,1608 }, - { 166,1608 }, { 167,1608 }, { 168,1608 }, { 169,1608 }, { 170,1608 }, - { 171,1608 }, { 172,1608 }, { 173,1608 }, { 174,1608 }, { 175,1608 }, - - { 176,1608 }, { 177,1608 }, { 178,1608 }, { 179,1608 }, { 180,1608 }, - { 181,1608 }, { 182,1608 }, { 183,1608 }, { 184,1608 }, { 185,1608 }, - { 186,1608 }, { 187,1608 }, { 188,1608 }, { 189,1608 }, { 190,1608 }, - { 191,1608 }, { 192,1608 }, { 193,1608 }, { 194,1608 }, { 195,1608 }, - { 196,1608 }, { 197,1608 }, { 198,1608 }, { 199,1608 }, { 200,1608 }, - { 201,1608 }, { 202,1608 }, { 203,1608 }, { 204,1608 }, { 205,1608 }, - { 206,1608 }, { 207,1608 }, { 208,1608 }, { 209,1608 }, { 210,1608 }, - { 211,1608 }, { 212,1608 }, { 213,1608 }, { 214,1608 }, { 215,1608 }, - { 216,1608 }, { 217,1608 }, { 218,1608 }, { 219,1608 }, { 220,1608 }, - { 221,1608 }, { 222,1608 }, { 223,1608 }, { 224,1608 }, { 225,1608 }, - - { 226,1608 }, { 227,1608 }, { 228,1608 }, { 229,1608 }, { 230,1608 }, - { 231,1608 }, { 232,1608 }, { 233,1608 }, { 234,1608 }, { 235,1608 }, - { 236,1608 }, { 237,1608 }, { 238,1608 }, { 239,1608 }, { 240,1608 }, - { 241,1608 }, { 242,1608 }, { 243,1608 }, { 244,1608 }, { 245,1608 }, - { 246,1608 }, { 247,1608 }, { 248,1608 }, { 249,1608 }, { 250,1608 }, - { 251,1608 }, { 252,1608 }, { 253,1608 }, { 254,1608 }, { 255,1608 }, - { 0, 1 }, { 0,4250 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 9,-259 }, { 10,-259 }, { 0, 0 }, { 0, 0 }, { 13,-259 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 32,-259 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 60,-257 }, { 0, 0 }, { 0,4188 }, { 1, 0 }, - { 2, 0 }, { 3, 0 }, { 4, 0 }, { 5, 0 }, { 6, 0 }, - - { 7, 0 }, { 8, 0 }, { 9, 0 }, { 10, 0 }, { 11, 0 }, - { 12, 0 }, { 13, 0 }, { 14, 0 }, { 15, 0 }, { 16, 0 }, - { 17, 0 }, { 18, 0 }, { 19, 0 }, { 20, 0 }, { 21, 0 }, - { 22, 0 }, { 23, 0 }, { 24, 0 }, { 25, 0 }, { 26, 0 }, - { 27, 0 }, { 28, 0 }, { 29, 0 }, { 30, 0 }, { 31, 0 }, - { 32, 0 }, { 33, 0 }, { 34,-2209 }, { 35, 0 }, { 36, 0 }, - { 37, 0 }, { 0, 0 }, { 39, 0 }, { 40, 0 }, { 41, 0 }, - { 42, 0 }, { 43, 0 }, { 44, 0 }, { 45, 0 }, { 46, 0 }, - { 47, 0 }, { 48, 0 }, { 49, 0 }, { 50, 0 }, { 51, 0 }, - { 52, 0 }, { 53, 0 }, { 54, 0 }, { 55, 0 }, { 56, 0 }, - - { 57, 0 }, { 58, 0 }, { 59, 0 }, { 60, 0 }, { 61, 0 }, - { 62, 0 }, { 63, 0 }, { 64, 0 }, { 65, 0 }, { 66, 0 }, - { 67, 0 }, { 68, 0 }, { 69, 0 }, { 70, 0 }, { 71, 0 }, - { 72, 0 }, { 73, 0 }, { 74, 0 }, { 75, 0 }, { 76, 0 }, - { 77, 0 }, { 78, 0 }, { 79, 0 }, { 80, 0 }, { 81, 0 }, - { 82, 0 }, { 83, 0 }, { 84, 0 }, { 85, 0 }, { 86, 0 }, - { 87, 0 }, { 88, 0 }, { 89, 0 }, { 90, 0 }, { 91, 0 }, - { 92, 0 }, { 93, 0 }, { 94, 0 }, { 95, 0 }, { 96, 0 }, - { 97, 0 }, { 98, 0 }, { 99, 0 }, { 100, 0 }, { 101, 0 }, - { 102, 0 }, { 103, 0 }, { 104, 0 }, { 105, 0 }, { 106, 0 }, - - { 107, 0 }, { 108, 0 }, { 109, 0 }, { 110, 0 }, { 111, 0 }, - { 112, 0 }, { 113, 0 }, { 114, 0 }, { 115, 0 }, { 116, 0 }, - { 117, 0 }, { 118, 0 }, { 119, 0 }, { 120, 0 }, { 121, 0 }, - { 122, 0 }, { 123, 0 }, { 124, 0 }, { 125, 0 }, { 126, 0 }, - { 127, 0 }, { 128, 0 }, { 129, 0 }, { 130, 0 }, { 131, 0 }, - { 132, 0 }, { 133, 0 }, { 134, 0 }, { 135, 0 }, { 136, 0 }, - { 137, 0 }, { 138, 0 }, { 139, 0 }, { 140, 0 }, { 141, 0 }, - { 142, 0 }, { 143, 0 }, { 144, 0 }, { 145, 0 }, { 146, 0 }, - { 147, 0 }, { 148, 0 }, { 149, 0 }, { 150, 0 }, { 151, 0 }, - { 152, 0 }, { 153, 0 }, { 154, 0 }, { 155, 0 }, { 156, 0 }, - - { 157, 0 }, { 158, 0 }, { 159, 0 }, { 160, 0 }, { 161, 0 }, - { 162, 0 }, { 163, 0 }, { 164, 0 }, { 165, 0 }, { 166, 0 }, - { 167, 0 }, { 168, 0 }, { 169, 0 }, { 170, 0 }, { 171, 0 }, - { 172, 0 }, { 173, 0 }, { 174, 0 }, { 175, 0 }, { 176, 0 }, - { 177, 0 }, { 178, 0 }, { 179, 0 }, { 180, 0 }, { 181, 0 }, - { 182, 0 }, { 183, 0 }, { 184, 0 }, { 185, 0 }, { 186, 0 }, - { 187, 0 }, { 188, 0 }, { 189, 0 }, { 190, 0 }, { 191, 0 }, - { 192, 0 }, { 193, 0 }, { 194, 0 }, { 195, 0 }, { 196, 0 }, - { 197, 0 }, { 198, 0 }, { 199, 0 }, { 200, 0 }, { 201, 0 }, - { 202, 0 }, { 203, 0 }, { 204, 0 }, { 205, 0 }, { 206, 0 }, - - { 207, 0 }, { 208, 0 }, { 209, 0 }, { 210, 0 }, { 211, 0 }, - { 212, 0 }, { 213, 0 }, { 214, 0 }, { 215, 0 }, { 216, 0 }, - { 217, 0 }, { 218, 0 }, { 219, 0 }, { 220, 0 }, { 221, 0 }, - { 222, 0 }, { 223, 0 }, { 224, 0 }, { 225, 0 }, { 226, 0 }, - { 227, 0 }, { 228, 0 }, { 229, 0 }, { 230, 0 }, { 231, 0 }, - { 232, 0 }, { 233, 0 }, { 234, 0 }, { 235, 0 }, { 236, 0 }, - { 237, 0 }, { 238, 0 }, { 239, 0 }, { 240, 0 }, { 241, 0 }, - { 242, 0 }, { 243, 0 }, { 244, 0 }, { 245, 0 }, { 246, 0 }, - { 247, 0 }, { 248, 0 }, { 249, 0 }, { 250, 0 }, { 251, 0 }, - { 252, 0 }, { 253, 0 }, { 254, 0 }, { 255, 0 }, { 256, 0 }, - - { 0, 0 }, { 0,3930 }, { 1, 0 }, { 2, 0 }, { 3, 0 }, - { 4, 0 }, { 5, 0 }, { 6, 0 }, { 7, 0 }, { 8, 0 }, - { 9, 0 }, { 10, 0 }, { 11, 0 }, { 12, 0 }, { 13, 0 }, - { 14, 0 }, { 15, 0 }, { 16, 0 }, { 17, 0 }, { 18, 0 }, - { 19, 0 }, { 20, 0 }, { 21, 0 }, { 22, 0 }, { 23, 0 }, - { 24, 0 }, { 25, 0 }, { 26, 0 }, { 27, 0 }, { 28, 0 }, - { 29, 0 }, { 30, 0 }, { 31, 0 }, { 32, 0 }, { 33, 0 }, - { 34, 0 }, { 35, 0 }, { 36, 0 }, { 37, 0 }, { 0, 0 }, - { 39,-2467 }, { 40, 0 }, { 41, 0 }, { 42, 0 }, { 43, 0 }, - { 44, 0 }, { 45, 0 }, { 46, 0 }, { 47, 0 }, { 48, 0 }, - - { 49, 0 }, { 50, 0 }, { 51, 0 }, { 52, 0 }, { 53, 0 }, - { 54, 0 }, { 55, 0 }, { 56, 0 }, { 57, 0 }, { 58, 0 }, - { 59, 0 }, { 60, 0 }, { 61, 0 }, { 62, 0 }, { 63, 0 }, - { 64, 0 }, { 65, 0 }, { 66, 0 }, { 67, 0 }, { 68, 0 }, - { 69, 0 }, { 70, 0 }, { 71, 0 }, { 72, 0 }, { 73, 0 }, - { 74, 0 }, { 75, 0 }, { 76, 0 }, { 77, 0 }, { 78, 0 }, - { 79, 0 }, { 80, 0 }, { 81, 0 }, { 82, 0 }, { 83, 0 }, - { 84, 0 }, { 85, 0 }, { 86, 0 }, { 87, 0 }, { 88, 0 }, - { 89, 0 }, { 90, 0 }, { 91, 0 }, { 92, 0 }, { 93, 0 }, - { 94, 0 }, { 95, 0 }, { 96, 0 }, { 97, 0 }, { 98, 0 }, - - { 99, 0 }, { 100, 0 }, { 101, 0 }, { 102, 0 }, { 103, 0 }, - { 104, 0 }, { 105, 0 }, { 106, 0 }, { 107, 0 }, { 108, 0 }, - { 109, 0 }, { 110, 0 }, { 111, 0 }, { 112, 0 }, { 113, 0 }, - { 114, 0 }, { 115, 0 }, { 116, 0 }, { 117, 0 }, { 118, 0 }, - { 119, 0 }, { 120, 0 }, { 121, 0 }, { 122, 0 }, { 123, 0 }, - { 124, 0 }, { 125, 0 }, { 126, 0 }, { 127, 0 }, { 128, 0 }, - { 129, 0 }, { 130, 0 }, { 131, 0 }, { 132, 0 }, { 133, 0 }, - { 134, 0 }, { 135, 0 }, { 136, 0 }, { 137, 0 }, { 138, 0 }, - { 139, 0 }, { 140, 0 }, { 141, 0 }, { 142, 0 }, { 143, 0 }, - { 144, 0 }, { 145, 0 }, { 146, 0 }, { 147, 0 }, { 148, 0 }, - - { 149, 0 }, { 150, 0 }, { 151, 0 }, { 152, 0 }, { 153, 0 }, - { 154, 0 }, { 155, 0 }, { 156, 0 }, { 157, 0 }, { 158, 0 }, - { 159, 0 }, { 160, 0 }, { 161, 0 }, { 162, 0 }, { 163, 0 }, - { 164, 0 }, { 165, 0 }, { 166, 0 }, { 167, 0 }, { 168, 0 }, - { 169, 0 }, { 170, 0 }, { 171, 0 }, { 172, 0 }, { 173, 0 }, - { 174, 0 }, { 175, 0 }, { 176, 0 }, { 177, 0 }, { 178, 0 }, - { 179, 0 }, { 180, 0 }, { 181, 0 }, { 182, 0 }, { 183, 0 }, - { 184, 0 }, { 185, 0 }, { 186, 0 }, { 187, 0 }, { 188, 0 }, - { 189, 0 }, { 190, 0 }, { 191, 0 }, { 192, 0 }, { 193, 0 }, - { 194, 0 }, { 195, 0 }, { 196, 0 }, { 197, 0 }, { 198, 0 }, - - { 199, 0 }, { 200, 0 }, { 201, 0 }, { 202, 0 }, { 203, 0 }, - { 204, 0 }, { 205, 0 }, { 206, 0 }, { 207, 0 }, { 208, 0 }, - { 209, 0 }, { 210, 0 }, { 211, 0 }, { 212, 0 }, { 213, 0 }, - { 214, 0 }, { 215, 0 }, { 216, 0 }, { 217, 0 }, { 218, 0 }, - { 219, 0 }, { 220, 0 }, { 221, 0 }, { 222, 0 }, { 223, 0 }, - { 224, 0 }, { 225, 0 }, { 226, 0 }, { 227, 0 }, { 228, 0 }, - { 229, 0 }, { 230, 0 }, { 231, 0 }, { 232, 0 }, { 233, 0 }, - { 234, 0 }, { 235, 0 }, { 236, 0 }, { 237, 0 }, { 238, 0 }, - { 239, 0 }, { 240, 0 }, { 241, 0 }, { 242, 0 }, { 243, 0 }, - { 244, 0 }, { 245, 0 }, { 246, 0 }, { 247, 0 }, { 248, 0 }, - - { 249, 0 }, { 250, 0 }, { 251, 0 }, { 252, 0 }, { 253, 0 }, - { 254, 0 }, { 255, 0 }, { 256, 0 }, { 0, 0 }, { 0,3672 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 9, 0 }, { 10, 0 }, - { 0, 0 }, { 0, 0 }, { 13, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 32, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 47,-2723 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 65, 773 }, - { 66, 773 }, { 67, 773 }, { 68, 773 }, { 69, 773 }, { 70, 773 }, - { 71, 773 }, { 72, 773 }, { 73, 773 }, { 74, 773 }, { 75, 773 }, - { 76, 773 }, { 77, 773 }, { 78, 773 }, { 79, 773 }, { 80, 773 }, - { 81, 773 }, { 82, 773 }, { 83, 773 }, { 84, 773 }, { 85, 773 }, - { 86, 773 }, { 87, 773 }, { 88, 773 }, { 89, 773 }, { 90, 773 }, - - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 95, 773 }, - { 0, 0 }, { 97, 773 }, { 98, 773 }, { 99, 773 }, { 100, 773 }, - { 101, 773 }, { 102, 773 }, { 103, 773 }, { 104, 773 }, { 105, 773 }, - { 106, 773 }, { 107, 773 }, { 108, 773 }, { 109, 773 }, { 110, 773 }, - { 111, 773 }, { 112, 773 }, { 113, 773 }, { 114, 773 }, { 115, 773 }, - { 116, 773 }, { 117, 773 }, { 118, 773 }, { 119, 773 }, { 120, 773 }, - { 121, 773 }, { 122, 773 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 128, 773 }, { 129, 773 }, { 130, 773 }, - { 131, 773 }, { 132, 773 }, { 133, 773 }, { 134, 773 }, { 135, 773 }, - { 136, 773 }, { 137, 773 }, { 138, 773 }, { 139, 773 }, { 140, 773 }, - - { 141, 773 }, { 142, 773 }, { 143, 773 }, { 144, 773 }, { 145, 773 }, - { 146, 773 }, { 147, 773 }, { 148, 773 }, { 149, 773 }, { 150, 773 }, - { 151, 773 }, { 152, 773 }, { 153, 773 }, { 154, 773 }, { 155, 773 }, - { 156, 773 }, { 157, 773 }, { 158, 773 }, { 159, 773 }, { 160, 773 }, - { 161, 773 }, { 162, 773 }, { 163, 773 }, { 164, 773 }, { 165, 773 }, - { 166, 773 }, { 167, 773 }, { 168, 773 }, { 169, 773 }, { 170, 773 }, - { 171, 773 }, { 172, 773 }, { 173, 773 }, { 174, 773 }, { 175, 773 }, - { 176, 773 }, { 177, 773 }, { 178, 773 }, { 179, 773 }, { 180, 773 }, - { 181, 773 }, { 182, 773 }, { 183, 773 }, { 184, 773 }, { 185, 773 }, - { 186, 773 }, { 187, 773 }, { 188, 773 }, { 189, 773 }, { 190, 773 }, - - { 191, 773 }, { 192, 773 }, { 193, 773 }, { 194, 773 }, { 195, 773 }, - { 196, 773 }, { 197, 773 }, { 198, 773 }, { 199, 773 }, { 200, 773 }, - { 201, 773 }, { 202, 773 }, { 203, 773 }, { 204, 773 }, { 205, 773 }, - { 206, 773 }, { 207, 773 }, { 208, 773 }, { 209, 773 }, { 210, 773 }, - { 211, 773 }, { 212, 773 }, { 213, 773 }, { 214, 773 }, { 215, 773 }, - { 216, 773 }, { 217, 773 }, { 218, 773 }, { 219, 773 }, { 220, 773 }, - { 221, 773 }, { 222, 773 }, { 223, 773 }, { 224, 773 }, { 225, 773 }, - { 226, 773 }, { 227, 773 }, { 228, 773 }, { 229, 773 }, { 230, 773 }, - { 231, 773 }, { 232, 773 }, { 233, 773 }, { 234, 773 }, { 235, 773 }, - { 236, 773 }, { 237, 773 }, { 238, 773 }, { 239, 773 }, { 240, 773 }, - - { 241, 773 }, { 242, 773 }, { 243, 773 }, { 244, 773 }, { 245, 773 }, - { 246, 773 }, { 247, 773 }, { 248, 773 }, { 249, 773 }, { 250, 773 }, - { 251, 773 }, { 252, 773 }, { 253, 773 }, { 254, 773 }, { 255, 773 }, - { 0, 0 }, { 0,3415 }, { 1,1610 }, { 2,1610 }, { 3,1610 }, - { 4,1610 }, { 5,1610 }, { 6,1610 }, { 7,1610 }, { 8,1610 }, - { 9,1610 }, { 10,1610 }, { 11,1610 }, { 12,1610 }, { 13,1610 }, - { 14,1610 }, { 15,1610 }, { 16,1610 }, { 17,1610 }, { 18,1610 }, - { 19,1610 }, { 20,1610 }, { 21,1610 }, { 22,1610 }, { 23,1610 }, - { 24,1610 }, { 25,1610 }, { 26,1610 }, { 27,1610 }, { 28,1610 }, - { 29,1610 }, { 30,1610 }, { 31,1610 }, { 32,1610 }, { 33,1610 }, - - { 34,1610 }, { 35,1610 }, { 36,1610 }, { 37,1610 }, { 38,1610 }, - { 39,1610 }, { 40,1610 }, { 41,1610 }, { 42,1610 }, { 43,1610 }, - { 44,1610 }, { 45,-2425 }, { 46,1610 }, { 47,1610 }, { 48,1610 }, - { 49,1610 }, { 50,1610 }, { 51,1610 }, { 52,1610 }, { 53,1610 }, - { 54,1610 }, { 55,1610 }, { 56,1610 }, { 57,1610 }, { 58,1610 }, - { 59,1610 }, { 60,1610 }, { 61,1610 }, { 62,1610 }, { 63,1610 }, - { 64,1610 }, { 65,1610 }, { 66,1610 }, { 67,1610 }, { 68,1610 }, - { 69,1610 }, { 70,1610 }, { 71,1610 }, { 72,1610 }, { 73,1610 }, - { 74,1610 }, { 75,1610 }, { 76,1610 }, { 77,1610 }, { 78,1610 }, - { 79,1610 }, { 80,1610 }, { 81,1610 }, { 82,1610 }, { 83,1610 }, - - { 84,1610 }, { 85,1610 }, { 86,1610 }, { 87,1610 }, { 88,1610 }, - { 89,1610 }, { 90,1610 }, { 91,1610 }, { 92,1610 }, { 93,1610 }, - { 94,1610 }, { 95,1610 }, { 96,1610 }, { 97,1610 }, { 98,1610 }, - { 99,1610 }, { 100,1610 }, { 101,1610 }, { 102,1610 }, { 103,1610 }, - { 104,1610 }, { 105,1610 }, { 106,1610 }, { 107,1610 }, { 108,1610 }, - { 109,1610 }, { 110,1610 }, { 111,1610 }, { 112,1610 }, { 113,1610 }, - { 114,1610 }, { 115,1610 }, { 116,1610 }, { 117,1610 }, { 118,1610 }, - { 119,1610 }, { 120,1610 }, { 121,1610 }, { 122,1610 }, { 123,1610 }, - { 124,1610 }, { 125,1610 }, { 126,1610 }, { 127,1610 }, { 128,1610 }, - { 129,1610 }, { 130,1610 }, { 131,1610 }, { 132,1610 }, { 133,1610 }, - - { 134,1610 }, { 135,1610 }, { 136,1610 }, { 137,1610 }, { 138,1610 }, - { 139,1610 }, { 140,1610 }, { 141,1610 }, { 142,1610 }, { 143,1610 }, - { 144,1610 }, { 145,1610 }, { 146,1610 }, { 147,1610 }, { 148,1610 }, - { 149,1610 }, { 150,1610 }, { 151,1610 }, { 152,1610 }, { 153,1610 }, - { 154,1610 }, { 155,1610 }, { 156,1610 }, { 157,1610 }, { 158,1610 }, - { 159,1610 }, { 160,1610 }, { 161,1610 }, { 162,1610 }, { 163,1610 }, - { 164,1610 }, { 165,1610 }, { 166,1610 }, { 167,1610 }, { 168,1610 }, - { 169,1610 }, { 170,1610 }, { 171,1610 }, { 172,1610 }, { 173,1610 }, - { 174,1610 }, { 175,1610 }, { 176,1610 }, { 177,1610 }, { 178,1610 }, - { 179,1610 }, { 180,1610 }, { 181,1610 }, { 182,1610 }, { 183,1610 }, - - { 184,1610 }, { 185,1610 }, { 186,1610 }, { 187,1610 }, { 188,1610 }, - { 189,1610 }, { 190,1610 }, { 191,1610 }, { 192,1610 }, { 193,1610 }, - { 194,1610 }, { 195,1610 }, { 196,1610 }, { 197,1610 }, { 198,1610 }, - { 199,1610 }, { 200,1610 }, { 201,1610 }, { 202,1610 }, { 203,1610 }, - { 204,1610 }, { 205,1610 }, { 206,1610 }, { 207,1610 }, { 208,1610 }, - { 209,1610 }, { 210,1610 }, { 211,1610 }, { 212,1610 }, { 213,1610 }, - { 214,1610 }, { 215,1610 }, { 216,1610 }, { 217,1610 }, { 218,1610 }, - { 219,1610 }, { 220,1610 }, { 221,1610 }, { 222,1610 }, { 223,1610 }, - { 224,1610 }, { 225,1610 }, { 226,1610 }, { 227,1610 }, { 228,1610 }, - { 229,1610 }, { 230,1610 }, { 231,1610 }, { 232,1610 }, { 233,1610 }, - - { 234,1610 }, { 235,1610 }, { 236,1610 }, { 237,1610 }, { 238,1610 }, - { 239,1610 }, { 240,1610 }, { 241,1610 }, { 242,1610 }, { 243,1610 }, - { 244,1610 }, { 245,1610 }, { 246,1610 }, { 247,1610 }, { 248,1610 }, - { 249,1610 }, { 250,1610 }, { 251,1610 }, { 252,1610 }, { 253,1610 }, - { 254,1610 }, { 255,1610 }, { 256,1610 }, { 0, 0 }, { 0,3157 }, - { 1,1352 }, { 2,1352 }, { 3,1352 }, { 4,1352 }, { 5,1352 }, - { 6,1352 }, { 7,1352 }, { 8,1352 }, { 9,1352 }, { 10,1352 }, - { 11,1352 }, { 12,1352 }, { 13,1352 }, { 14,1352 }, { 15,1352 }, - { 16,1352 }, { 17,1352 }, { 18,1352 }, { 19,1352 }, { 20,1352 }, - { 21,1352 }, { 22,1352 }, { 23,1352 }, { 24,1352 }, { 25,1352 }, - - { 26,1352 }, { 27,1352 }, { 28,1352 }, { 29,1352 }, { 30,1352 }, - { 31,1352 }, { 32,1352 }, { 33,1352 }, { 34,1352 }, { 35,1352 }, - { 36,1352 }, { 37,1352 }, { 38,1352 }, { 39,1352 }, { 40,1352 }, - { 41,1352 }, { 42,1352 }, { 43,1352 }, { 44,1352 }, { 0, 0 }, - { 46,1352 }, { 47,1352 }, { 48,1352 }, { 49,1352 }, { 50,1352 }, - { 51,1352 }, { 52,1352 }, { 53,1352 }, { 54,1352 }, { 55,1352 }, - { 56,1352 }, { 57,1352 }, { 58,1352 }, { 59,1352 }, { 60,1352 }, - { 61,1352 }, { 62,1352 }, { 63,1352 }, { 64,1352 }, { 65,1352 }, - { 66,1352 }, { 67,1352 }, { 68,1352 }, { 69,1352 }, { 70,1352 }, - { 71,1352 }, { 72,1352 }, { 73,1352 }, { 74,1352 }, { 75,1352 }, - - { 76,1352 }, { 77,1352 }, { 78,1352 }, { 79,1352 }, { 80,1352 }, - { 81,1352 }, { 82,1352 }, { 83,1352 }, { 84,1352 }, { 85,1352 }, - { 86,1352 }, { 87,1352 }, { 88,1352 }, { 89,1352 }, { 90,1352 }, - { 91,1352 }, { 92,1352 }, { 93,1352 }, { 94,1352 }, { 95,1352 }, - { 96,1352 }, { 97,1352 }, { 98,1352 }, { 99,1352 }, { 100,1352 }, - { 101,1352 }, { 102,1352 }, { 103,1352 }, { 104,1352 }, { 105,1352 }, - { 106,1352 }, { 107,1352 }, { 108,1352 }, { 109,1352 }, { 110,1352 }, - { 111,1352 }, { 112,1352 }, { 113,1352 }, { 114,1352 }, { 115,1352 }, - { 116,1352 }, { 117,1352 }, { 118,1352 }, { 119,1352 }, { 120,1352 }, - { 121,1352 }, { 122,1352 }, { 123,1352 }, { 124,1352 }, { 125,1352 }, - - { 126,1352 }, { 127,1352 }, { 128,1352 }, { 129,1352 }, { 130,1352 }, - { 131,1352 }, { 132,1352 }, { 133,1352 }, { 134,1352 }, { 135,1352 }, - { 136,1352 }, { 137,1352 }, { 138,1352 }, { 139,1352 }, { 140,1352 }, - { 141,1352 }, { 142,1352 }, { 143,1352 }, { 144,1352 }, { 145,1352 }, - { 146,1352 }, { 147,1352 }, { 148,1352 }, { 149,1352 }, { 150,1352 }, - { 151,1352 }, { 152,1352 }, { 153,1352 }, { 154,1352 }, { 155,1352 }, - { 156,1352 }, { 157,1352 }, { 158,1352 }, { 159,1352 }, { 160,1352 }, - { 161,1352 }, { 162,1352 }, { 163,1352 }, { 164,1352 }, { 165,1352 }, - { 166,1352 }, { 167,1352 }, { 168,1352 }, { 169,1352 }, { 170,1352 }, - { 171,1352 }, { 172,1352 }, { 173,1352 }, { 174,1352 }, { 175,1352 }, - - { 176,1352 }, { 177,1352 }, { 178,1352 }, { 179,1352 }, { 180,1352 }, - { 181,1352 }, { 182,1352 }, { 183,1352 }, { 184,1352 }, { 185,1352 }, - { 186,1352 }, { 187,1352 }, { 188,1352 }, { 189,1352 }, { 190,1352 }, - { 191,1352 }, { 192,1352 }, { 193,1352 }, { 194,1352 }, { 195,1352 }, - { 196,1352 }, { 197,1352 }, { 198,1352 }, { 199,1352 }, { 200,1352 }, - { 201,1352 }, { 202,1352 }, { 203,1352 }, { 204,1352 }, { 205,1352 }, - { 206,1352 }, { 207,1352 }, { 208,1352 }, { 209,1352 }, { 210,1352 }, - { 211,1352 }, { 212,1352 }, { 213,1352 }, { 214,1352 }, { 215,1352 }, - { 216,1352 }, { 217,1352 }, { 218,1352 }, { 219,1352 }, { 220,1352 }, - { 221,1352 }, { 222,1352 }, { 223,1352 }, { 224,1352 }, { 225,1352 }, - - { 226,1352 }, { 227,1352 }, { 228,1352 }, { 229,1352 }, { 230,1352 }, - { 231,1352 }, { 232,1352 }, { 233,1352 }, { 234,1352 }, { 235,1352 }, - { 236,1352 }, { 237,1352 }, { 238,1352 }, { 239,1352 }, { 240,1352 }, - { 241,1352 }, { 242,1352 }, { 243,1352 }, { 244,1352 }, { 245,1352 }, - { 246,1352 }, { 247,1352 }, { 248,1352 }, { 249,1352 }, { 250,1352 }, - { 251,1352 }, { 252,1352 }, { 253,1352 }, { 254,1352 }, { 255,1352 }, - { 256,1352 }, { 0, 8 }, { 0,2899 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 45,1352 }, { 46,1352 }, { 0, 0 }, - { 48,1352 }, { 49,1352 }, { 50,1352 }, { 51,1352 }, { 52,1352 }, - { 53,1352 }, { 54,1352 }, { 55,1352 }, { 56,1352 }, { 57,1352 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 65,1352 }, { 66,1352 }, { 67,1352 }, - - { 68,1352 }, { 69,1352 }, { 70,1352 }, { 71,1352 }, { 72,1352 }, - { 73,1352 }, { 74,1352 }, { 75,1352 }, { 76,1352 }, { 77,1352 }, - { 78,1352 }, { 79,1352 }, { 80,1352 }, { 81,1352 }, { 82,1352 }, - { 83,1352 }, { 84,1352 }, { 85,1352 }, { 86,1352 }, { 87,1352 }, - { 88,1352 }, { 89,1352 }, { 90,1352 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 95,1352 }, { 0, 0 }, { 97,1352 }, - { 98,1352 }, { 99,1352 }, { 100,1352 }, { 101,1352 }, { 102,1352 }, - { 103,1352 }, { 104,1352 }, { 105,1352 }, { 106,1352 }, { 107,1352 }, - { 108,1352 }, { 109,1352 }, { 110,1352 }, { 111,1352 }, { 112,1352 }, - { 113,1352 }, { 114,1352 }, { 115,1352 }, { 116,1352 }, { 117,1352 }, - - { 118,1352 }, { 119,1352 }, { 120,1352 }, { 121,1352 }, { 122,1352 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 128,1352 }, { 129,1352 }, { 130,1352 }, { 131,1352 }, { 132,1352 }, - { 133,1352 }, { 134,1352 }, { 135,1352 }, { 136,1352 }, { 137,1352 }, - { 138,1352 }, { 139,1352 }, { 140,1352 }, { 141,1352 }, { 142,1352 }, - { 143,1352 }, { 144,1352 }, { 145,1352 }, { 146,1352 }, { 147,1352 }, - { 148,1352 }, { 149,1352 }, { 150,1352 }, { 151,1352 }, { 152,1352 }, - { 153,1352 }, { 154,1352 }, { 155,1352 }, { 156,1352 }, { 157,1352 }, - { 158,1352 }, { 159,1352 }, { 160,1352 }, { 161,1352 }, { 162,1352 }, - { 163,1352 }, { 164,1352 }, { 165,1352 }, { 166,1352 }, { 167,1352 }, - - { 168,1352 }, { 169,1352 }, { 170,1352 }, { 171,1352 }, { 172,1352 }, - { 173,1352 }, { 174,1352 }, { 175,1352 }, { 176,1352 }, { 177,1352 }, - { 178,1352 }, { 179,1352 }, { 180,1352 }, { 181,1352 }, { 182,1352 }, - { 183,1352 }, { 184,1352 }, { 185,1352 }, { 186,1352 }, { 187,1352 }, - { 188,1352 }, { 189,1352 }, { 190,1352 }, { 191,1352 }, { 192,1352 }, - { 193,1352 }, { 194,1352 }, { 195,1352 }, { 196,1352 }, { 197,1352 }, - { 198,1352 }, { 199,1352 }, { 200,1352 }, { 201,1352 }, { 202,1352 }, - { 203,1352 }, { 204,1352 }, { 205,1352 }, { 206,1352 }, { 207,1352 }, - { 208,1352 }, { 209,1352 }, { 210,1352 }, { 211,1352 }, { 212,1352 }, - { 213,1352 }, { 214,1352 }, { 215,1352 }, { 216,1352 }, { 217,1352 }, - - { 218,1352 }, { 219,1352 }, { 220,1352 }, { 221,1352 }, { 222,1352 }, - { 223,1352 }, { 224,1352 }, { 225,1352 }, { 226,1352 }, { 227,1352 }, - { 228,1352 }, { 229,1352 }, { 230,1352 }, { 231,1352 }, { 232,1352 }, - { 233,1352 }, { 234,1352 }, { 235,1352 }, { 236,1352 }, { 237,1352 }, - { 238,1352 }, { 239,1352 }, { 240,1352 }, { 241,1352 }, { 242,1352 }, - { 243,1352 }, { 244,1352 }, { 245,1352 }, { 246,1352 }, { 247,1352 }, - { 248,1352 }, { 249,1352 }, { 250,1352 }, { 251,1352 }, { 252,1352 }, - { 253,1352 }, { 254,1352 }, { 255,1352 }, { 0, 5 }, { 0,2642 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 45, 0 }, - { 46, 0 }, { 0, 0 }, { 48, 0 }, { 49, 0 }, { 50, 0 }, - { 51, 0 }, { 52, 0 }, { 53, 0 }, { 54, 0 }, { 55, 0 }, - { 56, 0 }, { 57, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 65, 0 }, - { 66, 0 }, { 67, 0 }, { 68, 0 }, { 69, 0 }, { 70, 0 }, - { 71, 0 }, { 72, 0 }, { 73, 0 }, { 74, 0 }, { 75, 0 }, - { 76, 0 }, { 77, 0 }, { 78, 0 }, { 79, 0 }, { 80, 0 }, - { 81, 0 }, { 82, 0 }, { 83, 0 }, { 84, 0 }, { 85, 0 }, - { 86, 0 }, { 87, 0 }, { 88, 0 }, { 89, 0 }, { 90, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 95, 0 }, - { 0, 0 }, { 97, 0 }, { 98, 0 }, { 99, 0 }, { 100, 0 }, - { 101, 0 }, { 102, 0 }, { 103, 0 }, { 104, 0 }, { 105, 0 }, - { 106, 0 }, { 107, 0 }, { 108, 0 }, { 109, 0 }, { 110, 0 }, - - { 111, 0 }, { 112, 0 }, { 113, 0 }, { 114, 0 }, { 115, 0 }, - { 116, 0 }, { 117, 0 }, { 118, 0 }, { 119, 0 }, { 120, 0 }, - { 121, 0 }, { 122, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 128, 0 }, { 129, 0 }, { 130, 0 }, - { 131, 0 }, { 132, 0 }, { 133, 0 }, { 134, 0 }, { 135, 0 }, - { 136, 0 }, { 137, 0 }, { 138, 0 }, { 139, 0 }, { 140, 0 }, - { 141, 0 }, { 142, 0 }, { 143, 0 }, { 144, 0 }, { 145, 0 }, - { 146, 0 }, { 147, 0 }, { 148, 0 }, { 149, 0 }, { 150, 0 }, - { 151, 0 }, { 152, 0 }, { 153, 0 }, { 154, 0 }, { 155, 0 }, - { 156, 0 }, { 157, 0 }, { 158, 0 }, { 159, 0 }, { 160, 0 }, - - { 161, 0 }, { 162, 0 }, { 163, 0 }, { 164, 0 }, { 165, 0 }, - { 166, 0 }, { 167, 0 }, { 168, 0 }, { 169, 0 }, { 170, 0 }, - { 171, 0 }, { 172, 0 }, { 173, 0 }, { 174, 0 }, { 175, 0 }, - { 176, 0 }, { 177, 0 }, { 178, 0 }, { 179, 0 }, { 180, 0 }, - { 181, 0 }, { 182, 0 }, { 183, 0 }, { 184, 0 }, { 185, 0 }, - { 186, 0 }, { 187, 0 }, { 188, 0 }, { 189, 0 }, { 190, 0 }, - { 191, 0 }, { 192, 0 }, { 193, 0 }, { 194, 0 }, { 195, 0 }, - { 196, 0 }, { 197, 0 }, { 198, 0 }, { 199, 0 }, { 200, 0 }, - { 201, 0 }, { 202, 0 }, { 203, 0 }, { 204, 0 }, { 205, 0 }, - { 206, 0 }, { 207, 0 }, { 208, 0 }, { 209, 0 }, { 210, 0 }, - - { 211, 0 }, { 212, 0 }, { 213, 0 }, { 214, 0 }, { 215, 0 }, - { 216, 0 }, { 217, 0 }, { 218, 0 }, { 219, 0 }, { 220, 0 }, - { 221, 0 }, { 222, 0 }, { 223, 0 }, { 224, 0 }, { 225, 0 }, - { 226, 0 }, { 227, 0 }, { 228, 0 }, { 229, 0 }, { 230, 0 }, - { 231, 0 }, { 232, 0 }, { 233, 0 }, { 234, 0 }, { 235, 0 }, - { 236, 0 }, { 237, 0 }, { 238, 0 }, { 239, 0 }, { 240, 0 }, - { 241, 0 }, { 242, 0 }, { 243, 0 }, { 244, 0 }, { 245, 0 }, - { 246, 0 }, { 247, 0 }, { 248, 0 }, { 249, 0 }, { 250, 0 }, - { 251, 0 }, { 252, 0 }, { 253, 0 }, { 254, 0 }, { 255, 0 }, - { 0, 12 }, { 0,2385 }, { 1, 0 }, { 2, 0 }, { 3, 0 }, - - { 4, 0 }, { 5, 0 }, { 6, 0 }, { 7, 0 }, { 8, 0 }, - { 9, 0 }, { 0, 0 }, { 11, 0 }, { 12, 0 }, { 13, 0 }, - { 14, 0 }, { 15, 0 }, { 16, 0 }, { 17, 0 }, { 18, 0 }, - { 19, 0 }, { 20, 0 }, { 21, 0 }, { 22, 0 }, { 23, 0 }, - { 24, 0 }, { 25, 0 }, { 26, 0 }, { 27, 0 }, { 28, 0 }, - { 29, 0 }, { 30, 0 }, { 31, 0 }, { 32, 0 }, { 33, 0 }, - { 34, 0 }, { 35, 0 }, { 36, 0 }, { 37, 0 }, { 0, 0 }, - { 39, 0 }, { 40, 0 }, { 41, 0 }, { 42, 0 }, { 43, 0 }, - { 44, 0 }, { 45, 0 }, { 46, 0 }, { 47, 0 }, { 48, 0 }, - { 49, 0 }, { 50, 0 }, { 51, 0 }, { 52, 0 }, { 53, 0 }, - - { 54, 0 }, { 55, 0 }, { 56, 0 }, { 57, 0 }, { 58, 0 }, - { 59, 0 }, { 0, 0 }, { 61, 0 }, { 62, 0 }, { 63, 0 }, - { 64, 0 }, { 65, 0 }, { 66, 0 }, { 67, 0 }, { 68, 0 }, - { 69, 0 }, { 70, 0 }, { 71, 0 }, { 72, 0 }, { 73, 0 }, - { 74, 0 }, { 75, 0 }, { 76, 0 }, { 77, 0 }, { 78, 0 }, - { 79, 0 }, { 80, 0 }, { 81, 0 }, { 82, 0 }, { 83, 0 }, - { 84, 0 }, { 85, 0 }, { 86, 0 }, { 87, 0 }, { 88, 0 }, - { 89, 0 }, { 90, 0 }, { 91, 0 }, { 92, 0 }, { 93, 0 }, - { 94, 0 }, { 95, 0 }, { 96, 0 }, { 97, 0 }, { 98, 0 }, - { 99, 0 }, { 100, 0 }, { 101, 0 }, { 102, 0 }, { 103, 0 }, - - { 104, 0 }, { 105, 0 }, { 106, 0 }, { 107, 0 }, { 108, 0 }, - { 109, 0 }, { 110, 0 }, { 111, 0 }, { 112, 0 }, { 113, 0 }, - { 114, 0 }, { 115, 0 }, { 116, 0 }, { 117, 0 }, { 118, 0 }, - { 119, 0 }, { 120, 0 }, { 121, 0 }, { 122, 0 }, { 123, 0 }, - { 124, 0 }, { 125, 0 }, { 126, 0 }, { 127, 0 }, { 128, 0 }, - { 129, 0 }, { 130, 0 }, { 131, 0 }, { 132, 0 }, { 133, 0 }, - { 134, 0 }, { 135, 0 }, { 136, 0 }, { 137, 0 }, { 138, 0 }, - { 139, 0 }, { 140, 0 }, { 141, 0 }, { 142, 0 }, { 143, 0 }, - { 144, 0 }, { 145, 0 }, { 146, 0 }, { 147, 0 }, { 148, 0 }, - { 149, 0 }, { 150, 0 }, { 151, 0 }, { 152, 0 }, { 153, 0 }, - - { 154, 0 }, { 155, 0 }, { 156, 0 }, { 157, 0 }, { 158, 0 }, - { 159, 0 }, { 160, 0 }, { 161, 0 }, { 162, 0 }, { 163, 0 }, - { 164, 0 }, { 165, 0 }, { 166, 0 }, { 167, 0 }, { 168, 0 }, - { 169, 0 }, { 170, 0 }, { 171, 0 }, { 172, 0 }, { 173, 0 }, - { 174, 0 }, { 175, 0 }, { 176, 0 }, { 177, 0 }, { 178, 0 }, - { 179, 0 }, { 180, 0 }, { 181, 0 }, { 182, 0 }, { 183, 0 }, - { 184, 0 }, { 185, 0 }, { 186, 0 }, { 187, 0 }, { 188, 0 }, - { 189, 0 }, { 190, 0 }, { 191, 0 }, { 192, 0 }, { 193, 0 }, - { 194, 0 }, { 195, 0 }, { 196, 0 }, { 197, 0 }, { 198, 0 }, - { 199, 0 }, { 200, 0 }, { 201, 0 }, { 202, 0 }, { 203, 0 }, - - { 204, 0 }, { 205, 0 }, { 206, 0 }, { 207, 0 }, { 208, 0 }, - { 209, 0 }, { 210, 0 }, { 211, 0 }, { 212, 0 }, { 213, 0 }, - { 214, 0 }, { 215, 0 }, { 216, 0 }, { 217, 0 }, { 218, 0 }, - { 219, 0 }, { 220, 0 }, { 221, 0 }, { 222, 0 }, { 223, 0 }, - { 224, 0 }, { 225, 0 }, { 226, 0 }, { 227, 0 }, { 228, 0 }, - { 229, 0 }, { 230, 0 }, { 231, 0 }, { 232, 0 }, { 233, 0 }, - { 234, 0 }, { 235, 0 }, { 236, 0 }, { 237, 0 }, { 238, 0 }, - { 239, 0 }, { 240, 0 }, { 241, 0 }, { 242, 0 }, { 243, 0 }, - { 244, 0 }, { 245, 0 }, { 246, 0 }, { 247, 0 }, { 248, 0 }, - { 249, 0 }, { 250, 0 }, { 251, 0 }, { 252, 0 }, { 253, 0 }, - - { 254, 0 }, { 255, 0 }, { 256, 0 }, { 0, 12 }, { 0,2127 }, - { 1,-258 }, { 2,-258 }, { 3,-258 }, { 4,-258 }, { 5,-258 }, - { 6,-258 }, { 7,-258 }, { 8,-258 }, { 9, 0 }, { 10, 258 }, - { 11,-258 }, { 12,-258 }, { 13, 0 }, { 14,-258 }, { 15,-258 }, - { 16,-258 }, { 17,-258 }, { 18,-258 }, { 19,-258 }, { 20,-258 }, - { 21,-258 }, { 22,-258 }, { 23,-258 }, { 24,-258 }, { 25,-258 }, - { 26,-258 }, { 27,-258 }, { 28,-258 }, { 29,-258 }, { 30,-258 }, - { 31,-258 }, { 32, 0 }, { 33,-258 }, { 34,-258 }, { 35,-258 }, - { 36,-258 }, { 37,-258 }, { 0, 0 }, { 39,-258 }, { 40,-258 }, - { 41,-258 }, { 42,-258 }, { 43,-258 }, { 44,-258 }, { 45,-258 }, - - { 46,-258 }, { 47,-258 }, { 48,-258 }, { 49,-258 }, { 50,-258 }, - { 51,-258 }, { 52,-258 }, { 53,-258 }, { 54,-258 }, { 55,-258 }, - { 56,-258 }, { 57,-258 }, { 58,-258 }, { 59,-258 }, { 60,-2380 }, - { 61,-258 }, { 62,-258 }, { 63,-258 }, { 64,-258 }, { 65,-258 }, - { 66,-258 }, { 67,-258 }, { 68,-258 }, { 69,-258 }, { 70,-258 }, - { 71,-258 }, { 72,-258 }, { 73,-258 }, { 74,-258 }, { 75,-258 }, - { 76,-258 }, { 77,-258 }, { 78,-258 }, { 79,-258 }, { 80,-258 }, - { 81,-258 }, { 82,-258 }, { 83,-258 }, { 84,-258 }, { 85,-258 }, - { 86,-258 }, { 87,-258 }, { 88,-258 }, { 89,-258 }, { 90,-258 }, - { 91,-258 }, { 92,-258 }, { 93,-258 }, { 94,-258 }, { 95,-258 }, - - { 96,-258 }, { 97,-258 }, { 98,-258 }, { 99,-258 }, { 100,-258 }, - { 101,-258 }, { 102,-258 }, { 103,-258 }, { 104,-258 }, { 105,-258 }, - { 106,-258 }, { 107,-258 }, { 108,-258 }, { 109,-258 }, { 110,-258 }, - { 111,-258 }, { 112,-258 }, { 113,-258 }, { 114,-258 }, { 115,-258 }, - { 116,-258 }, { 117,-258 }, { 118,-258 }, { 119,-258 }, { 120,-258 }, - { 121,-258 }, { 122,-258 }, { 123,-258 }, { 124,-258 }, { 125,-258 }, - { 126,-258 }, { 127,-258 }, { 128,-258 }, { 129,-258 }, { 130,-258 }, - { 131,-258 }, { 132,-258 }, { 133,-258 }, { 134,-258 }, { 135,-258 }, - { 136,-258 }, { 137,-258 }, { 138,-258 }, { 139,-258 }, { 140,-258 }, - { 141,-258 }, { 142,-258 }, { 143,-258 }, { 144,-258 }, { 145,-258 }, - - { 146,-258 }, { 147,-258 }, { 148,-258 }, { 149,-258 }, { 150,-258 }, - { 151,-258 }, { 152,-258 }, { 153,-258 }, { 154,-258 }, { 155,-258 }, - { 156,-258 }, { 157,-258 }, { 158,-258 }, { 159,-258 }, { 160,-258 }, - { 161,-258 }, { 162,-258 }, { 163,-258 }, { 164,-258 }, { 165,-258 }, - { 166,-258 }, { 167,-258 }, { 168,-258 }, { 169,-258 }, { 170,-258 }, - { 171,-258 }, { 172,-258 }, { 173,-258 }, { 174,-258 }, { 175,-258 }, - { 176,-258 }, { 177,-258 }, { 178,-258 }, { 179,-258 }, { 180,-258 }, - { 181,-258 }, { 182,-258 }, { 183,-258 }, { 184,-258 }, { 185,-258 }, - { 186,-258 }, { 187,-258 }, { 188,-258 }, { 189,-258 }, { 190,-258 }, - { 191,-258 }, { 192,-258 }, { 193,-258 }, { 194,-258 }, { 195,-258 }, - - { 196,-258 }, { 197,-258 }, { 198,-258 }, { 199,-258 }, { 200,-258 }, - { 201,-258 }, { 202,-258 }, { 203,-258 }, { 204,-258 }, { 205,-258 }, - { 206,-258 }, { 207,-258 }, { 208,-258 }, { 209,-258 }, { 210,-258 }, - { 211,-258 }, { 212,-258 }, { 213,-258 }, { 214,-258 }, { 215,-258 }, - { 216,-258 }, { 217,-258 }, { 218,-258 }, { 219,-258 }, { 220,-258 }, - { 221,-258 }, { 222,-258 }, { 223,-258 }, { 224,-258 }, { 225,-258 }, - { 226,-258 }, { 227,-258 }, { 228,-258 }, { 229,-258 }, { 230,-258 }, - { 231,-258 }, { 232,-258 }, { 233,-258 }, { 234,-258 }, { 235,-258 }, - { 236,-258 }, { 237,-258 }, { 238,-258 }, { 239,-258 }, { 240,-258 }, - { 241,-258 }, { 242,-258 }, { 243,-258 }, { 244,-258 }, { 245,-258 }, - - { 246,-258 }, { 247,-258 }, { 248,-258 }, { 249,-258 }, { 250,-258 }, - { 251,-258 }, { 252,-258 }, { 253,-258 }, { 254,-258 }, { 255,-258 }, - { 256,-258 }, { 0, 0 }, { 0,1869 }, { 0, 14 }, { 0,1867 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 9, 0 }, { 10, 0 }, { 9, -2 }, { 10, -2 }, - { 13, 0 }, { 0, 0 }, { 13, -2 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 32, 0 }, - { 0, 0 }, { 32, -2 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 60,-2638 }, { 0, 0 }, { 60,-2640 }, - { 0, 0 }, { 0,1805 }, { 1, 515 }, { 2, 515 }, { 3, 515 }, - { 4, 515 }, { 5, 515 }, { 6, 515 }, { 7, 515 }, { 8, 515 }, - { 9, 515 }, { 10, 515 }, { 11, 515 }, { 12, 515 }, { 13, 515 }, - { 14, 515 }, { 15, 515 }, { 16, 515 }, { 17, 515 }, { 18, 515 }, - { 19, 515 }, { 20, 515 }, { 21, 515 }, { 22, 515 }, { 23, 515 }, - - { 24, 515 }, { 25, 515 }, { 26, 515 }, { 27, 515 }, { 28, 515 }, - { 29, 515 }, { 30, 515 }, { 31, 515 }, { 32, 515 }, { 33, 515 }, - { 34, 515 }, { 35, 515 }, { 36, 515 }, { 37, 515 }, { 38, 515 }, - { 39, 515 }, { 40, 515 }, { 41, 515 }, { 42, 515 }, { 43, 515 }, - { 44, 515 }, { 45, 515 }, { 46, 515 }, { 47, 515 }, { 48, 515 }, - { 49, 515 }, { 50, 515 }, { 51, 515 }, { 52, 515 }, { 53, 515 }, - { 54, 515 }, { 55, 515 }, { 56, 515 }, { 57, 515 }, { 58, 515 }, - { 59, 515 }, { 60, 515 }, { 61, 515 }, { 62,-3795 }, { 63, 515 }, - { 64, 515 }, { 65, 515 }, { 66, 515 }, { 67, 515 }, { 68, 515 }, - { 69, 515 }, { 70, 515 }, { 71, 515 }, { 72, 515 }, { 73, 515 }, - - { 74, 515 }, { 75, 515 }, { 76, 515 }, { 77, 515 }, { 78, 515 }, - { 79, 515 }, { 80, 515 }, { 81, 515 }, { 82, 515 }, { 83, 515 }, - { 84, 515 }, { 85, 515 }, { 86, 515 }, { 87, 515 }, { 88, 515 }, - { 89, 515 }, { 90, 515 }, { 91, 515 }, { 92, 515 }, { 93, 515 }, - { 94, 515 }, { 95, 515 }, { 96, 515 }, { 97, 515 }, { 98, 515 }, - { 99, 515 }, { 100, 515 }, { 101, 515 }, { 102, 515 }, { 103, 515 }, - { 104, 515 }, { 105, 515 }, { 106, 515 }, { 107, 515 }, { 108, 515 }, - { 109, 515 }, { 110, 515 }, { 111, 515 }, { 112, 515 }, { 113, 515 }, - { 114, 515 }, { 115, 515 }, { 116, 515 }, { 117, 515 }, { 118, 515 }, - { 119, 515 }, { 120, 515 }, { 121, 515 }, { 122, 515 }, { 123, 515 }, - - { 124, 515 }, { 125, 515 }, { 126, 515 }, { 127, 515 }, { 128, 515 }, - { 129, 515 }, { 130, 515 }, { 131, 515 }, { 132, 515 }, { 133, 515 }, - { 134, 515 }, { 135, 515 }, { 136, 515 }, { 137, 515 }, { 138, 515 }, - { 139, 515 }, { 140, 515 }, { 141, 515 }, { 142, 515 }, { 143, 515 }, - { 144, 515 }, { 145, 515 }, { 146, 515 }, { 147, 515 }, { 148, 515 }, - { 149, 515 }, { 150, 515 }, { 151, 515 }, { 152, 515 }, { 153, 515 }, - { 154, 515 }, { 155, 515 }, { 156, 515 }, { 157, 515 }, { 158, 515 }, - { 159, 515 }, { 160, 515 }, { 161, 515 }, { 162, 515 }, { 163, 515 }, - { 164, 515 }, { 165, 515 }, { 166, 515 }, { 167, 515 }, { 168, 515 }, - { 169, 515 }, { 170, 515 }, { 171, 515 }, { 172, 515 }, { 173, 515 }, - - { 174, 515 }, { 175, 515 }, { 176, 515 }, { 177, 515 }, { 178, 515 }, - { 179, 515 }, { 180, 515 }, { 181, 515 }, { 182, 515 }, { 183, 515 }, - { 184, 515 }, { 185, 515 }, { 186, 515 }, { 187, 515 }, { 188, 515 }, - { 189, 515 }, { 190, 515 }, { 191, 515 }, { 192, 515 }, { 193, 515 }, - { 194, 515 }, { 195, 515 }, { 196, 515 }, { 197, 515 }, { 198, 515 }, - { 199, 515 }, { 200, 515 }, { 201, 515 }, { 202, 515 }, { 203, 515 }, - { 204, 515 }, { 205, 515 }, { 206, 515 }, { 207, 515 }, { 208, 515 }, - { 209, 515 }, { 210, 515 }, { 211, 515 }, { 212, 515 }, { 213, 515 }, - { 214, 515 }, { 215, 515 }, { 216, 515 }, { 217, 515 }, { 218, 515 }, - { 219, 515 }, { 220, 515 }, { 221, 515 }, { 222, 515 }, { 223, 515 }, - - { 224, 515 }, { 225, 515 }, { 226, 515 }, { 227, 515 }, { 228, 515 }, - { 229, 515 }, { 230, 515 }, { 231, 515 }, { 232, 515 }, { 233, 515 }, - { 234, 515 }, { 235, 515 }, { 236, 515 }, { 237, 515 }, { 238, 515 }, - { 239, 515 }, { 240, 515 }, { 241, 515 }, { 242, 515 }, { 243, 515 }, - { 244, 515 }, { 245, 515 }, { 246, 515 }, { 247, 515 }, { 248, 515 }, - { 249, 515 }, { 250, 515 }, { 251, 515 }, { 252, 515 }, { 253, 515 }, - { 254, 515 }, { 255, 515 }, { 256, 515 }, { 0, 8 }, { 0,1547 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 45, 0 }, - { 46, 0 }, { 0, 0 }, { 48, 0 }, { 49, 0 }, { 50, 0 }, - { 51, 0 }, { 52, 0 }, { 53, 0 }, { 54, 0 }, { 55, 0 }, - { 56, 0 }, { 57, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 65, 0 }, - - { 66, 0 }, { 67, 0 }, { 68, 0 }, { 69, 0 }, { 70, 0 }, - { 71, 0 }, { 72, 0 }, { 73, 0 }, { 74, 0 }, { 75, 0 }, - { 76, 0 }, { 77, 0 }, { 78, 0 }, { 79, 0 }, { 80, 0 }, - { 81, 0 }, { 82, 0 }, { 83, 0 }, { 84, 0 }, { 85, 0 }, - { 86, 0 }, { 87, 0 }, { 88, 0 }, { 89, 0 }, { 90, 0 }, - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 95, 0 }, - { 0, 0 }, { 97, 0 }, { 98, 0 }, { 99, 0 }, { 100, 0 }, - { 101, 0 }, { 102, 0 }, { 103, 0 }, { 104, 0 }, { 105, 0 }, - { 106, 0 }, { 107, 0 }, { 108, 0 }, { 109, 0 }, { 110, 0 }, - { 111, 0 }, { 112, 0 }, { 113, 0 }, { 114, 0 }, { 115, 0 }, - - { 116, 0 }, { 117, 0 }, { 118, 0 }, { 119, 0 }, { 120, 0 }, - { 121, 0 }, { 122, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, { 128, 0 }, { 129, 0 }, { 130, 0 }, - { 131, 0 }, { 132, 0 }, { 133, 0 }, { 134, 0 }, { 135, 0 }, - { 136, 0 }, { 137, 0 }, { 138, 0 }, { 139, 0 }, { 140, 0 }, - { 141, 0 }, { 142, 0 }, { 143, 0 }, { 144, 0 }, { 145, 0 }, - { 146, 0 }, { 147, 0 }, { 148, 0 }, { 149, 0 }, { 150, 0 }, - { 151, 0 }, { 152, 0 }, { 153, 0 }, { 154, 0 }, { 155, 0 }, - { 156, 0 }, { 157, 0 }, { 158, 0 }, { 159, 0 }, { 160, 0 }, - { 161, 0 }, { 162, 0 }, { 163, 0 }, { 164, 0 }, { 165, 0 }, - - { 166, 0 }, { 167, 0 }, { 168, 0 }, { 169, 0 }, { 170, 0 }, - { 171, 0 }, { 172, 0 }, { 173, 0 }, { 174, 0 }, { 175, 0 }, - { 176, 0 }, { 177, 0 }, { 178, 0 }, { 179, 0 }, { 180, 0 }, - { 181, 0 }, { 182, 0 }, { 183, 0 }, { 184, 0 }, { 185, 0 }, - { 186, 0 }, { 187, 0 }, { 188, 0 }, { 189, 0 }, { 190, 0 }, - { 191, 0 }, { 192, 0 }, { 193, 0 }, { 194, 0 }, { 195, 0 }, - { 196, 0 }, { 197, 0 }, { 198, 0 }, { 199, 0 }, { 200, 0 }, - { 201, 0 }, { 202, 0 }, { 203, 0 }, { 204, 0 }, { 205, 0 }, - { 206, 0 }, { 207, 0 }, { 208, 0 }, { 209, 0 }, { 210, 0 }, - { 211, 0 }, { 212, 0 }, { 213, 0 }, { 214, 0 }, { 215, 0 }, - - { 216, 0 }, { 217, 0 }, { 218, 0 }, { 219, 0 }, { 220, 0 }, - { 221, 0 }, { 222, 0 }, { 223, 0 }, { 224, 0 }, { 225, 0 }, - { 226, 0 }, { 227, 0 }, { 228, 0 }, { 229, 0 }, { 230, 0 }, - { 231, 0 }, { 232, 0 }, { 233, 0 }, { 234, 0 }, { 235, 0 }, - { 236, 0 }, { 237, 0 }, { 238, 0 }, { 239, 0 }, { 240, 0 }, - { 241, 0 }, { 242, 0 }, { 243, 0 }, { 244, 0 }, { 245, 0 }, - { 246, 0 }, { 247, 0 }, { 248, 0 }, { 249, 0 }, { 250, 0 }, - { 251, 0 }, { 252, 0 }, { 253, 0 }, { 254, 0 }, { 255, 0 }, - { 0, 0 }, { 0,1290 }, { 1, 0 }, { 2, 0 }, { 3, 0 }, - { 4, 0 }, { 5, 0 }, { 6, 0 }, { 7, 0 }, { 8, 0 }, - - { 9, 0 }, { 10, 0 }, { 11, 0 }, { 12, 0 }, { 13, 0 }, - { 14, 0 }, { 15, 0 }, { 16, 0 }, { 17, 0 }, { 18, 0 }, - { 19, 0 }, { 20, 0 }, { 21, 0 }, { 22, 0 }, { 23, 0 }, - { 24, 0 }, { 25, 0 }, { 26, 0 }, { 27, 0 }, { 28, 0 }, - { 29, 0 }, { 30, 0 }, { 31, 0 }, { 32, 0 }, { 33, 0 }, - { 34, 0 }, { 35, 0 }, { 36, 0 }, { 37, 0 }, { 38, 0 }, - { 39, 0 }, { 40, 0 }, { 41, 0 }, { 42, 0 }, { 43, 0 }, - { 44, 0 }, { 45, 0 }, { 46, 0 }, { 47, 0 }, { 48, 0 }, - { 49, 0 }, { 50, 0 }, { 51, 0 }, { 52, 0 }, { 53, 0 }, - { 54, 0 }, { 55, 0 }, { 56, 0 }, { 57, 0 }, { 58, 0 }, - - { 59, 0 }, { 60, 0 }, { 61, 0 }, { 62,-4310 }, { 63, 0 }, - { 64, 0 }, { 65, 0 }, { 66, 0 }, { 67, 0 }, { 68, 0 }, - { 69, 0 }, { 70, 0 }, { 71, 0 }, { 72, 0 }, { 73, 0 }, - { 74, 0 }, { 75, 0 }, { 76, 0 }, { 77, 0 }, { 78, 0 }, - { 79, 0 }, { 80, 0 }, { 81, 0 }, { 82, 0 }, { 83, 0 }, - { 84, 0 }, { 85, 0 }, { 86, 0 }, { 87, 0 }, { 88, 0 }, - { 89, 0 }, { 90, 0 }, { 91, 0 }, { 92, 0 }, { 93, 0 }, - { 94, 0 }, { 95, 0 }, { 96, 0 }, { 97, 0 }, { 98, 0 }, - { 99, 0 }, { 100, 0 }, { 101, 0 }, { 102, 0 }, { 103, 0 }, - { 104, 0 }, { 105, 0 }, { 106, 0 }, { 107, 0 }, { 108, 0 }, - - { 109, 0 }, { 110, 0 }, { 111, 0 }, { 112, 0 }, { 113, 0 }, - { 114, 0 }, { 115, 0 }, { 116, 0 }, { 117, 0 }, { 118, 0 }, - { 119, 0 }, { 120, 0 }, { 121, 0 }, { 122, 0 }, { 123, 0 }, - { 124, 0 }, { 125, 0 }, { 126, 0 }, { 127, 0 }, { 128, 0 }, - { 129, 0 }, { 130, 0 }, { 131, 0 }, { 132, 0 }, { 133, 0 }, - { 134, 0 }, { 135, 0 }, { 136, 0 }, { 137, 0 }, { 138, 0 }, - { 139, 0 }, { 140, 0 }, { 141, 0 }, { 142, 0 }, { 143, 0 }, - { 144, 0 }, { 145, 0 }, { 146, 0 }, { 147, 0 }, { 148, 0 }, - { 149, 0 }, { 150, 0 }, { 151, 0 }, { 152, 0 }, { 153, 0 }, - { 154, 0 }, { 155, 0 }, { 156, 0 }, { 157, 0 }, { 158, 0 }, - - { 159, 0 }, { 160, 0 }, { 161, 0 }, { 162, 0 }, { 163, 0 }, - { 164, 0 }, { 165, 0 }, { 166, 0 }, { 167, 0 }, { 168, 0 }, - { 169, 0 }, { 170, 0 }, { 171, 0 }, { 172, 0 }, { 173, 0 }, - { 174, 0 }, { 175, 0 }, { 176, 0 }, { 177, 0 }, { 178, 0 }, - { 179, 0 }, { 180, 0 }, { 181, 0 }, { 182, 0 }, { 183, 0 }, - { 184, 0 }, { 185, 0 }, { 186, 0 }, { 187, 0 }, { 188, 0 }, - { 189, 0 }, { 190, 0 }, { 191, 0 }, { 192, 0 }, { 193, 0 }, - { 194, 0 }, { 195, 0 }, { 196, 0 }, { 197, 0 }, { 198, 0 }, - { 199, 0 }, { 200, 0 }, { 201, 0 }, { 202, 0 }, { 203, 0 }, - { 204, 0 }, { 205, 0 }, { 206, 0 }, { 207, 0 }, { 208, 0 }, - - { 209, 0 }, { 210, 0 }, { 211, 0 }, { 212, 0 }, { 213, 0 }, - { 214, 0 }, { 215, 0 }, { 216, 0 }, { 217, 0 }, { 218, 0 }, - { 219, 0 }, { 220, 0 }, { 221, 0 }, { 222, 0 }, { 223, 0 }, - { 224, 0 }, { 225, 0 }, { 226, 0 }, { 227, 0 }, { 228, 0 }, - { 229, 0 }, { 230, 0 }, { 231, 0 }, { 232, 0 }, { 233, 0 }, - { 234, 0 }, { 235, 0 }, { 236, 0 }, { 237, 0 }, { 238, 0 }, - { 239, 0 }, { 240, 0 }, { 241, 0 }, { 242, 0 }, { 243, 0 }, - { 244, 0 }, { 245, 0 }, { 246, 0 }, { 247, 0 }, { 248, 0 }, - { 249, 0 }, { 250, 0 }, { 251, 0 }, { 252, 0 }, { 253, 0 }, - { 254, 0 }, { 255, 0 }, { 256, 0 }, { 0, 0 }, { 0,1032 }, - - { 1, 258 }, { 2, 258 }, { 3, 258 }, { 4, 258 }, { 5, 258 }, - { 6, 258 }, { 7, 258 }, { 8, 258 }, { 9, 258 }, { 10, 258 }, - { 11, 258 }, { 12, 258 }, { 13, 258 }, { 14, 258 }, { 15, 258 }, - { 16, 258 }, { 17, 258 }, { 18, 258 }, { 19, 258 }, { 20, 258 }, - { 21, 258 }, { 22, 258 }, { 23, 258 }, { 24, 258 }, { 25, 258 }, - { 26, 258 }, { 27, 258 }, { 28, 258 }, { 29, 258 }, { 30, 258 }, - { 31, 258 }, { 32, 258 }, { 33, 258 }, { 34, 258 }, { 35, 258 }, - { 36, 258 }, { 37, 258 }, { 38, 258 }, { 39, 258 }, { 40, 258 }, - { 41, 258 }, { 42, 258 }, { 43, 258 }, { 44, 258 }, { 45, 516 }, - { 46, 258 }, { 47, 258 }, { 48, 258 }, { 49, 258 }, { 50, 258 }, - - { 51, 258 }, { 52, 258 }, { 53, 258 }, { 54, 258 }, { 55, 258 }, - { 56, 258 }, { 57, 258 }, { 58, 258 }, { 59, 258 }, { 60, 258 }, - { 61, 258 }, { 62, 258 }, { 63, 258 }, { 64, 258 }, { 65, 258 }, - { 66, 258 }, { 67, 258 }, { 68, 258 }, { 69, 258 }, { 70, 258 }, - { 71, 258 }, { 72, 258 }, { 73, 258 }, { 74, 258 }, { 75, 258 }, - { 76, 258 }, { 77, 258 }, { 78, 258 }, { 79, 258 }, { 80, 258 }, - { 81, 258 }, { 82, 258 }, { 83, 258 }, { 84, 258 }, { 85, 258 }, - { 86, 258 }, { 87, 258 }, { 88, 258 }, { 89, 258 }, { 90, 258 }, - { 91, 258 }, { 92, 258 }, { 93, 258 }, { 94, 258 }, { 95, 258 }, - { 96, 258 }, { 97, 258 }, { 98, 258 }, { 99, 258 }, { 100, 258 }, - - { 101, 258 }, { 102, 258 }, { 103, 258 }, { 104, 258 }, { 105, 258 }, - { 106, 258 }, { 107, 258 }, { 108, 258 }, { 109, 258 }, { 110, 258 }, - { 111, 258 }, { 112, 258 }, { 113, 258 }, { 114, 258 }, { 115, 258 }, - { 116, 258 }, { 117, 258 }, { 118, 258 }, { 119, 258 }, { 120, 258 }, - { 121, 258 }, { 122, 258 }, { 123, 258 }, { 124, 258 }, { 125, 258 }, - { 126, 258 }, { 127, 258 }, { 128, 258 }, { 129, 258 }, { 130, 258 }, - { 131, 258 }, { 132, 258 }, { 133, 258 }, { 134, 258 }, { 135, 258 }, - { 136, 258 }, { 137, 258 }, { 138, 258 }, { 139, 258 }, { 140, 258 }, - { 141, 258 }, { 142, 258 }, { 143, 258 }, { 144, 258 }, { 145, 258 }, - { 146, 258 }, { 147, 258 }, { 148, 258 }, { 149, 258 }, { 150, 258 }, - - { 151, 258 }, { 152, 258 }, { 153, 258 }, { 154, 258 }, { 155, 258 }, - { 156, 258 }, { 157, 258 }, { 158, 258 }, { 159, 258 }, { 160, 258 }, - { 161, 258 }, { 162, 258 }, { 163, 258 }, { 164, 258 }, { 165, 258 }, - { 166, 258 }, { 167, 258 }, { 168, 258 }, { 169, 258 }, { 170, 258 }, - { 171, 258 }, { 172, 258 }, { 173, 258 }, { 174, 258 }, { 175, 258 }, - { 176, 258 }, { 177, 258 }, { 178, 258 }, { 179, 258 }, { 180, 258 }, - { 181, 258 }, { 182, 258 }, { 183, 258 }, { 184, 258 }, { 185, 258 }, - { 186, 258 }, { 187, 258 }, { 188, 258 }, { 189, 258 }, { 190, 258 }, - { 191, 258 }, { 192, 258 }, { 193, 258 }, { 194, 258 }, { 195, 258 }, - { 196, 258 }, { 197, 258 }, { 198, 258 }, { 199, 258 }, { 200, 258 }, - - { 201, 258 }, { 202, 258 }, { 203, 258 }, { 204, 258 }, { 205, 258 }, - { 206, 258 }, { 207, 258 }, { 208, 258 }, { 209, 258 }, { 210, 258 }, - { 211, 258 }, { 212, 258 }, { 213, 258 }, { 214, 258 }, { 215, 258 }, - { 216, 258 }, { 217, 258 }, { 218, 258 }, { 219, 258 }, { 220, 258 }, - { 221, 258 }, { 222, 258 }, { 223, 258 }, { 224, 258 }, { 225, 258 }, - { 226, 258 }, { 227, 258 }, { 228, 258 }, { 229, 258 }, { 230, 258 }, - { 231, 258 }, { 232, 258 }, { 233, 258 }, { 234, 258 }, { 235, 258 }, - { 236, 258 }, { 237, 258 }, { 238, 258 }, { 239, 258 }, { 240, 258 }, - { 241, 258 }, { 242, 258 }, { 243, 258 }, { 244, 258 }, { 245, 258 }, - { 246, 258 }, { 247, 258 }, { 248, 258 }, { 249, 258 }, { 250, 258 }, - - { 251, 258 }, { 252, 258 }, { 253, 258 }, { 254, 258 }, { 255, 258 }, - { 256, 258 }, { 0, 0 }, { 0, 774 }, { 1, 0 }, { 2, 0 }, - { 3, 0 }, { 4, 0 }, { 5, 0 }, { 6, 0 }, { 7, 0 }, - { 8, 0 }, { 9, 0 }, { 10, 0 }, { 11, 0 }, { 12, 0 }, - { 13, 0 }, { 14, 0 }, { 15, 0 }, { 16, 0 }, { 17, 0 }, - { 18, 0 }, { 19, 0 }, { 20, 0 }, { 21, 0 }, { 22, 0 }, - { 23, 0 }, { 24, 0 }, { 25, 0 }, { 26, 0 }, { 27, 0 }, - { 28, 0 }, { 29, 0 }, { 30, 0 }, { 31, 0 }, { 32, 0 }, - { 33, 0 }, { 34, 0 }, { 35, 0 }, { 36, 0 }, { 37, 0 }, - { 38, 0 }, { 39, 0 }, { 40, 0 }, { 41, 0 }, { 42, 0 }, - - { 43, 0 }, { 44, 0 }, { 45, 516 }, { 46, 0 }, { 47, 0 }, - { 48, 0 }, { 49, 0 }, { 50, 0 }, { 51, 0 }, { 52, 0 }, - { 53, 0 }, { 54, 0 }, { 55, 0 }, { 56, 0 }, { 57, 0 }, - { 58, 0 }, { 59, 0 }, { 60, 0 }, { 61, 0 }, { 62, 0 }, - { 63, 0 }, { 64, 0 }, { 65, 0 }, { 66, 0 }, { 67, 0 }, - { 68, 0 }, { 69, 0 }, { 70, 0 }, { 71, 0 }, { 72, 0 }, - { 73, 0 }, { 74, 0 }, { 75, 0 }, { 76, 0 }, { 77, 0 }, - { 78, 0 }, { 79, 0 }, { 80, 0 }, { 81, 0 }, { 82, 0 }, - { 83, 0 }, { 84, 0 }, { 85, 0 }, { 86, 0 }, { 87, 0 }, - { 88, 0 }, { 89, 0 }, { 90, 0 }, { 91, 0 }, { 92, 0 }, - - { 93, 0 }, { 94, 0 }, { 95, 0 }, { 96, 0 }, { 97, 0 }, - { 98, 0 }, { 99, 0 }, { 100, 0 }, { 101, 0 }, { 102, 0 }, - { 103, 0 }, { 104, 0 }, { 105, 0 }, { 106, 0 }, { 107, 0 }, - { 108, 0 }, { 109, 0 }, { 110, 0 }, { 111, 0 }, { 112, 0 }, - { 113, 0 }, { 114, 0 }, { 115, 0 }, { 116, 0 }, { 117, 0 }, - { 118, 0 }, { 119, 0 }, { 120, 0 }, { 121, 0 }, { 122, 0 }, - { 123, 0 }, { 124, 0 }, { 125, 0 }, { 126, 0 }, { 127, 0 }, - { 128, 0 }, { 129, 0 }, { 130, 0 }, { 131, 0 }, { 132, 0 }, - { 133, 0 }, { 134, 0 }, { 135, 0 }, { 136, 0 }, { 137, 0 }, - { 138, 0 }, { 139, 0 }, { 140, 0 }, { 141, 0 }, { 142, 0 }, - - { 143, 0 }, { 144, 0 }, { 145, 0 }, { 146, 0 }, { 147, 0 }, - { 148, 0 }, { 149, 0 }, { 150, 0 }, { 151, 0 }, { 152, 0 }, - { 153, 0 }, { 154, 0 }, { 155, 0 }, { 156, 0 }, { 157, 0 }, - { 158, 0 }, { 159, 0 }, { 160, 0 }, { 161, 0 }, { 162, 0 }, - { 163, 0 }, { 164, 0 }, { 165, 0 }, { 166, 0 }, { 167, 0 }, - { 168, 0 }, { 169, 0 }, { 170, 0 }, { 171, 0 }, { 172, 0 }, - { 173, 0 }, { 174, 0 }, { 175, 0 }, { 176, 0 }, { 177, 0 }, - { 178, 0 }, { 179, 0 }, { 180, 0 }, { 181, 0 }, { 182, 0 }, - { 183, 0 }, { 184, 0 }, { 185, 0 }, { 186, 0 }, { 187, 0 }, - { 188, 0 }, { 189, 0 }, { 190, 0 }, { 191, 0 }, { 192, 0 }, - - { 193, 0 }, { 194, 0 }, { 195, 0 }, { 196, 0 }, { 197, 0 }, - { 198, 0 }, { 199, 0 }, { 200, 0 }, { 201, 0 }, { 202, 0 }, - { 203, 0 }, { 204, 0 }, { 205, 0 }, { 206, 0 }, { 207, 0 }, - { 208, 0 }, { 209, 0 }, { 210, 0 }, { 211, 0 }, { 212, 0 }, - { 213, 0 }, { 214, 0 }, { 215, 0 }, { 216, 0 }, { 217, 0 }, - { 218, 0 }, { 219, 0 }, { 220, 0 }, { 221, 0 }, { 222, 0 }, - { 223, 0 }, { 224, 0 }, { 225, 0 }, { 226, 0 }, { 227, 0 }, - { 228, 0 }, { 229, 0 }, { 230, 0 }, { 231, 0 }, { 232, 0 }, - { 233, 0 }, { 234, 0 }, { 235, 0 }, { 236, 0 }, { 237, 0 }, - { 238, 0 }, { 239, 0 }, { 240, 0 }, { 241, 0 }, { 242, 0 }, - - { 243, 0 }, { 244, 0 }, { 245, 0 }, { 246, 0 }, { 247, 0 }, - { 248, 0 }, { 249, 0 }, { 250, 0 }, { 251, 0 }, { 252, 0 }, - { 253, 0 }, { 254, 0 }, { 255, 0 }, { 256, 0 }, { 0, 0 }, - { 0, 516 }, { 1,-258 }, { 2,-258 }, { 3,-258 }, { 4,-258 }, - { 5,-258 }, { 6,-258 }, { 7,-258 }, { 8,-258 }, { 9,-258 }, - { 10,-258 }, { 11,-258 }, { 12,-258 }, { 13,-258 }, { 14,-258 }, - { 15,-258 }, { 16,-258 }, { 17,-258 }, { 18,-258 }, { 19,-258 }, - { 20,-258 }, { 21,-258 }, { 22,-258 }, { 23,-258 }, { 24,-258 }, - { 25,-258 }, { 26,-258 }, { 27,-258 }, { 28,-258 }, { 29,-258 }, - { 30,-258 }, { 31,-258 }, { 32,-258 }, { 33,-258 }, { 34,-258 }, - - { 35,-258 }, { 36,-258 }, { 37,-258 }, { 38,-258 }, { 39,-258 }, - { 40,-258 }, { 41,-258 }, { 42,-258 }, { 43,-258 }, { 44,-258 }, - { 0, 0 }, { 46,-258 }, { 47,-258 }, { 48,-258 }, { 49,-258 }, - { 50,-258 }, { 51,-258 }, { 52,-258 }, { 53,-258 }, { 54,-258 }, - { 55,-258 }, { 56,-258 }, { 57,-258 }, { 58,-258 }, { 59,-258 }, - { 60,-258 }, { 61,-258 }, { 62,-258 }, { 63,-258 }, { 64,-258 }, - { 65,-258 }, { 66,-258 }, { 67,-258 }, { 68,-258 }, { 69,-258 }, - { 70,-258 }, { 71,-258 }, { 72,-258 }, { 73,-258 }, { 74,-258 }, - { 75,-258 }, { 76,-258 }, { 77,-258 }, { 78,-258 }, { 79,-258 }, - { 80,-258 }, { 81,-258 }, { 82,-258 }, { 83,-258 }, { 84,-258 }, - - { 85,-258 }, { 86,-258 }, { 87,-258 }, { 88,-258 }, { 89,-258 }, - { 90,-258 }, { 91,-258 }, { 92,-258 }, { 93,-258 }, { 94,-258 }, - { 95,-258 }, { 96,-258 }, { 97,-258 }, { 98,-258 }, { 99,-258 }, - { 100,-258 }, { 101,-258 }, { 102,-258 }, { 103,-258 }, { 104,-258 }, - { 105,-258 }, { 106,-258 }, { 107,-258 }, { 108,-258 }, { 109,-258 }, - { 110,-258 }, { 111,-258 }, { 112,-258 }, { 113,-258 }, { 114,-258 }, - { 115,-258 }, { 116,-258 }, { 117,-258 }, { 118,-258 }, { 119,-258 }, - { 120,-258 }, { 121,-258 }, { 122,-258 }, { 123,-258 }, { 124,-258 }, - { 125,-258 }, { 126,-258 }, { 127,-258 }, { 128,-258 }, { 129,-258 }, - { 130,-258 }, { 131,-258 }, { 132,-258 }, { 133,-258 }, { 134,-258 }, - - { 135,-258 }, { 136,-258 }, { 137,-258 }, { 138,-258 }, { 139,-258 }, - { 140,-258 }, { 141,-258 }, { 142,-258 }, { 143,-258 }, { 144,-258 }, - { 145,-258 }, { 146,-258 }, { 147,-258 }, { 148,-258 }, { 149,-258 }, - { 150,-258 }, { 151,-258 }, { 152,-258 }, { 153,-258 }, { 154,-258 }, - { 155,-258 }, { 156,-258 }, { 157,-258 }, { 158,-258 }, { 159,-258 }, - { 160,-258 }, { 161,-258 }, { 162,-258 }, { 163,-258 }, { 164,-258 }, - { 165,-258 }, { 166,-258 }, { 167,-258 }, { 168,-258 }, { 169,-258 }, - { 170,-258 }, { 171,-258 }, { 172,-258 }, { 173,-258 }, { 174,-258 }, - { 175,-258 }, { 176,-258 }, { 177,-258 }, { 178,-258 }, { 179,-258 }, - { 180,-258 }, { 181,-258 }, { 182,-258 }, { 183,-258 }, { 184,-258 }, - - { 185,-258 }, { 186,-258 }, { 187,-258 }, { 188,-258 }, { 189,-258 }, - { 190,-258 }, { 191,-258 }, { 192,-258 }, { 193,-258 }, { 194,-258 }, - { 195,-258 }, { 196,-258 }, { 197,-258 }, { 198,-258 }, { 199,-258 }, - { 200,-258 }, { 201,-258 }, { 202,-258 }, { 203,-258 }, { 204,-258 }, - { 205,-258 }, { 206,-258 }, { 207,-258 }, { 208,-258 }, { 209,-258 }, - { 210,-258 }, { 211,-258 }, { 212,-258 }, { 213,-258 }, { 214,-258 }, - { 215,-258 }, { 216,-258 }, { 217,-258 }, { 218,-258 }, { 219,-258 }, - { 220,-258 }, { 221,-258 }, { 222,-258 }, { 223,-258 }, { 224,-258 }, - { 225,-258 }, { 226,-258 }, { 227,-258 }, { 228,-258 }, { 229,-258 }, - { 230,-258 }, { 231,-258 }, { 232,-258 }, { 233,-258 }, { 234,-258 }, - - { 235,-258 }, { 236,-258 }, { 237,-258 }, { 238,-258 }, { 239,-258 }, - { 240,-258 }, { 241,-258 }, { 242,-258 }, { 243,-258 }, { 244,-258 }, - { 245,-258 }, { 246,-258 }, { 247,-258 }, { 248,-258 }, { 249,-258 }, - { 250,-258 }, { 251,-258 }, { 252,-258 }, { 253,-258 }, { 254,-258 }, - { 255,-258 }, { 256,-258 }, { 0, 0 }, { 0, 258 }, { 1,-516 }, - { 2,-516 }, { 3,-516 }, { 4,-516 }, { 5,-516 }, { 6,-516 }, - { 7,-516 }, { 8,-516 }, { 9,-516 }, { 10,-516 }, { 11,-516 }, - { 12,-516 }, { 13,-516 }, { 14,-516 }, { 15,-516 }, { 16,-516 }, - { 17,-516 }, { 18,-516 }, { 19,-516 }, { 20,-516 }, { 21,-516 }, - { 22,-516 }, { 23,-516 }, { 24,-516 }, { 25,-516 }, { 26,-516 }, - - { 27,-516 }, { 28,-516 }, { 29,-516 }, { 30,-516 }, { 31,-516 }, - { 32,-516 }, { 33,-516 }, { 34,-516 }, { 35,-516 }, { 36,-516 }, - { 37,-516 }, { 38,-516 }, { 39,-516 }, { 40,-516 }, { 41,-516 }, - { 42,-516 }, { 43,-516 }, { 44,-516 }, { 45,-5315 }, { 46,-516 }, - { 47,-516 }, { 48,-516 }, { 49,-516 }, { 50,-516 }, { 51,-516 }, - { 52,-516 }, { 53,-516 }, { 54,-516 }, { 55,-516 }, { 56,-516 }, - { 57,-516 }, { 58,-516 }, { 59,-516 }, { 60,-516 }, { 61,-516 }, - { 62,-516 }, { 63,-516 }, { 64,-516 }, { 65,-516 }, { 66,-516 }, - { 67,-516 }, { 68,-516 }, { 69,-516 }, { 70,-516 }, { 71,-516 }, - { 72,-516 }, { 73,-516 }, { 74,-516 }, { 75,-516 }, { 76,-516 }, - - { 77,-516 }, { 78,-516 }, { 79,-516 }, { 80,-516 }, { 81,-516 }, - { 82,-516 }, { 83,-516 }, { 84,-516 }, { 85,-516 }, { 86,-516 }, - { 87,-516 }, { 88,-516 }, { 89,-516 }, { 90,-516 }, { 91,-516 }, - { 92,-516 }, { 93,-516 }, { 94,-516 }, { 95,-516 }, { 96,-516 }, - { 97,-516 }, { 98,-516 }, { 99,-516 }, { 100,-516 }, { 101,-516 }, - { 102,-516 }, { 103,-516 }, { 104,-516 }, { 105,-516 }, { 106,-516 }, - { 107,-516 }, { 108,-516 }, { 109,-516 }, { 110,-516 }, { 111,-516 }, - { 112,-516 }, { 113,-516 }, { 114,-516 }, { 115,-516 }, { 116,-516 }, - { 117,-516 }, { 118,-516 }, { 119,-516 }, { 120,-516 }, { 121,-516 }, - { 122,-516 }, { 123,-516 }, { 124,-516 }, { 125,-516 }, { 126,-516 }, - - { 127,-516 }, { 128,-516 }, { 129,-516 }, { 130,-516 }, { 131,-516 }, - { 132,-516 }, { 133,-516 }, { 134,-516 }, { 135,-516 }, { 136,-516 }, - { 137,-516 }, { 138,-516 }, { 139,-516 }, { 140,-516 }, { 141,-516 }, - { 142,-516 }, { 143,-516 }, { 144,-516 }, { 145,-516 }, { 146,-516 }, - { 147,-516 }, { 148,-516 }, { 149,-516 }, { 150,-516 }, { 151,-516 }, - { 152,-516 }, { 153,-516 }, { 154,-516 }, { 155,-516 }, { 156,-516 }, - { 157,-516 }, { 158,-516 }, { 159,-516 }, { 160,-516 }, { 161,-516 }, - { 162,-516 }, { 163,-516 }, { 164,-516 }, { 165,-516 }, { 166,-516 }, - { 167,-516 }, { 168,-516 }, { 169,-516 }, { 170,-516 }, { 171,-516 }, - { 172,-516 }, { 173,-516 }, { 174,-516 }, { 175,-516 }, { 176,-516 }, - - { 177,-516 }, { 178,-516 }, { 179,-516 }, { 180,-516 }, { 181,-516 }, - { 182,-516 }, { 183,-516 }, { 184,-516 }, { 185,-516 }, { 186,-516 }, - { 187,-516 }, { 188,-516 }, { 189,-516 }, { 190,-516 }, { 191,-516 }, - { 192,-516 }, { 193,-516 }, { 194,-516 }, { 195,-516 }, { 196,-516 }, - { 197,-516 }, { 198,-516 }, { 199,-516 }, { 200,-516 }, { 201,-516 }, - { 202,-516 }, { 203,-516 }, { 204,-516 }, { 205,-516 }, { 206,-516 }, - { 207,-516 }, { 208,-516 }, { 209,-516 }, { 210,-516 }, { 211,-516 }, - { 212,-516 }, { 213,-516 }, { 214,-516 }, { 215,-516 }, { 216,-516 }, - { 217,-516 }, { 218,-516 }, { 219,-516 }, { 220,-516 }, { 221,-516 }, - { 222,-516 }, { 223,-516 }, { 224,-516 }, { 225,-516 }, { 226,-516 }, - - { 227,-516 }, { 228,-516 }, { 229,-516 }, { 230,-516 }, { 231,-516 }, - { 232,-516 }, { 233,-516 }, { 234,-516 }, { 235,-516 }, { 236,-516 }, - { 237,-516 }, { 238,-516 }, { 239,-516 }, { 240,-516 }, { 241,-516 }, - { 242,-516 }, { 243,-516 }, { 244,-516 }, { 245,-516 }, { 246,-516 }, - { 247,-516 }, { 248,-516 }, { 249,-516 }, { 250,-516 }, { 251,-516 }, - { 252,-516 }, { 253,-516 }, { 254,-516 }, { 255,-516 }, { 256,-516 }, - { 257, 16 }, { 1, 0 }, }; - -static yyconst struct yy_trans_info *yy_start_state_list[5] = - { - &yy_transition[1], - &yy_transition[3], - &yy_transition[261], - &yy_transition[519], - &yy_transition[777], - - - } ; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -#ifndef YY_REENTRANT -char *yytext; -#endif -#line 1 "../../../src/sd/domnode-xml-scanner.l" -#define INITIAL 0 -#define YY_NEVER_INTERACTIVE 1 -#define YY_NO_UNPUT 1 -#line 15 "../../../src/sd/domnode-xml-scanner.l" -#include -#include -#include -#include -#include -#include "error.h" -#include "malloc.h" -#include "domnode-xml.h" - -/* Generated by bison(1) */ -#include "domnode-xml-parser.h" - -#ifdef strdup -# undef strdup -#endif -#define strdup sd_strdup -#ifdef malloc -# undef malloc -#endif -#define malloc sd_malloc -#ifdef calloc -# undef calloc -#endif -#define calloc sd_calloc -#ifdef realloc -# undef realloc -#endif -#define realloc sd_realloc -#ifdef yyerror -# undef yyerror -#endif -#define yyerror sd_error - -/******************************************************************************/ -/* Extract a single word */ -static char* word(const char *s) -{ - char *buf; - int i, k; - - for (k = 0; isspace(s[k]) || s[k] == '<'; k++); - for (i = k; s[i] && ! isspace(s[i]); i++); - - buf = malloc((i - k + 1) * sizeof(char)); - strncpy(buf, &s[k], i - k); - buf[i - k] = 0; - - return buf; -} - -/******************************************************************************/ -/* Extract text between " " */ -static char* string(const char* s) -{ - char* buf; - int i; - - buf = strdup(s + 1); - for (i = 0; buf[i] != '"'; i++); - buf[i] = 0; - - return buf; -} - -/******************************************************************************/ -/* Extract text between */ -static char* comment(const char* s) -{ - char* buf; - int i, k; - - for (k = 4; isspace(s[k]); k++); - for (i = k; strncmp(&s[i], "-->", 3); i++); - - buf = malloc((i - k + 1) * sizeof(char)); - strncpy(buf, &s[k], i - k); - buf[i - k] = 0; - - return buf; -} - -#define CONTENT 1 - -#line 2268 "domnode-xml-scanner.c" -#endif /* !__sd_domnode_xml_IN_HEADER YY-END-DISCARD-FROM-HEADER */ - -/* Special case for "unistd.h", since it is non-ANSI. We include it way - * down here because we want the user's section 1 to have been scanned first. - * The user has a chance to override it with an option. - */ -#ifndef YY_NO_UNISTD_H -#include -#endif /* !YY_NO_UNISTD_H */ - -#ifndef YY_EXTRA_TYPE -#define YY_EXTRA_TYPE void * -#endif - - -#ifndef __sd_domnode_xml_IN_HEADER /* YY-DISCARD-FROM-HEADER */ -/* Holds the entire state of the reentrant scanner. */ -struct yyguts_t - { - - /* User-defined. Not touched by flex. */ - YY_EXTRA_TYPE yyextra_r; - - /* The rest are the same as the globals declared in the non-reentrant scanner. */ - FILE *yyin_r, *yyout_r; - YY_BUFFER_STATE yy_current_buffer; - char yy_hold_char; - int yy_n_chars; - int yyleng_r; - char *yy_c_buf_p; - int yy_init; - int yy_start; - int yy_did_buffer_switch_on_eof; - int yy_start_stack_ptr; - int yy_start_stack_depth; - int *yy_start_stack; - yy_state_type yy_last_accepting_state; - char* yy_last_accepting_cpos; - - int yylineno_r; - int yy_flex_debug_r; - -#ifdef YY_USES_REJECT - yy_state_type *yy_state_buf; - yy_state_type *yy_state_ptr; - char *yy_full_match; - int yy_lp; -#endif - -#ifdef YY_TEXT_IS_ARRAY - char yytext_r[YYLMAX]; - char *yytext_ptr; - int yy_more_offset; - int yy_prev_more_offset; -#else - char *yytext_r; - int yy_more_flag; - int yy_more_len; -#endif - - YYSTYPE * yylval_r; -#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - YYLTYPE * yylloc_r; -#endif - - }; -#endif /* !__sd_domnode_xml_IN_HEADER YY-END-DISCARD-FROM-HEADER */ - -#ifndef __sd_domnode_xml_IN_HEADER /* YY-DISCARD-FROM-HEADER */ -static int yy_init_globals YY_PARAMS(( YY_PROTO_ONLY_ARG )); -#endif /* !__sd_domnode_xml_IN_HEADER YY-END-DISCARD-FROM-HEADER */ - -#ifndef __sd_domnode_xml_IN_HEADER /* YY-DISCARD-FROM-HEADER */ -/* This must go here because YYSTYPE and YYLTYPE are included - * from bison output in section 1.*/ -# define yylval YY_G(yylval_r) -# if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) -# define yylloc YY_G(yylloc_r) -# endif - -#endif /* !__sd_domnode_xml_IN_HEADER YY-END-DISCARD-FROM-HEADER */ - - -/* Accessor methods to globals. - These are made visible to non-reentrant scanners for convenience. */ - -#ifndef YY_NO_DESTROY -int yylex_destroy YY_PARAMS(( YY_PROTO_ONLY_ARG )); -#endif - -#ifndef YY_NO_GET_DEBUG -int yyget_debug YY_PARAMS(( YY_PROTO_ONLY_ARG )); -#endif - -#ifndef YY_NO_SET_DEBUG -void yyset_debug YY_PARAMS(( int debug_flag YY_PROTO_LAST_ARG )); -#endif - -#ifndef YY_NO_GET_EXTRA -YY_EXTRA_TYPE yyget_extra YY_PARAMS(( YY_PROTO_ONLY_ARG )); -#endif - -#ifndef YY_NO_SET_EXTRA -void yyset_extra YY_PARAMS(( YY_EXTRA_TYPE user_defined YY_PROTO_LAST_ARG )); -#endif - -#ifndef YY_NO_GET_IN -FILE *yyget_in YY_PARAMS(( YY_PROTO_ONLY_ARG )); -#endif - -#ifndef YY_NO_SET_IN -void yyset_in YY_PARAMS(( FILE * in_str YY_PROTO_LAST_ARG )); -#endif - -#ifndef YY_NO_GET_OUT -FILE *yyget_out YY_PARAMS(( YY_PROTO_ONLY_ARG )); -#endif - -#ifndef YY_NO_SET_OUT -void yyset_out YY_PARAMS(( FILE * out_str YY_PROTO_LAST_ARG )); -#endif - -#ifndef YY_NO_GET_LENG -int yyget_leng YY_PARAMS(( YY_PROTO_ONLY_ARG )); -#endif - -#ifndef YY_NO_GET_TEXT -char *yyget_text YY_PARAMS(( YY_PROTO_ONLY_ARG )); -#endif - -#ifndef YY_NO_GET_LINENO -int yyget_lineno YY_PARAMS(( YY_PROTO_ONLY_ARG )); -#endif - -#ifndef YY_NO_SET_LINENO -void yyset_lineno YY_PARAMS(( int line_number YY_PROTO_LAST_ARG )); -#endif - -#ifndef YY_NO_GET_LVAL -YYSTYPE * yyget_lval YY_PARAMS(( YY_PROTO_ONLY_ARG )); -#endif -void yyset_lval YY_PARAMS(( YYSTYPE * yylvalp YY_PROTO_LAST_ARG )); -#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) -#ifndef YY_NO_GET_LLOC - YYLTYPE *yyget_lloc YY_PARAMS(( YY_PROTO_ONLY_ARG )); -#endif -#ifndef YY_NO_SET_LLOC - void yyset_lloc YY_PARAMS(( YYLTYPE * yyllocp YY_PROTO_LAST_ARG )); -#endif -#endif /* YYLTYPE */ - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap YY_PARAMS(( YY_PROTO_ONLY_ARG )); -#else -extern int yywrap YY_PARAMS(( YY_PROTO_ONLY_ARG )); -#endif -#endif - -#ifndef __sd_domnode_xml_IN_HEADER /* YY-DISCARD-FROM-HEADER */ -#ifndef YY_NO_UNPUT -static void yyunput YY_PARAMS(( int c, char *buf_ptr YY_PROTO_LAST_ARG)); -#endif -#endif /* !__sd_domnode_xml_IN_HEADER YY-END-DISCARD-FROM-HEADER */ - -#ifndef yytext_ptr -static void yy_flex_strncpy YY_PARAMS(( char *, yyconst char *, int YY_PROTO_LAST_ARG)); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen YY_PARAMS(( yyconst char * YY_PROTO_LAST_ARG)); -#endif - -#ifndef YY_NO_INPUT -#ifndef __sd_domnode_xml_IN_HEADER /* YY-DISCARD-FROM-HEADER */ -#ifdef __cplusplus -static int yyinput YY_PARAMS(( YY_PROTO_ONLY_ARG )); -#else -static int input YY_PARAMS(( YY_PROTO_ONLY_ARG )); -#endif -#endif /* !__sd_domnode_xml_IN_HEADER YY-END-DISCARD-FROM-HEADER */ -#endif - - -#if YY_STACK_USED -#ifndef __sd_domnode_xml_IN_HEADER /* YY-DISCARD-FROM-HEADER */ -#endif /* !__sd_domnode_xml_IN_HEADER YY-END-DISCARD-FROM-HEADER */ - -#ifndef YY_NO_PUSH_STATE -static void yy_push_state YY_PARAMS(( int new_state YY_PROTO_LAST_ARG)); -#endif -#ifndef YY_NO_POP_STATE -static void yy_pop_state YY_PARAMS(( YY_PROTO_ONLY_ARG )); -#endif -#ifndef YY_NO_TOP_STATE -static int yy_top_state YY_PARAMS(( YY_PROTO_ONLY_ARG )); -#endif - -#else -#define YY_NO_PUSH_STATE 1 -#define YY_NO_POP_STATE 1 -#define YY_NO_TOP_STATE 1 -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ - -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - errno=0; \ - while ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \ - { \ - if( errno != EINTR) \ - { \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - break; \ - } \ - errno=0; \ - clearerr(yyin); \ - } -\ -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg YY_CALL_LAST_ARG) -#endif - -#ifndef __sd_domnode_xml_IN_HEADER /* YY-DISCARD-FROM-HEADER */ -#endif /* !__sd_domnode_xml_IN_HEADER YY-END-DISCARD-FROM-HEADER */ -#ifndef __sd_domnode_xml_IN_HEADER /* YY-DISCARD-FROM-HEADER */ -/* end tables serialization structures and prototypes */ - -#endif /* !__sd_domnode_xml_IN_HEADER YY-END-DISCARD-FROM-HEADER */ - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL - -/* If the bison pure parser is used, then bison will provide - one or two additional arguments. */ - -# if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) -# define YY_LEX_PROTO YY_PARAMS((YYSTYPE * yylvalp, YYLTYPE * yyllocp YY_PROTO_LAST_ARG)) -# define YY_LEX_DECLARATION YYFARGS2(YYSTYPE *,yylvalp, YYLTYPE *,yyllocp) -# else -# define YY_LEX_PROTO YY_PARAMS((YYSTYPE * yylvalp YY_PROTO_LAST_ARG)) -# define YY_LEX_DECLARATION YYFARGS1(YYSTYPE *,yylvalp) -# endif - - - -extern int yylex YY_LEX_PROTO; - -#define YY_DECL int yylex YY_LEX_DECLARATION -#endif - - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP \ - YY_USER_ACTION - -#ifndef __sd_domnode_xml_IN_HEADER /* YY-DISCARD-FROM-HEADER */ -YY_DECL - { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - -#line 112 "../../../src/sd/domnode-xml-scanner.l" -#define YY_TABLES_VERIFY 0 - - -#line 2585 "domnode-xml-scanner.c" - - yylval = yylvalp; -#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - yylloc = yyllocp; -#endif - - if ( YY_G(yy_init) ) - { - YY_G(yy_init) = 0; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - -#ifdef YY_USES_REJECT - if ( ! YY_G(yy_state_buf) ) - YY_G(yy_state_buf) = (yy_state_type *)yyalloc(YY_BUF_SIZE + 2 YY_CALL_LAST_ARG); -#endif - - if ( ! YY_G(yy_start) ) - YY_G(yy_start) = 1; /* first start state */ - - if ( ! yyin ) - yyin = stdin; - - if ( ! yyout ) - yyout = stdout; - - if ( ! YY_G(yy_current_buffer) ) - YY_G(yy_current_buffer) = - yy_create_buffer( yyin, YY_BUF_SIZE YY_CALL_LAST_ARG); - - yy_load_buffer_state( YY_CALL_ONLY_ARG ); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_cp = YY_G(yy_c_buf_p); - - /* Support of yytext. */ - *yy_cp = YY_G(yy_hold_char); - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = yy_start_state_list[YY_G(yy_start)]; -yy_match: - { - register yyconst struct yy_trans_info *yy_trans_info; - - register YY_CHAR yy_c; - - for ( yy_c = YY_SC_TO_UI(*yy_cp); - (yy_trans_info = &yy_current_state[(unsigned int) yy_c])-> - yy_verify == yy_c; - yy_c = YY_SC_TO_UI(*++yy_cp) ) - { - yy_current_state += yy_trans_info->yy_nxt; - - if ( yy_current_state[-1].yy_nxt ) - { - YY_G(yy_last_accepting_state) = yy_current_state; - YY_G(yy_last_accepting_cpos) = yy_cp; - } - } - } - -yy_find_action: - yy_act = yy_current_state[-1].yy_nxt; - - YY_DO_BEFORE_ACTION; - -#ifdef YY_USE_LINENO - if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) - { - int yyl; - for ( yyl = 0; yyl < yyleng; ++yyl ) - if ( yytext[yyl] == '\n' ) - ++yylineno; - } -#endif - -do_action: /* This label is used only to access EOF actions. */ - - - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = YY_G(yy_hold_char); - yy_cp = YY_G(yy_last_accepting_cpos) + 1; - yy_current_state = YY_G(yy_last_accepting_state); - goto yy_find_action; - -case 1: -/* rule 1 can match eol */ -YY_RULE_SETUP -#line 114 "../../../src/sd/domnode-xml-scanner.l" -{/* skip */} - YY_BREAK -case 2: -YY_RULE_SETUP -#line 115 "../../../src/sd/domnode-xml-scanner.l" -{ return SLASH; } - YY_BREAK -case 3: -YY_RULE_SETUP -#line 116 "../../../src/sd/domnode-xml-scanner.l" -{ return EQ; } - YY_BREAK -case 4: -/* rule 4 can match eol */ -YY_RULE_SETUP -#line 117 "../../../src/sd/domnode-xml-scanner.l" -{ BEGIN(CONTENT); return CLOSE; } - YY_BREAK -case 5: -YY_RULE_SETUP -#line 118 "../../../src/sd/domnode-xml-scanner.l" -{ yylvalp->s = strdup(yytext); return NAME; } - YY_BREAK -case 6: -/* rule 6 can match eol */ -YY_RULE_SETUP -#line 119 "../../../src/sd/domnode-xml-scanner.l" -{ yylvalp->s = string(yytext); return VALUE; } - YY_BREAK -case 7: -/* rule 7 can match eol */ -YY_RULE_SETUP -#line 120 "../../../src/sd/domnode-xml-scanner.l" -{ return ENDDEF; } - YY_BREAK -case 8: -/* rule 8 can match eol */ -YY_RULE_SETUP -#line 122 "../../../src/sd/domnode-xml-scanner.l" -{ - BEGIN(INITIAL); - yylvalp->s = word(yytext); - return START; - } - YY_BREAK -case 9: -/* rule 9 can match eol */ -YY_RULE_SETUP -#line 127 "../../../src/sd/domnode-xml-scanner.l" -{BEGIN(INITIAL); return END;} - YY_BREAK -case 10: -/* rule 10 can match eol */ -YY_RULE_SETUP -#line 128 "../../../src/sd/domnode-xml-scanner.l" -{yylvalp->s = comment(yytext); return COMMENT;} - YY_BREAK -case 11: -/* rule 11 can match eol */ -YY_RULE_SETUP -#line 129 "../../../src/sd/domnode-xml-scanner.l" -{/* skip */} - YY_BREAK -case 12: -YY_RULE_SETUP -#line 131 "../../../src/sd/domnode-xml-scanner.l" -{yylvalp->s = strdup(yytext); return DATA;} - YY_BREAK -case 13: -YY_RULE_SETUP -#line 133 "../../../src/sd/domnode-xml-scanner.l" -{ yyerror("wrong XML input '%c'", *yytext); } - YY_BREAK -case 14: -/* rule 14 can match eol */ -YY_RULE_SETUP -#line 134 "../../../src/sd/domnode-xml-scanner.l" -{/* skip, must be an extra one at EOF */} - YY_BREAK -case 15: -YY_RULE_SETUP -#line 135 "../../../src/sd/domnode-xml-scanner.l" -YY_FATAL_ERROR( "flex scanner jammed" ); - YY_BREAK -#line 2770 "domnode-xml-scanner.c" -case YY_STATE_EOF(INITIAL): -case YY_STATE_EOF(CONTENT): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - YY_G(yytext_ptr)) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = YY_G(yy_hold_char); - YY_RESTORE_YY_MORE_OFFSET - - if ( YY_G(yy_current_buffer)->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between yy_current_buffer and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - YY_G(yy_n_chars) = YY_G(yy_current_buffer)->yy_n_chars; - YY_G(yy_current_buffer)->yy_input_file = yyin; - YY_G(yy_current_buffer)->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( YY_G(yy_c_buf_p) <= &YY_G(yy_current_buffer)->yy_ch_buf[YY_G(yy_n_chars)] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - YY_G(yy_c_buf_p) = YY_G(yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( YY_CALL_ONLY_ARG ); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state YY_CALL_LAST_ARG); - - yy_bp = YY_G(yytext_ptr) + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++YY_G(yy_c_buf_p); - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = YY_G(yy_c_buf_p); - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer( YY_CALL_ONLY_ARG ) ) - { - case EOB_ACT_END_OF_FILE: - { - YY_G(yy_did_buffer_switch_on_eof) = 0; - - if ( yywrap( YY_CALL_ONLY_ARG ) ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - YY_G(yy_c_buf_p) = YY_G(yytext_ptr) + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! YY_G(yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - YY_G(yy_c_buf_p) = - YY_G(yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( YY_CALL_ONLY_ARG ); - - yy_cp = YY_G(yy_c_buf_p); - yy_bp = YY_G(yytext_ptr) + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - YY_G(yy_c_buf_p) = - &YY_G(yy_current_buffer)->yy_ch_buf[YY_G(yy_n_chars)]; - - yy_current_state = yy_get_previous_state( YY_CALL_ONLY_ARG ); - - yy_cp = YY_G(yy_c_buf_p); - yy_bp = YY_G(yytext_ptr) + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of yylex */ -#endif /* !__sd_domnode_xml_IN_HEADER YY-END-DISCARD-FROM-HEADER */ - -#ifndef __sd_domnode_xml_IN_HEADER /* YY-DISCARD-FROM-HEADER */ -#endif /* !__sd_domnode_xml_IN_HEADER YY-END-DISCARD-FROM-HEADER */ - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ - -#ifndef __sd_domnode_xml_IN_HEADER /* YY-DISCARD-FROM-HEADER */ -static int yy_get_next_buffer YYFARGS0(void) - { - register char *dest = YY_G(yy_current_buffer)->yy_ch_buf; - register char *source = YY_G(yytext_ptr); - register int number_to_move, i; - int ret_val; - - if ( YY_G(yy_c_buf_p) > &YY_G(yy_current_buffer)->yy_ch_buf[YY_G(yy_n_chars) + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( YY_G(yy_current_buffer)->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( YY_G(yy_c_buf_p) - YY_G(yytext_ptr) - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) (YY_G(yy_c_buf_p) - YY_G(yytext_ptr)) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( YY_G(yy_current_buffer)->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - YY_G(yy_current_buffer)->yy_n_chars = YY_G(yy_n_chars) = 0; - - else - { - size_t num_to_read = - YY_G(yy_current_buffer)->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ -#ifdef YY_USES_REJECT - YY_FATAL_ERROR( -"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); -#else - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_G(yy_current_buffer); - - int yy_c_buf_p_offset = - (int) (YY_G(yy_c_buf_p) - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yyrealloc( (void *) b->yy_ch_buf, - b->yy_buf_size + 2 YY_CALL_LAST_ARG ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - YY_G(yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = YY_G(yy_current_buffer)->yy_buf_size - - number_to_move - 1; -#endif - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&YY_G(yy_current_buffer)->yy_ch_buf[number_to_move]), - YY_G(yy_n_chars), num_to_read ); - - YY_G(yy_current_buffer)->yy_n_chars = YY_G(yy_n_chars); - } - - if ( YY_G(yy_n_chars) == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart( yyin YY_CALL_LAST_ARG); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - YY_G(yy_current_buffer)->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - YY_G(yy_n_chars) += number_to_move; - YY_G(yy_current_buffer)->yy_ch_buf[YY_G(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; - YY_G(yy_current_buffer)->yy_ch_buf[YY_G(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; - - YY_G(yytext_ptr) = &YY_G(yy_current_buffer)->yy_ch_buf[0]; - - return ret_val; - } -#endif /* !__sd_domnode_xml_IN_HEADER YY-END-DISCARD-FROM-HEADER */ - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -#ifndef __sd_domnode_xml_IN_HEADER /* YY-DISCARD-FROM-HEADER */ - static yy_state_type yy_get_previous_state YYFARGS0(void) - { - register yy_state_type yy_current_state; - register char *yy_cp; - - yy_current_state = yy_start_state_list[YY_G(yy_start)]; - - for ( yy_cp = YY_G(yytext_ptr) + YY_MORE_ADJ; yy_cp < YY_G(yy_c_buf_p); ++yy_cp ) - { - yy_current_state += yy_current_state[(*yy_cp ? YY_SC_TO_UI(*yy_cp) : 256)].yy_nxt; - if ( yy_current_state[-1].yy_nxt ) - { - YY_G(yy_last_accepting_state) = yy_current_state; - YY_G(yy_last_accepting_cpos) = yy_cp; - } - } - - return yy_current_state; - } - - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - static yy_state_type yy_try_NUL_trans YYFARGS1( yy_state_type, yy_current_state) - { - register int yy_is_jam; - register char *yy_cp = YY_G(yy_c_buf_p); - - register int yy_c = 256; - register yyconst struct yy_trans_info *yy_trans_info; - - yy_trans_info = &yy_current_state[(unsigned int) yy_c]; - yy_current_state += yy_trans_info->yy_nxt; - yy_is_jam = (yy_trans_info->yy_verify != yy_c); - - if ( ! yy_is_jam ) - { - if ( yy_current_state[-1].yy_nxt ) - { - YY_G(yy_last_accepting_state) = yy_current_state; - YY_G(yy_last_accepting_cpos) = yy_cp; - } - } - - return yy_is_jam ? 0 : yy_current_state; - } - - -#ifndef YY_NO_UNPUT - static void yyunput YYFARGS2( int,c, register char *,yy_bp) - { - register char *yy_cp = YY_G(yy_c_buf_p); - - /* undo effects of setting up yytext */ - *yy_cp = YY_G(yy_hold_char); - - if ( yy_cp < YY_G(yy_current_buffer)->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register int number_to_move = YY_G(yy_n_chars) + 2; - register char *dest = &YY_G(yy_current_buffer)->yy_ch_buf[ - YY_G(yy_current_buffer)->yy_buf_size + 2]; - register char *source = - &YY_G(yy_current_buffer)->yy_ch_buf[number_to_move]; - - while ( source > YY_G(yy_current_buffer)->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - YY_G(yy_current_buffer)->yy_n_chars = - YY_G(yy_n_chars) = YY_G(yy_current_buffer)->yy_buf_size; - - if ( yy_cp < YY_G(yy_current_buffer)->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (char) c; - -#ifdef YY_USE_LINENO - if ( c == '\n' ) - --yylineno; -#endif - YY_G(yytext_ptr) = yy_bp; - YY_G(yy_hold_char) = *yy_cp; - YY_G(yy_c_buf_p) = yy_cp; - } -#endif /* ifndef YY_NO_UNPUT */ - -#ifndef YY_NO_INPUT -#ifdef __cplusplus - static int yyinput YYFARGS0(void) -#else - static int input YYFARGS0(void) -#endif - - - { - int c; - - *YY_G(yy_c_buf_p) = YY_G(yy_hold_char); - - if ( *YY_G(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( YY_G(yy_c_buf_p) < &YY_G(yy_current_buffer)->yy_ch_buf[YY_G(yy_n_chars)] ) - /* This was really a NUL. */ - *YY_G(yy_c_buf_p) = '\0'; - - else - { /* need more input */ - int offset = YY_G(yy_c_buf_p) - YY_G(yytext_ptr); - ++YY_G(yy_c_buf_p); - - switch ( yy_get_next_buffer( YY_CALL_ONLY_ARG ) ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart( yyin YY_CALL_LAST_ARG); - - /*FALLTHROUGH*/ - - case EOB_ACT_END_OF_FILE: - { - if ( yywrap( YY_CALL_ONLY_ARG ) ) - return EOF; - - if ( ! YY_G(yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(YY_CALL_ONLY_ARG); -#else - return input(YY_CALL_ONLY_ARG); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - YY_G(yy_c_buf_p) = YY_G(yytext_ptr) + offset; - break; - } - } - } - - c = *(unsigned char *) YY_G(yy_c_buf_p); /* cast for 8-bit char's */ - *YY_G(yy_c_buf_p) = '\0'; /* preserve yytext */ - YY_G(yy_hold_char) = *++YY_G(yy_c_buf_p); - - - return c; - } -#endif /* ifndef YY_NO_INPUT */ - - void yyrestart YYFARGS1( FILE *,input_file) - { - if ( ! YY_G(yy_current_buffer) ) - YY_G(yy_current_buffer) = - yy_create_buffer( yyin, YY_BUF_SIZE YY_CALL_LAST_ARG); - - yy_init_buffer( YY_G(yy_current_buffer), input_file YY_CALL_LAST_ARG); - yy_load_buffer_state( YY_CALL_ONLY_ARG ); - } - - void yy_switch_to_buffer YYFARGS1( YY_BUFFER_STATE ,new_buffer) - { - if ( YY_G(yy_current_buffer) == new_buffer ) - return; - - if ( YY_G(yy_current_buffer) ) - { - /* Flush out information for old buffer. */ - *YY_G(yy_c_buf_p) = YY_G(yy_hold_char); - YY_G(yy_current_buffer)->yy_buf_pos = YY_G(yy_c_buf_p); - YY_G(yy_current_buffer)->yy_n_chars = YY_G(yy_n_chars); - } - - YY_G(yy_current_buffer) = new_buffer; - yy_load_buffer_state( YY_CALL_ONLY_ARG ); - - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - YY_G(yy_did_buffer_switch_on_eof) = 1; - } - - - void yy_load_buffer_state YYFARGS0(void) - { - YY_G(yy_n_chars) = YY_G(yy_current_buffer)->yy_n_chars; - YY_G(yytext_ptr) = YY_G(yy_c_buf_p) = YY_G(yy_current_buffer)->yy_buf_pos; - yyin = YY_G(yy_current_buffer)->yy_input_file; - YY_G(yy_hold_char) = *YY_G(yy_c_buf_p); - } - - YY_BUFFER_STATE yy_create_buffer YYFARGS2( FILE *,file, int ,size) - { - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) YY_CALL_LAST_ARG ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yyalloc( b->yy_buf_size + 2 YY_CALL_LAST_ARG ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - yy_init_buffer( b, file YY_CALL_LAST_ARG); - - return b; - } - - void yy_delete_buffer YYFARGS1( YY_BUFFER_STATE ,b) - { - if ( ! b ) - return; - - if ( b == YY_G(yy_current_buffer) ) - YY_G(yy_current_buffer) = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yyfree( (void *) b->yy_ch_buf YY_CALL_LAST_ARG ); - - yyfree( (void *) b YY_CALL_LAST_ARG ); - } - - -#ifndef YY_ALWAYS_INTERACTIVE -#ifndef YY_NEVER_INTERACTIVE -#ifndef __cplusplus -extern int isatty YY_PARAMS(( int )); -#endif /* __cplusplus */ -#endif /* !YY_NEVER_INTERACTIVE */ -#endif /* !YY_ALWAYS_INTERACTIVE */ - - void yy_init_buffer YYFARGS2( YY_BUFFER_STATE ,b, FILE *,file) - - { - int oerrno = errno; - - yy_flush_buffer( b YY_CALL_LAST_ARG); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - -#if YY_ALWAYS_INTERACTIVE - b->yy_is_interactive = 1; -#else -#if YY_NEVER_INTERACTIVE - b->yy_is_interactive = 0; -#else - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; -#endif -#endif - errno = oerrno; - } - - void yy_flush_buffer YYFARGS1( YY_BUFFER_STATE ,b) - { - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == YY_G(yy_current_buffer) ) - yy_load_buffer_state( YY_CALL_ONLY_ARG ); - } - - -#ifndef YY_NO_SCAN_BUFFER -YY_BUFFER_STATE yy_scan_buffer YYFARGS2( char *,base, yy_size_t ,size) - { - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) YY_CALL_LAST_ARG ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - yy_switch_to_buffer( b YY_CALL_LAST_ARG ); - - return b; - } -#endif - - -#ifndef YY_NO_SCAN_STRING -YY_BUFFER_STATE yy_scan_string YYFARGS1( yyconst char *,yy_str) - { - int len; - for ( len = 0; yy_str[len]; ++len ) - ; - - return yy_scan_bytes( yy_str, len YY_CALL_LAST_ARG); - } -#endif - - -#ifndef YY_NO_SCAN_BYTES -YY_BUFFER_STATE yy_scan_bytes YYFARGS2( yyconst char *,bytes, int ,len) - { - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; - buf = (char *) yyalloc( n YY_CALL_LAST_ARG ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - - for ( i = 0; i < len; ++i ) - buf[i] = bytes[i]; - - buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer( buf, n YY_CALL_LAST_ARG); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; - } -#endif - - -#ifndef YY_NO_PUSH_STATE - static void yy_push_state YYFARGS1( int ,new_state) - { - if ( YY_G(yy_start_stack_ptr) >= YY_G(yy_start_stack_depth) ) - { - yy_size_t new_size; - - YY_G(yy_start_stack_depth) += YY_START_STACK_INCR; - new_size = YY_G(yy_start_stack_depth) * sizeof( int ); - - if ( ! YY_G(yy_start_stack) ) - YY_G(yy_start_stack) = (int *) yyalloc( new_size YY_CALL_LAST_ARG ); - - else - YY_G(yy_start_stack) = (int *) yyrealloc( - (void *) YY_G(yy_start_stack), new_size YY_CALL_LAST_ARG ); - - if ( ! YY_G(yy_start_stack) ) - YY_FATAL_ERROR( - "out of memory expanding start-condition stack" ); - } - - YY_G(yy_start_stack)[YY_G(yy_start_stack_ptr)++] = YY_START; - - BEGIN(new_state); - } -#endif - - -#ifndef YY_NO_POP_STATE - static void yy_pop_state YYFARGS0(void) - { - if ( --YY_G(yy_start_stack_ptr) < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); - - BEGIN(YY_G(yy_start_stack)[YY_G(yy_start_stack_ptr)]); - } -#endif - - -#ifndef YY_NO_TOP_STATE - static int yy_top_state YYFARGS0(void) - { - return YY_G(yy_start_stack)[YY_G(yy_start_stack_ptr) - 1]; - } -#endif - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -static void yy_fatal_error YYFARGS1(yyconst char*, msg) - { - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); - } - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - yytext[yyleng] = YY_G(yy_hold_char); \ - YY_G(yy_c_buf_p) = yytext + yyless_macro_arg; \ - YY_G(yy_hold_char) = *YY_G(yy_c_buf_p); \ - *YY_G(yy_c_buf_p) = '\0'; \ - yyleng = yyless_macro_arg; \ - } \ - while ( 0 ) - - - -/* Accessor methods (get/set functions) to struct members. */ - -#ifndef YY_NO_GET_EXTRA -YY_EXTRA_TYPE yyget_extra YYFARGS0(void) -{ - return yyextra; -} -#endif /* !YY_NO_GET_EXTRA */ - -#ifndef YY_NO_GET_LINENO -int yyget_lineno YYFARGS0(void) -{ - return yylineno; -} -#endif /* !YY_NO_GET_LINENO */ - -#ifndef YY_NO_GET_IN -FILE *yyget_in YYFARGS0(void) -{ - return yyin; -} -#endif /* !YY_NO_GET_IN */ - -#ifndef YY_NO_GET_OUT -FILE *yyget_out YYFARGS0(void) -{ - return yyout; -} -#endif /* !YY_NO_GET_OUT */ - -#ifndef YY_NO_GET_LENG -int yyget_leng YYFARGS0(void) -{ - return yyleng; -} -#endif /* !YY_NO_GET_LENG */ - -#ifndef YY_NO_GET_TEXT -char *yyget_text YYFARGS0(void) -{ - return yytext; -} -#endif /* !YY_NO_GET_TEXT */ - -#ifndef YY_NO_SET_EXTRA -void yyset_extra YYFARGS1( YY_EXTRA_TYPE ,user_defined) -{ - yyextra = user_defined ; -} -#endif /* !YY_NO_SET_EXTRA */ - -#ifndef YY_NO_SET_LINENO -void yyset_lineno YYFARGS1( int ,line_number) -{ - yylineno = line_number; -} -#endif /* !YY_NO_SET_LINENO */ - - -#ifndef YY_NO_SET_IN -void yyset_in YYFARGS1( FILE * ,in_str) -{ - yyin = in_str ; -} -#endif /* !YY_NO_SET_IN */ - -#ifndef YY_NO_SET_OUT -void yyset_out YYFARGS1( FILE * ,out_str) -{ - yyout = out_str ; -} -#endif /* !YY_NO_SET_OUT */ - - -#ifndef YY_NO_GET_DEBUG -int yyget_debug YYFARGS0(void) -{ - return yy_flex_debug; -} -#endif /* !YY_NO_GET_DEBUG */ - -#ifndef YY_NO_SET_DEBUG -void yyset_debug YYFARGS1( int ,bdebug) -{ - yy_flex_debug = bdebug ; -} -#endif /* !YY_NO_SET_DEBUG */ - -/* Accessor methods for yylval and yylloc */ - -#ifndef YY_NO_GET_LVAL -YYSTYPE * yyget_lval YYFARGS0(void) -{ - return yylval; -} -#endif /* !YY_NO_GET_LVAL */ - -#ifndef YY_NO_SET_LVAL -void yyset_lval YYFARGS1( YYSTYPE * ,yylvalp) -{ - yylval = yylvalp; -} -#endif /* !YY_NO_SET_LVAL */ - -#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) -#ifndef YY_NO_GET_LLOC -YYLTYPE *yyget_lloc YYFARGS0(void) -{ - return yylloc; -} -#endif /* !YY_NO_GET_LLOC */ - -#ifndef YY_NO_SET_LLOC -void yyset_lloc YYFARGS1( YYLTYPE * ,yyllocp) -{ - yylloc = yyllocp; -} -#endif /* !YY_NO_SET_LLOC */ - -#endif /* YYLTYPE */ - - -static int yy_init_globals YYFARGS0(void) - { - /* Initialization is the same as for the non-reentrant scanner. - This function is called once per scanner lifetime. */ - - /* We do not touch yylineno unless the option is enabled. */ -#ifdef YY_USE_LINENO - yylineno = 1; -#endif - YY_G(yy_current_buffer) = 0; - YY_G(yy_c_buf_p) = (char *) 0; - YY_G(yy_init) = 1; - YY_G(yy_start) = 0; - YY_G(yy_start_stack_ptr) = 0; - YY_G(yy_start_stack_depth) = 0; - YY_G(yy_start_stack) = (int *) 0; - -#ifdef YY_USES_REJECT - YY_G(yy_state_buf) = 0; - YY_G(yy_state_ptr) = 0; - YY_G(yy_full_match) = 0; - YY_G(yy_lp) = 0; -#endif - -#ifdef YY_TEXT_IS_ARRAY - YY_G(yytext_ptr) = 0; - YY_G(yy_more_offset) = 0; - YY_G(yy_prev_more_offset) = 0; -#endif - -/* Defined in main.c */ -#ifdef YY_STDINIT - yyin = stdin; - yyout = stdout; -#else - yyin = (FILE *) 0; - yyout = (FILE *) 0; -#endif - - /* For future reference: Set errno on error, since we are called by - * yylex_init() - */ - return 0; - } - -/* User-visible API */ - -/* yylex_init is special because it creates the scanner itself, so it is - * the ONLY reentrant function that doesn't take the scanner as the last argument. - * That's why we explicitly handle the declaration, instead of using our macros. - */ -#ifndef YY_TRADITIONAL_FUNC_DEFS -int yylex_init(yyscan_t* ptr_yy_globals) -#else -int yylex_init( ptr_yy_globals ) - yyscan_t* ptr_yy_globals; -#endif - { - if (ptr_yy_globals == NULL){ - errno = EINVAL; - return 1; - } - - *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL ); - - if (*ptr_yy_globals == NULL){ - errno = ENOMEM; - return 1; - } - - memset(*ptr_yy_globals,0,sizeof(struct yyguts_t)); - - return yy_init_globals ( *ptr_yy_globals ); - } - - -/* yylex_destroy is for both reentrant and non-reentrant scanners. */ -int yylex_destroy YYFARGS0(void) -{ - /* Destroy the current (main) buffer. */ - yy_delete_buffer( YY_G(yy_current_buffer) YY_CALL_LAST_ARG ); - YY_G(yy_current_buffer) = NULL; - -#if defined(YY_STACK_USED) || defined(YY_REENTRANT) - /* Destroy the start condition stack. */ - if (YY_G(yy_start_stack) ){ - yyfree( YY_G(yy_start_stack) YY_CALL_LAST_ARG ); - YY_G(yy_start_stack) = NULL; - } -#endif - -#ifdef YY_USES_REJECT - yyfree ( YY_G(yy_state_buf) YY_CALL_LAST_ARG); -#endif - - /* Destroy the main struct (reentrant only). */ - yyfree ( yyscanner YY_CALL_LAST_ARG ); - return 0; -} - - -/* Internal utility routines. */ - -#ifndef yytext_ptr -static void yy_flex_strncpy YYFARGS3( char*,s1, yyconst char *,s2, int,n) - { - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; - } -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen YYFARGS1( yyconst char *,s) - { - register int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; - } -#endif - -/* You may override yyalloc by defining YY_NO_FLEX_ALLOC and linking to - * your own version */ -#ifndef YY_NO_FLEX_ALLOC -void *yyalloc YYFARGS1( yy_size_t ,size) - { - return (void *) malloc( size ); - } -#endif - -/* You may override yyrealloc by defining YY_NO_FLEX_REALLOC and linking - * to your own version. */ -#ifndef YY_NO_FLEX_REALLOC -void *yyrealloc YYFARGS2( void *,ptr, yy_size_t ,size) - { - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); - } -#endif - -/* You may override yyfree by defining YY_NO_FLEX_FREE and linking to - * your own version.*/ -#ifndef YY_NO_FLEX_FREE -void yyfree YYFARGS1( void *,ptr) - { - free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ - } -#endif - -#define YYTABLES_NAME "yytables" - -#if YY_MAIN -int main YY_PARAMS((void)); - -int main () - { - - yyscan_t lexer; - yylex_init(&lexer); - yylex( lexer ); - yylex_destroy( lexer); - - - return 0; - } -#endif -#endif /* !__sd_domnode_xml_IN_HEADER YY-END-DISCARD-FROM-HEADER */ -#line 135 "../../../src/sd/domnode-xml-scanner.l" diff --git a/import/log4c/sd/domnode-xml-scanner.h b/import/log4c/sd/domnode-xml-scanner.h deleted file mode 100644 index ed23a68..0000000 --- a/import/log4c/sd/domnode-xml-scanner.h +++ /dev/null @@ -1,882 +0,0 @@ -#ifndef __sd_domnode_xml_HEADER_H -#define __sd_domnode_xml_HEADER_H 1 -#define __sd_domnode_xml_IN_HEADER 1 - -#define YY_REENTRANT 1 -#define YY_BISON_BRIDGE 1 -#ifndef YY_REENTRANT -#define yytext __sd_domnode_xml_text -#define yyleng __sd_domnode_xml_leng -#define yyin __sd_domnode_xml_in -#define yyout __sd_domnode_xml_out -#define yy_flex_debug __sd_domnode_xml__flex_debug -#endif -#define yy_create_buffer __sd_domnode_xml__create_buffer -#define yy_delete_buffer __sd_domnode_xml__delete_buffer -#define yy_scan_buffer __sd_domnode_xml__scan_buffer -#define yy_scan_string __sd_domnode_xml__scan_string -#define yy_scan_bytes __sd_domnode_xml__scan_bytes -#define yy_init_buffer __sd_domnode_xml__init_buffer -#define yy_flush_buffer __sd_domnode_xml__flush_buffer -#define yy_load_buffer_state __sd_domnode_xml__load_buffer_state -#define yy_switch_to_buffer __sd_domnode_xml__switch_to_buffer -#define yylex __sd_domnode_xml_lex -#define yyrestart __sd_domnode_xml_restart -#define yylex_init __sd_domnode_xml_lex_init -#define yylex_destroy __sd_domnode_xml_lex_destroy -#define yyget_debug __sd_domnode_xml_get_debug -#define yyset_debug __sd_domnode_xml_set_debug -#define yyget_extra __sd_domnode_xml_get_extra -#define yyset_extra __sd_domnode_xml_set_extra -#define yyget_in __sd_domnode_xml_get_in -#define yyset_in __sd_domnode_xml_set_in -#define yyget_out __sd_domnode_xml_get_out -#define yyset_out __sd_domnode_xml_set_out -#define yyget_leng __sd_domnode_xml_get_leng -#define yyget_text __sd_domnode_xml_get_text -#define yyget_lineno __sd_domnode_xml_get_lineno -#define yyset_lineno __sd_domnode_xml_set_lineno -#ifdef YY_BISON_BRIDGE -#define yyget_lval __sd_domnode_xml_get_lval -#define yyset_lval __sd_domnode_xml_set_lval -#define yyget_lloc __sd_domnode_xml_get_lloc -#define yyset_lloc __sd_domnode_xml_set_lloc -#endif -#define yyalloc __sd_domnode_xml_alloc -#define yyrealloc __sd_domnode_xml_realloc -#define yyfree __sd_domnode_xml_free - -#line 50 "domnode-xml-scanner.h" -#define YY_INT_ALIGNED short int - - -/* A lexical scanner generated by flex */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 27 -#if YY_FLEX_SUBMINOR_VERSION > 0 -#define FLEX_BETA -#endif - -/* First, we deal with platform-specific or compiler-specific issues. */ - -/* begin standard C headers. */ -#include -#include -#include -#include - -/* end standard C headers. */ - -#include - -/* flex integer type definitions */ - -#ifndef FLEXINT_H -#define FLEXINT_H - -/* C99 systems have . Non-C99 systems may or may not. */ - -#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L -#include -typedef int8_t flex_int8_t; -typedef uint8_t flex_uint8_t; -typedef int16_t flex_int16_t; -typedef uint16_t flex_uint16_t; -typedef int32_t flex_int32_t; -typedef uint32_t flex_uint32_t; -#else -typedef signed char flex_int8_t; -typedef short int flex_int16_t; -typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; -typedef unsigned short int flex_uint16_t; -typedef unsigned int flex_uint32_t; -#endif /* ! C99 */ - -/* Limits of integral types. */ -#ifndef INT8_MIN -#define INT8_MIN (-128) -#endif -#ifndef INT16_MIN -#define INT16_MIN (-32767-1) -#endif -#ifndef INT32_MIN -#define INT32_MIN (-2147483647-1) -#endif -#ifndef INT8_MAX -#define INT8_MAX (127) -#endif -#ifndef INT16_MAX -#define INT16_MAX (32767) -#endif -#ifndef INT32_MAX -#define INT32_MAX (2147483647) -#endif -#ifndef UINT8_MAX -#define UINT8_MAX (255U) -#endif -#ifndef UINT16_MAX -#define UINT16_MAX (65535U) -#endif -#ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) -#endif - - -#endif /* ! FLEXINT_H */ - - - -#ifdef __cplusplus - -/* C++ compilers don't understand traditional function definitions. */ -#ifdef YY_TRADITIONAL_FUNC_DEFS -#undef YY_TRADITIONAL_FUNC_DEFS -#endif - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -/* We're not in a C++ compiler, so by default, - we generate C99 function defs, unless you explicitly ask - for traditional defs by defining YY_TRADITIONAL_FUNC_DEFS */ - -#if __STDC__ - -#define YY_USE_CONST - -#endif /* __STDC__ */ -#endif /* ! __cplusplus */ - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - -/* For compilers that can't handle prototypes. - * e.g., - * The function prototype - * int foo(int x, char* y); - * - * ...should be written as - * int foo YY_PARAMS((int x, char* y)); - * - * ...which could possibly generate - * int foo (); - */ -#ifdef YY_NO_PROTOS -#define YY_PARAMS(proto) () -#else -#define YY_PARAMS(proto) proto -#endif - - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) - - -/* An opaque pointer. */ -#ifndef YY_TYPEDEF_YY_SCANNER_T -#define YY_TYPEDEF_YY_SCANNER_T -typedef void* yyscan_t; -#endif - -/* For use wherever a Global is accessed or assigned. */ -#define YY_G(var) (((struct yyguts_t*)yyscanner)->var) - -/* For use in function prototypes to append the additional argument. */ -#define YY_PROTO_LAST_ARG , yyscan_t yyscanner -#define YY_PROTO_ONLY_ARG yyscan_t yyscanner - -/* For use in function definitions to append the additional argument. */ -#ifdef YY_TRADITIONAL_FUNC_DEFS -#define YY_DEF_LAST_ARG , yyscanner -#define YY_DEF_ONLY_ARG yyscanner -#else -#define YY_DEF_LAST_ARG , yyscan_t yyscanner -#define YY_DEF_ONLY_ARG yyscan_t yyscanner -#endif -#define YY_DECL_LAST_ARG yyscan_t yyscanner; - -/* For use in function calls to pass the additional argument. */ -#define YY_CALL_LAST_ARG , yyscanner -#define YY_CALL_ONLY_ARG yyscanner - -/* For convenience, these vars (plus the bison vars far below) - are macros in the reentrant scanner. */ -#define yyin YY_G(yyin_r) -#define yyout YY_G(yyout_r) -#define yyextra YY_G(yyextra_r) -#define yyleng YY_G(yyleng_r) -#define yytext YY_G(yytext_r) -#define yylineno YY_G(yylineno_r) -#define yy_flex_debug YY_G(yy_flex_debug_r) - -int yylex_init YY_PARAMS((yyscan_t* scanner)); - - - -/* For compilers that need traditional function definitions. - * e.g., - * The function prototype taking 2 arguments - * int foo (int x, char* y) - * - * ...should be written as - * int foo YYFARGS2(int,x, char*,y) - * - * ...which could possibly generate - * int foo (x,y,yyscanner) - * int x; - * char * y; - * yyscan_t yyscanner; - */ -#ifdef YY_TRADITIONAL_FUNC_DEFS -/* Generate traditional function defs */ -#define YYFARGS0(v) (YY_DEF_ONLY_ARG) YY_DECL_LAST_ARG -#define YYFARGS1(t1,n1) (n1 YY_DEF_LAST_ARG) t1 n1; YY_DECL_LAST_ARG -#define YYFARGS2(t1,n1,t2,n2) (n1,n2 YY_DEF_LAST_ARG) t1 n1; t2 n2; YY_DECL_LAST_ARG -#define YYFARGS3(t1,n1,t2,n2,t3,n3) (n1,n2,n3 YY_DEF_LAST_ARG) t1 n1; t2 n2; t3 n3; YY_DECL_LAST_ARG -#else -/* Generate C99 function defs. */ -#define YYFARGS0(v) (YY_DEF_ONLY_ARG) -#define YYFARGS1(t1,n1) (t1 n1 YY_DEF_LAST_ARG) -#define YYFARGS2(t1,n1,t2,n2) (t1 n1,t2 n2 YY_DEF_LAST_ARG) -#define YYFARGS3(t1,n1,t2,n2,t3,n3) (t1 n1,t2 n2,t3 n3 YY_DEF_LAST_ARG) -#endif - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN YY_G(yy_start) = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START ((YY_G(yy_start) - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart( yyin YY_CALL_LAST_ARG ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#ifndef YY_BUF_SIZE -#define YY_BUF_SIZE 16384 -#endif - - -#ifndef YY_TYPEDEF_YY_BUFFER_STATE -#define YY_TYPEDEF_YY_BUFFER_STATE -typedef struct yy_buffer_state *YY_BUFFER_STATE; -#endif - - - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - -#ifdef YY_USE_LINENO -/* Note: We specifically omit the test for yy_rule_can_match_eol because it requires - * access to the local variable yy_act. Since yyless() is a macro, it would break - * existing scanners that call yyless() from OUTSIDE yylex. - * One obvious solution it to make yy_act a global. I tried that, and saw - * a 5% performance hit in a non-yylineno scanner, because yy_act is - * normally declared as a register variable-- so it's not worth it. - */ -#define YY_LESS_LINENO(n) \ - do { \ - int yyl;\ - for ( yyl = n; yyl < yyleng; ++yyl )\ - if ( yytext[yyl] == '\n' )\ - --yylineno;\ - }while(0) -#else -#define YY_LESS_LINENO(n) -#endif - -/* The funky do-while in the following #define is used to turn the definition - * int a single C statement (which needs a semi-colon terminator). This - * avoids problems with code like: - * - * if ( condition_holds ) - * yyless( 5 ); - * else - * do_something_else(); - * - * Prior to using the do-while the compiler would get upset at the - * "else" because it interpreted the "if" statement as being all - * done when it reached the ';' after the yyless() call. - */ - -/* Return all but the first 'n' matched characters back to the input stream. */ - -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - *yy_cp = YY_G(yy_hold_char); \ - YY_RESTORE_YY_MORE_OFFSET \ - YY_G(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) - -#define unput(c) yyunput( c, YY_G(yytext_ptr) YY_CALL_LAST_ARG ) - -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ - -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef unsigned int yy_size_t; -#endif - -#ifndef YY_STRUCT_YY_BUFFER_STATE -#define YY_STRUCT_YY_BUFFER_STATE -struct yy_buffer_state - { - FILE *yy_input_file; - - - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - }; -#endif /* !YY_STRUCT_YY_BUFFER_STATE */ - - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - */ -#define YY_CURRENT_BUFFER yy_current_buffer - - - -void yyrestart YY_PARAMS(( FILE *input_file YY_PROTO_LAST_ARG )); - - -void yy_switch_to_buffer YY_PARAMS(( YY_BUFFER_STATE new_buffer YY_PROTO_LAST_ARG )); -void yy_load_buffer_state YY_PARAMS(( YY_PROTO_ONLY_ARG )); -YY_BUFFER_STATE yy_create_buffer YY_PARAMS(( FILE *file, int size YY_PROTO_LAST_ARG )); -void yy_delete_buffer YY_PARAMS(( YY_BUFFER_STATE b YY_PROTO_LAST_ARG )); -void yy_init_buffer YY_PARAMS(( YY_BUFFER_STATE b, FILE *file YY_PROTO_LAST_ARG )); -void yy_flush_buffer YY_PARAMS(( YY_BUFFER_STATE b YY_PROTO_LAST_ARG )); - -#define YY_FLUSH_BUFFER yy_flush_buffer( YY_G(yy_current_buffer) YY_CALL_LAST_ARG) - -YY_BUFFER_STATE yy_scan_buffer YY_PARAMS(( char *base, yy_size_t size YY_PROTO_LAST_ARG )); -YY_BUFFER_STATE yy_scan_string YY_PARAMS(( yyconst char *yy_str YY_PROTO_LAST_ARG )); -YY_BUFFER_STATE yy_scan_bytes YY_PARAMS(( yyconst char *bytes, int len YY_PROTO_LAST_ARG )); - - -void *yyalloc YY_PARAMS(( yy_size_t YY_PROTO_LAST_ARG )); -void *yyrealloc YY_PARAMS(( void *, yy_size_t YY_PROTO_LAST_ARG )); -void yyfree YY_PARAMS(( void * YY_PROTO_LAST_ARG )); - -#define yy_new_buffer yy_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! YY_G(yy_current_buffer) ) \ - YY_G(yy_current_buffer) = \ - yy_create_buffer( yyin, YY_BUF_SIZE YY_CALL_LAST_ARG); \ - YY_G(yy_current_buffer)->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! YY_G(yy_current_buffer) ) \ - YY_G(yy_current_buffer) = \ - yy_create_buffer( yyin, YY_BUF_SIZE YY_CALL_LAST_ARG); \ - YY_G(yy_current_buffer)->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (YY_G(yy_current_buffer)->yy_at_bol) - - -#define yywrap(n) 1 -#define YY_SKIP_YYWRAP -#define yytext_ptr yytext_r - - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - YY_G(yytext_ptr) = yy_bp; \ - yyleng = (size_t) (yy_cp - yy_bp); \ - YY_G(yy_hold_char) = *yy_cp; \ - *yy_cp = '\0'; \ - YY_G(yy_c_buf_p) = yy_cp; - - -/* Special case for "unistd.h", since it is non-ANSI. We include it way - * down here because we want the user's section 1 to have been scanned first. - * The user has a chance to override it with an option. - */ -#ifndef YY_NO_UNISTD_H -#include -#endif /* !YY_NO_UNISTD_H */ - -#ifndef YY_EXTRA_TYPE -#define YY_EXTRA_TYPE void * -#endif - - - - - - -/* Accessor methods to globals. - These are made visible to non-reentrant scanners for convenience. */ - -#ifndef YY_NO_DESTROY -int yylex_destroy YY_PARAMS(( YY_PROTO_ONLY_ARG )); -#endif - -#ifndef YY_NO_GET_DEBUG -int yyget_debug YY_PARAMS(( YY_PROTO_ONLY_ARG )); -#endif - -#ifndef YY_NO_SET_DEBUG -void yyset_debug YY_PARAMS(( int debug_flag YY_PROTO_LAST_ARG )); -#endif - -#ifndef YY_NO_GET_EXTRA -YY_EXTRA_TYPE yyget_extra YY_PARAMS(( YY_PROTO_ONLY_ARG )); -#endif - -#ifndef YY_NO_SET_EXTRA -void yyset_extra YY_PARAMS(( YY_EXTRA_TYPE user_defined YY_PROTO_LAST_ARG )); -#endif - -#ifndef YY_NO_GET_IN -FILE *yyget_in YY_PARAMS(( YY_PROTO_ONLY_ARG )); -#endif - -#ifndef YY_NO_SET_IN -void yyset_in YY_PARAMS(( FILE * in_str YY_PROTO_LAST_ARG )); -#endif - -#ifndef YY_NO_GET_OUT -FILE *yyget_out YY_PARAMS(( YY_PROTO_ONLY_ARG )); -#endif - -#ifndef YY_NO_SET_OUT -void yyset_out YY_PARAMS(( FILE * out_str YY_PROTO_LAST_ARG )); -#endif - -#ifndef YY_NO_GET_LENG -int yyget_leng YY_PARAMS(( YY_PROTO_ONLY_ARG )); -#endif - -#ifndef YY_NO_GET_TEXT -char *yyget_text YY_PARAMS(( YY_PROTO_ONLY_ARG )); -#endif - -#ifndef YY_NO_GET_LINENO -int yyget_lineno YY_PARAMS(( YY_PROTO_ONLY_ARG )); -#endif - -#ifndef YY_NO_SET_LINENO -void yyset_lineno YY_PARAMS(( int line_number YY_PROTO_LAST_ARG )); -#endif - -#ifndef YY_NO_GET_LVAL -YYSTYPE * yyget_lval YY_PARAMS(( YY_PROTO_ONLY_ARG )); -#endif -void yyset_lval YY_PARAMS(( YYSTYPE * yylvalp YY_PROTO_LAST_ARG )); -#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) -#ifndef YY_NO_GET_LLOC - YYLTYPE *yyget_lloc YY_PARAMS(( YY_PROTO_ONLY_ARG )); -#endif -#ifndef YY_NO_SET_LLOC - void yyset_lloc YY_PARAMS(( YYLTYPE * yyllocp YY_PROTO_LAST_ARG )); -#endif -#endif /* YYLTYPE */ - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap YY_PARAMS(( YY_PROTO_ONLY_ARG )); -#else -extern int yywrap YY_PARAMS(( YY_PROTO_ONLY_ARG )); -#endif -#endif - - -#ifndef yytext_ptr -static void yy_flex_strncpy YY_PARAMS(( char *, yyconst char *, int YY_PROTO_LAST_ARG)); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen YY_PARAMS(( yyconst char * YY_PROTO_LAST_ARG)); -#endif - -#ifndef YY_NO_INPUT -#endif - - -#if YY_STACK_USED - -#ifndef YY_NO_PUSH_STATE -static void yy_push_state YY_PARAMS(( int new_state YY_PROTO_LAST_ARG)); -#endif -#ifndef YY_NO_POP_STATE -static void yy_pop_state YY_PARAMS(( YY_PROTO_ONLY_ARG )); -#endif -#ifndef YY_NO_TOP_STATE -static int yy_top_state YY_PARAMS(( YY_PROTO_ONLY_ARG )); -#endif - -#else -#define YY_NO_PUSH_STATE 1 -#define YY_NO_POP_STATE 1 -#define YY_NO_TOP_STATE 1 -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ - -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - errno=0; \ - while ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \ - { \ - if( errno != EINTR) \ - { \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - break; \ - } \ - errno=0; \ - clearerr(yyin); \ - } -\ -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg YY_CALL_LAST_ARG) -#endif - - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL - -/* If the bison pure parser is used, then bison will provide - one or two additional arguments. */ - -# if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) -# define YY_LEX_PROTO YY_PARAMS((YYSTYPE * yylvalp, YYLTYPE * yyllocp YY_PROTO_LAST_ARG)) -# define YY_LEX_DECLARATION YYFARGS2(YYSTYPE *,yylvalp, YYLTYPE *,yyllocp) -# else -# define YY_LEX_PROTO YY_PARAMS((YYSTYPE * yylvalp YY_PROTO_LAST_ARG)) -# define YY_LEX_DECLARATION YYFARGS1(YYSTYPE *,yylvalp) -# endif - - - -extern int yylex YY_LEX_PROTO; - -#define YY_DECL int yylex YY_LEX_DECLARATION -#endif - - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP \ - YY_USER_ACTION - - - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ - - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -#line 135 "../../../src/sd/domnode-xml-scanner.l" -#line 719 "domnode-xml-scanner.h" -#ifdef YY_HEADER_EXPORT_START_CONDITIONS -/* Beware! Start conditions are not prefixed. */ -#undef INITIAL -#define INITIAL 0 -#define CONTENT 1 -#endif /* YY_HEADER_EXPORT_START_CONDITIONS */ - -#ifndef YY_HEADER_NO_UNDEFS -/* Undefine all internal macros, etc., that do no belong in the header. */ - -#undef BEGIN -#undef ECHO -#undef EOB_ACT_CONTINUE_SCAN -#undef EOB_ACT_END_OF_FILE -#undef EOB_ACT_LAST_MATCH -#undef FLEX_SCANNER -#undef FLEX_STD -#undef REJECT -#undef YYLMAX -#undef YYSTATE -#undef YY_AT_BOL -#undef YY_BREAK -#undef YY_BUFFER_EOF_PENDING -#undef YY_BUFFER_NEW -#undef YY_BUFFER_NORMAL -#undef YY_BUF_SIZE -#undef YY_CALL_LAST_ARG -#undef YY_CALL_ONLY_ARG -#undef YY_CURRENT_BUFFER -#undef YY_DECL -#undef YY_DECL_LAST_ARG -#undef YY_DO_BEFORE_ACTION -#undef YY_END_OF_BUFFER -#undef YY_END_OF_BUFFER_CHAR -#undef YY_EXIT_FAILURE -#undef YY_EXTRA_TYPE -#undef YY_FATAL_ERROR -#undef YY_FLEX_DEFINED_ECHO -#undef YY_FLEX_LEX_COMPAT -#undef YY_FLEX_MAJOR_VERSION -#undef YY_FLEX_MINOR_VERSION -#undef YY_FLUSH_BUFFER -#undef YY_G -#undef YY_INPUT -#undef YY_INT_ALIGNED -#undef YY_INTERACTIVE -#undef YY_LAST_ARG -#undef YY_LEX_ARGS -#undef YY_MAIN -#undef YY_MORE_ADJ -#undef YY_NEED_STRLEN -#undef YY_NEW_FILE -#undef YY_NO_FLEX_ALLOC -#undef YY_NO_FLEX_REALLOC -#undef YY_NO_FLEX_FREE -#undef YY_NO_GET_DEBUG -#undef YY_NO_GET_EXTRA -#undef YY_NO_GET_IN -#undef YY_NO_GET_LENG -#undef YY_NO_GET_LINENO -#undef YY_NO_GET_LLOC -#undef YY_NO_GET_LVAL -#undef YY_NO_GET_OUT -#undef YY_NO_GET_TEXT -#undef YY_NO_INPUT -#undef YY_NO_POP_STATE -#undef YY_NO_PUSH_STATE -#undef YY_NO_SCAN_BUFFER -#undef YY_NO_SCAN_BYTES -#undef YY_NO_SCAN_STRING -#undef YY_NO_SET_DEBUG -#undef YY_NO_SET_EXTRA -#undef YY_NO_SET_IN -#undef YY_NO_SET_LINENO -#undef YY_NO_SET_LLOC -#undef YY_NO_SET_LVAL -#undef YY_NO_SET_OUT -#undef YY_NO_TOP_STATE -#undef YY_NO_UNISTD_H -#undef YY_NO_UNPUT -#undef YY_NULL -#undef YY_NUM_RULES -#undef YY_ONLY_ARG -#undef YY_PROTO -#undef YY_READ_BUF_SIZE -#undef YY_REENTRANT -#undef YY_BISON_BRIDGE -#undef YY_RESTORE_YY_MORE_OFFSET -#undef YY_RULE_SETUP -#undef YY_SC_TO_UI -#undef YY_SKIP_YYWRAP -#undef YY_STACK_USED -#undef YY_START -#undef YY_START_STACK_INCR -#undef YY_STATE_EOF -#undef YY_STDINIT -#undef YY_TEXT_IS_ARRAY -#undef YY_TRAILING_HEAD_MASK -#undef YY_TRAILING_MASK -#undef YY_USER_ACTION -#undef YY_USES_REJECT -#undef YY_USE_CONST -#undef YY_USE_LINENO -#undef YY_USE_PROTOS -#undef unput -#undef yy_create_buffer -#undef yy_delete_buffer -#undef yy_flex_debug -#undef yy_flush_buffer -#undef yy_init_buffer -#undef yy_load_buffer_state -#undef yy_new_buffer -#undef yy_scan_buffer -#undef yy_scan_bytes -#undef yy_scan_string -#undef yy_set_bol -#undef yy_set_interactive -#undef yy_switch_to_buffer -#undef yyconst -#undef yyextra -#undef yyget_debug -#undef yyset_debug -#undef yyget_extra -#undef yyget_in -#undef yyget_leng -#undef yyget_lineno -#undef yyget_lloc -#undef yyget_lval -#undef yyget_out -#undef yyget_text -#undef yyin -#undef yyleng -#undef yyless -#undef yylex -#undef yylex_destroy -#undef yylex_init -#undef yylineno -#undef yylloc -#undef yylval -#undef yymore -#undef yyout -#undef yyrestart -#undef yyset_extra -#undef yyset_in -#undef yyset_lineno -#undef yyset_lloc -#undef yyset_lval -#undef yyset_out -#undef yyterminate -#undef yytext -#undef yytext_ptr -#undef yywrap -#undef yyalloc -#undef yyrealloc -#undef yyfree -#undef YY_NEVER_INTERACTIVE -#undef YY_NO_UNPUT -#undef YY_TABLES_VERIFY -#endif /* !YY_HEADER_NO_UNDEFS */ - -#undef __sd_domnode_xml_IN_HEADER -#endif /* __sd_domnode_xml_HEADER_H */ diff --git a/import/log4c/sd/domnode-xml.c b/import/log4c/sd/domnode-xml.c deleted file mode 100644 index fa19374..0000000 --- a/import/log4c/sd/domnode-xml.c +++ /dev/null @@ -1,149 +0,0 @@ -static const char version[] = "$Id: domnode-xml.c,v 1.2 2003/09/12 21:06:45 legoater Exp $"; - -/* - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * - * See the COPYING file for the terms of usage and distribution. - */ - -#include - -#ifdef HAVE_LANGINFO_H -# include -#endif - -#include "domnode-xml.h" - -/* Generated by bison(1) */ -#include "domnode-xml-parser.h" - -/* Generated by flex(1) */ -#define YY_HEADER_NO_UNDEFS 1 -#include "domnode-xml-scanner.h" - -extern int __sd_domnode_xml_parse(struct __sd_domnode_xml_maker*); - -/******************************************************************************/ -static int xml_fwrite(const sd_domnode_t* this, FILE* a_stream, int a_indent) -{ - sd_list_iter_t* iter; - int i; - - if (!this || !this->name || !a_stream) - return -1; - - for (i = 0; i < a_indent; i++) - fprintf(a_stream, " "); - - if (this->name && strcmp(this->name, "#comment") == 0) { - fprintf(a_stream, "\n", this->value); - return 0; - } - - fprintf(a_stream, "<%s", this->name); - - for (iter = sd_list_begin(this->attrs); iter != sd_list_end(this->attrs); - iter = sd_list_iter_next(iter)) { - sd_domnode_t* node = iter->data; - - fprintf(a_stream, " %s=\"%s\"", node->name, node->value); - } - - if (this->value || sd_list_get_nelem(this->children)) { - fprintf(a_stream, ">\n"); - - if (this->value) { - for (i = 0; i < a_indent + 1; i++) - fprintf(a_stream, " "); - fprintf(a_stream, "%s\n", this->value); - } - - for (iter = sd_list_begin(this->children); - iter != sd_list_end(this->children); - iter = sd_list_iter_next(iter)) { - sd_domnode_t* node = iter->data; - - if (xml_fwrite(node, a_stream, a_indent + 1) == -1) - return -1; - } - - for (i = 0; i < a_indent; i++) - fprintf(a_stream, " "); - fprintf(a_stream, "\n", this->name); - } else { - fprintf(a_stream, "/>\n"); - } - - return 0; -} - -/******************************************************************************/ -extern int __sd_domnode_xml_write(const sd_domnode_t* this, char** a_buffer, - size_t* a_size) -{ - /* TODO: to be implemented */ - return -1; -} - -/******************************************************************************/ -extern int __sd_domnode_xml_fwrite(const sd_domnode_t* this, FILE* a_stream) -{ -#ifdef HAVE_NL_LANGINFO - fprintf(a_stream, "\n\n", - nl_langinfo(CODESET)); -#else - fprintf(a_stream, "\n\n"); -#endif - - return xml_fwrite(this, a_stream, 0); -} - -/******************************************************************************/ -static int xml_parse(sd_domnode_t** a_node, yyscan_t a_scanner) -{ - int r; - struct __sd_domnode_xml_maker maker; - - maker.scanner = a_scanner; - maker.elements = sd_stack_new(0); - maker.root = 0; - - if (! (r = __sd_domnode_xml_parse(&maker))) *a_node = maker.root; - - sd_stack_delete(maker.elements, 0); - - return r; -} - -/******************************************************************************/ -extern int __sd_domnode_xml_fread(sd_domnode_t** a_node, FILE* a_stream) -{ - int r; - yyscan_t scanner; - - yylex_init(&scanner); - yyset_in(a_stream, scanner); - - r = xml_parse(a_node, scanner); - - yylex_destroy(scanner); - - return r; -} - -/******************************************************************************/ -extern int __sd_domnode_xml_read(sd_domnode_t** a_node, const char* a_buffer, - size_t a_size) -{ - int r; - yyscan_t scanner; - - yylex_init(&scanner); - yy_switch_to_buffer(yy_scan_bytes(a_buffer, a_size, scanner), scanner); - - r = xml_parse(a_node, scanner); - - yylex_destroy(scanner); - - return r; -} diff --git a/import/log4c/sd/domnode-xml.h b/import/log4c/sd/domnode-xml.h deleted file mode 100644 index b308624..0000000 --- a/import/log4c/sd/domnode-xml.h +++ /dev/null @@ -1,33 +0,0 @@ -/* $Id: domnode-xml.h,v 1.2 2003/09/12 21:06:45 legoater Exp $ - * - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * See the COPYING file for the terms of usage and distribution. - */ - -#ifndef __sd_domnode_xml_h -#define __sd_domnode_xml_h - -/** - * @file domnode-xml.h @ingroup sd - * - * @brief Private API for XML parsing. - */ - -#include "domnode.h" -#include "stack.h" - -struct __sd_domnode_xml_maker { - void* scanner; - sd_stack_t* elements; - sd_domnode_t* root; -}; - -extern int __sd_domnode_xml_fread(sd_domnode_t** a_node, FILE* a_stream); -extern int __sd_domnode_xml_fwrite(const sd_domnode_t* a_node, FILE* a_stream); - -extern int __sd_domnode_xml_read(sd_domnode_t** a_node, const char* a_buffer, - size_t a_size); -extern int __sd_domnode_xml_write(const sd_domnode_t* a_node, char** a_buffer, - size_t* a_size); - -#endif diff --git a/import/log4c/sd/domnode.c b/import/log4c/sd/domnode.c deleted file mode 100644 index 10cd927..0000000 --- a/import/log4c/sd/domnode.c +++ /dev/null @@ -1,249 +0,0 @@ -static const char version[] = "$Id: domnode.c,v 1.4 2003/09/12 21:06:45 legoater Exp $"; - -/* - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * - * See the COPYING file for the terms of usage and distribution. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include "malloc.h" -#include "error.h" -#include "domnode.h" - -/* TODO: generic format support */ -#include "domnode-xml.h" - -/******************************************************************************/ -extern sd_domnode_t* __sd_domnode_new(const char* a_name, const char* a_value, - int is_elem) -{ - sd_domnode_t* this; - - this = sd_calloc(1, sizeof(*this)); - - this->name = a_name ? sd_strdup(a_name) : 0; - this->value = a_value ? sd_strdup(a_value): 0; - this->children = is_elem ? sd_list_new(10) : 0; - this->attrs = is_elem ? sd_list_new(10) : 0; - - return this; -} - -/******************************************************************************/ -extern sd_domnode_t* sd_domnode_new(const char* a_name, const char* a_value) -{ - return __sd_domnode_new(a_name, a_value, 1); -} - -/******************************************************************************/ -static int foreach_delete(sd_domnode_t* a_node, void* unused) -{ - sd_domnode_delete(a_node); - return 0; -} - -/******************************************************************************/ -static void domnode_clear(sd_domnode_t* this) -{ - free((void*) this->name); - free((void*) this->value); - - sd_list_foreach(this->children, (sd_list_func_t) foreach_delete, 0); - sd_list_delete(this->children); - - sd_list_foreach(this->attrs, (sd_list_func_t) foreach_delete, 0); - sd_list_delete(this->attrs); -} - -/******************************************************************************/ -extern void sd_domnode_delete(sd_domnode_t* this) -{ - if (!this) - return; - - domnode_clear(this); - free(this); -} - -/******************************************************************************/ -static void domnode_update(sd_domnode_t* this, sd_domnode_t* a_node) -{ - domnode_clear(this); - this->name = a_node->name; - this->value = a_node->value; - this->children = a_node->children; - this->attrs = a_node->attrs; - - /* Destroy this now empty node ! */ - free(a_node); -} - -/******************************************************************************/ -extern int sd_domnode_fread(sd_domnode_t* this, FILE* a_stream) -{ - int ret; - sd_domnode_t* node; - - /* TODO: generic format support */ - if (! (ret = __sd_domnode_xml_fread(&node, a_stream))) - domnode_update(this, node); - - return ret ? -1 : 0; -} - -/******************************************************************************/ -extern int sd_domnode_read(sd_domnode_t* this, const char* a_buffer, - size_t a_size) -{ - int ret; - sd_domnode_t* node; - - /* TODO: generic format support */ - if (! (ret = __sd_domnode_xml_read(&node, a_buffer, a_size))) - domnode_update(this, node); - - return ret ? -1 : 0; -} - -/******************************************************************************/ -extern int sd_domnode_write(sd_domnode_t* this, char** a_buffer, - size_t* a_size) -{ - /* TODO: generic format support */ - return __sd_domnode_xml_write(this, a_buffer, a_size); -} - -/******************************************************************************/ -extern int sd_domnode_fwrite(const sd_domnode_t* this, FILE* a_stream) -{ - /* TODO: generic format support */ - return __sd_domnode_xml_fwrite(this, a_stream); -} - -/******************************************************************************/ -extern int sd_domnode_load(sd_domnode_t* this, const char* a_filename) -{ - FILE* fp; - int ret = 0; - - if ( (fp = fopen(a_filename, "r")) == 0) - return -1; - - ret = sd_domnode_fread(this, fp); - - fclose(fp); - return ret; -} - -/******************************************************************************/ -extern int sd_domnode_store(const sd_domnode_t* this, const char* afilename) -{ - FILE* fp; - int ret = 0; - - if ( (fp = fopen(afilename, "w")) == 0) - return -1; - - ret = sd_domnode_fwrite(this, fp); - - fclose(fp); - return ret; -} - -/******************************************************************************/ -extern sd_domnode_t* sd_domnode_search(const sd_domnode_t* this, - const char* a_name) -{ - sd_list_iter_t* i; - - for (i = sd_list_begin(this->children); i != sd_list_end(this->children); - i = sd_list_iter_next(i)) { - sd_domnode_t* node = i->data; - - if (strcmp(node->name, a_name) == 0) - return node; - } - - for (i = sd_list_begin(this->attrs); i != sd_list_end(this->attrs); - i = sd_list_iter_next(i)) { - sd_domnode_t* node = i->data; - - if (strcmp(node->name, a_name) == 0) - return node; - } - - for (i = sd_list_begin(this->children); i != sd_list_end(this->children); - i = sd_list_iter_next(i)) { - sd_domnode_t* node = i->data; - - if ((node = sd_domnode_search(node, a_name)) != 0) - return node; - } - - return 0; -} - -/******************************************************************************/ -extern sd_domnode_t* sd_domnode_attrs_put(sd_domnode_t* this, - sd_domnode_t* a_attr) -{ - sd_list_iter_t* i; - - if (!this || !this->attrs || !a_attr || !a_attr->value) - return 0; - - if ((i = sd_list_lookadd(this->attrs, a_attr)) == sd_list_end(this->attrs)) - return 0; - - return i->data; -} - -/******************************************************************************/ -extern sd_domnode_t* -sd_domnode_attrs_get(const sd_domnode_t* this, const char* a_name) -{ - sd_list_iter_t* i; - - if (!this || !this->attrs || !a_name || !*a_name) - return 0; - - for (i = sd_list_begin(this->attrs); i != sd_list_end(this->attrs); - i = sd_list_iter_next(i)) { - sd_domnode_t* node = i->data; - - if (strcmp(node->name, a_name) == 0) - return node; - } - - return 0; -} - -/******************************************************************************/ -extern sd_domnode_t* -sd_domnode_attrs_remove(sd_domnode_t* this, const char* a_name) -{ - sd_list_iter_t* i; - - if (!this || !this->attrs || !a_name || !*a_name) - return 0; - - for (i = sd_list_begin(this->attrs); i != sd_list_end(this->attrs); - i = sd_list_iter_next(i)) { - sd_domnode_t* node = i->data; - - if (strcmp(node->name, a_name) == 0) { - sd_list_iter_del(i); - return node; - } - } - - return 0; -} diff --git a/import/log4c/sd/domnode.h b/import/log4c/sd/domnode.h deleted file mode 100644 index 5768916..0000000 --- a/import/log4c/sd/domnode.h +++ /dev/null @@ -1,65 +0,0 @@ -/* $Id: domnode.h,v 1.4 2003/09/12 21:06:45 legoater Exp $ - * - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * See the COPYING file for the terms of usage and distribution. - */ - -#ifndef __sd_domnode_h -#define __sd_domnode_h - -/** - * @file domnode.h @ingroup sd - * - * @brief Generic DOM object. - */ - -#include -#include - -__SD_BEGIN_DECLS - -typedef struct { - const char* name; - const char* value; - sd_list_t* children; - sd_list_t* attrs; -} sd_domnode_t; - -extern sd_domnode_t* sd_domnode_new(const char* a_name, - const char* a_value); - -extern void sd_domnode_delete(sd_domnode_t* this); - -extern int sd_domnode_read(sd_domnode_t* this, - const char* a_buffer, size_t asize); -extern int sd_domnode_write(sd_domnode_t* this, char** a_buffer, - size_t* asize); - -extern int sd_domnode_fread(sd_domnode_t* this, FILE* a_stream); -extern int sd_domnode_fwrite(const sd_domnode_t* this, - FILE* a_stream); - -extern int sd_domnode_load(sd_domnode_t* this, - const char* a_filename); - -extern int sd_domnode_store(const sd_domnode_t* this, - const char* a_filename); - -extern sd_domnode_t* sd_domnode_search(const sd_domnode_t* this, - const char* a_name); - -extern sd_domnode_t* sd_domnode_attrs_put(sd_domnode_t* this, - sd_domnode_t* a_attr); -extern sd_domnode_t* sd_domnode_attrs_get(const sd_domnode_t* this, - const char* a_name); -extern sd_domnode_t* sd_domnode_attrs_remove(sd_domnode_t* this, - const char* a_name); - -/** Creates a new node. */ -extern sd_domnode_t* __sd_domnode_new(const char* name, const char* a_value, - int is_elem); - -__SD_END_DECLS - -#endif - diff --git a/import/log4c/sd/error.c b/import/log4c/sd/error.c deleted file mode 100644 index 737fdcd..0000000 --- a/import/log4c/sd/error.c +++ /dev/null @@ -1,66 +0,0 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#include - - -#include -#include -#include -#include - -/* - These function provide replacements for the analogous functions - on platforms/compilers where a variable number of arguments are not supported - such as windows/msvc6 for example. - - See error.h for the preprocessor logic as to whether these get used or not. - -*/ - -int sd_debug_fn(const char *a_format,...){ - - va_list va_args; - int rc = 0; -#ifdef __SD_DEBUG__ - char format_buf[2048]; - - snprintf(format_buf, sizeof(format_buf), - "[DEBUG] %s \n", a_format); - - if ( getenv("SD_DEBUG") ){ - rc = vfprintf(stderr, format_buf, va_args ); - } -#endif - return rc; -} - -int sd_error_fn(const char *a_format,... ){ - - va_list va_args; - int rc = 0; -#ifdef __SD_DEBUG__ - char format_buf[2048]; - - snprintf(format_buf, sizeof(format_buf), - "[ERROR] %s \n", a_format); - - if ( getenv("SD_ERROR") ){ - vfprintf(stderr, format_buf, va_args ); - } -#endif - - return rc; -} - -void sd_oserror_fn(const char *a_func, const char *a_param){ - int rc = 0; - -#ifdef __SD_DEBUG__ - if ( getenv("SD_ERROR") ){ - sd_error("%s(%s): #%d %s", a_func, a_param, errno, strerror(errno)); - } -#endif - - return rc; -} diff --git a/import/log4c/sd/error.h b/import/log4c/sd/error.h deleted file mode 100644 index c09ad63..0000000 --- a/import/log4c/sd/error.h +++ /dev/null @@ -1,50 +0,0 @@ -/* $Id: error.h,v 1.5 2005/12/15 22:05:09 rbyrne Exp $ - * - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * See the COPYING file for the terms of usage and distribution. - */ - -#ifndef __sd_error_h -#define __sd_error_h - -#include -#include -#include - -#ifndef _WIN32 -#ifdef __SD_DEBUG__ - -# define sd_debug(a_format, ...) \ - (getenv("SD_DEBUG") ? fprintf(stderr, "[DEBUG] %s() at %s:%d "a_format"\n", __FUNCTION__, __FILE__, __LINE__, ##__VA_ARGS__ ) : 0) -# define sd_error(a_format, ...) \ - (getenv("SD_ERROR") ? fprintf(stderr, "[ERROR] %s() at %s:%d "a_format"\n", __FUNCTION__, __FILE__, __LINE__, ##__VA_ARGS__ ) : 0) -# define sd_oserror(afunc, aparam) \ - (sd_error("%s(%s): #%d %s", afunc, aparam, errno, strerror(errno)), -1) - -#else - -# define sd_debug(...) -# define sd_error(...) -# define sd_oserror(...) -1 - -#endif /* __SD_DEBUG__ */ - -#else - -/* On windows the functions are always there, but the body will be - null. All because no variable arg macros. - Could go for the define sd_debug to always take 5 args for example.... - but implies extensive code changes. - -*/ - -# define sd_debug sd_debug_fn -# define sd_error sd_error_fn -# define sd_oserror sd_oserror_fn - -#endif - -/* backward compatibility */ -#define os_error sd_oserror - -#endif /* __sd_error_h */ diff --git a/import/log4c/sd/factory.c b/import/log4c/sd/factory.c deleted file mode 100644 index 4ccccee..0000000 --- a/import/log4c/sd/factory.c +++ /dev/null @@ -1,131 +0,0 @@ -static const char version[] = "$Id: factory.c,v 1.5 2005/12/15 19:39:52 legoater Exp $"; - -/* - * factory.c - * - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * See the COPYING file for the terms of usage and distribution. - */ - -#include -#include -#include -#include -#include - -struct __sd_factory -{ - char* fac_name; - const sd_factory_ops_t* fac_ops; - sd_hash_t* fac_hash; -}; - -/* FIXME: unsafe hand made polymorphism ... */ -typedef struct { - char* pr_name; -} sd_factory_product_t; - -/*******************************************************************************/ -extern sd_factory_t* sd_factory_new(const char* a_name, - const sd_factory_ops_t* a_ops) -{ - sd_factory_t* this; - - if (!a_name || !a_ops) - return NULL; - - this = sd_calloc(1, sizeof(*this)); - this->fac_name = sd_strdup(a_name); - this->fac_ops = a_ops; - this->fac_hash = sd_hash_new(20, NULL); - return this; -} - -/*******************************************************************************/ -extern void sd_factory_delete(sd_factory_t* this) -{ - sd_hash_iter_t* i; - - if (!this) - return; - - if (this->fac_ops->fac_delete) - for (i = sd_hash_begin(this->fac_hash); i != sd_hash_end(this->fac_hash); - i = sd_hash_iter_next(i)) - this->fac_ops->fac_delete(i->data); - - sd_hash_delete(this->fac_hash); - free(this->fac_name); - free(this); -} - -/*******************************************************************************/ -extern void* sd_factory_get(sd_factory_t* this, const char* a_name) -{ - sd_hash_iter_t* i; - sd_factory_product_t* pr; - - if ( (i = sd_hash_lookup(this->fac_hash, a_name)) != NULL) { - return i->data; - } - if (!this->fac_ops->fac_new) { - return NULL; - } - if ( (pr = this->fac_ops->fac_new(a_name)) == NULL) { - return NULL; - } - - sd_hash_add(this->fac_hash, pr->pr_name, pr); - return pr; -} - -/*******************************************************************************/ -extern void sd_factory_destroy(sd_factory_t* this, void* a_pr) -{ - sd_factory_product_t* pr = (sd_factory_product_t*) a_pr; - - sd_hash_del(this->fac_hash, pr->pr_name); - if (this->fac_ops->fac_delete) - this->fac_ops->fac_delete(pr); -} - -/*******************************************************************************/ -extern void sd_factory_print(const sd_factory_t* this, FILE* a_stream) -{ - sd_hash_iter_t* i; - - if (!this) - return; - - if (!this->fac_ops->fac_print) - return; - - fprintf(a_stream, "factory[%s]:\n", this->fac_name); - for (i = sd_hash_begin(this->fac_hash); i != sd_hash_end(this->fac_hash); - i = sd_hash_iter_next(i)) - { - this->fac_ops->fac_print(i->data, a_stream); - fprintf(a_stream, "\n"); - } -} - -/******************************************************************************/ -extern int sd_factory_list(const sd_factory_t* this, void** a_items, - int a_nitems) -{ - sd_hash_iter_t* i; - int j; - - if (!this || !a_items || a_items <= 0) - return -1; - - for (i = sd_hash_begin(this->fac_hash), j = 0; - i != sd_hash_end(this->fac_hash); - i = sd_hash_iter_next(i), j++) - { - if (j < a_nitems) - a_items[j] = i->data; - } - - return j; -} diff --git a/import/log4c/sd/factory.h b/import/log4c/sd/factory.h deleted file mode 100644 index d043b8a..0000000 --- a/import/log4c/sd/factory.h +++ /dev/null @@ -1,43 +0,0 @@ -/* $Id: factory.h,v 1.4 2005/12/15 19:39:52 legoater Exp $ - * - * factory.h - * - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * See the COPYING file for the terms of usage and distribution. - */ - -#ifndef __sd_factory_h -#define __sd_factory_h - -/** - * @file factory.h - */ - -#include -#include - -__SD_BEGIN_DECLS - -struct __sd_factory; -typedef struct __sd_factory sd_factory_t; - -struct __sd_factory_ops -{ - void* (*fac_new) (const char*); - void (*fac_delete) (void*); - void (*fac_print) (void*, FILE*); -}; -typedef struct __sd_factory_ops sd_factory_ops_t; - -extern sd_factory_t* sd_factory_new(const char* a_name, - const sd_factory_ops_t* a_ops); -extern void sd_factory_delete(sd_factory_t* a_this); -extern void* sd_factory_get(sd_factory_t* a_this, const char* a_name); -extern void sd_factory_destroy(sd_factory_t* a_this, void* a_pr); -extern void sd_factory_print(const sd_factory_t* a_this, FILE* a_stream); -extern int sd_factory_list(const sd_factory_t* a_this, void** a_items, - int a_nitems); - -__SD_END_DECLS - -#endif diff --git a/import/log4c/sd/hash.c b/import/log4c/sd/hash.c deleted file mode 100644 index 731282d..0000000 --- a/import/log4c/sd/hash.c +++ /dev/null @@ -1,331 +0,0 @@ -static const char version[] = "$Id: hash.c,v 1.4 2005/05/24 15:33:18 legoater Exp $"; - -/* - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * - * See the COPYING file for the terms of usage and distribution. - */ - -#include -#include -#include -#include -#include - -#define SD_HASH_FULLTAB 2 /* rehash when table gets this x full */ -#define SD_HASH_GROWTAB 4 /* grow table by this factor */ -#define SD_HASH_DEFAULT_SIZE 10 /* self explenatory */ - -struct __sd_hash { - size_t nelem; - size_t size; - sd_hash_iter_t** tab; - const sd_hash_ops_t* ops; -}; - -#define hindex(h, n) ((h)%(n)) - -/******************************************************************************/ -static void rehash(sd_hash_t* a_this) -{ - int i, h, size; - sd_hash_iter_t** tab; - sd_hash_iter_t* p; - sd_hash_iter_t* q; - - size = SD_HASH_GROWTAB * a_this->size; - tab = sd_calloc(size, sizeof(*tab)); - - if (tab == 0) return; - - for (i = 0; i < a_this->size; i++) { - for (p = a_this->tab[i]; p; p = q) { - q = p->__next; - h = hindex(p->__hkey, - size); - p->__next = tab[h]; - tab[h] = p; - if (p->__next != 0) p->__next->__prev = p; - p->__prev = 0; - } - } - free(a_this->tab); - - a_this->tab = tab; - a_this->size = size; -} - -/******************************************************************************/ -extern sd_hash_t* sd_hash_new(size_t a_size, const sd_hash_ops_t* a_ops) -{ - const static sd_hash_ops_t default_ops = { - (void*) &sd_hash_hash_string, - (void*) &strcmp, - 0, 0, 0, 0 - }; - - sd_hash_t* hash; - sd_hash_iter_t** tab; - - if (a_size == 0) a_size = SD_HASH_DEFAULT_SIZE; - - hash = sd_calloc(1, sizeof(*hash)); - tab = sd_calloc(a_size, sizeof(*tab)); - - if (hash == 0 || tab == 0) { - free(hash); - free(tab); - return 0; - } - - hash->nelem = 0; - hash->size = a_size; - hash->tab = tab; - hash->ops = a_ops != 0 ? a_ops : &default_ops; - - return hash; -} - -/******************************************************************************/ -extern sd_hash_iter_t* sd_hash_lookup(sd_hash_t* a_this, const void* a_key) -{ - int h; - sd_hash_iter_t* p; - - if (a_this == 0 || a_key == 0) return 0; - - h = hindex(a_this->ops->hash(a_key), a_this->size); - for (p = a_this->tab[h]; p != 0; p = p->__next) - if (a_this->ops->compare(a_key, p->key) == 0) { - return p; - } - - return 0; -} - -/******************************************************************************/ -extern sd_hash_iter_t* sd_hash_lookadd(sd_hash_t* a_this, const void* a_key) -{ - int h; - sd_hash_iter_t* p; - - if (a_this == 0 || a_key == 0) return 0; - if ((p = sd_hash_lookup(a_this, a_key)) != 0) return p; - if ((p = sd_calloc(1, sizeof(*p))) == 0) return 0; - - if (a_this->ops->key_dup != 0) - p->key = a_this->ops->key_dup(a_key); - else - p->key = (void*) a_key; - - p->hash = a_this; - p->__hkey = a_this->ops->hash(a_key); - - if (a_this->nelem > SD_HASH_FULLTAB * a_this->size) rehash(a_this); - - h = hindex(p->__hkey, - a_this->size); - p->__next = a_this->tab[h]; - a_this->tab[h] = p; - if (p->__next != 0) p->__next->__prev = p; - - a_this->nelem++; - - return p; -} - -/******************************************************************************/ -extern sd_hash_iter_t* sd_hash_add(sd_hash_t* a_this, const void* a_key, - void* a_data) -{ - sd_hash_iter_t* p; - - if ((p = sd_hash_lookadd(a_this, a_key)) == 0) return 0; - - if (a_this->ops->data_free != 0) a_this->ops->data_free(p->data); - - if (a_this->ops->data_dup != 0) - p->data = a_this->ops->data_dup(a_data); - else - p->data = a_data; - - return p; -} - -/******************************************************************************/ -extern void sd_hash_delete(sd_hash_t* a_this) -{ - sd_hash_clear(a_this); - free(a_this->tab); - free(a_this); -} - -/******************************************************************************/ -extern void sd_hash_clear(sd_hash_t* a_this) -{ - int h; - sd_hash_iter_t* p; - sd_hash_iter_t* q; - - if (a_this == 0) return; - - for (h = 0; h < a_this->size; h++) { - for (p = a_this->tab[h]; p; p = q) { - q = p->__next; - if (a_this->ops->key_free) a_this->ops->key_free(p->key); - if (a_this->ops->data_free) a_this->ops->data_free(p->data); - free(p); - } - a_this->tab[h] = 0; - } - a_this->nelem = 0; -} - -/******************************************************************************/ -extern void sd_hash_del(sd_hash_t* a_this, const void* a_key) -{ - int h; - sd_hash_iter_t* p; - - h = hindex(a_this->ops->hash(a_key), a_this->size); - for (p = a_this->tab[h]; p != 0; p = p->__next) - if (a_this->ops->compare(a_key, p->key) == 0) break; - if (p == 0) return; - - sd_hash_iter_del(p); -} - -/******************************************************************************/ -extern void sd_hash_foreach(sd_hash_t* a_this, sd_hash_func_t a_func, - void* a_data) -{ - int h, ret; - sd_hash_iter_t* p; - sd_hash_iter_t* q; - - if (a_this == 0 || a_func == 0) return; - - for (h = 0; h < a_this->size; h++) - for (p = a_this->tab[h]; p != 0; p = q) { - p->__foreach = 1; - ret = (*a_func)(p->key, p->data, a_data); - q = p->__next; - - if (p->__foreach == 0) - sd_hash_iter_del(p); - else - p->__foreach = 0; - - if (ret != 0) return; - } -} - -/******************************************************************************/ -extern unsigned int sd_hash_get_nelem(sd_hash_t* a_this) -{ - if (a_this == 0) return 0; - return a_this->nelem; -} - -/******************************************************************************/ -extern unsigned int sd_hash_get_size(sd_hash_t* a_this) -{ - if (a_this == 0) return 0; - return a_this->size; -} - -/******************************************************************************/ -extern sd_hash_iter_t* sd_hash_begin(sd_hash_t* a_this) -{ - int h; - - if (a_this == 0) return 0; - for (h = 0; h < a_this->size; h++) - if (a_this->tab[h]) - return a_this->tab[h]; - - return 0; -} - -/******************************************************************************/ -extern sd_hash_iter_t* sd_hash_end(sd_hash_t* a_this) -{ - return 0; -} - -/******************************************************************************/ -extern sd_hash_iter_t* sd_hash_iter_next(sd_hash_iter_t* a_this) -{ - int h, i; - - if (a_this == 0) return 0; - if (a_this->__next != 0) return a_this->__next; - - h = hindex(a_this->__hkey, a_this->hash->size); - - for (i = h + 1; i < a_this->hash->size; i++) - if (a_this->hash->tab[i]) - return a_this->hash->tab[i]; - - return 0; -} - -/******************************************************************************/ -extern sd_hash_iter_t* sd_hash_iter_prev(sd_hash_iter_t* a_this) -{ - int h, i; - sd_hash_iter_t* p; - - if (a_this == 0) return 0; - if (a_this->__prev != 0) return a_this->__prev; - - h = hindex(a_this->__hkey, a_this->hash->size); - - for (i = h - 1; i > 0; i--) - for (p = a_this->hash->tab[i]; p; p = p->__next) - if (p->__next == 0) - return p; - - return 0; -} - -/******************************************************************************/ -extern void sd_hash_iter_del(sd_hash_iter_t* a_this) -{ - if (a_this == 0) return; - - if (a_this->hash->ops->data_free != 0) - a_this->hash->ops->data_free(a_this->data); - a_this->data = 0; - - if (a_this->hash->ops->key_free != 0) - a_this->hash->ops->key_free(a_this->key); - a_this->key = 0; - - if (a_this->__foreach == 1) { - a_this->__foreach = 0; - return; - } - - if (a_this->__next != 0) a_this->__next->__prev = a_this->__prev; - if (a_this->__prev != 0) - a_this->__prev->__next = a_this->__next; - else - a_this->hash->tab[hindex(a_this->__hkey, a_this->hash->size)] = - a_this->__next; - - a_this->hash->nelem--; - - free(a_this); -} - -/******************************************************************************/ -extern unsigned int sd_hash_hash_string(const char* a_string) -{ - register unsigned int h; - - for (h = 0; *a_string != '\0'; a_string++) - h = *a_string + 31 * h; - - return h; -} diff --git a/import/log4c/sd/hash.h b/import/log4c/sd/hash.h deleted file mode 100644 index 123bc02..0000000 --- a/import/log4c/sd/hash.h +++ /dev/null @@ -1,166 +0,0 @@ -/* $Id: hash.h,v 1.4 2005/05/24 15:33:18 legoater Exp $ - * - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * Author: Marc Vertes - * See the COPYING file for the terms of usage and distribution. - */ - -#ifndef __sd_hash_h -#define __sd_hash_h - -/** - * @file hash.h - * - * @brief Generic hash table. It is implemented as an array of doubly-linked - * lists of iterators. The index within the array is computed by a efficient - * hash function. - */ - -#include -#include - -__SD_BEGIN_DECLS - -struct __sd_hash_ops { - unsigned int (*hash) (const void*); - int (*compare) (const void*, const void*); - void* (*key_dup) (const void*); - void (*key_free) (void*); - void* (*data_dup) (const void*); - void (*data_free) (void*); -}; - -/** - * This structure holds hash table operations. - */ -typedef struct __sd_hash_ops sd_hash_ops_t; - -/** - * This is the hash table. - */ -typedef struct __sd_hash sd_hash_t; - -struct __sd_hash_iter { - void* key; - void* data; - struct __sd_hash* hash; - unsigned int __hkey; - struct __sd_hash_iter* __next; - struct __sd_hash_iter* __prev; - int __foreach; -}; - -/** - * This is the elementary container for storing data into the hash table. - */ -typedef struct __sd_hash_iter sd_hash_iter_t; - -/** - * Signature of a "foreach" function. - */ -typedef unsigned int (*sd_hash_func_t)(void* a_key, void* a_data, - void* a_userdata); - -/** - * Creates a new hash table. One can customize the memory (de)allocation - * policy for keys and data stored in the hash table. - * @param a_size the initial size of the array. - * @param a_ops the hash operations. If NULL, then string keys are assumed and - * no memory (de)allocation is performed for keys and data. - * @return a dynamicaly allocated hash table. - */ -extern sd_hash_t* sd_hash_new(size_t a_size, const sd_hash_ops_t* a_ops); - -/** - * Destroys the hash table. - */ -extern void sd_hash_delete(sd_hash_t* a_this); - -/** - * clears the hash table. - */ -extern void sd_hash_clear(sd_hash_t* a_this); - -/** - * Looks for the iterator associated to the given key in the hash table. - * @param a_key the key associated to the iterator. - * @return a pointer to the found iterator or NULL. - */ -extern sd_hash_iter_t* sd_hash_lookup(sd_hash_t* a_this, const void* a_key); - -/** - * Looks for the iterator associated to the given key in the hash table and - * creates it if doesn't exist. - * @param a_key the key associated to the iterator. - * @return a pointer to the found iterator or NULL. - */ -extern sd_hash_iter_t* sd_hash_lookadd(sd_hash_t* a_this, const void* a_key); - -/** - * Adds data associated with the given key into the hash table. If the - * key already exists, the old iterator is freed according to the memory - * management operations passed to sd_hash_new(). - * @param a_key the key associated to the iterator. - * @return a pointer to the created or found iterator. - */ -extern sd_hash_iter_t* sd_hash_add(sd_hash_t* a_this, const void* a_key, - void* a_data); - -/** - * Removes an iterator from the hash table. - * @param a_key the key associated to the iterator. - */ -extern void sd_hash_del(sd_hash_t* a_this, const void* a_key); - -/** - * Calls \a a_func for each element of the hash table, as long as \a a_func - * returns 0. - * @param a_func the "foreach" function. - * @param a_data the user data passed to \a a_func. - */ -extern void sd_hash_foreach(sd_hash_t* a_this, sd_hash_func_t a_func, - void* a_data); - -/** - * Gets the number of iterators. - */ -extern unsigned int sd_hash_get_nelem(sd_hash_t* a_this); - -/** - * Gets the size of the array. - */ -extern unsigned int sd_hash_get_size(sd_hash_t* a_this); - -/** - * Gets the first iterator. - */ -extern sd_hash_iter_t* sd_hash_begin(sd_hash_t* a_this); - -/** - * Gets the last iterator. - */ -extern sd_hash_iter_t* sd_hash_end(sd_hash_t* a_this); - -/** - * Gets a pointer to the next iterator. - */ -extern sd_hash_iter_t* sd_hash_iter_next(sd_hash_iter_t* a_this); - -/** - * Gets a pointer to the previous iterator. - */ -extern sd_hash_iter_t* sd_hash_iter_prev(sd_hash_iter_t* a_this); - -/** - * Gets a pointer to the previous iterator. - */ -extern void sd_hash_iter_del(sd_hash_iter_t* a_this); - -/** - * Hashes strings. - */ -extern unsigned int sd_hash_hash_string(const char* a_string); - -__SD_END_DECLS - -#endif diff --git a/import/log4c/sd/list.c b/import/log4c/sd/list.c deleted file mode 100644 index a3d841a..0000000 --- a/import/log4c/sd/list.c +++ /dev/null @@ -1,332 +0,0 @@ -static const char version[] = "$Id: list.c,v 1.4 2005/05/24 15:22:20 legoater Exp $"; - -/* - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * - * See the COPYING file for the terms of usage and distribution. - */ - -#include -#include -#include - -struct __sd_list { - sd_list_iter_t* head; - sd_list_iter_t* tail; - size_t nelem; -}; - -/******************************************************************************/ -extern sd_list_t* sd_list_new(size_t a_capacity) -{ - sd_list_t* this; - - this = sd_calloc(1, sizeof(sd_list_t)); - this->head = 0; - this->tail = 0; - this->nelem = 0; - return this; -} - -/******************************************************************************/ -extern void sd_list_delete(sd_list_t* a_this) -{ - free(a_this); -} - -/******************************************************************************/ -extern void sd_list_clear(sd_list_t* a_this) -{ - a_this->head = 0; - a_this->tail = 0; - a_this->nelem = 0; -} - -/******************************************************************************/ -extern size_t sd_list_get_nelem(sd_list_t* a_this) -{ - return (a_this ? a_this->nelem : 0); -} - -/******************************************************************************/ -extern sd_list_iter_t* sd_list_begin(sd_list_t* a_this) -{ - return (a_this ? a_this->head : 0); -} - -/******************************************************************************/ -extern sd_list_iter_t* sd_list_end(sd_list_t* a_this) -{ - return 0; -} - -/******************************************************************************/ -extern sd_list_iter_t* sd_list_rbegin(sd_list_t* a_this) -{ - return (a_this ? a_this->tail : 0); -} - -/******************************************************************************/ -extern sd_list_iter_t* sd_list_rend(sd_list_t* a_this) -{ - return 0; -} - -/******************************************************************************/ -extern sd_list_iter_t* sd_list_lookup(sd_list_t* a_this, void* a_data) -{ - sd_list_iter_t* i; - - if (! a_this) return 0; - - for (i = a_this->head; i; i = i->__next) - if (a_data == i->data) - return i; - - return 0; -} - -/******************************************************************************/ -extern sd_list_iter_t* sd_list_lookadd(sd_list_t* a_this, void* a_data) -{ - sd_list_iter_t* i; - - if (! a_this) return 0; - - if ((i = sd_list_lookup(a_this, a_data)) != 0) - return i; - - return sd_list_add(a_this, a_data); -} - -/******************************************************************************/ -extern sd_list_iter_t* sd_list_add(sd_list_t* a_this, void* a_data) -{ - sd_list_iter_t* i; - - if (! a_this) return 0; - - - if ((i = sd_calloc(1, sizeof(*i))) == 0) - return 0; - - i->data = a_data; - i->list = a_this; - i->__next = a_this->head; - i->__prev = 0; - a_this->head = i; - - if (i->__next) i->__next->__prev = i; - if (!a_this->tail) a_this->tail = i; - - a_this->nelem++; - - return i; -} - -/******************************************************************************/ -extern sd_list_iter_t* sd_list_sortadd(sd_list_t* a_this, - sd_list_func_t a_func, void* a_data) -{ - sd_list_iter_t* i; - - if (! a_this || ! a_func) return 0; - - for (i = a_this->head; i; i = i->__next) - if ((*a_func)(i->data, a_data) > 0) - break; - - if (i) - return sd_list_iter_insert(i, a_data); - else - return sd_list_append(a_this, a_data); -} - -/******************************************************************************/ -extern int sd_list_del(sd_list_t* a_this, void* a_data) -{ - sd_list_iter_t* i; - - if (!a_this) - return -1; - - for (i = a_this->head; i; i = i->__next) - if (a_data == i->data) - break; - - if (!i) - return -1; - - sd_list_iter_del(i); - return 0; -} - -/******************************************************************************/ -extern void sd_list_foreach(sd_list_t* a_this, sd_list_func_t a_func, - void* a_userdata) -{ - sd_list_iter_t* i; - sd_list_iter_t* j; - - if (!a_this || !a_func) - return; - - for (i = a_this->head; i; i = j) { - int ret; - - i->__foreach = 1; - ret = (*a_func)(i->data, a_userdata); - j = i->__next; - - if (i->__foreach == 0) - sd_list_iter_del(i); - else - i->__foreach = 0; - - if (ret) return; - } -} - -/******************************************************************************/ -extern void sd_list_rforeach(sd_list_t* a_this, sd_list_func_t a_func, - void* a_userdata) -{ - sd_list_iter_t* i; - sd_list_iter_t* j; - - if (!a_this || !a_func) - return; - - for (i = a_this->tail; i; i = j) { - int ret; - - i->__foreach = 1; - ret = (*a_func)(i->data, a_userdata); - j = i->__prev; - - if (i->__foreach == 0) - sd_list_iter_del(i); - else - i->__foreach = 0; - - if (ret) return; - } -} - -/******************************************************************************/ -extern sd_list_iter_t* sd_list_iter_next(sd_list_iter_t* a_this) -{ - return (a_this ? a_this->__next : 0); -} - -/******************************************************************************/ -extern sd_list_iter_t* sd_list_iter_prev(sd_list_iter_t* a_this) -{ - return (a_this ? a_this->__prev : 0); -} - -/******************************************************************************/ -extern void sd_list_iter_del(sd_list_iter_t* a_this) -{ - if (!a_this) - return; - - if (a_this->__foreach == 1) { - a_this->__foreach = 0; - return; - } - - if (a_this->__next) - a_this->__next->__prev = a_this->__prev; - else - a_this->list->tail = a_this->__prev; - - if (a_this->__prev) - a_this->__prev->__next = a_this->__next; - else - a_this->list->head = a_this->__next; - - a_this->list->nelem--; - - free(a_this); -} - -/******************************************************************************/ -extern sd_list_iter_t* sd_list_iter_insert(sd_list_iter_t* a_this, - void* a_data) -{ - sd_list_iter_t* i; - - if (! a_this) return 0; - - if (a_this->list->head == a_this) - return sd_list_prepend(a_this->list, a_data); - - if ((i = sd_calloc(1, sizeof(*i))) == 0) - return 0; - - i->data = a_data; - i->list = a_this->list; - i->__prev = a_this->__prev; - i->__next = a_this; - - /* CAUTION: always exists since a_this is not the head */ - a_this->__prev->__next = i; - a_this->__prev = i; - - a_this->list->nelem++; - - return i; -} - -/******************************************************************************/ -extern sd_list_iter_t* sd_list_prepend(sd_list_t* a_this, void* a_data) -{ - sd_list_iter_t* i; - - if (! a_this) return 0; - - if ((i = sd_calloc(1, sizeof(*i))) == 0) - return 0; - - i->list = a_this; - i->data = a_data; - i->__prev = 0; - i->__next = a_this->head; - a_this->head = i; - - if (i->__next) - i->__next->__prev = i; - else - a_this->tail = i; - - a_this->nelem++; - - return i; -} - -/******************************************************************************/ -extern sd_list_iter_t* sd_list_append(sd_list_t* a_this, void* a_data) -{ - sd_list_iter_t* i; - - if (! a_this) return 0; - - if ((i = sd_calloc(1, sizeof(*i))) == 0) - return 0; - - i->list = a_this; - i->data = a_data; - i->__prev = a_this->tail; - i->__next = 0; - a_this->tail = i; - - if (i->__prev) - i->__prev->__next = i; - else - a_this->head = i; - - a_this->nelem++; - - return i; -} diff --git a/import/log4c/sd/list.h b/import/log4c/sd/list.h deleted file mode 100644 index c6af606..0000000 --- a/import/log4c/sd/list.h +++ /dev/null @@ -1,190 +0,0 @@ -/* $Id: list.h,v 1.3 2003/09/12 21:06:45 legoater Exp $ - * - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * - * See the COPYING file for the terms of usage and distribution. - */ - -#ifndef __sd_list_h -#define __sd_list_h - -/** - * @file list.h @ingroup sd - * - * @brief Generic list object. It is implemented as an array of doubly-linked - * lists of iterators. The index within the array is computed by a efficient - * list function. - */ - -#include -#include - -__SD_BEGIN_DECLS - -/** - * This is the list object. - */ -typedef struct __sd_list sd_list_t; - -struct __sd_list_iter { - void* data; - struct __sd_list* list; - struct __sd_list_iter* __next; - struct __sd_list_iter* __prev; - int __foreach; -}; - -/** - * This is the elementary container for storing data into the list object. - */ -typedef struct __sd_list_iter sd_list_iter_t; - -/** - * Signature of a "foreach" function. - */ -typedef unsigned int (*sd_list_func_t)(void* a_data, void* a_userdata); - -/** - * Creates a list. - * @param a_capacity initial number of preallocated iterators - * @return the list object. - */ -extern sd_list_t* sd_list_new(size_t a_capacity); - -/** - * Destroys the list object. - * @todo need a function parameter to destroy list elements. - */ -extern void sd_list_delete(sd_list_t* a_this); - -/** - * Adds the given_data at the head of the list. - */ -extern sd_list_iter_t* sd_list_prepend(sd_list_t* a_this, void* a_data); - -/** - * Adds the given data at the tail of the list. - */ -extern sd_list_iter_t* sd_list_append(sd_list_t* a_this, void* a_data); - -/** - * Looks for the iterator associated to the given data in the list object. - * @param a_data the data to find - * @return a pointer to the found iterator or NULL. - */ -extern sd_list_iter_t* sd_list_lookup(sd_list_t* a_this, void* a_data); - -/** - * Looks for the iterator associated to the given data in the list object and - * creates it if doesn't exist, using @c sd_list_add(). - * @param a_data the data to find/add - * @return a pointer to the found iterator or NULL. - */ -extern sd_list_iter_t* sd_list_lookadd(sd_list_t* a_this, void* a_data); - -/** - * Adds the given data into the list object. If the data already exists, - * the associated iterator is returned. - * @warning the element is added at the begining of the list. - * @param a_data the data to add - * @return a pointer to the created or found iterator. - */ -extern sd_list_iter_t* sd_list_add(sd_list_t* a_this, void* a_data); - -/** - * Applies the given function to all list elements, starting from the - * first one. As soon as the function returns a non-null value, the - * given data is inserted in the list (before the element). - * @param a_func the "sort" function. - * @param a_data the data to add - * @return a pointer to the created iterator. - */ -extern sd_list_iter_t* sd_list_sortadd(sd_list_t* a_this, - sd_list_func_t a_func, - void* a_data); - -/** - * Removes an iterator from the list object. - * @param a_data the data associated to the iterator. - */ -extern int sd_list_del(sd_list_t* a_this, void* a_data); - -/** - * clears the list object. - */ -extern void sd_list_clear(sd_list_t* a_this); - -/** - * Calls \a a_func for each element of the list object, as long as \a a_func - * returns 0. - * @param a_func the "foreach" function. - * @param a_data the user data passed to \a a_func. - */ -extern void sd_list_foreach(sd_list_t* a_this, sd_list_func_t a_func, - void* a_userdata); - -/** - * Calls \a a_func for each element of the list object, as long as \a a_func - * returns 0. - * Same as sd_list_foreach but from tail to head of list. - * @param a_func the "foreach" function. - * @param a_data the user data passed to \a a_func. - */ -extern void sd_list_rforeach(sd_list_t* a_this, sd_list_func_t a_func, - void* a_userdata); - -/** - * Gets the number of iterators. - */ -extern size_t sd_list_get_nelem(sd_list_t* a_this); - -/** - * Gets the iterator pointing to the first element of the list. - */ -extern sd_list_iter_t* sd_list_begin(sd_list_t* a_this); - -/** - * Gets the past-the-last-element iterator of the list. - */ -extern sd_list_iter_t* sd_list_end(sd_list_t* a_this); - -/** - * Gets the iterator pointing to the last element of the list. - */ -extern sd_list_iter_t* sd_list_rbegin(sd_list_t* a_this); - -/** - * Gets the before-the-first-element iterator of the list. - */ -extern sd_list_iter_t* sd_list_rend(sd_list_t* a_this); - -/** - * Gets a pointer to the next iterator. - */ -extern sd_list_iter_t* sd_list_iter_next(sd_list_iter_t* a_this); - -/** - * Gets a pointer to the previous iterator. - */ -extern sd_list_iter_t* sd_list_iter_prev(sd_list_iter_t* a_this); - -/** - * Deletes the iterator from the list. - */ -extern void sd_list_iter_del(sd_list_iter_t* a_this); - -/** - * Deletes the iterator from the list. - */ -extern void sd_list_iter_del(sd_list_iter_t* a_this); - -/** - * Creates a new iterator and inserts it before @a a_this. - * @param a_data the data associated to the iterator. - */ -extern sd_list_iter_t* sd_list_iter_insert(sd_list_iter_t* a_this, - void* a_data); - -__SD_END_DECLS - -#endif diff --git a/import/log4c/sd/malloc.c b/import/log4c/sd/malloc.c deleted file mode 100644 index 4a1cde5..0000000 --- a/import/log4c/sd/malloc.c +++ /dev/null @@ -1,138 +0,0 @@ -/* xmalloc.c -- malloc with out of memory checking - Copyright (C) 1990,91,92,93,94,95,96,97 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C 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. - - The GNU C 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 the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#include - -#ifdef HAVE_UNISTD_H -#include -#endif - -#include -#include -#include - -#if defined(__APPLE__) -# include -# include -# define environ (*_NSGetEnviron()) -#endif /* __APPLE__ */ - -typedef void (*sd_malloc_handler_t)(); - -static char* first_break = NULL; -static sd_malloc_handler_t handler = NULL; - -static void * -fixup_null_alloc (n) - size_t n; -{ - void* p = 0; - -#ifdef HAVE_SBRK - if (n == 0) - p = malloc ((size_t) 1); - - if (p == 0) { - extern char **environ; - size_t allocated; - - if (first_break != NULL) - allocated = (char *) sbrk (0) - first_break; - else - allocated = (char *) sbrk (0) - (char *) &environ; - sd_error("\nCannot allocate %lu bytes after allocating %lu bytes\n", - (unsigned long) n, (unsigned long) allocated); - - if (handler) - handler(); - else { - sd_error("\n\tMemory exhausted !! Aborting.\n"); - abort(); - } - } -#endif - return p; -} - -sd_malloc_handler_t -sd_malloc_set_handler(a_handler) - sd_malloc_handler_t a_handler; -{ - sd_malloc_handler_t previous = handler; - - handler = a_handler; - return previous; -} - -/* Allocate N bytes of memory dynamically, with error checking. */ - -void * -sd_malloc (n) - size_t n; -{ - void *p; - - p = malloc (n); - if (p == 0) - p = fixup_null_alloc (n); - return p; -} - -/* Allocate memory for N elements of S bytes, with error checking. */ - -void * -sd_calloc (n, s) - size_t n, s; -{ - void *p; - - p = calloc (n, s); - if (p == 0) - p = fixup_null_alloc (n * s); - return p; -} - -/* Change the size of an allocated block of memory P to N bytes, - with error checking. - If P is NULL, run sd_malloc. */ - -void * -sd_realloc (p, n) - void *p; - size_t n; -{ - if (p == 0) - return sd_malloc (n); - p = realloc (p, n); - if (p == 0) - p = fixup_null_alloc (n); - return p; -} - -/* Return a newly allocated copy of STRING. */ - -char * -sd_strdup (string) - const char *string; -{ - return strcpy (sd_malloc (strlen (string) + 1), string); -} diff --git a/import/log4c/sd/malloc.h b/import/log4c/sd/malloc.h deleted file mode 100644 index 2238333..0000000 --- a/import/log4c/sd/malloc.h +++ /dev/null @@ -1,43 +0,0 @@ -/* $Id: malloc.h,v 1.3 2003/09/12 21:06:45 legoater Exp $ - * - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * - * See the COPYING file for the terms of usage and distribution. - */ - -#ifndef __sd_malloc_h -#define __sd_malloc_h - -#include -#include -#include - -/** - * @file malloc.h - */ - -__SD_BEGIN_DECLS - -typedef void (*sd_malloc_handler_t)(); - -extern sd_malloc_handler_t sd_malloc_set_handler(void (*a_handler)()); - -#ifndef __SD_DEBUG__ - -extern void *sd_malloc(size_t n); -extern void *sd_calloc(size_t n, size_t s); -extern void *sd_realloc(void *p, size_t n); -extern char *sd_strdup (const char *__str); - -#else - -#define sd_malloc malloc -#define sd_calloc calloc -#define sd_realloc realloc -#define sd_strdup strdup - -#endif - -__SD_END_DECLS - -#endif diff --git a/import/log4c/sd/sd_xplatform.c b/import/log4c/sd/sd_xplatform.c deleted file mode 100644 index fa208f9..0000000 --- a/import/log4c/sd/sd_xplatform.c +++ /dev/null @@ -1,104 +0,0 @@ -static const char version[] = "$Id$"; - -/* - * sd_xplatform.c - * - * See the COPYING file for the terms of usage and distribution. - */ - -#include -#include - -#include "sd_xplatform.h" - -/****************** getopt *******************************/ - -#define EOF (-1) - - int sd_opterr = 1, sd_optind = 1, sd_optopt = 0; - char *sd_optarg = NULL; - int _sp = 1; - -#define warn(a,b,c)fprintf(stderr,a,b,c) - - void - getopt_reset(void) - { - sd_opterr = 1; - sd_optind = 1; - sd_optopt = 0; - sd_optarg = NULL; - _sp = 1; - } - - int - sd_getopt(int argc, char *const *argv, const char *opts) - { - char c; - char *cp; - - if (_sp == 1) { - if (sd_optind >= argc || argv[sd_optind][0] != '-' || - argv[sd_optind] == NULL || argv[sd_optind][1] == '\0') - return (EOF); - else if (strcmp(argv[sd_optind], "--") == 0) { - sd_optind++; - return (EOF); - } - } - sd_optopt = c = (unsigned char)argv[sd_optind][_sp]; - if (c == ':' || (cp = strchr(opts, c)) == NULL) { - if (opts[0] != ':') - warn("%s: illegal option -- %c\n", argv[0], c); - if (argv[sd_optind][++_sp] == '\0') { - sd_optind++; - _sp = 1; - } - return ('?'); - } - - if (*(cp + 1) == ':') { - if (argv[sd_optind][_sp+1] != '\0') - sd_optarg = &argv[sd_optind++][_sp+1]; - else if (++sd_optind >= argc) { - if (opts[0] != ':') { - warn("%s: option requires an argument" - " -- %c\n", argv[0], c); - } - _sp = 1; - sd_optarg = NULL; - return (opts[0] == ':' ? ':' : '?'); - } else - sd_optarg = argv[sd_optind++]; - _sp = 1; - } else { - if (argv[sd_optind][++_sp] == '\0') { - _sp = 1; - sd_optind++; - } - sd_optarg = NULL; - } - return (c); - } - -/***************************** gettimeofday *******************/ - -#ifdef _WIN32 - -#if 0 /* also in winsock[2].h */ -#define _TIMEVAL_DEFINED -struct timeval { - long tv_sec; - long tv_usec; - long tv_usec; -}; -#endif /* _TIMEVAL_DEFINED */ -int sd_gettimeofday(struct timeval* tp, void* tzp) { - DWORD t; - t = timeGetTime(); - tp->tv_sec = t / 1000; - tp->tv_usec = t % 1000; - /* 0 indicates that the call succeeded. */ - return 0; -} -#endif /* _WIN32 */ diff --git a/import/log4c/sd/sd_xplatform.h b/import/log4c/sd/sd_xplatform.h deleted file mode 100644 index 3507e31..0000000 --- a/import/log4c/sd/sd_xplatform.h +++ /dev/null @@ -1,73 +0,0 @@ -/* $Id$ - * - * sd_xplatform.h - * - * See the COPYING file for the terms of usage and distribution. - */ - -#ifndef __sd_xplatform_h -#define __sd_xplatform_h - -#ifndef _WIN32 -#include -#include -#else -#include -#include -#include -#endif - - -#ifdef HAVE_STDINT_H -# include -#define XP_UINT64 uint64_t -#else -#ifndef _WIN32 -#define XP_UINT64 long long -#else -#define XP_UINT64 DWORD64 -#endif -#endif - -#include - - -extern int sd_optind; - -extern void getopt_reset(void); - -extern int sd_getopt(int argc, char *const *argv, const char *opts); - -#ifdef _WIN32 -#define SD_GETOPT(a,b,c) sd_getopt(a,b,c) -#define SD_OPTIND sd_optind -#else -#define SD_GETOPT(a,b,c) getopt(a,b,c) -#define SD_OPTIND optind -#endif - -extern int sd_gettimeofday(struct timeval* tp, void* tzp); - -#ifdef _WIN32 -#define SD_GETTIMEOFDAY(a,b) sd_gettimeofday(a,b) -#else -#define SD_GETTIMEOFDAY(a,b) gettimeofday(a,b) -#endif - -#ifndef _WIN32 -#define DIFF_CMD "/usr/bin/diff -q" -#else -#define DIFF_CMD "comp.exe" -#endif - -#ifdef _WIN32 -#define snprintf _snprintf -#define vsnprintf _vsnprintf -#define alloca _alloca -#define strncasecmp strnicmp -#define strcasecmp stricmp -#define YY_NO_UNISTD_H -#endif - - -#endif diff --git a/import/log4c/sd/sprintf.c b/import/log4c/sd/sprintf.c deleted file mode 100644 index 27e203f..0000000 --- a/import/log4c/sd/sprintf.c +++ /dev/null @@ -1,58 +0,0 @@ -static const char version[] = "$Id: sprintf.c,v 1.4 2005/12/15 22:05:09 rbyrne Exp $"; - -/* - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * - * See the COPYING file for the terms of usage and distribution. - */ - -#include -#include -#include -#include -#include -#include -#include - -/******************************************************************************/ -extern char* sd_sprintf(const char* a_fmt, ...) -{ - char* buffer; - va_list args; - - va_start(args, a_fmt); - buffer = sd_vsprintf(a_fmt, args); - va_end(args); - - return buffer; -} - -/******************************************************************************/ -extern char* sd_vsprintf(const char* a_fmt, va_list a_args) -{ - int size = 1024; - char* buffer = sd_calloc(size, sizeof(char)); - - while (1) { - int n = vsnprintf(buffer, size, a_fmt, a_args); - - /* If that worked, return */ - if (n > -1 && n < size) - return buffer; - - /* Else try again with more space. */ - if (n > -1) /* ISO/IEC 9899:1999 */ - size = n + 1; - else /* twice the old size */ - size *= 2; - - buffer = sd_realloc(buffer, size); - } -} - -#if defined(__osf__) -# ifndef snprintf -# include "sprintf.osf.c" -# endif -#endif - diff --git a/import/log4c/sd/sprintf.h b/import/log4c/sd/sprintf.h deleted file mode 100644 index a708746..0000000 --- a/import/log4c/sd/sprintf.h +++ /dev/null @@ -1,59 +0,0 @@ -/* $Id: sprintf.h,v 1.3 2003/09/12 21:06:45 legoater Exp $ - * - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * - * See the COPYING file for the terms of usage and distribution. - */ - -#ifndef __sd_sprintf_h -#define __sd_sprintf_h - -/** - * @file sprintf.h - * - * @brief Formatted output conversion - * - * These functions write the output under the control of a format - * string that specifies how subsequent arguments (or arguments - * accessed via the variable-length argument facilities of stdarg(2)) - * are converted for output. - * - * They do not write more than \a size bytes, including the trailing - * \c '\0'. - * - * These functions return the number of characters printed (not - * including the trailing \c `\0' used to end output to strings). They - * return -1 if the output was truncated due to the @a size limit. - * - */ - -#include -#include -#include - -__SD_BEGIN_DECLS - -/** - * Same as fprintf(3) with auto-allocation of the resulting buffer, - * and output directly in a file, not a stream. - */ -extern int sd_fprintf(int fd, const char *fmt, ...); - -/** - * Same as sprintf(3) with auto-allocation of the resulting buffer. - */ -extern char* sd_sprintf(const char* a_fmt, ...); - -/** - * Same as vsprintf(3) with auto-allocation of the resulting buffer. - */ -extern char* sd_vsprintf(const char* a_fmt, va_list a_arg); - -#if defined(__osf__) -extern int snprintf(char* str, size_t size, const char* fmt, ...); -extern int vsnprintf(char* str, size_t size, const char* fmt, va_list arg); -#endif - -__SD_END_DECLS - -#endif diff --git a/import/log4c/sd/sprintf.osf.c b/import/log4c/sd/sprintf.osf.c deleted file mode 100644 index 9563422..0000000 --- a/import/log4c/sd/sprintf.osf.c +++ /dev/null @@ -1,44 +0,0 @@ -static const char ident[] = "$Id: sprintf.osf.c,v 1.2 2002/11/21 16:13:10 legoater Exp $"; - -/* Includes - ******************************************************************************/ -#include -#include -#include - -/******************************************************************************/ -extern int snprintf(char* s, size_t maxlen, const char* fmt, ...) -{ - int len; - va_list args; - - va_start(args, fmt); - len = vsnprintf(s, maxlen, fmt, args); - va_end(args); - - return len; -} - -/******************************************************************************/ -extern int vsnprintf(char* s, size_t maxlen, const char* fmt, va_list args) -{ - int len; - FILE f; - - if (maxlen == 0) - return 0; - - memset(&f, 0, sizeof(f)); - - f._flag = _IOWRT + _IOSTRG; - - f._bufsiz = f._cnt = maxlen - 1; - f._base = f._ptr = (unsigned char*) s; - f._bufendp = f._base + f._bufsiz; - - len = vfprintf(&f, fmt, args); - *f._ptr = '\0'; - - return len; -} - diff --git a/import/log4c/sd/stack.c b/import/log4c/sd/stack.c deleted file mode 100644 index 5b519bc..0000000 --- a/import/log4c/sd/stack.c +++ /dev/null @@ -1,164 +0,0 @@ -/* stack - a dynamically resizing stack - * Copyright (c) 2001 Michael B. Allen - * - * The MIT License - * - * 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 furnished 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, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -#include -#include -#include -#include - -#include - -#define SD_STACK_INIT_SIZE 32 - -struct __sd_stack { - size_t max; - size_t sp; - size_t size; - size_t iter; - void **array; -}; - -/******************************************************************************/ -sd_stack_t* sd_stack_new(size_t max) -{ - sd_stack_t* this; - - this = sd_calloc(1, sizeof(sd_stack_t)); - this->max = max == 0 ? INT_MAX : max; - this->size = SD_STACK_INIT_SIZE; - this->sp = 0; - this->array = sd_calloc(this->size, sizeof(*this->array)); - - return this; -} - -/******************************************************************************/ -void sd_stack_delete(sd_stack_t* this, void (*free_data_fn)(void *)) -{ - if (!this) - return; - - sd_stack_clear(this, free_data_fn); - - free(this->array); - free(this); -} - -/******************************************************************************/ -size_t sd_stack_get_nelem(const sd_stack_t* this) -{ - return this ? this->sp : -1; -} - -/******************************************************************************/ -void sd_stack_clear(sd_stack_t* this, void (*free_data_fn)(void *)) -{ - if (!this) - return; - - if (free_data_fn) { - while (this->sp > 0) { - free_data_fn(this->array[--(this->sp)]); - } - } -} - -/******************************************************************************/ -void* sd_stack_begin(sd_stack_t* this) -{ - if (!this) - return NULL; - - this->iter = 0; - return this->array[this->iter]; -} - -/******************************************************************************/ -void* sd_stack_next(sd_stack_t* this) -{ - if (this && this->iter < this->sp) - return this->array[this->iter++]; - - return NULL; -} - -/******************************************************************************/ -void* sd_stack_end(sd_stack_t* this) -{ - return sd_stack_peek(this); -} - -/******************************************************************************/ -void* sd_stack_peek(sd_stack_t* this) -{ - if (!this || !this->sp) - return NULL; - - return this->array[this->sp - 1]; -} - -/******************************************************************************/ -int sd_stack_push(sd_stack_t* this, void *data) -{ - if (this == NULL) - return -1; - - if (this->sp == this->size) { - size_t new_size; - - if (this->size == this->max) - return -1; - - if (this->size * 2 > this->max) { - new_size = this->max; - } else { - new_size = this->size * 2; - } - - this->size = new_size; - this->array = sd_realloc(this->array, sizeof(*this->array) * this->size); - } - - assert(this->sp <= this->size); - this->array[this->sp++] = data; - return 0; -} - -/******************************************************************************/ -void* sd_stack_pop(sd_stack_t* this) -{ - if (this == NULL || this->sp == 0) - return NULL; - - if (this->size >= SD_STACK_INIT_SIZE * 4 && this->sp < this->size / 4) { - size_t new_size = this->size / 2; - - this->size = new_size; - this->array = sd_realloc(this->array, sizeof(*this->array) * this->size); - } - - assert(this->sp > 0 && this->sp <= this->size); - return this->array[--(this->sp)]; -} - diff --git a/import/log4c/sd/stack.h b/import/log4c/sd/stack.h deleted file mode 100644 index a7f2733..0000000 --- a/import/log4c/sd/stack.h +++ /dev/null @@ -1,41 +0,0 @@ -/* $Id: stack.h,v 1.4 2003/09/12 21:06:45 legoater Exp $ - * - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * - * See the COPYING file for the terms of usage and distribution. - */ - -#ifndef __sd_stack_h -#define __sd_stack_h - -/** - * @file stack.h @ingroup sd - * - * @brief Generic stack object. - * - * @todo documentation - * @todo API homogeneity with sd_list and sd_hash - */ - -#include -#include - -__SD_BEGIN_DECLS - -typedef struct __sd_stack sd_stack_t; - -extern sd_stack_t* sd_stack_new(size_t max); -extern void sd_stack_delete(sd_stack_t* astack, void (*free_data_fn)(void *)); -extern size_t sd_stack_get_nelem(const sd_stack_t* astack); - -extern void sd_stack_clear(sd_stack_t* astack, void (*free_data_fn)(void *)); -extern int sd_stack_push(sd_stack_t* astack, void *data); -extern void* sd_stack_pop(sd_stack_t* astack); -extern void* sd_stack_begin(sd_stack_t* astack); -extern void* sd_stack_next(sd_stack_t* astack); -extern void* sd_stack_end(sd_stack_t* astack); -extern void* sd_stack_peek(sd_stack_t* astack); - -__SD_END_DECLS - -#endif diff --git a/import/log4c/sd/test.c b/import/log4c/sd/test.c deleted file mode 100644 index 24bac9c..0000000 --- a/import/log4c/sd/test.c +++ /dev/null @@ -1,234 +0,0 @@ -static const char version[] = "$Id: test.c,v 1.10 2005/12/15 22:11:50 rbyrne Exp $"; - -/* - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * - * See the COPYING file for the terms of usage and distribution. - */ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif -#include -#include -#include -#include - -#include -#include - -typedef XP_UINT64 usec_t; - -#define MAX_NFUNC 100 - -struct __sd_test -{ - const char* name; - char in_filename[128]; - char ref_filename[128]; - char out_filename[128]; - FILE* in; - FILE* out; - FILE* err; - int verbose; - int timed; - sd_test_func_t** funcs; - int size; - int argc; - char** argv; -}; - - -/******************************************************************************/ -static usec_t now(void) -{ - struct timeval tv; - - SD_GETTIMEOFDAY(&tv, NULL); - return (usec_t) (tv.tv_sec * 1000000 + tv.tv_usec); -} - -/******************************************************************************/ -static int test_compare(sd_test_t* this, int a_argc, char* a_argv[]) -{ - char cmd[1024]; - - -#ifndef _WIN32 -#warning access() routine should be defined in sd_xplatform - if (access(this->ref_filename, R_OK) || access(this->out_filename, R_OK)) - return 1; - -#else - /* - cf. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt__access.2c_._waccess.asp - */ - if (_access(this->ref_filename, 04) == -1 || - _access(this->out_filename, 04) == -1) - return 1; -#endif - snprintf(cmd, sizeof(cmd), "%s %s %s 1>/dev/null 2>&1", DIFF_CMD, - this->ref_filename, this->out_filename); - - return ! system(cmd); -} - -/******************************************************************************/ -extern sd_test_t* sd_test_new(int a_argc, char* a_argv[]) -{ - sd_test_t* this; - int c; - char* ptr; - - this = sd_calloc(1, sizeof(sd_test_t)); - this->funcs = sd_calloc(MAX_NFUNC, sizeof(sd_test_func_t *)); - - /* - * get rid of libtool frontend script - */ - ptr = strstr(a_argv[0], "lt-"); - if (ptr) - this->name = ptr + 3; - else - this->name = a_argv[0]; - - snprintf(this->ref_filename, sizeof(this->ref_filename), "%s.ref", - this->name); - snprintf(this->in_filename, sizeof(this->in_filename), "%s.in", - this->name); - snprintf(this->out_filename, sizeof(this->out_filename), "%s.out", - this->name); - - this->in = fopen(this->in_filename, "r"); - this->out = fopen(this->out_filename, "w"); - this->err = 0; - this->verbose= 0; - this->size = 0; - - while ((c = SD_GETOPT(a_argc, a_argv, "vt")) != EOF) { - switch(c) { - case 'v': this->verbose = 1; break; - case 't': this->timed = 1; break; - default: break; - } - } - - this->argc = a_argc - (SD_OPTIND - 1); - this->argv = a_argv + (SD_OPTIND - 1); - return this; -} - -/******************************************************************************/ -extern void sd_test_delete(sd_test_t* this) -{ - if (!this) - return; - - if (this->in) fclose(this->in); - if (this->out) fclose(this->out); - free(this->funcs); - free(this); -} - -/******************************************************************************/ -extern const char* sd_test_get_name(const sd_test_t* this) -{ - return this ? this->name : NULL; -} - -/******************************************************************************/ -extern int sd_test_get_verbose(const sd_test_t* this) -{ - return this ? this->verbose: 0; -} - -/******************************************************************************/ -extern int sd_test_set_verbose(sd_test_t* this, int a_verbose) -{ - if (!this) - return 0; - - return this->verbose = a_verbose; -} - -/******************************************************************************/ -extern FILE* sd_test_in(sd_test_t* this) -{ - if (!this) - return NULL; - - return this->in ? this->in : stdin; -} - -/******************************************************************************/ -extern FILE* sd_test_out(sd_test_t* this) -{ - if (!this) - return NULL; - - if (this->verbose) - return stdout; - - return this->out ? this->out : stdout; -} - -/******************************************************************************/ -extern FILE* sd_test_err(sd_test_t* this) -{ - if (!this) - return NULL; - - return this->err ? this->err : stderr; -} - -/******************************************************************************/ -extern int sd_test_run(sd_test_t* this, int argc, char* argv[]) -{ - int i, passed = 0; - - if (!this) - return -1; - - sd_test_add(this, test_compare); - - fprintf(sd_test_err(this), "%s: ", this->name); - - for (i = 0; i < this->size; i++) { - int t; - usec_t elapsed; - - fprintf(sd_test_out(this), "=> test #%d :\n", i); - - elapsed = now(); - t = (*this->funcs[i])(this, this->argc, this->argv); - elapsed = now() - elapsed; - - fprintf(sd_test_out(this), "=> test #%d : %s\n", i, t ? " passed" : " failed"); - fflush(sd_test_out(this)); - - passed += (t != 0); - - fprintf(sd_test_err(this), "%c", t ? '+' : '-'); - if (this->timed) - fprintf(sd_test_err(this), "%lld ", elapsed); - } - - fprintf(sd_test_err(this), " %d/%d %s.\n", passed, this->size, - passed == this->size ? " passed" : " failed"); - - return passed == this->size; -} - -/******************************************************************************/ -extern int sd_test_add(sd_test_t* this, sd_test_func_t a_func) -{ - if (!this) - return -1; - - if (this->size == MAX_NFUNC) - return this->size; - - this->funcs[this->size] = a_func; - - return this->size++; -} diff --git a/import/log4c/sd/test.h b/import/log4c/sd/test.h deleted file mode 100644 index 8d330e7..0000000 --- a/import/log4c/sd/test.h +++ /dev/null @@ -1,44 +0,0 @@ -/* $Id: test.h,v 1.5 2003/09/12 21:06:46 legoater Exp $ - * - * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved. - * - * See the COPYING file for the terms of usage and distribution. - */ - -#ifndef __sd_test_h -#define __sd_test_h - -/** - * @file test.h - */ - -#include -#include - -__SD_BEGIN_DECLS - -#define SD_TEST_MAX_NFUNC 100 - -struct __sd_test; - -typedef struct __sd_test sd_test_t; - -typedef int (sd_test_func_t)(sd_test_t* a_test, int argc, char* argv[]); - -extern sd_test_t* sd_test_new(int a_argc, char* a_argv[]); -extern void sd_test_delete(sd_test_t* a_this); - -extern const char* sd_test_get_name(const sd_test_t* a_this); -extern int sd_test_get_verbose(const sd_test_t* a_test); -extern int sd_test_set_verbose(sd_test_t* a_this, int a_verbose); - -extern FILE* sd_test_in(sd_test_t* a_this); -extern FILE* sd_test_out(sd_test_t* a_this); -extern FILE* sd_test_err(sd_test_t* a_this); - -extern int sd_test_run(sd_test_t* a_this, int argc, char* argv[]); -extern int sd_test_add(sd_test_t* a_this, sd_test_func_t a_func); - -__SD_END_DECLS - -#endif diff --git a/include/Bongo.rules b/include/Bongo.rules deleted file mode 100644 index 34000f2..0000000 --- a/include/Bongo.rules +++ /dev/null @@ -1,43 +0,0 @@ -# -*- Makefile -*- -bongoincludedir=$(includedir)/bongo - -bongoinclude_HEADERS = \ - include/bongo-config.h \ - include/calcmd.h \ - include/connio.h \ - include/connio-trace.h \ - include/bongocal.h \ - include/bongocal-raw.h \ - include/bongocheck.h \ - include/bongojson.h \ - include/bongojsonrpc.h \ - include/bongomanagee.h \ - include/bongostore.h \ - include/bongostream.h \ - include/logger.h \ - include/memmgr.h \ - include/msgaddr.h \ - include/msgapi.h \ - include/msgdate.h \ - include/msgftrs.h \ - include/nmap.h \ - include/nmlib.h \ - include/rfc2231.h \ - include/rulesrv.h \ - include/streamio.h \ - include/thread_profile.h \ - include/bongoagent.h \ - include/bongothreadpool.h \ - include/bongoutil.h \ - include/xpl.h \ - include/xpldns.h \ - include/xplhash.h \ - include/xplold.h \ - include/xplresolve.h \ - include/xplschema.h \ - include/xplservice.h \ - include/xplthread.h \ - include/xplutil.h - -include/all: -include/clean: clean diff --git a/include/Makefile.am b/include/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/include/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/include/bongocheck.h b/include/bongocheck.h index 336c2cd..e7f8b7b 100644 --- a/include/bongocheck.h +++ b/include/bongocheck.h @@ -19,8 +19,6 @@ * ****************************************************************************/ -#include - /** \defgroup BongoCheck The Check Framework in the Bongo Project * \brief Provides unit testing for C code in the Bongo Project. * @@ -74,7 +72,6 @@ * */ #include -#include #include #include diff --git a/include/connio.h b/include/connio.h index 3ffd11f..cd35849 100644 --- a/include/connio.h +++ b/include/connio.h @@ -22,8 +22,6 @@ #ifndef _BONGO_CONNIO_H #define _BONGO_CONNIO_H -#include "bongo-config.h" - #include #include #include @@ -85,7 +83,7 @@ typedef struct { void CHOP_NEWLINE(unsigned char *s); void SET_POINTER_TO_VALUE(unsigned char *p, unsigned char *s); // FIXME: Unused? -#if defined(_BONGO_LINUX) || defined(S390RH) || defined(SOLARIS) +#if defined (UNIX) || defined(S390RH) || defined(SOLARIS) #include #include diff --git a/include/logger.h b/include/logger.h index 018c234..698ef49 100644 --- a/include/logger.h +++ b/include/logger.h @@ -1,196 +1,50 @@ -/**************************************************************************** - * - * Copyright (c) 2001 Novell, Inc. All Rights Reserved. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public License - * as published by the Free Software Foundation. - * - * 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, contact Novell, Inc. - * - * To contact Novell about this file by physical or electronic mail, you - * may find current contact information at www.novell.com. - * - ****************************************************************************/ - #ifndef LOGGER_H #define LOGGER_H -#include +#ifndef LOGGERNAME +#define LOGGERNAME "root" +#endif -#include +void Log(int level, char *message, ...); +void LogOpen(const char *agentname); +void LogClose(); -/* Subsystem constants */ -#define LOGGER_SUBSYSTEM_AUTH "\\Authentication" -#define LOGGER_SUBSYSTEM_GENERAL "\\General" -#define LOGGER_SUBSYSTEM_QUEUE "\\Queue" -#define LOGGER_SUBSYSTEM_UNHANDLED "\\Unhandled Request" -#define LOGGER_SUBSYSTEM_NOTIFY "\\Notification" -#define LOGGER_SUBSYSTEM_STANDARDS "\\Standards Violation" -#define LOGGER_SUBSYSTEM_MEMMON "\\Memory Monitor" -#define LOGGER_SUBSYSTEM_DATABASE "\\Database" -#define LOGGER_SUBSYSTEM_CONFIGURATION "\\Configuration" -#define LOGGER_SUBSYSTEM_CALENDAR "\\Calendar" -#define LOGGER_SUBSYSTEM_MAIL "\\Mail" +// various macros +#define LogFailure(message) Log(LOG_ERROR, "Internal Failure (%s:%d) " message, __FILE__, __LINE__) +#define LogFailureF(message, ...) Log(LOG_ERROR, "Internal Failure (%s:%d) " message, __FILE__, __LINE__, __VA_ARGS__) +#define LogAssert(test, message) if (!(test)) { Log(LOG_ERROR, "Internal Failure (%s:%d) " message, __FILE__, __LINE__); } +#define LogAssertF(test, message, ...) if(!(test)) { Log(LOG_ERROR, "Assert:%s:%d " message, __FILE__, __LINE__, __VA_ARGS__); } +#define LogWithID(...) Log(__VA_ARGS__) -/* Event IDs */ -typedef enum { - LOGGER_EVENT_WRONG_PASSWORD = 0x00020001, - LOGGER_EVENT_UNHANDLED_REQUEST, /* 0x00020002 */ - LOGGER_EVENT_LOGIN, /* 0x00020003 */ - LOGGER_EVENT_MAX_FAILED_LOGINS, /* 0x00020004 */ - LOGGER_EVENT_DISABLED_FEATURE, /* 0x00020005 */ - LOGGER_EVENT_UNKNOWN_USER, /* 0x00020006 */ - LOGGER_EVENT_NMAP_UNAVAILABLE, /* 0x00020007 */ - LOGGER_EVENT_OUT_OF_MEMORY, /* 0x00020008 */ - LOGGER_EVENT_NOT_CONFIGURED, /* 0x00020009 */ - LOGGER_EVENT_SESSION_LIMIT_REACHED, /* 0x0002000A */ - LOGGER_EVENT_PASSWORD_CHANGE, /* 0x0002000B */ - LOGGER_EVENT_SECRET_CHANGE, /* 0x0002000C */ - LOGGER_EVENT_ACCOUNT_CREATED, /* 0x0002000D */ - LOGGER_EVENT_ACCOUNT_DISABLED, /* 0x0002000E */ - LOGGER_EVENT_MEMORY_LEAKED, /* 0x0002000F */ - LOGGER_EVENT_NULL_DESTINATION, /* 0x00020010 */ - LOGGER_EVENT_MEMORY_BOUNDARY_OVERRUN, /* 0x00020011 */ - LOGGER_EVENT_MEMORY_NON_OWNER_FREE, /* 0x00020012 */ - LOGGER_EVENT_QUESTIONABLE_FREE, /* 0x00020013 */ - LOGGER_EVENT_QUESTIONABLE_ALLOC, /* 0x00020014 */ - LOGGER_EVENT_MESSAGE_RECEIVED, /* 0x00020015 */ - LOGGER_EVENT_MESSAGE_SENT, /* 0x00020016 */ - LOGGER_EVENT_CONNECTION_BLOCKED, /* 0x00020017 */ - LOGGER_EVENT_RECIPIENT_BLOCKED, /* 0x00020018 */ - LOGGER_EVENT_MESSAGE_RELAYED, /* 0x00020019 */ - LOGGER_EVENT_RECIPIENT_LIMIT_REACHED, /* 0x0002001A */ - LOGGER_EVENT_CONNECTION, /* 0x0002001B */ - LOGGER_EVENT_REGISTER_NMAP_SERVER, /* 0x0002001C */ - LOGGER_EVENT_AVIRUS_RESTART_FAILED, /* 0x0002001D */ - LOGGER_EVENT_DUPLICATE_ALIAS, /* 0x0002001E */ - LOGGER_EVENT_DATABASE_OPEN_ERROR, /* 0x0002001F */ - LOGGER_EVENT_ALIAS_CONTEXTS, /* 0x00020020 */ - LOGGER_EVENT_RECEIVED_BOUNCE, /* 0x00020021 */ - LOGGER_EVENT_SPAM_BLOCKED, /* 0x00020022 */ - LOGGER_EVENT_VIRUS_BLOCKED, /* 0x00020023 */ - LOGGER_EVENT_FORWARD, /* 0x00020024 */ - LOGGER_EVENT_AUTO_REPLY, /* 0x00020025 */ - LOGGER_EVENT_RECEIVED_CONTROL, /* 0x00020026 */ - LOGGER_EVENT_PROCESSING_ERROR, /* 0x00020027 */ - LOGGER_EVENT_LIST_SEND_BLOCKED, /* 0x00020028 First numeric value is one of ListBlockCodes */ - LOGGER_EVENT_CONFIGURATION_STRING, /* 0x00020029 */ - LOGGER_EVENT_CONFIGURATION_NUMERIC, /* 0X0002002A */ - LOGGER_EVENT_QLIMITS_ADJUSTED, /* 0x0002002B */ - LOGGER_EVENT_SSL_CONNECTION, /* 0x0002002C */ - LOGGER_EVENT_LIST_MESSAGE_RECEIVED, /* 0x0002002D */ - LOGGER_EVENT_LIST_MESSAGE_DELIVERED, /* 0x0002002E */ - LOGGER_EVENT_RELOADED_QUEUE_AGENT, /* 0x0002002F */ - LOGGER_EVENT_PQE_FROM, /* 0x00020030 */ - LOGGER_EVENT_OVER_QUOTA, /* 0x00020031 */ - LOGGER_EVENT_BONGO_DEBUG, /* 0x00020032 */ - LOGGER_EVENT_WRONG_SYSTEM_AUTH, /* 0x00020033 */ - LOGGER_EVENT_SWITCH_USER_DENIED, /* 0x00020034 */ - LOGGER_EVENT_WRONG_USER_AUTH, /* 0x00020035 */ - LOGGER_EVENT_DISKSPACE_LOW, /* 0x00020036 */ - LOGGER_EVENT_WRITE_ERROR, /* 0x00020037 */ - LOGGER_EVENT_ADD_QUEUE_AGENT, /* 0x00020038 */ - LOGGER_EVENT_BAD_HOSTNAME, /* 0x00020039 */ - LOGGER_EVENT_PROXY_LOCALHOST, /* 0x0002003A */ - LOGGER_EVENT_NMAP_ERROR, /* 0x0002003B */ - LOGGER_EVENT_DDB_INIT_FAILED, /* 0x0002003C */ - LOGGER_EVENT_DISALLOWED_HOSTNAME, /* 0x0002003D */ - LOGGER_EVENT_EXECUTING_RULE, /* 0x0002003E */ - LOGGER_EVENT_RULE_DELETE, /* 0x0002003F */ - LOGGER_EVENT_RULE_FORWARD, /* 0x00020040 */ - LOGGER_EVENT_RULE_COPY, /* 0x00020041 */ - LOGGER_EVENT_RULE_MOVE, /* 0x00020042 */ - LOGGER_EVENT_REREGISTER_QUEUE_AGENT, /* 0x00020043 */ - LOGGER_EVENT_REMOVED_QUEUE_AGENT, /* 0x00020044 */ - LOGGER_EVENT_DATABASE_FIND_ERROR, /* 0x00020045 */ - LOGGER_EVENT_DATABASE_ALIAS_ERROR, /* 0x00020046 */ - LOGGER_EVENT_DATABASE_CLOSE_ERROR, /* 0x00020047 */ - LOGGER_EVENT_ITEM_STORED, /* 0x00020048 */ - LOGGER_EVENT_DATABASE_INSERT_ERROR, /* 0x00020049 */ - LOGGER_EVENT_DATABASE_CREATE_ERROR, /* 0x0002004A */ - LOGGER_EVENT_PQE_START, /* 0x0002004B */ - LOGGER_EVENT_PQE_FIND_OBJECT_FAILED, /* 0x0002004C */ - LOGGER_EVENT_PQE_REMOTE_NMAP, /* 0x0002004D */ - LOGGER_EVENT_PQE_DELIVERY_FAILED, /* 0x0002004E */ - LOGGER_EVENT_PQE_FAILED_CONNECT, /* 0x0002004F */ - LOGGER_EVENT_PQE_FAILED, /* 0x00020050 */ - LOGGER_EVENT_MISSING_STRINGS_FILE, /* 0x00020051 */ - LOGGER_EVENT_WRONG_STRING_COUNT, /* 0x00020052 */ - LOGGER_EVENT_DIGEST_SENT, /* 0x00020053 */ - LOGGER_EVENT_CREATE_SOCKET_FAILED, /* 0x00020054 */ - LOGGER_EVENT_CARRIERSCAN_CONNECT_FAILED, /* 0x00020055 */ - LOGGER_EVENT_ILLEGAL_EMAIL_ADDRESS, /* 0x00020056 */ - LOGGER_EVENT_OPEN_STRINGS_FILE, /* 0x00020057 */ - LOGGER_EVENT_MESSAGE_TRY_LATER, /* 0x00020058 */ - LOGGER_EVENT_MESSAGE_FAILED_DELIVERY, /* 0x00020059 */ - LOGGER_EVENT_MEMORY_WILL_OVERRUN, /* 0x0002005A */ - LOGGER_EVENT_NULL_SOURCE, /* 0x0002005B */ - LOGGER_EVENT_ADD_TO_BLOCK_LIST, /* 0x0002005C */ - LOGGER_EVENT_ACCEPT_FAILURE, /* 0x0002005D */ - LOGGER_EVENT_INDEX_CORRUPTION, /* 0x0002005E */ - LOGGER_EVENT_NMAP_OUT_OF_MEMORY, /* 0x0002005F */ - LOGGER_EVENT_FILE_OPEN_FAILURE, /* 0x00020060 */ - LOGGER_EVENT_FILE_IO_FAILURE, /* 0x00020061 */ - LOGGER_EVENT_CONNECTION_TIMEOUT, /* 0x00020062 */ - LOGGER_EVENT_CONNECTION_ERROR, /* 0x00020063 */ - LOGGER_EVENT_PQE_LOCK_FULL, /* 0x00020064 */ - LOGGER_EVENT_AGENT_HEARTBEAT, /* 0x00020065 */ - LOGGER_EVENT_MBOX_CORRUPTION, /* 0x00020066 */ - LOGGER_EVENT_PROXY_HEARTBEAT, /* 0x00020067 */ - LOGGER_EVENT_CONNECTION_LOCAL, /* 0x00020068 */ - LOGGER_EVENT_DNS_CONFIGURATION_ERROR, /* 0x00020069 */ - LOGGER_EVENT_MESSAGE_WITH_UNKNOWN_RECIPS, /* 0x0002006A */ - LOGGER_EVENT_IP_CONNECT_FAILURE, /* 0x0002006B */ - LOGGER_EVENT_SMTP_CONNECT_ERROR, /* 0x0002006C */ - LOGGER_EVENT_NEGOTIATION_FAILED, /* 0x0002006D */ - LOGGER_EVENT_NETWORK_IO_FAILURE, /* 0x0002006E */ - LOGGER_EVENT_PROXY_USER, /* 0x0002006F */ - LOGGER_EVENT_SERVER_SHUTDOWN, /* 0x00020070 */ - LOGGER_EVENT_PRIV_FAILURE, /* 0x00020071 */ - LOGGER_EVENT_BIND_FAILURE, /* 0x00020072 */ +#define LOGIP(X) inet_ntoa(X.sin_addr) +#define LOGIPPTR(X) inet_ntoa(X->sin_addr) - /* - Third-party Bongo Queue Agent event ID's. +// deprecated start up functions +#define LogStart() LogOpen(LOGGERNAME); +#define LogStartup() LogOpen(LOGGERNAME); +#define LogShutdown() LogClose(); - 0x00028000 - */ - - LOGGER_EVENT_LAST_EVENT_ID -} LoggerEventIDs; - -/* List Codes */ -typedef enum { - LOGGER_LIST_NO_AUTH = 1, - LOGGER_LIST_NOT_MODERATOR, - LOGGER_LIST_NO_ATTACHMENTS, - LOGGER_LIST_USER_BANNED, - - LOGGER_LIST_LAST_CODE -} LoggerListCodes; - -/* Blocking Codes */ -typedef enum { - LOGGING_BLOCK_REVERSE_FAILED = 1, - LOGGING_BLOCK_BLOCKLIST, - LOGGING_BLOCK_RBL, - - LOGGER_LAST_BLOCK_CODE -} LoggerBlockCodes; - -/* Variables */ +#define LOG_FATAL 10 +#define LOG_ALERT 9 +#define LOG_CRIT 8 +#define LOG_CRITICAL 8 +#define LOG_ERROR 7 +#define LOG_WARN 6 +#define LOG_WARNING 6 +#define LOG_NOTICE 5 +#define LOG_INFO 4 +#define LOG_DEBUG 3 +#define LOG_TRACE 2 +#define LOG_NOTSET 1 +#define LOG_UNKNOWN 0 +#if 0 typedef struct _LoggingHandle LoggingHandle; /* Prototypes */ EXPORT LoggingHandle *LoggerOpen(const char *name); EXPORT void LoggerClose(LoggingHandle *handle); EXPORT void LoggerEvent(LoggingHandle *handle, const char *subsystem, unsigned long eventId, int level, int unknown /*fixme*/, const char *str1, const char *str2, int i1, int i2, void *p, int size); +#endif #endif /* LOGGER_H */ diff --git a/include/memmgr.h b/include/memmgr.h index 563b6cc..f94540a 100644 --- a/include/memmgr.h +++ b/include/memmgr.h @@ -26,10 +26,6 @@ XPL_BEGIN_C_LINKAGE -/* Library Specific */ -#define MEMMGR_API_VERSION 1 -#define MEMMGR_API_COMPATIBILITY 1 - /* Alignment macros */ #if defined(TARGET_CPU_68K) || defined(__CFM68K__) || defined(m68k) || defined(_M_M68K) #define ALIGNMENT 2 @@ -63,73 +59,19 @@ XPL_BEGIN_C_LINKAGE #define ALIGN_SIZE(s, a) (((s) + a - 1) & ~(a - 1)) -typedef BOOL (*PoolEntryCB)(void *Buffer, void *ClientData); - -typedef struct _MemStatistics { - struct { - unsigned long count; - unsigned long size; - } totalAlloc; - - unsigned long pitches; - unsigned long hits; - unsigned long strikes; - - struct { - unsigned long size; - - unsigned long minimum; - unsigned long maximum; - - unsigned long allocated; - } entry; - - unsigned char *name; - - struct _MemStatistics *next; - struct _MemStatistics *previous; -} MemStatistics; - EXPORT BOOL MemoryManagerOpen(const unsigned char *AgentName); EXPORT BOOL MemoryManagerClose(const unsigned char *AgentName); /* Memory Allocation API's */ -EXPORT void *MemCallocDirect(size_t Number, size_t Size); -EXPORT void *MemCallocDebugDirect(size_t Number, size_t Size, const char *SourceFile, unsigned long SourceLine); +EXPORT void *MemMallocDirect(size_t Size, const char *SourceFile, unsigned long SourceLine); +EXPORT void *MemMalloc0Direct(size_t size, const char *sourceFile, unsigned long sourceLine); +EXPORT void *MemReallocDirect(void *Source, size_t Size, const char *SourceFile, unsigned long SourceLine); -EXPORT void *MemMallocDirect(size_t Size); -EXPORT void *MemMallocDebugDirect(size_t Size, const char *SourceFile, unsigned long SourceLine); - -EXPORT void *MemMalloc0Direct(size_t size); -EXPORT void *MemMalloc0DebugDirect(size_t size, const char *sourceFile, unsigned long sourceLine); - - -EXPORT void *MemReallocDirect(void *Source, size_t Size); -EXPORT void *MemReallocDebugDirect(void *Source, size_t Size, const char *SourceFile, unsigned long SourceLine); - -#if !defined(MEMMGR_DEBUG) -#define MemCalloc(n, s) MemCallocDirect((n), (s)) -#else -#define MemCalloc(n, s) MemCallocDebugDirect((n), (s), __FILE__, __LINE__) -#endif - -#if !defined(MEMMGR_DEBUG) -#define MemMalloc(s) MemMallocDirect((s)) -#else -#define MemMalloc(s) MemMallocDebugDirect((s), __FILE__, __LINE__) -#endif - -#if !defined(MEMMGR_DEBUG) -#define MemMalloc0(s) MemMalloc0Direct((s)) -#else -#define MemMalloc0(s) MemMalloc0DebugDirect((s), __FILE__, __LINE__) -#endif - -#if !defined(MEMMGR_DEBUG) -#define MemRealloc(m, s) MemReallocDirect((m), (s)) -#else -#define MemRealloc(m, s) MemReallocDebugDirect((m), (s), __FILE__, __LINE__) -#endif +// deprecate Calloc() +#define MemCalloc(n, s) MemMallocDirect((n)*(s), __FILE__, __LINE__) +#define MemMalloc(s) MemMallocDirect((s), __FILE__, __LINE__) +#define MemMalloc0(s) MemMalloc0Direct((s), __FILE__, __LINE__) +#define MemRealloc(m, s) MemReallocDirect((m), (s), __FILE__, __LINE__) /* Helpers */ #define MemNew0(type, num) ((type*)MemMalloc0(sizeof(type) * (num))) @@ -138,47 +80,26 @@ EXPORT void *MemReallocDebugDirect(void *Source, size_t Size, const char *Source EXPORT void * MemClear(void *Source, size_t Size); /* Memory De-Allocation API's */ -EXPORT void MemFreeDirect(void *Source); -EXPORT void MemFreeDebugDirect(void *Source, const char *SourceFile, unsigned long SourceLine); - -#if !defined(MEMMGR_DEBUG) -#define MemFree(m) MemFreeDirect((m)) -#else -#define MemFree(m) MemFreeDebugDirect((m), __FILE__, __LINE__) -#endif +EXPORT void MemFreeDirect(void *Source, const char *SourceFile, unsigned long SourceLine); +EXPORT void MemFreeDirectCallback(void *Source); +#define MemFree(m) MemFreeDirect((m), __FILE__, __LINE__) /* String Allocation API's */ -EXPORT char *MemStrdupDirect(const char *StrSource); -EXPORT char *MemStrndupDirect(const char *StrSource, int n); -EXPORT char *MemStrdupDebugDirect(const char *StrSource, const char *SourceFile, unsigned long SourceLine); -EXPORT char *MemStrndupDebugDirect(const char *StrSource, int n, const char *SourceFile, unsigned long SourceLine); -EXPORT char *MemStrCatDirect(const char *stra, const char *strb); -EXPORT char *MemStrCatDebugDirect(const char *stra, const char *strb, const char *sourceFile, unsigned long sourceLine); - -#if !defined(MEMMGR_DEBUG) -#define MemStrdup(s) MemStrdupDirect((s)) -#define MemStrndup(s, n) MemStrndupDirect((s), (n)) -#define MemStrCat(s1, s2) MemStrCatDirect((s1), (s2)) -#else -#define MemStrdup(s) MemStrdupDebugDirect((s), __FILE__, __LINE__) -#define MemStrndup(s, n) MemStrndupDebugDirect((s), (n), __FILE__, __LINE__) -#define MemStrCat(s1, s2) MemStrCatDebugDirect((s1), (s2), __FILE__, __LINE__) -#endif - -/* Management Statistics */ -EXPORT MemStatistics *MemAllocStatistics(void); -EXPORT void MemFreeStatistics(MemStatistics *Statistics); +EXPORT char *MemStrdupDirect(const char *StrSource, const char *SourceFile, unsigned long SourceLine); +EXPORT char *MemStrndupDirect(const char *StrSource, int n, const char *SourceFile, unsigned long SourceLine); +#define MemStrdup(s) MemStrdupDirect((s), __FILE__, __LINE__) +#define MemStrndup(s, n) MemStrndupDirect((s), (n), __FILE__, __LINE__) /* Private Pool API's */ +typedef BOOL (*PoolEntryCB)(void *Buffer, void *ClientData); + EXPORT void *MemPrivatePoolAlloc(unsigned char *Ident, size_t AllocationSize, unsigned int MinAllocCount, unsigned int MaxAllocCount, BOOL Dynamic, BOOL Temporary, PoolEntryCB AllocCB, PoolEntryCB FreeCB, void *ClientData); EXPORT void MemPrivatePoolFree(void *PoolHandle); -EXPORT void MemPrivatePoolEnumerate(void *PoolHandle, PoolEntryCB EnumerationCB, void *Data); -EXPORT void MemPrivatePoolStatistics(void *PoolHandle, MemStatistics *PoolStats); -EXPORT void *MemPrivatePoolGetEntry(void *PoolHandle); -EXPORT void *MemPrivatePoolGetEntryDebug(void *PoolHandle, const char *SourceFile, unsigned long SourceLine); -EXPORT void MemPrivatePoolReturnEntry(void *PoolEntry); -EXPORT void MemPrivatePoolDiscardEntry(void *Source); +EXPORT void *MemPrivatePoolGetEntryDirect(void *PoolHandle, const char *SourceFile, unsigned long SourceLine); +EXPORT void MemPrivatePoolReturnEntryDirect(void *PoolHandle, void *PoolEntry, const char *SourceFile, unsigned long SourceLine); +#define MemPrivatePoolGetEntry(p) MemPrivatePoolGetEntryDirect((p), __FILE__, __LINE__) +#define MemPrivatePoolReturnEntry(p, e) MemPrivatePoolReturnEntryDirect((p), (e), __FILE__, __LINE__); EXPORT BOOL MemPrivatePoolZeroCallback(void *buffer, void *clientData); @@ -188,6 +109,7 @@ EXPORT BOOL MemPrivatePoolZeroCallback(void *buffer, void *clientData); typedef struct _BongoMemChunk BongoMemChunk; struct _BongoMemChunk { + // TODO: review pointers below; not sure the types make sense. uint8_t *curptr; uint8_t *endptr; diff --git a/include/msgapi.h b/include/msgapi.h index a194e0c..2dd3e19 100644 --- a/include/msgapi.h +++ b/include/msgapi.h @@ -73,7 +73,7 @@ typedef struct _MsgSQLHandle { } stmts; BongoMemStack *memstack; - XplSemaphore transactionLock; + XplMutex transactionLock; int transactionDepth; int lockTimeoutMs; BOOL isNew; // have we just created this? diff --git a/include/xplthread.h b/include/xplthread.h index 37f21db..ac26a70 100644 --- a/include/xplthread.h +++ b/include/xplthread.h @@ -22,17 +22,10 @@ #ifndef XPLTHREAD_H #define XPLTHREAD_H -#include "bongo-config.h" - -#ifdef _BONGO_HAVE_SEMAPHORE_H - +#ifdef HAVE_SEMAPHORE_H #include - #endif -/* Atomic reads/writes */ - -#if defined(_BONGO_LINUX) typedef struct { volatile int counter; } XplAtomic; /* this can be optimized so that it uses inc for 1, etc, but there is no real @@ -49,24 +42,6 @@ static __inline__ void _XplSafeAdd (int i, XplAtomic *v) :"=m" (v->counter) :"ir" (i), "m" (v->counter)); } -#elif defined (__powerpc__) || defined(__POWERPC__) -/* this can be optimized so that it uses inc for 1, etc, but there is no real - * reason to do that - * - * also, you could make a non-smp build that did not do lock - */ -static __inline__ void _XplSafeAdd (int a, XplAtomic *v) -{ - int t; - __asm__ __volatile__( -"1: lwarx %0,0,%3\n\ - add %0,%2,%0\n\ - stwcx. %0,0,%3 \n\ - bne- 1b" - : "=&r" (t), "=m" (v->counter) - : "r" (a), "r" (&v->counter), "m" (v->counter) -: "cc"); -} #else /* we don't have any asm, so use a generic mutex-based definition */ #include static pthread_mutex_t __xpl_safe_add_mutex = PTHREAD_MUTEX_INITIALIZER; @@ -85,28 +60,6 @@ static __inline__ void _XplSafeAdd (int i, XplAtomic *v) #define XplSafeDecrement(Variable) XplSafeAdd (Variable, -1) #define XplSafeSub(Variable, Value) XplSafeAdd (Variable, -(Value)) -#elif defined(WIN32) - -#define XplAtomic unsigned long -#define XplSafeRead(Variable) (Variable) -#define XplSafeWrite(Variable, Value) InterlockedExchange(&(Variable), (Value)) -#define XplSafeIncrement(Variable) InterlockedIncrement(&(Variable)) -#define XplSafeDecrement(Variable) InterlockedDecrement(&(Variable)) -#define XplSafeAdd(Variable, Value) InterlockedExchangeAdd(&(Variable), (Value)) -#define XplSafeSub(Variable, Value) InterlockedExchangeAdd(&(Variable), -1*(Value)) - -#else -# error "Safe variable operations not implemented on this platform" -#endif - - - -/* FIXME: should be #ifdef PTHREAD */ -#ifdef _BONGO_LINUX - -/* FIXME: This is only implemented for pthreads, need to bring in - * the netware/windows code at some point */ - #define XplThreadSwitchWithDelay() /* Thread Groups */ @@ -121,33 +74,33 @@ static __inline__ void _XplSafeAdd (int i, XplAtomic *v) #define XplThreadID pthread_t #define XplBeginThread(pID, func, stack, args, ret) { pthread_attr_t thread_attr; \ - pthread_attr_init(&thread_attr); \ - pthread_attr_setdetachstate(&thread_attr, PTHREAD_CREATE_DETACHED); \ - pthread_attr_setstacksize(&thread_attr, ((stack) * 2)); \ - if (((ret) = pthread_create((pID), &thread_attr, (void *)(func), (void *)(args))) == 0) { \ - ; \ - } else { \ - *(pID) = 0; \ - } \ - pthread_attr_destroy(&thread_attr); \ - } + pthread_attr_init(&thread_attr); \ + pthread_attr_setdetachstate(&thread_attr, PTHREAD_CREATE_DETACHED); \ + pthread_attr_setstacksize(&thread_attr, ((stack) * 2)); \ + if (((ret) = pthread_create((pID), &thread_attr, (void *)(func), (void *)(args))) == 0) { \ + ; \ + } else { \ + *(pID) = 0; \ + } \ + pthread_attr_destroy(&thread_attr); \ + } #define XplBeginCountedThreadGroup XplBeginCountedThread #define XplBeginCountedThread(pID, func, stack, args, ret, counter) { \ - pthread_attr_t thread_attr; \ - pthread_attr_init(&thread_attr); \ - pthread_attr_setdetachstate(&thread_attr, PTHREAD_CREATE_DETACHED); \ - pthread_attr_setstacksize(&thread_attr, ((stack) * 2)); \ - XplSafeIncrement (counter); \ - if (((ret) = pthread_create(pID, &thread_attr, (void *)(func), (void *)(args))) == 0) { \ - ; \ - } else { \ - *(pID) = 0; \ - XplSafeDecrement (counter); \ - } \ - pthread_attr_destroy(&thread_attr); \ - } + pthread_attr_t thread_attr; \ + pthread_attr_init(&thread_attr); \ + pthread_attr_setdetachstate(&thread_attr, PTHREAD_CREATE_DETACHED); \ + pthread_attr_setstacksize(&thread_attr, ((stack) * 2)); \ + XplSafeIncrement (counter); \ + if (((ret) = pthread_create(pID, &thread_attr, (void *)(func), (void *)(args))) == 0) { \ + ; \ + } else { \ + *(pID) = 0; \ + XplSafeDecrement (counter); \ + } \ + pthread_attr_destroy(&thread_attr); \ + } #define XplExitThread(code, status) pthread_exit((void *)status) #define XplSuspendThread(id) ; @@ -161,80 +114,6 @@ static __inline__ void _XplSafeAdd (int i, XplAtomic *v) #define XplMutexUnlock(m) pthread_mutex_unlock(&(m)); #define XplMutexDestroy(m) pthread_mutex_destroy(&(m)); -#elif defined(WIN32) - -#include - -#define XplThreadSwitchWithDelay() - -/* Thread Groups */ - -#define XplGetThreadGroupID() (HANDLE)GetModuleHandle(NULL) -#define XplSetThreadGroupID(thread) (HANDLE)GetModuleHandle(NULL) -#define XplGetThreadID() (HANDLE)GetModuleHandle(NULL) -#define XplSetThreadID(thread) (int)GetModuleHandle(NULL) - -/* Threads */ - -#define XplThreadID HANDLE - -#define XplBeginThread(id, func, stack, args, ret) { unsigned long tHrHndl; \ - if ((tHrHndl = _beginthreadex(NULL, (stack), (unsigned int (__stdcall *)(void *))(func), (void *)(args), 0, (unsigned int *)(id))) != 0) { \ - CloseHandle((HANDLE)tHrHndl); \ - (ret) = 0; \ - } else { \ - (ret) = -1; \ - } \ - } - -#define XplBeginCountedThreadGroup XplBeginCountedThread -#define XplBeginCountedThread(id, func, stack, args, ret, counter) { \ - unsigned long tHrHndl; \ - InterlockedIncrement(&(counter)); \ - if ((tHrHndl = _beginthreadex(NULL, (stack), (unsigned int (__stdcall *)(void *))(func), (void *)(args), 0, (unsigned int *)(id))) != 0) { \ - CloseHandle((HANDLE)tHrHndl); \ - (ret) = 0; \ - } else { \ - InterlockedDecrement(&(counter)); \ - (ret) = -1; \ - } \ - } -#define XplExitThread(code, status) _endthreadex(status) -#define XplSuspendThread(id) SuspendThread(id) -#define XplResumeThread(id) ResumeThread(id) -#define XplRenameThread(id, Name) - -#define XplMutex HANDLE -#define XplMutexInit(m) (m) = CreateMutex(NULL, FALSE, NULL) -#define XplMutexLock(m) (WaitForSingleObject((m), INFINITE) == WAIT_OBJECT_0) -#define XplMutexTryLock(m) (WaitForSingleObject((m), 0) != WAIT_TIMEOUT) -#define XplMutexUnlock(m) (ReleaseMutex(m)) -#define XplMutexDestroy(m) (CloseHandle(m)) - -#endif - - -#ifdef _BONGO_HAVE_SEMAPHORE_H - -/* Semaphores */ - /********************** - Semaphores - **********************/ - -#ifdef MACOSX - -#include -#include - -#define XplSemaphore MPSemaphoreID -#define XplOpenLocalSemaphore(sem, init) (MPCreateSemaphore(0x7fffffff,init,&(sem)) != noErr ? -1 : (int) (sem)) -#define XplCloseLocalSemaphore(sem) (MPDeleteSemaphore(sem) != noErr ? -1 : 0) -#define XplWaitOnLocalSemaphore(sem) (MPWaitOnSemaphore(sem,kDurationForever) != noErr ? -1 : 0) -#define XplSignalLocalSemaphore(sem) (MPSignalSemaphore(sem) != noErr ? -1 : 0) -#define XplExamineLocalSemaphore(sem, cnt) if (MPWaitOnSemaphore(sem,kDurationImmediate) != kMPTimeoutErr) { MPSignalSemaphore(sem); cnt = 1; } else { cnt = 0; } - -#else - #define XplSemaphore sem_t #define XplOpenLocalSemaphore(sem, init) sem_init(&(sem), 0, init) #define XplCloseLocalSemaphore(sem) sem_destroy(&(sem)) @@ -243,16 +122,3 @@ static __inline__ void _XplSafeAdd (int i, XplAtomic *v) #define XplExamineLocalSemaphore(sem, cnt) sem_getvalue(&(sem), (int *)&(cnt)) #endif - -#elif defined(WIN32) - -#define XplSemaphore HANDLE -#define XplOpenLocalSemaphore(sem, init) sem=CreateSemaphore(NULL, init, 0x7fffffff, NULL); -#define XplCloseLocalSemaphore(sem) CloseHandle(sem) -#define XplWaitOnLocalSemaphore(sem) (WaitForSingleObject(sem, INFINITE)==WAIT_FAILED) -#define XplSignalLocalSemaphore(sem) (ReleaseSemaphore(sem, 1, NULL)==0) -#define XplExamineLocalSemaphore(sem, cnt) if (WaitForSingleObject(sem, 0)!=WAIT_TIMEOUT) { ReleaseSemaphore(sem, 1, (LPLONG)&cnt); cnt++;} else { cnt=0; } - -#endif - -#endif diff --git a/include/xplutil.h b/include/xplutil.h index b80cebc..999a401 100644 --- a/include/xplutil.h +++ b/include/xplutil.h @@ -22,7 +22,7 @@ #ifndef XPLUTIL_H #define XPLUTIL_H -#include "bongo-config.h" +#include #include "xplthread.h" #include @@ -35,11 +35,10 @@ #include #include -#ifdef _BONGO_HAVE_SYS_STAT_H +#ifdef HAVE_SYS_STAT_H #include #endif -#ifdef _BONGO_LINUX # include # include # include @@ -49,10 +48,6 @@ # include # include # include -#elif defined WIN32 -# include -# include -#endif /* Product Definitions */ @@ -64,10 +59,6 @@ typedef int BOOL; -#ifndef WIN32 -typedef unsigned long LONG; -#endif - typedef unsigned char BYTE; typedef unsigned short WORD; @@ -92,12 +83,6 @@ typedef unsigned short unicode; # define max(a,b) (((a)<(b)) ? (b) : (a)) #endif -/* Casts */ -#define XPL_PTR_TO_INT(p) ((int) XPL_POINTER_TO_INT_CAST (p)) -#define XPL_PTR_TO_UINT(p) ((unsigned int) XPL_POINTER_TO_UINT_CAST (p)) -#define XPL_INT_TO_PTR(i) ((void*) XPL_POINTER_TO_INT_CAST (i)) -#define XPL_UINT_TO_PTR(i) ((void*) XPL_POINTER_TO_UINT_CAST (i)) - /* Branch hints */ #if defined(__GNUC__) && (__GNUC__ > 2) #define XPL_LIKELY(e) (__builtin_expect(!!(e), 1)) @@ -107,6 +92,8 @@ typedef unsigned short unicode; #define XPL_UNLIKELY(e) (e) #endif +#define EXPORT + /* Format string helpers */ #if defined(__GNUC__) && (__GNUC__ > 2) #define XPL_PRINTF(format_idx, arg_idx) __attribute__((__format__ (__printf__, format_idx, arg_idx))) @@ -139,7 +126,7 @@ typedef unsigned short unicode; #define MAXEMAILNAMESIZE 256 /* Packing/Byte order */ -#ifdef _BONGO_LINUX +#ifdef UNIX # define Xpl8BitPackedStructure __attribute__ ((aligned(1),packed)) # define Xpl64BitPackedStructure __attribute__ ((aligned(8),packed)) #elif defined WIN32 @@ -160,64 +147,19 @@ typedef unsigned short unicode; /* C Library functions */ -#ifdef _BONGO_HAVE_STRCASECMP # define XplStrCaseCmp(a,b) strcasecmp(a,b) -#elif defined(HAVE_STRICMP) -# define XplStrCaseCmp(a,b) stricmp(a,b) -#else -# error "XplStrCaseCmp is not implemented on this platform" -#endif - -#ifdef _BONGO_HAVE_STRNCASECMP # define XplStrNCaseCmp(a,b,c) strncasecmp(a,b,c) -#elif defined(HAVE_STRNICMP) -# define XplStrNCaseCmp(a,b,c) strnicmp(a,b,c) -#else -# error "XplStrNCaseCmp is not implemented on this platform" -#endif - -#ifdef _BONGO_HAVE_VSNPRINTF # define XplVsnprintf vsnprintf -#elif defined (HAVE__VSNPRINTF) -# define XplVsnprintf _vsnprintf -#endif - -#ifdef _BONGO_HAVE_GETTIMEOFDAY # define XplGetHighResolutionTimer() 0 # define XplGetHighResolutionTime(counter) { struct timeval tOfDaYs; \ gettimeofday(&tOfDaYs,NULL); \ (counter) = (time_t) tOfDaYs.tv_usec; \ } -#elif defined (WIN32) - - -# define XplGetHighResolutionTimer() 0 -# define XplGetHighResolutionTime(counter) { LARGE_INTEGER c; \ - if (QueryPerformanceCounter(&c) != 0) { \ - (counter) = c.LowPart; \ - } \ - } -#else -# error "XplGetHighResolutionTime is not implemented on this platform" -#endif - /* UI Definitions - need to reconsider these*/ -#ifdef _BONGO_HAVE_RINGTHEBELL -# define XplBell() XplBell() -#else # define XplBell() -#endif -#if defined WIN32 && (defined DEBUG || defined _DEBUG) - -void XplDebugOut(const char *Format, ...); -# define XplConsolePrintf XplDebugOut -#elif defined _BONGO_HAVE_CONSOLEPRINTF -# define XplConsolePrintf consoleprintf -#else # define XplConsolePrintf printf -#endif #ifdef HAVE_UNGETCHARACTER # define XplUngetCh(a) ungetcharacter((a)) @@ -235,7 +177,7 @@ int XplTruncate(const char *path, int64_t length); # define XPL_DIR_SEPARATOR '/' #endif -#ifdef _BONGO_LINUX +#ifdef UNIX #define XplFSeek64(FILEPTR, OFFSET, WHENCE) fseek(FILEPTR, OFFSET, WHENCE) @@ -276,15 +218,7 @@ XplDir *XplOpenDir(const char *dirname); XplDir *XplReadDir(XplDir *dirp); int XplCloseDir(XplDir *dirp); -#ifdef _BONGO_HAVE_FSYNC # define XplFlushWrites(fileptr) fsync(fileno(fileptr)) -#elif defined (_BONGO_HAVE_FEFLUSHWRITE) -# define XplFlushWrites(fileptr) FEFlushWrite(fileno(fileptr)) -#elif defined (HAVE__COMMIT) -# define XplFlushWrites(fileptr) _commit(fileno(fileptr)) -#else -# error "XplFlushWrites not defined for this platform" -#endif #if defined(_A_SUBDIR) # define XPL_A_SUBDIR _A_SUBDIR @@ -351,46 +285,21 @@ int XplGetCurrentOSLangaugeID(void); int XplReturnLanguageName(int lang, unsigned char *buffer); /* Time */ -#ifdef _BONGO_HAVE__CONVERTDOSTIMETOCALENDAR -# define XplCalendarTime(time) _ConvertDOSTimeToCalendar(time) -#elif defined (HAVE_DOS2CALENDAR) -# define XplCalendarTime(time) dos2calendar(time) -#else # define XplCalendarTime(time) (time) -#endif void XplDelaySelect(int msec); -#ifdef _BONGO_HAVE_DELAY -# define XplDelay(msec) delay(msec) -#elif defined (_BONGO_HAVE_SLEEP) -# define XplDelay(msec) Sleep(msec) -#elif defined (_BONGO_HAVE_NANOSLEEP) void XplDelayNanosleep(int msec); -# define XplDelay(msec) XplDelayNanosleep(msec) -#elif defined (_BONGO_HAVE_USLEEP) -# define XplDelay(msec) usleep((msec) * 1000) -#else -# define XplDelay(msec) XplDelaySelect(msec) -#endif +#define XplDelay(msec) XplDelayNanosleep(msec) /* Signal handling */ -#ifdef WIN32 -#define XplExit(ccode) exit(ccode) -#define XplSignalHandler(handler) signal(SIGTERM, (handler)); -#define XplSignalBlock() - -#else - #define XplExit(ccode) kill(getpid(), 9) typedef void (*XplShutdownFunc)(int Signal); void XplSignalCatcher(XplShutdownFunc ShutdownFunction); void XplSignalBlock(void); #define XplSignalHandler(handler) XplSignalCatcher((handler)); -#endif - #ifdef WIN32 #define XplUnloadApp(id) @@ -414,7 +323,7 @@ BOOL XplRWWriteLockAcquire(XplRWLock *RWLock); BOOL XplRWReadLockRelease(XplRWLock *RWLock); BOOL XplRWWriteLockRelease(XplRWLock *RWLock); -#ifdef _BONGO_LINUX +#ifdef UNIX #define s_addr_1 s_addr>>24 & 0xff #define s_addr_2 s_addr>>16 & 0xff @@ -422,7 +331,7 @@ BOOL XplRWWriteLockRelease(XplRWLock *RWLock); #define s_addr_4 s_addr & 0xff #ifndef s_net -#if _BONGO_XPL_LITTLE_ENDIAN +#ifdef _BONGO_XPL_LITTLE_ENDIAN #define s_net s_addr_4 #define s_host s_addr_3 @@ -441,46 +350,6 @@ BOOL XplRWWriteLockRelease(XplRWLock *RWLock); #endif #endif -/* Windows specifics */ - -#if defined(BONGO_HAVE__SNPRINTF) && !defined(_BONGO_HAVE_SNPRINTF) -#define snprintf _snprintf -#endif - -#ifndef _BONGO_HAVE_GMTIME_R -#define gmtime_r(in, out) { struct tm *tmp; tmp=gmtime((time_t *)in); if (!tmp) { time_t t=1; tmp=gmtime(&t);} memcpy(out, tmp, sizeof(struct tm)); } -#endif - -#ifndef _BONGO_HAVE_LOCALTIME_R -#define localtime_r(in, out) { struct tm *tmp; tmp=localtime((time_t *)in); if (!tmp) { time_t t=1; tmp=localtime(&t);} memcpy(out, tmp, sizeof(struct tm)); } -#endif - -#ifdef WIN32 -# define WIN_CDECL __cdecl -# define WIN_STDCALL __stdcall -# define EXPORT __declspec(dllexport) -# define IMPORT __declspec(dllimport) -#else -# define WIN_CDECL -# define WIN_STDCALL -# define EXPORT -# define IMPORT -#endif - -#ifndef ECONNABORTED -#define ECONNABORTED 130 -#endif - -#ifndef SIGHUP -/* Dummy */ -#define SIGHUP 1000 -#endif - -#ifndef SIGUSR1 -/* Dummy */ -#define SIGUSR1 10 -#endif - #ifdef __cplusplus #define XPL_BEGIN_C_LINKAGE extern "C" { #else diff --git a/m4/codeset.m4 b/m4/codeset.m4 deleted file mode 100644 index a6e67ec..0000000 --- a/m4/codeset.m4 +++ /dev/null @@ -1,21 +0,0 @@ -# codeset.m4 serial AM1 (gettext-0.10.40) -dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl From Bruno Haible. - -AC_DEFUN([AM_LANGINFO_CODESET], -[ - AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, - [AC_TRY_LINK([#include ], - [char* cs = nl_langinfo(CODESET);], - am_cv_langinfo_codeset=yes, - am_cv_langinfo_codeset=no) - ]) - if test $am_cv_langinfo_codeset = yes; then - AC_DEFINE(HAVE_LANGINFO_CODESET, 1, - [Define if you have and nl_langinfo(CODESET).]) - fi -]) diff --git a/m4/gcc_stack_protect.m4 b/m4/gcc_stack_protect.m4 deleted file mode 100644 index 70db1a5..0000000 --- a/m4/gcc_stack_protect.m4 +++ /dev/null @@ -1,114 +0,0 @@ -dnl -dnl Useful macros for autoconf to check for ssp-patched gcc -dnl 1.0 - September 2003 - Tiago Sousa -dnl 1.1 - August 2006 - Ted Percival -dnl * Stricter language checking (C or C++) -dnl * Adds GCC_STACK_PROTECT_LIB to add -lssp to LDFLAGS as necessary -dnl * Caches all results -dnl * Uses macros to ensure correct ouput in quiet/silent mode -dnl 1.2 - April 2007 - Ted Percival -dnl * Added GCC_STACK_PROTECTOR macro for simpler (one-line) invocation -dnl * GCC_STACK_PROTECT_LIB now adds -lssp to LIBS rather than LDFLAGS -dnl -dnl About ssp: -dnl GCC extension for protecting applications from stack-smashing attacks -dnl http://www.research.ibm.com/trl/projects/security/ssp/ -dnl -dnl Usage: -dnl Most people will simply call GCC_STACK_PROTECTOR. -dnl If you only use one of C or C++, you can save time by only calling the -dnl macro appropriate for that language. In that case you should also call -dnl GCC_STACK_PROTECT_LIB first. -dnl -dnl GCC_STACK_PROTECTOR -dnl Tries to turn on stack protection for C and C++ by calling the following -dnl three macros with the right languages. -dnl -dnl GCC_STACK_PROTECT_CC -dnl checks -fstack-protector with the C compiler, if it exists then updates -dnl CFLAGS and defines ENABLE_SSP_CC -dnl -dnl GCC_STACK_PROTECT_CXX -dnl checks -fstack-protector with the C++ compiler, if it exists then updates -dnl CXXFLAGS and defines ENABLE_SSP_CXX -dnl -dnl GCC_STACK_PROTECT_LIB -dnl adds -lssp to LIBS if it is available -dnl ssp is usually provided as part of libc, but was previously a separate lib -dnl It does not hurt to add -lssp even if libc provides SSP - in that case -dnl libssp will simply be ignored. -dnl - -AC_DEFUN([GCC_STACK_PROTECT_LIB],[ - AC_CACHE_CHECK([whether libssp exists], ssp_cv_lib, - [ssp_old_libs="$LIBS" - LIBS="$LIBS -lssp" - AC_TRY_LINK(,, ssp_cv_lib=yes, ssp_cv_lib=no) - LIBS="$ssp_old_libs" - ]) - if test $ssp_cv_lib = yes; then - LIBS="$LIBS -lssp" - fi -]) - -AC_DEFUN([GCC_STACK_PROTECT_CC],[ - AC_LANG_ASSERT(C) - if test "X$CC" != "X"; then - AC_CACHE_CHECK([whether ${CC} accepts -fstack-protector], - ssp_cv_cc, - [ssp_old_cflags="$CFLAGS" - CFLAGS="$CFLAGS -fstack-protector" - AC_TRY_COMPILE(,, ssp_cv_cc=yes, ssp_cv_cc=no) - CFLAGS="$ssp_old_cflags" - ]) - if test $ssp_cv_cc = yes; then - CFLAGS="$CFLAGS -fstack-protector" - AC_DEFINE([ENABLE_SSP_CC], 1, [Define if SSP C support is enabled.]) - fi - fi -]) - -AC_DEFUN([GCC_STACK_PROTECT_CXX],[ - AC_LANG_ASSERT(C++) - if test "X$CXX" != "X"; then - AC_CACHE_CHECK([whether ${CXX} accepts -fstack-protector], - ssp_cv_cxx, - [ssp_old_cxxflags="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS -fstack-protector" - AC_TRY_COMPILE(,, ssp_cv_cxx=yes, ssp_cv_cxx=no) - CXXFLAGS="$ssp_old_cxxflags" - ]) - if test $ssp_cv_cxx = yes; then - CXXFLAGS="$CXXFLAGS -fstack-protector" - AC_DEFINE([ENABLE_SSP_CXX], 1, [Define if SSP C++ support is enabled.]) - fi - fi -]) - -dnl By default, we don't enable unless we're on glibc 2.5 or better. -dnl For some reason, linking on Debian etch (glibc=2.3, gcc=4.1) completely -dnl fails unless -shared is in CCLD/CXXLD, but setting that flag causes -dnl other configure tests to fail :( For now, I'm giving up on those -dnl old versions since time will fix this bug for us (I hope!) - -AC_DEFUN([GCC_STACK_PROTECTOR],[ - dnl -lssp shouldn't even be needed on recent glibc/gcc - dnl GCC_STACK_PROTECT_LIB - - AC_MSG_CHECKING([for GNU libc 2.4 or better]) - AC_EGREP_CPP(yes, [ - #include - #if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 4 - yes - #endif], [glibc_24=yes; AC_MSG_RESULT(yes)], AC_MSG_RESULT(no)) - if test "x$glibc_24" == "xyes"; then - AC_LANG_PUSH([C]) - GCC_STACK_PROTECT_CC - AC_LANG_POP([C]) - - AC_LANG_PUSH([C++]) - GCC_STACK_PROTECT_CXX - AC_LANG_POP([C++]) - fi -]) - diff --git a/m4/gettext.m4 b/m4/gettext.m4 deleted file mode 100644 index 624a807..0000000 --- a/m4/gettext.m4 +++ /dev/null @@ -1,549 +0,0 @@ -# gettext.m4 serial 37 (gettext-0.14.4) -dnl Copyright (C) 1995-2005 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. -dnl -dnl This file can can be used in projects which are not available under -dnl the GNU General Public License or the GNU Library General Public -dnl License but which still want to provide support for the GNU gettext -dnl functionality. -dnl Please note that the actual code of the GNU gettext library is covered -dnl by the GNU Library General Public License, and the rest of the GNU -dnl gettext package package is covered by the GNU General Public License. -dnl They are *not* in the public domain. - -dnl Authors: -dnl Ulrich Drepper , 1995-2000. -dnl Bruno Haible , 2000-2003. - -dnl Macro to add for using GNU gettext. - -dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]). -dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The -dnl default (if it is not specified or empty) is 'no-libtool'. -dnl INTLSYMBOL should be 'external' for packages with no intl directory, -dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory. -dnl If INTLSYMBOL is 'use-libtool', then a libtool library -dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static, -dnl depending on --{enable,disable}-{shared,static} and on the presence of -dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library -dnl $(top_builddir)/intl/libintl.a will be created. -dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext -dnl implementations (in libc or libintl) without the ngettext() function -dnl will be ignored. If NEEDSYMBOL is specified and is -dnl 'need-formatstring-macros', then GNU gettext implementations that don't -dnl support the ISO C 99 formatstring macros will be ignored. -dnl INTLDIR is used to find the intl libraries. If empty, -dnl the value `$(top_builddir)/intl/' is used. -dnl -dnl The result of the configuration is one of three cases: -dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled -dnl and used. -dnl Catalog format: GNU --> install in $(datadir) -dnl Catalog extension: .mo after installation, .gmo in source tree -dnl 2) GNU gettext has been found in the system's C library. -dnl Catalog format: GNU --> install in $(datadir) -dnl Catalog extension: .mo after installation, .gmo in source tree -dnl 3) No internationalization, always use English msgid. -dnl Catalog format: none -dnl Catalog extension: none -dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur. -dnl The use of .gmo is historical (it was needed to avoid overwriting the -dnl GNU format catalogs when building on a platform with an X/Open gettext), -dnl but we keep it in order not to force irrelevant filename changes on the -dnl maintainers. -dnl -AC_DEFUN([AM_GNU_GETTEXT], -[ - dnl Argument checking. - ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], , - [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT -])])])])]) - ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], , - [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT -])])])]) - define([gt_included_intl], ifelse([$1], [external], [no], [yes])) - define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], [])) - - AC_REQUIRE([AM_PO_SUBDIRS])dnl - ifelse(gt_included_intl, yes, [ - AC_REQUIRE([AM_INTL_SUBDIR])dnl - ]) - - dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. - AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) - AC_REQUIRE([AC_LIB_RPATH]) - - dnl Sometimes libintl requires libiconv, so first search for libiconv. - dnl Ideally we would do this search only after the - dnl if test "$USE_NLS" = "yes"; then - dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then - dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT - dnl the configure script would need to contain the same shell code - dnl again, outside any 'if'. There are two solutions: - dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'. - dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE. - dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not - dnl documented, we avoid it. - ifelse(gt_included_intl, yes, , [ - AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) - ]) - - dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation. - gt_INTL_MACOSX - - dnl Set USE_NLS. - AM_NLS - - ifelse(gt_included_intl, yes, [ - BUILD_INCLUDED_LIBINTL=no - USE_INCLUDED_LIBINTL=no - ]) - LIBINTL= - LTLIBINTL= - POSUB= - - dnl If we use NLS figure out what method - if test "$USE_NLS" = "yes"; then - gt_use_preinstalled_gnugettext=no - ifelse(gt_included_intl, yes, [ - AC_MSG_CHECKING([whether included gettext is requested]) - AC_ARG_WITH(included-gettext, - [ --with-included-gettext use the GNU gettext library included here], - nls_cv_force_use_gnu_gettext=$withval, - nls_cv_force_use_gnu_gettext=no) - AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) - - nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" - if test "$nls_cv_force_use_gnu_gettext" != "yes"; then - ]) - dnl User does not insist on using GNU NLS library. Figure out what - dnl to use. If GNU gettext is available we use this. Else we have - dnl to fall back to GNU NLS library. - - dnl Add a version number to the cache macros. - define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1))) - define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc]) - define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl]) - - AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc, - [AC_TRY_LINK([#include -]ifelse([$2], [need-formatstring-macros], -[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION -#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) -#endif -changequote(,)dnl -typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; -changequote([,])dnl -], [])[extern int _nl_msg_cat_cntr; -extern int *_nl_domain_bindings;], - [bindtextdomain ("", ""); -return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings], - gt_cv_func_gnugettext_libc=yes, - gt_cv_func_gnugettext_libc=no)]) - - if test "$gt_cv_func_gnugettext_libc" != "yes"; then - dnl Sometimes libintl requires libiconv, so first search for libiconv. - ifelse(gt_included_intl, yes, , [ - AM_ICONV_LINK - ]) - dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL - dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv]) - dnl because that would add "-liconv" to LIBINTL and LTLIBINTL - dnl even if libiconv doesn't exist. - AC_LIB_LINKFLAGS_BODY([intl]) - AC_CACHE_CHECK([for GNU gettext in libintl], - gt_cv_func_gnugettext_libintl, - [gt_save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $INCINTL" - gt_save_LIBS="$LIBS" - LIBS="$LIBS $LIBINTL" - dnl Now see whether libintl exists and does not depend on libiconv. - AC_TRY_LINK([#include -]ifelse([$2], [need-formatstring-macros], -[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION -#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) -#endif -changequote(,)dnl -typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; -changequote([,])dnl -], [])[extern int _nl_msg_cat_cntr; -extern -#ifdef __cplusplus -"C" -#endif -const char *_nl_expand_alias (const char *);], - [bindtextdomain ("", ""); -return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias ("")], - gt_cv_func_gnugettext_libintl=yes, - gt_cv_func_gnugettext_libintl=no) - dnl Now see whether libintl exists and depends on libiconv. - if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then - LIBS="$LIBS $LIBICONV" - AC_TRY_LINK([#include -]ifelse([$2], [need-formatstring-macros], -[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION -#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) -#endif -changequote(,)dnl -typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; -changequote([,])dnl -], [])[extern int _nl_msg_cat_cntr; -extern -#ifdef __cplusplus -"C" -#endif -const char *_nl_expand_alias (const char *);], - [bindtextdomain ("", ""); -return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias ("")], - [LIBINTL="$LIBINTL $LIBICONV" - LTLIBINTL="$LTLIBINTL $LTLIBICONV" - gt_cv_func_gnugettext_libintl=yes - ]) - fi - CPPFLAGS="$gt_save_CPPFLAGS" - LIBS="$gt_save_LIBS"]) - fi - - dnl If an already present or preinstalled GNU gettext() is found, - dnl use it. But if this macro is used in GNU gettext, and GNU - dnl gettext is already preinstalled in libintl, we update this - dnl libintl. (Cf. the install rule in intl/Makefile.in.) - if test "$gt_cv_func_gnugettext_libc" = "yes" \ - || { test "$gt_cv_func_gnugettext_libintl" = "yes" \ - && test "$PACKAGE" != gettext-runtime \ - && test "$PACKAGE" != gettext-tools; }; then - gt_use_preinstalled_gnugettext=yes - else - dnl Reset the values set by searching for libintl. - LIBINTL= - LTLIBINTL= - INCINTL= - fi - - ifelse(gt_included_intl, yes, [ - if test "$gt_use_preinstalled_gnugettext" != "yes"; then - dnl GNU gettext is not found in the C library. - dnl Fall back on included GNU gettext library. - nls_cv_use_gnu_gettext=yes - fi - fi - - if test "$nls_cv_use_gnu_gettext" = "yes"; then - dnl Mark actions used to generate GNU NLS library. - BUILD_INCLUDED_LIBINTL=yes - USE_INCLUDED_LIBINTL=yes - LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV" - LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV" - LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` - fi - - CATOBJEXT= - if test "$gt_use_preinstalled_gnugettext" = "yes" \ - || test "$nls_cv_use_gnu_gettext" = "yes"; then - dnl Mark actions to use GNU gettext tools. - CATOBJEXT=.gmo - fi - ]) - - if test -n "$INTL_MACOSX_LIBS"; then - if test "$gt_use_preinstalled_gnugettext" = "yes" \ - || test "$nls_cv_use_gnu_gettext" = "yes"; then - dnl Some extra flags are needed during linking. - LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" - LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" - fi - fi - - if test "$gt_use_preinstalled_gnugettext" = "yes" \ - || test "$nls_cv_use_gnu_gettext" = "yes"; then - AC_DEFINE(ENABLE_NLS, 1, - [Define to 1 if translation of program messages to the user's native language - is requested.]) - else - USE_NLS=no - fi - fi - - AC_MSG_CHECKING([whether to use NLS]) - AC_MSG_RESULT([$USE_NLS]) - if test "$USE_NLS" = "yes"; then - AC_MSG_CHECKING([where the gettext function comes from]) - if test "$gt_use_preinstalled_gnugettext" = "yes"; then - if test "$gt_cv_func_gnugettext_libintl" = "yes"; then - gt_source="external libintl" - else - gt_source="libc" - fi - else - gt_source="included intl directory" - fi - AC_MSG_RESULT([$gt_source]) - fi - - if test "$USE_NLS" = "yes"; then - - if test "$gt_use_preinstalled_gnugettext" = "yes"; then - if test "$gt_cv_func_gnugettext_libintl" = "yes"; then - AC_MSG_CHECKING([how to link with libintl]) - AC_MSG_RESULT([$LIBINTL]) - AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL]) - fi - - dnl For backward compatibility. Some packages may be using this. - AC_DEFINE(HAVE_GETTEXT, 1, - [Define if the GNU gettext() function is already present or preinstalled.]) - AC_DEFINE(HAVE_DCGETTEXT, 1, - [Define if the GNU dcgettext() function is already present or preinstalled.]) - fi - - dnl We need to process the po/ directory. - POSUB=po - fi - - ifelse(gt_included_intl, yes, [ - dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL - dnl to 'yes' because some of the testsuite requires it. - if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then - BUILD_INCLUDED_LIBINTL=yes - fi - - dnl Make all variables we use known to autoconf. - AC_SUBST(BUILD_INCLUDED_LIBINTL) - AC_SUBST(USE_INCLUDED_LIBINTL) - AC_SUBST(CATOBJEXT) - - dnl For backward compatibility. Some configure.ins may be using this. - nls_cv_header_intl= - nls_cv_header_libgt= - - dnl For backward compatibility. Some Makefiles may be using this. - DATADIRNAME=share - AC_SUBST(DATADIRNAME) - - dnl For backward compatibility. Some Makefiles may be using this. - INSTOBJEXT=.mo - AC_SUBST(INSTOBJEXT) - - dnl For backward compatibility. Some Makefiles may be using this. - GENCAT=gencat - AC_SUBST(GENCAT) - - dnl For backward compatibility. Some Makefiles may be using this. - INTLOBJS= - if test "$USE_INCLUDED_LIBINTL" = yes; then - INTLOBJS="\$(GETTOBJS)" - fi - AC_SUBST(INTLOBJS) - - dnl Enable libtool support if the surrounding package wishes it. - INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix - AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX) - ]) - - dnl For backward compatibility. Some Makefiles may be using this. - INTLLIBS="$LIBINTL" - AC_SUBST(INTLLIBS) - - dnl Make all documented variables known to autoconf. - AC_SUBST(LIBINTL) - AC_SUBST(LTLIBINTL) - AC_SUBST(POSUB) -]) - - -dnl Checks for all prerequisites of the intl subdirectory, -dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS, -dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL. -AC_DEFUN([AM_INTL_SUBDIR], -[ - AC_REQUIRE([AC_PROG_INSTALL])dnl - AC_REQUIRE([AM_MKINSTALLDIRS])dnl - AC_REQUIRE([AC_PROG_CC])dnl - AC_REQUIRE([AC_CANONICAL_HOST])dnl - AC_REQUIRE([gt_GLIBC2])dnl - AC_REQUIRE([AC_PROG_RANLIB])dnl - AC_REQUIRE([AC_ISC_POSIX])dnl - AC_REQUIRE([AC_HEADER_STDC])dnl - AC_REQUIRE([AC_C_CONST])dnl - AC_REQUIRE([bh_C_SIGNED])dnl - AC_REQUIRE([AC_C_INLINE])dnl - AC_REQUIRE([AC_TYPE_OFF_T])dnl - AC_REQUIRE([AC_TYPE_SIZE_T])dnl - AC_REQUIRE([gl_AC_TYPE_LONG_LONG])dnl - AC_REQUIRE([gt_TYPE_LONGDOUBLE])dnl - AC_REQUIRE([gt_TYPE_WCHAR_T])dnl - AC_REQUIRE([gt_TYPE_WINT_T])dnl - AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) - AC_REQUIRE([gl_AC_HEADER_STDINT_H]) - AC_REQUIRE([gt_TYPE_INTMAX_T]) - AC_REQUIRE([gt_PRINTF_POSIX]) - AC_REQUIRE([AC_FUNC_ALLOCA])dnl - AC_REQUIRE([AC_FUNC_MMAP])dnl - AC_REQUIRE([gl_GLIBC21])dnl - AC_REQUIRE([gt_INTDIV0])dnl - AC_REQUIRE([gl_AC_TYPE_UINTMAX_T])dnl - AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl - AC_REQUIRE([gt_INTTYPES_PRI])dnl - AC_REQUIRE([gl_XSIZE])dnl - AC_REQUIRE([gt_INTL_MACOSX])dnl - - AC_CHECK_TYPE([ptrdiff_t], , - [AC_DEFINE([ptrdiff_t], [long], - [Define as the type of the result of subtracting two pointers, if the system doesn't define it.]) - ]) - AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \ -stdlib.h string.h unistd.h sys/param.h]) - AC_CHECK_FUNCS([asprintf fwprintf getcwd getegid geteuid getgid getuid \ -mempcpy munmap putenv setenv setlocale snprintf stpcpy strcasecmp strdup \ -strtoul tsearch wcslen __argz_count __argz_stringify __argz_next \ -__fsetlocking]) - - dnl Use the _snprintf function only if it is declared (because on NetBSD it - dnl is defined as a weak alias of snprintf; we prefer to use the latter). - gt_CHECK_DECL(_snprintf, [#include ]) - gt_CHECK_DECL(_snwprintf, [#include ]) - - dnl Use the *_unlocked functions only if they are declared. - dnl (because some of them were defined without being declared in Solaris - dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built - dnl on Solaris 2.5.1 to run on Solaris 2.6). - dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13. - gt_CHECK_DECL(feof_unlocked, [#include ]) - gt_CHECK_DECL(fgets_unlocked, [#include ]) - gt_CHECK_DECL(getc_unlocked, [#include ]) - - case $gt_cv_func_printf_posix in - *yes) HAVE_POSIX_PRINTF=1 ;; - *) HAVE_POSIX_PRINTF=0 ;; - esac - AC_SUBST([HAVE_POSIX_PRINTF]) - if test "$ac_cv_func_asprintf" = yes; then - HAVE_ASPRINTF=1 - else - HAVE_ASPRINTF=0 - fi - AC_SUBST([HAVE_ASPRINTF]) - if test "$ac_cv_func_snprintf" = yes; then - HAVE_SNPRINTF=1 - else - HAVE_SNPRINTF=0 - fi - AC_SUBST([HAVE_SNPRINTF]) - if test "$ac_cv_func_wprintf" = yes; then - HAVE_WPRINTF=1 - else - HAVE_WPRINTF=0 - fi - AC_SUBST([HAVE_WPRINTF]) - - AM_ICONV - AM_LANGINFO_CODESET - if test $ac_cv_header_locale_h = yes; then - gt_LC_MESSAGES - fi - - if test -n "$INTL_MACOSX_LIBS"; then - CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers" - fi - - dnl intl/plural.c is generated from intl/plural.y. It requires bison, - dnl because plural.y uses bison specific features. It requires at least - dnl bison-1.26 because earlier versions generate a plural.c that doesn't - dnl compile. - dnl bison is only needed for the maintainer (who touches plural.y). But in - dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put - dnl the rule in general Makefile. Now, some people carelessly touch the - dnl files or have a broken "make" program, hence the plural.c rule will - dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not - dnl present or too old. - AC_CHECK_PROGS([INTLBISON], [bison]) - if test -z "$INTLBISON"; then - ac_verc_fail=yes - else - dnl Found it, now check the version. - AC_MSG_CHECKING([version of bison]) -changequote(<<,>>)dnl - ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'` - case $ac_prog_version in - '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; - 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*) -changequote([,])dnl - ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; - *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; - esac - AC_MSG_RESULT([$ac_prog_version]) - fi - if test $ac_verc_fail = yes; then - INTLBISON=: - fi -]) - - -dnl Checks for special options needed on MacOS X. -dnl Defines INTL_MACOSX_LIBS. -AC_DEFUN([gt_INTL_MACOSX], -[ - dnl Check for API introduced in MacOS X 10.2. - AC_CACHE_CHECK([for CFPreferencesCopyAppValue], - gt_cv_func_CFPreferencesCopyAppValue, - [gt_save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers" - gt_save_LIBS="$LIBS" - LIBS="$LIBS -framework CoreFoundation" - AC_TRY_LINK([#include ], - [CFPreferencesCopyAppValue(NULL, NULL)], - [gt_cv_func_CFPreferencesCopyAppValue=yes], - [gt_cv_func_CFPreferencesCopyAppValue=no]) - CPPFLAGS="$gt_save_CPPFLAGS" - LIBS="$gt_save_LIBS"]) - if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then - AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], 1, - [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.]) - fi - dnl Check for API introduced in MacOS X 10.3. - AC_CACHE_CHECK([for CFLocaleCopyCurrent], gt_cv_func_CFLocaleCopyCurrent, - [gt_save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers" - gt_save_LIBS="$LIBS" - LIBS="$LIBS -framework CoreFoundation" - AC_TRY_LINK([#include ], [CFLocaleCopyCurrent();], - [gt_cv_func_CFLocaleCopyCurrent=yes], - [gt_cv_func_CFLocaleCopyCurrent=no]) - CPPFLAGS="$gt_save_CPPFLAGS" - LIBS="$gt_save_LIBS"]) - if test $gt_cv_func_CFLocaleCopyCurrent = yes; then - AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], 1, - [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.]) - fi - INTL_MACOSX_LIBS= - if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then - INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" - fi - AC_SUBST([INTL_MACOSX_LIBS]) -]) - - -dnl gt_CHECK_DECL(FUNC, INCLUDES) -dnl Check whether a function is declared. -AC_DEFUN([gt_CHECK_DECL], -[ - AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1, - [AC_TRY_COMPILE([$2], [ -#ifndef $1 - char *p = (char *) $1; -#endif -], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)]) - if test $ac_cv_have_decl_$1 = yes; then - gt_value=1 - else - gt_value=0 - fi - AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value], - [Define to 1 if you have the declaration of `$1', and to 0 if you don't.]) -]) - - -dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) -AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) diff --git a/m4/glibc2.m4 b/m4/glibc2.m4 deleted file mode 100644 index e8f5bfe..0000000 --- a/m4/glibc2.m4 +++ /dev/null @@ -1,30 +0,0 @@ -# glibc2.m4 serial 1 -dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -# Test for the GNU C Library, version 2.0 or newer. -# From Bruno Haible. - -AC_DEFUN([gt_GLIBC2], - [ - AC_CACHE_CHECK(whether we are using the GNU C Library 2 or newer, - ac_cv_gnu_library_2, - [AC_EGREP_CPP([Lucky GNU user], - [ -#include -#ifdef __GNU_LIBRARY__ - #if (__GLIBC__ >= 2) - Lucky GNU user - #endif -#endif - ], - ac_cv_gnu_library_2=yes, - ac_cv_gnu_library_2=no) - ] - ) - AC_SUBST(GLIBC2) - GLIBC2="$ac_cv_gnu_library_2" - ] -) diff --git a/m4/glibc21.m4 b/m4/glibc21.m4 deleted file mode 100644 index d95fd98..0000000 --- a/m4/glibc21.m4 +++ /dev/null @@ -1,30 +0,0 @@ -# glibc21.m4 serial 3 -dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -# Test for the GNU C Library, version 2.1 or newer. -# From Bruno Haible. - -AC_DEFUN([gl_GLIBC21], - [ - AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer, - ac_cv_gnu_library_2_1, - [AC_EGREP_CPP([Lucky GNU user], - [ -#include -#ifdef __GNU_LIBRARY__ - #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) - Lucky GNU user - #endif -#endif - ], - ac_cv_gnu_library_2_1=yes, - ac_cv_gnu_library_2_1=no) - ] - ) - AC_SUBST(GLIBC21) - GLIBC21="$ac_cv_gnu_library_2_1" - ] -) diff --git a/m4/gmime.m4 b/m4/gmime.m4 deleted file mode 100644 index 1365986..0000000 --- a/m4/gmime.m4 +++ /dev/null @@ -1,40 +0,0 @@ -dnl Check for GMime Library. - -AC_DEFUN([AC_CHECK_GMIME], [ - have_gmime="no" - ac_gmime="no" - - # exported variables - GMIME_LIBS="" - GMIME_CFLAGS="" - - AC_ARG_WITH(gmime, AC_HELP_STRING([--with-gmime[=dir]], [Compile with libgmime at given dir]), - [ ac_gmime="$withval" - if test "x$withval" != "xno" -a "x$withval" != "xyes"; then - ac_gmime="yes" - ac_gmime_dir=$withval - fi ], - [ ac_gmime="auto" ] ) - - if test "x$PKG_CONFIG" != "xno"; then - if test "x$ac_gmime" = "xyes"; then - ac_gmime_tmppkgconfig=$PKG_CONFIG_PATH - export PKG_CONFIG_PATH=${ac_gmime_dir}/lib/pkgconfig/ - echo Setting path to $PKG_CONFIG_PATH - PKG_CHECK_MODULES(GMIME, gmime-2.4, , - [ - PKG_CHECK_MODULES(GMIME, gmime-2.0, ac_gmime="no") - ]) - export PKG_CONFIG_PATH=$ac_gmime_tmppkgconfig - fi - - if test "x$ac_gmime" = "xauto"; then - PKG_CHECK_MODULES(GMIME, gmime-2.4, , - [ - PKG_CHECK_MODULES(GMIME, gmime-2.0, ac_gmime="no") - ]) - fi - fi - - AC_MSG_RESULT([$ac_gmime]) -]) diff --git a/m4/iconv.m4 b/m4/iconv.m4 deleted file mode 100644 index 654c415..0000000 --- a/m4/iconv.m4 +++ /dev/null @@ -1,101 +0,0 @@ -# iconv.m4 serial AM4 (gettext-0.11.3) -dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl From Bruno Haible. - -AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], -[ - dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. - AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) - AC_REQUIRE([AC_LIB_RPATH]) - - dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV - dnl accordingly. - AC_LIB_LINKFLAGS_BODY([iconv]) -]) - -AC_DEFUN([AM_ICONV_LINK], -[ - dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and - dnl those with the standalone portable GNU libiconv installed). - - dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV - dnl accordingly. - AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) - - dnl Add $INCICONV to CPPFLAGS before performing the following checks, - dnl because if the user has installed libiconv and not disabled its use - dnl via --without-libiconv-prefix, he wants to use it. The first - dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed. - am_save_CPPFLAGS="$CPPFLAGS" - AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) - - AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [ - am_cv_func_iconv="no, consider installing GNU libiconv" - am_cv_lib_iconv=no - AC_TRY_LINK([#include -#include ], - [iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd);], - am_cv_func_iconv=yes) - if test "$am_cv_func_iconv" != yes; then - am_save_LIBS="$LIBS" - LIBS="$LIBS $LIBICONV" - AC_TRY_LINK([#include -#include ], - [iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd);], - am_cv_lib_iconv=yes - am_cv_func_iconv=yes) - LIBS="$am_save_LIBS" - fi - ]) - if test "$am_cv_func_iconv" = yes; then - AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) - fi - if test "$am_cv_lib_iconv" = yes; then - AC_MSG_CHECKING([how to link with libiconv]) - AC_MSG_RESULT([$LIBICONV]) - else - dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV - dnl either. - CPPFLAGS="$am_save_CPPFLAGS" - LIBICONV= - LTLIBICONV= - fi - AC_SUBST(LIBICONV) - AC_SUBST(LTLIBICONV) -]) - -AC_DEFUN([AM_ICONV], -[ - AM_ICONV_LINK - if test "$am_cv_func_iconv" = yes; then - AC_MSG_CHECKING([for iconv declaration]) - AC_CACHE_VAL(am_cv_proto_iconv, [ - AC_TRY_COMPILE([ -#include -#include -extern -#ifdef __cplusplus -"C" -#endif -#if defined(__STDC__) || defined(__cplusplus) -size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); -#else -size_t iconv(); -#endif -], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") - am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) - am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` - AC_MSG_RESULT([$]{ac_t:- - }[$]am_cv_proto_iconv) - AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, - [Define as const if the declaration of iconv() needs const.]) - fi -]) diff --git a/m4/intdiv0.m4 b/m4/intdiv0.m4 deleted file mode 100644 index b8d7817..0000000 --- a/m4/intdiv0.m4 +++ /dev/null @@ -1,70 +0,0 @@ -# intdiv0.m4 serial 1 (gettext-0.11.3) -dnl Copyright (C) 2002 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl From Bruno Haible. - -AC_DEFUN([gt_INTDIV0], -[ - AC_REQUIRE([AC_PROG_CC])dnl - AC_REQUIRE([AC_CANONICAL_HOST])dnl - - AC_CACHE_CHECK([whether integer division by zero raises SIGFPE], - gt_cv_int_divbyzero_sigfpe, - [ - AC_TRY_RUN([ -#include -#include - -static void -#ifdef __cplusplus -sigfpe_handler (int sig) -#else -sigfpe_handler (sig) int sig; -#endif -{ - /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */ - exit (sig != SIGFPE); -} - -int x = 1; -int y = 0; -int z; -int nan; - -int main () -{ - signal (SIGFPE, sigfpe_handler); -/* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */ -#if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP) - signal (SIGTRAP, sigfpe_handler); -#endif -/* Linux/SPARC yields signal SIGILL. */ -#if defined (__sparc__) && defined (__linux__) - signal (SIGILL, sigfpe_handler); -#endif - - z = x / y; - nan = y / y; - exit (1); -} -], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no, - [ - # Guess based on the CPU. - case "$host_cpu" in - alpha* | i[34567]86 | m68k | s390*) - gt_cv_int_divbyzero_sigfpe="guessing yes";; - *) - gt_cv_int_divbyzero_sigfpe="guessing no";; - esac - ]) - ]) - case "$gt_cv_int_divbyzero_sigfpe" in - *yes) value=1;; - *) value=0;; - esac - AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value, - [Define if integer division by zero raises signal SIGFPE.]) -]) diff --git a/m4/intmax.m4 b/m4/intmax.m4 deleted file mode 100644 index d99c999..0000000 --- a/m4/intmax.m4 +++ /dev/null @@ -1,30 +0,0 @@ -# intmax.m4 serial 2 (gettext-0.14.2) -dnl Copyright (C) 2002-2005 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl From Bruno Haible. -dnl Test whether the system has the 'intmax_t' type, but don't attempt to -dnl find a replacement if it is lacking. - -AC_DEFUN([gt_TYPE_INTMAX_T], -[ - AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) - AC_REQUIRE([gl_AC_HEADER_STDINT_H]) - AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t, - [AC_TRY_COMPILE([ -#include -#include -#if HAVE_STDINT_H_WITH_UINTMAX -#include -#endif -#if HAVE_INTTYPES_H_WITH_UINTMAX -#include -#endif -], [intmax_t x = -1;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)]) - if test $gt_cv_c_intmax_t = yes; then - AC_DEFINE(HAVE_INTMAX_T, 1, - [Define if you have the 'intmax_t' type in or .]) - fi -]) diff --git a/m4/inttypes-pri.m4 b/m4/inttypes-pri.m4 deleted file mode 100644 index 4d56a9a..0000000 --- a/m4/inttypes-pri.m4 +++ /dev/null @@ -1,30 +0,0 @@ -# inttypes-pri.m4 serial 1 (gettext-0.11.4) -dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl From Bruno Haible. - -# Define PRI_MACROS_BROKEN if exists and defines the PRI* -# macros to non-string values. This is the case on AIX 4.3.3. - -AC_DEFUN([gt_INTTYPES_PRI], -[ - AC_REQUIRE([gt_HEADER_INTTYPES_H]) - if test $gt_cv_header_inttypes_h = yes; then - AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken], - gt_cv_inttypes_pri_broken, - [ - AC_TRY_COMPILE([#include -#ifdef PRId32 -char *p = PRId32; -#endif -], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes) - ]) - fi - if test "$gt_cv_inttypes_pri_broken" = yes; then - AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1, - [Define if exists and defines unusable PRI* macros.]) - fi -]) diff --git a/m4/inttypes.m4 b/m4/inttypes.m4 deleted file mode 100644 index 779bcea..0000000 --- a/m4/inttypes.m4 +++ /dev/null @@ -1,25 +0,0 @@ -# inttypes.m4 serial 1 (gettext-0.11.4) -dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl From Paul Eggert. - -# Define HAVE_INTTYPES_H if exists and doesn't clash with -# . - -AC_DEFUN([gt_HEADER_INTTYPES_H], -[ - AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h, - [ - AC_TRY_COMPILE( - [#include -#include ], - [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no) - ]) - if test $gt_cv_header_inttypes_h = yes; then - AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1, - [Define if exists and doesn't clash with .]) - fi -]) diff --git a/m4/inttypes_h.m4 b/m4/inttypes_h.m4 deleted file mode 100644 index a5d075d..0000000 --- a/m4/inttypes_h.m4 +++ /dev/null @@ -1,26 +0,0 @@ -# inttypes_h.m4 serial 6 -dnl Copyright (C) 1997-2004 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl From Paul Eggert. - -# Define HAVE_INTTYPES_H_WITH_UINTMAX if exists, -# doesn't clash with , and declares uintmax_t. - -AC_DEFUN([gl_AC_HEADER_INTTYPES_H], -[ - AC_CACHE_CHECK([for inttypes.h], gl_cv_header_inttypes_h, - [AC_TRY_COMPILE( - [#include -#include ], - [uintmax_t i = (uintmax_t) -1;], - gl_cv_header_inttypes_h=yes, - gl_cv_header_inttypes_h=no)]) - if test $gl_cv_header_inttypes_h = yes; then - AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1, - [Define if exists, doesn't clash with , - and declares uintmax_t. ]) - fi -]) diff --git a/m4/isc-posix.m4 b/m4/isc-posix.m4 deleted file mode 100644 index 74dc8f2..0000000 --- a/m4/isc-posix.m4 +++ /dev/null @@ -1,24 +0,0 @@ -# isc-posix.m4 serial 2 (gettext-0.11.2) -dnl Copyright (C) 1995-2002 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -# This file is not needed with autoconf-2.53 and newer. Remove it in 2005. - -# This test replaces the one in autoconf. -# Currently this macro should have the same name as the autoconf macro -# because gettext's gettext.m4 (distributed in the automake package) -# still uses it. Otherwise, the use in gettext.m4 makes autoheader -# give these diagnostics: -# configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX -# configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX - -undefine([AC_ISC_POSIX]) - -AC_DEFUN([AC_ISC_POSIX], - [ - dnl This test replaces the obsolescent AC_ISC_POSIX kludge. - AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"]) - ] -) diff --git a/m4/lcmessage.m4 b/m4/lcmessage.m4 deleted file mode 100644 index 19aa77e..0000000 --- a/m4/lcmessage.m4 +++ /dev/null @@ -1,30 +0,0 @@ -# lcmessage.m4 serial 4 (gettext-0.14.2) -dnl Copyright (C) 1995-2002, 2004-2005 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. -dnl -dnl This file can can be used in projects which are not available under -dnl the GNU General Public License or the GNU Library General Public -dnl License but which still want to provide support for the GNU gettext -dnl functionality. -dnl Please note that the actual code of the GNU gettext library is covered -dnl by the GNU Library General Public License, and the rest of the GNU -dnl gettext package package is covered by the GNU General Public License. -dnl They are *not* in the public domain. - -dnl Authors: -dnl Ulrich Drepper , 1995. - -# Check whether LC_MESSAGES is available in . - -AC_DEFUN([gt_LC_MESSAGES], -[ - AC_CACHE_CHECK([for LC_MESSAGES], gt_cv_val_LC_MESSAGES, - [AC_TRY_LINK([#include ], [return LC_MESSAGES], - gt_cv_val_LC_MESSAGES=yes, gt_cv_val_LC_MESSAGES=no)]) - if test $gt_cv_val_LC_MESSAGES = yes; then - AC_DEFINE(HAVE_LC_MESSAGES, 1, - [Define if your file defines LC_MESSAGES.]) - fi -]) diff --git a/m4/lib-ld.m4 b/m4/lib-ld.m4 deleted file mode 100644 index 96c4e2c..0000000 --- a/m4/lib-ld.m4 +++ /dev/null @@ -1,110 +0,0 @@ -# lib-ld.m4 serial 3 (gettext-0.13) -dnl Copyright (C) 1996-2003 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl Subroutines of libtool.m4, -dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision -dnl with libtool.m4. - -dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. -AC_DEFUN([AC_LIB_PROG_LD_GNU], -[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld, -[# I'd rather use --version here, but apparently some GNU ld's only accept -v. -case `$LD -v 2>&1 conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by GCC]) - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [[\\/]* | [A-Za-z]:[\\/]*)] - [re_direlt='/[^/][^/]*/\.\./'] - # Canonicalize the path of ld - ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - AC_MSG_CHECKING([for GNU ld]) -else - AC_MSG_CHECKING([for non-GNU ld]) -fi -AC_CACHE_VAL(acl_cv_path_LD, -[if test -z "$LD"; then - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - acl_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in - *GNU* | *'with BFD'*) - test "$with_gnu_ld" != no && break ;; - *) - test "$with_gnu_ld" != yes && break ;; - esac - fi - done - IFS="$ac_save_ifs" -else - acl_cv_path_LD="$LD" # Let the user override the test with a path. -fi]) -LD="$acl_cv_path_LD" -if test -n "$LD"; then - AC_MSG_RESULT($LD) -else - AC_MSG_RESULT(no) -fi -test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) -AC_LIB_PROG_LD_GNU -]) diff --git a/m4/lib-link.m4 b/m4/lib-link.m4 deleted file mode 100644 index ea0b0c4..0000000 --- a/m4/lib-link.m4 +++ /dev/null @@ -1,553 +0,0 @@ -# lib-link.m4 serial 6 (gettext-0.14.3) -dnl Copyright (C) 2001-2005 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl From Bruno Haible. - -AC_PREREQ(2.50) - -dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and -dnl the libraries corresponding to explicit and implicit dependencies. -dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and -dnl augments the CPPFLAGS variable. -AC_DEFUN([AC_LIB_LINKFLAGS], -[ - AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) - AC_REQUIRE([AC_LIB_RPATH]) - define([Name],[translit([$1],[./-], [___])]) - define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) - AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ - AC_LIB_LINKFLAGS_BODY([$1], [$2]) - ac_cv_lib[]Name[]_libs="$LIB[]NAME" - ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" - ac_cv_lib[]Name[]_cppflags="$INC[]NAME" - ]) - LIB[]NAME="$ac_cv_lib[]Name[]_libs" - LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" - INC[]NAME="$ac_cv_lib[]Name[]_cppflags" - AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) - AC_SUBST([LIB]NAME) - AC_SUBST([LTLIB]NAME) - dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the - dnl results of this search when this library appears as a dependency. - HAVE_LIB[]NAME=yes - undefine([Name]) - undefine([NAME]) -]) - -dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode) -dnl searches for libname and the libraries corresponding to explicit and -dnl implicit dependencies, together with the specified include files and -dnl the ability to compile and link the specified testcode. If found, it -dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and -dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and -dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs -dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. -AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], -[ - AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) - AC_REQUIRE([AC_LIB_RPATH]) - define([Name],[translit([$1],[./-], [___])]) - define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) - - dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME - dnl accordingly. - AC_LIB_LINKFLAGS_BODY([$1], [$2]) - - dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, - dnl because if the user has installed lib[]Name and not disabled its use - dnl via --without-lib[]Name-prefix, he wants to use it. - ac_save_CPPFLAGS="$CPPFLAGS" - AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) - - AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ - ac_save_LIBS="$LIBS" - LIBS="$LIBS $LIB[]NAME" - AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no]) - LIBS="$ac_save_LIBS" - ]) - if test "$ac_cv_lib[]Name" = yes; then - HAVE_LIB[]NAME=yes - AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.]) - AC_MSG_CHECKING([how to link with lib[]$1]) - AC_MSG_RESULT([$LIB[]NAME]) - else - HAVE_LIB[]NAME=no - dnl If $LIB[]NAME didn't lead to a usable library, we don't need - dnl $INC[]NAME either. - CPPFLAGS="$ac_save_CPPFLAGS" - LIB[]NAME= - LTLIB[]NAME= - fi - AC_SUBST([HAVE_LIB]NAME) - AC_SUBST([LIB]NAME) - AC_SUBST([LTLIB]NAME) - undefine([Name]) - undefine([NAME]) -]) - -dnl Determine the platform dependent parameters needed to use rpath: -dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator, -dnl hardcode_direct, hardcode_minus_L. -AC_DEFUN([AC_LIB_RPATH], -[ - dnl Tell automake >= 1.10 to complain if config.rpath is missing. - m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])]) - AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS - AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld - AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host - AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir - AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [ - CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ - ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh - . ./conftest.sh - rm -f ./conftest.sh - acl_cv_rpath=done - ]) - wl="$acl_cv_wl" - libext="$acl_cv_libext" - shlibext="$acl_cv_shlibext" - hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" - hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" - hardcode_direct="$acl_cv_hardcode_direct" - hardcode_minus_L="$acl_cv_hardcode_minus_L" - dnl Determine whether the user wants rpath handling at all. - AC_ARG_ENABLE(rpath, - [ --disable-rpath do not hardcode runtime library paths], - :, enable_rpath=yes) -]) - -dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and -dnl the libraries corresponding to explicit and implicit dependencies. -dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. -AC_DEFUN([AC_LIB_LINKFLAGS_BODY], -[ - define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) - dnl By default, look in $includedir and $libdir. - use_additional=yes - AC_LIB_WITH_FINAL_PREFIX([ - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - ]) - AC_LIB_ARG_WITH([lib$1-prefix], -[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib - --without-lib$1-prefix don't search for lib$1 in includedir and libdir], -[ - if test "X$withval" = "Xno"; then - use_additional=no - else - if test "X$withval" = "X"; then - AC_LIB_WITH_FINAL_PREFIX([ - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - ]) - else - additional_includedir="$withval/include" - additional_libdir="$withval/lib" - fi - fi -]) - dnl Search the library and its dependencies in $additional_libdir and - dnl $LDFLAGS. Using breadth-first-seach. - LIB[]NAME= - LTLIB[]NAME= - INC[]NAME= - rpathdirs= - ltrpathdirs= - names_already_handled= - names_next_round='$1 $2' - while test -n "$names_next_round"; do - names_this_round="$names_next_round" - names_next_round= - for name in $names_this_round; do - already_handled= - for n in $names_already_handled; do - if test "$n" = "$name"; then - already_handled=yes - break - fi - done - if test -z "$already_handled"; then - names_already_handled="$names_already_handled $name" - dnl See if it was already located by an earlier AC_LIB_LINKFLAGS - dnl or AC_LIB_HAVE_LINKFLAGS call. - uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` - eval value=\"\$HAVE_LIB$uppername\" - if test -n "$value"; then - if test "$value" = yes; then - eval value=\"\$LIB$uppername\" - test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" - eval value=\"\$LTLIB$uppername\" - test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" - else - dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined - dnl that this library doesn't exist. So just drop it. - : - fi - else - dnl Search the library lib$name in $additional_libdir and $LDFLAGS - dnl and the already constructed $LIBNAME/$LTLIBNAME. - found_dir= - found_la= - found_so= - found_a= - if test $use_additional = yes; then - if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then - found_dir="$additional_libdir" - found_so="$additional_libdir/lib$name.$shlibext" - if test -f "$additional_libdir/lib$name.la"; then - found_la="$additional_libdir/lib$name.la" - fi - else - if test -f "$additional_libdir/lib$name.$libext"; then - found_dir="$additional_libdir" - found_a="$additional_libdir/lib$name.$libext" - if test -f "$additional_libdir/lib$name.la"; then - found_la="$additional_libdir/lib$name.la" - fi - fi - fi - fi - if test "X$found_dir" = "X"; then - for x in $LDFLAGS $LTLIB[]NAME; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - case "$x" in - -L*) - dir=`echo "X$x" | sed -e 's/^X-L//'` - if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then - found_dir="$dir" - found_so="$dir/lib$name.$shlibext" - if test -f "$dir/lib$name.la"; then - found_la="$dir/lib$name.la" - fi - else - if test -f "$dir/lib$name.$libext"; then - found_dir="$dir" - found_a="$dir/lib$name.$libext" - if test -f "$dir/lib$name.la"; then - found_la="$dir/lib$name.la" - fi - fi - fi - ;; - esac - if test "X$found_dir" != "X"; then - break - fi - done - fi - if test "X$found_dir" != "X"; then - dnl Found the library. - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" - if test "X$found_so" != "X"; then - dnl Linking with a shared library. We attempt to hardcode its - dnl directory into the executable's runpath, unless it's the - dnl standard /usr/lib. - if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then - dnl No hardcoding is needed. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" - else - dnl Use an explicit option to hardcode DIR into the resulting - dnl binary. - dnl Potentially add DIR to ltrpathdirs. - dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. - haveit= - for x in $ltrpathdirs; do - if test "X$x" = "X$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - ltrpathdirs="$ltrpathdirs $found_dir" - fi - dnl The hardcoding into $LIBNAME is system dependent. - if test "$hardcode_direct" = yes; then - dnl Using DIR/libNAME.so during linking hardcodes DIR into the - dnl resulting binary. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" - else - if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then - dnl Use an explicit option to hardcode DIR into the resulting - dnl binary. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" - dnl Potentially add DIR to rpathdirs. - dnl The rpathdirs will be appended to $LIBNAME at the end. - haveit= - for x in $rpathdirs; do - if test "X$x" = "X$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - rpathdirs="$rpathdirs $found_dir" - fi - else - dnl Rely on "-L$found_dir". - dnl But don't add it if it's already contained in the LDFLAGS - dnl or the already constructed $LIBNAME - haveit= - for x in $LDFLAGS $LIB[]NAME; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-L$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" - fi - if test "$hardcode_minus_L" != no; then - dnl FIXME: Not sure whether we should use - dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" - dnl here. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" - else - dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH - dnl here, because this doesn't fit in flags passed to the - dnl compiler. So give up. No hardcoding. This affects only - dnl very old systems. - dnl FIXME: Not sure whether we should use - dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" - dnl here. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" - fi - fi - fi - fi - else - if test "X$found_a" != "X"; then - dnl Linking with a static library. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" - else - dnl We shouldn't come here, but anyway it's good to have a - dnl fallback. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" - fi - fi - dnl Assume the include files are nearby. - additional_includedir= - case "$found_dir" in - */lib | */lib/) - basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` - additional_includedir="$basedir/include" - ;; - esac - if test "X$additional_includedir" != "X"; then - dnl Potentially add $additional_includedir to $INCNAME. - dnl But don't add it - dnl 1. if it's the standard /usr/include, - dnl 2. if it's /usr/local/include and we are using GCC on Linux, - dnl 3. if it's already present in $CPPFLAGS or the already - dnl constructed $INCNAME, - dnl 4. if it doesn't exist as a directory. - if test "X$additional_includedir" != "X/usr/include"; then - haveit= - if test "X$additional_includedir" = "X/usr/local/include"; then - if test -n "$GCC"; then - case $host_os in - linux* | gnu* | k*bsd*-gnu) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - for x in $CPPFLAGS $INC[]NAME; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-I$additional_includedir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_includedir"; then - dnl Really add $additional_includedir to $INCNAME. - INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" - fi - fi - fi - fi - fi - dnl Look for dependencies. - if test -n "$found_la"; then - dnl Read the .la file. It defines the variables - dnl dlname, library_names, old_library, dependency_libs, current, - dnl age, revision, installed, dlopen, dlpreopen, libdir. - save_libdir="$libdir" - case "$found_la" in - */* | *\\*) . "$found_la" ;; - *) . "./$found_la" ;; - esac - libdir="$save_libdir" - dnl We use only dependency_libs. - for dep in $dependency_libs; do - case "$dep" in - -L*) - additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` - dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. - dnl But don't add it - dnl 1. if it's the standard /usr/lib, - dnl 2. if it's /usr/local/lib and we are using GCC on Linux, - dnl 3. if it's already present in $LDFLAGS or the already - dnl constructed $LIBNAME, - dnl 4. if it doesn't exist as a directory. - if test "X$additional_libdir" != "X/usr/lib"; then - haveit= - if test "X$additional_libdir" = "X/usr/local/lib"; then - if test -n "$GCC"; then - case $host_os in - linux* | gnu* | k*bsd*-gnu) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - haveit= - for x in $LDFLAGS $LIB[]NAME; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - dnl Really add $additional_libdir to $LIBNAME. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" - fi - fi - haveit= - for x in $LDFLAGS $LTLIB[]NAME; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - dnl Really add $additional_libdir to $LTLIBNAME. - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" - fi - fi - fi - fi - ;; - -R*) - dir=`echo "X$dep" | sed -e 's/^X-R//'` - if test "$enable_rpath" != no; then - dnl Potentially add DIR to rpathdirs. - dnl The rpathdirs will be appended to $LIBNAME at the end. - haveit= - for x in $rpathdirs; do - if test "X$x" = "X$dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - rpathdirs="$rpathdirs $dir" - fi - dnl Potentially add DIR to ltrpathdirs. - dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. - haveit= - for x in $ltrpathdirs; do - if test "X$x" = "X$dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - ltrpathdirs="$ltrpathdirs $dir" - fi - fi - ;; - -l*) - dnl Handle this in the next round. - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` - ;; - *.la) - dnl Handle this in the next round. Throw away the .la's - dnl directory; it is already contained in a preceding -L - dnl option. - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` - ;; - *) - dnl Most likely an immediate library name. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" - ;; - esac - done - fi - else - dnl Didn't find the library; assume it is in the system directories - dnl known to the linker and runtime loader. (All the system - dnl directories known to the linker should also be known to the - dnl runtime loader, otherwise the system is severely misconfigured.) - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" - fi - fi - fi - done - done - if test "X$rpathdirs" != "X"; then - if test -n "$hardcode_libdir_separator"; then - dnl Weird platform: only the last -rpath option counts, the user must - dnl pass all path elements in one option. We can arrange that for a - dnl single library, but not when more than one $LIBNAMEs are used. - alldirs= - for found_dir in $rpathdirs; do - alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" - done - dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl. - acl_save_libdir="$libdir" - libdir="$alldirs" - eval flag=\"$hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" - else - dnl The -rpath options are cumulative. - for found_dir in $rpathdirs; do - acl_save_libdir="$libdir" - libdir="$found_dir" - eval flag=\"$hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" - done - fi - fi - if test "X$ltrpathdirs" != "X"; then - dnl When using libtool, the option that works for both libraries and - dnl executables is -R. The -R options are cumulative. - for found_dir in $ltrpathdirs; do - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" - done - fi -]) - -dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, -dnl unless already present in VAR. -dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes -dnl contains two or three consecutive elements that belong together. -AC_DEFUN([AC_LIB_APPENDTOVAR], -[ - for element in [$2]; do - haveit= - for x in $[$1]; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X$element"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - [$1]="${[$1]}${[$1]:+ }$element" - fi - done -]) diff --git a/m4/lib-prefix.m4 b/m4/lib-prefix.m4 deleted file mode 100644 index 0d895ca..0000000 --- a/m4/lib-prefix.m4 +++ /dev/null @@ -1,153 +0,0 @@ -# lib-prefix.m4 serial 4 (gettext-0.14.2) -dnl Copyright (C) 2001-2005 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl From Bruno Haible. - -dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and -dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't -dnl require excessive bracketing. -ifdef([AC_HELP_STRING], -[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], -[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) - -dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed -dnl to access previously installed libraries. The basic assumption is that -dnl a user will want packages to use other packages he previously installed -dnl with the same --prefix option. -dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate -dnl libraries, but is otherwise very convenient. -AC_DEFUN([AC_LIB_PREFIX], -[ - AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) - AC_REQUIRE([AC_PROG_CC]) - AC_REQUIRE([AC_CANONICAL_HOST]) - AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) - dnl By default, look in $includedir and $libdir. - use_additional=yes - AC_LIB_WITH_FINAL_PREFIX([ - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - ]) - AC_LIB_ARG_WITH([lib-prefix], -[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib - --without-lib-prefix don't search for libraries in includedir and libdir], -[ - if test "X$withval" = "Xno"; then - use_additional=no - else - if test "X$withval" = "X"; then - AC_LIB_WITH_FINAL_PREFIX([ - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - ]) - else - additional_includedir="$withval/include" - additional_libdir="$withval/lib" - fi - fi -]) - if test $use_additional = yes; then - dnl Potentially add $additional_includedir to $CPPFLAGS. - dnl But don't add it - dnl 1. if it's the standard /usr/include, - dnl 2. if it's already present in $CPPFLAGS, - dnl 3. if it's /usr/local/include and we are using GCC on Linux, - dnl 4. if it doesn't exist as a directory. - if test "X$additional_includedir" != "X/usr/include"; then - haveit= - for x in $CPPFLAGS; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-I$additional_includedir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test "X$additional_includedir" = "X/usr/local/include"; then - if test -n "$GCC"; then - case $host_os in - linux* | gnu* | k*bsd*-gnu) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - if test -d "$additional_includedir"; then - dnl Really add $additional_includedir to $CPPFLAGS. - CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" - fi - fi - fi - fi - dnl Potentially add $additional_libdir to $LDFLAGS. - dnl But don't add it - dnl 1. if it's the standard /usr/lib, - dnl 2. if it's already present in $LDFLAGS, - dnl 3. if it's /usr/local/lib and we are using GCC on Linux, - dnl 4. if it doesn't exist as a directory. - if test "X$additional_libdir" != "X/usr/lib"; then - haveit= - for x in $LDFLAGS; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test "X$additional_libdir" = "X/usr/local/lib"; then - if test -n "$GCC"; then - case $host_os in - linux*) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - dnl Really add $additional_libdir to $LDFLAGS. - LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" - fi - fi - fi - fi - fi -]) - -dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, -dnl acl_final_exec_prefix, containing the values to which $prefix and -dnl $exec_prefix will expand at the end of the configure script. -AC_DEFUN([AC_LIB_PREPARE_PREFIX], -[ - dnl Unfortunately, prefix and exec_prefix get only finally determined - dnl at the end of configure. - if test "X$prefix" = "XNONE"; then - acl_final_prefix="$ac_default_prefix" - else - acl_final_prefix="$prefix" - fi - if test "X$exec_prefix" = "XNONE"; then - acl_final_exec_prefix='${prefix}' - else - acl_final_exec_prefix="$exec_prefix" - fi - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" - prefix="$acl_save_prefix" -]) - -dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the -dnl variables prefix and exec_prefix bound to the values they will have -dnl at the end of the configure script. -AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], -[ - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - $1 - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" -]) diff --git a/m4/libcurl.m4 b/m4/libcurl.m4 deleted file mode 100644 index a9bfa2e..0000000 --- a/m4/libcurl.m4 +++ /dev/null @@ -1,239 +0,0 @@ -# LIBCURL_CHECK_CONFIG ([DEFAULT-ACTION], [MINIMUM-VERSION], -# [ACTION-IF-YES], [ACTION-IF-NO]) -# ---------------------------------------------------------- -# David Shaw May-09-2006 -# -# Checks for libcurl. DEFAULT-ACTION is the string yes or no to -# specify whether to default to --with-libcurl or --without-libcurl. -# If not supplied, DEFAULT-ACTION is yes. MINIMUM-VERSION is the -# minimum version of libcurl to accept. Pass the version as a regular -# version number like 7.10.1. If not supplied, any version is -# accepted. ACTION-IF-YES is a list of shell commands to run if -# libcurl was successfully found and passed the various tests. -# ACTION-IF-NO is a list of shell commands that are run otherwise. -# Note that using --without-libcurl does run ACTION-IF-NO. -# -# This macro #defines HAVE_LIBCURL if a working libcurl setup is -# found, and sets @LIBCURL@ and @LIBCURL_CPPFLAGS@ to the necessary -# values. Other useful defines are LIBCURL_FEATURE_xxx where xxx are -# the various features supported by libcurl, and LIBCURL_PROTOCOL_yyy -# where yyy are the various protocols supported by libcurl. Both xxx -# and yyy are capitalized. See the list of AH_TEMPLATEs at the top of -# the macro for the complete list of possible defines. Shell -# variables $libcurl_feature_xxx and $libcurl_protocol_yyy are also -# defined to 'yes' for those features and protocols that were found. -# Note that xxx and yyy keep the same capitalization as in the -# curl-config list (e.g. it's "HTTP" and not "http"). -# -# Users may override the detected values by doing something like: -# LIBCURL="-lcurl" LIBCURL_CPPFLAGS="-I/usr/myinclude" ./configure -# -# For the sake of sanity, this macro assumes that any libcurl that is -# found is after version 7.7.2, the first version that included the -# curl-config script. Note that it is very important for people -# packaging binary versions of libcurl to include this script! -# Without curl-config, we can only guess what protocols are available, -# or use curl_version_info to figure it out at runtime. - -AC_DEFUN([LIBCURL_CHECK_CONFIG], -[ - AH_TEMPLATE([LIBCURL_FEATURE_SSL],[Defined if libcurl supports SSL]) - AH_TEMPLATE([LIBCURL_FEATURE_KRB4],[Defined if libcurl supports KRB4]) - AH_TEMPLATE([LIBCURL_FEATURE_IPV6],[Defined if libcurl supports IPv6]) - AH_TEMPLATE([LIBCURL_FEATURE_LIBZ],[Defined if libcurl supports libz]) - AH_TEMPLATE([LIBCURL_FEATURE_ASYNCHDNS],[Defined if libcurl supports AsynchDNS]) - AH_TEMPLATE([LIBCURL_FEATURE_IDN],[Defined if libcurl supports IDN]) - AH_TEMPLATE([LIBCURL_FEATURE_SSPI],[Defined if libcurl supports SSPI]) - AH_TEMPLATE([LIBCURL_FEATURE_NTLM],[Defined if libcurl supports NTLM]) - - AH_TEMPLATE([LIBCURL_PROTOCOL_HTTP],[Defined if libcurl supports HTTP]) - AH_TEMPLATE([LIBCURL_PROTOCOL_HTTPS],[Defined if libcurl supports HTTPS]) - AH_TEMPLATE([LIBCURL_PROTOCOL_FTP],[Defined if libcurl supports FTP]) - AH_TEMPLATE([LIBCURL_PROTOCOL_FTPS],[Defined if libcurl supports FTPS]) - AH_TEMPLATE([LIBCURL_PROTOCOL_FILE],[Defined if libcurl supports FILE]) - AH_TEMPLATE([LIBCURL_PROTOCOL_TELNET],[Defined if libcurl supports TELNET]) - AH_TEMPLATE([LIBCURL_PROTOCOL_LDAP],[Defined if libcurl supports LDAP]) - AH_TEMPLATE([LIBCURL_PROTOCOL_DICT],[Defined if libcurl supports DICT]) - AH_TEMPLATE([LIBCURL_PROTOCOL_TFTP],[Defined if libcurl supports TFTP]) - - AC_ARG_WITH(libcurl, - AC_HELP_STRING([--with-libcurl=DIR],[look for the curl library in DIR]), - [_libcurl_with=$withval],[_libcurl_with=ifelse([$1],,[yes],[$1])]) - - if test "$_libcurl_with" != "no" ; then - - AC_PROG_AWK - - _libcurl_version_parse="eval $AWK '{split(\$NF,A,\".\"); X=256*256*A[[1]]+256*A[[2]]+A[[3]]; print X;}'" - - _libcurl_try_link=yes - - if test -d "$_libcurl_with" ; then - LIBCURL_CPPFLAGS="-I$withval/include" - _libcurl_ldflags="-L$withval/lib" - AC_PATH_PROG([_libcurl_config],["$withval/bin/curl-config"]) - else - AC_PATH_PROG([_libcurl_config],[curl-config]) - fi - - if test x$_libcurl_config != "x" ; then - AC_CACHE_CHECK([for the version of libcurl], - [libcurl_cv_lib_curl_version], - [libcurl_cv_lib_curl_version=`$_libcurl_config --version | $AWK '{print $[]2}'`]) - - _libcurl_version=`echo $libcurl_cv_lib_curl_version | $_libcurl_version_parse` - _libcurl_wanted=`echo ifelse([$2],,[0],[$2]) | $_libcurl_version_parse` - - if test $_libcurl_wanted -gt 0 ; then - AC_CACHE_CHECK([for libcurl >= version $2], - [libcurl_cv_lib_version_ok], - [ - if test $_libcurl_version -ge $_libcurl_wanted ; then - libcurl_cv_lib_version_ok=yes - else - libcurl_cv_lib_version_ok=no - fi - ]) - fi - - if test $_libcurl_wanted -eq 0 || test x$libcurl_cv_lib_version_ok = xyes ; then - if test x"$LIBCURL_CPPFLAGS" = "x" ; then - LIBCURL_CPPFLAGS=`$_libcurl_config --cflags` - fi - if test x"$LIBCURL" = "x" ; then - LIBCURL=`$_libcurl_config --libs` - - # This is so silly, but Apple actually has a bug in their - # curl-config script. Fixed in Tiger, but there are still - # lots of Panther installs around. - case "${host}" in - powerpc-apple-darwin7*) - LIBCURL=`echo $LIBCURL | sed -e 's|-arch i386||g'` - ;; - esac - fi - - # All curl-config scripts support --feature - _libcurl_features=`$_libcurl_config --feature` - - # Is it modern enough to have --protocols? (7.12.4) - if test $_libcurl_version -ge 461828 ; then - _libcurl_protocols=`$_libcurl_config --protocols` - fi - else - _libcurl_try_link=no - fi - - unset _libcurl_wanted - fi - - if test $_libcurl_try_link = yes ; then - - # we didn't find curl-config, so let's see if the user-supplied - # link line (or failing that, "-lcurl") is enough. - LIBCURL=${LIBCURL-"$_libcurl_ldflags -lcurl"} - - AC_CACHE_CHECK([whether libcurl is usable], - [libcurl_cv_lib_curl_usable], - [ - _libcurl_save_cppflags=$CPPFLAGS - CPPFLAGS="$LIBCURL_CPPFLAGS $CPPFLAGS" - _libcurl_save_libs=$LIBS - LIBS="$LIBCURL $LIBS" - - AC_LINK_IFELSE(AC_LANG_PROGRAM([#include ],[ -/* Try and use a few common options to force a failure if we are - missing symbols or can't link. */ -int x; -curl_easy_setopt(NULL,CURLOPT_URL,NULL); -x=CURL_ERROR_SIZE; -x=CURLOPT_WRITEFUNCTION; -x=CURLOPT_FILE; -x=CURLOPT_ERRORBUFFER; -x=CURLOPT_STDERR; -x=CURLOPT_VERBOSE; -]),libcurl_cv_lib_curl_usable=yes,libcurl_cv_lib_curl_usable=no) - - CPPFLAGS=$_libcurl_save_cppflags - LIBS=$_libcurl_save_libs - unset _libcurl_save_cppflags - unset _libcurl_save_libs - ]) - - if test $libcurl_cv_lib_curl_usable = yes ; then - - # Does curl_free() exist in this version of libcurl? - # If not, fake it with free() - - _libcurl_save_cppflags=$CPPFLAGS - CPPFLAGS="$CPPFLAGS $LIBCURL_CPPFLAGS" - _libcurl_save_libs=$LIBS - LIBS="$LIBS $LIBCURL" - - AC_CHECK_FUNC(curl_free,, - AC_DEFINE(curl_free,free, - [Define curl_free() as free() if our version of curl lacks curl_free.])) - - CPPFLAGS=$_libcurl_save_cppflags - LIBS=$_libcurl_save_libs - unset _libcurl_save_cppflags - unset _libcurl_save_libs - - AC_DEFINE(HAVE_LIBCURL,1, - [Define to 1 if you have a functional curl library.]) - AC_SUBST(LIBCURL_CPPFLAGS) - AC_SUBST(LIBCURL) - - for _libcurl_feature in $_libcurl_features ; do - AC_DEFINE_UNQUOTED(AS_TR_CPP(libcurl_feature_$_libcurl_feature),[1]) - eval AS_TR_SH(libcurl_feature_$_libcurl_feature)=yes - done - - if test "x$_libcurl_protocols" = "x" ; then - - # We don't have --protocols, so just assume that all - # protocols are available - _libcurl_protocols="HTTP FTP FILE TELNET LDAP DICT" - - if test x$libcurl_feature_SSL = xyes ; then - _libcurl_protocols="$_libcurl_protocols HTTPS" - - # FTPS wasn't standards-compliant until version - # 7.11.0 - if test $_libcurl_version -ge 461568; then - _libcurl_protocols="$_libcurl_protocols FTPS" - fi - fi - fi - - for _libcurl_protocol in $_libcurl_protocols ; do - AC_DEFINE_UNQUOTED(AS_TR_CPP(libcurl_protocol_$_libcurl_protocol),[1]) - eval AS_TR_SH(libcurl_protocol_$_libcurl_protocol)=yes - done - else - unset LIBCURL - unset LIBCURL_CPPFLAGS - fi - fi - - unset _libcurl_try_link - unset _libcurl_version_parse - unset _libcurl_config - unset _libcurl_feature - unset _libcurl_features - unset _libcurl_protocol - unset _libcurl_protocols - unset _libcurl_version - unset _libcurl_ldflags - fi - - if test x$_libcurl_with = xno || test x$libcurl_cv_lib_curl_usable != xyes ; then - # This is the IF-NO path - ifelse([$4],,:,[$4]) - else - # This is the IF-YES path - ifelse([$3],,:,[$3]) - fi - - unset _libcurl_with -])dnl diff --git a/m4/longdouble.m4 b/m4/longdouble.m4 deleted file mode 100644 index 40cd7ce..0000000 --- a/m4/longdouble.m4 +++ /dev/null @@ -1,28 +0,0 @@ -# longdouble.m4 serial 1 (gettext-0.12) -dnl Copyright (C) 2002-2003 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl From Bruno Haible. -dnl Test whether the compiler supports the 'long double' type. -dnl Prerequisite: AC_PROG_CC - -AC_DEFUN([gt_TYPE_LONGDOUBLE], -[ - AC_CACHE_CHECK([for long double], gt_cv_c_long_double, - [if test "$GCC" = yes; then - gt_cv_c_long_double=yes - else - AC_TRY_COMPILE([ - /* The Stardent Vistra knows sizeof(long double), but does not support it. */ - long double foo = 0.0; - /* On Ultrix 4.3 cc, long double is 4 and double is 8. */ - int array [2*(sizeof(long double) >= sizeof(double)) - 1]; - ], , - gt_cv_c_long_double=yes, gt_cv_c_long_double=no) - fi]) - if test $gt_cv_c_long_double = yes; then - AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type.]) - fi -]) diff --git a/m4/longlong.m4 b/m4/longlong.m4 deleted file mode 100644 index 7b399e0..0000000 --- a/m4/longlong.m4 +++ /dev/null @@ -1,23 +0,0 @@ -# longlong.m4 serial 5 -dnl Copyright (C) 1999-2004 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl From Paul Eggert. - -# Define HAVE_LONG_LONG if 'long long' works. - -AC_DEFUN([gl_AC_TYPE_LONG_LONG], -[ - AC_CACHE_CHECK([for long long], ac_cv_type_long_long, - [AC_TRY_LINK([long long ll = 1LL; int i = 63;], - [long long llmax = (long long) -1; - return ll << i | ll >> i | llmax / ll | llmax % ll;], - ac_cv_type_long_long=yes, - ac_cv_type_long_long=no)]) - if test $ac_cv_type_long_long = yes; then - AC_DEFINE(HAVE_LONG_LONG, 1, - [Define if you have the 'long long' type.]) - fi -]) diff --git a/m4/nls.m4 b/m4/nls.m4 deleted file mode 100644 index 2082c3b..0000000 --- a/m4/nls.m4 +++ /dev/null @@ -1,51 +0,0 @@ -# nls.m4 serial 2 (gettext-0.14.3) -dnl Copyright (C) 1995-2003, 2005 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. -dnl -dnl This file can can be used in projects which are not available under -dnl the GNU General Public License or the GNU Library General Public -dnl License but which still want to provide support for the GNU gettext -dnl functionality. -dnl Please note that the actual code of the GNU gettext library is covered -dnl by the GNU Library General Public License, and the rest of the GNU -dnl gettext package package is covered by the GNU General Public License. -dnl They are *not* in the public domain. - -dnl Authors: -dnl Ulrich Drepper , 1995-2000. -dnl Bruno Haible , 2000-2003. - -AC_PREREQ(2.50) - -AC_DEFUN([AM_NLS], -[ - AC_MSG_CHECKING([whether NLS is requested]) - dnl Default is enabled NLS - AC_ARG_ENABLE(nls, - [ --disable-nls do not use Native Language Support], - USE_NLS=$enableval, USE_NLS=yes) - AC_MSG_RESULT($USE_NLS) - AC_SUBST(USE_NLS) -]) - -AC_DEFUN([AM_MKINSTALLDIRS], -[ - dnl Tell automake >= 1.10 to complain if mkinstalldirs is missing. - m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([mkinstalldirs])]) - dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly - dnl find the mkinstalldirs script in another subdir but $(top_srcdir). - dnl Try to locate it. - MKINSTALLDIRS= - if test -n "$ac_aux_dir"; then - case "$ac_aux_dir" in - /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;; - *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;; - esac - fi - if test -z "$MKINSTALLDIRS"; then - MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" - fi - AC_SUBST(MKINSTALLDIRS) -]) diff --git a/m4/po.m4 b/m4/po.m4 deleted file mode 100644 index f2795ee..0000000 --- a/m4/po.m4 +++ /dev/null @@ -1,429 +0,0 @@ -# po.m4 serial 7 (gettext-0.14.3) -dnl Copyright (C) 1995-2005 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. -dnl -dnl This file can can be used in projects which are not available under -dnl the GNU General Public License or the GNU Library General Public -dnl License but which still want to provide support for the GNU gettext -dnl functionality. -dnl Please note that the actual code of the GNU gettext library is covered -dnl by the GNU Library General Public License, and the rest of the GNU -dnl gettext package package is covered by the GNU General Public License. -dnl They are *not* in the public domain. - -dnl Authors: -dnl Ulrich Drepper , 1995-2000. -dnl Bruno Haible , 2000-2003. - -AC_PREREQ(2.50) - -dnl Checks for all prerequisites of the po subdirectory. -AC_DEFUN([AM_PO_SUBDIRS], -[ - AC_REQUIRE([AC_PROG_MAKE_SET])dnl - AC_REQUIRE([AC_PROG_INSTALL])dnl - AC_REQUIRE([AM_MKINSTALLDIRS])dnl - AC_REQUIRE([AM_NLS])dnl - - dnl Perform the following tests also if --disable-nls has been given, - dnl because they are needed for "make dist" to work. - - dnl Search for GNU msgfmt in the PATH. - dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions. - dnl The second test excludes FreeBSD msgfmt. - AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, - [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && - (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], - :) - AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) - - dnl Search for GNU xgettext 0.12 or newer in the PATH. - dnl The first test excludes Solaris xgettext and early GNU xgettext versions. - dnl The second test excludes FreeBSD xgettext. - AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, - [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && - (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], - :) - dnl Remove leftover from FreeBSD xgettext call. - rm -f messages.po - - dnl Search for GNU msgmerge 0.11 or newer in the PATH. - AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge, - [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :) - - dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. - dnl Test whether we really found GNU msgfmt. - if test "$GMSGFMT" != ":"; then - dnl If it is no GNU msgfmt we define it as : so that the - dnl Makefiles still can work. - if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 && - (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then - : ; - else - GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'` - AC_MSG_RESULT( - [found $GMSGFMT program is not GNU msgfmt; ignore it]) - GMSGFMT=":" - fi - fi - - dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. - dnl Test whether we really found GNU xgettext. - if test "$XGETTEXT" != ":"; then - dnl If it is no GNU xgettext we define it as : so that the - dnl Makefiles still can work. - if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && - (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then - : ; - else - AC_MSG_RESULT( - [found xgettext program is not GNU xgettext; ignore it]) - XGETTEXT=":" - fi - dnl Remove leftover from FreeBSD xgettext call. - rm -f messages.po - fi - - AC_OUTPUT_COMMANDS([ - for ac_file in $CONFIG_FILES; do - # Support "outfile[:infile[:infile...]]" - case "$ac_file" in - *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - esac - # PO directories have a Makefile.in generated from Makefile.in.in. - case "$ac_file" in */Makefile.in) - # Adjust a relative srcdir. - ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` - ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" - ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` - # In autoconf-2.13 it is called $ac_given_srcdir. - # In autoconf-2.50 it is called $srcdir. - test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" - case "$ac_given_srcdir" in - .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; - /*) top_srcdir="$ac_given_srcdir" ;; - *) top_srcdir="$ac_dots$ac_given_srcdir" ;; - esac - # Treat a directory as a PO directory if and only if it has a - # POTFILES.in file. This allows packages to have multiple PO - # directories under different names or in different locations. - if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then - rm -f "$ac_dir/POTFILES" - test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" - cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" - POMAKEFILEDEPS="POTFILES.in" - # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend - # on $ac_dir but don't depend on user-specified configuration - # parameters. - if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then - # The LINGUAS file contains the set of available languages. - if test -n "$OBSOLETE_ALL_LINGUAS"; then - test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" - fi - ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` - # Hide the ALL_LINGUAS assigment from automake. - eval 'ALL_LINGUAS''=$ALL_LINGUAS_' - POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" - else - # The set of available languages was given in configure.in. - eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' - fi - # Compute POFILES - # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) - # Compute UPDATEPOFILES - # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) - # Compute DUMMYPOFILES - # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) - # Compute GMOFILES - # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) - case "$ac_given_srcdir" in - .) srcdirpre= ;; - *) srcdirpre='$(srcdir)/' ;; - esac - POFILES= - UPDATEPOFILES= - DUMMYPOFILES= - GMOFILES= - for lang in $ALL_LINGUAS; do - POFILES="$POFILES $srcdirpre$lang.po" - UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" - DUMMYPOFILES="$DUMMYPOFILES $lang.nop" - GMOFILES="$GMOFILES $srcdirpre$lang.gmo" - done - # CATALOGS depends on both $ac_dir and the user's LINGUAS - # environment variable. - INST_LINGUAS= - if test -n "$ALL_LINGUAS"; then - for presentlang in $ALL_LINGUAS; do - useit=no - if test "%UNSET%" != "$LINGUAS"; then - desiredlanguages="$LINGUAS" - else - desiredlanguages="$ALL_LINGUAS" - fi - for desiredlang in $desiredlanguages; do - # Use the presentlang catalog if desiredlang is - # a. equal to presentlang, or - # b. a variant of presentlang (because in this case, - # presentlang can be used as a fallback for messages - # which are not translated in the desiredlang catalog). - case "$desiredlang" in - "$presentlang"*) useit=yes;; - esac - done - if test $useit = yes; then - INST_LINGUAS="$INST_LINGUAS $presentlang" - fi - done - fi - CATALOGS= - if test -n "$INST_LINGUAS"; then - for lang in $INST_LINGUAS; do - CATALOGS="$CATALOGS $lang.gmo" - done - fi - test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" - sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" - for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do - if test -f "$f"; then - case "$f" in - *.orig | *.bak | *~) ;; - *) cat "$f" >> "$ac_dir/Makefile" ;; - esac - fi - done - fi - ;; - esac - done], - [# Capture the value of obsolete ALL_LINGUAS because we need it to compute - # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it - # from automake. - eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' - # Capture the value of LINGUAS because we need it to compute CATALOGS. - LINGUAS="${LINGUAS-%UNSET%}" - ]) -]) - -dnl Postprocesses a Makefile in a directory containing PO files. -AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE], -[ - # When this code is run, in config.status, two variables have already been - # set: - # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in, - # - LINGUAS is the value of the environment variable LINGUAS at configure - # time. - -changequote(,)dnl - # Adjust a relative srcdir. - ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` - ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" - ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` - # In autoconf-2.13 it is called $ac_given_srcdir. - # In autoconf-2.50 it is called $srcdir. - test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" - case "$ac_given_srcdir" in - .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; - /*) top_srcdir="$ac_given_srcdir" ;; - *) top_srcdir="$ac_dots$ac_given_srcdir" ;; - esac - - # Find a way to echo strings without interpreting backslash. - if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then - gt_echo='echo' - else - if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then - gt_echo='printf %s\n' - else - echo_func () { - cat < "$ac_file.tmp" - if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then - # Add dependencies that cannot be formulated as a simple suffix rule. - for lang in $ALL_LINGUAS; do - frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` - cat >> "$ac_file.tmp" < /dev/null; then - # Add dependencies that cannot be formulated as a simple suffix rule. - for lang in $ALL_LINGUAS; do - frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'` - cat >> "$ac_file.tmp" <> "$ac_file.tmp" < -#include -/* The string "%2$d %1$d", with dollar characters protected from the shell's - dollar expansion (possibly an autoconf bug). */ -static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' }; -static char buf[100]; -int main () -{ - sprintf (buf, format, 33, 55); - return (strcmp (buf, "55 33") != 0); -}], gt_cv_func_printf_posix=yes, gt_cv_func_printf_posix=no, - [ - AC_EGREP_CPP(notposix, [ -#if defined __NetBSD__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__ - notposix -#endif - ], gt_cv_func_printf_posix="guessing no", - gt_cv_func_printf_posix="guessing yes") - ]) - ]) - case $gt_cv_func_printf_posix in - *yes) - AC_DEFINE(HAVE_POSIX_PRINTF, 1, - [Define if your printf() function supports format strings with positions.]) - ;; - esac -]) diff --git a/m4/progtest.m4 b/m4/progtest.m4 deleted file mode 100644 index a56365c..0000000 --- a/m4/progtest.m4 +++ /dev/null @@ -1,92 +0,0 @@ -# progtest.m4 serial 4 (gettext-0.14.2) -dnl Copyright (C) 1996-2003, 2005 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. -dnl -dnl This file can can be used in projects which are not available under -dnl the GNU General Public License or the GNU Library General Public -dnl License but which still want to provide support for the GNU gettext -dnl functionality. -dnl Please note that the actual code of the GNU gettext library is covered -dnl by the GNU Library General Public License, and the rest of the GNU -dnl gettext package package is covered by the GNU General Public License. -dnl They are *not* in the public domain. - -dnl Authors: -dnl Ulrich Drepper , 1996. - -AC_PREREQ(2.50) - -# Search path for a program which passes the given test. - -dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, -dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) -AC_DEFUN([AM_PATH_PROG_WITH_TEST], -[ -# Prepare PATH_SEPARATOR. -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - -# Find out how to test for executable files. Don't use a zero-byte file, -# as systems may use methods other than mode bits to determine executability. -cat >conf$$.file <<_ASEOF -#! /bin/sh -exit 0 -_ASEOF -chmod +x conf$$.file -if test -x conf$$.file >/dev/null 2>&1; then - ac_executable_p="test -x" -else - ac_executable_p="test -f" -fi -rm -f conf$$.file - -# Extract the first word of "$2", so it can be a program name with args. -set dummy $2; ac_word=[$]2 -AC_MSG_CHECKING([for $ac_word]) -AC_CACHE_VAL(ac_cv_path_$1, -[case "[$]$1" in - [[\\/]]* | ?:[[\\/]]*) - ac_cv_path_$1="[$]$1" # Let the user override the test with a path. - ;; - *) - ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in ifelse([$5], , $PATH, [$5]); do - IFS="$ac_save_IFS" - test -z "$ac_dir" && ac_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then - echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD - if [$3]; then - ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext" - break 2 - fi - fi - done - done - IFS="$ac_save_IFS" -dnl If no 4th arg is given, leave the cache variable unset, -dnl so AC_PATH_PROGS will keep looking. -ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" -])dnl - ;; -esac])dnl -$1="$ac_cv_path_$1" -if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then - AC_MSG_RESULT([$]$1) -else - AC_MSG_RESULT(no) -fi -AC_SUBST($1)dnl -]) diff --git a/m4/signed.m4 b/m4/signed.m4 deleted file mode 100644 index 048f593..0000000 --- a/m4/signed.m4 +++ /dev/null @@ -1,17 +0,0 @@ -# signed.m4 serial 1 (gettext-0.10.40) -dnl Copyright (C) 2001-2002 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl From Bruno Haible. - -AC_DEFUN([bh_C_SIGNED], -[ - AC_CACHE_CHECK([for signed], bh_cv_c_signed, - [AC_TRY_COMPILE(, [signed char x;], bh_cv_c_signed=yes, bh_cv_c_signed=no)]) - if test $bh_cv_c_signed = no; then - AC_DEFINE(signed, , - [Define to empty if the C compiler doesn't support this keyword.]) - fi -]) diff --git a/m4/size_max.m4 b/m4/size_max.m4 deleted file mode 100644 index 4fe81c7..0000000 --- a/m4/size_max.m4 +++ /dev/null @@ -1,59 +0,0 @@ -# size_max.m4 serial 2 -dnl Copyright (C) 2003 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl From Bruno Haible. - -AC_DEFUN([gl_SIZE_MAX], -[ - AC_CHECK_HEADERS(stdint.h) - dnl First test whether the system already has SIZE_MAX. - AC_MSG_CHECKING([for SIZE_MAX]) - result= - AC_EGREP_CPP([Found it], [ -#include -#if HAVE_STDINT_H -#include -#endif -#ifdef SIZE_MAX -Found it -#endif -], result=yes) - if test -z "$result"; then - dnl Define it ourselves. Here we assume that the type 'size_t' is not wider - dnl than the type 'unsigned long'. - dnl The _AC_COMPUTE_INT macro works up to LONG_MAX, since it uses 'expr', - dnl which is guaranteed to work from LONG_MIN to LONG_MAX. - _AC_COMPUTE_INT([~(size_t)0 / 10], res_hi, - [#include ], result=?) - _AC_COMPUTE_INT([~(size_t)0 % 10], res_lo, - [#include ], result=?) - _AC_COMPUTE_INT([sizeof (size_t) <= sizeof (unsigned int)], fits_in_uint, - [#include ], result=?) - if test "$fits_in_uint" = 1; then - dnl Even though SIZE_MAX fits in an unsigned int, it must be of type - dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'. - AC_TRY_COMPILE([#include - extern size_t foo; - extern unsigned long foo; - ], [], fits_in_uint=0) - fi - if test -z "$result"; then - if test "$fits_in_uint" = 1; then - result="$res_hi$res_lo"U - else - result="$res_hi$res_lo"UL - fi - else - dnl Shouldn't happen, but who knows... - result='~(size_t)0' - fi - fi - AC_MSG_RESULT([$result]) - if test "$result" != yes; then - AC_DEFINE_UNQUOTED([SIZE_MAX], [$result], - [Define as the maximum value of type 'size_t', if the system doesn't define it.]) - fi -]) diff --git a/m4/sqlite3.m4 b/m4/sqlite3.m4 deleted file mode 100644 index 976c04a..0000000 --- a/m4/sqlite3.m4 +++ /dev/null @@ -1,86 +0,0 @@ -dnl -*- autoconf -*- -dnl $id$ -dnl Check for libsqlite3, based on version found at libdbi-drivers.sf.net (GPLv2-licensed) - -AC_DEFUN([AC_FIND_FILE], [ - $3=no - for i in $2; do - for j in $1; do - if test -r "$i/$j"; then - $3=$i - break 2 - fi - done - done ]) - -AC_DEFUN([AC_CHECK_SQLITE3], [ - have_sqlite3="no" - ac_sqlite3="no" - ac_sqlite3_incdir="no" - ac_sqlite3_libdir="no" - - # exported variables - SQLITE_LIBS="" - SQLITE_CFLAGS="" - - AC_ARG_WITH(sqlite3, AC_HELP_STRING([--with-sqlite3[=dir]], [Compile with libsqlite3 at given dir]), - [ ac_sqlite3="$withval" - if test "x$withval" != "xno" -a "x$withval" != "xyes"; then - ac_sqlite3="yes" - ac_sqlite3_incdir="$withval"/include - ac_sqlite3_libdir="$withval"/lib - fi ], - [ ac_sqlite3="auto" ] ) - AC_ARG_WITH(sqlite3-incdir, AC_HELP_STRING([--with-sqlite3-incdir], [Specifies where the SQLite3 include files are.]), - [ ac_sqlite3_incdir="$withval" ] ) - AC_ARG_WITH(sqlite3-libdir, AC_HELP_STRING([--with-sqlite3-libdir], [Specifies where the SQLite3 libraries are.]), - [ ac_sqlite3_libdir="$withval" ] ) - - AC_MSG_CHECKING([for SQLite3]) - - # Try to automagically find SQLite, either with pkg-config, or without. - if test "x$ac_sqlite3" = "xauto"; then - if test "x$PKG_CONFIG" != "xno"; then - SQLITE_LIBS=`$PKG_CONFIG --libs sqlite3` - SQLITE_CFLAGS=`$PKG_CONFIG --cflags sqlite3` - if test "x$SQLITE_LIBS" = "x" -a "x$SQLITE_CFLAGS" = "x"; then - AC_CHECK_LIB([sqlite3], [sqlite3_open], [ac_sqlite3="yes"], [ac_sqlite3="no"]) - else - ac_sqlite3="yes" - fi - else - AC_CHECK_LIB([sqlite3], [sqlite3_open], [ac_sqlite3="yes"], [ac_sqlite3="no"]) - fi - fi - - if test "x$ac_sqlite3" = "xyes"; then - if test "$ac_sqlite3_incdir" = "no"; then - sqlite3_incdirs="/usr/include /usr/local/include /usr/include/sqlite /usr/local/include/sqlite /usr/local/sqlite/include /opt/sqlite/include" - AC_FIND_FILE(sqlite3.h, $sqlite3_incdirs, ac_sqlite3_incdir) - if test "$ac_sqlite3_incdir" = "no"; then - AC_MSG_ERROR([Invalid SQLite directory - include files not found.]) - fi - fi - if test "$ac_sqlite3_libdir" = "no"; then - sqlite3_libdirs="/usr/lib64 /usr/lib /usr/local/lib64 /usr/local/lib /usr/lib/sqlite usr/lib64/sqlite /usr/local/lib/sqlite /usr/local/sqlite/lib /opt/sqlite/lib" - sqlite3_libs="libsqlite3.so libsqlite3.a" - AC_FIND_FILE($sqlite3_libs, $sqlite3_libdirs, ac_sqlite3_libdir) - if test "$ac_sqlite3_libdir" = "no"; then - AC_MSG_ERROR([Invalid SQLite directory - libraries not found.]) - fi - fi - have_sqlite3="yes" - - if test x"$ac_sqlite3_libdir" = xno; then - test "x$SQLITE_LIBS" = "x" && SQLITE_LIBS="-lsqlite3" - else - test "x$SQLITE_LIBS" = "x" && SQLITE_LIBS="-L$ac_sqlite3_libdir -lsqlite3" - fi - test x"$ac_sqlite3_incdir" != xno && test "x$SQLITE_CFLAGS" = "x" && SQLITE_CFLAGS=-I$ac_sqlite3_incdir - - AC_SUBST(SQLITE_LIBS) - AC_SUBST(SQLITE_CFLAGS) - fi - - AC_MSG_RESULT([$ac_sqlite3]) -]) diff --git a/m4/stdint_h.m4 b/m4/stdint_h.m4 deleted file mode 100644 index 3355f35..0000000 --- a/m4/stdint_h.m4 +++ /dev/null @@ -1,26 +0,0 @@ -# stdint_h.m4 serial 5 -dnl Copyright (C) 1997-2004 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl From Paul Eggert. - -# Define HAVE_STDINT_H_WITH_UINTMAX if exists, -# doesn't clash with , and declares uintmax_t. - -AC_DEFUN([gl_AC_HEADER_STDINT_H], -[ - AC_CACHE_CHECK([for stdint.h], gl_cv_header_stdint_h, - [AC_TRY_COMPILE( - [#include -#include ], - [uintmax_t i = (uintmax_t) -1;], - gl_cv_header_stdint_h=yes, - gl_cv_header_stdint_h=no)]) - if test $gl_cv_header_stdint_h = yes; then - AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1, - [Define if exists, doesn't clash with , - and declares uintmax_t. ]) - fi -]) diff --git a/m4/uintmax_t.m4 b/m4/uintmax_t.m4 deleted file mode 100644 index bf83ed7..0000000 --- a/m4/uintmax_t.m4 +++ /dev/null @@ -1,30 +0,0 @@ -# uintmax_t.m4 serial 9 -dnl Copyright (C) 1997-2004 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl From Paul Eggert. - -AC_PREREQ(2.13) - -# Define uintmax_t to 'unsigned long' or 'unsigned long long' -# if it is not already defined in or . - -AC_DEFUN([gl_AC_TYPE_UINTMAX_T], -[ - AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) - AC_REQUIRE([gl_AC_HEADER_STDINT_H]) - if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then - AC_REQUIRE([gl_AC_TYPE_UNSIGNED_LONG_LONG]) - test $ac_cv_type_unsigned_long_long = yes \ - && ac_type='unsigned long long' \ - || ac_type='unsigned long' - AC_DEFINE_UNQUOTED(uintmax_t, $ac_type, - [Define to unsigned long or unsigned long long - if and don't define.]) - else - AC_DEFINE(HAVE_UINTMAX_T, 1, - [Define if you have the 'uintmax_t' type in or .]) - fi -]) diff --git a/m4/ulonglong.m4 b/m4/ulonglong.m4 deleted file mode 100644 index dee10cc..0000000 --- a/m4/ulonglong.m4 +++ /dev/null @@ -1,23 +0,0 @@ -# ulonglong.m4 serial 4 -dnl Copyright (C) 1999-2004 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl From Paul Eggert. - -# Define HAVE_UNSIGNED_LONG_LONG if 'unsigned long long' works. - -AC_DEFUN([gl_AC_TYPE_UNSIGNED_LONG_LONG], -[ - AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long, - [AC_TRY_LINK([unsigned long long ull = 1ULL; int i = 63;], - [unsigned long long ullmax = (unsigned long long) -1; - return ull << i | ull >> i | ullmax / ull | ullmax % ull;], - ac_cv_type_unsigned_long_long=yes, - ac_cv_type_unsigned_long_long=no)]) - if test $ac_cv_type_unsigned_long_long = yes; then - AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1, - [Define if you have the 'unsigned long long' type.]) - fi -]) diff --git a/m4/wchar_t.m4 b/m4/wchar_t.m4 deleted file mode 100644 index cde2129..0000000 --- a/m4/wchar_t.m4 +++ /dev/null @@ -1,20 +0,0 @@ -# wchar_t.m4 serial 1 (gettext-0.12) -dnl Copyright (C) 2002-2003 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl From Bruno Haible. -dnl Test whether has the 'wchar_t' type. -dnl Prerequisite: AC_PROG_CC - -AC_DEFUN([gt_TYPE_WCHAR_T], -[ - AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t, - [AC_TRY_COMPILE([#include - wchar_t foo = (wchar_t)'\0';], , - gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)]) - if test $gt_cv_c_wchar_t = yes; then - AC_DEFINE(HAVE_WCHAR_T, 1, [Define if you have the 'wchar_t' type.]) - fi -]) diff --git a/m4/wint_t.m4 b/m4/wint_t.m4 deleted file mode 100644 index b8fff9c..0000000 --- a/m4/wint_t.m4 +++ /dev/null @@ -1,20 +0,0 @@ -# wint_t.m4 serial 1 (gettext-0.12) -dnl Copyright (C) 2003 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl From Bruno Haible. -dnl Test whether has the 'wint_t' type. -dnl Prerequisite: AC_PROG_CC - -AC_DEFUN([gt_TYPE_WINT_T], -[ - AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t, - [AC_TRY_COMPILE([#include - wint_t foo = (wchar_t)'\0';], , - gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)]) - if test $gt_cv_c_wint_t = yes; then - AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.]) - fi -]) diff --git a/m4/xsize.m4 b/m4/xsize.m4 deleted file mode 100644 index 85bb721..0000000 --- a/m4/xsize.m4 +++ /dev/null @@ -1,13 +0,0 @@ -# xsize.m4 serial 3 -dnl Copyright (C) 2003-2004 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -AC_DEFUN([gl_XSIZE], -[ - dnl Prerequisites of lib/xsize.h. - AC_REQUIRE([gl_SIZE_MAX]) - AC_REQUIRE([AC_C_INLINE]) - AC_CHECK_HEADERS(stdint.h) -]) diff --git a/macros/ax_prefix_config_h.m4 b/macros/ax_prefix_config_h.m4 deleted file mode 100644 index c1b2887..0000000 --- a/macros/ax_prefix_config_h.m4 +++ /dev/null @@ -1,173 +0,0 @@ -dnl @synopsis AX_PREFIX_CONFIG_H [(OUTPUT-HEADER [,PREFIX [,ORIG-HEADER]])] -dnl -dnl This is a new variant from ac_prefix_config_ this one will use a -dnl lowercase-prefix if the config-define was starting with a -dnl lowercase-char, e.g. "#define const", "#define restrict", or -dnl "#define off_t", (and this one can live in another directory, e.g. -dnl testpkg/config.h therefore I decided to move the output-header to -dnl be the first arg) -dnl -dnl takes the usual config.h generated header file; looks for each of -dnl the generated "#define SOMEDEF" lines, and prefixes the defined -dnl name (ie. makes it "#define PREFIX_SOMEDEF". The result is written -dnl to the output config.header file. The PREFIX is converted to -dnl uppercase for the conversions. -dnl -dnl Defaults: -dnl -dnl OUTPUT-HEADER = $PACKAGE-config.h -dnl PREFIX = $PACKAGE -dnl ORIG-HEADER, from AM_CONFIG_HEADER(config.h) -dnl -dnl Your configure.ac script should contain both macros in this order, -dnl and unlike the earlier variations of this prefix-macro it is okay -dnl to place the AX_PREFIX_CONFIG_H call before the AC_OUTPUT -dnl invokation. -dnl -dnl Example: -dnl -dnl AC_INIT(config.h.in) # config.h.in as created by "autoheader" -dnl AM_INIT_AUTOMAKE(testpkg, 0.1.1) # makes #undef VERSION and PACKAGE -dnl AM_CONFIG_HEADER(config.h) # prep config.h from config.h.in -dnl AX_PREFIX_CONFIG_H(mylib/_config.h) # prep mylib/_config.h from it.. -dnl AC_MEMORY_H # makes "#undef NEED_MEMORY_H" -dnl AC_C_CONST_H # makes "#undef const" -dnl AC_OUTPUT(Makefile) # creates the "config.h" now -dnl # and also mylib/_config.h -dnl -dnl if the argument to AX_PREFIX_CONFIG_H would have been omitted then -dnl the default outputfile would have been called simply -dnl "testpkg-config.h", but even under the name "mylib/_config.h" it -dnl contains prefix-defines like -dnl -dnl #ifndef TESTPKG_VERSION -dnl #define TESTPKG_VERSION "0.1.1" -dnl #endif -dnl #ifndef TESTPKG_NEED_MEMORY_H -dnl #define TESTPKG_NEED_MEMORY_H 1 -dnl #endif -dnl #ifndef _testpkg_const -dnl #define _testpkg_const _const -dnl #endif -dnl -dnl and this "mylib/_config.h" can be installed along with other -dnl header-files, which is most convenient when creating a shared -dnl library (that has some headers) where some functionality is -dnl dependent on the OS-features detected at compile-time. No need to -dnl invent some "mylib-confdefs.h.in" manually. :-) -dnl -dnl Note that some AC_DEFINEs that end up in the config.h file are -dnl actually self-referential - e.g. AC_C_INLINE, AC_C_CONST, and the -dnl AC_TYPE_OFF_T say that they "will define inline|const|off_t if the -dnl system does not do it by itself". You might want to clean up about -dnl these - consider an extra mylib/conf.h that reads something like: -dnl -dnl #include -dnl #ifndef _testpkg_const -dnl #define _testpkg_const const -dnl #endif -dnl -dnl and then start using _testpkg_const in the header files. That is -dnl also a good thing to differentiate whether some library-user has -dnl starting to take up with a different compiler, so perhaps it could -dnl read something like this: -dnl -dnl #ifdef _MSC_VER -dnl #include -dnl #else -dnl #include -dnl #endif -dnl #ifndef _testpkg_const -dnl #define _testpkg_const const -dnl #endif -dnl -dnl @category Misc -dnl @author Guido Draheim -dnl @author Mårten Svantesson -dnl @version 2005-06-08 -dnl @license GPLWithACException - -AC_DEFUN([AX_PREFIX_CONFIG_H],[AC_REQUIRE([AC_CONFIG_HEADER]) -AC_CONFIG_COMMANDS([ifelse($1,,$PACKAGE-config.h,$1)],[dnl -AS_VAR_PUSHDEF([_OUT],[ac_prefix_conf_OUT])dnl -AS_VAR_PUSHDEF([_DEF],[ac_prefix_conf_DEF])dnl -AS_VAR_PUSHDEF([_PKG],[ac_prefix_conf_PKG])dnl -AS_VAR_PUSHDEF([_LOW],[ac_prefix_conf_LOW])dnl -AS_VAR_PUSHDEF([_UPP],[ac_prefix_conf_UPP])dnl -AS_VAR_PUSHDEF([_INP],[ac_prefix_conf_INP])dnl -m4_pushdef([_script],[conftest.prefix])dnl -m4_pushdef([_symbol],[m4_cr_Letters[]m4_cr_digits[]_])dnl -_OUT=`printf '%s\n' ifelse($1, , $PACKAGE-config.h, $1)` -_DEF=`printf '%s\n' _$_OUT | sed -e "y:m4_cr_letters:m4_cr_LETTERS[]:" -e "s/@<:@^m4_cr_Letters@:>@/_/g"` -_PKG=`printf '%s\n' ifelse($2, , $PACKAGE, $2)` -_LOW=`printf '%s\n' _$_PKG | sed -e "y:m4_cr_LETTERS-:m4_cr_letters[]_:"` -_UPP=`printf '%s\n' $_PKG | sed -e "y:m4_cr_letters-:m4_cr_LETTERS[]_:" -e "/^@<:@m4_cr_digits@:>@/s/^/_/"` -_INP=`printf '%s\n' "ifelse($3,,,$3)" | sed -e 's/ *//'` -if test ".$_INP" = "."; then - for ac_file in : $CONFIG_HEADERS; do test "_$ac_file" = _: && continue - case "$ac_file" in - *.h) _INP=$ac_file ;; - *) - esac - test ".$_INP" != "." && break - done -fi -if test ".$_INP" = "."; then - case "$_OUT" in - */*) _INP=`basename "$_OUT"` - ;; - *-*) _INP=`printf '%s\n' "$_OUT" | sed -e "s/@<:@_symbol@:>@*-//"` - ;; - *) _INP=config.h - ;; - esac -fi -if test -z "$_PKG" ; then - AC_MSG_ERROR([no prefix for _PREFIX_PKG_CONFIG_H]) -else - if test ! -f "$_INP" ; then if test -f "$srcdir/$_INP" ; then - _INP="$srcdir/$_INP" - fi fi - AC_MSG_NOTICE(creating $_OUT - prefix $_UPP for $_INP defines) - if test -f $_INP ; then - printf '%s\n' "s/@%:@undef *\\(@<:@m4_cr_LETTERS[]_@:>@\\)/@%:@undef $_UPP""_\\1/" > _script - printf '%s\n' "s/@%:@undef *\\(@<:@m4_cr_letters@:>@\\)/@%:@undef $_LOW""_\\1/" >> _script - printf '%s\n' "s/@%:@def[]ine *\\(@<:@m4_cr_LETTERS[]_@:>@@<:@_symbol@:>@*\\)\\(.*\\)/@%:@ifndef $_UPP""_\\1 \\" >> _script - printf '%s\n' "@%:@def[]ine $_UPP""_\\1 \\2 \\" >> _script - printf '%s\n' "@%:@endif/" >>_script - printf '%s\n' "s/@%:@def[]ine *\\(@<:@m4_cr_letters@:>@@<:@_symbol@:>@*\\)\\(.*\\)/@%:@ifndef $_LOW""_\\1 \\" >> _script - printf '%s\n' "@%:@define $_LOW""_\\1 \\2 \\" >> _script - printf '%s\n' "@%:@endif/" >> _script - # now executing _script on _DEF input to create _OUT output file - printf '%s\n' "@%:@ifndef $_DEF" >$tmp/pconfig.h - printf '%s\n' "@%:@def[]ine $_DEF 1" >>$tmp/pconfig.h - printf '%s\n' ' ' >>$tmp/pconfig.h - printf '%s\n' /'*' $_OUT. Generated automatically at end of configure. '*'/ >>$tmp/pconfig.h - - sed -f _script $_INP >>$tmp/pconfig.h - printf '%s\n' ' ' >>$tmp/pconfig.h - printf '%s\n' '/* once:' $_DEF '*/' >>$tmp/pconfig.h - printf '%s\n' "@%:@endif" >>$tmp/pconfig.h - if cmp -s $_OUT $tmp/pconfig.h 2>/dev/null; then - AC_MSG_NOTICE([$_OUT is unchanged]) - else - ac_dir=`AS_DIRNAME(["$_OUT"])` - AS_MKDIR_P(["$ac_dir"]) - rm -f "$_OUT" - mv $tmp/pconfig.h "$_OUT" - fi - cp _script _configs.sed - else - AC_MSG_ERROR([input file $_INP does not exist - skip generating $_OUT]) - fi - rm -f conftest.* -fi -m4_popdef([_symbol])dnl -m4_popdef([_script])dnl -AS_VAR_POPDEF([_INP])dnl -AS_VAR_POPDEF([_UPP])dnl -AS_VAR_POPDEF([_LOW])dnl -AS_VAR_POPDEF([_PKG])dnl -AS_VAR_POPDEF([_DEF])dnl -AS_VAR_POPDEF([_OUT])dnl -],[PACKAGE="$PACKAGE"])]) diff --git a/man/Bongo.rules b/man/Bongo.rules deleted file mode 100644 index adcfc82..0000000 --- a/man/Bongo.rules +++ /dev/null @@ -1,53 +0,0 @@ -mannormal = man/bongo-admin.1 \ - man/bongo-backup.1 \ - man/bongo-config.1 \ - man/bongo-manager.1 \ - man/bongo-queuetool.1 \ - man/bongo-setup.1 \ - man/bongo-sendmail.1 \ - man/bongo-standalone.1 \ - man/bongo-storetool.1 \ - man/bongoagents.8 - -mansymlinked = man/bongoaddressbook.8 \ - man/bongoalarm.8 \ - man/bongoantispam.8 \ - man/bongoavirus.8 \ - man/bongocalcmd.8 \ - man/bongocollector.8 \ - man/bongoconnmgr.8 \ - man/bongogeneric.8 \ - man/bongoimap.8 \ - man/bongoitip.8 \ - man/bongomailprox.8 \ - man/bongopluspack.8 \ - man/bongopop3.8 \ - man/bongoqueue.8 \ - man/bongorules.8 \ - man/bongosmtp.8 \ - man/bongostore.8 - -man/bongo%.8: - [ -L $(top_srcdir)/man/bongo$*.8 ] || ln -s bongoagents.8 $(top_srcdir)/man/bongo$*.8 - -dist_man_MANS = $(mannormal) -nodist_man_MANS = $(mansymlinked) - -CLEANFILES += man/bongoaddressbook.8 \ - man/bongoalarm.8 \ - man/bongoantispam.8 \ - man/bongoavirus.8 \ - man/bongocalcmd.8 \ - man/bongocollector.8 \ - man/bongoconnmgr.8 \ - man/bongogeneric.8 \ - man/bongoimap.8 \ - man/bongoitip.8 \ - man/bongomailprox.8 \ - man/bongopluspack.8 \ - man/bongopop3.8 \ - man/bongoqueue.8 \ - man/bongorules.8 \ - man/bongosmtp.8 \ - man/bongostore.8 - diff --git a/man/Makefile.am b/man/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/man/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/mkinstalldirs b/mkinstalldirs deleted file mode 100755 index 259dbfc..0000000 --- a/mkinstalldirs +++ /dev/null @@ -1,158 +0,0 @@ -#! /bin/sh -# mkinstalldirs --- make directory hierarchy - -scriptversion=2005-06-29.22 - -# Original author: Noah Friedman -# Created: 1993-05-16 -# Public domain. -# -# This file is maintained in Automake, please report -# bugs to or send patches to -# . - -errstatus=0 -dirmode= - -usage="\ -Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... - -Create each directory DIR (with mode MODE, if specified), including all -leading file name components. - -Report bugs to ." - -# process command line arguments -while test $# -gt 0 ; do - case $1 in - -h | --help | --h*) # -h for help - echo "$usage" - exit $? - ;; - -m) # -m PERM arg - shift - test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } - dirmode=$1 - shift - ;; - --version) - echo "$0 $scriptversion" - exit $? - ;; - --) # stop option processing - shift - break - ;; - -*) # unknown option - echo "$usage" 1>&2 - exit 1 - ;; - *) # first non-opt arg - break - ;; - esac -done - -for file -do - if test -d "$file"; then - shift - else - break - fi -done - -case $# in - 0) exit 0 ;; -esac - -# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and -# mkdir -p a/c at the same time, both will detect that a is missing, -# one will create a, then the other will try to create a and die with -# a "File exists" error. This is a problem when calling mkinstalldirs -# from a parallel make. We use --version in the probe to restrict -# ourselves to GNU mkdir, which is thread-safe. -case $dirmode in - '') - if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then - echo "mkdir -p -- $*" - exec mkdir -p -- "$@" - else - # On NextStep and OpenStep, the `mkdir' command does not - # recognize any option. It will interpret all options as - # directories to create, and then abort because `.' already - # exists. - test -d ./-p && rmdir ./-p - test -d ./--version && rmdir ./--version - fi - ;; - *) - if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 && - test ! -d ./--version; then - echo "mkdir -m $dirmode -p -- $*" - exec mkdir -m "$dirmode" -p -- "$@" - else - # Clean up after NextStep and OpenStep mkdir. - for d in ./-m ./-p ./--version "./$dirmode"; - do - test -d $d && rmdir $d - done - fi - ;; -esac - -for file -do - case $file in - /*) pathcomp=/ ;; - *) pathcomp= ;; - esac - oIFS=$IFS - IFS=/ - set fnord $file - shift - IFS=$oIFS - - for d - do - test "x$d" = x && continue - - pathcomp=$pathcomp$d - case $pathcomp in - -*) pathcomp=./$pathcomp ;; - esac - - if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" - - mkdir "$pathcomp" || lasterr=$? - - if test ! -d "$pathcomp"; then - errstatus=$lasterr - else - if test ! -z "$dirmode"; then - echo "chmod $dirmode $pathcomp" - lasterr= - chmod "$dirmode" "$pathcomp" || lasterr=$? - - if test ! -z "$lasterr"; then - errstatus=$lasterr - fi - fi - fi - fi - - pathcomp=$pathcomp/ - done -done - -exit $errstatus - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" -# End: diff --git a/po/Bongo.rules b/po/Bongo.rules deleted file mode 100644 index 4889ee0..0000000 --- a/po/Bongo.rules +++ /dev/null @@ -1,50 +0,0 @@ -# -*- Makefile -*- -MOFILES=$(POFILES:.po=.mo) - -dist_noinst_DATA += $(POFILES) \ - po/bongo.pot \ - po/bongo-web.pot \ - po/POTFILES.bongo \ - po/POTFILES.bongo-web - -po/all: update-mo - -po/clean: - for file in ${MOFILES}; do \ - rm -f $$file; \ - done - -po/install: po/all - for file in $(MOFILES); do \ - lang=`echo $$file | sed -e 's,.*/,,' | sed -e 's/.mo//'`; \ - $(MKINSTALLDIRS) $(DESTDIR)/$(localedir)/$$lang/LC_MESSAGES/; \ - installfilename=`basename $$(dirname $$file)`; \ - $(INSTALL) -m 0644 $$file $(DESTDIR)/$(localedir)/$$lang/LC_MESSAGES/$$installfilename.mo; \ - done - -update-pot: - $(XGETTEXT) --directory=$(srcdir) \ - --add-comments=translators \ - --keyword=_ --keyword=N_ --keyword=M_ \ - --files-from=$(srcdir)/po/POTFILES.bongo \ - --msgid-bugs-address="bongo-devel@gna.org" \ - -o po/bongo.pot -# This is a bit of a hack. Nevertheless, it works, I hope. - $(XGETTEXT) --directory=$(srcdir) \ - --add-comments=translators \ - --keyword=_ --keyword=N_ --keyword=M_ \ - --files-from=$(srcdir)/po/POTFILES.bongo-web \ - --msgid-bugs-address="bongo-devel@gna.org" \ - -L python \ - -o po/bongo-web.pot - -update-mo: ${MOFILES} - -update-po: ${POFILES}-update update-mo - -%.mo: - rm -f $@ && $(GMSGFMT) -o $@ $*.po - -%.po-update: update-pot - whichpotfile=`echo $*.po | sed -e 's,po/\([^/]*\)/.*,\1,'`; \ - $(MSGMERGE) $*.po po/$$whichpotfile.pot -o $*.po; diff --git a/po/Makefile.am b/po/Makefile.am deleted file mode 100644 index 6e4412f..0000000 --- a/po/Makefile.am +++ /dev/null @@ -1,19 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ - -distclean: diff --git a/src/agents/alarm/Bongo.rules b/src/agents/alarm/Bongo.rules deleted file mode 100644 index 0c26751..0000000 --- a/src/agents/alarm/Bongo.rules +++ /dev/null @@ -1,33 +0,0 @@ -# -*- Makefile -*- -sbin_PROGRAMS += bongoalarm - -bongoalarm_SOURCES = \ - src/agents/alarm/alarm.c \ - src/agents/alarm/alarm.h - -bongoalarm_CFLAGS = $(LIBCURL_CFLAGS) $(LIBICAL_CFLAGS) - -bongoalarm_LDADD = \ - libbongonmap.la \ - libbongocal.la \ - libbongomsgapi.la \ - libbongologger.la \ - libbongoconnio.la \ - libbongomemmgr.la \ - libbongostreamio.la \ - libbongoutil.la \ - libbongoxpl.la \ - $(top_builddir)/import/log4c/log4c/libbongolog4c.la \ - $(LIBICAL_LIBS) \ - $(LIBCURL_LIBS) \ - $(PTHREAD_LIBS) \ - $(ALL_LIBS) - - -install-data-hook:: - $(mkinstalldirs) $(DESTDIR)$(XPL_DEFAULT_CACHE_DIR)/alarm - -src/agents/alarm/all: bongoalarm -src/agents/alarm/clean: clean -src/agents/alarm/install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) sbin_PROGRAMS=bongoalarm install-sbinPROGRAMS diff --git a/src/agents/alarm/Makefile.am b/src/agents/alarm/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/agents/alarm/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/agents/antispam/Bongo.rules b/src/agents/antispam/Bongo.rules deleted file mode 100644 index 1d2d735..0000000 --- a/src/agents/antispam/Bongo.rules +++ /dev/null @@ -1,25 +0,0 @@ -# -*- Makefile -*- -sbin_PROGRAMS += bongoantispam - -bongoantispam_SOURCES = \ - src/agents/antispam/antispam.c \ - src/agents/antispam/antispam.h \ - src/agents/antispam/spamd.c - -bongoantispam_LDADD = \ - libbongonmap.la \ - libbongomsgapi.la \ - libbongologger.la \ - libbongoconnio.la \ - libbongomemmgr.la \ - libbongoutil.la \ - libbongoxpl.la \ - libbongo-json.la \ - $(top_builddir)/import/log4c/log4c/libbongolog4c.la \ - $(PTHREAD_LIBS) \ - $(ALL_LIBS) - -src/agents/antispam/all: bongoantispam -src/agents/antispam/clean: clean -src/agents/antispam/install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) sbin_PROGRAMS=bongoantispam install-sbinPROGRAMS diff --git a/src/agents/antispam/CMakeLists.txt b/src/agents/antispam/CMakeLists.txt new file mode 100644 index 0000000..f5e1312 --- /dev/null +++ b/src/agents/antispam/CMakeLists.txt @@ -0,0 +1,16 @@ +add_executable(bongoantispam + antispam.c + spamd.c +) + +target_link_libraries(bongoantispam + bongomemmgr + bongoxpl + bongoconnio + bongoutil + bongojson + bongomsgapi + bongologging +) + +install(TARGETS bongoantispam DESTINATION ${SBIN_INSTALL_DIR}) diff --git a/src/agents/antispam/Makefile.am b/src/agents/antispam/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/agents/antispam/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/agents/antispam/antispam.c b/src/agents/antispam/antispam.c index 954b0bc..41791c1 100644 --- a/src/agents/antispam/antispam.c +++ b/src/agents/antispam/antispam.c @@ -39,11 +39,7 @@ #include "antispam.h" -#if defined(RELEASE_BUILD) -#define ASpamClientAlloc() MemPrivatePoolGetEntry(ASpam.nmap.pool) -#else -#define ASpamClientAlloc() MemPrivatePoolGetEntryDebug(ASpam.nmap.pool, __FILE__, __LINE__) -#endif +#define ASpamClientAlloc() MemPrivatePoolGetEntryDirect(ASpam.nmap.pool, __FILE__, __LINE__) static void SignalHandler(int sigtype); @@ -64,7 +60,7 @@ ASpamClientFree(void *client) if (c->envelope) { MemFree(c->envelope); } - MemPrivatePoolReturnEntry(c); + MemPrivatePoolReturnEntry(ASpam.nmap.pool, c); return; } diff --git a/src/agents/avirus/Bongo.rules b/src/agents/avirus/Bongo.rules deleted file mode 100644 index 6fdb060..0000000 --- a/src/agents/avirus/Bongo.rules +++ /dev/null @@ -1,24 +0,0 @@ -# -*- Makefile -*- -sbin_PROGRAMS += bongoavirus - -bongoavirus_SOURCES = \ - src/agents/avirus/avirus.c \ - src/agents/avirus/avirus.h - -bongoavirus_LDADD = \ - libbongonmap.la \ - libbongostreamio.la \ - libbongomsgapi.la \ - libbongologger.la \ - libbongoconnio.la \ - libbongomemmgr.la \ - libbongoutil.la \ - libbongoxpl.la \ - $(top_builddir)/import/log4c/log4c/libbongolog4c.la \ - $(PTHREAD_LIBS) \ - $(ALL_LIBS) - -src/agents/avirus/all: bongoavirus -src/agents/avirus/clean: clean -src/agents/avirus/install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) sbin_PROGRAMS=bongoavirus install-sbinPROGRAMS diff --git a/src/agents/avirus/CMakeLists.txt b/src/agents/avirus/CMakeLists.txt new file mode 100644 index 0000000..122be38 --- /dev/null +++ b/src/agents/avirus/CMakeLists.txt @@ -0,0 +1,15 @@ +add_executable(bongoavirus + avirus.c +) + +target_link_libraries(bongoavirus + bongomemmgr + bongoxpl + bongoconnio + bongoutil + bongojson + bongomsgapi + bongologging +) + +install(TARGETS bongoavirus DESTINATION ${SBIN_INSTALL_DIR}) diff --git a/src/agents/avirus/Makefile.am b/src/agents/avirus/Makefile.am deleted file mode 100755 index 8830401..0000000 --- a/src/agents/avirus/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/agents/avirus/avirus.c b/src/agents/avirus/avirus.c index 0f93cdc..1bf826a 100755 --- a/src/agents/avirus/avirus.c +++ b/src/agents/avirus/avirus.c @@ -52,7 +52,7 @@ AVirusClientFree(void *client) if (c->envelope) { MemFree(c->envelope); } - MemPrivatePoolReturnEntry(c); + MemPrivatePoolReturnEntry(AVirus.QueueMemPool, c); return; } diff --git a/src/agents/calcmd/Bongo.rules b/src/agents/calcmd/Bongo.rules deleted file mode 100644 index 84e1ffa..0000000 --- a/src/agents/calcmd/Bongo.rules +++ /dev/null @@ -1,24 +0,0 @@ -# -*- Makefile -*- -sbin_PROGRAMS += bongocalcmd - -bongocalcmd_SOURCES = \ - src/agents/calcmd/calcmdd.c \ - src/agents/calcmd/calcmdd.h - -bongocalcmd_LDADD = \ - libbongonmap.la \ - libbongomsgapi.la \ - libbongologger.la \ - libbongoconnio.la \ - libbongomemmgr.la \ - libbongoutil.la \ - libbongoxpl.la \ - libbongocalcmd.la \ - $(top_builddir)/import/log4c/log4c/libbongolog4c.la \ - $(PTHREAD_LIBS) \ - $(ALL_LIBS) - -src/agents/calcmd/all: bongocalcmd -src/agents/calcmd/clean: clean -src/agents/calcmd/install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) sbin_PROGRAMS=bongocalcmd install-sbinPROGRAMS diff --git a/src/agents/calcmd/Makefile.am b/src/agents/calcmd/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/agents/calcmd/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/agents/collector/Bongo.rules b/src/agents/collector/Bongo.rules deleted file mode 100644 index caeb238..0000000 --- a/src/agents/collector/Bongo.rules +++ /dev/null @@ -1,33 +0,0 @@ -# -*- Makefile -*- -sbin_PROGRAMS += bongocollector - -bongocollector_SOURCES = \ - src/agents/collector/collector.c \ - src/agents/collector/collector.h - -bongocollector_CPPFLAGS = $(AM_CPPFLAGS) \ - $(LIBCURL_CPPFLAGS) $(LIBICAL_CFLAGS) - -bongocollector_LDADD = \ - libbongonmap.la \ - libbongocal.la \ - libbongomsgapi.la \ - libbongologger.la \ - libbongoconnio.la \ - libbongomemmgr.la \ - libbongostreamio.la \ - libbongoutil.la \ - libbongoxpl.la \ - $(top_builddir)/import/log4c/log4c/libbongolog4c.la \ - $(LIBCURL_LIBS) \ - $(LIBICAL_LIBS) \ - $(PTHREAD_LIBS) \ - $(ALL_LIBS) - -install-data-hook:: - $(mkinstalldirs) $(DESTDIR)$(XPL_DEFAULT_CACHE_DIR)/collector - -src/agents/collector/all: bongocollector -src/agents/collector/clean: clean -src/agents/collector/install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) sbin_PROGRAMS=bongocollector install-sbinPROGRAMS diff --git a/src/agents/collector/Makefile.am b/src/agents/collector/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/agents/collector/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/agents/connmgr/Bongo.rules b/src/agents/connmgr/Bongo.rules deleted file mode 100644 index a01fa35..0000000 --- a/src/agents/connmgr/Bongo.rules +++ /dev/null @@ -1,35 +0,0 @@ -# -*- Makefile -*- -cmmoduledir = $(libdir)/connmgr -cmmodule_LTLIBRARIES := - -sbin_PROGRAMS += bongoconnmgr - -bongoconnmgr_SOURCES := \ - src/agents/connmgr/connmgr.c \ - src/agents/connmgr/connmgrp.h \ - src/agents/connmgr/modules.c - -bongoconnmgr_LDADD := \ - libbongomanagement.la \ - libbongomsgapi.la \ - libbongomdb.la \ - libbongologger.la \ - libbongoconnio.la \ - libbongomemmgr.la \ - libbongoutil.la \ - libbongoxpl.la \ - $(top_builddir)/import/log4c/log4c/libbongolog4c.la \ - $(SQLITE_LIBS) \ - $(PTHREAD_LIBS) \ - $(ALL_LIBS) - -src/agents/connmgr/all: bongoconnmgr \ - src/agents/connmgr/cmmodules/rbl/all \ - src/agents/connmgr/cmmodules/rdns/all \ - src/agents/connmgr/cmmodules/user/all \ - src/agents/connmgr/cmmodules/lists/all - -src/agents/connmgr/clean: clean -src/agents/connmgr/install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) sbin_PROGRAMS=bongoconnmgr \ - install-sbinPROGRAMS install-cmmoduleLTLIBRARIES diff --git a/src/agents/connmgr/Makefile.am b/src/agents/connmgr/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/agents/connmgr/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/agents/connmgr/cmmodules/lists/Bongo.rules b/src/agents/connmgr/cmmodules/lists/Bongo.rules deleted file mode 100644 index f6af5ee..0000000 --- a/src/agents/connmgr/cmmodules/lists/Bongo.rules +++ /dev/null @@ -1,19 +0,0 @@ -# -*- Makefile -*- -cmmodule_LTLIBRARIES += libcmlists.la - -libcmlists_la_SOURCES := \ - src/agents/connmgr/cmmodules/lists/cmlists.c \ - src/agents/connmgr/cmmodules/lists/cmlists.h - -libcmlists_la_LDFLAGS := -module -avoid-version -libcmlists_la_LIBADD := \ - libbongomsgapi.la \ - libbongologger.la \ - libbongomemmgr.la \ - libbongomdb.la \ - libbongoxpl.la \ - $(PTHREAD_LIBS) \ - $(ALL_LIBS) - -src/agents/connmgr/cmmodules/lists/all: libcmlists.la -src/agents/connmgr/cmmodules/lists/clean: clean diff --git a/src/agents/connmgr/cmmodules/lists/Makefile.am b/src/agents/connmgr/cmmodules/lists/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/agents/connmgr/cmmodules/lists/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/agents/connmgr/cmmodules/rbl/Bongo.rules b/src/agents/connmgr/cmmodules/rbl/Bongo.rules deleted file mode 100644 index 1e1772f..0000000 --- a/src/agents/connmgr/cmmodules/rbl/Bongo.rules +++ /dev/null @@ -1,23 +0,0 @@ -# -*- Makefile -*- -cmmodule_LTLIBRARIES += libcmrbl.la - -libcmrbl_la_SOURCES := \ - src/agents/connmgr/cmmodules/rbl/cmrbl.c \ - src/agents/connmgr/cmmodules/rbl/cmrbl.h - -libcmrbl_la_CPPFLAGS := $(AM_CPPFLAGS) \ - $(SQLITE_CFLAGS) - -libcmrbl_la_LDFLAGS := -module -avoid-version -libcmrbl_la_LIBADD := \ - libbongomsgapi.la \ - libbongologger.la \ - libbongomemmgr.la \ - libbongomdb.la \ - libbongoxpl.la \ - $(SQLITE_LIBS) \ - $(PTHREAD_LIBS) \ - $(ALL_LIBS) - -src/agents/connmgr/cmmodules/rbl/all: libcmrbl.la -src/agents/connmgr/cmmodules/rbl/clean: clean diff --git a/src/agents/connmgr/cmmodules/rbl/Makefile.am b/src/agents/connmgr/cmmodules/rbl/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/agents/connmgr/cmmodules/rbl/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/agents/connmgr/cmmodules/rdns/Bongo.rules b/src/agents/connmgr/cmmodules/rdns/Bongo.rules deleted file mode 100644 index 4bb0452..0000000 --- a/src/agents/connmgr/cmmodules/rdns/Bongo.rules +++ /dev/null @@ -1,23 +0,0 @@ -# -*- Makefile -*- -cmmodule_LTLIBRARIES += libcmrdns.la - -libcmrdns_la_SOURCES := \ - src/agents/connmgr/cmmodules/rdns/cmrdns.c \ - src/agents/connmgr/cmmodules/rdns/cmrdns.h - -libcmrdns_la_CPPFLAGS := $(AM_CPPFLAGS) \ - $(SQLITE_CFLAGS) - -libcmrdns_la_LDFLAGS := -module -avoid-version -libcmrdns_la_LIBADD := \ - libbongomsgapi.la \ - libbongologger.la \ - libbongomemmgr.la \ - libbongomdb.la \ - libbongoxpl.la \ - $(SQLITE_LIBS) \ - $(PTHREAD_LIBS) \ - $(ALL_LIBS) - -src/agents/connmgr/cmmodules/rdns/all: libcmrdns.la -src/agents/connmgr/cmmodules/rdns/clean: clean diff --git a/src/agents/connmgr/cmmodules/rdns/Makefile.am b/src/agents/connmgr/cmmodules/rdns/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/agents/connmgr/cmmodules/rdns/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/agents/connmgr/cmmodules/user/Bongo.rules b/src/agents/connmgr/cmmodules/user/Bongo.rules deleted file mode 100644 index 5ad1a23..0000000 --- a/src/agents/connmgr/cmmodules/user/Bongo.rules +++ /dev/null @@ -1,19 +0,0 @@ -# -*- Makefile -*- -cmmodule_LTLIBRARIES += libcmuser.la - -libcmuser_la_SOURCES := \ - src/agents/connmgr/cmmodules/user/cmuser.c \ - src/agents/connmgr/cmmodules/user/cmuser.h - -libcmuser_la_LDFLAGS := -module -avoid-version -libcmuser_la_LIBADD := \ - libbongomsgapi.la \ - libbongologger.la \ - libbongomemmgr.la \ - libbongomdb.la \ - libbongoxpl.la \ - $(PTHREAD_LIBS) \ - $(ALL_LIBS) - -src/agents/connmgr/cmmodules/user/cmuser/all: libcmuser.la -src/agents/connmgr/cmmodules/user/cmuser/clean: clean diff --git a/src/agents/connmgr/cmmodules/user/Makefile.am b/src/agents/connmgr/cmmodules/user/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/agents/connmgr/cmmodules/user/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/agents/connmgr/connmgr.c b/src/agents/connmgr/connmgr.c index 109fbb2..ff27180 100644 --- a/src/agents/connmgr/connmgr.c +++ b/src/agents/connmgr/connmgr.c @@ -39,11 +39,7 @@ #include "connmgrp.h" -#if !defined(DEBUG) -#define GetConnMgrClientPoolEntry() MemPrivatePoolGetEntry(ConnMgr.client.pool) -#else -#define GetConnMgrClientPoolEntry() MemPrivatePoolGetEntryDebug(ConnMgr.client.pool, __FILE__, __LINE__) -#endif +#define GetConnMgrClientPoolEntry() MemPrivatePoolGetEntryDirect(ConnMgr.client.pool, __FILE__, __LINE__) static void SignalHandler(int sigtype); @@ -236,7 +232,7 @@ ConnMgrReturnClientPoolEntry(ConnMgrClient *client) c->state = CONNMGR_CLIENT_FRESH; - MemPrivatePoolReturnEntry(c); + MemPrivatePoolReturnEntry(ConnMgr.client.pool, c); return; } @@ -913,7 +909,7 @@ SendConnMgrStatistics(unsigned char *arguments, unsigned char **response, BOOL * + 10 /* DMCMV_BAD_PASSWORD_COUNT */ + 28); /* Formatting */ - MemPrivatePoolStatistics(ConnMgr.client.pool, &poolStats); + // MemPrivatePoolStatistics(ConnMgr.client.pool, &poolStats); if (*response) { sprintf(*response, "%s (%s: v%d.%d.%d)\r\n%lu:%lu:%lu:%lu:%d:%d:%d:%d:%d:%d\r\n", diff --git a/src/agents/generic/Bongo.rules b/src/agents/generic/Bongo.rules deleted file mode 100644 index 9660fd1..0000000 --- a/src/agents/generic/Bongo.rules +++ /dev/null @@ -1,23 +0,0 @@ -# -*- Makefile -*- -sbin_PROGRAMS += bongogeneric - -bongogeneric_SOURCES = \ - src/agents/generic/generic.c \ - src/agents/generic/generic.h - -bongogeneric_LDADD = \ - libbongonmap.la \ - libbongomsgapi.la \ - libbongologger.la \ - libbongoconnio.la \ - libbongomemmgr.la \ - libbongoutil.la \ - libbongoxpl.la \ - $(top_builddir)/import/log4c/log4c/libbongolog4c.la \ - $(PTHREAD_LIBS) \ - $(ALL_LIBS) - -src/agents/generic/all: bongogeneric -src/agents/generic/clean: clean -src/agents/generic/install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) sbin_PROGRAMS=bongogeneric install-sbinPROGRAMS diff --git a/src/agents/generic/Makefile.am b/src/agents/generic/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/agents/generic/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/agents/generic/generic.c b/src/agents/generic/generic.c index 10ca33b..9caa89b 100755 --- a/src/agents/generic/generic.c +++ b/src/agents/generic/generic.c @@ -44,7 +44,7 @@ GAgentClientFree(void *clientp) MemFree(client->envelope); } - MemPrivatePoolReturnEntry(client); + MemPrivatePoolReturnEntry(GAgent.clientPool, client); } static int diff --git a/src/agents/imap/Bongo.rules b/src/agents/imap/Bongo.rules deleted file mode 100644 index cbfd17b..0000000 --- a/src/agents/imap/Bongo.rules +++ /dev/null @@ -1,37 +0,0 @@ -# -*- Makefile -*- -sbin_PROGRAMS += bongoimap - -bongoimap_SOURCES = \ - src/agents/imap/imapd.c \ - src/agents/imap/imapd.h \ - src/agents/imap/copy.c \ - src/agents/imap/event.c \ - src/agents/imap/fetch.c \ - src/agents/imap/fetch.h \ - src/agents/imap/progress.c \ - src/agents/imap/store.c \ - src/agents/imap/store.h \ - src/agents/imap/search.c \ - src/agents/imap/search.h \ - src/agents/imap/session.c \ - src/agents/imap/rfc822parse.c \ - src/agents/imap/rfc822parse.h \ - src/agents/imap/uid.c \ - src/agents/imap/inline.h - -bongoimap_LDADD = \ - libbongonmap.la \ - libbongomsgapi.la \ - libbongologger.la \ - libbongoconnio.la \ - libbongomemmgr.la \ - libbongoutil.la \ - libbongoxpl.la \ - $(top_builddir)/import/log4c/log4c/libbongolog4c.la \ - $(PTHREAD_LIBS) \ - $(ALL_LIBS) - -src/agents/imap/all: bongoimap src/agents/imap/tests/all -src/agents/imap/clean: clean -src/agents/imap/install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) sbin_PROGRAMS=bongoimap install-sbinPROGRAMS diff --git a/src/agents/imap/CMakeLists.txt b/src/agents/imap/CMakeLists.txt new file mode 100644 index 0000000..1d5f7f2 --- /dev/null +++ b/src/agents/imap/CMakeLists.txt @@ -0,0 +1,24 @@ +add_executable(bongoimap + imapd.c + copy.c + event.c + fetch.c + progress.c + store.c + search.c + session.c + rfc822parse.c + uid.c +) + +target_link_libraries(bongoimap + bongomemmgr + bongoxpl + bongoconnio + bongoutil + bongojson + bongomsgapi + bongologging +) + +install(TARGETS bongoimap DESTINATION ${SBIN_INSTALL_DIR}) diff --git a/src/agents/imap/Makefile.am b/src/agents/imap/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/agents/imap/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/agents/imap/imapd.c b/src/agents/imap/imapd.c index 25646ca..17364da 100644 --- a/src/agents/imap/imapd.c +++ b/src/agents/imap/imapd.c @@ -88,11 +88,7 @@ static ProtocolCommand ImapProtocolCommands[] = { #undef DEBUG -#if !defined(DEBUG) -#define ImapSessionGet() MemPrivatePoolGetEntry(IMAPConnectionPool) -#else -#define ImapSessionGet() MemPrivatePoolGetEntryDebug(IMAPConnectionPool, __FILE__, __LINE__) -#endif +#define ImapSessionGet() MemPrivatePoolGetEntryDirect(IMAPConnectionPool, __FILE__, __LINE__) void *IMAPConnectionPool = NULL; @@ -236,11 +232,8 @@ ImapSessionReturn(ImapSession *session) s->command.buffer = command; s->command.buffer[0] = '\0'; - - MemPrivatePoolReturnEntry(s); - } else { - MemPrivatePoolDiscardEntry(s); } + MemPrivatePoolReturnEntry(IMAPConnectionPool, s); return; } @@ -849,13 +842,7 @@ ImapCommandUnknown(void *param) { ImapSession *session = (ImapSession *)param; - LoggerEvent(Imap.logHandle, LOGGER_SUBSYSTEM_UNHANDLED, LOGGER_EVENT_UNHANDLED_REQUEST, LOG_INFO, 0, - session->user.name, - session->command.buffer, - XplHostToLittle(session->client.conn->socketAddress.sin_addr.s_addr), - 0, - NULL, - 0); + Log(LOG_INFO, "Unhandled command for user %s", session->user.name); return(SendError(session->client.conn, "*", session->command.tag, STATUS_UNKNOWN_COMMAND)); } @@ -3197,9 +3184,9 @@ HandleConnection(void *param) session->progress = NULL; if (ConnNegotiate(session->client.conn, Imap.server.ssl.context)) { if (session->client.conn->ssl.enable == FALSE) { - LoggerEvent(Imap.logHandle, LOGGER_SUBSYSTEM_AUTH, LOGGER_EVENT_CONNECTION, LOG_INFO, 0, NULL, NULL, XplHostToLittle(session->client.conn->socketAddress.sin_addr.s_addr), 0, NULL, 0); + Log(LOG_INFO, "Non-SSL connection from %s", LOGIP(session->client.conn->socketAddress)); } else { - LoggerEvent(Imap.logHandle, LOGGER_SUBSYSTEM_AUTH, LOGGER_EVENT_SSL_CONNECTION, LOG_INFO, 0, NULL, NULL, XplHostToLittle(session->client.conn->socketAddress.sin_addr.s_addr), 0, NULL, 0); + Log(LOG_INFO, "SSL connection from %s", LOGIP(session->client.conn->socketAddress)); } if ((ConnWriteF(session->client.conn, "* OK %s %s server ready <%ud.%lu@%s>\r\n",BongoGlobals.hostname, PRODUCT_NAME, (unsigned int)XplGetThreadID(),time(NULL),BongoGlobals.hostname) != -1) && (ConnFlush(session->client.conn) != -1)) { @@ -3328,15 +3315,13 @@ ServerSocketInit(void) Imap.server.conn->socket = ConnServerSocket(Imap.server.conn, 2048); if (XplSetEffectiveUser(MsgGetUnprivilegedUser()) < 0) { - LoggerEvent(Imap.logHandle, LOGGER_SUBSYSTEM_GENERAL, LOGGER_EVENT_PRIV_FAILURE, LOG_ERROR, 0, MsgGetUnprivilegedUser(), NULL, 0, 0, NULL, 0); - XplConsolePrintf("bongoimap: Could not drop to unprivileged user '%s'\n", MsgGetUnprivilegedUser()); + Log(LOG_ERROR, "Could not drop to unprivileged user '%s'", MsgGetUnprivilegedUser()); return -1; } if (Imap.server.conn->socket < 0) { int ret = Imap.server.conn->socket; - LoggerEvent(Imap.logHandle, LOGGER_SUBSYSTEM_GENERAL, LOGGER_EVENT_BIND_FAILURE, LOG_ERROR, 0, "IMAP ", NULL, Imap.server.port, 0, NULL, 0); - XplConsolePrintf("bongoimap: Could not bind to port %d\n", Imap.server.port); + Log(LOG_ERROR, "Could not bind to port %d", Imap.server.port); ConnFree(Imap.server.conn); return ret; } @@ -3349,7 +3334,7 @@ ServerSocketSSLInit(void) { Imap.server.ssl.conn = ConnAlloc(FALSE); if (Imap.server.ssl.conn == NULL) { - XplConsolePrintf("bongoimap: Could not allocate connection.\n"); + Log(LOG_ERROR, "Could not allocate SSL connection"); ConnFree(Imap.server.conn); return -1; } @@ -3365,16 +3350,14 @@ ServerSocketSSLInit(void) Imap.server.ssl.conn->socket = ConnServerSocket(Imap.server.ssl.conn, 2048); if (XplSetEffectiveUser(MsgGetUnprivilegedUser()) < 0) { - LoggerEvent(Imap.logHandle, LOGGER_SUBSYSTEM_GENERAL, LOGGER_EVENT_PRIV_FAILURE, LOG_ERROR, 0, MsgGetUnprivilegedUser(), NULL, 0, 0, NULL, 0); - XplConsolePrintf("bongoimap: Could not drop to unprivileged user '%s'\n", MsgGetUnprivilegedUser()); + Log(LOG_ERROR, "Could not drop to unprivileged user '%s'", MsgGetUnprivilegedUser()); return -1; } if (Imap.server.ssl.conn->socket < 0) { int ret = Imap.server.ssl.conn->socket; - LoggerEvent(Imap.logHandle, LOGGER_SUBSYSTEM_GENERAL, LOGGER_EVENT_BIND_FAILURE, LOG_ERROR, 0, "IMAP-SSL ", NULL, Imap.server.ssl.port, 0, NULL, 0); - XplConsolePrintf("bongoimap: Could not bind to SSL port %d\n", Imap.server.ssl.port); + Log(LOG_ERROR, "Could not bind to SSL port %d", Imap.server.ssl.port); ConnFree(Imap.server.conn); ConnFree(Imap.server.ssl.conn); @@ -3529,13 +3512,12 @@ IMAPServer(void *unused) case EPROTO: #endif case EINTR: { - LoggerEvent(Imap.logHandle, LOGGER_SUBSYSTEM_GENERAL, LOGGER_EVENT_ACCEPT_FAILURE, LOG_ERROR, 0, NULL, NULL, errno, 0, NULL, 0); + Log(LOG_WARN, "Connection interrupted"); continue; } case EIO: { - LoggerEvent(Imap.logHandle, LOGGER_SUBSYSTEM_GENERAL, LOGGER_EVENT_ACCEPT_FAILURE, LOG_ERROR, 0, NULL, NULL, errno, 2, NULL, 0); - XplConsolePrintf("IMAPD: Server exiting after an accept() failure with an errno: %d\n", errno); + Log(LOG_WARN, "Server exiting after an accept() failure with an errno: %d\n", errno); break; } @@ -3592,8 +3574,7 @@ IMAPServer(void *unused) ConnSSLContextFree(Imap.server.ssl.context); } - LoggerClose(Imap.logHandle); - Imap.logHandle = NULL; + LogClose(); MsgShutdown(); @@ -3696,22 +3677,18 @@ IMAPSSLServer(void *unused) case EPROTO: #endif case EINTR: { - LoggerEvent(Imap.logHandle, LOGGER_SUBSYSTEM_GENERAL, LOGGER_EVENT_ACCEPT_FAILURE, LOG_ERROR, 0, "SSL Server", NULL, errno, 1, NULL, 0); + Log(LOG_WARN, "accept() interrupted"); continue; } case EIO: { Imap.exiting = TRUE; - XplConsolePrintf("IMAPD: SSL Server exiting after an accept() failure with an errno: %d\n", errno); - LoggerEvent(Imap.logHandle, LOGGER_SUBSYSTEM_GENERAL, LOGGER_EVENT_ACCEPT_FAILURE, LOG_ERROR, 0, "SSL Server", NULL, errno, 3, NULL, 0); - + Log(LOG_WARN, "SSL Server exiting after an accept() failure with an errno: %d\n", errno); break; } default: { - XplConsolePrintf("IMAPD: SSL Server exiting after an accept() failure with an errno: %d\n", errno); - LoggerEvent(Imap.logHandle, LOGGER_SUBSYSTEM_GENERAL, LOGGER_EVENT_ACCEPT_FAILURE, LOG_ALERT, 0, "SSL Server", NULL, errno, 1, NULL, 0); - + Log(LOG_WARN, "SSL Server exiting after an accept() failure with an errno: %d\n", errno); break; } } @@ -3811,12 +3788,7 @@ XplServiceMain(int argc, char *argv[]) MsgAuthInit(); NMAPInitialize(); - Imap.logHandle = LoggerOpen("bongoimap"); - if (Imap.logHandle != NULL) { - ; - } else { - XplConsolePrintf("IMAPD: Unable to initialize Nsure Audit. Logging disabled.\r\n"); - } + LogOpen("bongoimap"); ReadConfiguration(); CONN_TRACE_INIT(XPL_DEFAULT_WORK_DIR, "imap"); diff --git a/src/agents/imap/session.c b/src/agents/imap/session.c index d9685a7..9a76e68 100644 --- a/src/agents/imap/session.c +++ b/src/agents/imap/session.c @@ -56,13 +56,13 @@ UserStoreConnect(ImapSession *session, struct sockaddr_in *store) return(STATUS_CONTINUE); } - LoggerEvent(Imap.logHandle, LOGGER_SUBSYSTEM_GENERAL, LOGGER_EVENT_NMAP_UNAVAILABLE, LOG_ERROR, 0, NULL, NULL, store->sin_addr.s_addr, 0, NULL, 0); + Log(LOG_WARN, "Couldn't authenticate user from %s", LOGIPPTR(store)); NMAPQuit(session->store.conn); session->store.conn = NULL; return(STATUS_NMAP_AUTH_ERROR); } - LoggerEvent(Imap.logHandle, LOGGER_SUBSYSTEM_GENERAL, LOGGER_EVENT_NMAP_UNAVAILABLE, LOG_ERROR, 0, NULL, NULL, store->sin_addr.s_addr, 0, NULL, 0); + Log(LOG_ERROR, "NMAP connection error"); return(STATUS_NMAP_CONNECT_ERROR); } @@ -94,8 +94,7 @@ UserStoreInitialize(ImapSession *session, unsigned char *username) ccode = STATUS_NMAP_COMM_ERROR; } - LoggerEvent(Imap.logHandle, LOGGER_SUBSYSTEM_GENERAL, LOGGER_EVENT_NMAP_UNAVAILABLE, LOG_ERROR, - 0, NULL, NULL, session->store.conn->socketAddress.sin_addr.s_addr, ccode, NULL, 0); + Log(LOG_ERROR, "NMAP unavailable"); return(ccode); } @@ -111,8 +110,7 @@ UserLogin(ImapSession *session, unsigned char **username, unsigned char *passwor if (ccode == STATUS_CONTINUE) { ccode = UserStoreInitialize(session, *username); if (ccode == STATUS_CONTINUE) { - LoggerEvent(Imap.logHandle, LOGGER_SUBSYSTEM_AUTH, LOGGER_EVENT_LOGIN, LOG_INFO, - 0, *username, NULL, XplHostToLittle(session->client.conn->socketAddress.sin_addr.s_addr), 0, NULL, 0); + Log(LOG_INFO, "Successful login for user %s", *username); return(STATUS_CONTINUE); } } @@ -145,8 +143,7 @@ SendLoginFailure(ImapSession *session, unsigned char *username, unsigned char *c XplDelay(2000); session->client.authFailures++; if (session->client.authFailures > MAX_FAILED_LOGINS) { - LoggerEvent(Imap.logHandle, LOGGER_SUBSYSTEM_AUTH, LOGGER_EVENT_MAX_FAILED_LOGINS, LOG_NOTICE, - 0, username, NULL, XplHostToLittle(session->client.conn->socketAddress.sin_addr.s_addr), MAX_FAILED_LOGINS, NULL, 0); + Log(LOG_INFO, "Authentication failure for user %s", username); if (ConnWrite(session->client.conn, "* BYE IMAP4rev1 Server signing off\r\n", sizeof("* BYE IMAP4rev1 Server signing off\r\n") - 1) != -1) { if (SendError(session->client.conn, session->command.tag, "LOGIN", STATUS_PERMISSION_DENIED) == STATUS_CONTINUE) { ConnFlush(session->client.conn); diff --git a/src/agents/imap/tests/Bongo.rules b/src/agents/imap/tests/Bongo.rules deleted file mode 100644 index b9b81e5..0000000 --- a/src/agents/imap/tests/Bongo.rules +++ /dev/null @@ -1,20 +0,0 @@ -# -*- Makefile -*- -TESTS += checktest-imap -check_PROGRAMS += checktest-imap - -dist_noinst_DATA += \ - src/agents/imap/tests/uid_test.c - -CLEANFILES += \ - src/agents/imap/tests/checklog.xml - -checktest_imap_SOURCES = \ - src/agents/imap/tests/checktest.c - -checktest_imap_LDADD = $(CHECK_LIBS) \ - libbongomemmgr.la \ - libbongoutil.la \ - libbongoxpl.la - -src/agents/imap/tests/all: -src/agents/imap/tests/clean: clean diff --git a/src/agents/imap/tests/Makefile.am b/src/agents/imap/tests/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/agents/imap/tests/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/agents/itip/Bongo.rules b/src/agents/itip/Bongo.rules deleted file mode 100644 index ca0e625..0000000 --- a/src/agents/itip/Bongo.rules +++ /dev/null @@ -1,25 +0,0 @@ -# -*- Makefile -*- -sbin_PROGRAMS += bongoitip - -bongoitip_SOURCES = \ - src/agents/itip/itip.c \ - src/agents/itip/itip.h - -bongoitip_LDADD = \ - libbongonmap.la \ - libbongomsgapi.la \ - libbongologger.la \ - libbongoconnio.la \ - libbongomemmgr.la \ - libbongoutil.la \ - libbongoxpl.la \ - libbongocal.la \ - libbongostreamio.la \ - $(top_builddir)/import/log4c/log4c/libbongolog4c.la \ - $(PTHREAD_LIBS) \ - $(ALL_LIBS) - -src/agents/itip/all: bongoitip -src/agents/itip/clean: clean -src/agents/itip/install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) sbin_PROGRAMS=bongoitip install-sbinPROGRAMS diff --git a/src/agents/itip/Makefile.am b/src/agents/itip/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/agents/itip/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/agents/itip/itip.c b/src/agents/itip/itip.c index 44dde80..c3ecf07 100644 --- a/src/agents/itip/itip.c +++ b/src/agents/itip/itip.c @@ -52,7 +52,7 @@ ItipAgentClientFree(void *clientp) MemFree(client->envelope); } - MemPrivatePoolReturnEntry(client); + MemPrivatePoolReturnEntry(ItipAgent.clientPool, client); } static BOOL diff --git a/src/agents/mailprox/Bongo.rules b/src/agents/mailprox/Bongo.rules deleted file mode 100644 index f721615..0000000 --- a/src/agents/mailprox/Bongo.rules +++ /dev/null @@ -1,25 +0,0 @@ -# -*- Makefile -*- -sbin_PROGRAMS += bongomailprox - -bongomailprox_SOURCES = \ - src/agents/mailprox/imap.c \ - src/agents/mailprox/mailprox.c \ - src/agents/mailprox/mailprox.h \ - src/agents/mailprox/pop.c - -bongomailprox_LDADD = \ - libbongonmap.la \ - libbongomsgapi.la \ - libbongologger.la \ - libbongoconnio.la \ - libbongomemmgr.la \ - libbongoutil.la \ - libbongoxpl.la \ - $(top_builddir)/import/log4c/log4c/libbongolog4c.la \ - $(PTHREAD_LIBS) \ - $(ALL_LIBS) - -src/agents/mailprox/all: bongomailprox -src/agents/mailprox/clean: clean -src/agents/mailprox/install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) sbin_PROGRAMS=bongomailprox install-sbinPROGRAMS diff --git a/src/agents/mailprox/Makefile.am b/src/agents/mailprox/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/agents/mailprox/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/agents/mailprox/mailprox.c b/src/agents/mailprox/mailprox.c index c8f134c..6239f15 100644 --- a/src/agents/mailprox/mailprox.c +++ b/src/agents/mailprox/mailprox.c @@ -34,11 +34,7 @@ MailProxyGlobals MailProxy; -#if defined(RELEASE_BUILD) -#define GetMailProxyClientPoolEntry() MemPrivatePoolGetEntry(MailProxy.client.pool) -#else -#define GetMailProxyClientPoolEntry() MemPrivatePoolGetEntryDebug(MailProxy.client.pool, __FILE__, __LINE__) -#endif +#define GetMailProxyClientPoolEntry() MemPrivatePoolGetEntryDirect(MailProxy.client.pool, __FILE__, __LINE__) static void SignalHandler(int sigtype); @@ -160,7 +156,7 @@ MailProxyClientFree(MailProxyClient *client) memset(c, 0, sizeof(MailProxyClient)); c->state = MAILPROXY_CLIENT_FRESH; - MemPrivatePoolReturnEntry(c); + MemPrivatePoolReturnEntry(MailProxy.client.pool, c); return; } @@ -900,10 +896,7 @@ XplServiceMain(int argc, char *argv[]) NMAPInitialize(); - MailProxy.handle.logging = LoggerOpen("bongomailprox"); - if (MailProxy.handle.logging == NULL) { - XplConsolePrintf("bongomailprox: Unable to initialize Nsure Audit. Logging disabled.\r\n"); - } + LogOpen("bongomailprox"); XplRWLockInit(&MailProxy.lock); diff --git a/src/agents/pluspack/Bongo.rules b/src/agents/pluspack/Bongo.rules deleted file mode 100644 index 37d37b6..0000000 --- a/src/agents/pluspack/Bongo.rules +++ /dev/null @@ -1,23 +0,0 @@ -# -*- Makefile -*- -sbin_PROGRAMS += bongopluspack - -bongopluspack_SOURCES = \ - src/agents/pluspack/pluspack.c \ - src/agents/pluspack/pluspack.h - -bongopluspack_LDADD = \ - libbongonmap.la \ - libbongomsgapi.la \ - libbongologger.la \ - libbongoconnio.la \ - libbongomemmgr.la \ - libbongoutil.la \ - libbongoxpl.la \ - $(top_builddir)/import/log4c/log4c/libbongolog4c.la \ - $(PTHREAD_LIBS) \ - $(ALL_LIBS) - -src/agents/pluspack/all: bongopluspack -src/agents/pluspack/clean: clean -src/agents/pluspack/install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) sbin_PROGRAMS=bongopluspack install-sbinPROGRAMS diff --git a/src/agents/pluspack/Makefile.am b/src/agents/pluspack/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/agents/pluspack/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/agents/pluspack/pluspack.c b/src/agents/pluspack/pluspack.c index 6aa5388..da52d55 100644 --- a/src/agents/pluspack/pluspack.c +++ b/src/agents/pluspack/pluspack.c @@ -32,11 +32,7 @@ #include "pluspack.h" -#if defined(RELEASE_BUILD) -#define PlusPackClientAlloc() MemPrivatePoolGetEntry(PlusPack.nmap.pool) -#else -#define PlusPackClientAlloc() MemPrivatePoolGetEntryDebug(PlusPack.nmap.pool, __FILE__, __LINE__) -#endif +#define PlusPackClientAlloc() MemPrivatePoolGetEntryDirect(PlusPack.nmap.pool, __FILE__, __LINE__) static void SignalHandler(int sigtype); @@ -96,7 +92,7 @@ PlusPackClientFree(PlusPackClient *client) c->conn = NULL; } - MemPrivatePoolReturnEntry(c); + MemPrivatePoolReturnEntry(PlusPack.nmap.pool, c); return; } diff --git a/src/agents/pop/Bongo.rules b/src/agents/pop/Bongo.rules deleted file mode 100644 index 9f4b4ed..0000000 --- a/src/agents/pop/Bongo.rules +++ /dev/null @@ -1,23 +0,0 @@ -# -*- Makefile -*- -sbin_PROGRAMS += bongopop3 - -bongopop3_SOURCES = \ - src/agents/pop/pop3.c \ - src/agents/pop/pop3.h - -bongopop3_LDADD = \ - libbongonmap.la \ - libbongomsgapi.la \ - libbongologger.la \ - libbongoconnio.la \ - libbongomemmgr.la \ - libbongoutil.la \ - libbongoxpl.la \ - $(top_builddir)/import/log4c/log4c/libbongolog4c.la \ - $(PTHREAD_LIBS) \ - $(ALL_LIBS) - -src/agents/pop/all: bongopop3 -src/agents/pop/clean: clean -src/agents/pop/install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) sbin_PROGRAMS=bongopop3 install-sbinPROGRAMS diff --git a/src/agents/pop/CMakeLists.txt b/src/agents/pop/CMakeLists.txt new file mode 100644 index 0000000..c0ecc49 --- /dev/null +++ b/src/agents/pop/CMakeLists.txt @@ -0,0 +1,15 @@ +add_executable(bongopop3 + pop3.c +) + +target_link_libraries(bongopop3 + bongomemmgr + bongoxpl + bongoconnio + bongoutil + bongojson + bongomsgapi + bongologging +) + +install(TARGETS bongopop3 DESTINATION ${SBIN_INSTALL_DIR}) diff --git a/src/agents/pop/Makefile.am b/src/agents/pop/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/agents/pop/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/agents/pop/pop3.c b/src/agents/pop/pop3.c index 4511a9c..19252ad 100644 --- a/src/agents/pop/pop3.c +++ b/src/agents/pop/pop3.c @@ -79,11 +79,7 @@ #define POP3_NMAP_PASSWORD_INVALID -4 #define POP3_NMAP_FEATURE_DISABLED -5 -#if !defined(DEBUG) -#define GetPOP3ClientPoolEntry() MemPrivatePoolGetEntry(POP3.client.pool) -#else -#define GetPOP3ClientPoolEntry() MemPrivatePoolGetEntryDebug(POP3.client.pool, __FILE__, __LINE__) -#endif +#define GetPOP3ClientPoolEntry() MemPrivatePoolGetEntryDirect(POP3.client.pool, __FILE__, __LINE__) static void SignalHandler(int sigtype); @@ -102,7 +98,7 @@ static void SignalHandler(int sigtype); } else if (XplSafeRead(POP3.client.worker.active) < XplSafeRead(POP3.client.worker.maximum)) { \ XplSafeIncrement(POP3.client.worker.active); \ XplSignalBlock(); \ - XplBeginThread(&(id), HandleConnection, POP_STACK_SPACE, XPL_INT_TO_PTR(XplSafeRead(POP3.client.worker.active)), (r)); \ + XplBeginThread(&(id), HandleConnection, POP_STACK_SPACE, (char *)(XplSafeRead(POP3.client.worker.active)), (r)); \ XplSignalHandler(SignalHandler); \ if (!(r)) { \ (c)->queue.previous = NULL; \ @@ -448,7 +444,7 @@ POP3ReturnClientPoolEntry(POP3Client *client) c->state = POP3_CLIENT_FRESH; - MemPrivatePoolReturnEntry(c); + MemPrivatePoolReturnEntry(POP3.client.pool, c); return; } @@ -1843,8 +1839,7 @@ POP3Server(void *ignored) } } - LoggerClose(POP3.loggingHandle); - POP3.loggingHandle = NULL; + LogClose(); MsgShutdown(); @@ -2099,10 +2094,7 @@ XplServiceMain(int argc, char *argv[]) MsgAuthInit(); NMAPInitialize(); - POP3.loggingHandle = LoggerOpen("bongopop3"); - if (POP3.loggingHandle == NULL) { - XplConsolePrintf("POP3D: Unable to initialize logging interface. Logging disabled.\r\n"); - } + LogOpen("bongopop3"); ReadConfiguration(); CONN_TRACE_INIT(XPL_DEFAULT_WORK_DIR, "pop"); diff --git a/src/agents/queue/Bongo.rules b/src/agents/queue/Bongo.rules deleted file mode 100644 index 29595fb..0000000 --- a/src/agents/queue/Bongo.rules +++ /dev/null @@ -1,32 +0,0 @@ -# -*- Makefile -*- -sbin_PROGRAMS += bongoqueue - -bongoqueue_SOURCES = \ - src/agents/queue/conf.c \ - src/agents/queue/conf.h \ - src/agents/queue/domain.c \ - src/agents/queue/domain.h \ - src/agents/queue/queued.c \ - src/agents/queue/queued.h \ - src/agents/queue/mime.c \ - src/agents/queue/mime.h \ - src/agents/queue/queue.c \ - src/agents/queue/queue.h \ - src/agents/queue/messages.h - -bongoqueue_LDADD = \ - libbongonmap.la \ - libbongomsgapi.la \ - libbongologger.la \ - libbongoconnio.la \ - libbongomemmgr.la \ - libbongoutil.la \ - libbongoxpl.la \ - $(top_builddir)/import/log4c/log4c/libbongolog4c.la \ - $(PTHREAD_LIBS) \ - $(ALL_LIBS) - -src/agents/queue/all: bongoqueue -src/agents/queue/clean: clean -src/agents/queue/install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) sbin_PROGRAMS=bongoqueue install-sbinPROGRAMS diff --git a/src/agents/queue/CMakeLists.txt b/src/agents/queue/CMakeLists.txt new file mode 100644 index 0000000..3c41330 --- /dev/null +++ b/src/agents/queue/CMakeLists.txt @@ -0,0 +1,19 @@ +add_executable(bongoqueue + conf.c + domain.c + queued.c + mime.c + queue.c +) + +target_link_libraries(bongoqueue + bongomemmgr + bongoxpl + bongoconnio + bongoutil + bongojson + bongomsgapi + bongologging +) + +install(TARGETS bongoqueue DESTINATION ${SBIN_INSTALL_DIR}) diff --git a/src/agents/queue/Makefile.am b/src/agents/queue/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/agents/queue/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/agents/queue/queued.c b/src/agents/queue/queued.c index f1c04df..997f959 100644 --- a/src/agents/queue/queued.c +++ b/src/agents/queue/queued.c @@ -417,7 +417,7 @@ QueueClientFree(void *clientp) { QueueClient *client = clientp; - MemPrivatePoolReturnEntry(client); + MemPrivatePoolReturnEntry(Agent.clientMemPool, client); } static BOOL diff --git a/src/agents/queue/queued.h b/src/agents/queue/queued.h index 257dc83..fe33c9b 100644 --- a/src/agents/queue/queued.h +++ b/src/agents/queue/queued.h @@ -91,11 +91,7 @@ typedef struct _QueueAgent { extern QueueAgent Agent; -#if defined(RELEASE_BUILD) -#define QueueClientAlloc() MemPrivatePoolGetEntry(Agent.clientMemPool) -#else -#define QueueClientAlloc() MemPrivatePoolGetEntryDebug(Agent.clientMemPool, __FILE__, __LINE__); -#endif +#define QueueClientAlloc() MemPrivatePoolGetEntryDirect(Agent.clientMemPool, __FILE__, __LINE__); void QueueClientFree(void *clientp); int HandleCommand(QueueClient *client); diff --git a/src/agents/rules/Bongo.rules b/src/agents/rules/Bongo.rules deleted file mode 100644 index a0bcaae..0000000 --- a/src/agents/rules/Bongo.rules +++ /dev/null @@ -1,25 +0,0 @@ -# -*- Makefile -*- -sbin_PROGRAMS += bongorules - -bongorules_SOURCES = \ - src/agents/rules/rules.c \ - src/agents/rules/rules.h \ - src/agents/rules/stream.c - -bongorules_LDADD = \ - libbongonmap.la \ - libbongostreamio.la \ - libbongomsgapi.la \ - libbongologger.la \ - libbongoconnio.la \ - libbongomemmgr.la \ - libbongoutil.la \ - libbongoxpl.la \ - $(top_builddir)/import/log4c/log4c/libbongolog4c.la \ - $(PTHREAD_LIBS) \ - $(ALL_LIBS) - -src/agents/rules/all: bongorules -src/agents/rules/clean: clean -src/agents/rules/install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) sbin_PROGRAMS=bongorules install-sbinPROGRAMS diff --git a/src/agents/rules/CMakeLists.txt b/src/agents/rules/CMakeLists.txt new file mode 100644 index 0000000..c0daa80 --- /dev/null +++ b/src/agents/rules/CMakeLists.txt @@ -0,0 +1,16 @@ +add_executable(bongorules + rules.c + stream.c +) + +target_link_libraries(bongorules + bongomemmgr + bongoxpl + bongoconnio + bongoutil + bongojson + bongomsgapi + bongologging +) + +install(TARGETS bongorules DESTINATION ${SBIN_INSTALL_DIR}) diff --git a/src/agents/rules/Makefile.am b/src/agents/rules/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/agents/rules/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/agents/rules/rules.c b/src/agents/rules/rules.c index 0d7b598..f876046 100644 --- a/src/agents/rules/rules.c +++ b/src/agents/rules/rules.c @@ -1056,7 +1056,7 @@ RulesClientFree(void *clientp) RulesCleanupInformation(client); - MemPrivatePoolReturnEntry(client); + MemPrivatePoolReturnEntry(RulesAgent.OutgoingPool, client); } static int diff --git a/src/agents/smtp/Bongo.rules b/src/agents/smtp/Bongo.rules deleted file mode 100644 index a5d9723..0000000 --- a/src/agents/smtp/Bongo.rules +++ /dev/null @@ -1,42 +0,0 @@ -# -*- Makefile -*- -sbin_PROGRAMS += bongosmtp bongosmtpc - -bongosmtp_SOURCES = \ - src/agents/smtp/smtpd.c \ - src/agents/smtp/smtp.h \ - src/agents/smtp/smtpd.h - -bongosmtp_LDADD = \ - libbongonmap.la \ - libbongomsgapi.la \ - libbongologger.la \ - libbongoconnio.la \ - libbongomemmgr.la \ - libbongoutil.la \ - libbongoxpl.la \ - $(top_builddir)/import/log4c/log4c/libbongolog4c.la \ - $(PTHREAD_LIBS) \ - $(ALL_LIBS) - -bongosmtpc_SOURCES = \ - src/agents/smtp/smtpc.c \ - src/agents/smtp/smtp.h \ - src/agents/smtp/smtpc.h - -bongosmtpc_LDADD = \ - libbongonmap.la \ - libbongomsgapi.la \ - libbongologger.la \ - libbongoconnio.la \ - libbongomemmgr.la \ - libbongoutil.la \ - libbongoxpl.la \ - $(top_builddir)/import/log4c/log4c/libbongolog4c.la \ - $(PTHREAD_LIBS) \ - $(ALL_LIBS) - -src/agents/smtp/all: bongosmtp bongosmtpc -src/agents/smtp/clean: clean -src/agents/smtp/install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) sbin_PROGRAMS=bongosmtp install-sbinPROGRAMS - @cd $(top_builddir) && $(MAKE) $(MFLAGS) sbin_PROGRAMS=bongosmtpc install-sbinPROGRAMS diff --git a/src/agents/smtp/CMakeLists.txt b/src/agents/smtp/CMakeLists.txt new file mode 100644 index 0000000..268191c --- /dev/null +++ b/src/agents/smtp/CMakeLists.txt @@ -0,0 +1,30 @@ +add_executable(bongosmtp + smtpd.c +) + +target_link_libraries(bongosmtp + bongomemmgr + bongoxpl + bongoconnio + bongoutil + bongojson + bongomsgapi + bongologging +) + +add_executable(bongosmtpc + smtpc.c +) + +target_link_libraries(bongosmtpc + bongomemmgr + bongoxpl + bongoconnio + bongoutil + bongojson + bongomsgapi + bongologging +) + +install(TARGETS bongosmtp DESTINATION ${SBIN_INSTALL_DIR}) +install(TARGETS bongosmtpc DESTINATION ${SBIN_INSTALL_DIR}) diff --git a/src/agents/smtp/Makefile.am b/src/agents/smtp/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/agents/smtp/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/agents/smtp/smtpc.c b/src/agents/smtp/smtpc.c index 7154b9b..d67e5a9 100755 --- a/src/agents/smtp/smtpc.c +++ b/src/agents/smtp/smtpc.c @@ -46,7 +46,7 @@ SMTPClientFree(void *clientp) MemFree(client->envelope); } - MemPrivatePoolReturnEntry(client); + MemPrivatePoolReturnEntry(SMTPAgent.OutgoingPool, client); } int RecipientCompare(const void *lft, const void *rgt) { diff --git a/src/agents/smtp/smtpd.c b/src/agents/smtp/smtpd.c index 059a546..51ac789 100644 --- a/src/agents/smtp/smtpd.c +++ b/src/agents/smtp/smtpd.c @@ -193,11 +193,7 @@ typedef struct #define SENDER_LOCAL (1<<10) -#if !defined(DEBUG) -#define GetSMTPConnection() MemPrivatePoolGetEntry(SMTPConnectionPool) -#else -#define GetSMTPConnection() MemPrivatePoolGetEntryDebug(SMTPConnectionPool, __FILE__, __LINE__) -#endif +#define GetSMTPConnection() MemPrivatePoolGetEntryDirect(SMTPConnectionPool, __FILE__, __LINE__) void *SMTPConnectionPool = NULL; @@ -235,7 +231,7 @@ ReturnSMTPConnection (ConnectionStruct * Client) c->MsgFlags = MSG_FLAG_ENCODING_NONE; - MemPrivatePoolReturnEntry (c); + MemPrivatePoolReturnEntry (SMTPConnectionPool, c); return; } diff --git a/src/agents/store/Bongo.rules b/src/agents/store/Bongo.rules deleted file mode 100644 index 8cbc6f8..0000000 --- a/src/agents/store/Bongo.rules +++ /dev/null @@ -1,76 +0,0 @@ -# -*- Makefile -*- -sbin_PROGRAMS += bongostore - -bongostore_CPPFLAGS = $(AM_CPPFLAGS) \ - -Wall -Werror \ - -I$(top_srcdir)/src/agents/store \ - $(GMIME_CFLAGS) \ - $(SQLITE_CFLAGS) - -# this is a hack because certain automakes don't seem to output .o -# in the same directory the .s resides in. automake <= 1.9 ? -# gcc call was: $(CC) $(CFLAGS) -I$(top_srcdir) -c -o $@ $< -# however, it doesn't pass -I flags through... :( -src/agents/store/create-store.o: src/agents/store/create-store.s src/agents/store/create-store.sql - $(AS) -I$(top_srcdir) -o $@ $< - -bongostore_SOURCES = \ - src/agents/store/create-store.s \ - src/agents/store/create-store.sql \ - src/agents/store/auth.c \ - src/agents/store/calendar.c \ - src/agents/store/calendar.h \ - src/agents/store/command.c \ - src/agents/store/command.h \ - src/agents/store/command-parsing.c \ - src/agents/store/command-parsing.h \ - src/agents/store/config.c \ - src/agents/store/cookie.c \ - src/agents/store/db.c \ - src/agents/store/fairlock.c \ - src/agents/store/guid.c \ - src/agents/store/help.h \ - src/agents/store/lock.h \ - src/agents/store/mail.c \ - src/agents/store/mail.h \ - src/agents/store/maildir.c \ - src/agents/store/main.cpp \ - src/agents/store/messages.h \ - src/agents/store/mime.c \ - src/agents/store/mime.h \ - src/agents/store/object-model.h \ - src/agents/store/object-model.c \ - src/agents/store/properties.h \ - src/agents/store/properties.c \ - src/agents/store/query-builder.h \ - src/agents/store/query-builder.c \ - src/agents/store/query-parser.h \ - src/agents/store/query-parser.c \ - src/agents/store/search.c \ - src/agents/store/store.c \ - src/agents/store/stored.c \ - src/agents/store/stored.h \ - src/agents/store/watch.c - -bongostore_LDADD = \ - libbongo-json.la \ - libbongocal.la \ - libbongonmap.la \ - libbongomsgapi.la \ - libbongologger.la \ - libbongoconnio.la \ - libbongostreamio.la \ - libbongomemmgr.la \ - libbongoutil.la \ - libbongoxpl.la \ - $(top_builddir)/import/log4c/log4c/libbongolog4c.la \ - $(SQLITE_LIBS) \ - $(GMIME_LIBS) \ - $(PTHREAD_LIBS) \ - $(KSTAT_LIBS) \ - $(ALL_LIBS) - -src/agents/store/all: bongostore -src/agents/store/clean: clean -src/agents/store/install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) sbin_PROGRAMS=bongostore install-sbinPROGRAMS diff --git a/src/agents/store/CMakeLists.txt b/src/agents/store/CMakeLists.txt new file mode 100644 index 0000000..916ad5d --- /dev/null +++ b/src/agents/store/CMakeLists.txt @@ -0,0 +1,44 @@ +# StrictCompile() + +enable_language(ASM-ATT) + +add_executable(bongostore + auth.c + calendar.c + createstore.s + command.c + command-parsing.c + config.c + cookie.c + db.c + fairlock.c + guid.c + mail.c + maildir.c + main.c + mime.c + object-model.c + properties.c + query-builder.c + query-parser.c + search.c + store.c + stored.c + watch.c) + +target_link_libraries(bongostore + bongomemmgr + bongoxpl + bongoconnio + bongoutil + bongojson + bongomsgapi + bongologging + ${SQLITE_LIBRARIES} + ${GLIB2_LIBRARIES} + ${GCRYPT_LIBRARIES} + ${ICAL_LIBRARIES} + ${GMIME2_LIBRARIES} + ) + +install(TARGETS bongostore DESTINATION ${SBIN_INSTALL_DIR}) diff --git a/src/agents/store/Makefile.am b/src/agents/store/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/agents/store/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/agents/store/create-store.s b/src/agents/store/create-store.s.cmake similarity index 66% rename from src/agents/store/create-store.s rename to src/agents/store/create-store.s.cmake index e2e75a8..a4968d7 100644 --- a/src/agents/store/create-store.s +++ b/src/agents/store/create-store.s.cmake @@ -2,6 +2,6 @@ .globl sql_create_store .type sql_create_store,@object sql_create_store: -.incbin "src/agents/store/create-store.sql" +.incbin "@CMAKE_CURRENT_SOURCE_DIR@/src/agents/store/create-store.sql" .byte 0 .size sql_create_store, .-sql_create_store diff --git a/src/agents/store/guid.c b/src/agents/store/guid.c index a0a6a30..a498d5d 100644 --- a/src/agents/store/guid.c +++ b/src/agents/store/guid.c @@ -24,60 +24,6 @@ #include "stored.h" -#if defined(WIN32) -#include - -void -GuidReset(void) -{ - unsigned long length; - unsigned char salt[32]; - unsigned char name[MAX_COMPUTERNAME_LENGTH + 1]; - unsigned char *uid = NULL; - FILETIME date; - UUID uuid; - xpl_hash_context context; - - XplHashNew(&context, XPLHASH_SHA1); - - GetSystemTimeAsFileTime(&date); - sprintf(salt, "%010lu%010lu", date.dwHighDateTime, date.dwLowDateTime); - XplHashWrite(&context, salt, strlen(salt)); - - length = sizeof(name) - 1; - if (GetComputerName(name, &length)) { - XplHashWrite(&context, name, strlen(name)); - } else { - XplRandomData(&name, sizeof(name) - 1); - XplHashWrite(&context, name, sizeof(name) - 1); - } - - if ((UuidCreate(&uuid) == RPC_S_OK) && - (UuidToString(&uuid, &uid) == RPC_S_OK)) { - XplHashWrite(&context, uid, strlen(uid)); - } else { - XplRandomData(&name, sizeof(name) - 1); - XplHashWrite(&context, name, sizeof(name) - 1); - } - if (uid) - RpcStringFree(&uid); - - XplHashFinal(&context, XPLHASH_UPPERCASE, StoreAgent.guid.next, - XPLHASH_SHA1_LENGTH); - - memset(StoreAgent.guid.next + NMAP_GUID_PREFIX_LENGTH, '0', - NMAP_GUID_SUFFIX_LENGTH); -} -#elif defined(NETWARE) || defined(LIBC) -#error GuidReset not implemented on this platform. - -void -GuidReset(void) -{ - return; -} -#elif defined(LINUX) - #if HAVE_KSTAT_H #include #elif HAVE_SYS_SYSINFO_H @@ -87,10 +33,10 @@ GuidReset(void) void GuidReset(void) { char name[256 + 1]; unsigned char salt[32]; -#if HAVE_KSTAT_H +#ifdef HAVE_KSTAT_H kstat_t *ksp; kstat_ctl_t *kc; -#elif HAVE_SYS_SYSINFO_H +#elifdef HAVE_SYS_SYSINFO_H struct sysinfo si; #endif struct timeval tv; @@ -142,9 +88,6 @@ void GuidReset(void) { return; } -#else -#error GuidReset not implemented on this platform. -#endif void GuidAlloc(unsigned char *guid) diff --git a/src/agents/store/main.cpp b/src/agents/store/main.c similarity index 100% rename from src/agents/store/main.cpp rename to src/agents/store/main.c diff --git a/src/agents/store/object-model.c b/src/agents/store/object-model.c index 3f5fca1..164df2d 100644 --- a/src/agents/store/object-model.c +++ b/src/agents/store/object-model.c @@ -1002,7 +1002,7 @@ StoreObjectIterProperties(StoreClient *client, StoreObject *document) while ((ccode = MsgSQLResults(client->storedb, &stmt)) > 0) { StorePropInfo prop; - MemClear(&prop, sizeof(StorePropInfo)); + memset(&prop, 0, sizeof(StorePropInfo)); prop.type = MsgSQLResultInt(&stmt, 0); MsgSQLResultTextPtr(&stmt, 1, &prop.name); diff --git a/src/agents/store/query-builder.c b/src/agents/store/query-builder.c index d485883..ce4aa40 100644 --- a/src/agents/store/query-builder.c +++ b/src/agents/store/query-builder.c @@ -24,7 +24,7 @@ static int QueryBuilderAddProperty(QueryBuilder *builder, const char *property, int QueryBuilderStart(QueryBuilder *builder) { - MemClear(builder, sizeof(QueryBuilder)); + memset(builder, 0, sizeof(QueryBuilder)); builder->order_prop = builder->int_query = builder->ext_query = NULL; builder->order_direction = ORDER_NONE; builder->output_mode = MODE_COLLECTIONS; diff --git a/src/agents/store/query-builder.h b/src/agents/store/query-builder.h index c9f90b5..52d2cbb 100644 --- a/src/agents/store/query-builder.h +++ b/src/agents/store/query-builder.h @@ -1,7 +1,7 @@ #ifndef QUERY_BUILDER_H #define QUERY_BUILDER_H -#include +#include "query-parser.h" typedef enum { ORDER_NONE, diff --git a/src/agents/store/stored.c b/src/agents/store/stored.c index b24adf6..c3b4508 100644 --- a/src/agents/store/stored.c +++ b/src/agents/store/stored.c @@ -50,7 +50,7 @@ StoreClientFree(void *clientp) BongoMemStackDestroy(&client->memstack); - MemPrivatePoolReturnEntry(client); + MemPrivatePoolReturnEntry(StoreAgent.memPool, client); } static int diff --git a/src/agents/store/tests/Bongo.rules b/src/agents/store/tests/Bongo.rules deleted file mode 100644 index fd04d56..0000000 --- a/src/agents/store/tests/Bongo.rules +++ /dev/null @@ -1,45 +0,0 @@ -# -*- Makefile -*- -TESTS += checktest-store -check_PROGRAMS += checktest-store -checktest_store_SOURCES = \ - src/agents/store/tests/checktest.c - -checktest_store_CPPFLAGS = $(AM_CPPFLAGS) \ - $(CHECK_CFLAGS) - -checktest_store_LDADD = $(CHECK_LIBS) \ - libbongonmap.la \ - libbongomsgapi.la \ - libbongologger.la \ - libbongoconnio.la \ - libbongomemmgr.la \ - libbongoutil.la \ - libbongoxpl.la \ - $(top_builddir)/import/log4c/log4c/libbongolog4c.la \ - $(SQLITE_LIBS) \ - $(PTHREAD_LIBS) \ - $(ALL_LIBS) - -noinst_PROGRAMS += mkauthhash - -mkauthhash_SOURCES = \ - src/agents/store/tests/mkauthhash.c - -mkauthhash_store_CPPFLAGS = $(AM_CPPFLAGS) \ - $(SQLITE_CFLAGS) - -mkauthhash_LDADD = \ - libbongonmap.la \ - libbongomsgapi.la \ - libbongologger.la \ - libbongoconnio.la \ - libbongomemmgr.la \ - libbongoutil.la \ - libbongoxpl.la \ - $(top_builddir)/import/log4c/log4c/libbongolog4c.la \ - $(SQLITE_LIBS) \ - $(PTHREAD_LIBS) \ - $(ALL_LIBS) - -src/agents/store/tests/all: -src/agents/store/tests/clean: clean diff --git a/src/agents/store/tests/Makefile.am b/src/agents/store/tests/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/agents/store/tests/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/apps/CMakeLists.txt b/src/apps/CMakeLists.txt new file mode 100644 index 0000000..2ebbe37 --- /dev/null +++ b/src/apps/CMakeLists.txt @@ -0,0 +1,13 @@ +add_executable(bongo- +) + +target_link_libraries(bongo- + bongonmap + bongomsgapi + bongojson + bongoutil + bongoxpl + bongocal +) + +install(TARGETS bongo- DESTINATION ${SBIN_INSTALL_DIR}) diff --git a/src/apps/admin/Bongo.rules b/src/apps/admin/Bongo.rules deleted file mode 100644 index 479db4f..0000000 --- a/src/apps/admin/Bongo.rules +++ /dev/null @@ -1,33 +0,0 @@ -# -*- Makefile -*- -pkgpythonadmintooldir = $(pkgpythondir)/admintool -pkgpythonadmintool_PYTHON = \ - src/apps/admin/bongo/admintool/__init__.py \ - src/apps/admin/bongo/admintool/AgentCommands.py \ - src/apps/admin/bongo/admintool/DemoCommands.py \ - src/apps/admin/bongo/admintool/CmdUtil.py \ - src/apps/admin/bongo/admintool/MdbUtil.py \ - src/apps/admin/bongo/admintool/ServerCommands.py \ - src/apps/admin/bongo/admintool/SetupCommands.py \ - src/apps/admin/bongo/admintool/UserCommands.py - -src/apps/admin/bongo-admin: $(top_builddir)/src/libs/python/bongo-python-wrapper - $(INSTALL) -m 755 $< $@ - -sbin_SCRIPTS += src/apps/admin/bongo-admin -dist_pkglibexec_SCRIPTS += src/apps/admin/bongo-admin.py - -dist_noinst_DATA += src/apps/admin/bongo/__init__.py - -CLEANFILES += \ - src/apps/admin/bongo-admin \ - src/apps/admin/*.pyc \ - src/apps/admin/bongo/*.pyc \ - src/apps/admin/bongo/admintool/*.pyc - -src/apps/admin/all: -src/apps/admin/clean: clean -src/apps/admin/install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) \ - dist_sbin_SCRIPTS=src/apps/admin/bongo-admin \ - dist_pkglibexec_SCRIPTS=src/apps/admin/bongo-admin.py \ - install-dist_sbinSCRIPTS install-pkgpythonadmintoolPYTHON diff --git a/src/apps/admin/Makefile.am b/src/apps/admin/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/apps/admin/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/apps/backup/Bongo.rules b/src/apps/backup/Bongo.rules deleted file mode 100644 index 711e1ff..0000000 --- a/src/apps/backup/Bongo.rules +++ /dev/null @@ -1,27 +0,0 @@ -# -*- Makefile -*- -sbin_PROGRAMS += bongo-backup - -bongo_backup_SOURCES = \ - src/apps/backup/backup.h \ - src/apps/backup/backup.c - -bongo_backup_CPPFLAGS = $(AM_CPPFLAGS) \ - $(SQLITE_CFLAGS) - -bongo_backup_LDADD = \ - libbongonmap.la \ - libbongomsgapi.la \ - libbongologger.la \ - libbongoconnio.la \ - libbongomemmgr.la \ - libbongoutil.la \ - libbongoxpl.la \ - $(top_builddir)/import/log4c/log4c/libbongolog4c.la \ - $(PTHREAD_LIBS) \ - $(SQLITE_LIBS) \ - $(ALL_LIBS) - -src/apps/backup/all: bongo-backup -src/apps/backup/clean: clean -src/apps/backup/install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) sbin_PROGRAMS=bongo-backup install-sbinPROGRAMS diff --git a/src/apps/backup/Makefile.am b/src/apps/backup/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/apps/backup/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/apps/config/Bongo.rules b/src/apps/config/Bongo.rules deleted file mode 100644 index 8c43762..0000000 --- a/src/apps/config/Bongo.rules +++ /dev/null @@ -1,48 +0,0 @@ -# -*- Makefile -*- -sbin_PROGRAMS += bongo-config - -conf_defaults = \ - src/apps/config/config/global \ - src/apps/config/config/aliases/default_config \ - src/apps/config/config/antispam \ - src/apps/config/config/antivirus \ - src/apps/config/config/imap \ - src/apps/config/config/mailproxy \ - src/apps/config/config/manager \ - src/apps/config/config/pop3 \ - src/apps/config/config/queue \ - src/apps/config/config/smtp \ - src/apps/config/hawkeye/history - -bongo_config_SOURCES = \ - $(conf_defaults) \ - src/apps/config/config.c \ - src/apps/config/config.h \ - src/apps/config/store.c - -bongo_config_CPPFLAGS = $(AM_CPPFLAGS) \ - $(GNUTLS_CFLAGS) - -bongo_config_LDADD = \ - libbongonmap.la \ - libbongomsgapi.la \ - libbongoconnio.la \ - libbongomemmgr.la \ - libbongoutil.la \ - libbongoxpl.la \ - $(PTHREAD_LIBS) \ - $(GNUTLS_LIBS) \ - $(ALL_LIBS) - -confdir = $(pkgdatadir)/conf - -conf_DATA = \ - src/apps/config/default.set - -src/apps/config/default.set: $(conf_defaults) - (cd $(top_srcdir)/src/apps/config && tar chof - --exclude .svn config hawkeye) > $@ - -src/apps/config/all: bongo-config -src/apps/config/clean: clean -src/apps/config/install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) sbin_PROGRAMS=bongo-config install-sbinPROGRAMS diff --git a/src/apps/config/CMakeLists.txt b/src/apps/config/CMakeLists.txt new file mode 100644 index 0000000..5e152fb --- /dev/null +++ b/src/apps/config/CMakeLists.txt @@ -0,0 +1,24 @@ +add_executable(bongo-config + config.c + store.c +) + +target_link_libraries(bongo-config + bongonmap + bongomsgapi + bongojson + bongoutil + bongoxpl + bongocal +) + +add_custom_target(default.set + COMMAND tar chof - --exclude .svn config hawkeye > ${CMAKE_CURRENT_BINARY_DIR}/default.set + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + VERBATIM +) + +add_dependencies(bongo-config default.set) + +install(TARGETS bongo-config DESTINATION ${SBIN_INSTALL_DIR}) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/default.set DESTINATION ${DATA_INSTALL_DIR}/conf) diff --git a/src/apps/config/Makefile.am b/src/apps/config/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/apps/config/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/apps/config/config.c b/src/apps/config/config.c index b872135..66ede3a 100644 --- a/src/apps/config/config.c +++ b/src/apps/config/config.c @@ -7,7 +7,6 @@ #include #include #include -#include #include #include @@ -64,52 +63,43 @@ RunAsRoot() } } -void -AddDomain(const char *str) { - BongoJsonNode *domain; - - domain = BongoJsonNodeNewString(str); - BongoArrayAppendValue(BongoJsonNodeAsArray(config.domains), domain); -} - void GetInstallParameters(void){ - char *tmp = NULL; + GetInteractiveData(_("IP address to run on"), &config.ip, "127.0.0.1"); + GetInteractiveData(_("DNS name to use as main hostname:"), &config.dns, "localhost"); - GetInteractiveData(_("IP address to run on"), &config.ip, "127.0.0.1"); - GetInteractiveData(_("DNS name to use as main hostname:"), &config.dns, "localhost"); - - /* this is a little messy here due to the way the array works */ - if (!config.domains) { - config.domains = BongoJsonNodeNewArray(BongoArrayNew(sizeof(char *), 1)); - while (1) { - GetInteractiveData(_("Mail Domains (enter \"\" to end adding domains):"), &tmp, ""); - if (tmp[0] == '\0') { - tmp = NULL; - break; - } - - AddDomain(tmp); - tmp = NULL; - } - } + /* this is a little messy here due to the way the array works */ + if (!config.domains) { + config.domains = BongoJsonNodeNewArray(BongoArrayNew(sizeof(char *), 1)); + while (1) { + char *tmp = NULL; + BongoJsonNode *domain; + + GetInteractiveData(_("Mail Domains (one per line, blank line to finish):"), &tmp, ""); + if ((tmp == NULL) || (tmp[0] == '\0')) return; + + BongoJsonArrayAppendString(BongoJsonNodeAsArray(config.domains), tmp); + MemFree(tmp); + tmp = NULL; + } + } } void SetStoreConfigurationModifications(StoreClient *client) { - BongoJsonNode *node; - unsigned char *aconfig = NULL; - unsigned char *default_config = NULL; - unsigned int default_config_len; - /* - * unsigned char default_config[] = "{ \"domainalias\" : \"\", \"aliases\" : { \"postmaster\" : \"admin\" }, \"username-mapping\" : 0 }"; - const unsigned int default_config_len = strlen(default_config); + BongoJsonNode *node; + unsigned char *aconfig = NULL; + unsigned char *default_config = NULL; + unsigned int default_config_len; + /* + * unsigned char default_config[] = + * "{ \"domainalias\" : \"\", \"aliases\" : { \"postmaster\" : \"admin\" }, \"username-mapping\" : 0 }"; + * const unsigned int default_config_len = strlen(default_config); + */ - */ - - NMAPReadConfigFile("aliases/default_config", &default_config); - if (default_config == NULL) return; - default_config_len = strlen(default_config); + NMAPReadConfigFile("aliases/default_config", &default_config); + if (default_config == NULL) return; + default_config_len = strlen(default_config); /* first let's read in the queue document and store out the domains and hosted domains */ if(NMAPReadConfigFile("queue", &aconfig)) { @@ -118,13 +108,15 @@ SetStoreConfigurationModifications(StoreClient *client) { BongoJsonNode *current; char *content; unsigned int x; - BongoArray *domains; + BongoArray *domains, *oldDomains; + /* node is what is in the store. it should basically be any defaults */ + /* pull out the domain array so that i can replace it with the new list of domains */ current = BongoJsonJPath(node, "o:domains/a"); + oldDomains = BongoJsonNodeAsArray(current); + domains = BongoJsonNodeAsArray(config.domains); - /* free the old array */ - BongoArrayDestroy(BongoJsonNodeAsArray(current), TRUE); - BongoJsonNodeAsArray(current) = domains; + BongoJsonNodeAsArray(current) = domains; content = BongoJsonNodeToString(node); PutOrReplaceConfig(client, "/config", "queue", content, strlen(content)); @@ -134,6 +126,9 @@ SetStoreConfigurationModifications(StoreClient *client) { BongoJsonNode *current = BongoJsonArrayGet(domains, x); PutOrReplaceConfig(client, "/config/aliases", BongoJsonNodeAsString(current), default_config, default_config_len); } + + /* put back the old domains array so that the free can sanely free it */ + BongoJsonNodeAsArray(current) = oldDomains; BongoJsonNodeFree(node); } MemFree(aconfig); @@ -295,12 +290,14 @@ GetInteractiveData(char *description, char **data, char *def) { *data = (char *)MemMalloc(sizeof(char)*size); line = fgets(*data, size, stdin); if (!line || *line == '\0' || *line == '\n' || *line == '\r') { - MemFree(*data); - *data = MemStrdup(def); + if (*data) { + MemFree(*data); + } + line = *data = MemStrdup(def); } size = strlen(line); - if (line[size-1] == '\n') line[size-1] = 0; + if (size != 0 && line[size-1] == '\n') line[size-1] = 0; } #define CERTSIZE 10240 @@ -488,7 +485,7 @@ UserAdd(const char *username) default: XplConsolePrintf(_("Couldn't add user %s: internal error\n"), username); break; - } + } } void @@ -519,16 +516,25 @@ UserPassword(const char *username) if (strlen(password) == 0) { XplConsolePrintf(_("ERROR: Can't set password to empty string.\n")); - return; + goto cleanup; } if (strncmp(password, password2, strlen(password))) { XplConsolePrintf(_("ERROR: The passwords provided don't match.\n")); - return; + goto cleanup; } if (MsgAuthSetPassword(username, password) != 0) { XplConsolePrintf(_("ERROR: Couldn't set the password for the user.\n")); } + +cleanup: + if (password) { + MemFree(password); + } + if (password2) { + MemFree(password2); + } + return; } void @@ -550,14 +556,14 @@ main(int argc, char *argv[]) { BongoAgent configtool; config.verbose = 0; - /* this just clears up a warning. we don't need this here */ - GlobalConfig[0].type = BONGO_JSON_NULL; - if (!MemoryManagerOpen("bongo-config")) { XplConsolePrintf("ERROR: Failed to initialize memory manager\n"); return 1; } - + + // this just clears up a warning. we don't need this here + GlobalConfig[0].type = BONGO_JSON_NULL; + // parse options while (++next_arg < argc && argv[next_arg][0] == '-') { char *arg = argv[next_arg]; @@ -571,12 +577,12 @@ main(int argc, char *argv[]) { } else if (!strcmp(arg, "--hostname")) { next_arg++; config.dns = MemStrdup(argv[next_arg]); - } else if (!strcmp(arg, "--domain")) { - if (!config.domains) { - config.domains = BongoJsonNodeNewArray(BongoArrayNew(sizeof(char *), 1)); - } - next_arg++; - AddDomain(argv[next_arg]); + } else if (!strcmp(arg, "--domain")) { + next_arg++; + if (!config.domains) { + config.domains = BongoJsonNodeNewArray(BongoArrayNew(sizeof(char *), 1)); + } + BongoJsonArrayAppendString(BongoJsonNodeAsArray(config.domains), MemStrdup(argv[next_arg])); } else { printf("Unrecognized option: %s\n", argv[next_arg]); } @@ -621,7 +627,7 @@ main(int argc, char *argv[]) { next_arg++; switch(command) { case 1: - GetInstallParameters(); + GetInstallParameters(); InitializeDataArea(); // changes our user to unprivileged GenerateCryptoData(); RunAsRoot(); diff --git a/src/apps/config/config.h b/src/apps/config/config.h index d57e7c8..4346ece 100644 --- a/src/apps/config/config.h +++ b/src/apps/config/config.h @@ -12,12 +12,12 @@ typedef struct { BOOL interactive; char *ip; char *dns; - BongoJsonNode *domains; + BongoJsonNode *domains; } BongoConfig; typedef struct { - Connection *conn; - char buffer[CONN_BUFSIZE + 1]; + Connection *conn; + char buffer[CONN_BUFSIZE + 1]; } StoreClient; #define malloc(bytes) MemMalloc(bytes) @@ -26,16 +26,15 @@ typedef struct { /* function prototypes */ // config.c -void GetInstallParameters(void); -void AddDomain(const char *str); -void SetStoreConfigurationModifications(StoreClient *client); +void GetInstallParameters(void); +void SetStoreConfigurationModifications(StoreClient *client); void LoadDefaultStoreConfiguration(void); void InitializeDataArea(void); void usage(void); void RunAsBongoUser(void); void RunAsRoot(void); void InitialStoreConfiguration(void); -void GetInteractiveData(char *description, char **data, char *def); +void GetInteractiveData(char *description, char **data, char *def); BOOL GenerateCryptoData(void); void CheckVersion(void); void AddUser(const char *username); diff --git a/src/apps/manager/Bongo.rules b/src/apps/manager/Bongo.rules deleted file mode 100644 index c682f6d..0000000 --- a/src/apps/manager/Bongo.rules +++ /dev/null @@ -1,21 +0,0 @@ -# -*- Makefile -*- -sbin_PROGRAMS += bongo-manager - -bongo_manager_SOURCES = \ - src/apps/manager/manager.c - -bongo_manager_LDADD = \ - libbongonmap.la \ - libbongomsgapi.la \ - libbongoconnio.la \ - libbongomemmgr.la \ - libbongo-json.la \ - libbongoxpl.la \ - $(top_builddir)/import/log4c/log4c/libbongolog4c.la \ - $(PTHREAD_LIBS) \ - $(ALL_LIBS) - -src/apps/manager/all: bongo-manager -src/apps/manager/clean: clean -src/apps/manager/install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) sbin_PROGRAMS=bongo-manager install-sbinPROGRAMS diff --git a/src/apps/manager/CMakeLists.txt b/src/apps/manager/CMakeLists.txt new file mode 100644 index 0000000..702de5a --- /dev/null +++ b/src/apps/manager/CMakeLists.txt @@ -0,0 +1,14 @@ +add_executable(bongo-manager + manager.c +) + +target_link_libraries(bongo-manager + bongonmap + bongomsgapi + bongojson + bongoutil + bongoxpl + bongocal +) + +install(TARGETS bongo-manager DESTINATION ${SBIN_INSTALL_DIR}) diff --git a/src/apps/manager/Makefile.am b/src/apps/manager/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/apps/manager/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/apps/queuetool/Bongo.rules b/src/apps/queuetool/Bongo.rules deleted file mode 100644 index 7df5aa4..0000000 --- a/src/apps/queuetool/Bongo.rules +++ /dev/null @@ -1,10 +0,0 @@ -# -*- Makefile -*- -dist_sbin_SCRIPTS += \ - src/apps/queuetool/bongo-queuetool - -src/apps/queuetool/all: -src/apps/queuetool/clean: clean -src/apps/queuetool/install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) \ - dist_sbinSCRIPTS=src/apps/queuetool/bongo-queuetool \ - install-dist_sbinSCRIPTS diff --git a/src/apps/queuetool/CMakeLists.txt b/src/apps/queuetool/CMakeLists.txt new file mode 100644 index 0000000..d68144a --- /dev/null +++ b/src/apps/queuetool/CMakeLists.txt @@ -0,0 +1 @@ +install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/bongo-queuetool DESTINATION ${SBIN_INSTALL_DIR}) diff --git a/src/apps/queuetool/Makefile.am b/src/apps/queuetool/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/apps/queuetool/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/apps/sendmail/Bongo.rules b/src/apps/sendmail/Bongo.rules deleted file mode 100644 index 82d03b4..0000000 --- a/src/apps/sendmail/Bongo.rules +++ /dev/null @@ -1,23 +0,0 @@ -# -*- Makefile -*- -sbin_PROGRAMS += bongo-sendmail - -bongo_sendmail_SOURCES = \ - src/apps/sendmail/sendmail.h \ - src/apps/sendmail/sendmail.c - -bongo_sendmail_LDADD = \ - libbongonmap.la \ - libbongomsgapi.la \ - libbongologger.la \ - libbongoconnio.la \ - libbongomemmgr.la \ - libbongoutil.la \ - libbongoxpl.la \ - $(top_builddir)/import/log4c/log4c/libbongolog4c.la \ - $(PTHREAD_LIBS) \ - $(ALL_LIBS) - -src/apps/sendmail/all: bongo-sendmail -src/apps/sendmail/clean: clean -src/apps/sendmail/install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) sbin_PROGRAMS=bongo-sendmail install-sbinPROGRAMS diff --git a/src/apps/sendmail/Makefile.am b/src/apps/sendmail/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/apps/sendmail/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/apps/storetool/Bongo.rules b/src/apps/storetool/Bongo.rules deleted file mode 100644 index 76f8d49..0000000 --- a/src/apps/storetool/Bongo.rules +++ /dev/null @@ -1,38 +0,0 @@ -# -*- Makefile -*- -pkgpythonstoretooldir = $(pkgpythondir)/storetool - -pkgpythonstoretool_PYTHON = \ - src/apps/storetool/bongo/storetool/__init__.py \ - src/apps/storetool/bongo/storetool/BackupCommands.py \ - src/apps/storetool/bongo/storetool/CalendarCommands.py \ - src/apps/storetool/bongo/storetool/ContactCommands.py \ - src/apps/storetool/bongo/storetool/InteractiveCommands.py \ - src/apps/storetool/bongo/storetool/MailCommands.py \ - src/apps/storetool/bongo/storetool/TestCommands.py \ - src/apps/storetool/bongo/storetool/ExportMailbox.py - -src/apps/storetool/bongo-storetool: $(top_builddir)/src/libs/python/bongo-python-wrapper - $(INSTALL) -m 755 $< $@ - -dist_pkglibexec_SCRIPTS += src/apps/storetool/bongo-storetool.py - -sbin_SCRIPTS += \ - src/apps/storetool/bongo-storetool - -dist_noinst_DATA += \ - src/apps/storetool/bongo/__init__.py - -CLEANFILES += \ - src/apps/storetool/bongo-storetool \ - src/apps/storetool/*.pyc \ - src/apps/storetool/bongo/*.pyc \ - src/apps/storetool/bongo/storetool/*.pyc - -src/apps/storetool/all: -src/apps/storetool/clean: clean -src/apps/storetool/install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) \ - sbin_SCRIPTS=src/apps/storetool/bongo-storetool \ - dist_pkglibexec_SCRIPTS=src/apps/storetool/bongo-storetool.py \ - install-sbinSCRIPTS \ - install-pkgpythonstoretoolPYTHON diff --git a/src/apps/storetool/Makefile.am b/src/apps/storetool/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/apps/storetool/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/apps/storetool/demo/Bongo.rules b/src/apps/storetool/demo/Bongo.rules deleted file mode 100644 index 04b388f..0000000 --- a/src/apps/storetool/demo/Bongo.rules +++ /dev/null @@ -1,83 +0,0 @@ -# -*- Makefile -*- -demodir = $(pkgdatadir)/demo - -calendardir = $(demodir)/calendars -dist_calendar_DATA = \ - src/apps/storetool/demo/calendars/French%20Holidays.ics \ - src/apps/storetool/demo/calendars/openSUSE.ics \ - src/apps/storetool/demo/calendars/US%20Holidays.ics \ - src/apps/storetool/demo/calendars/World%20Cup%202006.ics - -contactdir = $(demodir)/contacts -dist_contact_DATA = \ - src/apps/storetool/demo/contacts/list.vcf - -maildir = $(demodir)/mail - -dist_mail_DATA = \ - src/apps/storetool/demo/mail/bbq \ - src/apps/storetool/demo/mail/party-invite \ - src/apps/storetool/demo/mail/desktop-devel-000 \ - src/apps/storetool/demo/mail/desktop-devel-001 \ - src/apps/storetool/demo/mail/desktop-devel-002 \ - src/apps/storetool/demo/mail/desktop-devel-003 \ - src/apps/storetool/demo/mail/desktop-devel-004 \ - src/apps/storetool/demo/mail/desktop-devel-005 \ - src/apps/storetool/demo/mail/desktop-devel-006 \ - src/apps/storetool/demo/mail/desktop-devel-007 \ - src/apps/storetool/demo/mail/desktop-devel-008 \ - src/apps/storetool/demo/mail/desktop-devel-009 \ - src/apps/storetool/demo/mail/desktop-devel-010 \ - src/apps/storetool/demo/mail/desktop-devel-011 \ - src/apps/storetool/demo/mail/desktop-devel-012 \ - src/apps/storetool/demo/mail/desktop-devel-013 \ - src/apps/storetool/demo/mail/desktop-devel-014 \ - src/apps/storetool/demo/mail/desktop-devel-015 \ - src/apps/storetool/demo/mail/desktop-devel-016 \ - src/apps/storetool/demo/mail/desktop-devel-017 \ - src/apps/storetool/demo/mail/desktop-devel-018 \ - src/apps/storetool/demo/mail/desktop-devel-019 \ - src/apps/storetool/demo/mail/desktop-devel-020 \ - src/apps/storetool/demo/mail/desktop-devel-021 \ - src/apps/storetool/demo/mail/desktop-devel-023 \ - src/apps/storetool/demo/mail/desktop-devel-024 \ - src/apps/storetool/demo/mail/desktop-devel-025 \ - src/apps/storetool/demo/mail/desktop-devel-026 \ - src/apps/storetool/demo/mail/desktop-devel-027 \ - src/apps/storetool/demo/mail/desktop-devel-028 \ - src/apps/storetool/demo/mail/desktop-devel-029 \ - src/apps/storetool/demo/mail/desktop-devel-030 \ - src/apps/storetool/demo/mail/desktop-devel-031 \ - src/apps/storetool/demo/mail/desktop-devel-032 \ - src/apps/storetool/demo/mail/desktop-devel-033 \ - src/apps/storetool/demo/mail/desktop-devel-034 \ - src/apps/storetool/demo/mail/desktop-devel-035 \ - src/apps/storetool/demo/mail/desktop-devel-036 \ - src/apps/storetool/demo/mail/desktop-devel-037 \ - src/apps/storetool/demo/mail/desktop-devel-038 \ - src/apps/storetool/demo/mail/desktop-devel-039 \ - src/apps/storetool/demo/mail/bongo-general-000 \ - src/apps/storetool/demo/mail/bongo-general-001 \ - src/apps/storetool/demo/mail/bongo-general-002 \ - src/apps/storetool/demo/mail/bongo-general-003 \ - src/apps/storetool/demo/mail/bongo-general-004 \ - src/apps/storetool/demo/mail/bongo-general-005 \ - src/apps/storetool/demo/mail/bongo-general-006 \ - src/apps/storetool/demo/mail/bongo-general-007 \ - src/apps/storetool/demo/mail/bongo-general-008 \ - src/apps/storetool/demo/mail/bongo-general-009 \ - src/apps/storetool/demo/mail/bongo-general-010 \ - src/apps/storetool/demo/mail/bongo-general-011 \ - src/apps/storetool/demo/mail/bongo-general-012 \ - src/apps/storetool/demo/mail/bongo-general-013 \ - src/apps/storetool/demo/mail/bongo-general-014 \ - src/apps/storetool/demo/mail/bongo-general-015 \ - src/apps/storetool/demo/mail/bongo-general-016 \ - src/apps/storetool/demo/mail/itunes-000 \ - src/apps/storetool/demo/mail/support-001 \ - src/apps/storetool/demo/mail/support-002 \ - src/apps/storetool/demo/mail/support-003 \ - src/apps/storetool/demo/mail/support-004 - -src/apps/storetool/demo/all: -src/apps/storetool/demo/clean: clean diff --git a/src/apps/storetool/demo/Makefile.am b/src/apps/storetool/demo/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/apps/storetool/demo/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/apps/testtool/Bongo.rules b/src/apps/testtool/Bongo.rules deleted file mode 100644 index 4980415..0000000 --- a/src/apps/testtool/Bongo.rules +++ /dev/null @@ -1,26 +0,0 @@ -# -*- Makefile -*- -sbin_PROGRAMS += bongo-testtool - -bongo_testtool_SOURCES = \ - $(conf_defaults) \ - src/apps/testtool/config.h \ - src/apps/testtool/testtool.c - -bongo_testtool_CPPFLAGS = $(AM_CPPFLAGS) \ - $(GNUTLS_CFLAGS) - -bongo_testtool_LDADD = \ - libbongonmap.la \ - libbongomsgapi.la \ - libbongoconnio.la \ - libbongomemmgr.la \ - libbongoutil.la \ - libbongoxpl.la \ - $(PTHREAD_LIBS) \ - $(GNUTLS_LIBS) \ - $(ALL_LIBS) - -src/apps/testtool/all: bongo-testtool -src/apps/testtool/clean: clean -src/apps/testtool/install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) sbin_PROGRAMS=bongo-testtool install-sbinPROGRAMS diff --git a/src/apps/testtool/CMakeLists.txt b/src/apps/testtool/CMakeLists.txt new file mode 100644 index 0000000..d55ac1f --- /dev/null +++ b/src/apps/testtool/CMakeLists.txt @@ -0,0 +1,14 @@ +add_executable(bongo-testtool + testtool.c +) + +target_link_libraries(bongo-testtool + bongonmap + bongomsgapi + bongojson + bongoutil + bongoxpl + bongocal +) + +install(TARGETS bongo-testtool DESTINATION ${SBIN_INSTALL_DIR}) diff --git a/src/apps/testtool/Makefile.am b/src/apps/testtool/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/apps/testtool/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/apps/testtool/testtool.c b/src/apps/testtool/testtool.c index 0307fe2..e2cd383 100644 --- a/src/apps/testtool/testtool.c +++ b/src/apps/testtool/testtool.c @@ -7,7 +7,6 @@ #include #include #include -#include #include "config.h" #include diff --git a/src/libs/bongoutil/Bongo.rules b/src/libs/bongoutil/Bongo.rules deleted file mode 100644 index 110bb8c..0000000 --- a/src/libs/bongoutil/Bongo.rules +++ /dev/null @@ -1,23 +0,0 @@ -# -*- Makefile -*- -lib_LTLIBRARIES += libbongoutil.la - -libbongoutil_la_LDFLAGS = $(GNUTLS_LIBS) - -libbongoutil_la_SOURCES = \ - src/libs/bongoutil/array.c \ - src/libs/bongoutil/fileio.c \ - src/libs/bongoutil/hashtable.c \ - src/libs/bongoutil/bongothreadpool.c \ - src/libs/bongoutil/bongokeyword.c \ - src/libs/bongoutil/lists.c \ - src/libs/bongoutil/stringbuilder.c \ - src/libs/bongoutil/quicksort.c \ - src/libs/bongoutil/utf7mod.c \ - src/libs/bongoutil/bongoutil.c - -libbongoutil_la_LIBADD = \ - libbongoxpl.la \ - libbongomemmgr.la - -src/libs/bongoutil/all: libbongoutil.la -src/libs/bongo/clean: clean diff --git a/src/libs/bongoutil/CMakeLists.txt b/src/libs/bongoutil/CMakeLists.txt new file mode 100644 index 0000000..d44dfa2 --- /dev/null +++ b/src/libs/bongoutil/CMakeLists.txt @@ -0,0 +1,14 @@ + +add_library(bongoutil SHARED + array.c + fileio.c + hashtable.c + bongothreadpool.c + bongokeyword.c + lists.c + stringbuilder.c + quicksort.c + utf7mod.c + bongoutil.c) + +install(TARGETS bongoutil DESTINATION ${LIB_INSTALL_DIR}) diff --git a/src/libs/bongoutil/Makefile.am b/src/libs/bongoutil/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/libs/bongoutil/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/libs/bongoutil/tests/Bongo.rules b/src/libs/bongoutil/tests/Bongo.rules deleted file mode 100644 index 720f443..0000000 --- a/src/libs/bongoutil/tests/Bongo.rules +++ /dev/null @@ -1,22 +0,0 @@ -# -*- Makefile -*- -TESTS += checktest-bongoutil -check_PROGRAMS += checktest-bongoutil - -dist_noinst_DATA += \ - src/libs/bongoutil/tests/bongokeyword_test.c \ - src/libs/bongoutil/tests/stringops_test.c \ - src/libs/bongoutil/tests/utf7mod_test.c - -CLEANFILES += \ - src/libs/bongoutil/tests/checklog.xml - -checktest_bongoutil_SOURCES = \ - src/libs/bongoutil/tests/checktest.c - -checktest_bongoutil_LDADD = $(CHECK_LIBS) \ - libbongomemmgr.la \ - libbongoutil.la \ - libbongoxpl.la - -src/libs/bongoutil/tests/all: -src/libs/bongoutil/tests/clean: clean diff --git a/src/libs/bongoutil/tests/Makefile.am b/src/libs/bongoutil/tests/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/libs/bongoutil/tests/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/libs/cal/Bongo.rules b/src/libs/cal/Bongo.rules deleted file mode 100644 index 2c1b133..0000000 --- a/src/libs/cal/Bongo.rules +++ /dev/null @@ -1,35 +0,0 @@ -# -*- Makefile -*- -lib_LTLIBRARIES += libbongocal.la - -libbongocal_la_SOURCES = \ - src/libs/cal/bongo-cal-object.c \ - src/libs/cal/bongo-cal-instance.c \ - src/libs/cal/bongo-cal-private.h \ - src/libs/cal/bongo-cal-recur.c \ - src/libs/cal/bongo-cal-time.c \ - src/libs/cal/bongo-cal-timezone.c \ - src/libs/cal/cal-convert.c - -libbongocal_la_CPPFLAGS = $(AM_CPPFLAGS) \ - -DZONEINFODIR=\""$(datadir)/bongo/zoneinfo"\" \ - $(LIBICAL_CFLAGS) - -libbongocal_la_LIBADD = \ - libbongomemmgr.la \ - libbongoutil.la \ - libbongoxpl.la \ - libbongo-json.la \ - libbongoconnio.la \ - $(LIBICAL_LIBS) \ - $(PTHREAD_LIBS) \ - $(ALL_LIBS) - -noinst_PROGRAMS += bongo-import-tz - -bongo_import_tz_SOURCES = src/libs/cal/bongo-import-tz.c -bongo_import_tz_LDADD = libbongocal.la $(LIBICAL_LIBS) -bongo_import_tz_CPPFLAGS = $(AM_CPPFLAGS) $(LIBICAL_CFLAGS)\ - -I$(top_srcdir)/src/libs/cal - -src/libs/cal/all: libbongocal.la bongo-import-tz -src/libs/cal/clean: clean diff --git a/src/libs/cal/CMakeLists.txt b/src/libs/cal/CMakeLists.txt new file mode 100644 index 0000000..782fa05 --- /dev/null +++ b/src/libs/cal/CMakeLists.txt @@ -0,0 +1,26 @@ +add_library(bongocal SHARED + bongo-cal-object.c + bongo-cal-instance.c + bongo-cal-recur.c + bongo-cal-time.c + bongo-cal-timezone.c + cal-convert.c) + +# FIXME: this compile is a bit broken. +#add_executable(bongo-import-tz +# bongo-import-tz.c) +# +#target_link_libraries(bongo-import-tz +# bongomemmgr +# bongocal +# ${GLIB2_LIBRARIES} +# ${ICAL_LIBRARIES} +# ) + +target_link_libraries(bongocal + bongoxpl + bongomemmgr + ${LIBICAL_LIBRARIES} +) + +install(TARGETS bongocal DESTINATION ${LIB_INSTALL_DIR}) diff --git a/src/libs/cal/Makefile.am b/src/libs/cal/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/libs/cal/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/libs/cal/bongo-cal-instance.c b/src/libs/cal/bongo-cal-instance.c index d2e1848..5b6725c 100644 --- a/src/libs/cal/bongo-cal-instance.c +++ b/src/libs/cal/bongo-cal-instance.c @@ -302,7 +302,7 @@ IntArrayToList(BongoArray *array, int min, int max) int intVal; if (BongoJsonArrayGetInt(array, i, &intVal) == BONGO_JSON_OK) { if (intVal >= min && intVal <= max) { - ret = BongoListPrepend(ret, XPL_INT_TO_PTR(intVal)); + ret = BongoListPrepend(ret, (char *)(intVal)); } } } @@ -327,8 +327,8 @@ DayArrayToList(BongoArray *array) day = GetWeekday(end); if (ord >= -53 && ord <= 53) { - ret = BongoListPrepend(ret, XPL_INT_TO_PTR(day)); - ret = BongoListPrepend(ret, XPL_INT_TO_PTR(ord)); + ret = BongoListPrepend(ret, (char *)(day)); + ret = BongoListPrepend(ret, (char *)(ord)); } } } @@ -394,7 +394,7 @@ ReadRecur(BongoCalInstance *inst, BongoJsonObject *obj, BongoCalRule *recur) recur->bymonth = IntArrayToList(arrayVal, 1, 12); for (l = recur->bymonth; l != NULL; l = l->next) { - l->data = XPL_INT_TO_PTR(XPL_PTR_TO_INT(l->data) - 1); + l->data = ((int)(l->data)) - 1; } } diff --git a/src/libs/cal/bongo-cal-recur.c b/src/libs/cal/bongo-cal-recur.c index 9729f44..0e0a76a 100644 --- a/src/libs/cal/bongo-cal-recur.c +++ b/src/libs/cal/bongo-cal-recur.c @@ -553,7 +553,7 @@ static void PrintIntList(BongoList *list) { for (; list != NULL; list = list->next) { - printf("%d,", XPL_PTR_TO_INT(list->data)); + printf("%d,", (int)(list->data)); } } @@ -1705,7 +1705,7 @@ CalObjInitializeRecurData (RecurData *recurData, /* Create an array of months from bymonths for fast lookup. */ elem = recur->bymonth; while (elem) { - month = XPL_PTR_TO_INT (elem->data); + month = (int) (elem->data); recurData->months[month] = 1; elem = elem->next; } @@ -1715,7 +1715,7 @@ CalObjInitializeRecurData (RecurData *recurData, element there corresponds to the last day of the year. */ elem = recur->byyearday; while (elem) { - yearday = XPL_PTR_TO_INT (elem->data); + yearday = (int) (elem->data); if (yearday >= 0) recurData->yeardays[yearday] = 1; else @@ -1728,7 +1728,7 @@ CalObjInitializeRecurData (RecurData *recurData, element there corresponds to the last day of the month. */ elem = recur->bymonthday; while (elem) { - monthday = XPL_PTR_TO_INT (elem->data); + monthday = (int) (elem->data); if (monthday >= 0) recurData->monthdays[monthday] = 1; else @@ -1739,10 +1739,10 @@ CalObjInitializeRecurData (RecurData *recurData, /* Create an array of weekdays from byday for fast lookup. */ elem = recur->byday; while (elem) { - weekday = XPL_PTR_TO_INT (elem->data); + weekday = (int) (elem->data); elem = elem->next; /* The week number is not used when filtering. */ - week_num = XPL_PTR_TO_INT (elem->data); + week_num = (int) (elem->data); elem = elem->next; recurData->weekdays[weekday] = 1; @@ -1751,7 +1751,7 @@ CalObjInitializeRecurData (RecurData *recurData, /* Create an array of hours from byhour for fast lookup. */ elem = recur->byhour; while (elem) { - hour = XPL_PTR_TO_INT (elem->data); + hour = (int) (elem->data); recurData->hours[hour] = 1; elem = elem->next; } @@ -1759,7 +1759,7 @@ CalObjInitializeRecurData (RecurData *recurData, /* Create an array of minutes from byminutes for fast lookup. */ elem = recur->byminute; while (elem) { - minute = XPL_PTR_TO_INT (elem->data); + minute = (int) (elem->data); recurData->minutes[minute] = 1; elem = elem->next; } @@ -1767,7 +1767,7 @@ CalObjInitializeRecurData (RecurData *recurData, /* Create an array of seconds from byseconds for fast lookup. */ elem = recur->bysecond; while (elem) { - second = XPL_PTR_TO_INT (elem->data); + second = (int) (elem->data); recurData->seconds[second] = 1; elem = elem->next; } @@ -1960,7 +1960,7 @@ CalObjBySetPosFilter (BongoCalRule *recur, element from occs to new_occs. */ len = occs->len; while (elem) { - pos = XPL_PTR_TO_INT (elem->data); + pos = (int) (elem->data); /* Negative values count back from the end of the array. */ if (pos < 0) @@ -2488,7 +2488,7 @@ CalObjByMonthExpand (RecurData *recurData, elem = recurData->recur->bymonth; while (elem) { /* NOTE: The day may now be invalid, e.g. 31st Feb. */ - occ->month = XPL_PTR_TO_INT (elem->data); + occ->month = (int) (elem->data); BongoArrayAppendValues (new_occs, occ, 1); elem = elem->next; } @@ -2569,7 +2569,7 @@ CalObjByWeeknoExpand (RecurData *recurData, new occurrence for each one. */ elem = recurData->recur->byweekno; while (elem) { - weekno = XPL_PTR_TO_INT (elem->data); + weekno = (int) (elem->data); if (weekno > 0) { cotime = year_start_cotime; CalObjTimeAddDays (&cotime, @@ -2640,7 +2640,7 @@ CalObjByYeardayExpand (RecurData *recurData, new occurrence for each one. */ elem = recurData->recur->byyearday; while (elem) { - dayno = XPL_PTR_TO_INT (elem->data); + dayno = (int) (elem->data); if (dayno > 0) { cotime = year_start_cotime; CalObjTimeAddDays (&cotime, dayno - 1); @@ -2734,7 +2734,7 @@ CalObjBymonthdayExpand (RecurData *recurData, new occurrence for each one. */ elem = recurData->recur->bymonthday; while (elem) { - dayno = XPL_PTR_TO_INT (elem->data); + dayno = (int) (elem->data); if (dayno > 0) { cotime = month_start_cotime; CalObjTimeAddDays (&cotime, dayno - 1); @@ -2819,9 +2819,9 @@ CalObjByDayExpandYearly (RecurData *recurData, elem = recurData->recur->byday; while (elem) { - weekday = XPL_PTR_TO_INT (elem->data); + weekday = (int) (elem->data); elem = elem->next; - week_num = XPL_PTR_TO_INT (elem->data); + week_num = (int) (elem->data); elem = elem->next; year = occ->year; @@ -2897,9 +2897,9 @@ CalObjByDayExpandMonthly (RecurData *recurData, elem = recurData->recur->byday; while (elem) { - weekday = XPL_PTR_TO_INT (elem->data); + weekday = (int) (elem->data); elem = elem->next; - week_num = XPL_PTR_TO_INT (elem->data); + week_num = (int) (elem->data); elem = elem->next; year = occ->year; @@ -2986,7 +2986,7 @@ CalObjByDayExpandWeekly (RecurData *recurData, elem = recurData->recur->byday; while (elem) { - weekday = XPL_PTR_TO_INT (elem->data); + weekday = (int) (elem->data); DPRINT("weekday is %d\n", weekday); elem = elem->next; @@ -2994,7 +2994,7 @@ CalObjByDayExpandWeekly (RecurData *recurData, /* FIXME: Currently we just ignore this, but maybe we should skip all elements where week_num != 0. The spec isn't clear about this. */ - week_num = XPL_PTR_TO_INT (elem->data); + week_num = (int) (elem->data); DPRINT("week num is %d\n", week_num); elem = elem->next; @@ -3075,7 +3075,7 @@ CalObjByhourExpand (RecurData *recurData, elem = recurData->recur->byhour; while (elem) { - occ->hour = XPL_PTR_TO_INT (elem->data); + occ->hour = (int) (elem->data); BongoArrayAppendValues (new_occs, occ, 1); elem = elem->next; } @@ -3142,7 +3142,7 @@ CalObjByminuteExpand (RecurData *recurData, elem = recurData->recur->byminute; while (elem) { - occ->minute = XPL_PTR_TO_INT (elem->data); + occ->minute = (int) (elem->data); BongoArrayAppendValues (new_occs, occ, 1); elem = elem->next; } @@ -3209,7 +3209,7 @@ CalObjBysecondExpand (RecurData *recurData, elem = recurData->recur->bysecond; while (elem) { - occ->second = XPL_PTR_TO_INT (elem->data); + occ->second = (int) (elem->data); BongoArrayAppendValues (new_occs, occ, 1); elem = elem->next; } diff --git a/src/libs/cal/bongo-import-tz.c b/src/libs/cal/bongo-import-tz.c index c201dc2..9f12863 100644 --- a/src/libs/cal/bongo-import-tz.c +++ b/src/libs/cal/bongo-import-tz.c @@ -7,7 +7,7 @@ #include #include #include -#include +#include "bongo-cal-private.h" #include static char * diff --git a/src/libs/cal/tests/Bongo.rules b/src/libs/cal/tests/Bongo.rules deleted file mode 100644 index 3dca98e..0000000 --- a/src/libs/cal/tests/Bongo.rules +++ /dev/null @@ -1,23 +0,0 @@ -# -*- Makefile -*- -TESTS += checktest-cal -check_PROGRAMS += checktest-cal - -CLEANFILES += checklog.xml - -checktest_cal_SOURCES = \ - src/libs/cal/tests/test-cal.c - -checktest_cal_LDADD = $(CHECK_LIBS) \ - libbongomemmgr.la \ - libbongoutil.la \ - libbongoxpl.la \ - libbongo-json.la \ - libbongocal.la \ - $(LIBICAL_LIBS) \ - $(PTHREAD_LIBS) \ - $(ALL_LIBS) - -checktest_CFLAGS = $(AM_CFLAGS) $(LIBICAL_CFLAGS) -g -O0 - -src/libs/cal/tests/all: -src/libs/cal/tests/clean: clean diff --git a/src/libs/cal/tests/Makefile.am b/src/libs/cal/tests/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/libs/cal/tests/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/libs/calcmd/Bongo.rules b/src/libs/calcmd/Bongo.rules deleted file mode 100644 index d25deae..0000000 --- a/src/libs/calcmd/Bongo.rules +++ /dev/null @@ -1,34 +0,0 @@ -# -*- Makefile -*- -lib_LTLIBRARIES += libbongocalcmd.la - -libbongocalcmd_la_SOURCES = \ - src/libs/calcmd/parsecmd.y \ - src/libs/calcmd/calcmd.c - -libbongocalcmd_la_LIBADD = \ - libbongocal.la \ - libbongomemmgr.la \ - libbongoxpl.la - -check_PROGRAMS += parsecmd - -parsecmd_SOURCES = src/libs/calcmd/test.c - -parsecmd_LDADD = \ - libbongomsgapi.la \ - libbongologger.la \ - libbongoconnio.la \ - libbongomemmgr.la \ - libbongoutil.la \ - libbongoxpl.la \ - libbongocalcmd.la \ - libbongocal.la \ - $(PTHREAD_LIBS) \ - $(ALL_LIBS) - -dist_noinst_DATA += \ - src/libs/calcmd/test.pl \ - src/libs/calcmd/test.dat - -src/libs/calcmd/all: libbongocalcmd.la parsecmd -src/libs/calcmd/clean: clean diff --git a/src/libs/calcmd/Makefile.am b/src/libs/calcmd/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/libs/calcmd/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/libs/calcmd/tests/Bongo.rules b/src/libs/calcmd/tests/Bongo.rules deleted file mode 100644 index 260701a..0000000 --- a/src/libs/calcmd/tests/Bongo.rules +++ /dev/null @@ -1,13 +0,0 @@ -# -*- Makefile -*- -TESTS += checktest-calcmd -check_PROGRAMS += checktest-calcmd - -checktest_calcmd_SOURCES = \ - src/libs/calcmd/tests/checktest.c - -checktest_calcmd_LDADD = $(CHECK_LIBS) - -CLEANFILES += src/libs/calcmd/tests/checklog.xml - -src/libs/calcmd/tests/all: -src/libs/calcmd/tests/clean: clean diff --git a/src/libs/calcmd/tests/Makefile.am b/src/libs/calcmd/tests/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/libs/calcmd/tests/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/libs/connio/Bongo.rules b/src/libs/connio/Bongo.rules deleted file mode 100644 index 57921c8..0000000 --- a/src/libs/connio/Bongo.rules +++ /dev/null @@ -1,15 +0,0 @@ -# -*- Makefile -*- -lib_LTLIBRARIES += libbongoconnio.la - -libbongoconnio_la_SOURCES = \ - src/libs/connio/connio.c \ - src/libs/connio/trace.c \ - src/libs/connio/conniop.h \ - src/libs/connio/addrpool.c \ - src/libs/connio/sockets.c \ - src/libs/connio/unix-ip.c - -libbongoconnio_la_LIBADD = $(GNUTLS_LIBS) - -src/libs/connio/all: libbongoconnio.la -src/libs/connio/clean: clean diff --git a/src/libs/connio/CMakeLists.txt b/src/libs/connio/CMakeLists.txt new file mode 100644 index 0000000..7649d81 --- /dev/null +++ b/src/libs/connio/CMakeLists.txt @@ -0,0 +1,14 @@ + +add_library(bongoconnio SHARED + connio.c + trace.c + addrpool.c + sockets.c + unix-ip.c +) + +target_link_libraries(bongoconnio + ${GNUTLS_LIBRARIES} +) + +install(TARGETS bongoconnio DESTINATION ${LIB_INSTALL_DIR}) diff --git a/src/libs/connio/Makefile.am b/src/libs/connio/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/libs/connio/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/libs/connio/addrpool.c b/src/libs/connio/addrpool.c index 8099597..6811b49 100644 --- a/src/libs/connio/addrpool.c +++ b/src/libs/connio/addrpool.c @@ -222,7 +222,7 @@ AddressPoolAddressAdd(AddressPool *pool, uint32_t ipAddress, unsigned short port return(TRUE); } - newAddrList = MemMalloc(sizeof(AddressPoolAddress) * pool->addressCount + 1); + newAddrList = MemMalloc(sizeof(AddressPoolAddress) * (pool->addressCount + 1)); if (!newAddrList) { XplRWWriteLockRelease(&(pool->lock)); return(FALSE); diff --git a/src/libs/connio/tests/Bongo.rules b/src/libs/connio/tests/Bongo.rules deleted file mode 100644 index b10cc56..0000000 --- a/src/libs/connio/tests/Bongo.rules +++ /dev/null @@ -1,21 +0,0 @@ -# -*- Makefile -*- -TESTS += checktest-connio -check_PROGRAMS += checktest-connio - -checktest_connio_SOURCES = \ - src/libs/connio/tests/checktest.c - -checktest_connio_LDADD = $(CHECK_LIBS) \ - libbongoconnio.la \ - libbongonmap.la \ - libbongomsgapi.la \ - libbongologger.la \ - libbongomemmgr.la \ - libbongoutil.la \ - libbongoxpl.la \ - $(SQLITE_LIBS) \ - $(PTHREAD_LIBS) \ - $(ALL_LIBS) - -src/libs/connio/tests/all: -src/libs/connio/tests/clean: clean diff --git a/src/libs/connio/tests/Makefile.am b/src/libs/connio/tests/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/libs/connio/tests/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/libs/connio/unix-ip.c b/src/libs/connio/unix-ip.c index 657e178..06ed5c2 100644 --- a/src/libs/connio/unix-ip.c +++ b/src/libs/connio/unix-ip.c @@ -374,7 +374,7 @@ XplIPRead(void *socket, unsigned char *Buf, int Len, int readTimeout) /* All sockets are closed when exiting. */ /* Closed socket will error on read. */ - pfd.fd = XPL_PTR_TO_INT(socket); + pfd.fd = (int)(socket); pfd.events = POLLIN; rc = poll(&pfd, 1, readTimeout * 1000); if (rc > 0) { @@ -384,7 +384,7 @@ XplIPRead(void *socket, unsigned char *Buf, int Len, int readTimeout) XPLIPRead_Again: - rc = recv(XPL_PTR_TO_INT(socket), Buf, Len, 0); + rc = recv((int)(socket), Buf, Len, 0); if (rc >= 0) { /* success */ return(rc); @@ -414,7 +414,7 @@ XplIPWrite(void * socket, unsigned char *Buf, int Len) XPLIPWrite_Again: - rc = send(XPL_PTR_TO_INT(socket), Buf, Len, 0); + rc = send((int)(socket), Buf, Len, 0); if (rc >= 0) { /* common predicted path */ return(rc); diff --git a/src/libs/connmgr/Bongo.rules b/src/libs/connmgr/Bongo.rules deleted file mode 100644 index c08306f..0000000 --- a/src/libs/connmgr/Bongo.rules +++ /dev/null @@ -1,10 +0,0 @@ -# -*- Makefile -*- -lib_LTLIBRARIES += libbongoconnmgr.la - -#libbongonmap_la_LDFLAGS := -static -libbongoconnmgr_la_SOURCES := \ - src/libs/connmgr/connmgr.c \ - src/libs/connmgr/hashcred.c - -src/libs/connmgr/all: libbongoconnmgr.la -src/libs/connmgr/clean: clean diff --git a/src/libs/connmgr/Makefile.am b/src/libs/connmgr/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/libs/connmgr/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/libs/json/Bongo.rules b/src/libs/json/Bongo.rules deleted file mode 100644 index 4f16af1..0000000 --- a/src/libs/json/Bongo.rules +++ /dev/null @@ -1,10 +0,0 @@ -# -*- Makefile -*- -lib_LTLIBRARIES += libbongo-json.la - -libbongo_json_la_SOURCES= \ - src/libs/json/bongojsonrpc.c \ - src/libs/json/json.c \ - src/libs/json/parse.c - -src/libs/json/all: libbongo-json.la -src/libs/json/clean: clean diff --git a/src/libs/json/CMakeLists.txt b/src/libs/json/CMakeLists.txt new file mode 100644 index 0000000..33baa3c --- /dev/null +++ b/src/libs/json/CMakeLists.txt @@ -0,0 +1,6 @@ +add_library(bongojson SHARED + bongojsonrpc.c + json.c + parse.c) + +install(TARGETS bongojson DESTINATION ${LIB_INSTALL_DIR}) diff --git a/src/libs/json/Makefile.am b/src/libs/json/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/libs/json/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/libs/logger/Bongo.rules b/src/libs/logger/Bongo.rules deleted file mode 100644 index c4aeccf..0000000 --- a/src/libs/logger/Bongo.rules +++ /dev/null @@ -1,21 +0,0 @@ -# -*- Makefile -*- -lib_LTLIBRARIES += libbongologger.la - -logconfdir = $(XPL_DEFAULT_CONF_DIR) - -dist_logconf_DATA = \ - src/libs/logger/logs.conf - -libbongologger_la_SOURCES = \ - src/libs/logger/bongo.lsc \ - src/libs/logger/logger-format.pl \ - src/libs/logger/logger.c \ - src/libs/logger/logger-format.c \ - src/libs/logger/loggerp.h - -libbongologger_la_LIBADD = \ - libbongoxpl.la \ - $(DL_LIBS) - -src/libs/logger/all: libbongologger.la -src/libs/logger/clean: clean diff --git a/src/libs/logger/Makefile.am b/src/libs/logger/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/libs/logger/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/libs/logger/bongo.lsc b/src/libs/logger/bongo.lsc deleted file mode 100644 index 76e0031..0000000 --- a/src/libs/logger/bongo.lsc +++ /dev/null @@ -1,148 +0,0 @@ -#^Bongo^0002^Bongo^EN -# Variables: -# -# Syntax: $FV -# -# Format (F): -# T - Time (UTC localized) -# D - Date (UTC localized) -# N - Number (32bit unsigned) -# S - String -# X - Hexdecimal Number -# R - RFC822 format date/time -# I - IPv4 Internet Address (network order) -# i - IPv4 Internet Address (host order) -# P - Password -# -# Value (V): -# C - Platform Agent Date -# A - Audit Service Date -# 1 - Numerical value 1 -# 2 - Numerical value 2 -# S - Text 1 -# T - Text 2 -# O - Component -# I - Event ID -# L - Log Level -# M - MIME Hint -# X - Data Size -# D - Data -# -# -# EventID, Description, Text1 Title, Text2 Title, Value1 Title, Value1 Type, Value2 Title, Value2 Type, Group Title, Group Type, Data Title, Data Type, Display Schema - -0002,Bongo,Bongo Project Version 0.1.0,,,,,,,,,, -00020001,Bad Password,Account,Password,IP Address,i,,,,,,,"$XI: Bad password \"$PT\" for account \"$SS\" from $i1\n" -00020002,Unhandled Request,Account,Request,IP Addres,i,,,,,,,"$XI: Unhandled request \"$ST\" for account \"$SS\" from $i1\n" -00020003,Login,Account,,IP Address,i,,,,,,,"$XI: Valid login for account \"$SS\" from $i1\n" -00020004,Max Bad Passwords,Account,,IP Address,i,Failed Attempts,,,,,,"$XI: $N2 failed logins for account \"$SS\" from $i1\n" -00020005,Feature not Enabled,,,,,,,,,,,"$XI: Feature disabled for account \"$SS\" from $i1\n" -00020006,Unknown User,Account,Password,IP Address,i,,,,,,,"$XI: Account \"$SS\" does not exist; attempt from $i1 with password \"$PT\"\n" -00020007,NMAP Unavailable,,,,,,,,,,,"$XI: Could not connect to NMAP server $i1 (code:$N2)\n" -00020008,Out of Memory,,,,,,,,,,,"$XI: Could not allocated $N1 bytes (file:$SS line:$N2)\n" -00020009,Component not Configured,,,,,,,,,,,"$XI: Component not configured: $SS\n" -0002000A,Session Limit Reached,,,,,,,,,,,"$XI: Session limit ($N1) reached\n" -0002000B,Password Change,Account,,IP Address,i,Result,,,,,,"$XI: User \"$SS\" at $i1 changed password; result:$N2\n" -0002000C,Secret Change,Account,Old Question,IP Address,i,,,,,,,"$XI: User \"$SS\" at $i1 changed secret Q/A (Old question: $ST)\n" -0002000D,Account Created,Account,EMail,IP Address,i,,,,,,,"$XI: User \"$SS\" created from address $i1 using \"$ST\"; assigned \"$PD\" as the password.\n" -0002000E,Account Disabled,Account,,IP Address,i,,,,,,,"$XI: User \"$SS\" disabled from $i1\n" -0002000F,Memory Leaked,,,,,,,,,,,"$XI: Memory allocated by file $SS on line $N1 for $N2 bytes was not freed\n" -00020010,Memory Null Destination,,,,,,,,,,,"$XI: Null pointer used as destination by file $SS on line $N1\n" -00020011,Memory Buffer Overflowed,,,,,,,,,,,"$XI: Memory allocated by file $SS on line $N1 overflowed\n" -00020012,Memory Free by Non-Owner,,,,,,,,,,,"$XI: Memory allocated by file $SS on line $N1 was freed by file $ST on line $N2\n" -00020013,Memory Questionable Free,,,,,,,,,,,"$XI: Memory allocated by file $SS on line $N1 was questionably freed\n" -00020014,Memory Questionable Alloc,,,,,,,,,,,"$XI: Questionable allocation requested by file $SS on line $N1 for $N2 bytes\n" -00020015,Message Received,Sender,,IP Address,i,Size,,,,,,"$XI: Received message from \"$SS\", size $N2 (IP:$i1)\n" -00020016,Message Sent,Sender,Recipient,Size,,Status,,,,,,"$XI: Delivered message for \"$SS\" to \"$ST\", size $N1; status $N2\n" -00020017,Connection Blocked,Block Source,,IP Address,i,Reason,,,,,,"$XI: Blocked connection from $i1, reason $N2 (detail: $SS)\n" -00020018,Recipient Blocked,Recipient,,IP Address,i,,,,,,,"$XI: Blocked relay for recipient \"$SS\" from address $i1\n" -00020019,Message Relayed,Sender,Recipient,IP Address,i,,,,,,,"$XI: Relayed message for \"$SS\" to recipient \"$ST\" from address $i1\n" -0002001A,Recipient Limit Reached,,,,,,,,,,,"$XI: Blocked relay for \"$SS\" to recipient \"$ST\" from address $i1\n" -0002001B,New Connection,,,IP Address,i,,,,,,,"$XI: New connection from address $i1\n" -0002001C,Register NMAP Server,,,,,,,,,,,"$XI: Registered NMAP Server $i1 for queue $N2 with SSL $SS\n" -0002001D,Anti-Virus Restart Failed,,,,,,,,,,,"$XI: Failed to restart the anti-virus engine \"$SS\"\n" -0002001E,Duplicate Alias,,,,,,,,,,,"$XI: Have duplicate alias: user: \"$SS\", alias: \"$ST\"\n" -0002001F,Database Open Error,,,,,,,,,,,"$XI: Open database \"$SS\" returned $N1\n" -00020020,Alias Working Contexts,,,,,,,,,,,"$XI: Enumerating context \"$ST\"\n" -00020021,Received Bounce,,,,,,,,,,,"$XI: Received bounce from \"$SS\" at $i1, auth from \"$ST\"\n" -00020022,Spam Blocked,,,,,,,,,,,"$XI: Blocked spam from \"$SS\" at $i1\n" -00020023,Virus Blocked,Sender,Virus,,,,,,,,,"$XI: Blocked virus $ST from \"$SD\" to \"$SS\"\n" -00020024,Message forwarded,Sender,Recipient,,,,,,,,,"$XI: Forwarding for \"$SS\" to \"$ST\"\n" -00020025,Auto replied to message,Sender,Recipient,,,,,,,,,"$XI: Auto reply for \"$SS\" to \"$ST\"\n" -00020026,Received Control Request,,,,,,,,,,,"$XI: Received control request from \"$SS\" at $i1; auth from \"$ST\"\n" -00020027,Processing Error,,,,,,,,,,,"$XI: Processing error on request from \"$SS\" at $i1, queue ID: $ST\n" -00020028,List Send Blocked,,,,,,,,,,,"$XI: Blocked send by \"$ST\" to \"$SS\" reason $N1\n" -00020029,Configuration String,,,,,,,,,,,"$XI: Configuration for \"$SS\": \"$ST\"\n" -0002002A,Configuration Value,,,,,,,,,,,"$XI: Configuration for \"$SS\": $N1\n" -0002002B,Queue Limits Adjusted,,,,,,,,,,,"$XI: Not enough memory; tuning parameters adjusted; concurrent limit: $N1, sequential limit: $N2\n" -0002002C,New SSL Connection,,,IP Address,i,,,,,,,"$XI: New SSL connection from address $i1\n" -0002002D,List Message Received,,,,,,,,,,,"$XI: Message for list \"$SS\" received from \"$ST\"\n" -0002002E,List Message Delivered,,,,,,,,,,,"$XI: Message from list \"$SS\" for user \"$ST\" delivered\n" -0002002F,Reloaded Queue Agent,,,,,,,,,,,"$XI: Reloaded Queue Agent $i1:$ND for queue $N2\n" -00020030,Queue Entry From,,,,,,,,,,,"$XI: Queue $N1, entry \"$SS\" from \"$ST\"; auth from \"$SD\"\n" -00020031,Over Quota,,,,,,,,,,,"$XI: User \"$SS\" quota of $N1 exceeds allotment of $N2, message returned to \"$ST\"\n" -00020032,Bongo Debug,,,,,,,,,,,"$XI: \"$SS\" \"$ST\" $N1 $N2\n" -00020033,Wrong System Auth,,,,,,,,,,,"$XI: Wrong system auth from IP Address $i1\n" -00020034,Switch User Denied,,,,,,,,,,,"$XI: Denied attempt to switch from user \"$SS\" to user \"$ST\" from IP Address $i1\n" -00020035,Wrong User Auth,,,,,,,,,,,"$XI: Wrong auth user \"$SS\" from IP Address $i1\n" -00020036,Diskspace Low,,,,,,,,,,,"$XI: Diskspace low for path \"$SS\"; currently $N1 free blocks, minimum $N2 free blocks required\n" -00020037,Write File Error,,,,,,,,,,,"$XI: Could not write to \"$SS\" for user \"$ST\"; line $N1 from $N2\n" -00020038,Add Queue Agent,,,,,,,,,,,"$XI: Adding Queue Agent $i1:$ND for queue $N2\n" -00020039,Bad Hostname,Hostname,User,,,,,,,,,"$XI: Hostname \"$SS\" is unusable, specified by user \"$ST\"\n" -0002003A,Proxy Localhost,User,,IP Address,i,,,,,,,"$XI: User \"$SS\" attempted to proxy $i1 (the localhost)\n" -0002003B,NMAP Error,,,,,,,,,,,"$XI: User \"$SS\" received NMAP error $N1 (detail: $ST)\n" -0002003C,DDB Initialization,,,,,,,,,,,"$XI: DDB initialization failed (detail: $SS)\n" -0002003D,Disallowed Hostname,Hostname,User,,,,,,,,,"$XI: Hostname \"$SS\" is not allowed, specified by user \"$ST\"\n" -0002003E,Executing Rule,Account,Rule,,,,,,,,,"$XI: User \"$SS\" executing rule \"$ST\"\n" -0002003F,Rule Delete Message,Recipient,,,,,,,,,,"$XI: Removing recipient \"$SS\"\n" -00020040,Rule Forward Message,From,To,,,,,,,,,"$XI: Forwarding from \"$SS\" to \"$ST\"\n" -00020041,Rule Copy Message,From,,,,,,,,,,"$XI: Copy from \"$SS\"\n" -00020042,Rule Move Message,Account,Mailbox,,,,,,,,,"$XI: Moving into mailbox \"$SS:$ST\"\n" -00020043,Reregister Queue Agent,,,,,,,,,,,"$XI: Removed Queue Agent $i1:$ND, queue $N2; agent re-registered\n" -00020044,Removed Queue Agent,,,,,,,,,,,"$XI: Removed Queue Agent $i1:$ND, queue $N2\n" -00020045,Database Find Error,,,,,,,,,,,"$XI: Find \"$SS\" returned $N1\n" -00020046,Database Alias Error,,,,,,,,,,,"$XI: Insert \"$SS\" with alias \"$ST\" returned $N1\n" -00020047,Database Close Error,,,,,,,,,,,"$XI: Close database \"$SS\" returned $N1\n" -00020048,Item Stored,,,,,,,,,,,"$XI: Storing item from \"$ST\" for \"$SS\" with size of $N1; location $SD\n" -00020049,Database Insert Error,,,,,,,,,,,"$XI: Insert \"$SS\" into database returned $N1\n" -0002004A,Database Create Error,,,,,,,,,,,"$XI: Create database \"$SS\" returned $N1\n" -0002004B,Queue Entry Start,,,,,,,,,,,"$XI: Processing queue $N1 entry \"$N2\"\n" -0002004C,Queue Entry Find Object,,,,,,,,,,,"$XI: Recipient \"$SS\" was not found for queue $N1 from \"$ST\" at IP Address $i2\n" -0002004D,Queue Entry to Remote NMAP,,,,,,,,,,,"$XI: Sending queue $N1 entry \"$SS\" via NMAP link to $N2 for \"$ST\"\n" -0002004E,Queue Entry Delivery Failed,,,,,,,,,,,"$XI: Failed to delivery for queue $N1, entry \"$SS\"; status $N2\n" -0002004F,Queue Entry Failed Connect,,,,,,,,,,,"$XI: Queue $N1 entry \"$SS\" failed to connect to $i2:$ND\n" -00020050,Queue Entry Failed,,,,,,,,,,,"$XI: Queue agent $i1:$ND failed to process queue $N2 entry \"$SS\"\n" -00020051,Missing Strings.TXT,,,,,,,,,,,"$XI: Missing strings.txt for language $N1\n" -00020052,Wrong String Count,,,,,,,,,,,"$XI: \"$SS\" is missing strings; found $N1, expected $N2\n" -00020053,Digest Sent,,,,,,,,,,,"$XI: Sent digest for list \"$SS\"\n" -00020054,Create Socket Failed,,,,,,,,,,,"$XI: Unable to create a socket; file \"$SS\", line $N1\n" -00020055,CarrierScan Connect Failed,,,,,,,,,,,"$XI: Unable to connect to the Symantec CarrierScan host at $i1\n" -00020056,Illegal EMail Address,Account,EMail Address,,,,,,,,,"$XI: User \"$SS\" has an illegal e-mail address of \"$ST\"\n" -00020057,Open Strings File Failed,,,,,,,,,,,"$XI: Open strings file for language $N1 returned $SS\n" -00020058,Message Delivery Retry Later,Sender,Recipient,Size,,Status,,,,,,"$XI: Delivery retry needed for \"$SS\" to \"$ST\", size $N1; status $N2\n" -00020059,Message Delivery Failed,Sender,Recipient,Size,,Status,,,,,,"$XI: Delivery failed for \"$SS\" to \"$ST\", size $N1; st" -0002005A,Memory Buffer will Overflow,,,,,,,,,,,"$XI: Memory allocated by file $SS on line $N1 will overflow due to write from $ST on line $N2; attempted to write $ND bytes\n" -0002005B,Memory Null Destination,,,,,,,,,,,"$XI: Null pointer used as source by file $SS on line $N1\n" -0002005C,Added To Block List,,,,,,,,,,,"$XI: IP Address $i1 blocked due to message from \"$SS\" with $N2 recipients\n" -0002005D,Accept Failed,,,,,,,,,,,"$XI: accept() failed with error $N1; SSL connection state $N2\n" -0002005E,Corrupted Index,Account,Mailbox,Index,N,,,,,,,"$XI: Index file \"$ST\" for user \"$SS\", index $N1, is invalid\n" -0002005F,NMAP Out of Memory,Account,Mailbox,Size,N,,,,,,,"$XI: NMAP failed to allocate $N1 bytes for user \"$SS\", mailbox \"$ST\"; unloading\n" -00020060,File Failed to Open,File Path,,Source Line,N,,,,,,,"$XI: File $SS failed to open on line $N1\n" -00020061,File IO Error, Function,,Source Line,N,errno,N,,,,,"$XI: $SS set errno $N2 on line $N1\n" -00020062,Connection Timeout,,,IP Address,i,Timeout,N,,,,N,"$XI: Address $i1 timed out, connection was alive for $N2 seconds\n" -00020063,Connection Error,,,IP Address,i,Timeout,N,,,,N,"$XI: Connection error from $i1, connection was alive for $N2 seconds\n" -00020064,Queue Entry Lock Flooded,,,Entry ID,N,,,,,,N,"$XI: Unable to lock queue entry $N1; lock table full\n" -00020065,Agent HeartBeat,,,,,,,,,,N,"$XI: Agent heartbeat.\n" -00020066,Invalid Mailbox,Account,Mailbox,Message,,,,,,,,"$XI: Mailbox file \"$ST\" for user \"$SS\", Message $N1, is invalid\n" -00020067,Proxy HeartBeat,,,,,,,,,,N,"$XI: Proxy heartbeat.\n" -00020068,Local Connection,,,,,,,,,,N,"$XI: DNS resolved $SS to your server ($i1). \n" -00020069,DNS Configuration Error,,,,,,,,,,N,"$XI: DNS resolved $SS to your server ($i1). Configure Bongo to accept mail for this domain or change the DNS record.\n" -0002006A,Message with Unknown Users,,,,,,,,,,N,"$XI: Message from $i1 had $N2 unknown users.\n" -0002006B,IP Connect Failure,,,,,,,,,,N,"$XI: Attempt to connect to $i1 ($ST) failed! Reason: $SS\n" -0002006C,SMTP Connect Error,,,,,,,,,,N,"$XI: SMTP server returned greeting $N1 $SS Recipient: $ST\n" -0002006D,Negotiation Error,Host,Message,IP Address,,,,,,,N,"$XI: Protocol negotiation with $i1 ($SS) failed! Reason: $ST\n" -0002006E,Network Error,Host,Message,IP Address,,,,,,,N,"$XI: Network communication with $i1 ($SS) failed! Reason: $ST\n" -0002006F,Proxied Mail,User,Host,Messages,KiloBytes,,,,,,N,"$XI: Proxied $N1 messages for \"$SS\" from \"$ST\"; $N2 KiloBytes\n" -00020070,Server Termination,,,,,,,,,,N,"$XI: Server Shutting Down: state=$N1 errno=$N2\n" -00020071,User Error,,,,,,,,,,N,"$XI: Could not drop to unprivileged user '$SS'\n" -00020072,Port Error,,,,,,,,,,N,"$XI: Could not bind to $SSport $N1\n" diff --git a/src/libs/logger/logger-format.c b/src/libs/logger/logger-format.c deleted file mode 100644 index 92f4252..0000000 --- a/src/libs/logger/logger-format.c +++ /dev/null @@ -1,288 +0,0 @@ - -/* Automatically Generated - Do Not Edit */ - -#include -#include "loggerp.h" -#include - -int -LoggerFormatMessage (int eventId, char *buf, unsigned int len, const char *var_S, const char *var_T, unsigned int var_1, unsigned int var_2, void *var_D, int var_X) -{ - struct in_addr x; - - switch (eventId) { - case 0x00020001 : - x.s_addr = var_1; - return snprintf (buf, len, "%08x: Bad password \"%s\" for account \"%s\" from %s", eventId, "REMOVED", var_S, inet_ntoa(x)); - case 0x00020002 : - x.s_addr = var_1; - return snprintf (buf, len, "%08x: Unhandled request \"%s\" for account \"%s\" from %s", eventId, var_T, var_S, inet_ntoa(x)); - case 0x00020003 : - x.s_addr = var_1; - return snprintf (buf, len, "%08x: Valid login for account \"%s\" from %s", eventId, var_S, inet_ntoa(x)); - case 0x00020004 : - x.s_addr = var_1; - return snprintf (buf, len, "%08x: %d failed logins for account \"%s\" from %s", eventId, var_2, var_S, inet_ntoa(x)); - case 0x00020005 : - x.s_addr = var_1; - return snprintf (buf, len, "%08x: Feature disabled for account \"%s\" from %s", eventId, var_S, inet_ntoa(x)); - case 0x00020006 : - x.s_addr = var_1; - return snprintf (buf, len, "%08x: Account \"%s\" does not exist; attempt from %s with password \"%s\"", eventId, var_S, inet_ntoa(x), "REMOVED"); - case 0x00020007 : - x.s_addr = var_1; - return snprintf (buf, len, "%08x: Could not connect to NMAP server %s (code:%d)", eventId, inet_ntoa(x), var_2); - case 0x00020008 : - return snprintf (buf, len, "%08x: Could not allocated %d bytes (file:%s line:%d)", eventId, var_1, var_S, var_2); - case 0x00020009 : - return snprintf (buf, len, "%08x: Component not configured: %s", eventId, var_S); - case 0x0002000A : - return snprintf (buf, len, "%08x: Session limit (%d) reached", eventId, var_1); - case 0x0002000B : - x.s_addr = var_1; - return snprintf (buf, len, "%08x: User \"%s\" at %s changed password; result:%d", eventId, var_S, inet_ntoa(x), var_2); - case 0x0002000C : - x.s_addr = var_1; - return snprintf (buf, len, "%08x: User \"%s\" at %s changed secret Q/A (Old question: %s)", eventId, var_S, inet_ntoa(x), var_T); - case 0x0002000D : - x.s_addr = var_1; - return snprintf (buf, len, "%08x: User \"%s\" created from address %s using \"%s\"; assigned \"%s\" as the password.", eventId, var_S, inet_ntoa(x), var_T, "REMOVED"); - case 0x0002000E : - x.s_addr = var_1; - return snprintf (buf, len, "%08x: User \"%s\" disabled from %s", eventId, var_S, inet_ntoa(x)); - case 0x0002000F : - return snprintf (buf, len, "%08x: Memory allocated by file %s on line %d for %d bytes was not freed", eventId, var_S, var_1, var_2); - case 0x00020010 : - return snprintf (buf, len, "%08x: Null pointer used as destination by file %s on line %d", eventId, var_S, var_1); - case 0x00020011 : - return snprintf (buf, len, "%08x: Memory allocated by file %s on line %d overflowed", eventId, var_S, var_1); - case 0x00020012 : - return snprintf (buf, len, "%08x: Memory allocated by file %s on line %d was freed by file %s on line %d", eventId, var_S, var_1, var_T, var_2); - case 0x00020013 : - return snprintf (buf, len, "%08x: Memory allocated by file %s on line %d was questionably freed", eventId, var_S, var_1); - case 0x00020014 : - return snprintf (buf, len, "%08x: Questionable allocation requested by file %s on line %d for %d bytes", eventId, var_S, var_1, var_2); - case 0x00020015 : - x.s_addr = var_1; - return snprintf (buf, len, "%08x: Received message from \"%s\", size %d (IP:%s)", eventId, var_S, var_2, inet_ntoa(x)); - case 0x00020016 : - return snprintf (buf, len, "%08x: Delivered message for \"%s\" to \"%s\", size %d; status %d", eventId, var_S, var_T, var_1, var_2); - case 0x00020017 : - x.s_addr = var_1; - return snprintf (buf, len, "%08x: Blocked connection from %s, reason %d (detail: %s)", eventId, inet_ntoa(x), var_2, var_S); - case 0x00020018 : - x.s_addr = var_1; - return snprintf (buf, len, "%08x: Blocked relay for recipient \"%s\" from address %s", eventId, var_S, inet_ntoa(x)); - case 0x00020019 : - x.s_addr = var_1; - return snprintf (buf, len, "%08x: Relayed message for \"%s\" to recipient \"%s\" from address %s", eventId, var_S, var_T, inet_ntoa(x)); - case 0x0002001A : - x.s_addr = var_1; - return snprintf (buf, len, "%08x: Blocked relay for \"%s\" to recipient \"%s\" from address %s", eventId, var_S, var_T, inet_ntoa(x)); - case 0x0002001B : - x.s_addr = var_1; - return snprintf (buf, len, "%08x: New connection from address %s", eventId, inet_ntoa(x)); - case 0x0002001C : - x.s_addr = var_1; - return snprintf (buf, len, "%08x: Registered NMAP Server %s for queue %d with SSL %s", eventId, inet_ntoa(x), var_2, var_S); - case 0x0002001D : - return snprintf (buf, len, "%08x: Failed to restart the anti-virus engine \"%s\"", eventId, var_S); - case 0x0002001E : - return snprintf (buf, len, "%08x: Have duplicate alias: user: \"%s\", alias: \"%s\"", eventId, var_S, var_T); - case 0x0002001F : - return snprintf (buf, len, "%08x: Open database \"%s\" returned %d", eventId, var_S, var_1); - case 0x00020020 : - return snprintf (buf, len, "%08x: Enumerating context \"%s\"", eventId, var_T); - case 0x00020021 : - x.s_addr = var_1; - return snprintf (buf, len, "%08x: Received bounce from \"%s\" at %s, auth from \"%s\"", eventId, var_S, inet_ntoa(x), var_T); - case 0x00020022 : - x.s_addr = var_1; - return snprintf (buf, len, "%08x: Blocked spam from \"%s\" at %s", eventId, var_S, inet_ntoa(x)); - case 0x00020023 : - return snprintf (buf, len, "%08x: Blocked virus %s from \"%s\" to \"%s\"", eventId, var_T, (char*)var_D, var_S); - case 0x00020024 : - return snprintf (buf, len, "%08x: Forwarding for \"%s\" to \"%s\"", eventId, var_S, var_T); - case 0x00020025 : - return snprintf (buf, len, "%08x: Auto reply for \"%s\" to \"%s\"", eventId, var_S, var_T); - case 0x00020026 : - x.s_addr = var_1; - return snprintf (buf, len, "%08x: Received control request from \"%s\" at %s; auth from \"%s\"", eventId, var_S, inet_ntoa(x), var_T); - case 0x00020027 : - x.s_addr = var_1; - return snprintf (buf, len, "%08x: Processing error on request from \"%s\" at %s, queue ID: %s", eventId, var_S, inet_ntoa(x), var_T); - case 0x00020028 : - return snprintf (buf, len, "%08x: Blocked send by \"%s\" to \"%s\" reason %d", eventId, var_T, var_S, var_1); - case 0x00020029 : - return snprintf (buf, len, "%08x: Configuration for \"%s\": \"%s\"", eventId, var_S, var_T); - case 0x0002002A : - return snprintf (buf, len, "%08x: Configuration for \"%s\": %d", eventId, var_S, var_1); - case 0x0002002B : - return snprintf (buf, len, "%08x: Not enough memory; tuning parameters adjusted; concurrent limit: %d, sequential limit: %d", eventId, var_1, var_2); - case 0x0002002C : - x.s_addr = var_1; - return snprintf (buf, len, "%08x: New SSL connection from address %s", eventId, inet_ntoa(x)); - case 0x0002002D : - return snprintf (buf, len, "%08x: Message for list \"%s\" received from \"%s\"", eventId, var_S, var_T); - case 0x0002002E : - return snprintf (buf, len, "%08x: Message from list \"%s\" for user \"%s\" delivered", eventId, var_S, var_T); - case 0x0002002F : - x.s_addr = var_1; - return snprintf (buf, len, "%08x: Reloaded Queue Agent %s:%d for queue %d", eventId, inet_ntoa(x), *((int*)var_D), var_2); - case 0x00020030 : - return snprintf (buf, len, "%08x: Queue %d, entry \"%s\" from \"%s\"; auth from \"%s\"", eventId, var_1, var_S, var_T, (char*)var_D); - case 0x00020031 : - return snprintf (buf, len, "%08x: User \"%s\" quota of %d exceeds allotment of %d, message returned to \"%s\"", eventId, var_S, var_1, var_2, var_T); - case 0x00020032 : - return snprintf (buf, len, "%08x: \"%s\" \"%s\" %d %d", eventId, var_S, var_T, var_1, var_2); - case 0x00020033 : - x.s_addr = var_1; - return snprintf (buf, len, "%08x: Wrong system auth from IP Address %s", eventId, inet_ntoa(x)); - case 0x00020034 : - x.s_addr = var_1; - return snprintf (buf, len, "%08x: Denied attempt to switch from user \"%s\" to user \"%s\" from IP Address %s", eventId, var_S, var_T, inet_ntoa(x)); - case 0x00020035 : - x.s_addr = var_1; - return snprintf (buf, len, "%08x: Wrong auth user \"%s\" from IP Address %s", eventId, var_S, inet_ntoa(x)); - case 0x00020036 : - return snprintf (buf, len, "%08x: Diskspace low for path \"%s\"; currently %d free blocks, minimum %d free blocks required", eventId, var_S, var_1, var_2); - case 0x00020037 : - return snprintf (buf, len, "%08x: Could not write to \"%s\" for user \"%s\"; line %d from %d", eventId, var_S, var_T, var_1, var_2); - case 0x00020038 : - x.s_addr = var_1; - return snprintf (buf, len, "%08x: Adding Queue Agent %s:%d for queue %d", eventId, inet_ntoa(x), *((int*)var_D), var_2); - case 0x00020039 : - return snprintf (buf, len, "%08x: Hostname \"%s\" is unusable, specified by user \"%s\"", eventId, var_S, var_T); - case 0x0002003A : - x.s_addr = var_1; - return snprintf (buf, len, "%08x: User \"%s\" attempted to proxy %s (the localhost)", eventId, var_S, inet_ntoa(x)); - case 0x0002003B : - return snprintf (buf, len, "%08x: User \"%s\" received NMAP error %d (detail: %s)", eventId, var_S, var_1, var_T); - case 0x0002003C : - return snprintf (buf, len, "%08x: DDB initialization failed (detail: %s)", eventId, var_S); - case 0x0002003D : - return snprintf (buf, len, "%08x: Hostname \"%s\" is not allowed, specified by user \"%s\"", eventId, var_S, var_T); - case 0x0002003E : - return snprintf (buf, len, "%08x: User \"%s\" executing rule \"%s\"", eventId, var_S, var_T); - case 0x0002003F : - return snprintf (buf, len, "%08x: Removing recipient \"%s\"", eventId, var_S); - case 0x00020040 : - return snprintf (buf, len, "%08x: Forwarding from \"%s\" to \"%s\"", eventId, var_S, var_T); - case 0x00020041 : - return snprintf (buf, len, "%08x: Copy from \"%s\"", eventId, var_S); - case 0x00020042 : - return snprintf (buf, len, "%08x: Moving into mailbox \"%s:%s\"", eventId, var_S, var_T); - case 0x00020043 : - x.s_addr = var_1; - return snprintf (buf, len, "%08x: Removed Queue Agent %s:%d, queue %d; agent re-registered", eventId, inet_ntoa(x), *((int*)var_D), var_2); - case 0x00020044 : - x.s_addr = var_1; - return snprintf (buf, len, "%08x: Removed Queue Agent %s:%d, queue %d", eventId, inet_ntoa(x), *((int*)var_D), var_2); - case 0x00020045 : - return snprintf (buf, len, "%08x: Find \"%s\" returned %d", eventId, var_S, var_1); - case 0x00020046 : - return snprintf (buf, len, "%08x: Insert \"%s\" with alias \"%s\" returned %d", eventId, var_S, var_T, var_1); - case 0x00020047 : - return snprintf (buf, len, "%08x: Close database \"%s\" returned %d", eventId, var_S, var_1); - case 0x00020048 : - return snprintf (buf, len, "%08x: Storing item from \"%s\" for \"%s\" with size of %d; location %s", eventId, var_T, var_S, var_1, (char*)var_D); - case 0x00020049 : - return snprintf (buf, len, "%08x: Insert \"%s\" into database returned %d", eventId, var_S, var_1); - case 0x0002004A : - return snprintf (buf, len, "%08x: Create database \"%s\" returned %d", eventId, var_S, var_1); - case 0x0002004B : - return snprintf (buf, len, "%08x: Processing queue %d entry \"%d\"", eventId, var_1, var_2); - case 0x0002004C : - x.s_addr = var_2; - return snprintf (buf, len, "%08x: Recipient \"%s\" was not found for queue %d from \"%s\" at IP Address %s", eventId, var_S, var_1, var_T, inet_ntoa(x)); - case 0x0002004D : - return snprintf (buf, len, "%08x: Sending queue %d entry \"%s\" via NMAP link to %d for \"%s\"", eventId, var_1, var_S, var_2, var_T); - case 0x0002004E : - return snprintf (buf, len, "%08x: Failed to delivery for queue %d, entry \"%s\"; status %d", eventId, var_1, var_S, var_2); - case 0x0002004F : - x.s_addr = var_2; - return snprintf (buf, len, "%08x: Queue %d entry \"%s\" failed to connect to %s:%d", eventId, var_1, var_S, inet_ntoa(x), *((int*)var_D)); - case 0x00020050 : - x.s_addr = var_1; - return snprintf (buf, len, "%08x: Queue agent %s:%d failed to process queue %d entry \"%s\"", eventId, inet_ntoa(x), *((int*)var_D), var_2, var_S); - case 0x00020051 : - return snprintf (buf, len, "%08x: Missing strings.txt for language %d", eventId, var_1); - case 0x00020052 : - return snprintf (buf, len, "%08x: \"%s\" is missing strings; found %d, expected %d", eventId, var_S, var_1, var_2); - case 0x00020053 : - return snprintf (buf, len, "%08x: Sent digest for list \"%s\"", eventId, var_S); - case 0x00020054 : - return snprintf (buf, len, "%08x: Unable to create a socket; file \"%s\", line %d", eventId, var_S, var_1); - case 0x00020055 : - x.s_addr = var_1; - return snprintf (buf, len, "%08x: Unable to connect to the Symantec CarrierScan host at %s", eventId, inet_ntoa(x)); - case 0x00020056 : - return snprintf (buf, len, "%08x: User \"%s\" has an illegal e-mail address of \"%s\"", eventId, var_S, var_T); - case 0x00020057 : - return snprintf (buf, len, "%08x: Open strings file for language %d returned %s", eventId, var_1, var_S); - case 0x00020058 : - return snprintf (buf, len, "%08x: Delivery retry needed for \"%s\" to \"%s\", size %d; status %d", eventId, var_S, var_T, var_1, var_2); - case 0x00020059 : - return snprintf (buf, len, "%08x: Delivery failed for \"%s\" to \"%s\", size %d; st", eventId, var_S, var_T, var_1); - case 0x0002005A : - return snprintf (buf, len, "%08x: Memory allocated by file %s on line %d will overflow due to write from %s on line %d; attempted to write %d bytes", eventId, var_S, var_1, var_T, var_2, *((int*)var_D)); - case 0x0002005B : - return snprintf (buf, len, "%08x: Null pointer used as source by file %s on line %d", eventId, var_S, var_1); - case 0x0002005C : - x.s_addr = var_1; - return snprintf (buf, len, "%08x: IP Address %s blocked due to message from \"%s\" with %d recipients", eventId, inet_ntoa(x), var_S, var_2); - case 0x0002005D : - return snprintf (buf, len, "%08x: accept() failed with error %d; SSL connection state %d", eventId, var_1, var_2); - case 0x0002005E : - return snprintf (buf, len, "%08x: Index file \"%s\" for user \"%s\", index %d, is invalid", eventId, var_T, var_S, var_1); - case 0x0002005F : - return snprintf (buf, len, "%08x: NMAP failed to allocate %d bytes for user \"%s\", mailbox \"%s\"; unloading", eventId, var_1, var_S, var_T); - case 0x00020060 : - return snprintf (buf, len, "%08x: File %s failed to open on line %d", eventId, var_S, var_1); - case 0x00020061 : - return snprintf (buf, len, "%08x: %s set errno %d on line %d", eventId, var_S, var_2, var_1); - case 0x00020062 : - x.s_addr = var_1; - return snprintf (buf, len, "%08x: Address %s timed out, connection was alive for %d seconds", eventId, inet_ntoa(x), var_2); - case 0x00020063 : - x.s_addr = var_1; - return snprintf (buf, len, "%08x: Connection error from %s, connection was alive for %d seconds", eventId, inet_ntoa(x), var_2); - case 0x00020064 : - return snprintf (buf, len, "%08x: Unable to lock queue entry %d; lock table full", eventId, var_1); - case 0x00020065 : - return snprintf (buf, len, "%08x: Agent heartbeat.", eventId); - case 0x00020066 : - return snprintf (buf, len, "%08x: Mailbox file \"%s\" for user \"%s\", Message %d, is invalid", eventId, var_T, var_S, var_1); - case 0x00020067 : - return snprintf (buf, len, "%08x: Proxy heartbeat.", eventId); - case 0x00020068 : - x.s_addr = var_1; - return snprintf (buf, len, "%08x: DNS resolved %s to your server (%s). ", eventId, var_S, inet_ntoa(x)); - case 0x00020069 : - x.s_addr = var_1; - return snprintf (buf, len, "%08x: DNS resolved %s to your server (%s). Configure Bongo to accept mail for this domain or change the DNS record.", eventId, var_S, inet_ntoa(x)); - case 0x0002006A : - x.s_addr = var_1; - return snprintf (buf, len, "%08x: Message from %s had %d unknown users.", eventId, inet_ntoa(x), var_2); - case 0x0002006B : - x.s_addr = var_1; - return snprintf (buf, len, "%08x: Attempt to connect to %s (%s) failed! Reason: %s", eventId, inet_ntoa(x), var_T, var_S); - case 0x0002006C : - return snprintf (buf, len, "%08x: SMTP server returned greeting %d %s Recipient: %s", eventId, var_1, var_S, var_T); - case 0x0002006D : - x.s_addr = var_1; - return snprintf (buf, len, "%08x: Protocol negotiation with %s (%s) failed! Reason: %s", eventId, inet_ntoa(x), var_S, var_T); - case 0x0002006E : - x.s_addr = var_1; - return snprintf (buf, len, "%08x: Network communication with %s (%s) failed! Reason: %s", eventId, inet_ntoa(x), var_S, var_T); - case 0x0002006F : - return snprintf (buf, len, "%08x: Proxied %d messages for \"%s\" from \"%s\"; %d KiloBytes", eventId, var_1, var_S, var_T, var_2); - case 0x00020070 : - return snprintf (buf, len, "%08x: Server Shutting Down: state=%d errno=%d", eventId, var_1, var_2); - case 0x00020071 : - return snprintf (buf, len, "%08x: Could not drop to unprivileged user '%s'", eventId, var_S); - case 0x00020072 : - return snprintf (buf, len, "%08x: Could not bind to %sport %d", eventId, var_S, var_1); - } -return -1; -} diff --git a/src/libs/logger/logger-format.pl b/src/libs/logger/logger-format.pl deleted file mode 100755 index 5ca84ad..0000000 --- a/src/libs/logger/logger-format.pl +++ /dev/null @@ -1,129 +0,0 @@ -#!/usr/bin/perl - -# Converts lsc file to a C source file with the proper definitions -# -# usage: -# -# cat foo.lsc | ./logger-format.pl > logger-format.c -# - - -print << 'EOF'; - -/* Automatically Generated - Do Not Edit */ - -#include -#include "loggerp.h" -#include - -int -LoggerFormatMessage (int eventId, char *buf, unsigned int len, const char *var_S, const char *var_T, unsigned int var_1, unsigned int var_2, void *var_D, int var_X) -{ - struct in_addr x; - - switch (eventId) { -EOF - -while (<>) { - chomp; - - if (/^\#/) { - next; - } - - if ($_ eq "") { - next; - } - - @pieces = split /\,/, $_, 13; - - $formatstr = ""; - $args = ""; - - $formatstr = $pieces[12]; - chomp $formatstr; - if ($formatstr eq "") { - next; - } - $formatstr =~ s/\[\$TC] \$SO\: *//; - $formatstr =~ s/\\n\"$/\"/; - - $extracode = ""; - $xset = ""; - - while ($formatstr =~ /\$(.)(.)/) { - $varname = "var_$2"; - - if ($1 eq "N") { - if ($2 ne "1" && $2 ne "2" && $2 ne "D") { - print STDERR "unsupported formatter/type pair: $1$2 in $formatstr\n"; - exit (1); - } - if ($2 eq "D") { - $varname = "*((int*)var_D)"; - } - $formatstr =~ s/\$(.)(.)/\%d/; - } elsif ($1 eq "D") { - $formatstr =~ s/\$(.)(.)/%d/; - } elsif ($1 eq "T" || $1 eq "D" || $1 eq "R") { - print STDERR "unsupported formatter $1 in $formatstr\n"; - exit (1); - } elsif ($1 eq "S") { - if ($2 ne "S" && $2 ne "T" && $2 ne "D") { - print STDERR "unsupported formatter/type pair: $1$2 in $formatstr\n"; - exit (1); - } - if ($2 eq "D") { - $varname = "(char*)var_D"; - } - - $formatstr =~ s/\$(.)(.)/\%s/; - } elsif ($1 eq "X") { - if ($2 ne "1" && $2 ne "2" && $2 ne "I") { - print STDERR "unsupported formatter/type pair: $1$2 in $formatstr\n"; - exit (1); - } - $formatstr =~ s/\$(.)(.)/\%08x/; - $varname = "eventId"; - } elsif ($1 eq "I" || $1 eq "i") { - if ($1 eq "I") { - $xset = " x.s_addr = ntohl($varname);\n"; - } else { - $xset = " x.s_addr = $varname;\n"; - } - $varname = "inet_ntoa(x)"; - - $formatstr =~ s/\$(.)(.)/\%s/; - } elsif ($1 eq "P") { - $varname = "\"REMOVED\""; - $formatstr =~ s/\$(.)(.)/\%s/; - } else { - if ($2 eq "D") { - $varname = "(char*)var_D"; - } - - $formatstr =~ s/\$(.)(.)/\%s/; - } - $args = $args . ", $varname"; - } - - -# C - Platform Agent Date -# A - Audit Service Date -# 1 - Numerical value 1 -# 2 - Numerical value 2 -# S - Text 1 -# T - Text 2 -# O - Component -# I - Event ID -# L - Log Level -# M - MIME Hint -# X - Data Size -# D - Data - - - print " case 0x$pieces[0] :\n$xset"; - print " return snprintf (buf, len, $formatstr$args);\n"; -} - -print " }\nreturn -1;\n}\n"; diff --git a/src/libs/logger/logger-syslog.c b/src/libs/logger/logger-syslog.c deleted file mode 100644 index cbf3125..0000000 --- a/src/libs/logger/logger-syslog.c +++ /dev/null @@ -1,90 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2001 Novell, Inc. All Rights Reserved. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public License - * as published by the Free Software Foundation. - * - * 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, contact Novell, Inc. - * - * To contact Novell about this file by physical or electronic mail, you - * may find current contact information at www.novell.com. - * - ****************************************************************************/ - -#include -#include "loggerp.h" - -#ifdef HAVE_SYSLOG_H - -#include -#include - -#ifndef LOG_AUTHPRIV -#define LOG_AUTHPRIV LOG_AUTH -#endif - -static LoggingHandle * -SyslogOpen(const char *name) -{ - openlog(name, LOG_PID, LOG_DAEMON); - return (LoggingHandle*)1; -} - -static void -SyslogClose(LoggingHandle *handle) -{ - closelog(); -} - -static void -SyslogEvent (LoggingHandle *loggingHandle, const char *subsystem, unsigned long eventId, int level, int unknown /*fixme*/, const char *str1, const char *str2, int i1, int i2, void *p, int size) -{ - char buf[1024]; - unsigned n; - - n = LoggerFormatMessage(eventId, buf, sizeof (buf), str1, str2, i1, i2, p, size); - - if (n < sizeof (buf) && n > 0) { - int facility = 0; - - if (!strcmp(subsystem, LOGGER_SUBSYSTEM_AUTH)) { - facility = LOG_AUTHPRIV; - } else if (!strcmp(subsystem, LOGGER_SUBSYSTEM_MAIL)) { - facility = LOG_MAIL; - } - - syslog(level | facility, "%s", buf); - } -} - -static const Log syslogLog = { - SyslogOpen, - SyslogClose, - SyslogEvent, -}; - -const Log * -LoggerGetSyslog (void) -{ - return &syslogLog; -} - -#else /* no syslog.h, stub out syslog */ - -const Log * -LoggerGetSyslog (void) -{ - return NULL; -} -#endif - - - diff --git a/src/libs/logger/logger.c b/src/libs/logger/logger.c deleted file mode 100644 index aaa59ac..0000000 --- a/src/libs/logger/logger.c +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2001 Novell, Inc. All Rights Reserved. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public License - * as published by the Free Software Foundation. - * - * 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, contact Novell, Inc. - * - * To contact Novell about this file by physical or electronic mail, you - * may find current contact information at www.novell.com. - * - ****************************************************************************/ - -#include -#include "loggerp.h" -/* Prototypes */ - -EXPORT void -LoggerEvent(LoggingHandle *handle, const char *subsystem, unsigned long eventId, int level, int flags, const char *str1, const char *str2, int i1, int i2, void *p, int size) -{ - char buf[1024]; - unsigned int n; - - n = LoggerFormatMessage(eventId, buf, sizeof(buf), str1, str2, i1, i2, p, size); - - if (n < sizeof(buf) && n > 0) { - LogMsg(subsystem, eventId, level, "%s", buf); - } -} - -EXPORT void -LoggerClose(LoggingHandle *handle) -{ - log4c_fini(); -} - -EXPORT LoggingHandle * -LoggerOpen(const char *name) -{ - char bongo_log_file[XPL_MAX_PATH]; - - if (log4c_init() == -1) { - // log4c couldn't find a file itself, let's default to etc/bongo/logs.conf - snprintf(bongo_log_file, XPL_MAX_PATH, "%s/logs.conf", XPL_DEFAULT_CONF_DIR); - if (log4c_load(bongo_log_file) == -1) { - XplConsolePrintf("ERROR: Unable to find log config %s\n", bongo_log_file); - } - } - - return (LoggingHandle*)1; -} diff --git a/src/libs/logger/loggerp.h b/src/libs/logger/loggerp.h deleted file mode 100644 index 706c701..0000000 --- a/src/libs/logger/loggerp.h +++ /dev/null @@ -1,33 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2001 Novell, Inc. All Rights Reserved. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public License - * as published by the Free Software Foundation. - * - * 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, contact Novell, Inc. - * - * To contact Novell about this file by physical or electronic mail, you - * may find current contact information at www.novell.com. - * - ****************************************************************************/ - -#ifndef LOGGERP_H -#define LOGGERP_H - -#include -#include -#include - -/* Prototypes */ - -int LoggerFormatMessage (int eventId, char *buf, unsigned int len, const char *var_S, const char *var_T, unsigned int var_1, unsigned int var_2, void *var_D, int var_X); - -#endif /* LOGGERP_H */ diff --git a/src/libs/logger/logs.conf b/src/libs/logger/logs.conf deleted file mode 100644 index 8dc6a04..0000000 --- a/src/libs/logger/logs.conf +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - 0 - - 0 - 1 - - - - - - - - - diff --git a/src/libs/logging/CMakeLists.txt b/src/libs/logging/CMakeLists.txt new file mode 100644 index 0000000..04a202a --- /dev/null +++ b/src/libs/logging/CMakeLists.txt @@ -0,0 +1,5 @@ +add_library(bongologging SHARED + logging.c + ) + +install(TARGETS bongologging DESTINATION ${LIB_INSTALL_DIR}) diff --git a/src/libs/logging/logging.c b/src/libs/logging/logging.c new file mode 100644 index 0000000..d526d01 --- /dev/null +++ b/src/libs/logging/logging.c @@ -0,0 +1,40 @@ +#include +#include + +const int syslog_mapping[] = { + LOG_DEBUG, // UNKNOWN + LOG_DEBUG, // NOTSET + LOG_DEBUG, // TRACE + LOG_DEBUG, // DEBUG + LOG_INFO, // INFO + LOG_NOTICE, // NOTICE + LOG_WARNING, // WARNING + LOG_ERR, // ERROR + LOG_CRIT, // CRITICAL + LOG_ALERT, // ALERT + LOG_EMERG // FATAL +}; + +void +Log(int level, char *message, ...) +{ + va_list args; + + if ((level>10) || (level<0)) return; + + va_start(args, message); + vsyslog(syslog_mapping[level], message, args); + va_end(args); +} + +void +LogOpen(const char *agentname) +{ + openlog(agentname, LOG_NDELAY, LOG_MAIL); +} + +void +LogClose() +{ + closelog(); +} diff --git a/src/libs/management/Bongo.rules b/src/libs/management/Bongo.rules deleted file mode 100644 index d0f20b8..0000000 --- a/src/libs/management/Bongo.rules +++ /dev/null @@ -1,12 +0,0 @@ -# -*- Makefile -*- -lib_LTLIBRARIES += libbongomanagement.la - -#libbongomanagement_la_LDFLAGS = -static -libbongomanagement_la_SOURCES = \ - src/libs/management/bongomanagee.c \ - src/libs/management/managee.c - -libbongomanagement_la_LIBADD = libbongoutil.la libbongo-json.la - -src/libs/management/all: libbongomanagement.la -src/libs/management/clean: clean diff --git a/src/libs/management/Makefile.am b/src/libs/management/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/libs/management/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/libs/mdb-file/Bongo.rules b/src/libs/mdb-file/Bongo.rules deleted file mode 100644 index 06d8218..0000000 --- a/src/libs/mdb-file/Bongo.rules +++ /dev/null @@ -1,19 +0,0 @@ -# -*- Makefile -*- -mdb_LTLIBRARIES += libmdbfile.la - -libmdbfile_la_SOURCES := \ - src/libs/mdb-file/mdbfile.c \ - src/libs/mdb-file/mdbfilep.h - -libmdbfile_la_CPPFLAGS := $(AM_CPPFLAGS) \ - -DLOCALSTATEDIR=\""$(localstatedir)"\" \ - -DMDB_INTERNAL - -libmdbfile_la_LDFLAGS := -module -avoid-version -libmdbfile_la_LIBADD := \ - libbongoutil.la \ - libbongomemmgr.la \ - libbongoxpl.la - -src/libs/mdb-file/all: libmdbfile.la -src/libs/mdb-file/clean: clean diff --git a/src/libs/mdb-file/Makefile.am b/src/libs/mdb-file/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/libs/mdb-file/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/libs/mdb-xldap/Bongo.rules b/src/libs/mdb-xldap/Bongo.rules deleted file mode 100644 index 9c96159..0000000 --- a/src/libs/mdb-xldap/Bongo.rules +++ /dev/null @@ -1,33 +0,0 @@ -# -*- Makefile -*- -if HAVE_LDAP -mdb_LTLIBRARIES += libmdbldap.la -endif - -libmdbldap_la_SOURCES := \ - src/libs/mdb-xldap/valarray.c \ - src/libs/mdb-xldap/schema.c \ - src/libs/mdb-xldap/mdbldap.c \ - src/libs/mdb-xldap/mdbldapp.h - -libmdbldap_la_CPPFLAGS := $(AM_CPPFLAGS) \ - -DLOCALSTATEDIR=\""$(localstatedir)"\" \ - -DMDB_INTERNAL - -libmdbldap_la_LDFLAGS = -module -avoid-version -libmdbldap_la_LIBADD := \ - $(LDAP_LIBS) \ - libbongoutil.la \ - libbongoxpl.la \ - libbongomemmgr.la \ - libbongostreamio.la \ - $(top_builddir)/import/log4c/log4c/libbongolog4c.la - -if HAVE_LDAP -src/libs/mdb-xldap/all: libmdbldap.la -src/libs/mdb-xldap/install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) mdb_LTLIBRARIES=libmdbldap.la install-mdbLTLIBRARIES -else -src/libs/mdb-xldap/all: -src/libs/mdb-xldap/install: -endif -src/libs/mdb-xldap/clean: clean diff --git a/src/libs/mdb-xldap/Makefile.am b/src/libs/mdb-xldap/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/libs/mdb-xldap/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/libs/mdb/Bongo.rules b/src/libs/mdb/Bongo.rules deleted file mode 100644 index b58f2d5..0000000 --- a/src/libs/mdb/Bongo.rules +++ /dev/null @@ -1,21 +0,0 @@ -# -*- Makefile -*- -mdbdir = $(libdir)/bongomdb -mdb_LTLIBRARIES := - -lib_LTLIBRARIES += libbongomdb.la - -libbongomdb_la_SOURCES := \ - src/libs/mdb/mdb.c \ - src/libs/mdb/mdbp.h - -libbongomdb_la_CPPFLAGS := $(AM_CPPFLAGS) \ - -DDRIVER_EXTENSION=\"$(SHARED_POSTFIX)\" \ - -DSYSCONF_DIR=\""$(sysconfdir)"\" \ - -DDRIVER_DIR=\""$(libdir)/bongomdb"\" - -libbongomdb_la_LIBADD := \ - libbongoxpl.la \ - $(DL_LIBS) - -src/libs/mdb/all: libbongomdb.la -src/libs/mdb/clean: clean diff --git a/src/libs/mdb/Makefile.am b/src/libs/mdb/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/libs/mdb/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/libs/memmgr/Bongo.rules b/src/libs/memmgr/Bongo.rules deleted file mode 100644 index 96e4504..0000000 --- a/src/libs/memmgr/Bongo.rules +++ /dev/null @@ -1,12 +0,0 @@ -# -*- Makefile -*- -lib_LTLIBRARIES += libbongomemmgr.la - -libbongomemmgr_la_SOURCES = \ - src/libs/memmgr/memmgr.c \ - src/libs/memmgr/memmgrp.h \ - src/libs/memmgr/memstack.c - -libbongomemmgr_la_LIBADD = libbongoxpl.la - -src/libs/memmgr/all: libbongomemmgr.la -src/libs/memmgr/clean: clean diff --git a/src/libs/memmgr/CMakeLists.txt b/src/libs/memmgr/CMakeLists.txt new file mode 100644 index 0000000..4583376 --- /dev/null +++ b/src/libs/memmgr/CMakeLists.txt @@ -0,0 +1,11 @@ +add_library(bongomemmgr SHARED + allocator.c + pools.c + memstack.c +) + +target_link_libraries(bongomemmgr + ${GLIB2_LIBRARIES} +) + +install(TARGETS bongomemmgr DESTINATION ${LIB_INSTALL_DIR}) diff --git a/src/libs/memmgr/Makefile.am b/src/libs/memmgr/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/libs/memmgr/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/libs/memmgr/allocator.c b/src/libs/memmgr/allocator.c new file mode 100644 index 0000000..dfda20e --- /dev/null +++ b/src/libs/memmgr/allocator.c @@ -0,0 +1,60 @@ +// memory allocation routines. + +#include +#include +#include + +EXPORT void * +MemMallocDirect(size_t Size, const char *SourceFile, unsigned long SourceLine) +{ + return g_malloc(Size); +} + +EXPORT void * +MemMalloc0Direct(size_t size, const char *sourceFile, unsigned long sourceLine) +{ + return g_malloc0(size); +} + +EXPORT void * +MemReallocDirect(void *Source, size_t Size, const char *SourceFile, unsigned long SourceLine) +{ + return g_realloc(Source, Size); +} + +EXPORT char * +MemStrdupDirect(const char *StrSource, const char *SourceFile, unsigned long SourceLine) +{ + return MemStrndupDirect(StrSource, strlen(StrSource), SourceFile, SourceLine); +} + +EXPORT char * +MemStrndupDirect(const char *StrSource, int n, const char *SourceFile, unsigned long SourceLine) +{ + char *new; + + new = MemMallocDirect(n + 1, SourceFile, SourceLine); + memcpy(new, StrSource, n); + new[n] = '\0'; + + return new; +} + +EXPORT void +MemFreeDirect(void *Source, const char *SourceFile, unsigned long SourceLine) +{ + g_free(Source); +} + +EXPORT void +MemFreeDirectCallback(void *Source) +{ + // this is used when we need a free()-like API to pass to other functions, + // for example Hashtable. + MemFreeDirect(Source, "unknown.c", 0); + return; +} + +#if defined(MEMMGR_DEBUG) + +#endif diff --git a/src/libs/memmgr/memmgr.c b/src/libs/memmgr/memmgr.c index 25da590..e69de29 100644 --- a/src/libs/memmgr/memmgr.c +++ b/src/libs/memmgr/memmgr.c @@ -1,2690 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2001 Novell, Inc. All Rights Reserved. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public License - * as published by the Free Software Foundation. - * - * 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, contact Novell, Inc. - * - * To contact Novell about this file by physical or electronic mail, you - * may find current contact information at www.novell.com. - * - ****************************************************************************/ - -#define PRODUCT_NAME "Bongo Memory Manager" -#define PRODUCT_VERSION "$Revision: 1.3 $" - -#include -#include -#include -#include -#include - -#if !defined(LIBC) - -#define PLATFORM_ALLOC_POOL(pool, s) malloc((s)) -#define PLATFORM_ALLOC_PRIVATE(pool, s) malloc((s)) -#define PLATFORM_ALLOC_EXTREME(s) malloc((s)) -#define PLATFORM_ALLOC(s) malloc((s)) -#define PLATFORM_ALLOC_FREE(p) free((p)) - -#else - -#include - -#define PLATFORM_ALLOC_POOL(pool, s) AllocSleepOK((s), (pool).resourceTag, NULL) -#define PLATFORM_ALLOC_PRIVATE(pool, s) AllocSleepOK((s), (pool)->resourceTag, NULL) -#define PLATFORM_ALLOC_EXTREME(s) AllocSleepOK((s), MemManager.control.poolExtreme.resourceTag, NULL) -#define PLATFORM_ALLOC(s) AllocSleepOK((s), MemManager.nlm.resourceTag, NULL) -#define PLATFORM_ALLOC_FREE(p) free((p)) - -#endif - -#include "memmgrp.h" - -typedef enum _MemPoolStates { - LIBRARY_LOADED = 0, - LIBRARY_INITIALIZING, - LIBRARY_RUNNING, - LIBRARY_SHUTTING_DOWN, - LIBRARY_SHUTDOWN, - - LIBRARY_MAX_STATES -} MemManagerStates; - -struct { - MemManagerStates state; - - unsigned long flags; - - struct { - XplThreadID group; - XplThreadID main; - } id; - - time_t startTime; - - struct { - XplSemaphore pools; - XplSemaphore shutdown; - } sem; - - XplAtomic useCount; - - struct { - MemPoolControl pool128; - MemPoolControl pool256; - MemPoolControl pool512; - MemPoolControl pool1KB; - MemPoolControl pool2KB; - MemPoolControl pool4KB; - MemPoolControl pool8KB; - MemPoolControl pool16KB; - MemPoolControl pool32KB; - MemPoolControl pool64KB; - MemPoolControl pool128KB; - MemPoolControl pool256KB; - MemPoolControl pool512KB; - MemPoolControl pool1MB; - MemPoolControl pool2MB; - MemPoolControl pool4MB; - MemPoolControl poolExtreme; - - MemPoolControl *poolPrivate; - } control; - - unsigned char *agentName; - -#if defined(LIBC) - struct { - void *handle; - rtag_t resourceTag; - } nlm; -#endif -} MemManager; - -#define PUSH_NON_EXTREME_FREE_ENTRY(pool, entry) \ - { \ - (entry)->flags &= ~PENTRY_FLAG_INUSE; \ - XplWaitOnLocalSemaphore((pool)->sem); \ - if ((entry)->next != NULL) { \ - (entry)->next->previous = (entry)->previous; \ - } \ - if ((entry)->previous != NULL) { \ - (entry)->previous->next = (entry)->next; \ - } else { \ - (pool)->inUse = (entry)->next; \ - } \ - (entry)->previous = NULL; \ - if (((entry)->next = (pool)->free) != NULL) { \ - (entry)->next->previous = (entry); \ - } \ - (pool)->free = (entry); \ - XplSignalLocalSemaphore((pool)->sem); \ - } - -#define PUSH_EXTREME_FREE_ENTRY(entry, eNext) \ - { \ - (entry)->flags &= ~PENTRY_FLAG_INUSE; \ - XplWaitOnLocalSemaphore(MemManager.control.poolExtreme.sem); \ - if ((entry)->next != NULL) { \ - (entry)->next->previous = (entry)->previous; \ - } \ - if ((entry)->previous != NULL) { \ - (entry)->previous->next = (entry)->next; \ - } else { \ - MemManager.control.poolExtreme.inUse = (entry)->next; \ - } \ - if (((eNext) = MemManager.control.poolExtreme.free) != NULL) { \ - do { \ - if ((entry)->allocSize < (eNext)->allocSize) { \ - if (((entry)->previous = (eNext)->previous) != NULL) {\ - (entry)->previous->next = (entry); \ - } else { \ - MemManager.control.poolExtreme.free = (entry); \ - } \ - (entry)->next = (eNext); \ - (eNext)->previous = (entry); \ - } else if ((eNext)->next != NULL) { \ - (eNext) = (eNext)->next; \ - continue; \ - } else { \ - (eNext)->next = (entry); \ - (entry)->previous = (eNext); \ - (entry)->next = NULL; \ - } \ - break; \ - } while (TRUE); \ - } else { \ - (entry)->previous = NULL; \ - (entry)->next = NULL; \ - MemManager.control.poolExtreme.free = (entry); \ - } \ - XplSignalLocalSemaphore(MemManager.control.poolExtreme.sem); \ - } - -#define PULL_INTERNAL_FREE_ENTRY(pool, entry, count) \ - { \ - XplWaitOnLocalSemaphore((pool).sem); \ - (pool).stats.pitches++; \ - if ((pool).free != NULL) { \ - (entry) = (pool).free; \ - if (((pool).free = (entry)->next) != NULL) { \ - (pool).free->previous = NULL; \ - } \ - (entry)->previous = NULL; \ - if (((entry)->next = (pool).inUse) != NULL) { \ - (entry)->next->previous = (entry); \ - } \ - (pool).inUse = (entry); \ - XplSignalLocalSemaphore((pool).sem); \ - (entry)->size = (count); \ - (entry)->flags |= PENTRY_FLAG_INUSE; \ - } else { \ - (pool).stats.strikes++; \ - XplSignalLocalSemaphore((pool).sem); \ - { register XplThreadID threadID; \ - threadID = XplSetThreadGroupID(MemManager.id.group); \ - (entry) = (MemPoolEntry *)PLATFORM_ALLOC_POOL((pool), \ - (pool).allocSize + ALIGN_SIZE(sizeof(MemPoolEntry), ALIGNMENT)); \ - XplSetThreadGroupID(threadID); \ - } \ - if ((entry) != NULL) { \ - (entry)->control = &(pool); \ - (entry)->flags = (pool).defaultFlags; \ - (entry)->allocSize = (pool).allocSize; \ - (entry)->suffix[0] = 0; \ - (entry)->suffix[1] = 0; \ - (entry)->suffix[2] = 0; \ - (entry)->suffix[3] = 0; \ - (entry)->previous = NULL; \ - (entry)->size = (count); \ - (entry)->flags |= PENTRY_FLAG_INUSE; \ - XplWaitOnLocalSemaphore((pool).sem); \ - (pool).eCount.allocated++; \ - if ((pool).eCount.allocated < (pool).eCount.maximum) { \ - ; \ - } else { \ - (entry)->flags |= PENTRY_FLAG_NON_POOLABLE; \ - } \ - (entry)->previous = NULL; \ - if (((entry)->next = (pool).inUse) != NULL) { \ - (entry)->next->previous = (entry); \ - } \ - (pool).inUse = (entry); \ - XplSignalLocalSemaphore((pool).sem); \ - } \ - } \ - } - -#define PULL_PRIVATE_FREE_ENTRY(pool, entry) \ - { \ - XplWaitOnLocalSemaphore((pool)->sem); \ - (pool)->stats.pitches++; \ - if ((pool)->free != NULL) { \ - (entry) = (pool)->free; \ - if (((pool)->free = (entry)->next) != NULL) { \ - (pool)->free->previous = NULL; \ - } \ - (entry)->previous = NULL; \ - if (((entry)->next = (pool)->inUse) != NULL) { \ - (entry)->next->previous = (entry); \ - } \ - (pool)->inUse = (entry); \ - XplSignalLocalSemaphore((pool)->sem); \ - (entry)->flags |= PENTRY_FLAG_INUSE; \ - } else { \ - (pool)->stats.strikes++; \ - XplSignalLocalSemaphore((pool)->sem); \ - { register XplThreadID threadID; \ - threadID = XplSetThreadGroupID(MemManager.id.group); \ - (entry) = (MemPoolEntry *)PLATFORM_ALLOC_PRIVATE((pool), \ - (pool)->allocSize + ALIGN_SIZE(sizeof(MemPoolEntry), ALIGNMENT));\ - XplSetThreadGroupID(threadID); \ - } \ - if ((entry) != NULL) { \ - (entry)->control = (pool); \ - (entry)->flags = (pool)->defaultFlags; \ - (entry)->allocSize = (pool)->allocSize; \ - (entry)->suffix[0] = 0; \ - (entry)->suffix[1] = 0; \ - (entry)->suffix[2] = 0; \ - (entry)->suffix[3] = 0; \ - (entry)->previous = NULL; \ - if ((pool)->allocCB != NULL) { \ - if (((pool)->allocCB)((entry)->suffix, \ - (pool)->clientData)) { \ - ; \ - } else { \ - PLATFORM_ALLOC_FREE((entry)); \ - (entry) = NULL; \ - } \ - } \ - } \ - if ((entry) != NULL) { \ - XplWaitOnLocalSemaphore((pool)->sem); \ - (pool)->eCount.allocated++; \ - if ((pool)->eCount.allocated < (pool)->eCount.maximum) { \ - ; \ - } else { \ - (entry)->flags |= PENTRY_FLAG_NON_POOLABLE; \ - } \ - (entry)->previous = NULL; \ - if (((entry)->next = (pool)->inUse) != NULL) { \ - (entry)->next->previous = (entry); \ - } \ - (pool)->inUse = (entry); \ - XplSignalLocalSemaphore((pool)->sem); \ - (entry)->size = (pool)->allocSize; \ - (entry)->flags |= PENTRY_FLAG_INUSE; \ - } \ - } \ - } - -#define PULL_EXTREME_FREE_ENTRY(entry, count) \ - { \ - XplWaitOnLocalSemaphore(MemManager.control.poolExtreme.sem); \ - MemManager.control.poolExtreme.stats.pitches++; \ - (entry) = MemManager.control.poolExtreme.free; \ - while ((entry) != NULL) { \ - if ((count) <= (entry)->allocSize) { \ - break; \ - } \ - (entry) = (entry)->next; \ - } \ - if ((entry) != NULL) { \ - if ((entry)->next != NULL) { \ - (entry)->next->previous = (entry)->previous; \ - } \ - if ((entry)->previous != NULL) { \ - (entry)->previous->next = (entry)->next; \ - } else { \ - MemManager.control.poolExtreme.free = (entry)->next; \ - } \ - (entry)->previous = NULL; \ - if (((entry)->next = MemManager.control.poolExtreme.inUse) != NULL) { \ - (entry)->next->previous = (entry); \ - } \ - MemManager.control.poolExtreme.inUse = (entry); \ - XplSignalLocalSemaphore(MemManager.control.poolExtreme.sem); \ - (entry)->size = (count); \ - (entry)->flags |= PENTRY_FLAG_INUSE; \ - } else { \ - MemManager.control.poolExtreme.stats.strikes++; \ - XplSignalLocalSemaphore(MemManager.control.poolExtreme.sem); \ - { register XplThreadID threadID; \ - threadID = XplSetThreadGroupID(MemManager.id.group); \ - (entry) = (MemPoolEntry *)PLATFORM_ALLOC_EXTREME((count) + ALIGN_SIZE(sizeof(MemPoolEntry), ALIGNMENT)); \ - XplSetThreadGroupID(threadID); \ - } \ - if ((entry) != NULL) { \ - (entry)->control = &MemManager.control.poolExtreme; \ - (entry)->flags = MemManager.control.poolExtreme.defaultFlags; \ - (entry)->allocSize = ALIGN_SIZE(count, ALIGNMENT); \ - (entry)->suffix[0] = 0; \ - (entry)->suffix[1] = 0; \ - (entry)->suffix[2] = 0; \ - (entry)->suffix[3] = 0; \ - (entry)->previous = NULL; \ - XplWaitOnLocalSemaphore(MemManager.control.poolExtreme.sem); \ - MemManager.control.poolExtreme.eCount.allocated++; \ - if (MemManager.control.poolExtreme.eCount.allocated < MemManager.control.poolExtreme.eCount.maximum) { \ - ; \ - } else { \ - (entry)->flags |= PENTRY_FLAG_NON_POOLABLE; \ - } \ - (entry)->previous = NULL; \ - if (((entry)->next = MemManager.control.poolExtreme.inUse) != NULL) { \ - (entry)->next->previous = (entry); \ - } \ - MemManager.control.poolExtreme.inUse = (entry); \ - XplSignalLocalSemaphore(MemManager.control.poolExtreme.sem); \ - (entry)->size = (count); \ - (entry)->flags |= PENTRY_FLAG_INUSE; \ - } \ - } \ - } - -EXPORT void * -MemCallocDirect(size_t Number, size_t Size) -{ -#if _BONGO_SYSTEM_MALLOC - if (Size == 0) { - return calloc(1, 1); - } else { - return calloc(Number, Size); - } -#else - register MemPoolEntry *pEntry; - register unsigned int size = Number * Size; - - if (size < 128) { - { - XplWaitOnLocalSemaphore((MemManager.control.pool128).sem); - (MemManager.control.pool128).stats.pitches++; - if ((MemManager.control.pool128).free != NULL) { - (pEntry) = (MemManager.control.pool128).free; - if (((MemManager.control.pool128).free = (pEntry)->next) != NULL) { - (MemManager.control.pool128).free->previous = NULL; - } - (pEntry)->previous = NULL; - if (((pEntry)->next = (MemManager.control.pool128).inUse) != NULL) { - (pEntry)->next->previous = (pEntry); - } - (MemManager.control.pool128).inUse = (pEntry); - XplSignalLocalSemaphore((MemManager.control.pool128).sem); - (pEntry)->size = (size); - (pEntry)->flags |= PENTRY_FLAG_INUSE; - } else { - (MemManager.control.pool128).stats.strikes++; - XplSignalLocalSemaphore((MemManager.control.pool128).sem); - { register XplThreadID threadID; - threadID = XplSetThreadGroupID(MemManager.id.group); - (pEntry) = (MemPoolEntry *)PLATFORM_ALLOC_POOL((MemManager.control.pool128), - (MemManager.control.pool128).allocSize + ALIGN_SIZE(sizeof(MemPoolEntry), ALIGNMENT)); - XplSetThreadGroupID(threadID); - } - if ((pEntry) != NULL) { - (pEntry)->control = &(MemManager.control.pool128); - (pEntry)->flags = (MemManager.control.pool128).defaultFlags; - (pEntry)->allocSize = (MemManager.control.pool128).allocSize; - (pEntry)->suffix[0] = 0; - (pEntry)->suffix[1] = 0; - (pEntry)->suffix[2] = 0; - (pEntry)->suffix[3] = 0; - (pEntry)->previous = NULL; - (pEntry)->size = (size); - (pEntry)->flags |= PENTRY_FLAG_INUSE; - XplWaitOnLocalSemaphore((MemManager.control.pool128).sem); - (MemManager.control.pool128).eCount.allocated++; - if ((MemManager.control.pool128).eCount.allocated < (MemManager.control.pool128).eCount.maximum) { - ; - } else { - (pEntry)->flags |= PENTRY_FLAG_NON_POOLABLE; - } - (pEntry)->previous = NULL; - if (((pEntry)->next = (MemManager.control.pool128).inUse) != NULL) { - (pEntry)->next->previous = (pEntry); - } - (MemManager.control.pool128).inUse = (pEntry); - XplSignalLocalSemaphore((MemManager.control.pool128).sem); - } - } - } - } else if (size < 256) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool256, pEntry, size); - } else if (size < 512) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool512, pEntry, size); - } else if (size < 1024) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool1KB, pEntry, size); - } else if (size < (2 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool2KB, pEntry, size); - } else if (size < (4 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool4KB, pEntry, size); - } else if (size < (8 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool8KB, pEntry, size); - } else if (size < (16 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool16KB, pEntry, size); - } else if (size < (32 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool32KB, pEntry, size); - } else if (size < (64 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool64KB, pEntry, size); - } else if (size < (128 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool128KB, pEntry, size); - } else if (size < (256 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool256KB, pEntry, size); - } else if (size < (512 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool512KB, pEntry, size); - } else if (size < (1024 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool1MB, pEntry, size); - } else if (size < (2 * 1024 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool2MB, pEntry, size); - } else if (size < (4 * 1024 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool4MB, pEntry, size); - } else { - PULL_EXTREME_FREE_ENTRY(pEntry, size); - } - - if (pEntry != NULL) { - memset(pEntry->suffix, 0, size); - return(pEntry->suffix); - } - - return(NULL); -#endif -} - -EXPORT void * -MemCallocDebugDirect(size_t Number, size_t Size, const char *SourceFile, unsigned long SourceLine) -{ -#if _BONGO_SYSTEM_MALLOC - if (Size == 0) { - return calloc(1, 1); - } else { - return calloc(Number, Size); - } -#else - register MemPoolEntry *pEntry; - register unsigned int size = Number * Size; - - if (size < 128) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool128, pEntry, size); - } else if (size < 256) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool256, pEntry, size); - } else if (size < 512) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool512, pEntry, size); - } else if (size < 1024) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool1KB, pEntry, size); - } else if (size < (2 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool2KB, pEntry, size); - } else if (size < (4 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool4KB, pEntry, size); - } else if (size < (8 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool8KB, pEntry, size); - } else if (size < (16 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool16KB, pEntry, size); - } else if (size < (32 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool32KB, pEntry, size); - } else if (size < (64 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool64KB, pEntry, size); - } else if (size < (128 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool128KB, pEntry, size); - } else if (size < (256 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool256KB, pEntry, size); - } else if (size < (512 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool512KB, pEntry, size); - } else if (size < (1024 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool1MB, pEntry, size); - } else if (size < (2 * 1024 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool2MB, pEntry, size); - } else if (size < (4 * 1024 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool4MB, pEntry, size); - } else { - PULL_EXTREME_FREE_ENTRY(pEntry, size); - } - - if (pEntry != NULL) { - if (SourceFile != NULL) { - strncpy(pEntry->source.file, SourceFile, sizeof(pEntry->source.file)); - pEntry->source.line = SourceLine; - } else { - strcpy(pEntry->source.file, "UNKNOWN"); - pEntry->source.line = 0; - } - - memset(pEntry->suffix, 0, size); - return(pEntry->suffix); - } - - return(NULL); -#endif -} - -EXPORT void * -MemMallocDirect(size_t Size) -{ -#if _BONGO_SYSTEM_MALLOC - if (Size == 0) { - return malloc(1); - } else { - return malloc(Size); - } -#else - register MemPoolEntry *pEntry; - - if (Size < 128) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool128, pEntry, Size); - } else if (Size < 256) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool256, pEntry, Size); - } else if (Size < 512) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool512, pEntry, Size); - } else if (Size < 1024) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool1KB, pEntry, Size); - } else if (Size < (2 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool2KB, pEntry, Size); - } else if (Size < (4 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool4KB, pEntry, Size); - } else if (Size < (8 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool8KB, pEntry, Size); - } else if (Size < (16 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool16KB, pEntry, Size); - } else if (Size < (32 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool32KB, pEntry, Size); - } else if (Size < (64 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool64KB, pEntry, Size); - } else if (Size < (128 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool128KB, pEntry, Size); - } else if (Size < (256 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool256KB, pEntry, Size); - } else if (Size < (512 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool512KB, pEntry, Size); - } else if (Size < (1024 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool1MB, pEntry, Size); - } else if (Size < (2 * 1024 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool2MB, pEntry, Size); - } else if (Size < (4 * 1024 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool4MB, pEntry, Size); - } else { - PULL_EXTREME_FREE_ENTRY(pEntry, Size); - } - - if (pEntry != NULL) { - return(pEntry->suffix); - } - - return(NULL); -#endif -} - -EXPORT void * -MemMallocDebugDirect(size_t Size, const char *SourceFile, unsigned long SourceLine) -{ -#if _BONGO_SYSTEM_MALLOC - if (Size == 0) { - return malloc(1); - } else { - return malloc(Size); - } -#else - register MemPoolEntry *pEntry; - - if (Size < 128) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool128, pEntry, Size); - } else if (Size < 256) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool256, pEntry, Size); - } else if (Size < 512) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool512, pEntry, Size); - } else if (Size < 1024) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool1KB, pEntry, Size); - } else if (Size < (2 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool2KB, pEntry, Size); - } else if (Size < (4 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool4KB, pEntry, Size); - } else if (Size < (8 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool8KB, pEntry, Size); - } else if (Size < (16 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool16KB, pEntry, Size); - } else if (Size < (32 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool32KB, pEntry, Size); - } else if (Size < (64 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool64KB, pEntry, Size); - } else if (Size < (128 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool128KB, pEntry, Size); - } else if (Size < (256 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool256KB, pEntry, Size); - } else if (Size < (512 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool512KB, pEntry, Size); - } else if (Size < (1024 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool1MB, pEntry, Size); - } else if (Size < (2 * 1024 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool2MB, pEntry, Size); - } else if (Size < (4 * 1024 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool4MB, pEntry, Size); - } else { - PULL_EXTREME_FREE_ENTRY(pEntry, Size); - } - - if (pEntry != NULL) { - if (SourceFile != NULL) { - strncpy(pEntry->source.file, SourceFile, sizeof(pEntry->source.file)); - pEntry->source.line = SourceLine; - } else { - strcpy(pEntry->source.file, "UNKNOWN"); - pEntry->source.line = 0; - } - - return(pEntry->suffix); - } - - return(NULL); -#endif -} - -EXPORT void * -MemMalloc0Direct(size_t size) -{ -#if _BONGO_SYSTEM_MALLOC - if (size == 0) { - return calloc(1, 1); - } else { - return calloc(size, 1); - } -#else - void *ret = MemMallocDirect(size); - if (ret) { - memset(ret, 0, size); - } - return ret; -#endif -} - - -EXPORT void * -MemMalloc0DebugDirect(size_t size, const char *sourceFile, unsigned long line) -{ -#if _BONGO_SYSTEM_MALLOC - if (size == 0) { - return calloc(1, 1); - } else { - return calloc(size, 1); - } -#else - void *ret = MemMallocDebugDirect(size, sourceFile, line); - if (ret) { - memset(ret, 0, size); - } - return ret; -#endif -} - - -EXPORT void * -MemReallocDirect(void *Source, size_t Size) -{ -#if _BONGO_SYSTEM_MALLOC - if (Size == 0) { - return realloc(Source, 1); - } else { - return realloc(Source, Size); - } -#else - register MemPoolEntry *pEntryOld; - register MemPoolEntry *pEntryNew; - - if (Source != NULL) { - pEntryOld = (MemPoolEntry *)((unsigned char *)Source - SUFFIX_OFFSET); - - if (!(pEntryOld->flags & PENTRY_FLAG_PRIVATE_ENTRY)) { - if (Size < pEntryOld->allocSize) { - pEntryOld->size = Size; - return(pEntryOld->suffix); - } - } else { - /* Private pool entries are fixed sizes and therefore cannot be - reallocated to a different size. */ - return(NULL); - } - } else { - pEntryOld = NULL; - } - - if (Size < 128) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool128, pEntryNew, Size); - } else if (Size < 256) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool256, pEntryNew, Size); - } else if (Size < 512) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool512, pEntryNew, Size); - } else if (Size < 1024) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool1KB, pEntryNew, Size); - } else if (Size < (2 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool2KB, pEntryNew, Size); - } else if (Size < (4 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool4KB, pEntryNew, Size); - } else if (Size < (8 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool8KB, pEntryNew, Size); - } else if (Size < (16 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool16KB, pEntryNew, Size); - } else if (Size < (32 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool32KB, pEntryNew, Size); - } else if (Size < (64 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool64KB, pEntryNew, Size); - } else if (Size < (128 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool128KB, pEntryNew, Size); - } else if (Size < (256 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool256KB, pEntryNew, Size); - } else if (Size < (512 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool512KB, pEntryNew, Size); - } else if (Size < (1024 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool1MB, pEntryNew, Size); - } else if (Size < (2 * 1024 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool2MB, pEntryNew, Size); - } else if (Size < (4 * 1024 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool4MB, pEntryNew, Size); - } else { - PULL_EXTREME_FREE_ENTRY(pEntryNew, Size); - } - - if (pEntryNew != NULL) { - if (pEntryOld != NULL) { - memcpy(pEntryNew->suffix, pEntryOld->suffix, pEntryOld->size); - - if (!(pEntryOld->flags & (PENTRY_FLAG_NON_POOLABLE | PENTRY_FLAG_EXTREME_ENTRY))) { - PUSH_NON_EXTREME_FREE_ENTRY(pEntryOld->control, pEntryOld); - } else { - XplWaitOnLocalSemaphore(pEntryOld->control->sem); - - if (pEntryOld->next != NULL) { - pEntryOld->next->previous = pEntryOld->previous; - } - - if (pEntryOld->previous != NULL) { - pEntryOld->previous->next = pEntryOld->next; - } else { - pEntryOld->control->inUse = pEntryOld->next; - } - - pEntryOld->control->eCount.allocated--; - - XplSignalLocalSemaphore(pEntryOld->control->sem); - - { register XplThreadID threadID = XplSetThreadGroupID(MemManager.id.group); - PLATFORM_ALLOC_FREE(pEntryOld); - XplSetThreadGroupID(threadID); - } - } - } - - return(pEntryNew->suffix); - } - - return(NULL); -#endif -} - -EXPORT void * -MemReallocDebugDirect(void *Source, size_t Size, const char *SourceFile, unsigned long SourceLine) -{ -#if _BONGO_SYSTEM_MALLOC - if (Size == 0) { - return realloc(Source, 1); - } else { - return realloc(Source, Size); - } -#else - register MemPoolEntry *pEntryOld; - register MemPoolEntry *pEntryNew; - - if (Source != NULL) { - pEntryOld = (MemPoolEntry *)((unsigned char *)Source - SUFFIX_OFFSET); - - if (!(pEntryOld->flags & PENTRY_FLAG_PRIVATE_ENTRY)) { - if (SourceFile != NULL) { - strncpy(pEntryOld->source.file, SourceFile, sizeof(pEntryOld->source.file)); - pEntryOld->source.line = SourceLine; - } else { - strcpy(pEntryOld->source.file, "UNKNOWN"); - pEntryOld->source.line = 0; - } - - if (Size < pEntryOld->allocSize) { - pEntryOld->size = Size; - return(pEntryOld->suffix); - } - } else { - /* Private pool entries are fixed sizes and therefore cannot be - reallocated to a different size. */ - return(NULL); - } - } else { - pEntryOld = NULL; - } - - if (Size < 128) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool128, pEntryNew, Size); - } else if (Size < 256) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool256, pEntryNew, Size); - } else if (Size < 512) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool512, pEntryNew, Size); - } else if (Size < 1024) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool1KB, pEntryNew, Size); - } else if (Size < (2 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool2KB, pEntryNew, Size); - } else if (Size < (4 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool4KB, pEntryNew, Size); - } else if (Size < (8 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool8KB, pEntryNew, Size); - } else if (Size < (16 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool16KB, pEntryNew, Size); - } else if (Size < (32 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool32KB, pEntryNew, Size); - } else if (Size < (64 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool64KB, pEntryNew, Size); - } else if (Size < (128 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool128KB, pEntryNew, Size); - } else if (Size < (256 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool256KB, pEntryNew, Size); - } else if (Size < (512 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool512KB, pEntryNew, Size); - } else if (Size < (1024 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool1MB, pEntryNew, Size); - } else if (Size < (2 * 1024 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool2MB, pEntryNew, Size); - } else if (Size < (4 * 1024 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool4MB, pEntryNew, Size); - } else { - PULL_EXTREME_FREE_ENTRY(pEntryNew, Size); - } - - if (pEntryNew != NULL) { - if (pEntryOld != NULL) { - memcpy(pEntryNew->suffix, pEntryOld->suffix, pEntryOld->size); - - if (!(pEntryOld->flags & (PENTRY_FLAG_NON_POOLABLE | PENTRY_FLAG_EXTREME_ENTRY))) { - if (SourceFile != NULL) { - strncpy(pEntryOld->source.file, SourceFile, sizeof(pEntryOld->source.file)); - pEntryOld->source.line = SourceLine; - } else { - strcpy(pEntryOld->source.file, "UNKNOWN"); - pEntryOld->source.line = 0; - } - - PUSH_NON_EXTREME_FREE_ENTRY(pEntryOld->control, pEntryOld); - } else { - XplWaitOnLocalSemaphore(pEntryOld->control->sem); - - if (pEntryOld->next != NULL) { - pEntryOld->next->previous = pEntryOld->previous; - } - - if (pEntryOld->previous != NULL) { - pEntryOld->previous->next = pEntryOld->next; - } else { - pEntryOld->control->inUse = pEntryOld->next; - } - - pEntryOld->control->eCount.allocated--; - - XplSignalLocalSemaphore(pEntryOld->control->sem); - - { register XplThreadID threadID = XplSetThreadGroupID(MemManager.id.group); - PLATFORM_ALLOC_FREE(pEntryOld); - XplSetThreadGroupID(threadID); - } - } - } - - if (SourceFile != NULL) { - strncpy(pEntryNew->source.file, SourceFile, sizeof(pEntryNew->source.file)); - pEntryNew->source.line = SourceLine; - } else { - strcpy(pEntryNew->source.file, "UNKNOWN"); - pEntryNew->source.line = 0; - } - - return(pEntryNew->suffix); - } - - return(NULL); -#endif -} - -EXPORT void * -MemClear(void *Source, size_t Size) -{ - unsigned char *src = Source; - unsigned char value = '\0'; - - while (Size-- != 0) { - *src++ = value; - } - return Source; -} - -EXPORT void -MemFreeDirect(void *Source) -{ -#if _BONGO_SYSTEM_MALLOC - free(Source); -#else - register MemPoolEntry *pEntry; - - if (Source != NULL) { - pEntry = (MemPoolEntry *)((unsigned char *)Source - SUFFIX_OFFSET); - - if (pEntry->flags & PENTRY_FLAG_INUSE) { - if (!(pEntry->flags & (PENTRY_FLAG_NON_POOLABLE | PENTRY_FLAG_EXTREME_ENTRY))) { - PUSH_NON_EXTREME_FREE_ENTRY(pEntry->control, pEntry); - } else { - XplWaitOnLocalSemaphore(pEntry->control->sem); - - if (pEntry->next != NULL) { - pEntry->next->previous = pEntry->previous; - } - - if (pEntry->previous != NULL) { - pEntry->previous->next = pEntry->next; - } else { - pEntry->control->inUse = pEntry->next; - } - - pEntry->control->eCount.allocated--; - - XplSignalLocalSemaphore(pEntry->control->sem); - - { register XplThreadID threadID = XplSetThreadGroupID(MemManager.id.group); - PLATFORM_ALLOC_FREE(pEntry); - XplSetThreadGroupID(threadID); - } - } - } - } - - return; -#endif -} - -EXPORT void -MemFreeDebugDirect(void *Source, const char *SourceFile, unsigned long SourceLine) -{ -#if _BONGO_SYSTEM_MALLOC - free(Source); -#else - register MemPoolEntry *pEntry; - - if (Source != NULL) { - pEntry = (MemPoolEntry *)((unsigned char *)Source - SUFFIX_OFFSET); - - if (pEntry->flags & PENTRY_FLAG_INUSE) { - if (!(pEntry->flags & (PENTRY_FLAG_NON_POOLABLE | PENTRY_FLAG_EXTREME_ENTRY))) { - if (SourceFile != NULL) { - strncpy(pEntry->source.file, SourceFile, sizeof(pEntry->source.file)); - pEntry->source.line = SourceLine; - } else { - strcpy(pEntry->source.file, "UNKNOWN"); - pEntry->source.line = 0; - } - - PUSH_NON_EXTREME_FREE_ENTRY(pEntry->control, pEntry); - } else { - XplWaitOnLocalSemaphore(pEntry->control->sem); - - if (pEntry->next != NULL) { - pEntry->next->previous = pEntry->previous; - } - - if (pEntry->previous != NULL) { - pEntry->previous->next = pEntry->next; - } else { - pEntry->control->inUse = pEntry->next; - } - - pEntry->control->eCount.allocated--; - - XplSignalLocalSemaphore(pEntry->control->sem); - - { register XplThreadID threadID = XplSetThreadGroupID(MemManager.id.group); - PLATFORM_ALLOC_FREE(pEntry); - XplSetThreadGroupID(threadID); - } - } - } else { - XplConsolePrintf("MemMGR: free'd allocation free'd again by %s [%lu]; originally free'd by %s [%lu].\r\n", SourceFile, SourceLine, pEntry->source.file, pEntry->source.line); - } - } - - return; -#endif -} - -EXPORT char * -MemStrCatDirect(const char *stra, const char *strb) -{ - int len; - char *ret; - - if (stra == NULL) { - stra = ""; - } - - len = strlen(stra) + strlen(strb); - ret = MemMallocDirect(len + 1); - if (!ret) { - return NULL; - } - - strcpy(ret, stra); - strcpy(ret + strlen(stra), strb); - - return ret; -} - -EXPORT char * -MemStrCatDebugDirect(const char *stra, const char *strb, const char *sourceFile, unsigned long sourceLine) -{ - int len; - char *ret; - - if (stra == NULL) { - stra = ""; - } - - len = strlen(stra) + strlen(strb); - ret = MemMallocDebugDirect(len + 1, sourceFile, sourceLine); - if (!ret) { - return NULL; - } - - strcpy(ret, stra); - strcpy(ret + strlen(stra), strb); - - return ret; -} - -EXPORT char * -MemStrdupDirect(const char *StrSource) -{ -#if _BONGO_SYSTEM_MALLOC - if (StrSource) { - return strdup(StrSource); - } else { - return NULL; - } -#else - register MemPoolEntry *pEntry; - register unsigned int size; - - if (StrSource != NULL) { - size = strlen(StrSource) + 1; - - if (size < 128) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool128, pEntry, size); - } else if (size < 256) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool256, pEntry, size); - } else if (size < 512) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool512, pEntry, size); - } else if (size < 1024) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool1KB, pEntry, size); - } else if (size < (2 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool2KB, pEntry, size); - } else if (size < (4 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool4KB, pEntry, size); - } else if (size < (8 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool8KB, pEntry, size); - } else if (size < (16 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool16KB, pEntry, size); - } else if (size < (32 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool32KB, pEntry, size); - } else if (size < (64 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool64KB, pEntry, size); - } else if (size < (128 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool128KB, pEntry, size); - } else if (size < (256 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool256KB, pEntry, size); - } else if (size < (512 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool512KB, pEntry, size); - } else if (size < (1024 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool1MB, pEntry, size); - } else if (size < (2 * 1024 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool2MB, pEntry, size); - } else if (size < (4 * 1024 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool4MB, pEntry, size); - } else { - PULL_EXTREME_FREE_ENTRY(pEntry, size); - } - - if (pEntry != NULL) { - memcpy(pEntry->suffix, StrSource, size); - return(pEntry->suffix); - } - } - - return(NULL); -#endif -} - -EXPORT char * -MemStrndupDirect(const char *StrSource, int n) -{ -#if _BONGO_SYSTEM_MALLOC - char *mem = malloc(n); - if (mem) { - strncpy(mem, StrSource, n); - return mem; - } else { - return NULL; - } -#else - register MemPoolEntry *pEntry; - register unsigned int size = n + 1; - - if (StrSource != NULL) { - if (size < 128) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool128, pEntry, size); - } else if (size < 256) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool256, pEntry, size); - } else if (size < 512) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool512, pEntry, size); - } else if (size < 1024) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool1KB, pEntry, size); - } else if (size < (2 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool2KB, pEntry, size); - } else if (size < (4 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool4KB, pEntry, size); - } else if (size < (8 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool8KB, pEntry, size); - } else if (size < (16 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool16KB, pEntry, size); - } else if (size < (32 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool32KB, pEntry, size); - } else if (size < (64 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool64KB, pEntry, size); - } else if (size < (128 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool128KB, pEntry, size); - } else if (size < (256 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool256KB, pEntry, size); - } else if (size < (512 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool512KB, pEntry, size); - } else if (size < (1024 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool1MB, pEntry, size); - } else if (size < (2 * 1024 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool2MB, pEntry, size); - } else if (size < (4 * 1024 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool4MB, pEntry, size); - } else { - PULL_EXTREME_FREE_ENTRY(pEntry, size); - } - - if (pEntry != NULL) { - memcpy(pEntry->suffix, StrSource, n); - pEntry->suffix[n] = '\0'; - return(pEntry->suffix); - } - } - - return(NULL); -#endif -} - -EXPORT char * -MemStrdupDebugDirect(const char *StrSource, const char *SourceFile, unsigned long SourceLine) -{ -#if _BONGO_SYSTEM_MALLOC - if (StrSource) { - return strdup(StrSource); - } else { - return NULL; - } -#else - register MemPoolEntry *pEntry; - register unsigned int size; - - if (StrSource != NULL) { - size = strlen(StrSource) + 1; - - if (size < 128) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool128, pEntry, size); - } else if (size < 256) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool256, pEntry, size); - } else if (size < 512) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool512, pEntry, size); - } else if (size < 1024) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool1KB, pEntry, size); - } else if (size < (2 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool2KB, pEntry, size); - } else if (size < (4 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool4KB, pEntry, size); - } else if (size < (8 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool8KB, pEntry, size); - } else if (size < (16 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool16KB, pEntry, size); - } else if (size < (32 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool32KB, pEntry, size); - } else if (size < (64 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool64KB, pEntry, size); - } else if (size < (128 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool128KB, pEntry, size); - } else if (size < (256 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool256KB, pEntry, size); - } else if (size < (512 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool512KB, pEntry, size); - } else if (size < (1024 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool1MB, pEntry, size); - } else if (size < (2 * 1024 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool2MB, pEntry, size); - } else if (size < (4 * 1024 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool4MB, pEntry, size); - } else { - PULL_EXTREME_FREE_ENTRY(pEntry, size); - } - - if (pEntry != NULL) { - if (SourceFile != NULL) { - strncpy(pEntry->source.file, SourceFile, sizeof(pEntry->source.file)); - pEntry->source.line = SourceLine; - } else { - strcpy(pEntry->source.file, "UNKNOWN"); - pEntry->source.line = 0; - } - - memcpy(pEntry->suffix, StrSource, size); - return(pEntry->suffix); - } - } - - return(NULL); -#endif -} - -EXPORT char * -MemStrndupDebugDirect(const char *StrSource, int n, const char *SourceFile, unsigned long SourceLine) -{ -#if _BONGO_SYSTEM_MALLOC - return MemStrndupDirect(StrSource, n); -#else - register MemPoolEntry *pEntry; - register unsigned int size = n + 1; - - if (StrSource != NULL) { - if (size < 128) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool128, pEntry, size); - } else if (size < 256) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool256, pEntry, size); - } else if (size < 512) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool512, pEntry, size); - } else if (size < 1024) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool1KB, pEntry, size); - } else if (size < (2 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool2KB, pEntry, size); - } else if (size < (4 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool4KB, pEntry, size); - } else if (size < (8 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool8KB, pEntry, size); - } else if (size < (16 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool16KB, pEntry, size); - } else if (size < (32 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool32KB, pEntry, size); - } else if (size < (64 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool64KB, pEntry, size); - } else if (size < (128 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool128KB, pEntry, size); - } else if (size < (256 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool256KB, pEntry, size); - } else if (size < (512 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool512KB, pEntry, size); - } else if (size < (1024 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool1MB, pEntry, size); - } else if (size < (2 * 1024 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool2MB, pEntry, size); - } else if (size < (4 * 1024 * 1024)) { - PULL_INTERNAL_FREE_ENTRY(MemManager.control.pool4MB, pEntry, size); - } else { - PULL_EXTREME_FREE_ENTRY(pEntry, size); - } - - if (pEntry != NULL) { - if (SourceFile != NULL) { - strncpy(pEntry->source.file, SourceFile, sizeof(pEntry->source.file)); - pEntry->source.line = SourceLine; - } else { - strcpy(pEntry->source.file, "UNKNOWN"); - pEntry->source.line = 0; - } - - memcpy(pEntry->suffix, StrSource, n); - pEntry->suffix[n] = '\0'; - return(pEntry->suffix); - } - } - - return(NULL); -#endif -} - -static BOOL -GetPoolStatistics(MemPoolControl *Pool, MemStatistics **Head, MemStatistics **Previous) -{ - register MemStatistics *next; - register BOOL result = TRUE; - - if (Pool && Head) { - if (Pool->flags & PCONTROL_FLAG_INITIALIZED) { - next = (MemStatistics *)PLATFORM_ALLOC(sizeof(MemStatistics)); - if (next) { - if (*Head) { - next->next = NULL; - next->previous = *Previous; - - (*Previous)->next = next; - } else { - *Head = next; - - next->next = next->previous = NULL; - } - - *Previous = next; - - XplWaitOnLocalSemaphore(Pool->sem); - - next->name = strdup(Pool->name); - - next->totalAlloc.count = Pool->eCount.allocated; - next->totalAlloc.size = Pool->eCount.allocated * Pool->allocSize; - - next->entry.size = Pool->allocSize; - next->entry.minimum = Pool->eCount.minimum; - next->entry.maximum = Pool->eCount.maximum; - next->entry.allocated = Pool->eCount.allocated; - - next->pitches = Pool->stats.pitches; - next->strikes = Pool->stats.strikes; - next->hits = Pool->stats.pitches - Pool->stats.strikes; - - XplSignalLocalSemaphore(Pool->sem); - } else { - result = FALSE; - } - } - } else { - result = FALSE; - } - - return(result); -} - -EXPORT MemStatistics * -MemAllocStatistics(void) -{ - int pool; - BOOL result = TRUE; - MemStatistics *head = NULL; - MemStatistics *next; - MemStatistics *previous = NULL; - MemPoolControl *pControl = NULL; - - for (pool = 0; (pool < 17) && result; pool++) { - switch (pool) { - case 0: { result = GetPoolStatistics(&MemManager.control.pool128, &head, &previous); break; } - case 1: { result = GetPoolStatistics(&MemManager.control.pool256, &head, &previous); break; } - case 2: { result = GetPoolStatistics(&MemManager.control.pool512, &head, &previous); break; } - case 3: { result = GetPoolStatistics(&MemManager.control.pool1KB, &head, &previous); break; } - case 4: { result = GetPoolStatistics(&MemManager.control.pool2KB, &head, &previous); break; } - case 5: { result = GetPoolStatistics(&MemManager.control.pool4KB, &head, &previous); break; } - case 6: { result = GetPoolStatistics(&MemManager.control.pool8KB, &head, &previous); break; } - case 7: { result = GetPoolStatistics(&MemManager.control.pool16KB, &head, &previous); break; } - case 8: { result = GetPoolStatistics(&MemManager.control.pool32KB, &head, &previous); break; } - case 9: { result = GetPoolStatistics(&MemManager.control.pool64KB, &head, &previous); break; } - case 10: { result = GetPoolStatistics(&MemManager.control.pool128KB, &head, &previous); break; } - case 11: { result = GetPoolStatistics(&MemManager.control.pool256KB, &head, &previous); break; } - case 12: { result = GetPoolStatistics(&MemManager.control.pool512KB, &head, &previous); break; } - case 13: { result = GetPoolStatistics(&MemManager.control.pool1MB, &head, &previous); break; } - case 14: { result = GetPoolStatistics(&MemManager.control.pool2MB, &head, &previous); break; } - case 15: { result = GetPoolStatistics(&MemManager.control.pool4MB, &head, &previous); break; } - case 16: { result = GetPoolStatistics(&MemManager.control.poolExtreme, &head, &previous); break; } - } - } - - XplWaitOnLocalSemaphore(MemManager.sem.pools); - - pControl = MemManager.control.poolPrivate; - while ((pControl != NULL) && (result)) { - result = GetPoolStatistics(pControl, &head, &previous); - - pControl = pControl->next; - } - - XplSignalLocalSemaphore(MemManager.sem.pools); - - if (result) { - return(head); - } - - next = head; - while (next != NULL) { - previous = next->next; - - PLATFORM_ALLOC_FREE(next->name); - PLATFORM_ALLOC_FREE(next); - - next = previous; - } - - return(NULL); -} - -EXPORT void -MemFreeStatistics(MemStatistics *Statistics) -{ - MemStatistics *previous; - MemStatistics *next; - - next = Statistics; - while (next != NULL) { - previous = next->next; - - PLATFORM_ALLOC_FREE(next->name); - PLATFORM_ALLOC_FREE(next); - - next = previous; - } - - return; -} - -static void -FillMemoryPool(MemPoolControl *PControl) -{ - int count; - XplThreadID threadID; - MemPoolEntry *pEntry; - MemPoolControl *pool = PControl; - - if (!(pool->flags & PCONTROL_FLAG_INITIALIZED)) { - threadID = XplSetThreadGroupID(MemManager.id.group); - - pool->flags |= PCONTROL_FLAG_INITIALIZED; - - XplOpenLocalSemaphore(pool->sem, 0); - - pool->eCount.allocated = 0; - pool->base.start = NULL; - pool->base.end = NULL; - pool->free = NULL; - pool->inUse = NULL; - -#if defined(LIBC) - pool->ResourceTag = AllocateResourceTag(MMNLMHandle, pool->name, AllocSignature); - if (pool->ResourceTag == NULL) { - XplConsolePrintf("MemMGR: Unable to allocate a resource tag for \"%s\".\r\n", pool->name); - - pool->flags &= ~PCONTROL_FLAG_INITIALIZED; - XplCloseLocalSemaphore(pool->sem); - return; - } -#endif - - if (pool->eCount.minimum && !(pool->defaultFlags & PENTRY_FLAG_EXTREME_ENTRY)) { - count = pool->allocSize + ALIGN_SIZE(sizeof(MemPoolEntry), ALIGNMENT); - -#if 0 - /* Align the base for each pool entry on a 32-bit boundary. */ - if (count % sizeof(unsigned long)) { - count += sizeof(unsigned long) - (count % sizeof(unsigned long)); - } -#endif - - pool->base.start = (MemPoolEntry *)PLATFORM_ALLOC_PRIVATE(pool, pool->eCount.minimum * count); - if (pool->base.start != NULL) { - pool->base.end = (MemPoolEntry *)((unsigned char *)pool->base.start + (pool->eCount.minimum * count)); - - pEntry = pool->free = pool->base.start; - - pEntry->previous = NULL; - - do { - pEntry->control = pool; - - pEntry->allocSize = pool->allocSize; - pEntry->size = 0; - - pEntry->flags = pool->defaultFlags | PENTRY_FLAG_INDIRECT_ALLOC; - - pEntry->suffix[0] = 0; - pEntry->suffix[1] = 0; - pEntry->suffix[2] = 0; - pEntry->suffix[3] = 0; - pEntry->source.line = 0; - pEntry->source.file[0] = '\0'; - - if (pool->allocCB != NULL) { - if ((pool->allocCB)(pEntry->suffix, pool->clientData)) { - pool->eCount.allocated += 1; - } else { - XplConsolePrintf("MemMGR: Allocation call-back failed creating \"%s\".\r\n", pool->name); - - if (pEntry->previous != NULL) { - pEntry->previous->next = NULL; - } - - break; - } - } else { - pool->eCount.allocated += 1; - } - - pEntry->next = (MemPoolEntry *)((unsigned char *)pEntry + count); - - if (pEntry->next < pool->base.end) { - pEntry->next->previous = pEntry; - pEntry = pEntry->next; - continue; - } - - pEntry->next = NULL; - break; - } while (TRUE); - } - } - - XplSetThreadGroupID(threadID); - - XplSignalLocalSemaphore(pool->sem); - } - - return; -} - -/* The MemManager.sem.pools must be held before calling! - The thread group ID must be set to MemManager.id.group before calling! - - If the library hasn't been shutdown properly, we can run into trouble - by not calling the pool owner's freeCB routine. */ -static void -EmptyMemoryPool(MemPoolControl *PControl) -{ - MemPoolEntry *pEntry; - MemPoolEntry *pEntryNext; - - if (PControl->flags & PCONTROL_FLAG_INITIALIZED) { - XplWaitOnLocalSemaphore(PControl->sem); - PControl->flags &= ~PCONTROL_FLAG_INITIALIZED; - - pEntry = PControl->free; - PControl->free = NULL; - - while (pEntry != NULL) { - pEntryNext = pEntry->next; - - if (PControl->freeCB != NULL) { - (PControl->freeCB)(pEntry->suffix, PControl->clientData); - } - - if (!(pEntry->flags & PENTRY_FLAG_INDIRECT_ALLOC)) { - PLATFORM_ALLOC_FREE(pEntry); - } - - pEntry = pEntryNext; - } - - if ((pEntry = PControl->inUse) != NULL) { - PControl->inUse = NULL; - - if (MemManager.flags & MEMMGR_FLAG_REPORT_LEAKS) { - XplConsolePrintf("MemMGR: Leak report for \"%s\"\r\n", PControl->name); - } - - while (pEntry != NULL) { - if (MemManager.flags & MEMMGR_FLAG_REPORT_LEAKS) { - XplConsolePrintf(" %lu octets for \"%s\" on %lu\r\n", pEntry->size, pEntry->source.file, pEntry->source.line); - } - - pEntryNext = pEntry->next; - - if (PControl->freeCB != NULL) { - (PControl->freeCB)(pEntry->suffix, PControl->clientData); - } - - if (!(pEntry->flags & PENTRY_FLAG_INDIRECT_ALLOC)) { - PLATFORM_ALLOC_FREE(pEntry); - } - - pEntry = pEntryNext; - } - } - - PControl->base.end = NULL; - if (PControl->base.start != NULL) { - PLATFORM_ALLOC_FREE(PControl->base.start); - PControl->base.start = NULL; - } - -#if defined(LIBC) - ReturnResourceTag(PControl->ResourceTag, 1); - PControl->ResourceTag = NULL; -#endif - - XplCloseLocalSemaphore(PControl->sem); - } - - return; -} - -static void -MemoryPoolFree (MemPoolControl *pControl) -{ - EmptyMemoryPool(pControl); - - if (pControl->name) { - PLATFORM_ALLOC_FREE(pControl->name); - pControl->name = NULL; - } -} - -static void -MemoryPoolsFree(void) -{ - MemPoolControl *pControlNext; - MemPoolControl *pControl; - XplThreadID threadID; - - threadID = XplSetThreadGroupID(MemManager.id.group); - - XplWaitOnLocalSemaphore(MemManager.sem.pools); - - MemoryPoolFree(&MemManager.control.pool128); - MemoryPoolFree(&MemManager.control.pool256); - MemoryPoolFree(&MemManager.control.pool512); - MemoryPoolFree(&MemManager.control.pool1KB); - MemoryPoolFree(&MemManager.control.pool2KB); - MemoryPoolFree(&MemManager.control.pool4KB); - MemoryPoolFree(&MemManager.control.pool8KB); - MemoryPoolFree(&MemManager.control.pool16KB); - MemoryPoolFree(&MemManager.control.pool32KB); - MemoryPoolFree(&MemManager.control.pool64KB); - MemoryPoolFree(&MemManager.control.pool128KB); - MemoryPoolFree(&MemManager.control.pool256KB); - MemoryPoolFree(&MemManager.control.pool512KB); - MemoryPoolFree(&MemManager.control.pool1MB); - MemoryPoolFree(&MemManager.control.pool2MB); - MemoryPoolFree(&MemManager.control.pool4MB); - MemoryPoolFree(&MemManager.control.poolExtreme); - - - pControl = MemManager.control.poolPrivate; - while (pControl != NULL) { - pControlNext = pControl->next; - - MemoryPoolFree (pControl); - - pControl = pControlNext; - } - - XplSignalLocalSemaphore(MemManager.sem.pools); - - XplSetThreadGroupID(threadID); - - return; -} - -EXPORT BOOL -MemPrivatePoolZeroCallback(void *buffer, void *clientData) -{ - memset(buffer, 0, XPL_PTR_TO_INT(clientData)); - - return TRUE; -} - - -EXPORT void * -MemPrivatePoolAlloc(unsigned char *name, size_t AllocationSize, unsigned int MinAllocCount, unsigned int MaxAllocCount, BOOL Dynamic, BOOL Temporary, PoolEntryCB allocCB, PoolEntryCB freeCB, void *clientData) -{ - unsigned char *identity; - size_t allocSize; - XplThreadID threadID; - MemPoolControl *pool; - - allocSize = ALIGN_SIZE(AllocationSize, ALIGNMENT); - - if (name) { - identity = (unsigned char *)PLATFORM_ALLOC(strlen(MemManager.agentName) + strlen(name) + 2); - - sprintf(identity, "%s:%s", MemManager.agentName, name); - } else { - identity = NULL; - } - - if ((identity != NULL) && (allocSize > 0) && (MaxAllocCount > 0)) { - XplWaitOnLocalSemaphore(MemManager.sem.pools); - pool = MemManager.control.poolPrivate; - while (pool != NULL) { - if (XplStrCaseCmp(pool->name, identity) == 0) { - break; - } - - pool = pool->next; - } - - if (pool != NULL) { - XplSignalLocalSemaphore(MemManager.sem.pools); - if (!(pool->flags & PCONTROL_FLAG_INITIALIZED)) { - if (Dynamic) { - pool->flags = PCONTROL_FLAG_DYNAMIC; - } else { - pool->flags = 0; - pool->eCount.minimum = MinAllocCount; - pool->eCount.maximum = MaxAllocCount; - } - - if (Temporary) { - pool->flags |= PCONTROL_FLAG_DO_NOT_SAVE; - } - - if (pool->allocSize != allocSize) { - XplConsolePrintf("MemMGR: Resetting allocation size for \"%s\".\r\n", pool->name); - pool->allocSize = allocSize; - pool->flags |= PCONTROL_FLAG_CONFIG_CHANGED; - } - - pool->defaultFlags = PENTRY_FLAG_PRIVATE_ENTRY; - - pool->allocCB = allocCB; - pool->freeCB = freeCB; - pool->clientData = clientData; - FillMemoryPool(pool); - } else { - return(NULL); - } - } else { - threadID = XplSetThreadGroupID(MemManager.id.group); - pool = (MemPoolControl *)PLATFORM_ALLOC(sizeof(MemPoolControl)); - XplSetThreadGroupID(threadID); - - if (pool != NULL) { - memset(pool, 0, sizeof(MemPoolControl)); - - if (Dynamic) { - pool->flags = (PCONTROL_FLAG_DYNAMIC | PCONTROL_FLAG_CONFIG_CHANGED); - } else { - pool->flags = PCONTROL_FLAG_CONFIG_CHANGED; - } - - if (Temporary) { - pool->flags |= PCONTROL_FLAG_DO_NOT_SAVE; - } - - pool->name = strdup(identity); - - pool->allocSize = allocSize; - pool->defaultFlags = PENTRY_FLAG_PRIVATE_ENTRY; - - pool->eCount.minimum = MinAllocCount; - pool->eCount.maximum = MaxAllocCount; - - pool->allocCB = allocCB; - pool->freeCB = freeCB; - pool->clientData = clientData; - - FillMemoryPool(pool); - - pool->previous = NULL; - pool->next = MemManager.control.poolPrivate; - if (MemManager.control.poolPrivate != NULL) { - MemManager.control.poolPrivate->previous = pool; - } - MemManager.control.poolPrivate = pool; - - } else { - XplConsolePrintf("MemMGR: Unable to allocate %d bytes for private pool \"%s\".\r\n", sizeof(MemPoolControl), identity); - } - XplSignalLocalSemaphore(MemManager.sem.pools); - } - - PLATFORM_ALLOC_FREE(identity); - - return((void *)pool); - } - - PLATFORM_ALLOC_FREE(identity); - - return(NULL); -} - -EXPORT void -MemPrivatePoolEnumerate(void *PoolHandle, PoolEntryCB EnumerationCB, void *Data) -{ - MemPoolControl *pControl; - MemPoolEntry *pEntry; - - XplWaitOnLocalSemaphore(MemManager.sem.pools); - pControl = MemManager.control.poolPrivate; - while (pControl != NULL) { - if (pControl == (MemPoolControl *)PoolHandle) { - break; - } - - pControl = pControl->next; - } - XplSignalLocalSemaphore(MemManager.sem.pools); - - if (pControl != NULL) { - XplWaitOnLocalSemaphore(pControl->sem); - - pEntry = pControl->inUse; - while (pEntry != NULL) { - EnumerationCB(pEntry->suffix, Data); - pEntry = pEntry->next; - } - - XplSignalLocalSemaphore(pControl->sem); - } - - return; -} - -EXPORT void -MemPrivatePoolStatistics(void *PoolHandle, MemStatistics *PoolStats) -{ - MemPoolControl *pControl; - - XplWaitOnLocalSemaphore(MemManager.sem.pools); - pControl = MemManager.control.poolPrivate; - while (pControl != NULL) { - if (pControl == (MemPoolControl *)PoolHandle) { - break; - } - - pControl = pControl->next; - } - XplSignalLocalSemaphore(MemManager.sem.pools); - - if (pControl != NULL) { - XplWaitOnLocalSemaphore(pControl->sem); - - PoolStats->totalAlloc.count = pControl->eCount.allocated; - PoolStats->totalAlloc.size = pControl->eCount.allocated * pControl->allocSize; - PoolStats->pitches = pControl->stats.pitches; - PoolStats->strikes = pControl->stats.strikes; - PoolStats->hits = pControl->stats.pitches - pControl->stats.strikes; - - XplSignalLocalSemaphore(pControl->sem); - } - - return; -} - -EXPORT void -MemPrivatePoolFree(void *PoolHandle) -{ - MemPoolControl *pControl; - XplThreadID threadID; - - XplWaitOnLocalSemaphore(MemManager.sem.pools); - pControl = MemManager.control.poolPrivate; - while (pControl != NULL) { - if (pControl == (MemPoolControl *)PoolHandle) { - break; - } - - pControl = pControl->next; - } - - if (pControl != NULL) { - threadID = XplSetThreadGroupID(MemManager.id.group); - EmptyMemoryPool(pControl); - XplSetThreadGroupID(threadID); - } - XplSignalLocalSemaphore(MemManager.sem.pools); - - return; -} - -EXPORT void * -MemPrivatePoolGetEntry(void *PoolHandle) -{ - register MemPoolEntry *pEntry; - - PULL_PRIVATE_FREE_ENTRY((MemPoolControl *)PoolHandle, pEntry); - - if (pEntry != NULL) { - return(pEntry->suffix); - } - - return(NULL); -} - -EXPORT void * -MemPrivatePoolGetEntryDebug(void *PoolHandle, const char *SourceFile, unsigned long SourceLine) -{ - register MemPoolEntry *pEntry; - - PULL_PRIVATE_FREE_ENTRY((MemPoolControl *)PoolHandle, pEntry); - - if (pEntry != NULL) { - if (SourceFile != NULL) { - strncpy(pEntry->source.file, SourceFile, sizeof(pEntry->source.file)); - pEntry->source.line = SourceLine; - } else { - strcpy(pEntry->source.file, "UNKNOWN"); - pEntry->source.line = 0; - } - - return(pEntry->suffix); - } - - return(NULL); -} - -EXPORT void -MemPrivatePoolReturnEntry(void *Source) -{ - register MemPoolEntry *pEntry; - - if (Source != NULL) { - pEntry = (MemPoolEntry *)((unsigned char *)Source - SUFFIX_OFFSET); - - if (pEntry->flags & PENTRY_FLAG_INUSE) { - PUSH_NON_EXTREME_FREE_ENTRY(pEntry->control, pEntry); - } else { - XplConsolePrintf("MemMGR: free'd private allocation free'd again; originally free'd by %s [%lu].\r\n", pEntry->source.file, pEntry->source.line); - } - } - - return; -} - -EXPORT void -MemPrivatePoolDiscardEntry(void *Source) -{ - register XplThreadID threadID; - register MemPoolEntry *pEntry; - - if (Source != NULL) { - pEntry = (MemPoolEntry *)((unsigned char *)Source - SUFFIX_OFFSET); - - XplWaitOnLocalSemaphore(pEntry->control->sem); - - if (pEntry->next != NULL) { - pEntry->next->previous = pEntry->previous; - } - - if (pEntry->previous != NULL) { - pEntry->previous->next = pEntry->next; - } else { - pEntry->control->inUse = pEntry->next; - } - - pEntry->control->eCount.allocated--; - - XplSignalLocalSemaphore(pEntry->control->sem); - - if (!(pEntry->flags & PENTRY_FLAG_INDIRECT_ALLOC)) { - threadID = XplSetThreadGroupID(MemManager.id.group); - PLATFORM_ALLOC_FREE(pEntry); - XplSetThreadGroupID(threadID); - } - } - - return; -} - -static BOOL -LoadManagerConfiguration(const unsigned char *AgentName) -{ - XplThreadID threadID; - unsigned char *ptr; - unsigned char *cur; - unsigned char buffer[256]; - FILE *handle; - MemPoolControl *privatePool; - MemPoolControl pControl; - - memset(&pControl, 0, sizeof(MemPoolControl)); - -#if defined(NETWARE) || defined(LIBC) - strcpy(buffer, "SYS:/etc/nmpools.cfg"); -#elif defined(LINUX) || defined(SOLARIS) || defined(S390RH) - if (AgentName != NULL) { - snprintf(buffer, sizeof (buffer), XPL_DEFAULT_DBF_DIR "/%s.conf", AgentName); - - cur = ptr = buffer; - while ((*cur = *ptr) != '\0') { - if (!(isspace(*ptr))) { - cur++; - } - - ptr++; - } - - *cur = '\0'; - } else { - goto UseDefaultConfiguration; - } -#else /* defined(WIN32) */ - buffer[0] = '\0'; - - if (AgentName != NULL) { - int readCount; - long result; - long type; - unsigned char winPath[256]; - HKEY key; - - wsprintf(buffer, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion"); - result = RegOpenKeyEx(HKEY_LOCAL_MACHINE, buffer, 0, KEY_READ, &key); - if (result == ERROR_SUCCESS) { - /* Determine the required read buffer size and load it if the buffer is large enough. */ - result = RegQueryValueEx(key, "SystemRoot", NULL, &type, NULL, &readCount); - if ((result == ERROR_SUCCESS) && (type == REG_SZ) && (readCount <= sizeof(winPath))) { - result = RegQueryValueEx(key, "SystemRoot", NULL, &type, winPath, &readCount); - if (result == ERROR_SUCCESS) { - sprintf(buffer, "%s/%s.cfg", winPath, AgentName); - } - } - - RegCloseKey(key); - } - } - - if (buffer[0] == '\0') { - goto UseDefaultConfiguration; - } -#endif - - handle = fopen(buffer, "rt"); - if (handle != NULL) { - /* The format for pool configuration attributes is: - Pool: \"\" [FIX | DYN] - */ - while ((ferror(handle) == 0) && (feof(handle) == 0)) { - if (pControl.name) { - PLATFORM_ALLOC_FREE(pControl.name); - } - - memset(&pControl, 0, sizeof(MemPoolControl)); - if (fgets(buffer, sizeof(buffer), handle) != NULL) { - if (strncmp(buffer, "Pool: ", 6) == 0) { - cur = (unsigned char *)(buffer) + 6; - - /* Read the pool identification string. */ - if (cur[0] == '"') { - ptr = strchr(++cur, '"'); - if (ptr != NULL) { - *ptr = '\0'; - pControl.name = strdup(cur); - *ptr = '"'; - - cur = ptr + 1; - } else { - XplConsolePrintf("MemMGR: Invalid config format of \"%s\".\r\n", buffer); - XplConsolePrintf(" Missing closing quote.\r\n"); - continue; - } - } else { - XplConsolePrintf("MemMGR: Invalid config format of \"%s\".\r\n", buffer); - XplConsolePrintf(" Missing pool identifier opening quote.\r\n"); - continue; - } - - /* Read the pool state designator. */ - if (strncmp(cur, " DYN ", 5) == 0) { - pControl.flags = PCONTROL_FLAG_DYNAMIC; - } else if (strncmp(cur, " FIX ", 5) == 0) { - pControl.flags = 0; - } else { - XplConsolePrintf("MemMGR: Invalid config format of \"%s\".\r\n", buffer); - XplConsolePrintf(" Invalid pool state designator.\r\n"); - continue; - } - - cur += 5; - - /* Read the pool allocation size. */ - ptr = strchr(cur, ' '); - if (ptr != NULL) { - *ptr = '\0'; - pControl.allocSize = ALIGN_SIZE(atol(cur), ALIGNMENT); - *ptr = ' '; - - cur = ptr + 1; - } else { - XplConsolePrintf("MemMGR: Invalid config format of \"%s\".\r\n", buffer); - XplConsolePrintf(" Invalid pool allocation size.\r\n"); - continue; - } - - /* Read the pool minimum allocation count. */ - ptr = strchr(cur, ' '); - if (ptr != NULL) { - *ptr = '\0'; - pControl.eCount.minimum = atol(cur); - *ptr = ' '; - - cur = ptr + 1; - } else { - XplConsolePrintf("MemMGR: Invalid config format of \"%s\".\r\n", buffer); - XplConsolePrintf(" Invalid pool minimum allocation count.\r\n"); - continue; - } - - /* Read the pool maximum allocation count. */ - pControl.eCount.maximum = atol(cur); - - /* Validate the settings. */ - if ((pControl.name[0] != '\0') && (pControl.eCount.maximum >= pControl.eCount.minimum)) { - if (strcmp(pControl.name, MemManager.control.pool128.name) == 0) { - MemManager.control.pool128.flags = pControl.flags; - MemManager.control.pool128.eCount.minimum = pControl.eCount.minimum; - MemManager.control.pool128.eCount.maximum = pControl.eCount.maximum; - continue; - } else if (strcmp(pControl.name, MemManager.control.pool256.name) == 0) { - MemManager.control.pool256.flags = pControl.flags; - MemManager.control.pool256.eCount.minimum = pControl.eCount.minimum; - MemManager.control.pool256.eCount.maximum = pControl.eCount.maximum; - continue; - } else if (strcmp(pControl.name, MemManager.control.pool512.name) == 0) { - MemManager.control.pool512.flags = pControl.flags; - MemManager.control.pool512.eCount.minimum = pControl.eCount.minimum; - MemManager.control.pool512.eCount.maximum = pControl.eCount.maximum; - continue; - } else if (strcmp(pControl.name, MemManager.control.pool1KB.name) == 0) { - MemManager.control.pool1KB.flags = pControl.flags; - MemManager.control.pool1KB.eCount.minimum = pControl.eCount.minimum; - MemManager.control.pool1KB.eCount.maximum = pControl.eCount.maximum; - continue; - } else if (strcmp(pControl.name, MemManager.control.pool2KB.name) == 0) { - MemManager.control.pool2KB.flags = pControl.flags; - MemManager.control.pool2KB.eCount.minimum = pControl.eCount.minimum; - MemManager.control.pool2KB.eCount.maximum = pControl.eCount.maximum; - continue; - } else if (strcmp(pControl.name, MemManager.control.pool4KB.name) == 0) { - MemManager.control.pool4KB.flags = pControl.flags; - MemManager.control.pool4KB.eCount.minimum = pControl.eCount.minimum; - MemManager.control.pool4KB.eCount.maximum = pControl.eCount.maximum; - continue; - } else if (strcmp(pControl.name, MemManager.control.pool8KB.name) == 0) { - MemManager.control.pool8KB.flags = pControl.flags; - MemManager.control.pool8KB.eCount.minimum = pControl.eCount.minimum; - MemManager.control.pool8KB.eCount.maximum = pControl.eCount.maximum; - continue; - } else if (strcmp(pControl.name, MemManager.control.pool16KB.name) == 0) { - MemManager.control.pool16KB.flags = pControl.flags; - MemManager.control.pool16KB.eCount.minimum = pControl.eCount.minimum; - MemManager.control.pool16KB.eCount.maximum = pControl.eCount.maximum; - continue; - } else if (strcmp(pControl.name, MemManager.control.pool32KB.name) == 0) { - MemManager.control.pool32KB.flags = pControl.flags; - MemManager.control.pool32KB.eCount.minimum = pControl.eCount.minimum; - MemManager.control.pool32KB.eCount.maximum = pControl.eCount.maximum; - continue; - } else if (strcmp(pControl.name, MemManager.control.pool64KB.name) == 0) { - MemManager.control.pool64KB.flags = pControl.flags; - MemManager.control.pool64KB.eCount.minimum = pControl.eCount.minimum; - MemManager.control.pool64KB.eCount.maximum = pControl.eCount.maximum; - continue; - } else if (strcmp(pControl.name, MemManager.control.pool128KB.name) == 0) { - MemManager.control.pool128KB.flags = pControl.flags; - MemManager.control.pool128KB.eCount.minimum = pControl.eCount.minimum; - MemManager.control.pool128KB.eCount.maximum = pControl.eCount.maximum; - continue; - } else if (strcmp(pControl.name, MemManager.control.pool256KB.name) == 0) { - MemManager.control.pool256KB.flags = pControl.flags; - MemManager.control.pool256KB.eCount.minimum = pControl.eCount.minimum; - MemManager.control.pool256KB.eCount.maximum = pControl.eCount.maximum; - continue; - } else if (strcmp(pControl.name, MemManager.control.pool512KB.name) == 0) { - MemManager.control.pool512KB.flags = pControl.flags; - MemManager.control.pool512KB.eCount.minimum = pControl.eCount.minimum; - MemManager.control.pool512KB.eCount.maximum = pControl.eCount.maximum; - continue; - } else if (strcmp(pControl.name, MemManager.control.pool1MB.name) == 0) { - MemManager.control.pool1MB.flags = pControl.flags; - MemManager.control.pool1MB.eCount.minimum = pControl.eCount.minimum; - MemManager.control.pool1MB.eCount.maximum = pControl.eCount.maximum; - continue; - } else if (strcmp(pControl.name, MemManager.control.pool2MB.name) == 0) { - MemManager.control.pool2MB.flags = pControl.flags; - MemManager.control.pool2MB.eCount.minimum = pControl.eCount.minimum; - MemManager.control.pool2MB.eCount.maximum = pControl.eCount.maximum; - continue; - } else if (strcmp(pControl.name, MemManager.control.pool4MB.name) == 0) { - MemManager.control.pool4MB.flags = pControl.flags; - MemManager.control.pool4MB.eCount.minimum = pControl.eCount.minimum; - MemManager.control.pool4MB.eCount.maximum = pControl.eCount.maximum; - continue; - } else if (strcmp(pControl.name, MemManager.control.poolExtreme.name) == 0) { - MemManager.control.poolExtreme.flags = 0; - MemManager.control.poolExtreme.eCount.minimum = 0; - MemManager.control.poolExtreme.eCount.maximum = pControl.eCount.maximum; - continue; - } - - XplWaitOnLocalSemaphore(MemManager.sem.pools); - - threadID = XplSetThreadGroupID(MemManager.id.group); - privatePool = (MemPoolControl *)PLATFORM_ALLOC(sizeof(MemPoolControl)); - XplSetThreadGroupID(threadID); - - if (privatePool != NULL) { - memset(privatePool, 0, sizeof(MemPoolControl)); - - privatePool->previous = NULL; - - privatePool->next = MemManager.control.poolPrivate; - if (privatePool->next != NULL) { - privatePool->next->previous = privatePool; - } - - MemManager.control.poolPrivate = privatePool; - } else { - XplSignalLocalSemaphore(MemManager.sem.pools); - - XplConsolePrintf("MemMGR: Unable to allocate %d bytes for pool \"%s\".\r\n", sizeof(MemPoolControl), pControl.name); - XplConsolePrintf(" Shutting down.\r\n"); - - return(FALSE); - } - - MemManager.control.poolPrivate->flags = pControl.flags; - MemManager.control.poolPrivate->allocSize = pControl.allocSize; - MemManager.control.poolPrivate->eCount.minimum = pControl.eCount.minimum; - MemManager.control.poolPrivate->eCount.maximum = pControl.eCount.maximum; - - MemManager.control.poolPrivate->name = pControl.name; - pControl.name = NULL; - - XplSignalLocalSemaphore(MemManager.sem.pools); - - continue; - } else { - XplConsolePrintf("MemMGR: Invalid config format of \"%s\".\r\n", buffer); - XplConsolePrintf(" Missing identifier or minimum allocation exceeds maximum.\r\n"); - continue; - } - } - } - } - - fclose(handle); - } - -UseDefaultConfiguration: - XplWaitOnLocalSemaphore(MemManager.sem.pools); - - /* Initialize memory pools. */ - FillMemoryPool(&MemManager.control.pool128); - FillMemoryPool(&MemManager.control.pool256); - FillMemoryPool(&MemManager.control.pool512); - FillMemoryPool(&MemManager.control.pool1KB); - FillMemoryPool(&MemManager.control.pool2KB); - FillMemoryPool(&MemManager.control.pool4KB); - FillMemoryPool(&MemManager.control.pool8KB); - FillMemoryPool(&MemManager.control.pool16KB); - FillMemoryPool(&MemManager.control.pool32KB); - FillMemoryPool(&MemManager.control.pool64KB); - FillMemoryPool(&MemManager.control.pool128KB); - FillMemoryPool(&MemManager.control.pool256KB); - FillMemoryPool(&MemManager.control.pool512KB); - FillMemoryPool(&MemManager.control.pool1MB); - FillMemoryPool(&MemManager.control.pool2MB); - FillMemoryPool(&MemManager.control.pool4MB); - FillMemoryPool(&MemManager.control.poolExtreme); - - XplSignalLocalSemaphore(MemManager.sem.pools); - - return(TRUE); -} - -static void -SavePoolConfiguration(MemPoolControl *pControl, FILE *handle) -{ - unsigned int adjust; - - if (pControl->flags & PCONTROL_FLAG_INITIALIZED) { - XplWaitOnLocalSemaphore(pControl->sem); - } - - if (pControl->flags & PCONTROL_FLAG_DYNAMIC) { - if (pControl->eCount.allocated < (pControl->eCount.minimum + (pControl->eCount.minimum / 10))) { - /* Adjust the pool downwards. */ - adjust = pControl->eCount.minimum / 5; - - if (pControl->eCount.minimum > adjust) { - pControl->eCount.minimum -= adjust; - } else { - pControl->eCount.minimum = 0; - } - - if (pControl->eCount.maximum > adjust) { - pControl->eCount.maximum -= adjust; - } else { - pControl->eCount.maximum = 8; - } - - if (pControl->eCount.maximum <= pControl->eCount.minimum) { - pControl->eCount.maximum = pControl->eCount.minimum + (pControl->eCount.minimum / 2); - } - } else if (pControl->eCount.allocated > (pControl->eCount.maximum - (pControl->eCount.maximum / 10))) { - /* Adjust the pool upwards. */ - adjust = pControl->eCount.maximum / 3; - - pControl->eCount.minimum += adjust; - pControl->eCount.maximum += adjust; - } else if (pControl->eCount.minimum == 0) { - pControl->eCount.minimum = pControl->eCount.allocated; - } - } - - fprintf(handle, "Pool: \"%s\" %s %010lu %010lu %010lu\r\n", pControl->name, (pControl->flags & PCONTROL_FLAG_DYNAMIC)? "DYN": "FIX", - (long unsigned int)pControl->allocSize, (long unsigned int)pControl->eCount.minimum, (long unsigned int)pControl->eCount.maximum); - pControl->flags |= PCONTROL_FLAG_CONFIG_SAVED; - - if (pControl->flags & PCONTROL_FLAG_INITIALIZED) { - XplSignalLocalSemaphore(pControl->sem); - } -} - - -static BOOL -SaveManagerConfiguration(const unsigned char *AgentName) -{ - unsigned char buffer[256]; - FILE *handle; - MemPoolControl *pControl = NULL; - -#if defined(NETWARE) || defined(LIBC) - strcpy(buffer, "SYS:/etc/nmpools.cfg"); -#elif defined(LINUX) || defined(SOLARIS) || defined(S390RH) - unsigned char *src; - unsigned char *dest; - - if (AgentName != NULL) { - strcpy(buffer, "/etc/bongo"); - XplMakeDir(buffer); - - snprintf(buffer, sizeof (buffer), XPL_DEFAULT_DBF_DIR "/%s.conf", AgentName); - - src = dest = buffer; - while ((*dest = *src) != '\0') { - if (!(isspace(*src))) { - dest++; - } - - src++; - } - - *dest = '\0'; - } else { - return(FALSE); - } -#else /* defined(WIN32) */ - int readCount; - long result; - long type; - unsigned char winPath[256]; - HKEY key; - - buffer[0] = '\0'; - if (AgentName != NULL) { - wsprintf(buffer, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion"); - result = RegOpenKeyEx(HKEY_LOCAL_MACHINE, buffer, 0, KEY_READ, &key); - if (result == ERROR_SUCCESS) { - /* Determine the required read buffer size and load it if the buffer is large enough. */ - result = RegQueryValueEx(key, "SystemRoot", NULL, &type, NULL, &readCount); - if ((result == ERROR_SUCCESS) && (type == REG_SZ) && (readCount <= sizeof(winPath))) { - result = RegQueryValueEx(key, "SystemRoot", NULL, &type, winPath, &readCount); - if (result == ERROR_SUCCESS) { - sprintf(buffer, "%s/%s.cfg", winPath, AgentName); - } - } - - RegCloseKey(key); - } - } - - if (buffer[0] == '\0') { - return(FALSE); - } -#endif - - if ((time(NULL) - MemManager.startTime) < (60 *60)) { - return(TRUE); - } - - handle = fopen(buffer, "wt"); - if (handle != NULL) { - SavePoolConfiguration (&MemManager.control.pool128, handle); - SavePoolConfiguration (&MemManager.control.pool256, handle); - SavePoolConfiguration (&MemManager.control.pool512, handle); - SavePoolConfiguration (&MemManager.control.pool1KB, handle); - SavePoolConfiguration (&MemManager.control.pool2KB, handle); - SavePoolConfiguration (&MemManager.control.pool4KB, handle); - SavePoolConfiguration (&MemManager.control.pool8KB, handle); - SavePoolConfiguration (&MemManager.control.pool16KB, handle); - SavePoolConfiguration (&MemManager.control.pool32KB, handle); - SavePoolConfiguration (&MemManager.control.pool64KB, handle); - SavePoolConfiguration (&MemManager.control.pool128KB, handle); - SavePoolConfiguration (&MemManager.control.pool256KB, handle); - SavePoolConfiguration (&MemManager.control.pool512KB, handle); - SavePoolConfiguration (&MemManager.control.pool1MB, handle); - SavePoolConfiguration (&MemManager.control.pool2MB, handle); - SavePoolConfiguration (&MemManager.control.pool4MB, handle); - - XplWaitOnLocalSemaphore(MemManager.sem.pools); - - pControl = MemManager.control.poolPrivate; - while (pControl != NULL) { - SavePoolConfiguration (pControl, handle); - - pControl = pControl->next; - } - - XplSignalLocalSemaphore(MemManager.sem.pools); - - fclose(handle); - handle = NULL; - - return(TRUE); - } - - return(FALSE); -} - -static void -StopManagerLibrary(const unsigned char *AgentName) -{ - XplThreadID threadID; - MemPoolControl *pControl; - MemPoolControl *pControlNext; - - if (MemManager.state < LIBRARY_SHUTTING_DOWN) { - MemManager.state = LIBRARY_SHUTTING_DOWN; - - /* Save the configuration */ - SaveManagerConfiguration(AgentName); - - MemManager.state = LIBRARY_SHUTDOWN; - - /* Release memory pools. */ - MemoryPoolsFree(); - - /* free the private pool control structures */ - threadID = XplSetThreadGroupID(MemManager.id.group); - - XplWaitOnLocalSemaphore(MemManager.sem.pools); - - pControl = MemManager.control.poolPrivate; - MemManager.control.poolPrivate = NULL; - while (pControl != NULL) { - pControlNext = pControl->next; - PLATFORM_ALLOC_FREE(pControl); - pControl = pControlNext; - } - - XplSetThreadGroupID(threadID); - - XplCloseLocalSemaphore(MemManager.sem.pools); - } - - return; -} - -static void -InternalPoolInit(MemPoolControl *PControl, const unsigned char *Name, unsigned long AllocSize, unsigned long MaximumEntries, unsigned long Flags) -{ - memset(PControl, 0, sizeof(MemPoolControl)); - - PControl->flags = Flags; - if (!PControl->flags) { - PControl->flags = PCONTROL_FLAG_DYNAMIC; - } - - PControl->name = strdup(Name); - PControl->allocSize = ALIGN_SIZE(AllocSize, ALIGNMENT); - PControl->eCount.maximum = MaximumEntries; - - return; -} - -static void -StartManagerLibrary(const unsigned char *AgentName) -{ - MemManager.agentName = strdup(AgentName); - - MemManager.flags |= MEMMGR_FLAG_REPORT_LEAKS; - - MemManager.id.group = XplGetThreadGroupID(); - - XplOpenLocalSemaphore(MemManager.sem.pools, 1); - - XplSafeWrite(MemManager.useCount, 0); - - InternalPoolInit(&MemManager.control.pool128, "128 Bytes", POOL128_ALLOC_SIZE, 20 * 1024, 0); - InternalPoolInit(&MemManager.control.pool256, "256 Bytes", POOL256_ALLOC_SIZE, 6 * 1024, 0); - InternalPoolInit(&MemManager.control.pool512, "512 Bytes", POOL512_ALLOC_SIZE, 2 * 1024, 0); - InternalPoolInit(&MemManager.control.pool1KB, "1 KiloByte", POOL1KB_ALLOC_SIZE, 2 * 1024, 0); - InternalPoolInit(&MemManager.control.pool2KB, "2 KiloBytes", POOL2KB_ALLOC_SIZE, 6 * 1024, 0); - InternalPoolInit(&MemManager.control.pool4KB, "4 KiloBytes", POOL4KB_ALLOC_SIZE, 1024, 0); - InternalPoolInit(&MemManager.control.pool8KB, "8 KiloBytes", POOL8KB_ALLOC_SIZE, 512, 0); - InternalPoolInit(&MemManager.control.pool16KB, "16 KiloBytes", POOL16KB_ALLOC_SIZE, 512, 0); - InternalPoolInit(&MemManager.control.pool32KB, "32 KiloBytes", POOL32KB_ALLOC_SIZE, 512, 0); - InternalPoolInit(&MemManager.control.pool64KB, "64 KiloBytes", POOL64KB_ALLOC_SIZE, 512, 0); - InternalPoolInit(&MemManager.control.pool128KB, "128 KiloBytes", POOL128KB_ALLOC_SIZE, 384, 0); - InternalPoolInit(&MemManager.control.pool256KB, "256 KiloBytes", POOL256KB_ALLOC_SIZE, 384, 0); - InternalPoolInit(&MemManager.control.pool512KB, "512 KiloBytes", POOL512KB_ALLOC_SIZE, 256, 0); - InternalPoolInit(&MemManager.control.pool1MB, "1 MegaByte", POOL1MB_ALLOC_SIZE, 64, 0); - InternalPoolInit(&MemManager.control.pool2MB, "2 MegaBytes", POOL2MB_ALLOC_SIZE, 32, 0); - InternalPoolInit(&MemManager.control.pool4MB, "4 MegaBytes", POOL4MB_ALLOC_SIZE, 32, 0); - InternalPoolInit(&MemManager.control.poolExtreme, "Extreme MegaBytes", 0, 64, PENTRY_FLAG_EXTREME_ENTRY); - - LoadManagerConfiguration(AgentName); - - MemManager.state = LIBRARY_RUNNING; - - return; -} - -EXPORT BOOL -MemoryManagerOpen(const unsigned char *AgentName) -{ - if ((MemManager.state == LIBRARY_LOADED) && (AgentName != NULL)) { - MemManager.state = LIBRARY_INITIALIZING; - - StartManagerLibrary(AgentName); - } - - while ((MemManager.state == LIBRARY_INITIALIZING) || (MemManager.state == LIBRARY_LOADED)) { - XplDelay(100); - } - - if (MemManager.state == LIBRARY_RUNNING) { - XplSafeIncrement(MemManager.useCount); - return(TRUE); - } - - return(FALSE); -} - -EXPORT BOOL -MemoryManagerClose(const unsigned char *AgentName) -{ - XplSafeDecrement(MemManager.useCount); - - if (XplSafeRead(MemManager.useCount) > 0) { - return(FALSE); - } - - StopManagerLibrary(AgentName); - - return(TRUE); -} - -#if 0 -#if defined(WIN32) -BOOL WINAPI DllMain(HINSTANCE hInst, DWORD Reason, LPVOID Reserved) -{ - if (Reason == DLL_PROCESS_ATTACH) { - DisableThreadLibraryCalls(hInst); - } - - return(TRUE); -} -#elif defined(NETWARE) || defined(LIBC) -void MMShutdownSigHandler(int sigtype) -{ - static int signaled = FALSE; - - if (!signaled && ((sigtype == SIGTERM) || (sigtype == SIGINT))) { - XplSignalLocalSemaphore(MemManager.sem.shutdown); - XplWaitOnLocalSemaphore(MemManager.sem.shutdown); - - XplCloseLocalSemaphore(MemManager.sem.shutdown); - } - - return; -} - -int main(int argc, char *argv[]) -{ - int i; - int ccode; - unsigned long semValue = 0; - - MemManager.state = LIBRARY_INITIALIZING; - - XplSignalHandler(MMShutdownSigHandler); - - XplOpenLocalSemaphore(MemManager.sem.shutdown, 0); - - MemManager.startTime = time(NULL); - - if (argc > 1) { - for (i = 1; i < argc; i++) { - if (XplStrCaseCmp("-leaks", argv[i]) == 0) { - MemManager.flags |= MEMMGR_FLAG_REPORT_LEAKS; - } - } - } - -#if !defined(LIBC) - StartManagerLibrary(NULL); - if (MemManager.state == LIBRARY_RUNNING) { - MemoryManagerOpen(NULL); - - XplWaitOnLocalSemaphore(MemManager.sem.shutdown); - - MemoryManagerClose(NULL); - } else { - XplBell(); - XplConsolePrintf("MemMGR: Unable to initialize!\r\n"); - XplBell(); - - return(-1); - } -#else - MMNLMHandle = getnlmhandle(); - if (MMNLMHandle != NULL) { - MMResourceTag = AllocateResourceTag(MMNLMHandle, "Bongo Memory Manager", AllocSignature); - if (MMResourceTag != NULL) { - StartManagerLibrary(NULL); - if (MemManager.state == LIBRARY_RUNNING) { - MemoryManagerOpen(NULL); - - XplWaitOnLocalSemaphore(MemManager.sem.shutdown); - - MemoryManagerClose(NULL); - } else { - XplBell(); - XplConsolePrintf("MemMGR: Unable to initialize!\r\n"); - XplBell(); - - return(-1); - } - } else { - XplBell(); - XplConsolePrintf("MemMGR: Unable to allocate global resource tag!\r\n"); - XplBell(); - - return(-1); - } - } else { - XplBell(); - XplBell(); - XplConsolePrintf("MemMGR: Unable to identify module handle!\r\n"); - - return(-1); - } -#endif - - XplSignalLocalSemaphore(MemManager.sem.shutdown); - - return(0); -} -#endif -#endif diff --git a/src/libs/memmgr/memstack.c b/src/libs/memmgr/memstack.c index eae1825..7655c92 100644 --- a/src/libs/memmgr/memstack.c +++ b/src/libs/memmgr/memstack.c @@ -32,7 +32,7 @@ BongoMemChunkNew (size_t size) return NULL; } - result->curptr = &result->data[0]; + result->curptr = (uint8_t *) &result->data[0]; result->endptr = result->curptr + size; result->next = NULL; @@ -103,7 +103,7 @@ BongoMemStackReset(BongoMemStack *stack) if (next) { MemFree(chunk); } else { - chunk->curptr = &chunk->data[0]; + chunk->curptr = (uint8_t *) &chunk->data[0]; chunk->next = NULL; stack->chunk = chunk; return; @@ -164,7 +164,7 @@ BongoMemStackPop(BongoMemStack *stack, void *obj) if (next) { MemFree(chunk); } else { - chunk->curptr = &chunk->data[0]; + chunk->curptr = (uint8_t *) &chunk->data[0]; chunk->next = NULL; stack->chunk = chunk; return; diff --git a/src/libs/memmgr/pools.c b/src/libs/memmgr/pools.c new file mode 100644 index 0000000..ab635f5 --- /dev/null +++ b/src/libs/memmgr/pools.c @@ -0,0 +1,65 @@ +#include +#include +#include +#include "memmgrp.h" + +EXPORT BOOL +MemPrivatePoolZeroCallback(void *buffer, void *clientData) +{ + memset(buffer, 0, (int)(clientData)); + + return TRUE; +} + +struct MemPoolPrivateRef { + size_t size; +}; + +EXPORT void * +MemPrivatePoolAlloc(unsigned char *name, size_t AllocationSize, unsigned int MinAllocCount, unsigned int MaxAllocCount, BOOL Dynamic, BOOL Temporary, PoolEntryCB allocCB, PoolEntryCB freeCB, void *clientData) +{ + struct MemPoolPrivateRef *ref; + + ref = g_new0(struct MemPoolPrivateRef, 1); + ref->size = AllocationSize; + return (ref); +} + +EXPORT void +MemPrivatePoolFree(void *PoolHandle) +{ + // free this private pool - todo; keep references? + g_free(PoolHandle); + return; +} + +EXPORT void * +MemPrivatePoolGetEntryDirect(void *PoolHandle, const char *SourceFile, unsigned long SourceLine) +{ + struct MemPoolPrivateRef *ref = (struct MemPoolPrivateRef *)PoolHandle; + + return g_slice_alloc(ref->size); +} + +EXPORT void +MemPrivatePoolReturnEntryDirect(void *PoolHandle, void *Source, const char *SourceFile, unsigned long SourceLine) +{ + struct MemPoolPrivateRef *ref = (struct MemPoolPrivateRef *)PoolHandle; + + g_slice_free1(ref->size, Source); + return; +} + +EXPORT BOOL +MemoryManagerOpen(const unsigned char *AgentName) +{ + // do we need this? + return(TRUE); +} + +EXPORT BOOL +MemoryManagerClose(const unsigned char *AgentName) +{ + // do we need this? + return(TRUE); +} diff --git a/src/libs/msgapi/Bongo.rules b/src/libs/msgapi/Bongo.rules deleted file mode 100644 index 1503583..0000000 --- a/src/libs/msgapi/Bongo.rules +++ /dev/null @@ -1,74 +0,0 @@ -# -*- Makefile -*- -lib_LTLIBRARIES += libbongomsgapi.la - -libbongomsgapi_la_SOURCES = \ - src/libs/msgapi/cookie.c \ - src/libs/msgapi/msgaddr.c \ - src/libs/msgapi/msgapi.c \ - src/libs/msgapi/msgapip.h \ - src/libs/msgapi/msgauth.c \ - src/libs/msgapi/msgcollector.c \ - src/libs/msgapi/msgdate.c \ - src/libs/msgapi/msghttp.c \ - src/libs/msgapi/plugin-api.h \ - src/libs/msgapi/sqldb.c \ - src/libs/msgapi/msghttp.h - -libbongomsgapi_la_CPPFLAGS = $(AM_CPPFLAGS) \ - $(LIBCURL_CPPFLAGS) \ - $(LIBICAL_CFLAGS) \ - $(SQLITE_CFLAGS) - -libbongomsgapi_la_LIBADD = \ - libbongocal.la \ - libbongoconnio.la \ - libbongoutil.la \ - libbongo-json.la \ - libbongomemmgr.la \ - libbongonmap.la \ - libbongoxpl.la \ - $(LIBCURL_LIBS) \ - $(SQLITE_LIBS) \ - $(LIBICAL_LIBS) \ - $(DL_LIBS) - -# auth backends -authdir = $(libdir)/bongo-auth/ -auth_std_libadd = \ - $(top_builddir)/import/log4c/log4c/libbongolog4c.la \ - libbongomemmgr.la \ - $(PTHREAD_LIBS) \ - $(ALL_LIBS) - -auth_LTLIBRARIES = libauthsqlite3.la - -libauthsqlite3_la_SOURCES = \ - src/libs/msgapi/auth-backends/sqlite.h \ - src/libs/msgapi/auth-backends/sqlite.c - -libauthsqlite3_la_CPPFLAGS = $(AM_CPPFLAGS) $(SQLITE_CFLAGS) - -libauthsqlite3_la_LIBADD = \ - $(SQLITE_LIBS) \ - $(auth_std_libadd) - -if HAVE_LDAP -auth_LTLIBRARIES += libauthldap.la -endif - -libauthldap_la_SOURCES = src/libs/msgapi/auth-backends/ldap.c -libauthldap_la_CPPFLAGS = $(AM_CPPFLAGS) -libauthldap_la_LIBADD = $(LDAP_LIBS) - -if HAVE_ODBC -auth_LTLIBRARIES += libauthodbc.la -endif - -libauthodbc_la_SOURCES = src/libs/msgapi/auth-backends/odbc.c -libauthodbc_la_CPPFLAGS = $(AM_CPPFLAGS) -libauthodbc_la_LIBADD = $(ODBC_LIBS) - -src/libs/msgapi/all: libbongomsgapi.la $(auth_LTLIBRARIES) -src/libs/msgapi/clean: clean -src/libs/msgapi/install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) lib_LTLIBRARIES=libbongomsgapi.la install-libLTLIBRARIES diff --git a/src/libs/msgapi/CMakeLists.txt b/src/libs/msgapi/CMakeLists.txt new file mode 100644 index 0000000..c311fa2 --- /dev/null +++ b/src/libs/msgapi/CMakeLists.txt @@ -0,0 +1,24 @@ +add_library(bongomsgapi SHARED + cookie.c + msgaddr.c + msgapi.c + msgauth.c + msgcollector.c + msgdate.c + msghttp.c + sqldb.c +) + +target_link_libraries(bongomsgapi + bongoxpl + bongomemmgr + bongonmap + bongocal + ${SQLITE_LIBRARIES} + ${LIBICAL_LIBRARIES} + ${CURL_LIBRARIES} +) + +install(TARGETS bongomsgapi DESTINATION ${LIB_INSTALL_DIR}) + +add_subdirectory(auth-backends) diff --git a/src/libs/msgapi/Makefile.am b/src/libs/msgapi/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/libs/msgapi/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/libs/msgapi/auth-backends/CMakeLists.txt b/src/libs/msgapi/auth-backends/CMakeLists.txt new file mode 100644 index 0000000..c2c0247 --- /dev/null +++ b/src/libs/msgapi/auth-backends/CMakeLists.txt @@ -0,0 +1,4 @@ +add_library(authsqlite3 MODULE + sqlite.c) + +install(TARGETS authsqlite3 DESTINATION ${LIB_INSTALL_DIR}/bongo-auth) diff --git a/src/libs/msgapi/msgapi.c b/src/libs/msgapi/msgapi.c index d6376fa..4119b1f 100644 --- a/src/libs/msgapi/msgapi.c +++ b/src/libs/msgapi/msgapi.c @@ -39,7 +39,6 @@ #include #include "msgapip.h" -#include #include #include #include diff --git a/src/libs/msgapi/msgcollector.c b/src/libs/msgapi/msgcollector.c index 3b45092..0bf5a78 100644 --- a/src/libs/msgapi/msgcollector.c +++ b/src/libs/msgapi/msgcollector.c @@ -200,9 +200,9 @@ static void FreeEventData (void *data) { if (data) { - MemFreeDirect (((EventData *)data)->guid); - MemFreeDirect (((EventData *)data)->dtstamp); - MemFreeDirect (data); + MemFree (((EventData *)data)->guid); + MemFree (((EventData *)data)->dtstamp); + MemFree (data); } } @@ -221,7 +221,7 @@ ReadCalendar(Connection *conn, const char *calendar) guids = BongoHashtableCreateFull(16, (HashFunction)BongoStringHash, (CompareFunction)strcmp, - MemFreeDirect, + MemFreeDirectCallback, FreeEventData); ccode = NMAPRunCommandF(conn, buffer, CONN_BUFSIZE, "EVENTS \"C/calendars/%s\" Pnmap.event.uid,nmap.event.stamp\r\n", calendar); @@ -263,7 +263,7 @@ ReadCalendar(Connection *conn, const char *calendar) BongoHashtablePut(guids, uid, data); } else { - MemFreeDirect(guid); + MemFree(guid); } } @@ -278,7 +278,7 @@ ReadCalendar(Connection *conn, const char *calendar) NMAPReadAnswer(conn, buffer, sizeof(buffer), TRUE); } - MemFreeDirect(guid); + MemFree(guid); } BongoArrayDestroy(&oldDuplicates, TRUE); @@ -675,18 +675,6 @@ write_data(void *buffer, size_t size, size_t nmemb, void *stream) return nmemb*size; } -static char * -AliasProtocol(const char *url, const char *proto, const char *newProto) -{ - unsigned int protoLen = strlen(proto); - - if (strlen(url) > protoLen && XplStrNCaseCmp(proto, url, protoLen) == 0) { - return MemStrCat(newProto, url + protoLen); - } - - return NULL; -} - int MsgImportIcsUrl(const char *user, const char *calendarName, @@ -702,11 +690,10 @@ MsgImportIcsUrl(const char *user, char *aliasedUrl = NULL; int ret = 0; - /* replace webcal: with http: */ - aliasedUrl = AliasProtocol(url, "webcal:", "http:"); - if (!aliasedUrl) { - aliasedUrl = AliasProtocol(url, "feed:", "http:"); - } + /* TODO: fix up url. + * Protocol could be webcal://, feed://, dav://, ical://, etc. + * Need to replace with http:// for curl to understand it. + */ curl = curl_easy_init(); if (curl) { diff --git a/src/libs/msgapi/msgdate.c b/src/libs/msgapi/msgdate.c index c085ff3..1f1ebe3 100644 --- a/src/libs/msgapi/msgdate.c +++ b/src/libs/msgapi/msgdate.c @@ -27,7 +27,8 @@ #include #include "msgapip.h" -#include +//#include +#include #include "bongoutil.h" #define LAST 5 diff --git a/src/libs/nmap/Bongo.rules b/src/libs/nmap/Bongo.rules deleted file mode 100644 index 2737646..0000000 --- a/src/libs/nmap/Bongo.rules +++ /dev/null @@ -1,18 +0,0 @@ -# -*- Makefile -*- -lib_LTLIBRARIES += libbongonmap.la - -#libbongonmap_la_LDFLAGS = -static -libbongonmap_la_SOURCES = \ - src/libs/nmap/bongoagent.c \ - src/libs/nmap/nmap.c \ - src/libs/nmap/hashcred.c \ - src/libs/nmap/mime.c - -libbongonmap_la_LIBADD = \ - libbongologger.la \ - libbongocal.la \ - libbongostreamio.la \ - $(top_builddir)/import/log4c/log4c/libbongolog4c.la - -src/libs/nmap/all: libbongonmap.la -src/libs/nmap/clean: clean diff --git a/src/libs/nmap/CMakeLists.txt b/src/libs/nmap/CMakeLists.txt new file mode 100644 index 0000000..19826cd --- /dev/null +++ b/src/libs/nmap/CMakeLists.txt @@ -0,0 +1,19 @@ + +add_library(bongonmap SHARED + bongoagent.c + nmap.c + hashcred.c + mime.c) + +target_link_libraries(bongonmap + bongoconnio + bongomemmgr + bongoxpl + bongologging + bongostreamio + ${GNUTLS_LIBRARIES} + ${GCRYPT_LIBRARIES} + ${PTHREAD_LIBRARIES} + ) + +install(TARGETS bongonmap DESTINATION ${LIB_INSTALL_DIR}) diff --git a/src/libs/nmap/Makefile.am b/src/libs/nmap/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/libs/nmap/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/libs/nmap/bongoagent.c b/src/libs/nmap/bongoagent.c index ba73aa5..b8deb13 100644 --- a/src/libs/nmap/bongoagent.c +++ b/src/libs/nmap/bongoagent.c @@ -298,7 +298,7 @@ BongoAgentInit(BongoAgent *agent, { agent->state = BONGO_AGENT_STATE_RUNNING; - LoggerOpen(agentName); + LogOpen(agentName); if (!MemoryManagerOpen(agentName)) { Log(LOG_ERROR, "Unable to initialize memory manager; shutting down."); @@ -351,11 +351,7 @@ QueueHandleConnection (void *datap) int ccode; char line[CONN_BUFSIZE]; -#if defined(RELEASE_BUILD) - client = MemPrivatePoolGetEntry(data->clientPool); -#else - client = MemPrivatePoolGetEntryDebug(data->clientPool, __FILE__, __LINE__); -#endif + client = MemPrivatePoolGetEntryDirect(data->clientPool, __FILE__, __LINE__); memset(client, 0, data->clientSize); @@ -388,11 +384,7 @@ HandleConnection (void *datap) void *client; int ccode; -#if defined(RELEASE_BUILD) - client = MemPrivatePoolGetEntry(data->clientPool); -#else - client = MemPrivatePoolGetEntryDebug(data->clientPool, __FILE__, __LINE__); -#endif + client = MemPrivatePoolGetEntryDirect(data->clientPool, __FILE__, __LINE__); memset(client, 0, data->clientSize); @@ -609,7 +601,7 @@ BongoAgentShutdown(BongoAgent *agent) ConnCloseAll(1); - LoggerClose(NULL); + LogClose(); MsgShutdown(); diff --git a/src/libs/python/Bongo.rules b/src/libs/python/Bongo.rules deleted file mode 100644 index 51c3031..0000000 --- a/src/libs/python/Bongo.rules +++ /dev/null @@ -1,158 +0,0 @@ -# -*- Makefile -*- -# This file needs a lot of help. We need a single list of the python -# files we ship, and a target that compiles them at install-time. In -# the meantime, we'll have this packagedir monstrosity. - -pkgpythondir = $(pythondir)/bongo -pkgpythonadmindir = $(pythondir)/bongo/admin -pkgpythonexternaldir = $(pythondir)/bongo/external -pkgpythonexternaldateutildir = $(pythondir)/bongo/external/dateutil -pkgpythonexternalemaildir = $(pythondir)/bongo/external/email -pkgpythonexternalemailmimedir = $(pythondir)/bongo/external/email/mime -pkgpythonexternaldateutilzoneinfodir = $(pythondir)/bongo/external/dateutil/zoneinfo -pkgpythonexternalsimplejsondir = $(pythondir)/bongo/external/simplejson -pkgpythonexternalsimpletaldir = $(pythondir)/bongo/external/simpletal -pkgpythonexternalvobjectdir = $(pythondir)/bongo/external/vobject -pkgpythonnmapdir = $(pythondir)/bongo/nmap -pkgpythonstoredir = $(pythondir)/bongo/store - -pkgpython_PYTHON = \ - src/libs/python/bongo/__init__.py \ - src/libs/python/bongo/CalCmd.py \ - src/libs/python/bongo/cmdparse.py \ - src/libs/python/bongo/Console.py \ - src/libs/python/bongo/Contact.py \ - src/libs/python/bongo/BongoError.py \ - src/libs/python/bongo/MDB.py \ - src/libs/python/bongo/Template.py \ - src/libs/python/bongo/Privs.py \ - src/libs/python/bongo/StreamIO.py \ - src/libs/python/bongo/table.py - -nodist_pkgpython_PYTHON = \ - src/libs/python/bongo/Xpl.py - -pkgpythonadmin_PYTHON = \ - src/libs/python/bongo/admin/__init__.py \ - src/libs/python/bongo/admin/Addressbook.py \ - src/libs/python/bongo/admin/Alias.py \ - src/libs/python/bongo/admin/Antispam.py \ - src/libs/python/bongo/admin/Calcmd.py \ - src/libs/python/bongo/admin/Collector.py \ - src/libs/python/bongo/admin/Handler.py \ - src/libs/python/bongo/admin/Imap.py \ - src/libs/python/bongo/admin/Itip.py \ - src/libs/python/bongo/admin/JsonUtil.py \ - src/libs/python/bongo/admin/ManagedSlapd.py \ - src/libs/python/bongo/admin/Mdb.py \ - src/libs/python/bongo/admin/Msgserver.py \ - src/libs/python/bongo/admin/Pop3.py \ - src/libs/python/bongo/admin/Proxy.py \ - src/libs/python/bongo/admin/Queue.py \ - src/libs/python/bongo/admin/Schema.py \ - src/libs/python/bongo/admin/Security.py \ - src/libs/python/bongo/admin/Smtp.py \ - src/libs/python/bongo/admin/Store.py \ - src/libs/python/bongo/admin/Template.py \ - src/libs/python/bongo/admin/User.py \ - src/libs/python/bongo/admin/Util.py \ - src/libs/python/bongo/admin/Webadmin.py \ - src/libs/python/bongo/admin/Webservices.py \ - src/libs/python/bongo/admin/bongoutil.py - -pkgpythonexternal_PYTHON = \ - src/libs/python/bongo/external/__init__.py - -pkgpythonexternaldateutil_PYTHON = \ - src/libs/python/bongo/external/dateutil/__init__.py \ - src/libs/python/bongo/external/dateutil/easter.py \ - src/libs/python/bongo/external/dateutil/parser.py \ - src/libs/python/bongo/external/dateutil/relativedelta.py \ - src/libs/python/bongo/external/dateutil/rrule.py \ - src/libs/python/bongo/external/dateutil/tz.py \ - src/libs/python/bongo/external/dateutil/tzwin.py - -pkgpythonexternaldateutilzoneinfo_PYTHON = \ - src/libs/python/bongo/external/dateutil/zoneinfo/__init__.py - -pkgpythonexternalemail_PYTHON = \ - src/libs/python/bongo/external/email/feedparser.py \ - src/libs/python/bongo/external/email/_parseaddr.py \ - src/libs/python/bongo/external/email/parser.py \ - src/libs/python/bongo/external/email/message.py \ - src/libs/python/bongo/external/email/header.py \ - src/libs/python/bongo/external/email/iterators.py \ - src/libs/python/bongo/external/email/encoders.py \ - src/libs/python/bongo/external/email/payloads.py \ - src/libs/python/bongo/external/email/quoprimime.py \ - src/libs/python/bongo/external/email/generator.py \ - src/libs/python/bongo/external/email/filegenerator.py \ - src/libs/python/bongo/external/email/charset.py \ - src/libs/python/bongo/external/email/base64mime.py \ - src/libs/python/bongo/external/email/__init__.py \ - src/libs/python/bongo/external/email/errors.py \ - src/libs/python/bongo/external/email/utils.py - -pkgpythonexternalemailmime_PYTHON = \ - src/libs/python/bongo/external/email/mime/audio.py \ - src/libs/python/bongo/external/email/mime/message.py \ - src/libs/python/bongo/external/email/mime/nonmultipart.py \ - src/libs/python/bongo/external/email/mime/multipart.py \ - src/libs/python/bongo/external/email/mime/text.py \ - src/libs/python/bongo/external/email/mime/image.py \ - src/libs/python/bongo/external/email/mime/base.py \ - src/libs/python/bongo/external/email/mime/__init__.py \ - src/libs/python/bongo/external/email/mime/application.py - -pkgpythonexternalsimplejson_PYTHON = \ - src/libs/python/bongo/external/simplejson/__init__.py \ - src/libs/python/bongo/external/simplejson/decoder.py \ - src/libs/python/bongo/external/simplejson/encoder.py \ - src/libs/python/bongo/external/simplejson/jsonfilter.py \ - src/libs/python/bongo/external/simplejson/scanner.py - -pkgpythonexternalsimpletal_PYTHON = \ - src/libs/python/bongo/external/simpletal/DummyLogger.py \ - src/libs/python/bongo/external/simpletal/__init__.py \ - src/libs/python/bongo/external/simpletal/simpleElementTree.py \ - src/libs/python/bongo/external/simpletal/simpleTAL.py \ - src/libs/python/bongo/external/simpletal/FixedHTMLParser.py \ - src/libs/python/bongo/external/simpletal/sgmlentitynames.py \ - src/libs/python/bongo/external/simpletal/simpleTALES.py \ - src/libs/python/bongo/external/simpletal/simpleTALUtils.py - - -pkgpythonexternalvobject_PYTHON = \ - src/libs/python/bongo/external/vobject/__init__.py \ - src/libs/python/bongo/external/vobject/base.py \ - src/libs/python/bongo/external/vobject/behavior.py \ - src/libs/python/bongo/external/vobject/icalendar.py \ - src/libs/python/bongo/external/vobject/vcard.py \ - src/libs/python/bongo/external/vobject/win32tz.py - -pkgpythonnmap_PYTHON = \ - src/libs/python/bongo/nmap/__init__.py \ - src/libs/python/bongo/nmap/CommandStream.py \ - src/libs/python/bongo/nmap/NmapClient.py \ - src/libs/python/bongo/nmap/NmapConnection.py \ - src/libs/python/bongo/nmap/QueueClient.py - -pkgpythonstore_PYTHON = \ - src/libs/python/bongo/store/__init__.py \ - src/libs/python/bongo/store/CommandStream.py \ - src/libs/python/bongo/store/QueueClient.py \ - src/libs/python/bongo/store/StoreClient.py \ - src/libs/python/bongo/store/StoreConnection.py - -CLEANFILES += \ - src/libs/python/bongo/*.pyc \ - src/libs/python/bongo/external/*.pyc \ - src/libs/python/bongo/external/simplejson/*.pyc \ - src/libs/python/bongo/nmap/*.pyc \ - src/libs/python/bongoy/store/*.pyc - -src/libs/python/bongo-python-wrapper: $(top_builddir)/config.status $(srcdir)/src/libs/python/bongo-python-wrapper.in - cd $(top_builddir) && $(SHELL) ./config.status $@ - -src/libs/python/all: src/libs/python/bongo/all -src/libs/python/clean: clean diff --git a/src/libs/python/Makefile.am b/src/libs/python/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/libs/python/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/libs/python/bongo/CMakeLists.txt b/src/libs/python/bongo/CMakeLists.txt new file mode 100644 index 0000000..fca7db7 --- /dev/null +++ b/src/libs/python/bongo/CMakeLists.txt @@ -0,0 +1,8 @@ +# should look at doing a 'real' python install +# http://www.python.org/doc/2.2.3/dist/setup-script.html + +install(DIRECTORY ./ + DESTINATION "${PYTHON_SITEPACKAGES_PATH}/bongo/" + FILES_MATCHING PATTERN "*.py" + PATTERN ".svn" EXCLUDE + ) diff --git a/src/libs/python/bongo/Makefile.am b/src/libs/python/bongo/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/libs/python/bongo/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/libs/python/libbongo/Bongo.rules b/src/libs/python/libbongo/Bongo.rules deleted file mode 100644 index 5d7e65c..0000000 --- a/src/libs/python/libbongo/Bongo.rules +++ /dev/null @@ -1,79 +0,0 @@ -# -*- Makefile -*- -pkgpyexecdir = $(pyexecdir)/libbongo - -pkgpyexec_PYTHON = \ - src/libs/python/libbongo/__init__.py - -pkgpyexec_LTLIBRARIES = \ - libs.la \ - bootstrap.la - -# src/libs/python/libbongo/mdb.c -libs_la_SOURCES = \ - src/libs/python/libbongo/cal.c \ - src/libs/python/libbongo/calcmd.c \ - src/libs/python/libbongo/libs.c \ - src/libs/python/libbongo/libs.h \ - src/libs/python/libbongo/msgapi.c \ - src/libs/python/libbongo/msgapi-defs.c \ - src/libs/python/libbongo/msgapi-defs.h \ - src/libs/python/libbongo/pybongo.c \ - src/libs/python/libbongo/pybongo.h \ - src/libs/python/libbongo/streamio.c \ - src/libs/python/libbongo/json.c \ - src/libs/python/libbongo/json.h \ - src/libs/python/libbongo/tests.c \ - src/libs/python/libbongo/bongoutil.c - -libs_la_CPPFLAGS = $(AM_CPPFLAGS) \ - $(PYTHON_CPPFLAGS) \ - $(LIBICAL_CFLAGS) \ - $(bongo_CFLAGS) - -libs_la_LDFLAGS = -avoid-version -module -libs_la_LIBADD = \ - $(PYTHON_LIBS) \ - libbongocal.la \ - libbongocalcmd.la \ - libbongoutil.la \ - libbongo-json.la \ - libbongomsgapi.la \ - libbongostreamio.la - -# src/libs/python/libbongo/mdb.c -bootstrap_la_SOURCES = \ - src/libs/python/libbongo/bootstrap.c \ - src/libs/python/libbongo/bootstrap.h \ - src/libs/python/libbongo/msgapi-defs.c \ - src/libs/python/libbongo/msgapi-defs.h \ - src/libs/python/libbongo/pybongo.c \ - src/libs/python/libbongo/pybongo.h - -bootstrap_la_CPPFLAGS = $(AM_CPPFLAGS) \ - $(PYTHON_CPPFLAGS) \ - $(bongo_CFLAGS) - -bootstrap_la_LDFLAGS = -avoid-version -module -bootstrap_la_LIBADD = \ - $(PYTHON_LIBS) \ - libbongomsgapi.la - -src/libs/python/libbongo/libs.so: libs.la - cp .libs/libs.so $@ - -src/libs/python/libbongo/bootstrap.so: bootstrap.la - cp .libs/bootstrap.so $@ - -noinst_DATA += \ - src/libs/python/libbongo/libs.so \ - src/libs/python/libbongo/bootstrap.so - -CLEANFILES += \ - src/libs/python/libbongo/libs.so \ - src/libs/python/libbongo/bootstrap.so - -src/libs/python/libbongo/all: \ - src/libs/python/libbongo/libs.so \ - src/libs/python/libbongo/bootstrap.so - -src/libs/python/bongo/clean: clean diff --git a/src/libs/python/libbongo/CMakeLists.txt b/src/libs/python/libbongo/CMakeLists.txt new file mode 100644 index 0000000..dfbe23c --- /dev/null +++ b/src/libs/python/libbongo/CMakeLists.txt @@ -0,0 +1,42 @@ +include_directories(AFTER ${PYTHON_INCLUDE_PATH}) + +python_add_module(libs + cal.c + calcmd.c + libs.c + msgapi.c + msgapi-defs.c + pybongo.c + streamio.c + json.c + tests.c + bongoutil.c +) + +python_add_module(bootstrap + bootstrap.c + msgapi-defs.c + pybongo.c +) + +# remove 'lib' prefix from these libraries. +set_target_properties(libs bootstrap + PROPERTIES + PREFIX "" +) + +target_link_libraries(libs + bongonmap + bongomsgapi + bongojson + bongoutil + bongoxpl + bongocal + ${PYTHON_LIBRARIES} +) + +target_link_libraries(bootstrap + ${PYTHON_LIBRARIES} +) + +install(TARGETS libs bootstrap DESTINATION ${PYTHON_SITEPACKAGES_PATH}/libbongo/) diff --git a/src/libs/python/libbongo/Makefile.am b/src/libs/python/libbongo/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/libs/python/libbongo/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/libs/python/libbongo/bongoutil.c b/src/libs/python/libbongo/bongoutil.c index 2174364..426ca92 100755 --- a/src/libs/python/libbongo/bongoutil.c +++ b/src/libs/python/libbongo/bongoutil.c @@ -22,7 +22,6 @@ #include -#include #include #include #include diff --git a/src/libs/python/libbongo/bootstrap.c b/src/libs/python/libbongo/bootstrap.c index 12b795a..01219d0 100644 --- a/src/libs/python/libbongo/bootstrap.c +++ b/src/libs/python/libbongo/bootstrap.c @@ -30,7 +30,6 @@ #include #include "bootstrap.h" #include "msgapi-defs.h" -#include #include #include diff --git a/src/libs/python/libbongo/cal.c b/src/libs/python/libbongo/cal.c index ee45301..ac3be99 100644 --- a/src/libs/python/libbongo/cal.c +++ b/src/libs/python/libbongo/cal.c @@ -1,8 +1,6 @@ #include #include -#include - #include #include #include diff --git a/src/libs/python/libbongo/calcmd.c b/src/libs/python/libbongo/calcmd.c index 0e174cb..5847a6c 100644 --- a/src/libs/python/libbongo/calcmd.c +++ b/src/libs/python/libbongo/calcmd.c @@ -1,6 +1,5 @@ #include -#include #include #include diff --git a/src/libs/python/libbongo/json.c b/src/libs/python/libbongo/json.c index a92efc0..686ed09 100644 --- a/src/libs/python/libbongo/json.c +++ b/src/libs/python/libbongo/json.c @@ -1,7 +1,6 @@ #include #include "structmember.h" -#include #include #include diff --git a/src/libs/python/libbongo/libs.c b/src/libs/python/libbongo/libs.c index 69c908b..db783d8 100644 --- a/src/libs/python/libbongo/libs.c +++ b/src/libs/python/libbongo/libs.c @@ -23,7 +23,6 @@ #include #include "libs.h" #include "pybongo.h" -#include #include #include #include diff --git a/src/libs/python/libbongo/msgapi-defs.h b/src/libs/python/libbongo/msgapi-defs.h index eb74432..d116ddb 100644 --- a/src/libs/python/libbongo/msgapi-defs.h +++ b/src/libs/python/libbongo/msgapi-defs.h @@ -2,7 +2,6 @@ #define PYBONGO_MSGAPI_DEFS_H #include "pybongo.h" -#include #include #include diff --git a/src/libs/python/libbongo/msgapi.c b/src/libs/python/libbongo/msgapi.c index e81813c..b2f57c2 100644 --- a/src/libs/python/libbongo/msgapi.c +++ b/src/libs/python/libbongo/msgapi.c @@ -22,7 +22,6 @@ #include -#include #include #include #include diff --git a/src/libs/python/libbongo/streamio.c b/src/libs/python/libbongo/streamio.c index 705d315..8417895 100644 --- a/src/libs/python/libbongo/streamio.c +++ b/src/libs/python/libbongo/streamio.c @@ -1,6 +1,5 @@ #include -#include #include #include diff --git a/src/libs/python/libbongo/tests.c b/src/libs/python/libbongo/tests.c index fb0fa54..fc065f9 100644 --- a/src/libs/python/libbongo/tests.c +++ b/src/libs/python/libbongo/tests.c @@ -1,7 +1,5 @@ #include -#include - #include "libs.h" #ifdef __cplusplus diff --git a/src/libs/streamio/Bongo.rules b/src/libs/streamio/Bongo.rules deleted file mode 100644 index a162b42..0000000 --- a/src/libs/streamio/Bongo.rules +++ /dev/null @@ -1,18 +0,0 @@ -# -*- Makefile -*- -lib_LTLIBRARIES += libbongostreamio.la - -#libbongostreamio_la_LDFLAGS = -static - -libbongostreamio_la_CPPFLAGS = $(AM_CPPFLAGS) \ - -I$(top_srcdir)/src/libs/streamio/codec - -libbongostreamio_la_SOURCES = \ - src/libs/streamio/streamio.c \ - src/libs/streamio/streamiop.h \ - src/libs/streamio/search.c \ - src/libs/streamio/bongostream.c - -libbongostreamio_la_LIBADD = libbongoutil.la - -src/libs/streamio/all: libbongostreamio.la -src/libs/streamio/clean: clean diff --git a/src/libs/streamio/CMakeLists.txt b/src/libs/streamio/CMakeLists.txt new file mode 100644 index 0000000..a3ac0eb --- /dev/null +++ b/src/libs/streamio/CMakeLists.txt @@ -0,0 +1,6 @@ +add_library(bongostreamio SHARED + streamio.c + search.c + bongostream.c) + +install(TARGETS bongostreamio DESTINATION ${LIB_INSTALL_DIR}) diff --git a/src/libs/streamio/Makefile.am b/src/libs/streamio/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/libs/streamio/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/libs/streamio/codec/Bongo.rules b/src/libs/streamio/codec/Bongo.rules deleted file mode 100644 index 3a149dc..0000000 --- a/src/libs/streamio/codec/Bongo.rules +++ /dev/null @@ -1,75 +0,0 @@ -# -*- Makefile -*- -# This file is autogenerated. -# Run ls | ./write-makefile-am.pl > Bongo.rules to regenerate. - -noinst_HEADERS += \ - src/libs/streamio/codec/ascii.h \ - src/libs/streamio/codec/base64.h \ - src/libs/streamio/codec/big5.h \ - src/libs/streamio/codec/cns11643_1.h \ - src/libs/streamio/codec/cns11643_2.h \ - src/libs/streamio/codec/cns11643_3.h \ - src/libs/streamio/codec/cns11643.h \ - src/libs/streamio/codec/cns11643_inv.h \ - src/libs/streamio/codec/cp1133.h \ - src/libs/streamio/codec/cp1250.h \ - src/libs/streamio/codec/cp1251.h \ - src/libs/streamio/codec/cp1252.h \ - src/libs/streamio/codec/cp1253.h \ - src/libs/streamio/codec/cp1254.h \ - src/libs/streamio/codec/cp1255.h \ - src/libs/streamio/codec/cp1256.h \ - src/libs/streamio/codec/cp1257.h \ - src/libs/streamio/codec/cp1258.h \ - src/libs/streamio/codec/cp850.h \ - src/libs/streamio/codec/cp862.h \ - src/libs/streamio/codec/cp866.h \ - src/libs/streamio/codec/cp874.h \ - src/libs/streamio/codec/crlf.h \ - src/libs/streamio/codec/euc_kr.h \ - src/libs/streamio/codec/euc_tw.h \ - src/libs/streamio/codec/gb2312.h \ - src/libs/streamio/codec/html.h \ - src/libs/streamio/codec/hz.h \ - src/libs/streamio/codec/iso2022_cn.h \ - src/libs/streamio/codec/iso2022_jp.h \ - src/libs/streamio/codec/iso2022_kr.h \ - src/libs/streamio/codec/iso8859_10.h \ - src/libs/streamio/codec/iso8859_13.h \ - src/libs/streamio/codec/iso8859_14.h \ - src/libs/streamio/codec/iso8859_15.h \ - src/libs/streamio/codec/iso8859_16.h \ - src/libs/streamio/codec/iso8859_1.h \ - src/libs/streamio/codec/iso8859_2.h \ - src/libs/streamio/codec/iso8859_3.h \ - src/libs/streamio/codec/iso8859_4.h \ - src/libs/streamio/codec/iso8859_5.h \ - src/libs/streamio/codec/iso8859_6.h \ - src/libs/streamio/codec/iso8859_7.h \ - src/libs/streamio/codec/iso8859_8.h \ - src/libs/streamio/codec/iso8859_9.h \ - src/libs/streamio/codec/jisx0208.h \ - src/libs/streamio/codec/koi8_r.h \ - src/libs/streamio/codec/koi8_ru.h \ - src/libs/streamio/codec/koi8_u.h \ - src/libs/streamio/codec/ksc5601.h \ - src/libs/streamio/codec/q.h \ - src/libs/streamio/codec/qp.h \ - src/libs/streamio/codec/quoted_string.h \ - src/libs/streamio/codec/rfc1522.h \ - src/libs/streamio/codec/rfc2231.h \ - src/libs/streamio/codec/rfc2445.h \ - src/libs/streamio/codec/rfc822.h \ - src/libs/streamio/codec/search.h \ - src/libs/streamio/codec/sjis.h \ - src/libs/streamio/codec/tis620.h \ - src/libs/streamio/codec/ucs_2.h \ - src/libs/streamio/codec/ucs_4.h \ - src/libs/streamio/codec/utf8.h \ - src/libs/streamio/codec/vcard.h \ - src/libs/streamio/codec/viscii.h \ - src/libs/streamio/codec/wml.h \ - $(NULL) - -src/libs/streamio/codec/all: -src/libs/streamio/codec/clean: clean diff --git a/src/libs/streamio/codec/Makefile.am b/src/libs/streamio/codec/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/libs/streamio/codec/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/libs/xpl/Bongo.rules b/src/libs/xpl/Bongo.rules deleted file mode 100644 index f503067..0000000 --- a/src/libs/xpl/Bongo.rules +++ /dev/null @@ -1,21 +0,0 @@ -# -*- Makefile -*- -lib_LTLIBRARIES += libbongoxpl.la - -libbongoxpl_la_SOURCES = \ - src/libs/xpl/dir.c \ - src/libs/xpl/dns.c \ - src/libs/xpl/dns.h \ - src/libs/xpl/fsys.c \ - src/libs/xpl/hash.c \ - src/libs/xpl/ip.c \ - src/libs/xpl/mem.c \ - src/libs/xpl/resolve.c \ - src/libs/xpl/rwlock.c \ - src/libs/xpl/util.c \ - src/libs/xpl/cryptolock.c - -libbongoxpl_la_LIBADD = $(RESOLV_LIBS) -libbongoxpl_la_LDFLAGS = $(PTHREAD_LIBS) $(GNUTLS_LIBS) $(LIBGCRYPT_LIBS) $(KSTAT_LIBS) - -src/libs/xpl/all: libbongoxpl.la -src/libs/xpl/clean: clean diff --git a/src/libs/xpl/CMakeLists.txt b/src/libs/xpl/CMakeLists.txt new file mode 100644 index 0000000..e73bb24 --- /dev/null +++ b/src/libs/xpl/CMakeLists.txt @@ -0,0 +1,19 @@ +add_library(bongoxpl SHARED + dir.c + dns.c + fsys.c + hash.c + ip.c + mem.c + resolve.c + rwlock.c + util.c + cryptolock.c +) + +target_link_libraries(bongoxpl + resolv + ${GCRYPT_LIBRARIES} +) + +install(TARGETS bongoxpl DESTINATION ${LIB_INSTALL_DIR}) diff --git a/src/libs/xpl/Makefile.am b/src/libs/xpl/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/libs/xpl/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/libs/xpl/fsys.c b/src/libs/xpl/fsys.c index 8c780f9..8e1b778 100644 --- a/src/libs/xpl/fsys.c +++ b/src/libs/xpl/fsys.c @@ -250,7 +250,7 @@ XplGetDiskspaceUsed(unsigned char *Path) unsigned long XplGetDiskspaceFree(unsigned char *Path) { -#if HAVE_STATVFS +#ifdef _SYS_STATVFS_H struct statvfs stv; if (statvfs(Path, &stv)==0) { @@ -271,7 +271,7 @@ XplGetDiskspaceFree(unsigned char *Path) unsigned long XplGetDiskBlocksize(unsigned char *Path) { -#if HAVE_STATVFS +#ifdef _SYS_STATVFS_H struct statvfs stv; if (statvfs(Path, &stv)==0) { diff --git a/src/libs/xpl/hash.c b/src/libs/xpl/hash.c index be33aa9..b7ac7c7 100644 --- a/src/libs/xpl/hash.c +++ b/src/libs/xpl/hash.c @@ -7,6 +7,7 @@ */ #include +#include #include #include #include diff --git a/src/libs/xpl/tests/Bongo.rules b/src/libs/xpl/tests/Bongo.rules deleted file mode 100644 index 57d2ca5..0000000 --- a/src/libs/xpl/tests/Bongo.rules +++ /dev/null @@ -1,19 +0,0 @@ -# -*- Makefile -*- -TESTS += checktest-bongoxpl-dns -check_PROGRAMS += checktest-bongoxpl-dns - -dist_noinst_DATA += \ - src/libs/xpl/tests/dns-test.c - -CLEANFILES += \ - src/libs/xpl/tests/checklog.xml - -checktest_bongoxpl_dns_SOURCES = \ - src/libs/xpl/tests/dns-test.c - -checktest_bongoxpl_dns_LDADD = $(CHECK_LIBS) \ - libbongomemmgr.la \ - libbongoxpl.la - -src/libs/xpl/tests/all: -src/libs/xpl/tests/clean: clean diff --git a/src/libs/xpl/tests/Makefile.am b/src/libs/xpl/tests/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/libs/xpl/tests/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/src/www/Bongo.rules b/src/www/Bongo.rules deleted file mode 100644 index 61b3d02..0000000 --- a/src/www/Bongo.rules +++ /dev/null @@ -1,478 +0,0 @@ -# -*- Makefile -*- -htdocsdir = $(pkgdatadir)/htdocs - -dist_htdocs_DATA = \ - src/www/dragonfly.html \ - src/www/dragonfly-debug.html \ - src/www/favicon.ico - -htl10ndir = $(htdocsdir)/l10n -htl10n_DATA = $(htl10n_jsfiles) - -cssdir = $(htdocsdir)/css - -dist_css_DATA = \ - src/www/css/layout.css \ - src/www/css/widgets.css \ - src/www/css/login.css \ - src/www/css/composer.css \ - src/www/css/conversation.css \ - src/www/css/contacts.css \ - src/www/css/calendar.css \ - src/www/css/summary.css \ - src/www/css/print.css \ - src/www/css/admin.css \ - src/www/css/log.css - -screencssdir = $(cssdir) - -compress_script = $(top_srcdir)/src/www/compress.py - -dist_screencss_DATA = \ - src/www/css/screen.css - -src/www/css/screen.css: $(dist_css_DATA) - mkdir -p src/www/css - $(compress_script) -I$(top_srcdir) $(dist_css_DATA) --measure -o src/www/css/screen.css -i $(top_srcdir)/src/www/css/print.css -i $(top_srcdir)src/www/css/admin.css --no-linebreaks - -imgdir = $(htdocsdir)/img - -dist_img_DATA = \ - src/www/img/accessories-text-editor.gif \ - src/www/img/accessories-text-editor.png \ - src/www/img/addressbook-16.png \ - src/www/img/airplane-emblem.png \ - src/www/img/applications-internet.gif \ - src/www/img/applications-internet.png \ - src/www/img/arrow.png \ - src/www/img/ajax-loader.gif \ - src/www/img/bg-button.png \ - src/www/img/bg-button-pressed.png \ - src/www/img/bg-button-selected.png \ - src/www/img/bg-header.png \ - src/www/img/bg-page.png \ - src/www/img/bg-selected.png \ - src/www/img/bg-shine.png \ - src/www/img/bg-side-title-hover.png \ - src/www/img/bg-side-title.png \ - src/www/img/bg-tab-selected.png \ - src/www/img/bg-timestrip.png \ - src/www/img/bg-timestrip-right.png \ - src/www/img/bg-toolbar.png \ - src/www/img/blank.gif \ - src/www/img/calendar-16.gif \ - src/www/img/calendar-16.png \ - src/www/img/cal-offmonth.png \ - src/www/img/cal-selected.png \ - src/www/img/cal-selected-stipple.png \ - src/www/img/cal-today.png \ - src/www/img/cal-today-stipple.png \ - src/www/img/close.gif \ - src/www/img/closed-read.png \ - src/www/img/closed-unread.png \ - src/www/img/contact-16.png \ - src/www/img/contact-new.png \ - src/www/img/contact-unknown.png \ - src/www/img/continued-left.png \ - src/www/img/continued-right.png \ - src/www/img/dialog-information.gif \ - src/www/img/dialog-information.png \ - src/www/img/dragonfly-favicon.png \ - src/www/img/dragonfly.png \ - src/www/img/emblem-readonly.gif \ - src/www/img/emblem-readonly.png \ - src/www/img/event-16.png \ - src/www/img/go-next.png \ - src/www/img/go-previous.png \ - src/www/img/grad-cal.png \ - src/www/img/grad-cal-title.png \ - src/www/img/grad-page.png \ - src/www/img/grad.png \ - src/www/img/grad-tab.png \ - src/www/img/grad-textarea.png \ - src/www/img/grad-toolbar.png \ - src/www/img/big-info.png \ - src/www/img/grippy.png \ - src/www/img/grippy-h.gif \ - src/www/img/grippy-h.png \ - src/www/img/grippy-v.gif \ - src/www/img/grippy-v.png \ - src/www/img/histogram.png \ - src/www/img/home-16.png \ - src/www/img/home-16.gif \ - src/www/img/bongo-favicon.gif \ - src/www/img/bongo-favicon.ico \ - src/www/img/bongo-favicon.png \ - src/www/img/icon-simple-calendars.gif \ - src/www/img/icon-simple-calendars.png \ - src/www/img/icon-simple-contacts.gif \ - src/www/img/icon-simple-contacts.png \ - src/www/img/icon-simple-todos.gif \ - src/www/img/icon-simple-todos.png \ - src/www/img/image-x-generic.png \ - src/www/img/info-bl.gif \ - src/www/img/info-bl.png \ - src/www/img/info-br.gif \ - src/www/img/info-br.png \ - src/www/img/info-cl.gif \ - src/www/img/info-cl.png \ - src/www/img/info-cr.gif \ - src/www/img/info-cr.png \ - src/www/img/info-pointer-down.gif \ - src/www/img/info-pointer-down.png \ - src/www/img/info-pointer-left.gif \ - src/www/img/info-pointer-left.png \ - src/www/img/info-pointer-right.gif \ - src/www/img/info-pointer-right.png \ - src/www/img/info-pointer-up.gif \ - src/www/img/info-pointer-up.png \ - src/www/img/info-tl.gif \ - src/www/img/info-tl.png \ - src/www/img/info-tr.gif \ - src/www/img/info-tr.png \ - src/www/img/lightbulb.png \ - src/www/img/link-underline-view-active.gif \ - src/www/img/link-underline-view.gif \ - src/www/img/login-bg-bottom.png \ - src/www/img/login-bg-middle.png \ - src/www/img/login-bg-top.png \ - src/www/img/login-logo.gif \ - src/www/img/login-logo.png \ - src/www/img/mail-closed-16.png \ - src/www/img/mail-forward-16.png \ - src/www/img/mail-inbox-16.png \ - src/www/img/mail-inbox-22.png \ - src/www/img/mail-reply-all-16.png \ - src/www/img/mail-reply-sender-16.png \ - src/www/img/message-16.gif \ - src/www/img/message-16.png \ - src/www/img/message-closed-16.png \ - src/www/img/minus.png \ - src/www/img/msg-gradient.png \ - src/www/img/navselhilight.png \ - src/www/img/open-read.png \ - src/www/img/open-unread.png \ - src/www/img/plus.png \ - src/www/img/popup.png \ - src/www/img/read-gradient.png \ - src/www/img/sad.png \ - src/www/img/side-bl.png \ - src/www/img/side-br.png \ - src/www/img/side-cl.png \ - src/www/img/side-cr.png \ - src/www/img/side-tl.png \ - src/www/img/side-tr.png \ - src/www/img/star.png \ - src/www/img/star-widget.gif \ - src/www/img/star-widget.png \ - src/www/img/system-search.gif \ - src/www/img/system-search.png \ - src/www/img/text-x-generic.png \ - src/www/img/top-gradient.png \ - src/www/img/unread-gradient.png \ - src/www/img/x.png \ - src/www/img/bg.png \ - src/www/img/Bongo-logo.png \ - src/www/img/cbg.png \ - src/www/img/desktop-big.png \ - src/www/img/dialog-error-32.png \ - src/www/img/dialog-information-32.png \ - src/www/img/dialog-warning.png \ - src/www/img/form_buttons.png \ - src/www/img/form_buttons.gif \ - src/www/img/help-browser.png \ - src/www/img/locked.png \ - src/www/img/locale.png \ - src/www/img/login-pane.png \ - src/www/img/network-server.png \ - src/www/img/sel.png \ - src/www/img/sbg.png \ - src/www/img/system-installer.png \ - src/www/img/system-users.png \ - src/www/img/user.png \ - src/www/img/user-desktop.png \ - src/www/img/agent-control.png \ - src/www/img/agent-bongoimap.png \ - src/www/img/agent-bongomailprox.png \ - src/www/img/agent-bongopluspack.png \ - src/www/img/agent-bongopop3.png \ - src/www/img/agent-bongosmtp.png \ - src/www/img/agent-bongoantispam.png \ - src/www/img/agent-bongoavirus.png \ - src/www/img/agent-bongocalcmd.png \ - src/www/img/agent-bongocollector.png \ - src/www/img/agent-bongoqueue.png \ - src/www/img/agent-global.png \ - src/www/img/agent-unknown.png \ - src/www/img/list-add.png \ - src/www/img/list-remove.png \ - src/www/img/document-properties.png \ - src/www/img/document-delete.png - -jsdir = $(htdocsdir)/js - -# These *must* be in the order in which they get loaded in the browser -dist_js_DATA = \ - src/www/js/Dragonfly.js \ - src/www/js/Format.js \ - src/www/js/Gettext.js \ - src/www/js/Cookie.js \ - src/www/js/Location.js \ - src/www/js/Login.js \ - src/www/js/Util.js \ - src/www/js/Widgets.js \ - src/www/js/ValidatingEntry.js \ - src/www/js/Preferences.js \ - src/www/js/AddressBook.js \ - src/www/js/JCal.js \ - src/www/js/Calendar.js \ - src/www/js/BongoCalendar.js \ - src/www/js/CalendarEditor.js \ - src/www/js/OccurrenceEditor.js \ - src/www/js/CalendarView.js \ - src/www/js/CalendarLayout.js \ - src/www/js/CalendarDrag.js \ - src/www/js/CalendarWidgets.js \ - src/www/js/Summary.js \ - src/www/js/Search.js \ - src/www/js/Mail.js \ - src/www/js/MailWidgets.js \ - src/www/js/Composer.js \ - src/www/js/MailConversationView.js \ - src/www/js/MailListView.js \ - src/www/js/Browser.js \ - src/www/js/BrowserCheck.js \ - src/www/js/Admin.js \ - src/www/js/Log.js - -eAreadir = $(htdocsdir)/js/eArea - -dist_eArea_DATA = \ - src/www/js/eArea/editableArea.js \ - src/www/js/eArea/blank.html - -eAreaimagedir = $(htdocsdir)/js/eArea/icons - -dist_eAreaimage_DATA = \ - src/www/js/eArea/icons/edit-select-all.png \ - src/www/js/eArea/icons/edit-undo.png \ - src/www/js/eArea/icons/edit-redo.png \ - src/www/js/eArea/icons/format-justify-center.png \ - src/www/js/eArea/icons/format-justify-left.png \ - src/www/js/eArea/icons/format-justify-right.png \ - src/www/js/eArea/icons/format-justify-fill.png \ - src/www/js/eArea/icons/format-text-bold.png \ - src/www/js/eArea/icons/format-text-italic.png \ - src/www/js/eArea/icons/format-text-underline.png \ - src/www/js/eArea/icons/format-indent-more.png \ - src/www/js/eArea/icons/format-indent-less.png \ - src/www/js/eArea/icons/insert-image.png \ - src/www/js/eArea/icons/insert-link.png \ - src/www/js/eArea/icons/switch-mode.png - -plugindir = $(htdocsdir)/plugins - -dist_plugin_DATA = \ - src/www/plugins/example.js - -prototypedir = $(jsdir)/lib/prototype - -dist_prototype_DATA = \ - src/www/js/lib/prototype/prototype.js - -mochidir = $(jsdir)/lib/MochiKit - -# These *must* be in the order in which they get loaded in the browser/MochiKit -dist_mochi_DATA = \ - src/www/js/lib/MochiKit/Base.js \ - src/www/js/lib/MochiKit/Iter.js \ - src/www/js/lib/MochiKit/DateTime.js \ - src/www/js/lib/MochiKit/Format.js \ - src/www/js/lib/MochiKit/Async.js \ - src/www/js/lib/MochiKit/DOM.js \ - src/www/js/lib/MochiKit/Color.js \ - src/www/js/lib/MochiKit/Signal.js \ - src/www/js/lib/MochiKit/Visual.js \ - src/www/js/lib/MochiKit/MochiKit.js - -scriptaculousdir = $(jsdir)/lib/script.aculo.us - -# Same as with above JS. -dist_scriptaculous_DATA = \ - src/www/js/lib/script.aculo.us/effects.js \ - src/www/js/lib/script.aculo.us/controls.js - -finaljsdir = $(jsdir) - -dist_finaljs_DATA = \ - src/www/js/final.js - -src/www/js/final.js: $(dist_js_DATA) $(dist_prototype_DATA) $(dist_scriptaculous_DATA) $(dist_mochi_DATA) - mkdir -p src/www/js - $(compress_script) -I$(top_srcdir) $(dist_prototype_DATA) $(dist_scriptaculous_DATA) $(dist_mochi_DATA) $(dist_js_DATA) src/www/js/eArea/editableArea.js -o src/www/js/final.js --measure --type js -i src/www/js/Admin.js -i src/www/js/Browser.js -i src/www/js/BrowserCheck.js - -install-data-local:: install-dist_htdocsDATA - ln -sf dragonfly.html "$(DESTDIR)$(htdocsdir)/index.html" - -pkgpythondragonflydir = $(pkgpythondir)/dragonfly - -pkgpythondragonfly_PYTHON = \ - src/www/bongo/dragonfly/__init__.py \ - src/www/bongo/dragonfly/AddressbookView.py \ - src/www/bongo/dragonfly/Auth.py \ - src/www/bongo/dragonfly/CalendarView.py \ - src/www/bongo/dragonfly/Composer.py \ - src/www/bongo/dragonfly/MailView.py \ - src/www/bongo/dragonfly/PreferencesView.py \ - src/www/bongo/dragonfly/ResourceHandler.py \ - src/www/bongo/dragonfly/ResourcePath.py \ - src/www/bongo/dragonfly/Server.py \ - src/www/bongo/dragonfly/SmsHandler.py \ - src/www/bongo/dragonfly/SummaryView.py - -pkgpythonhawkeyedir = $(pkgpythondir)/hawkeye - -pkgpythonhawkeye_PYTHON = \ - src/www/bongo/hawkeye/__init__.py \ - src/www/bongo/hawkeye/AgentView.py \ - src/www/bongo/hawkeye/AliasView.py \ - src/www/bongo/hawkeye/BackupView.py \ - src/www/bongo/hawkeye/HawkeyeHandler.py \ - src/www/bongo/hawkeye/HawkeyePath.py \ - src/www/bongo/hawkeye/SystemView.py \ - src/www/bongo/hawkeye/RootView.py \ - src/www/bongo/hawkeye/Server.py \ - src/www/bongo/hawkeye/ServerView.py \ - src/www/bongo/hawkeye/UsersView.py - -pkgpythonsundialdir = $(pkgpythondir)/sundial - -pkgpythonsundial_PYTHON := \ - src/www/bongo/sundial/__init__.py \ - src/www/bongo/sundial/SundialHandler.py \ - src/www/bongo/sundial/SundialPath.py \ - src/www/bongo/sundial/GetView.py \ - src/www/bongo/sundial/PropfindView.py \ - src/www/bongo/sundial/OptionsView.py \ - src/www/bongo/sundial/ReportView.py \ - src/www/bongo/sundial/DeleteView.py \ - src/www/bongo/sundial/PutView.py \ - src/www/bongo/sundial/Server.py - -pkgpythoncommonwebdir = $(pkgpythondir)/commonweb - -pkgpythoncommonweb_PYTHON = \ - src/www/bongo/commonweb/__init__.py \ - src/www/bongo/commonweb/Auth.py \ - src/www/bongo/commonweb/HttpError.py \ - src/www/bongo/commonweb/ApacheLogHandler.py \ - src/www/bongo/commonweb/BongoCookie.py \ - src/www/bongo/commonweb/BongoFieldStorage.py \ - src/www/bongo/commonweb/BongoUtil.py \ - src/www/bongo/commonweb/Standalone.py \ - src/www/bongo/commonweb/BongoSession.py \ - src/www/bongo/commonweb/ElementTree.py - -hawkeyetplrootdir = $(htdocsdir)/hawkeye/root -dist_hawkeyetplroot_DATA = \ - src/www/hawkeye/root/login.tpl \ - src/www/hawkeye/root/test.tpl \ - src/www/hawkeye/root/test-hello.tpl \ - src/www/hawkeye/root/index.tpl - -hawkeyetplbackupdir = $(htdocsdir)/hawkeye/backup -dist_hawkeyetplbackup_DATA = \ - src/www/hawkeye/backup/index.tpl - -hawkeyetplserverdir = $(htdocsdir)/hawkeye/server -dist_hawkeyetplserver_DATA = \ - src/www/hawkeye/server/index.tpl - -hawkeyetplsystemdir = $(htdocsdir)/hawkeye/system -dist_hawkeyetplsystem_DATA = \ - src/www/hawkeye/system/index.tpl - -hawkeyetplagentsdir = $(htdocsdir)/hawkeye/agents -dist_hawkeyetplagents_DATA = \ - src/www/hawkeye/agents/index.tpl \ - src/www/hawkeye/agents/agentview.tpl - -hawkeyetplaliasesdir = $(htdocsdir)/hawkeye/aliases -dist_hawkeyetplaliases_DATA = \ - src/www/hawkeye/aliases/index.tpl \ - src/www/hawkeye/aliases/edit.tpl \ - src/www/hawkeye/aliases/confirmdelete.tpl - -hawkeyetpldir = $(htdocsdir)/hawkeye -dist_hawkeyetpl_DATA = \ - src/www/hawkeye/footer.tpl \ - src/www/hawkeye/header.tpl - -src/www/bongo-standalone: $(top_builddir)/src/libs/python/bongo-python-wrapper - $(INSTALL) -m 755 $< $@ - -dist_pkglibexec_SCRIPTS += src/www/bongo-standalone.py - -sbin_SCRIPTS += \ - src/www/bongo-standalone - -dist_noinst_SCRIPTS += \ - src/www/l10n/po2json \ - src/www/compress.py - -templatesdir = $(pkgdatadir)/templates - -dist_templates_DATA = \ - src/www/templates/month-view.html \ - src/www/templates/event.html - -exampledir = $(pkgdatadir)/examples - -example_DATA = \ - src/www/bongo.conf - -dist_noinst_DATA += \ - src/www/js/lib/prototype/LICENSE \ - src/www/js/lib/MochiKit/LICENSE.txt \ - src/www/js/lib/script.aculo.us/MIT-LICENSE \ - src/www/bongo/__init__.py.in \ - src/www/bongo-devel.conf - -noinst_DATA += \ - src/www/bongo/__init__.py - -src/www/bongo/__init__.py: src/www/bongo/__init__.py.in $(top_srcdir)/src/libs/python/bongo/__init__.py - cp $< $(top_srcdir)/$@.tmp - cat $(top_srcdir)/src/libs/python/bongo/__init__.py >> $(top_srcdir)/$@.tmp - mv $(top_srcdir)/$@.tmp $(top_srcdir)/$@ - -src/www/bongo-devel.conf: src/www/bongo.conf.in Makefile - sed -e "s%\@DATADIR\@/\@PACKAGE\@/htdocs%${top_srcdir}/src/www%" \ - -e "s%\@APACHE_MOD_DIR\@%${APACHE_MOD_DIR}%" \ - -e "s%\@PYTHONDIR\@%${top_srcdir}/src/www%" \ - -e "s%\@SHARED_POSTFIX\@%${SHARED_POSTFIX}%" \ - -e "s%\@DATADIR\@/\@PACKAGE\@/hawkeye%${top_srcdir}/src/www/hawkeye%" \ - $< > $@ - -po2json = $(top_srcdir)/src/www/l10n/po2json - -src/www/l10n/%.js: po/bongo-web/%.mo config.status - mkdir -p src/www/l10n - $(po2json) -p $(top_srcdir)/po/bongo-web/$*.po -o $(top_srcdir)/$@ - -# This generates no translation. It simply does msgid:msgid on the potfile. -src/www/l10n/en.js: config.status - mkdir -p src/www/l10n - $(po2json) -p $(top_srcdir)/po/bongo-web.pot -o $(top_srcdir)/$@ --en - -CLEANFILES += \ - src/www/bongo-standalone \ - src/www/*.pyc \ - src/www/bongo/__init__.py \ - src/www/bongo-devel.conf \ - src/www/bongo/*.pyc \ - src/www/bongo/__init__.py \ - src/www/bongo/dragonfly/*.pyc - -src/www/all: src/www/bongo/__init__.py src/www/bongo-devel.conf src/www/bongo.conf -src/www/clean: clean diff --git a/src/www/Makefile.am b/src/www/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/src/www/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@ diff --git a/zoneinfo/Bongo.rules b/zoneinfo/Bongo.rules deleted file mode 100644 index 02a47b0..0000000 --- a/zoneinfo/Bongo.rules +++ /dev/null @@ -1,405 +0,0 @@ -## This file is autogenerated by update-zoneinfo.sh -nobase_dist_pkgdata_DATA += \ - zoneinfo/Africa-Abidjan.zone \ - zoneinfo/Africa-Accra.zone \ - zoneinfo/Africa-Addis_Ababa.zone \ - zoneinfo/Africa-Algiers.zone \ - zoneinfo/Africa-Asmara.zone \ - zoneinfo/Africa-Bamako.zone \ - zoneinfo/Africa-Bangui.zone \ - zoneinfo/Africa-Banjul.zone \ - zoneinfo/Africa-Bissau.zone \ - zoneinfo/Africa-Blantyre.zone \ - zoneinfo/Africa-Brazzaville.zone \ - zoneinfo/Africa-Bujumbura.zone \ - zoneinfo/Africa-Cairo.zone \ - zoneinfo/Africa-Casablanca.zone \ - zoneinfo/Africa-Ceuta.zone \ - zoneinfo/Africa-Conakry.zone \ - zoneinfo/Africa-Dakar.zone \ - zoneinfo/Africa-Dar_es_Salaam.zone \ - zoneinfo/Africa-Djibouti.zone \ - zoneinfo/Africa-Douala.zone \ - zoneinfo/Africa-El_Aaiun.zone \ - zoneinfo/Africa-Freetown.zone \ - zoneinfo/Africa-Gaborone.zone \ - zoneinfo/Africa-Harare.zone \ - zoneinfo/Africa-Johannesburg.zone \ - zoneinfo/Africa-Kampala.zone \ - zoneinfo/Africa-Khartoum.zone \ - zoneinfo/Africa-Kigali.zone \ - zoneinfo/Africa-Kinshasa.zone \ - zoneinfo/Africa-Lagos.zone \ - zoneinfo/Africa-Libreville.zone \ - zoneinfo/Africa-Lome.zone \ - zoneinfo/Africa-Luanda.zone \ - zoneinfo/Africa-Lubumbashi.zone \ - zoneinfo/Africa-Lusaka.zone \ - zoneinfo/Africa-Malabo.zone \ - zoneinfo/Africa-Maputo.zone \ - zoneinfo/Africa-Maseru.zone \ - zoneinfo/Africa-Mbabane.zone \ - zoneinfo/Africa-Mogadishu.zone \ - zoneinfo/Africa-Monrovia.zone \ - zoneinfo/Africa-Nairobi.zone \ - zoneinfo/Africa-Ndjamena.zone \ - zoneinfo/Africa-Niamey.zone \ - zoneinfo/Africa-Nouakchott.zone \ - zoneinfo/Africa-Ouagadougou.zone \ - zoneinfo/Africa-Porto-Novo.zone \ - zoneinfo/Africa-Sao_Tome.zone \ - zoneinfo/Africa-Tripoli.zone \ - zoneinfo/Africa-Tunis.zone \ - zoneinfo/Africa-Windhoek.zone \ - zoneinfo/America-Adak.zone \ - zoneinfo/America-Anchorage.zone \ - zoneinfo/America-Anguilla.zone \ - zoneinfo/America-Antigua.zone \ - zoneinfo/America-Araguaina.zone \ - zoneinfo/America-Argentina-Buenos_Aires.zone \ - zoneinfo/America-Argentina-Catamarca.zone \ - zoneinfo/America-Argentina-Cordoba.zone \ - zoneinfo/America-Argentina-Jujuy.zone \ - zoneinfo/America-Argentina-La_Rioja.zone \ - zoneinfo/America-Argentina-Mendoza.zone \ - zoneinfo/America-Argentina-Rio_Gallegos.zone \ - zoneinfo/America-Argentina-San_Juan.zone \ - zoneinfo/America-Argentina-Tucuman.zone \ - zoneinfo/America-Argentina-Ushuaia.zone \ - zoneinfo/America-Aruba.zone \ - zoneinfo/America-Asuncion.zone \ - zoneinfo/America-Atikokan.zone \ - zoneinfo/America-Bahia.zone \ - zoneinfo/America-Barbados.zone \ - zoneinfo/America-Belem.zone \ - zoneinfo/America-Belize.zone \ - zoneinfo/America-Blanc-Sablon.zone \ - zoneinfo/America-Boa_Vista.zone \ - zoneinfo/America-Bogota.zone \ - zoneinfo/America-Boise.zone \ - zoneinfo/America-Cambridge_Bay.zone \ - zoneinfo/America-Campo_Grande.zone \ - zoneinfo/America-Cancun.zone \ - zoneinfo/America-Caracas.zone \ - zoneinfo/America-Cayenne.zone \ - zoneinfo/America-Cayman.zone \ - zoneinfo/America-Chicago.zone \ - zoneinfo/America-Chihuahua.zone \ - zoneinfo/America-Costa_Rica.zone \ - zoneinfo/America-Cuiaba.zone \ - zoneinfo/America-Curacao.zone \ - zoneinfo/America-Danmarkshavn.zone \ - zoneinfo/America-Dawson_Creek.zone \ - zoneinfo/America-Dawson.zone \ - zoneinfo/America-Denver.zone \ - zoneinfo/America-Detroit.zone \ - zoneinfo/America-Dominica.zone \ - zoneinfo/America-Edmonton.zone \ - zoneinfo/America-Eirunepe.zone \ - zoneinfo/America-El_Salvador.zone \ - zoneinfo/America-Fortaleza.zone \ - zoneinfo/America-Glace_Bay.zone \ - zoneinfo/America-Godthab.zone \ - zoneinfo/America-Goose_Bay.zone \ - zoneinfo/America-Grand_Turk.zone \ - zoneinfo/America-Grenada.zone \ - zoneinfo/America-Guadeloupe.zone \ - zoneinfo/America-Guatemala.zone \ - zoneinfo/America-Guayaquil.zone \ - zoneinfo/America-Guyana.zone \ - zoneinfo/America-Halifax.zone \ - zoneinfo/America-Havana.zone \ - zoneinfo/America-Hermosillo.zone \ - zoneinfo/America-Indiana-Indianapolis.zone \ - zoneinfo/America-Indiana-Knox.zone \ - zoneinfo/America-Indiana-Marengo.zone \ - zoneinfo/America-Indiana-Petersburg.zone \ - zoneinfo/America-Indiana-Vevay.zone \ - zoneinfo/America-Indiana-Vincennes.zone \ - zoneinfo/America-Inuvik.zone \ - zoneinfo/America-Iqaluit.zone \ - zoneinfo/America-Jamaica.zone \ - zoneinfo/America-Juneau.zone \ - zoneinfo/America-Kentucky-Louisville.zone \ - zoneinfo/America-Kentucky-Monticello.zone \ - zoneinfo/America-La_Paz.zone \ - zoneinfo/America-Lima.zone \ - zoneinfo/America-Los_Angeles.zone \ - zoneinfo/America-Maceio.zone \ - zoneinfo/America-Managua.zone \ - zoneinfo/America-Manaus.zone \ - zoneinfo/America-Martinique.zone \ - zoneinfo/America-Mazatlan.zone \ - zoneinfo/America-Menominee.zone \ - zoneinfo/America-Merida.zone \ - zoneinfo/America-Mexico_City.zone \ - zoneinfo/America-Miquelon.zone \ - zoneinfo/America-Moncton.zone \ - zoneinfo/America-Monterrey.zone \ - zoneinfo/America-Montevideo.zone \ - zoneinfo/America-Montreal.zone \ - zoneinfo/America-Montserrat.zone \ - zoneinfo/America-Nassau.zone \ - zoneinfo/America-New_York.zone \ - zoneinfo/America-Nipigon.zone \ - zoneinfo/America-Nome.zone \ - zoneinfo/America-Noronha.zone \ - zoneinfo/America-North_Dakota-Center.zone \ - zoneinfo/America-North_Dakota-New_Salem.zone \ - zoneinfo/America-Panama.zone \ - zoneinfo/America-Pangnirtung.zone \ - zoneinfo/America-Paramaribo.zone \ - zoneinfo/America-Phoenix.zone \ - zoneinfo/America-Port-au-Prince.zone \ - zoneinfo/America-Port_of_Spain.zone \ - zoneinfo/America-Porto_Velho.zone \ - zoneinfo/America-Puerto_Rico.zone \ - zoneinfo/America-Rainy_River.zone \ - zoneinfo/America-Rankin_Inlet.zone \ - zoneinfo/America-Recife.zone \ - zoneinfo/America-Regina.zone \ - zoneinfo/America-Rio_Branco.zone \ - zoneinfo/America-Santiago.zone \ - zoneinfo/America-Santo_Domingo.zone \ - zoneinfo/America-Sao_Paulo.zone \ - zoneinfo/America-Scoresbysund.zone \ - zoneinfo/America-Shiprock.zone \ - zoneinfo/America-St_Johns.zone \ - zoneinfo/America-St_Kitts.zone \ - zoneinfo/America-St_Lucia.zone \ - zoneinfo/America-St_Thomas.zone \ - zoneinfo/America-St_Vincent.zone \ - zoneinfo/America-Swift_Current.zone \ - zoneinfo/America-Tegucigalpa.zone \ - zoneinfo/America-Thule.zone \ - zoneinfo/America-Thunder_Bay.zone \ - zoneinfo/America-Tijuana.zone \ - zoneinfo/America-Toronto.zone \ - zoneinfo/America-Tortola.zone \ - zoneinfo/America-Vancouver.zone \ - zoneinfo/America-Whitehorse.zone \ - zoneinfo/America-Winnipeg.zone \ - zoneinfo/America-Yakutat.zone \ - zoneinfo/America-Yellowknife.zone \ - zoneinfo/Antarctica-Casey.zone \ - zoneinfo/Antarctica-Davis.zone \ - zoneinfo/Antarctica-DumontDUrville.zone \ - zoneinfo/Antarctica-Mawson.zone \ - zoneinfo/Antarctica-McMurdo.zone \ - zoneinfo/Antarctica-Palmer.zone \ - zoneinfo/Antarctica-Rothera.zone \ - zoneinfo/Antarctica-South_Pole.zone \ - zoneinfo/Antarctica-Syowa.zone \ - zoneinfo/Antarctica-Vostok.zone \ - zoneinfo/Arctic-Longyearbyen.zone \ - zoneinfo/Asia-Aden.zone \ - zoneinfo/Asia-Almaty.zone \ - zoneinfo/Asia-Amman.zone \ - zoneinfo/Asia-Anadyr.zone \ - zoneinfo/Asia-Aqtau.zone \ - zoneinfo/Asia-Aqtobe.zone \ - zoneinfo/Asia-Ashgabat.zone \ - zoneinfo/Asia-Baghdad.zone \ - zoneinfo/Asia-Bahrain.zone \ - zoneinfo/Asia-Baku.zone \ - zoneinfo/Asia-Bangkok.zone \ - zoneinfo/Asia-Beirut.zone \ - zoneinfo/Asia-Bishkek.zone \ - zoneinfo/Asia-Brunei.zone \ - zoneinfo/Asia-Calcutta.zone \ - zoneinfo/Asia-Choibalsan.zone \ - zoneinfo/Asia-Chongqing.zone \ - zoneinfo/Asia-Colombo.zone \ - zoneinfo/Asia-Damascus.zone \ - zoneinfo/Asia-Dhaka.zone \ - zoneinfo/Asia-Dili.zone \ - zoneinfo/Asia-Dubai.zone \ - zoneinfo/Asia-Dushanbe.zone \ - zoneinfo/Asia-Gaza.zone \ - zoneinfo/Asia-Harbin.zone \ - zoneinfo/Asia-Hong_Kong.zone \ - zoneinfo/Asia-Hovd.zone \ - zoneinfo/Asia-Irkutsk.zone \ - zoneinfo/Asia-Istanbul.zone \ - zoneinfo/Asia-Jakarta.zone \ - zoneinfo/Asia-Jayapura.zone \ - zoneinfo/Asia-Jerusalem.zone \ - zoneinfo/Asia-Kabul.zone \ - zoneinfo/Asia-Kamchatka.zone \ - zoneinfo/Asia-Karachi.zone \ - zoneinfo/Asia-Kashgar.zone \ - zoneinfo/Asia-Katmandu.zone \ - zoneinfo/Asia-Krasnoyarsk.zone \ - zoneinfo/Asia-Kuala_Lumpur.zone \ - zoneinfo/Asia-Kuching.zone \ - zoneinfo/Asia-Kuwait.zone \ - zoneinfo/Asia-Macau.zone \ - zoneinfo/Asia-Magadan.zone \ - zoneinfo/Asia-Makassar.zone \ - zoneinfo/Asia-Manila.zone \ - zoneinfo/Asia-Muscat.zone \ - zoneinfo/Asia-Nicosia.zone \ - zoneinfo/Asia-Novosibirsk.zone \ - zoneinfo/Asia-Omsk.zone \ - zoneinfo/Asia-Oral.zone \ - zoneinfo/Asia-Phnom_Penh.zone \ - zoneinfo/Asia-Pontianak.zone \ - zoneinfo/Asia-Pyongyang.zone \ - zoneinfo/Asia-Qatar.zone \ - zoneinfo/Asia-Qyzylorda.zone \ - zoneinfo/Asia-Rangoon.zone \ - zoneinfo/Asia-Riyadh.zone \ - zoneinfo/Asia-Saigon.zone \ - zoneinfo/Asia-Sakhalin.zone \ - zoneinfo/Asia-Samarkand.zone \ - zoneinfo/Asia-Seoul.zone \ - zoneinfo/Asia-Shanghai.zone \ - zoneinfo/Asia-Singapore.zone \ - zoneinfo/Asia-Taipei.zone \ - zoneinfo/Asia-Tashkent.zone \ - zoneinfo/Asia-Tbilisi.zone \ - zoneinfo/Asia-Tehran.zone \ - zoneinfo/Asia-Thimphu.zone \ - zoneinfo/Asia-Tokyo.zone \ - zoneinfo/Asia-Ulaanbaatar.zone \ - zoneinfo/Asia-Urumqi.zone \ - zoneinfo/Asia-Vientiane.zone \ - zoneinfo/Asia-Vladivostok.zone \ - zoneinfo/Asia-Yakutsk.zone \ - zoneinfo/Asia-Yekaterinburg.zone \ - zoneinfo/Asia-Yerevan.zone \ - zoneinfo/Atlantic-Azores.zone \ - zoneinfo/Atlantic-Bermuda.zone \ - zoneinfo/Atlantic-Canary.zone \ - zoneinfo/Atlantic-Cape_Verde.zone \ - zoneinfo/Atlantic-Faroe.zone \ - zoneinfo/Atlantic-Jan_Mayen.zone \ - zoneinfo/Atlantic-Madeira.zone \ - zoneinfo/Atlantic-Reykjavik.zone \ - zoneinfo/Atlantic-South_Georgia.zone \ - zoneinfo/Atlantic-Stanley.zone \ - zoneinfo/Atlantic-St_Helena.zone \ - zoneinfo/Australia-Adelaide.zone \ - zoneinfo/Australia-Brisbane.zone \ - zoneinfo/Australia-Broken_Hill.zone \ - zoneinfo/Australia-Currie.zone \ - zoneinfo/Australia-Darwin.zone \ - zoneinfo/Australia-Eucla.zone \ - zoneinfo/Australia-Hobart.zone \ - zoneinfo/Australia-Lindeman.zone \ - zoneinfo/Australia-Lord_Howe.zone \ - zoneinfo/Australia-Melbourne.zone \ - zoneinfo/Australia-Perth.zone \ - zoneinfo/Australia-Sydney.zone \ - zoneinfo/Europe-Amsterdam.zone \ - zoneinfo/Europe-Andorra.zone \ - zoneinfo/Europe-Athens.zone \ - zoneinfo/Europe-Belgrade.zone \ - zoneinfo/Europe-Berlin.zone \ - zoneinfo/Europe-Bratislava.zone \ - zoneinfo/Europe-Brussels.zone \ - zoneinfo/Europe-Bucharest.zone \ - zoneinfo/Europe-Budapest.zone \ - zoneinfo/Europe-Chisinau.zone \ - zoneinfo/Europe-Copenhagen.zone \ - zoneinfo/Europe-Dublin.zone \ - zoneinfo/Europe-Gibraltar.zone \ - zoneinfo/Europe-Guernsey.zone \ - zoneinfo/Europe-Helsinki.zone \ - zoneinfo/Europe-Isle_of_Man.zone \ - zoneinfo/Europe-Istanbul.zone \ - zoneinfo/Europe-Jersey.zone \ - zoneinfo/Europe-Kaliningrad.zone \ - zoneinfo/Europe-Kiev.zone \ - zoneinfo/Europe-Lisbon.zone \ - zoneinfo/Europe-Ljubljana.zone \ - zoneinfo/Europe-London.zone \ - zoneinfo/Europe-Luxembourg.zone \ - zoneinfo/Europe-Madrid.zone \ - zoneinfo/Europe-Malta.zone \ - zoneinfo/Europe-Mariehamn.zone \ - zoneinfo/Europe-Minsk.zone \ - zoneinfo/Europe-Monaco.zone \ - zoneinfo/Europe-Moscow.zone \ - zoneinfo/Europe-Nicosia.zone \ - zoneinfo/Europe-Oslo.zone \ - zoneinfo/Europe-Paris.zone \ - zoneinfo/Europe-Podgorica.zone \ - zoneinfo/Europe-Prague.zone \ - zoneinfo/Europe-Riga.zone \ - zoneinfo/Europe-Rome.zone \ - zoneinfo/Europe-Samara.zone \ - zoneinfo/Europe-San_Marino.zone \ - zoneinfo/Europe-Sarajevo.zone \ - zoneinfo/Europe-Simferopol.zone \ - zoneinfo/Europe-Skopje.zone \ - zoneinfo/Europe-Sofia.zone \ - zoneinfo/Europe-Stockholm.zone \ - zoneinfo/Europe-Tallinn.zone \ - zoneinfo/Europe-Tirane.zone \ - zoneinfo/Europe-Uzhgorod.zone \ - zoneinfo/Europe-Vaduz.zone \ - zoneinfo/Europe-Vatican.zone \ - zoneinfo/Europe-Vienna.zone \ - zoneinfo/Europe-Vilnius.zone \ - zoneinfo/Europe-Volgograd.zone \ - zoneinfo/Europe-Warsaw.zone \ - zoneinfo/Europe-Zagreb.zone \ - zoneinfo/Europe-Zaporozhye.zone \ - zoneinfo/Europe-Zurich.zone \ - zoneinfo/Indian-Antananarivo.zone \ - zoneinfo/Indian-Chagos.zone \ - zoneinfo/Indian-Christmas.zone \ - zoneinfo/Indian-Cocos.zone \ - zoneinfo/Indian-Comoro.zone \ - zoneinfo/Indian-Kerguelen.zone \ - zoneinfo/Indian-Mahe.zone \ - zoneinfo/Indian-Maldives.zone \ - zoneinfo/Indian-Mauritius.zone \ - zoneinfo/Indian-Mayotte.zone \ - zoneinfo/Indian-Reunion.zone \ - zoneinfo/Pacific-Apia.zone \ - zoneinfo/Pacific-Auckland.zone \ - zoneinfo/Pacific-Chatham.zone \ - zoneinfo/Pacific-Easter.zone \ - zoneinfo/Pacific-Efate.zone \ - zoneinfo/Pacific-Enderbury.zone \ - zoneinfo/Pacific-Fakaofo.zone \ - zoneinfo/Pacific-Fiji.zone \ - zoneinfo/Pacific-Funafuti.zone \ - zoneinfo/Pacific-Galapagos.zone \ - zoneinfo/Pacific-Gambier.zone \ - zoneinfo/Pacific-Guadalcanal.zone \ - zoneinfo/Pacific-Guam.zone \ - zoneinfo/Pacific-Honolulu.zone \ - zoneinfo/Pacific-Johnston.zone \ - zoneinfo/Pacific-Kiritimati.zone \ - zoneinfo/Pacific-Kosrae.zone \ - zoneinfo/Pacific-Kwajalein.zone \ - zoneinfo/Pacific-Majuro.zone \ - zoneinfo/Pacific-Marquesas.zone \ - zoneinfo/Pacific-Midway.zone \ - zoneinfo/Pacific-Nauru.zone \ - zoneinfo/Pacific-Niue.zone \ - zoneinfo/Pacific-Norfolk.zone \ - zoneinfo/Pacific-Noumea.zone \ - zoneinfo/Pacific-Pago_Pago.zone \ - zoneinfo/Pacific-Palau.zone \ - zoneinfo/Pacific-Pitcairn.zone \ - zoneinfo/Pacific-Ponape.zone \ - zoneinfo/Pacific-Port_Moresby.zone \ - zoneinfo/Pacific-Rarotonga.zone \ - zoneinfo/Pacific-Saipan.zone \ - zoneinfo/Pacific-Tahiti.zone \ - zoneinfo/Pacific-Tarawa.zone \ - zoneinfo/Pacific-Tongatapu.zone \ - zoneinfo/Pacific-Truk.zone \ - zoneinfo/Pacific-Wake.zone \ - zoneinfo/Pacific-Wallis.zone \ - zoneinfo/generated.tznames \ - zoneinfo/america.tznames \ - $(NULL) - -zoneinfo/all: - -zoneinfo/clean: clean diff --git a/zoneinfo/Makefile.am b/zoneinfo/Makefile.am deleted file mode 100644 index 8830401..0000000 --- a/zoneinfo/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Makefile -*- -# -# Do not edit! -# -# (unless this is Makefile.am.subdir) -# -# This file is a copy of the toplevel Makefile.am.subdir. If changes -# need to be made, edit that file, and make update-makefiles, and -# check the new files in. -# -# This is a skeletal automake file. The real automake fules for -# building the targets for this directory can be found in the -# Bongo.rules file. This file is simply here so that 'make all' can -# work in each subdirectory. - -all clean install: - @cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@