Code

From: Sebastian Harl sh tokkee.org
authoroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Sun, 8 Jun 2008 15:55:09 +0000 (15:55 +0000)
committeroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Sun, 8 Jun 2008 15:55:09 +0000 (15:55 +0000)
commit636aa385717a0d5c88f025adb793bd90200a6d1f
tree6badb324b8f0c3c4ac699fb95862c08c199fe16f
parentc3fbac008ec626bf18e22caedff37fbbcef91b15
From: Sebastian Harl sh tokkee.org
Date: Sun, 8 Jun 2008 15:01:05 +0200
Subject: [PATCH] Cleanup the symbols exported by librrd.

Up to know librrd exported a lot of symbols, most of which are to be
regarded as private symbols. This somewhat pollutes the API as the symbols
could, in theory, be used by external software and, more importantly,
makes symbol based dependencies (as recently introduced in e.g. Debian)
somewhat harder to implement.

This patch does a somewhat large-scale cleanup of the exported symbols:

 * Introduced a librrd.sym file which contains all symbols that are to be
   exported. This file is then passed to libtool using the -export-symbols
   option which tells the linker to export the given symbols only (note:
   according to the libtool manual, this has no effect on some
   architectures - however, I assume that most architectures in use today
   do support it).

   librrd.sym contains all symbols originally defined in rrd.h sans
   LockRRD() (which has been moved to rrd_tool.h). The following functions
   have been added to rrd.h and the list of exported symbols (some of them
   have been renamed, see below):
   - rrd_info()
   - rrd_info_free()
   - rrd_info_print()
   - rrd_info_push()
   - rrd_lastupdate()
   - rrd_update_v()
   - rrd_strerror()

 * Prefixed all public functions and types with "rrd_" to avoid name
   clashes with other libraries. Also, while I was at it, I introduced
   typedefs for all custom types and prefixed the time names with "_t" to
   improve consistency:
   - enum info_type -> rrd_info_type_t
   - enum timetype -> rrd_timetype_t

   - union infoval -> rrd_infoval_t

   - struct info_t -> rrd_info_t
   - struct rrd_context -> rrd_context_t
   - struct rrd_time_value -> rrd_time_value_t

   - info_free() -> rrd_info_free()
   - info_free() -> rrd_info_free()
   - info_print() -> rrd_info_print()
   - info_push() -> rrd_info_push()
   - LockRRD() -> rrd_lock() (not public though)
   - parsetime() -> rrd_parsetime()
     (and: src/parsetime.c -> src/rrd_parsetime.c)
   - proc_start_end() -> rrd_proc_start_end()
   - set_to_DINF() -> rrd_set_to_DINF()
   - set_to_DNAN() -> rrd_set_to_DNAN()

 * Moved readfile() from rrd_open.c to rrd_cgi.c and declared it static.
   This function is used in rrd_cgi.c only.

 * rrd_lock() (f.k.a. LockRRD()) now accepts a rrd_file_t pointer instead
   of an integer to increase encapsulation.

git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@1405 a5681a0c-68f1-0310-ab6d-d61299d08faa
33 files changed:
program/bindings/perl-shared/RRDs.xs
program/bindings/python/rrdtoolmodule.c
program/bindings/ruby/main.c
program/bindings/tcl/tclrrd.c
program/doc/rrdthreads.pod
program/netware/Makefile
program/src/Makefile.am
program/src/librrd.sym [new file with mode: 0644]
program/src/parsetime.c [deleted file]
program/src/parsetime.h [deleted file]
program/src/rrd.h
program/src/rrd_cgi.c
program/src/rrd_create.c
program/src/rrd_error.c
program/src/rrd_fetch.c
program/src/rrd_graph.c
program/src/rrd_graph.h
program/src/rrd_graph_helper.c
program/src/rrd_info.c
program/src/rrd_nan_inf.c
program/src/rrd_not_thread_safe.c
program/src/rrd_open.c
program/src/rrd_parsetime.c [new file with mode: 0644]
program/src/rrd_parsetime.h [new file with mode: 0644]
program/src/rrd_resize.c
program/src/rrd_thread_safe.c
program/src/rrd_thread_safe_nt.c
program/src/rrd_tool.c
program/src/rrd_tool.h
program/src/rrd_update.c
program/src/rrd_xport.c
program/win32/rrd.dsp
program/win32/rrd.vcproj