Commit Graph
579 Commits
Author SHA1 Message Date
Andrew Johnson 2d4301f0bb Fix warnings from clang 2016-09-05 22:36:45 -05:00
Andrew Johnson cd49e245c2 Added JLink reporting infrastructure
Command 'dbjlr <record|*> <level>' calls the report method for
all JSON links in all records, or in one named record.
Added level and indent arguments to the jlif::report() method.

Added jlif::map_children() method for recursing through all
JSON links, plus dbJLinkMapChildren() and dbJLinkMapAll() APIs.

Implemented the report and map_children methods in the const
and calc link types.
2016-09-05 14:25:33 -05:00
Andrew Johnson 19447dc7ff Make the long-string buffer for link fields bigger
When representing a link field as a long string (.INP$)
we have to pick some size limit for the buffer.
Previously this was the max length of a PV name + 12 chars,
but with JSON links that's not big enough.

This commit sets it to 1KB and defines a macro so it will be
easier to change in the future if necessary.
2016-09-04 16:56:15 -05:00
Andrew Johnson dd311be319 JLink: Convert parser->linkDepth into jlink->parseDepth
This counter is indicates when we've finished parsing a link,
and needs to be stored with link rather than the parser so it
keeps its value while parsing embedded links. This fixes the
embedded links bug.

Also removed the limit on a link name's length.
2016-09-04 16:33:10 -05:00
Andrew Johnson ec6d86c91c Fix jlink memory leak in dbStaticLib
Added dbFreeLinkInfo(), use everywhere to release dbLinkInfo resources.

Renamed link_type => expected_type in db[Can]SetLink(),
my brain understands this name faster.
2016-09-04 15:56:39 -05:00
Andrew Johnson 25315882ec Clean up JSON_LINKs in doCloseLinks 2016-09-03 22:22:12 -05:00
Andrew Johnson 8d1c416551 Moved PV_LINK-specific code out of dbLink.c into link types
This required a change to the lset::getValue arguments, removing
the pstat and psevr pointers. Links can still return a non-zero
value from getValue and trigger a LINK:INVALID alarm, but for any
other alarm settings they must manipulate the record themselves.
2016-09-03 19:21:11 -05:00
Andrew Johnson 07b09eed1f Fixes to dbJLink, added dbJLinkFree()
Moved the clearing of key_is_link to the right place,
embedded links now parse correctly.
2016-09-03 13:36:17 -05:00
Andrew Johnson 23c71e9965 Various improvements
* Added new lset::openLink() method, called on JSON_LINKs only
* Cleanup in dbJLink.c to prevent memory leaks.
* Removed jlif::start_parse() method.
* Renamed jlif::end_parse() to end_child, which will be called on
the parent link when a child link has succesfully finished parsing.
2016-09-01 23:21:23 -05:00
Andrew Johnson 3992d4b92a Split dbJLinkInit, JLinks are now parsed at load-time 2016-09-01 00:56:26 -05:00
Andrew Johnson 40a3a66745 Added loadLS routine to lset
The long string in/out records use a different initializer
for constant links. The new loadLS method allows a constant
link type to initialize such a long string field.

NB: This routine was added in the middle of the lset table.
Any external link support implementations must be adjusted.
2016-08-31 00:36:23 -05:00
Andrew Johnson 5ec0633282 Pass link dbfType to jlif allocator; needed! 2016-08-30 01:13:15 -05:00
Andrew Johnson 33e565b67d Fix build warning from clang 2016-08-29 10:41:51 -05:00
Andrew Johnson 7edc0c67ca JSON Links implementation
The lnkConst.c implementation is not yet complete, no support for arrays of
strings (JMOP).

Link error messages should display their record & field name, which is not yet
possible.

The ability to embed links as parameters to other link types is not complete
yet; this will be required for the calc link type.

This code currently passes all existing tests, but additional tests are needed
for the new functionality.
2016-08-29 01:12:09 -05:00
Andrew Johnson cca6a5d05a Add isConstant and isVolatile to LSET 2016-08-27 16:26:55 -05:00
Andrew Johnson 82385c9f1b Missed a spot handling JSON_LINK field values 2016-08-18 00:18:41 -05:00
Andrew Johnson cbc7af0ef8 Remove 2 obsolete dbStatic routines (forms) 2016-08-15 20:19:19 -05:00
Andrew Johnson 7df97f074e Add lset::dbPutLinkAsync and S_db_noLSET 2016-08-13 21:42:23 -05:00
Andrew Johnson d3a9ba7701 Fix issues related to const array initialization 2016-08-12 23:21:26 -05:00
Andrew Johnson bb58598eba A cleaner way to close CA & DB links 2016-08-12 23:20:24 -05:00
Michael Davidsaver 899feb24b2 iocInit: close CA_LINKs through lset 2016-08-12 19:50:17 -04:00
Andrew Johnson 519208833f Add lset::loadArray and JSON parsing
Replace lset::loadLink with lset::loadScalar, add lset::loadArray
Add dbLoadLinkArray() routine to dbLink.h API
New dbConvertJSON.h API for use by dbConstLoadArray()
2016-08-10 12:49:49 -05:00
Andrew Johnson ae2180f5b5 Comments in Makefile 2016-08-10 12:21:03 -05:00
Andrew Johnson c01967d64f Remove spurious include dbCa.h 2016-06-02 22:29:45 -05:00
Andrew Johnson 667f74759d Allow (discard) comments inside JSON 2016-06-01 15:46:24 -05:00
Andrew Johnson 1f726c8760 Recognize arrays as constant links 2016-05-24 12:01:38 +02:00
Andrew Johnson 08b7802009 Recognize numbers before barewords 2016-05-24 11:59:08 +02:00
Andrew Johnson f6c4099634 Make info tags also JSON objects 2016-05-23 12:00:11 +02:00
Andrew Johnson c76041b14c Rename JSON_STR to JSON_LINK 2016-05-20 20:32:39 -05:00
Andrew Johnson 7ea544673a Accept bareword JSON strings, quote them 2016-05-20 00:02:45 -05:00
Andrew Johnson 6e6ae4354b Fix warnings from dbmfStrdup() change 2016-05-19 14:01:05 -05:00
Andrew Johnson 61e82ee1ae Fix memory allocation bugs 2016-05-19 01:32:12 -05:00
Andrew Johnson 28b3b1678c ioc/dbStatic: Add JSON parsing of field values
The parsing removes all white-space outside of quotes from the JSON.
dbRecordField() now strips quotes from simple string values itself.
2016-05-19 01:15:33 -05:00
Andrew Johnson 6a592dc2c0 Support "link(name, lset)" syntax in DBD files
Both Perl and dbStaticLib support included.
Also added a new std/link directory for link types.
Nothing looks up the registered link support tables yet.
2016-05-08 22:57:42 -05:00
Andrew Johnson 13294f80cc Add basic support and tests for a JSON link address type 2016-04-27 20:47:17 -05:00
Andrew Johnson 778aa18c00 More cleanup 2016-04-27 20:29:16 -05:00
Andrew Johnson 0348c2295b Cleanup 2016-04-26 22:13:12 -05:00
Andrew Johnson 8a5d1a08ad Restore loadLink to lset, move CONSTANT link code into its own source file 2016-04-03 01:29:28 -05:00
Andrew Johnson 1e028d68d8 Move DBLINK support code into its own source file 2016-04-03 00:49:36 -05:00
Andrew Johnson c888b4b6f0 Merged changes from 3.15 branch, to revno 12738 2016-03-30 12:39:36 -05:00
Andrew Johnson 177090e35e Merged fixes for lp:1558206 and lp:1563191 from 3.14 branch, revno 12622 2016-03-30 11:26:53 -05:00
Michael Davidsaver 7a1766279c dbLock: dbLockerAlloc() accept const array of non-const pointers 2016-03-24 13:42:49 -04:00
Michael Davidsaver 45db78981c iocInit: no need to break DB_LINK when isolated
This is being done to free the link private struct,
but dbDbRemoveLink() is not used to avoid the overhead
of splitting every lockset just before the PDB
is free'd.

No reason to do this for non-isolated until scans threads
are stopped.
2016-03-20 09:43:40 -04:00
Michael Davidsaver 7d94d05bb7 iocInit: special clear link set in doCloseLinks() 2016-03-19 17:15:08 -04:00
Andrew Johnson 59fea64390 Add missing dependencies for Test.dbd files 2016-03-16 13:10:17 -05:00
Andrew Johnson 0f6f833e91 Merged link-support branch 2016-02-29 13:48:18 -06:00
Andrew Johnson f0c56bcbba Merged 3.15 changes, to revno 12731 2016-02-26 18:16:26 -06:00
Andrew Johnson 76c422c5fd Merge Cygwin fix from 3.14, fix in rsrv too 2016-02-26 17:10:35 -06:00
Michael Davidsaver 2c48bcc26b dbChannelShow reporting detail level changed 2016-02-26 16:07:47 -05:00
Andrew Johnson 3304470323 Merged the rsrvbindiface branch 2016-02-26 14:15:22 -06:00