Commit Graph

14729 Commits

Author SHA1 Message Date
Michael Davidsaver
ceabe74653 fix test build 2012-04-27 13:25:25 -04:00
Ralph Lange
948a3feba7 Fix in dbLink.h: Include all used headers 2012-04-27 13:25:19 -04:00
Ralph Lange
57fc84fef3 dbState: Avoid segfaults when called with NULL pointer 2012-04-27 13:25:18 -04:00
Michael Davidsaver
03a30f3b8f Add DbState soft support for bi/bo records. 2012-04-27 13:25:18 -04:00
Michael Davidsaver
83586b49d0 Add test code for sync plugin. 2012-04-27 13:25:17 -04:00
Michael Davidsaver
95881525e5 Add sync plugin that uses the db state 2012-04-27 13:25:16 -04:00
Ralph Lange
c4b54c6d4d Fix compiler warnings and minor issues. 2012-04-27 13:25:16 -04:00
Michael Davidsaver
4893d0ef8b Add dbState library that provides a means of synchronizing plugins to events. 2012-04-27 13:25:15 -04:00
Ralph Lange
77eba53222 Change arr plugin behaviour from exclusive to inclusive range end specifier 2012-04-27 13:25:14 -04:00
Michael Davidsaver
0d9d992717 Add [s:i:e] sub-array shorthand parsing and unit test 2012-04-27 13:25:14 -04:00
Ralph Lange
ef2814ec44 Fix bug in arr plugin (for incr <= 0), add tests for invalid and out-of-bound parameters 2012-04-27 13:25:13 -04:00
Michael Davidsaver
45a531b167 Add arr plugin for array subsets (+ testcode) 2012-04-27 13:25:07 -04:00
Ralph Lange
ef4b2e5892 Fix in dbExtractArray.c for DBF_STRING copies with wrap around 2012-04-27 13:25:03 -04:00
Ralph Lange
0e2a66e721 Fixes and additions in dbExtractArray.c
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* Add forced write of '\0' to destination to end strings correctly
* Add dbExtractArrayFromBuf() to make array copies from ref type field logs easier
2012-04-27 13:24:54 -04:00
Michael Davidsaver
0b32220e86 Added tests for ts and dbnd plugins, fix in dbnd.c: make local functions static 2012-04-27 13:22:04 -04:00
Ralph Lange
d2d91a545f Bunch of minor changes
* Fix decorations in chfPlugin.c/.h
* Fix missing include in dbAccessDefs.h
* Beautification in dbChannel.c
2012-04-27 13:22:02 -04:00
Michael Davidsaver
62ba76c71a Add dbExtractArray to support extracting same type arrays with offset and increment 2012-04-27 13:22:02 -04:00
Michael Davidsaver
0cfe224f47 Add deadband plugin (client defined monitor deadband) 2012-04-27 13:22:01 -04:00
Ralph Lange
b843a8990a Fix: don't put dropped event (NULL) on the event queue 2012-04-27 13:22:01 -04:00
Ralph Lange
444a200b61 Change how ...Show is generated, minor refactoring and fix in ts plugin 2012-04-27 13:22:00 -04:00
Ralph Lange
d2abc71527 Add function to dbChannel.c to create a db_field_log copy of array/string data 2012-04-27 13:22:00 -04:00
Michael Davidsaver
e67ef8a005 Add ts filter plugin to set timestamp to "now" 2012-04-27 13:21:59 -04:00
Ralph Lange
6e58dcfab6 Change interface to ...Show functions, minor refactoring
* ...Show functions take an indent argument (number of spaces to print
  in front of each line) instead of a char* intro to avoid allocation at each level,
  replacing '\t' with 8 spaces in top level code where necessary
* Refactor element_size -> field_size (as used in dbAddr), also in dbChannel
  functions
* Fix: wrong macro name in unused part of db_field_log.h
2012-04-27 13:21:59 -04:00
Ralph Lange
317065dadb Minor fixes in chfPluginTest.c 2012-04-27 13:21:58 -04:00
Ralph Lange
6923dc5fd2 Add ability for plugins to drop db_field_log updates (+tests) 2012-04-27 13:21:58 -04:00
Ralph Lange
47e2e228ab Extend and add lots of tests in chfPluginTest.c
* Add tests for callback registration (pre and post)
* Add tests for callback execution (pre and post)
* Add tests for report function and array destructor
* Add test for combinations of two plugins (that register pre eventq, post eventq or in
  both chains), checking the order of calls and db_field_log changes independently
* Make test messages more verbose and comprehensive
2012-04-27 13:21:57 -04:00
Ralph Lange
f8e9a7643a Added pvt pointer argument to parse_error in the plugin interface 2012-04-27 13:21:57 -04:00
Ralph Lange
926246a495 =?UTF-8?q?Update=20copyright=20notices,=20refactor=20in=20dbEvent.c:=20make=20LOCK/UNLOCK=20macros=20require=20=C2=A8;=C2=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
2012-04-27 13:21:57 -04:00
Ralph Lange
0a6ca6011a Run post-event-queue filters for events 2012-04-27 13:21:56 -04:00
Michael Davidsaver
f806551fe3 Add context qualifier to db_field_log, support plugins for CA read operations 2012-04-27 13:21:56 -04:00
Ralph Lange
ec7dfb1890 Change mechanism to detect data type/size changes by plugins
* Remove "probe" type from db_field_log
* Supply probe when registering plugin chains
* Minor refactoring (rename) in dbfl_type and chFilter
2012-04-27 13:21:55 -04:00
Ralph Lange
c41fcef260 Restructured pre- and post-event queue chains, type/size change detection
* Add new db_field_log type "probe" for type change detection
* Move linked lists for pre- and post-event-queue chains into dbChannel,
  function pointers and arguments into chFilter
* Remove set-type-chain completely
* Simplify register functions in filter and plugin interfaces
* Add functions to run the pre and post chains to dbChannel
* Refactor in db_field_log: field_size -> element_size
* Refactor in dbEvent:
  db_post_single_event_first -> db_create_event_log
  db_post_single_event_final -> db_queue_event_log (removed from public interface)
* Change tests to compile
2012-04-27 13:21:55 -04:00
Ralph Lange
b99975cf71 Allow filter plugin to change the type of data and the array size
* Add field_size to db_field_log
* Add final type, dbr_type, no_elements, and field size to dbChannel
  (plus matching access methods)
* Add set-type callback chain to find out final sizes and types
* Add registration calls for pre-event-queue and post-event-queue insertion
2012-04-27 13:21:54 -04:00
Ralph Lange
b09a9758b0 Changed db_field_log types to add support for plugin-created array copies
* db_field_log now is one of rec = use record, val = val inside, ref = reference inside
* add field_type and no_elements (to allow plugins change type and array size)
* add destructor in the ref type (called when deleting the db_field_log)
* change dbEvent.c and dbAccess.c to use the new field log features
2012-04-27 13:21:54 -04:00
Ralph Lange
5ea973151f Make reference (array/string) updates use a reference type db_field_log.
* Redefine db_field_log to be a union between a "value" type (as before)
  and a "reference" type (pointers to values, dtor for plugin array copies).
* Add db_delete_field_log function that correctly destructs a db_field_log.
2012-04-27 13:21:54 -04:00
Ralph Lange
4dd42383ef Add filter/plugin insertion into the high-priority filter list (pre event queue).
* Move evSubscrip from dbEvent.[ch] (private) to dbChannel.h (public).
* Split up db_post_single_event_private into two parts:
  ..._first creates a new db_field_log chunk and copies from db.
  ..._final puts a db_field_log into the event queue.
* Add a typedef for the pre-event-queue recursive callbacks.
* Add a register function for the callback (plus void* arg) to filter and
  plugin interfaces.
* Add the code that builds up the pre-event-queue callback chain.
* Changes to the test files to compile (no tests added yet).
* Fix missing include in db_field_log.h.
2012-04-27 13:21:53 -04:00
Ralph Lange
dd03d19cf2 dbEvent.c: use a free list for the field logs and keep a pointer in the event queue 2012-04-27 13:21:53 -04:00
Ralph Lange
d92665c5a3 Refactoring: enforce consistent use of names in dbEvent.c - NO EFFECTIVE CODE CHANGES 2012-04-27 13:21:52 -04:00
Ralph Lange
9f5f5246aa Added required mask per plugin to shorten check loop. Trivial test change. [src/db/chfPlugin.c src/db/test/chfPluginTest.c] 2012-04-27 13:21:52 -04:00
Ralph Lange
52c6eaa848 Refactor: get rid of ...Ctx (as Ctx is often used for user handles) [src/db/chfPlugin.c] 2012-04-27 13:21:52 -04:00
Michael Davidsaver
de134ea72d Added chfPlugin, a simple interface for channel filter plugins.
- chfPlugin.h contains the simple jump table and doxygen documentation
  - chfPlugin.c is a wrapper library around the yajl callbacks that parses
    any client-supplied configuration into the user's structure
  - test/chfPluginTest.c tests the library and the data conversion
2012-04-27 13:21:51 -04:00
Ralph Lange
d22b719e32 Changed the structure for channel filters and channel filter plugins.
- Made chFilterPlugin public (moved from dbChannel.c to dbChannel.h)
  - Made the interface jump table chFilterIf part of the chFilterPlugin
    (i.e. once per plugin) instead of chFilter (once per instance)
  - Added a pointer from chFilter (instance) to chFilterPlugin (plugin)
  - Added a private user pointer in chFilterPlugin
  - Changed dbFindFilter() to return a chFilterPlugin* (instead of the jump table)
  - Changed dbRegisterFilter() to accept a user private pointer as 3rd arg
2012-04-27 13:21:50 -04:00
Ralph Lange
f65ec61dc3 Fix: Call dbChannelDelete() when client connection is lost. [rsrv/caservertask.c] 2012-04-27 13:21:49 -04:00
Andrew Johnson
a2fadc15a7 Must clear link type before calling dbLockSetSplit() 2012-04-27 13:21:48 -04:00
Andrew Johnson
4ef35a5f5c Move recGblInitConstantLink() functionality into dbLink.c
Using dbFastPutConvert for string to number conversion.
2012-04-27 13:21:48 -04:00
Michael Davidsaver
74b24bbe0f Refactor link handling code (incomplete).
* Moved routines into dbLink.h and dbLink.c
  * Created separate routines for DB_LINK processing
  * Added dbinitLink() and dbAddLink()
  * Started a Link Support Entry Table, not used yet
  * Everything should still work as before...
2012-04-27 13:21:47 -04:00
Andrew Johnson
06d3397342 Fix compiler warnings. 2012-04-27 13:21:47 -04:00
Andrew Johnson
58d1e22e0f Improve output from Show routines. 2012-04-27 13:21:46 -04:00
Andrew Johnson
19a166a60d Various updates.
* Added dbChannelGet()
 * Implement dbChannelGetField() using dbChannelGet()
 * Close filters in reverse order of opening
 * Messages and comments improved.
2012-04-27 13:21:46 -04:00
Andrew Johnson
1047f42b15 Simplify implementation.
* dbGet() now handles DBF_*LINK fields,
 * Simplify dbGetField(),
 * Split out getAttrValue(),
 * Rename dbGetFieldLink() to getLinkValue(),
 * Reduce number of casts.
2012-04-27 13:21:45 -04:00