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.
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.
Added dbFreeLinkInfo(), use everywhere to release dbLinkInfo resources.
Renamed link_type => expected_type in db[Can]SetLink(),
my brain understands this name faster.
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.
The JSON parser passes string arguments with a length
instead or nil-terminating them. These routines make it
simple to copy such strings into either permanent or
temporary storage.
* 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.
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.
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.
Replace lset::loadLink with lset::loadScalar, add lset::loadArray
Add dbLoadLinkArray() routine to dbLink.h API
New dbConvertJSON.h API for use by dbConstLoadArray()
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.