Commit Graph

41 Commits

Author SHA1 Message Date
Andrew Johnson
647bd334ae iocsh: Protect echo and cd from NULL arguments 2014-10-31 12:19:09 -05:00
Andrew Johnson
0a9c5d456b Merged iocshCmd-with-macros branch 2014-10-06 23:39:23 -05:00
Keenan Lang
64a98452e3 epicsEnvSet clears macros before setting environment variable to ensure intuitive use of the function in nested iocsh calls. While adding this functionality, fixed a latent bug in macPutValue where if you tried to NULL a macro with the same name as an environment variable, you would go into an infinite loop. 2014-09-02 16:35:32 -05:00
Keenan Lang
9d0be21cc1 MAC_HANDLE's in iocshBody weren't being created with environment variables. 2014-08-27 13:31:16 -05:00
Keenan Lang
2d3db2036b Updated iocshBody to keep track of macro context to allow scoping of macro variables from iocshRun/Load 2014-08-27 11:33:14 -05:00
Keenan Lang
00bb3d1e67 iocshLoad now works as iocsh with no parameters 2014-08-22 14:25:41 -05:00
Keenan Lang
1ad6ff03b3 Changed iocshLoadFile to iocshLoad and added iocshRun as the macro version of iocshCmd 2014-08-22 11:50:24 -05:00
Keenan Lang
76bd45cb45 Reverted calls that didn't need to use macDefExpand to single parameter 2014-08-21 16:09:21 -05:00
Keenan Lang
6d38cc1f76 Returned iocshCmd to it's original function signature, added iocshLoadFile instead 2014-08-21 15:19:50 -05:00
Keenan Lang
6ebbf0dd8c Whitespace changes snuck in due to editor 2014-08-20 16:58:50 -05:00
Keenan Lang
69c7f0b065 Changing macEnvExpand to accomodate macro definitions 2014-08-19 16:40:51 -05:00
Keenan Lang
ab94bb46f2 Changing iocshCmd to idealized syntax 2014-08-19 16:34:41 -05:00
Michael Davidsaver
3ca42fc838 cleanup iocsh 2014-06-23 16:28:22 -04:00
Andrew Johnson
0dc2746d68 libCom: Added echo command to iocsh 2014-02-21 15:49:15 -06:00
Andrew Johnson
e1e389a2dd Low-memory behaviour fixes.
Fix unchecked buffer allocation in dbChannel.c
Replace calls to epicsStrDup() with checked malloc() for
things that happen often after iocInit.

Michael Davidsaver pointed out this issue.
2014-02-07 17:19:28 -06:00
Andrew Johnson
0a2020e2fc Merged changes from 3.14 branch
Up to 3.14.12.4 release.
2013-12-17 12:54:04 -06:00
Andrew Johnson
197e992241 Fixed iocsh stream redirection for several commands
Eric provided the fixes to iocsh (empty commands would not reset
redirected streams), I fixed various commands.
2013-12-11 17:50:29 -06:00
Michael Davidsaver
026307c06d db cleanup
cleanup to allow database re-load
2012-06-28 10:55:44 -04:00
Andrew Johnson
bf965cc59c Merged changes from 3.14 branch.
Includes all changes up to rev 12323 on 2012-02-20.
2012-02-20 10:01:04 -06:00
Andrew Johnson
afaebfbeb1 libCom: Fix iocsh comment recognition
Merged J. Lewis Muir's fix for comments introduced by macro.
Added fixes to allow comments to be indented too, which used
to work if the '#' was followed by white-space or any argument
separator character.
2012-01-11 15:12:15 -06:00
J. Lewis Muir
ee2a2dfffc libCom/iocsh: Ignore comment lines after macro expansion
The handling of comment lines is only performed before macro
expansion, thus lines with macros that expand to comment lines will
not be correctly handled as comment lines.

By chance this kind of worked sometimes because a "#" command that
does nothing is internally added to the command registry to make it
show up in the help output.  Relying on this is broken.  Furthermore,
if the line starts with '#' followed by a non-separator character
(e.g. "##", "#whatever", etc.) it will not work (i.e. it will produce
a command-not-found error).

This fix checks to see if the first character of the line after macro
expansion is '#'.  If it is, it considers the line to be a comment.
2012-01-11 11:40:30 -06:00
Andrew Johnson
e15e42cff3 Merged Murali Shankar's iocLogPrefix changes.
Adjusted a few things during the merge.
2011-08-25 18:17:09 -05:00
Murali Shankar
0cb7c9aafe Added support for iocLogPrefix
Refactored logClientSend in libCom/logClient/logClient.c; took the code between the mutex operations and
moved it to a private method - sendLogMessageinChunks. Call this method once for the prefix (if it exists) and once
for the actual message.
Added ioCsh registration code into src/libCom/iocsh/libComRegister.c registering a command called
"iocLogPrefix" that sets this prefix.

Unit tested with and without prefixes.
Performance tested with and without prefixes - without prefix is approx the same. With prefix is about
twice the time (reflecting the two calls to sendLogMessageinChunks I think)
2011-08-23 11:04:09 -07:00
Andrew Johnson
c71093f47f libCom/iocsh: Oops, allow NULL pathname. 2011-04-26 15:18:30 -05:00
Andrew Johnson
c11a31f549 libCom/iocsh: Set IOCSH_STARTUP_SCRIPT env var. 2011-04-26 14:57:26 -05:00
Michael Davidsaver
f7fc564556 Fold antelope/flex and asHost into libCom
Build lexer and parser from libCom/Makefile.
Since libCom now includes asLib.c and asLib_lex.c we must build
antelope and flex without linking them to Com.  This works because
they only need epicsTempFile anyway.  However make doesn't like a
subdirectory with the same name as a target object, so the antelope
source directory is now called yacc.  The two main.c files were also
renamed to avoid other build problems.

Merge asHost into Com and remove mentions in CONFIG_BASE

Lots of noise since SRCS must be renamed to Com_SRCS
2011-02-25 15:39:44 -06:00
Andrew Johnson
9a831f9dc5 libCom: Simplify libCom/Makefile by splitting into parts
Each SRC_DIR gets its own Makefile fragment, and where it needs
private build rules a RULES files.

If this pattern gets used elsewhere we could automate the include
lines (search $(SRC_DIRS) for Makefiles and RULES files?).
2010-12-10 15:23:42 -06:00
Andrew Johnson
7f534cbc74 Rename 'thread' iocsh command to 'epicsThreadShow'. 2010-05-03 17:26:41 -05:00
Andrew Johnson
d192f51858 Don't use back-tick chars as open quotes, they aren't any more. 2010-04-28 17:29:04 -05:00
Ralph Lange
7fccc59fe9 ANSIfication of stuff (mostly missing argument types in declarations) 2009-04-03 17:46:26 +00:00
Andrew Johnson
6b212b0e17 Fix type of gphPvt pointer. 2009-03-20 06:04:00 +00:00
Andrew Johnson
a75cb10cb6 Added "errlog" command. 2009-02-24 20:10:57 +00:00
Andrew Johnson
0be13dfc0f Added registryDump command. 2008-12-10 21:34:00 +00:00
Andrew Johnson
6430a49300 General Time updates: Internal cleanup of framework code and providers,
replaced the osdSysTime provider with a new osiClockTime provider,
stringin device support puts record into alarm if no working provider,
added osdTimeRegister() to RTEMS/osdTime.h.
2008-09-12 22:55:55 +00:00
Janet B. Anderson
519b33e4fb Changes for shared library build using MinGW compiler on win32. 2008-07-29 21:11:56 +00:00
Andrew Johnson
1ed5eb1ad1 Major reworking of the task watchdog implementation:
* Added new monitoring API with insert and remove callbacks; the old API is
  still supported though.
* Added report routine, callable from iocsh.
* taskwdInsert() can take a NULL tid, meaning the calling thread.
2008-05-22 17:54:19 +00:00
Andrew Johnson
a3cd917de2 General Time, from Peter Denison, Eric Norum and many others... 2008-04-18 18:39:32 +00:00
Andrew Johnson
3fa2a79f4f Move static command structures to file scope, needed for vxWorks-x86 targets. 2007-11-27 17:57:25 +00:00
Andrew Johnson
30f2018b17 These osiRegister files not used. 2007-08-21 21:07:28 +00:00
Andrew Johnson
ae887b7527 Make date() command available to all architectures.
Allow the user to specify the date/time format string.
2007-05-01 20:23:57 +00:00
Andrew Johnson
70cc7eaab9 Reorganized iocsh command registration to untangle the build order.
The iocsh core is now part of libCom, and commands are registered locally
with a Register routine for each IOC library.
2007-03-13 17:54:23 +00:00