Commit Graph

12998 Commits

Author SHA1 Message Date
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
Andrew Johnson
9a02181084 Add ellPop() function, removes and returns the last node on a list. 2012-04-27 13:21:45 -04:00
Andrew Johnson
06bcdb0ade Tindying up.
Fixed issues with dbChannelDelete() and dbChannelShow().
2012-04-27 13:21:45 -04:00
Michael Davidsaver
e94fd29b9b fix camessage 2012-04-27 13:21:44 -04:00
Michael Davidsaver
bcfaa63d8c complete rename 2012-04-27 13:21:44 -04:00
Michael Davidsaver
4c2eba502a Rename dbChannelData() to dbChannelField()
dbChannel_get() now uses dbChannelGetField()
 dbChannel_put() now uses dbChannelPutField()
 Conflicts:

	src/db/db_access.c
2012-04-27 13:21:43 -04:00
Andrew Johnson
07b3b7e32d Make casr print the full channel name, not just the record name. 2012-04-27 13:21:43 -04:00
Andrew Johnson
1d274aba0d Make dbChannel_create() call dbChannelOpen() 2012-04-27 13:21:43 -04:00
Andrew Johnson
b4dbcf2b1a Don't parse field modifiers in dbChannelTest()
dbChannelDelete() returns void
 update tests.
2012-04-27 13:21:42 -04:00
Michael Davidsaver
e37c5c99bb adapt db_get_field_and_count to dbChannel_get_count 2012-04-27 13:21:42 -04:00
Michael Davidsaver
8bf53d3c59 Replaced dbAddr with dbChannel in all CA-server related code
* Routines with a db_access interface are named dbChannel_xxx
 * Using dbch for member variable names in Jeff's code

It seems to work!

TODO: Make dbChannel use a freelist
2012-04-27 13:21:41 -04:00
Andrew Johnson
56468b684e Extended functionality of dbChannel code:
* Deleted the chan->magic member and associated checks.
 * Moved rset->cvt_dbaddr() call into dbChannelCreate()
 * Added many accessor routines
 * Renamed dbChannelReport() to dbChannelShow() and added dbChannelFilterShow()
2012-04-27 13:21:41 -04:00
Andrew Johnson
f4d55f1249 Changed dbChannel management API to Test/Create/Delete 2012-04-27 13:21:40 -04:00
Andrew Johnson
4324ffd274 Various improvements:
* A filter's parse routines now return a parse_result (enum)
 * Return value from test filter parse routines is configurable
 * Either call parse_end() or parse_abort(), but never both.
2012-04-27 13:21:40 -04:00
Michael Davidsaver
eee5a28983 Integrated dbChannel more and extended its functionality:
* Register filters in pdbbase, using a list and gphash
 * Do record and field search first
 * Test loads a DBD/DB file to provide a record to find
2012-04-27 13:21:39 -04:00
Andrew Johnson
8baf3b1362 Ignore eclipse project configuration files. 2012-04-27 13:21:39 -04:00
Andrew Johnson
0ab891fca4 Added gphFindParse(), which takes a string length parameter.
This is useful for hash lookups while parsing a const string, to avoid
 having to copy and nil-terminate it.
2012-04-27 13:21:33 -04:00
Michael Davidsaver
68dfeb76c0 Adding dbChannel JSON parser and test files.
Passes 33 tests.
2012-04-27 13:21:32 -04:00
Andrew Johnson
cf623e290a Upgraded to yajl version 1.0.9. 2012-04-27 13:21:31 -04:00
Andrew Johnson
359fc1b69e Move YAJL_API to front of declarations. 2012-04-27 13:21:31 -04:00
Andrew Johnson
625a7adc69 Add Lloyd Hilaiel's Yet Another JSON Library v 1.05 to libCom.
This is BSD licensed, modified only enough to build under EPICS.
2012-04-27 13:21:29 -04:00
Andrew Johnson
492360a3d4 Documentation updates
Clear out old stuff.
Introduce global macro syntax.
2012-04-20 17:38:59 -05:00
Andrew Johnson
653af6e366 Unify behaviour with msi.
dbLoadTemplate must accept global definitions inside pattern and
variable substitutions, since the new version of msi does that.
2012-04-20 17:35:26 -05:00
Andrew Johnson
d61d7ebf96 Fix bug with global definitions
Pattern mode changes the behaviour of substituteGetReplacements()
which breaks the parsing of global definitions.  Add a separate
routine substituteGetGlobalReplacements() which is used for parsing
global definitions and ignores the isPattern flag.
2012-04-20 17:31:43 -05:00
Andrew Johnson
7a968bc5f5 Refactoring for maintainability
Use epicsStrDup()
Release macLib handle when finished
2012-04-20 14:01:51 -05:00
Andrew Johnson
e1a92fcf3f Refactoring for maintainability
Replaced all void * pointers with pointers to private structures.
Removed several unnecessary casts.
2012-04-20 13:15:07 -05:00
Andrew Johnson
729f04ecce Merged Michael's dontcant branch.
This removes various calls to cantProceed() and its relatives
and replaces them with an error return status when a resource
allocation fails.  It only does it for routines that already
have an error status return, so it makes no API changes, and
will prevent threads from being suspended unnecessarily.
2012-04-19 13:57:05 -05:00
Andrew Johnson
cec6aee81b HPUX: Delete void * operator new(size_t) methods
These were apparently needed by the HPUX compiler even though it
never actually executed them.  They are never used.
2012-04-12 11:28:23 -05:00
Andrew Johnson
bb4d470145 Delete diagnostic code inside #if 0 ... #endif 2012-04-12 11:26:03 -05:00
Andrew Johnson
1137f1b0b0 HPUX: Delete HP-specific return statements. 2012-04-12 11:24:13 -05:00