Commit Graph

285 Commits

Author SHA1 Message Date
Andrew Johnson
36d0fbd7be Another c89 compat fix 2021-02-08 13:34:01 -06:00
Michael Davidsaver
30e1431fb4 c89 compat 2021-02-08 09:43:51 -08:00
Michael Davidsaver
745c3f552e Com: add epicsStrSimilarity() 2021-02-08 09:22:27 -08:00
Michael Davidsaver
8723d4d9cb include database S_* in error string table 2021-02-08 09:22:27 -08:00
Michael Ritzert
410921b5ef Use getifaddrs instead of SIOCGIFCONF.
The old code is preserved in osdNetIfConf.c, which is used by the default
platform directory.

Platforms that support getifaddrs use the new code from osdNetIfAddrs.c.
2021-02-06 08:27:21 -08:00
Michael Davidsaver
43bd5ee1c2 Com: always skip SOCK_CLOEXEC for RTEMS and vxWorks 2021-02-05 10:32:47 -08:00
Michael Davidsaver
cf3173b6f4 posix: use SOCK_CLOEXEC and accept4()
If available, ensure O_CLOEXEC is set atomically.
Continue to F_SETFD as well (paranoia).

Available at least on Linux, freebsd, and RTEMS 5 w/ libbsd
2021-01-29 08:45:44 -08:00
Michael Davidsaver
1e471832e9 consolidate osiFileName.h
Don't really need 10 files for this
2021-01-27 09:19:13 -08:00
Michael Davidsaver
c19605232a epicsAtomicDefault.h typo 2021-01-18 08:23:54 -08:00
Andrew Johnson
99852c6504 Merge JSON5 support into 7.0 2021-01-05 21:39:15 -06:00
Michael Ritzert
a9e3fa74aa FTBFS on FreeBSD 12 2021-01-05 08:56:57 -08:00
Andrew Johnson
f775e0b8f6 Merge 3.15 branch into 7.0
Adjust updated test result displays for submodules
2020-12-23 16:18:21 -06:00
Andrew Johnson
5f0d52cd5c errSymLib Fix from Ivo Hanak
Fixes lp: #1907077
2020-12-08 10:10:03 -06:00
Michael Davidsaver
4e055610b7 epicsUnitTest: SetErrorMode() 2020-12-03 08:33:57 -08:00
Michael Davidsaver
dc99d63df8 C89 compat
Present for Dirk
2020-11-20 17:25:27 -08:00
Michael Davidsaver
d24a297304 osiSockTest: fix timeout 2020-11-19 13:07:05 -08:00
Michael Davidsaver
d83e3b5de1 osiSockTest: probe for !EPERM 2020-11-18 10:54:44 -08:00
Ralph Lange
f8df3473ab Redo d3d40689 that was lost in upmerging 2020-08-25 16:06:39 +02:00
Ralph Lange
e8bee54531 Redo 97b29129/0fbfc741 that was lost in upmerging 2020-08-25 16:04:04 +02:00
Michael Davidsaver
0cae0db98b compat IPPORT_USERRESERVED
musl libc doesn't define IPPORT_USERRESERVED
2020-08-22 07:51:33 -07:00
Michael Davidsaver
9e3d5d52ab iocshRegisterVariable() avoid spurious redefinition warning
Compare the contents, not the container.
2020-08-22 07:50:40 -07:00
Matic Pogacnik
5b37663bcb Check if input string to aToIPAddr is null 2020-08-14 10:04:56 -07:00
Andrew Johnson
c1152f94fd epicsString: Remove support for Octal character escapes \nnn
These changes to the functions epicsStrnRawFromEscaped() and
epicsStrnEscapedFromRaw() were prompted by the addition of JSON5
support to the dbStatic parser.

 * \0 now represents a zero byte
 * Unprintable characters are now escaped in hex

Tests for the octal escapes have been removed.
2020-08-09 00:33:07 -05:00
Andrew Johnson
8c9e42d15e Fixed the response of epicsStrnRawFromEscaped() to numeric overflows
\x only takes 2 hex digits now, and the octal parser ignores a 3rd
digit if it would take the value over 0xff:
    "\400"  => ' ' then '0'
    "\x088" => '\b' then '8'

With additional tests.
2020-08-09 00:33:07 -05:00
Andrew Johnson
b0d78921fd Final changes to YAJL for use in Base
* Bump the YAJL version number
* Define a HAS_JSON5 macro
* Set yajl_allow_json5 by default, fixing yajl_test and API comments
2020-08-09 00:33:07 -05:00
Andrew Johnson
c00f638f7e yajl: Add yajl_gen_reset() routine
For some reason this never got added with the rest of the generator.
2020-08-09 00:33:07 -05:00
Andrew Johnson
975e9ec553 Doxygen text and markup fixes and updates 2020-08-09 00:33:07 -05:00
Andrew Johnson
de2de5e2fd yajl: Clean up the formatting of some C macros 2020-08-09 00:33:07 -05:00
Andrew Johnson
a8e0de043c Support for 'single-quoted strings'
Also adds missing character flag VIC for 'r'.
The a5_spec_example test was copied from the JSON5 spec.
2020-08-09 00:33:07 -05:00
Andrew Johnson
549d6f67e3 YAJL support for JSON5 \xXX hex escapes in strings, with tests
Teach the lexer/parser to recognize and decode them in JSON5 mode.
Teach the encoder to use them in JSON5 mode.
Add another error message for bad hex digits.
Test cases to show they work, and that the bad-digit check fires.
2020-08-09 00:33:07 -05:00
Andrew Johnson
55f4e55383 Support for JSON5 character escapes in strings
Any character other than the digits 1-9 may be preceded by a
reverse solidus '\', and unless the combination has an explicitly
defined expansion the character is included without the solidus.
JSON5 adds \', \0 and \v to the set of defined escapes, and an
escaped newline is omitted from a string.

In the test case Perl uses \13 instead of \v in the output
but it is the correct character (13 octal = 11 decimal = '\v').
2020-08-09 00:33:07 -05:00
Andrew Johnson
e2256d0663 Accept unquoted identifiers as map keys
Adds another lexer entry point for lexing map keys only,
adjust parser to use this instead of the general lexer.
Also defines another lexer token for internal use only.
2020-08-09 00:33:07 -05:00
Andrew Johnson
88e0ced03e JSON5 support for generating unquoted map keys
Added a new routine to yajl_encode.c that validates bare identifiers.
Use this in yajl_gen_string() to avoid quoting keys we don't have to.
2020-08-09 00:33:07 -05:00
Andrew Johnson
baaf50c6d2 Add yajl_gen_json5 option and generator support for special numbers
When this flag is set, the yajl_gen_double() routine can output
the values NaN, -Infinity and +Infinity.
2020-08-09 00:33:07 -05:00
Andrew Johnson
97b8df6912 Added JSON5 support for parsing special numbers
NaN and both Infinities, with tests.
Special handling was added to yajl_test since different OSs don't
always generate the same output for special numbers (nan/NaN/...).
2020-08-09 00:33:07 -05:00
Andrew Johnson
98a358437f Add JSON5 support for hexadecimal integers
With tests for YAJL.

Note yajl_parse_integer still can't handle LLONG_MIN in base 10 or 16.
2020-08-09 00:33:07 -05:00
Andrew Johnson
00ac15cec5 Turning on JSON5 also enables comments
Includes the simple test case.
2020-08-09 00:33:07 -05:00
Andrew Johnson
456e774d85 JSON5: Modified lexer for some number support
If configured for JSON5 the lexer now allows a leading or trailing
decimal point on doubles, and an explicit leading + sign on integers
or double numbers.

Includes test cases.
2020-08-09 00:33:07 -05:00
Andrew Johnson
91c5b2fee2 Trailing commas now require a json5 parser
Modifies the yajl test case to add the -5 option
2020-08-09 00:33:06 -05:00
Andrew Johnson
ae604b2a55 Start of JSON5 support
Added yajl_allow_json5 config flag, pass it around.
Added -5 option to yajl_test and yajlTestConverter.pl
2020-08-09 00:33:06 -05:00
Andrew Johnson
d381a936b5 Fix for yajl#188 potential UB
Apparently it is UB to use an enum in va_start()
2020-08-09 00:33:06 -05:00
Andrew Johnson
e542a22631 Fix Darwin version of epicsMonotonicResolution() 2020-08-04 16:22:03 -05:00
Andrew Johnson
951b6acbbc Fix Cygwin TCP_NODELAY issue from Paul Chu & Freddie 2020-08-03 12:25:31 -05:00
Andrew Johnson
3c99391d93 Added SPDX License ID to all EPICS-original source files
In some cases the license-identification header was missing,
so I added that as well. Replaced the remaining headers that
specifically identified "Versions 3.13.7 and higher".

Makefiles and the build system were deliberately excluded.
2020-08-03 11:53:01 -05:00
Andrew Johnson
957f386d77 Removed EPICS license header and (c) from yacc/antelope sources
These should never have been added in the first place.
2020-08-03 11:49:56 -05:00
Andrew Johnson
60aaa16e1d Removed EPICS license header and (c) from flex sources
These should never have been added in the first place.
2020-08-03 11:49:56 -05:00
Andrew Johnson
3506d11558 Speed up osdTimeGetCurrent() on recent macOS
Fixes https://github.com/epics-base/epics-base/issues/83
2020-08-03 11:37:19 -05:00
Ralph Lange
7d2e352f6a Merge changes from 3.15 branch into 7.0
- merged 3.15 branch up to bf7a1605

# Conflicts:
#	modules/database/src/ioc/db/dbChannel.c
2020-07-15 11:46:45 +02:00
Andrew Johnson
5c03f8ba79 Simplify epicsMessageQueueTest using joinable threads
Fixes issues with thread shutdown
2020-07-02 16:17:04 -05:00
Andrew Johnson
1eeac6da2f Switch RTEMS to the default osdMessageQueue 2020-07-02 16:14:08 -05:00