Merge commit '631c8831b942ee5533a2f7016085dcef52c2f3ba' into PSI-7.0

Merge latest 7.0 until before records are modified
This commit is contained in:
zimoch committed 2026-10-13 10:15:50 +02:00
commit d6df659acf
32 files changed
+299 -133

No files matched your search

+2 -2
View File
@@ -206,7 +206,7 @@ typedef struct chFilterIf {
*
* Optional.
* \param filter Pointer to instance data.
* \param stringVal Value, not zero-terminated.
* \param stringVal Value, not null terminated.
* \param stringLen Number of chars in \p stringVal.
* \returns \p parse_stop on error, or \p parse_continue
*/
@@ -226,7 +226,7 @@ typedef struct chFilterIf {
*
* Optional.
* \param filter Pointer to instance data.
* \param key Value not zero-terminated.
* \param key Value not null terminated.
* \param stringLen Number of chars in \p key
* \returns \p parse_stop on error, or \p parse_continue
*/
+2 -2
View File
@@ -444,7 +444,7 @@ static long getCharChar(const dbAddr *paddr,
if (paddr->pfldDes && paddr->pfldDes->field_type == DBF_STRING) {
/* This is a DBF_STRING field being read as a long string.
* The buffer we return must be zero-terminated.
* The buffer we return must be null terminated.
*/
pdst[--nRequest] = 0;
if (nRequest == 0)
@@ -466,7 +466,7 @@ static long getCharUchar(const dbAddr *paddr,
if (paddr->pfldDes && paddr->pfldDes->field_type == DBF_STRING) {
/* This is a DBF_STRING field being read as a long string.
* The buffer we return must be zero-terminated.
* The buffer we return must be null terminated.
*/
pdst[--nRequest] = 0;
if (nRequest == 0)
+1 -1
View File
@@ -111,7 +111,7 @@ typedef struct lset {
/** @brief load constant long string from link type
*
* Usually called during IOC initialization, constant link types must copy a
* nil-terminated string up to size characters long to the buffer provided,
* null terminated string up to size characters long to the buffer provided,
* and write the length of that string to the plen location. A non-constant
* link type can use this as an early hint that subsequent calls to
* dbGetLink() will request long string data, although this might change.
@@ -9,6 +9,7 @@
\*************************************************************************/
#include "iocsh.h"
#include "iocInit.h"
#include "errSymTbl.h"
#include "errlog.h"
@@ -260,6 +261,54 @@ static void dbCreateAliasCallFunc(const iocshArgBuf *args)
}
}
static const iocshArg dbCreateRecordArg0 = { "recordType", iocshArgString};
static const iocshArg dbCreateRecordArg1 = { "recordName", iocshArgString};
static const iocshArg * const dbCreateRecordArgs[] = {&argPdbbase, &dbCreateRecordArg0, &dbCreateRecordArg1};
static const iocshFuncDef dbCreateRecordFuncDef = {
"dbCreateRecord",
3,
dbCreateRecordArgs,
"Add a new record to the database.\n"
"\n"
"Example: dbCreateRecord pdbbase ai record:name\n",
};
/**
* @brief Call function for dbCreateRecord iocsh command.
* Creates a new record in the database with the specified record type and record name.
* @param args The arguments passed from iocsh, where args[0] is the pointer to the database,
* args[1] is the record type name, and args[2] is the record name.
*/
static void dbCreateRecordCallFunc(const iocshArgBuf *args)
{
DBENTRY ent;
long status;
enum iocStateEnum iocState;
iocState = getIocState();
if(iocState != iocVoid) {
status = S_dbLib_postInitRecRegister;
}
else {
dbInitEntry(*iocshPpdbbase, &ent);
if(!args[2].sval || (args[2].sval[0] == '\0')) {
status = S_dbLib_recordNameMissing;
} else if(!args[1].sval) {
status = S_dbLib_recordTypeNotFound;
} else {
status = dbFindRecordType(&ent, args[1].sval);
if(!status) {
status = dbCreateRecord(&ent, args[2].sval);
}
}
dbFinishEntry(&ent);
}
if(status) {
fprintf(stderr, ERL_ERROR ": %ld %s\n", status, errSymMsg(status));
iocshSetError(1);
}
}
void dbStaticIocRegister(void)
{
iocshRegister(&dbDumpPathFuncDef, dbDumpPathCallFunc);
@@ -278,4 +327,5 @@ void dbStaticIocRegister(void)
iocshRegister(&dbPvdTableSizeFuncDef,dbPvdTableSizeCallFunc);
iocshRegister(&dbReportDeviceConfigFuncDef, dbReportDeviceConfigCallFunc);
iocshRegister(&dbCreateAliasFuncDef, dbCreateAliasCallFunc);
iocshRegister(&dbCreateRecordFuncDef, dbCreateRecordCallFunc);
}
+16 -14
View File
@@ -252,20 +252,22 @@ DBCORE_API void dbCatString(char **string, int *stringLength,
extern int dbStaticDebug;
extern int dbConvertStrict;
#define S_dbLib_recordTypeNotFound (M_dbLib|1) /* Record Type does not exist */
#define S_dbLib_recExists (M_dbLib|3) /* Record Already exists */
#define S_dbLib_recNotFound (M_dbLib|5) /* Record Not Found */
#define S_dbLib_flddesNotFound (M_dbLib|7) /* Field Description Not Found */
#define S_dbLib_fieldNotFound (M_dbLib|9) /* Field Not Found */
#define S_dbLib_badField (M_dbLib|11) /* Bad Field value */
#define S_dbLib_menuNotFound (M_dbLib|13) /* Menu not found */
#define S_dbLib_badLink (M_dbLib|15) /* Bad Link Field */
#define S_dbLib_nameLength (M_dbLib|17) /* Record Name is too long */
#define S_dbLib_noRecSup (M_dbLib|19) /* Record support not found */
#define S_dbLib_strLen (M_dbLib|21) /* String is too long */
#define S_dbLib_noSizeOffset (M_dbLib|23) /* Missing SizeOffset Routine - No record support? */
#define S_dbLib_outMem (M_dbLib|27) /* Out of memory */
#define S_dbLib_infoNotFound (M_dbLib|29) /* Info item Not Found */
#define S_dbLib_recordTypeNotFound (M_dbLib|1) /* Record Type does not exist */
#define S_dbLib_recExists (M_dbLib|3) /* Record Already exists */
#define S_dbLib_recNotFound (M_dbLib|5) /* Record Not Found */
#define S_dbLib_flddesNotFound (M_dbLib|7) /* Field Description Not Found */
#define S_dbLib_fieldNotFound (M_dbLib|9) /* Field Not Found */
#define S_dbLib_badField (M_dbLib|11) /* Bad Field value */
#define S_dbLib_menuNotFound (M_dbLib|13) /* Menu not found */
#define S_dbLib_badLink (M_dbLib|15) /* Bad Link Field */
#define S_dbLib_nameLength (M_dbLib|17) /* Record Name is too long */
#define S_dbLib_noRecSup (M_dbLib|19) /* Record support not found */
#define S_dbLib_strLen (M_dbLib|21) /* String is too long */
#define S_dbLib_noSizeOffset (M_dbLib|23) /* Missing SizeOffset Routine - No record support? */
#define S_dbLib_outMem (M_dbLib|27) /* Out of memory */
#define S_dbLib_infoNotFound (M_dbLib|29) /* Info item Not Found */
#define S_dbLib_postInitRecRegister (M_dbLib|31) /* IOC already initialized - No new records can be added */
#define S_dbLib_recordNameMissing (M_dbLib|33) /* Record name is required */
#ifdef __cplusplus
}
+18 -2
View File
@@ -7,7 +7,8 @@
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* iocInit.h ioc initialization */
/** @file iocInit.h
* @brief ioc initialization */
#ifndef INCiocInith
#define INCiocInith
@@ -22,15 +23,30 @@ enum iocStateEnum {
extern "C" {
#endif
/** Query present IOC run state
/** Query the present IOC run state
* @since 3.15.8
*/
DBCORE_API enum iocStateEnum getIocState(void);
/** @brief Initalizes the IOC in two distinct parts - iocBuild and iocRun
*/
DBCORE_API int iocInit(void);
/** @brief Puts the IOC into a quiescent state without allowing the various internal threads it starts to actually run */
DBCORE_API int iocBuild(void);
/** @brief Allows to start an IOC without its Channel Access parts. It can then be shutdown cleanly using iocShutdown.
* Feature only intended to be used for test programs, not production IOCs. */
DBCORE_API int iocBuildIsolated(void);
/** @brief Brings the IOC online after iocBuild or iocPause*/
DBCORE_API int iocRun(void);
/** @brief Freezes all internal operations
*
* the iocRun command can restart it from where it left off or the ioc can be shut down. Pausing may not always be safe as not all drivers and device support may have been written with the possibility of pausing an IOC in mind.
*/
DBCORE_API int iocPause(void);
/** @brief Exits the program, shutsdown the IOC */
DBCORE_API int iocShutdown(void);
#ifdef __cplusplus