Big changes to ioccrf routines.

1) Switched from using the registry to using a C++ map.  This provides
   an easy way to add...
2) A help command.  With no arguments, this command prints a table of
   commands.  With arguments it prints a synopsis of the specified
   command(s).
3) ioccrf() is now thread-safe with plans to add multiple remote
   access via telnet.  The value pointers have been removed from the
   argument structures and a pointer to an array of argument unions is
   passed to the registered callback routines.
4) All command/argument configuration structures are now const.
This commit is contained in:
W. Eric Norum
2000-12-18 15:33:21 +00:00
parent faa077ca9e
commit ad7dc7153c
16 changed files with 492 additions and 458 deletions

View File

@@ -26,7 +26,8 @@ INC += registerRecordDeviceDriverRegister.h
# 2) where to find the sources: ., ./os/<ARCH_CLASS>, ./os/generic, ...
#
LIBSRCS += ioccrf.c
LIBSRCS += ioccrf.cpp
LIBSRCS += epicsReadline.c
LIBSRCS += osiRegister.c
LIBSRCS += dbStaticRegister.c
LIBSRCS += dbTestRegister.c

View File

@@ -18,85 +18,85 @@ of this distribution.
#include "asTestRegister.h"
/* asSetFilename */
static ioccrfArg asSetFilenameArg0 = { "ascf",ioccrfArgString,0};
static ioccrfArg *asSetFilenameArgs[1] = {&asSetFilenameArg0};
static ioccrfFuncDef asSetFilenameFuncDef =
static const ioccrfArg asSetFilenameArg0 = { "ascf",ioccrfArgString};
static const ioccrfArg *asSetFilenameArgs[1] = {&asSetFilenameArg0};
static const ioccrfFuncDef asSetFilenameFuncDef =
{"asSetFilename",1,asSetFilenameArgs};
static void asSetFilenameCallFunc(ioccrfArg **args)
static void asSetFilenameCallFunc(const ioccrfArgBuf *args)
{
asSetFilename((char *)args[0]->value);
asSetFilename(args[0].sval);
}
/* asSetSubstitutions */
static ioccrfArg asSetSubstitutionsArg0 = { "substitutions",ioccrfArgString,0};
static ioccrfArg *asSetSubstitutionsArgs[1] = {&asSetSubstitutionsArg0};
static ioccrfFuncDef asSetSubstitutionsFuncDef =
static const ioccrfArg asSetSubstitutionsArg0 = { "substitutions",ioccrfArgString};
static const ioccrfArg *asSetSubstitutionsArgs[1] = {&asSetSubstitutionsArg0};
static const ioccrfFuncDef asSetSubstitutionsFuncDef =
{"asSetSubstitutions",1,asSetSubstitutionsArgs};
static void asSetSubstitutionsCallFunc(ioccrfArg **args)
static void asSetSubstitutionsCallFunc(const ioccrfArgBuf *args)
{
asSetSubstitutions((char *)args[0]->value);
asSetSubstitutions(args[0].sval);
}
/* asInit */
static ioccrfFuncDef asInitFuncDef = {"asInit",0,0};
static void asInitCallFunc(ioccrfArg **args)
static const ioccrfFuncDef asInitFuncDef = {"asInit",0};
static void asInitCallFunc(const ioccrfArgBuf *args)
{
asInit();
}
/* asdbdump */
static ioccrfFuncDef asdbdumpFuncDef = {"asdbdump",0,0};
static void asdbdumpCallFunc(ioccrfArg **args)
static const ioccrfFuncDef asdbdumpFuncDef = {"asdbdump",0};
static void asdbdumpCallFunc(const ioccrfArgBuf *args)
{
asdbdump();
}
/* aspuag */
static ioccrfArg aspuagArg0 = { "uagname",ioccrfArgString,0};
static ioccrfArg *aspuagArgs[1] = {&aspuagArg0};
static ioccrfFuncDef aspuagFuncDef = {"aspuag",1,aspuagArgs};
static void aspuagCallFunc(ioccrfArg **args)
static const ioccrfArg aspuagArg0 = { "uagname",ioccrfArgString};
static const ioccrfArg *aspuagArgs[1] = {&aspuagArg0};
static const ioccrfFuncDef aspuagFuncDef = {"aspuag",1,aspuagArgs};
static void aspuagCallFunc(const ioccrfArgBuf *args)
{
aspuag((char *)args[0]->value);
aspuag(args[0].sval);
}
/* asphag */
static ioccrfArg asphagArg0 = { "hagname",ioccrfArgString,0};
static ioccrfArg *asphagArgs[1] = {&asphagArg0};
static ioccrfFuncDef asphagFuncDef = {"asphag",1,asphagArgs};
static void asphagCallFunc(ioccrfArg **args)
static const ioccrfArg asphagArg0 = { "hagname",ioccrfArgString};
static const ioccrfArg *asphagArgs[1] = {&asphagArg0};
static const ioccrfFuncDef asphagFuncDef = {"asphag",1,asphagArgs};
static void asphagCallFunc(const ioccrfArgBuf *args)
{
asphag((char *)args[0]->value);
asphag(args[0].sval);
}
/* asprules */
static ioccrfArg asprulesArg0 = { "asgname",ioccrfArgString,0};
static ioccrfArg *asprulesArgs[1] = {&asprulesArg0};
static ioccrfFuncDef asprulesFuncDef = {"asprules",1,asprulesArgs};
static void asprulesCallFunc(ioccrfArg **args)
static const ioccrfArg asprulesArg0 = { "asgname",ioccrfArgString};
static const ioccrfArg *asprulesArgs[1] = {&asprulesArg0};
static const ioccrfFuncDef asprulesFuncDef = {"asprules",1,asprulesArgs};
static void asprulesCallFunc(const ioccrfArgBuf *args)
{
asprules((char *)args[0]->value);
asprules(args[0].sval);
}
/* aspmem */
static ioccrfArg aspmemArg0 = { "asgname",ioccrfArgString,0};
static ioccrfArg aspmemArg1 = { "clients",ioccrfArgInt,0};
static ioccrfArg *aspmemArgs[2] = {&aspmemArg0,&aspmemArg1};
static ioccrfFuncDef aspmemFuncDef = {"aspmem",2,aspmemArgs};
static void aspmemCallFunc(ioccrfArg **args)
static const ioccrfArg aspmemArg0 = { "asgname",ioccrfArgString};
static const ioccrfArg aspmemArg1 = { "clients",ioccrfArgInt};
static const ioccrfArg *aspmemArgs[2] = {&aspmemArg0,&aspmemArg1};
static const ioccrfFuncDef aspmemFuncDef = {"aspmem",2,aspmemArgs};
static void aspmemCallFunc(const ioccrfArgBuf *args)
{
aspmem((char *)args[0]->value,*(int *)args[1]->value);
aspmem(args[0].sval,args[1].ival);
}
/* astac */
static ioccrfArg astacArg0 = { "recordname",ioccrfArgString,0};
static ioccrfArg astacArg1 = { "user",ioccrfArgString,0};
static ioccrfArg astacArg2 = { "location",ioccrfArgString,0};
static ioccrfArg *astacArgs[3] = {&astacArg0,&astacArg1,&astacArg2};
static ioccrfFuncDef astacFuncDef = {"astac",3,astacArgs};
static void astacCallFunc(ioccrfArg **args)
static const ioccrfArg astacArg0 = { "recordname",ioccrfArgString};
static const ioccrfArg astacArg1 = { "user",ioccrfArgString};
static const ioccrfArg astacArg2 = { "location",ioccrfArgString};
static const ioccrfArg *astacArgs[3] = {&astacArg0,&astacArg1,&astacArg2};
static const ioccrfFuncDef astacFuncDef = {"astac",3,astacArgs};
static void astacCallFunc(const ioccrfArgBuf *args)
{
astac((char *)args[0]->value,(char *)args[1]->value,(char *)args[2]->value);
astac(args[0].sval,args[1].sval,args[2].sval);
}

View File

@@ -19,22 +19,22 @@ of this distribution.
#include "caTestRegister.h"
/* casr */
static ioccrfArg casrArg0 = { "level",ioccrfArgInt,0};
static ioccrfArg *casrArgs[1] = {&casrArg0};
static ioccrfFuncDef casrFuncDef = {"casr",1,casrArgs};
static void casrCallFunc(ioccrfArg **args)
static const ioccrfArg casrArg0 = { "level",ioccrfArgInt};
static const ioccrfArg *casrArgs[1] = {&casrArg0};
static const ioccrfFuncDef casrFuncDef = {"casr",1,casrArgs};
static void casrCallFunc(const ioccrfArgBuf *args)
{
casr(*(int *)args[0]->value);
casr(args[0].ival);
}
/* dbel */
static ioccrfArg dbelArg0 = { "record name",ioccrfArgString,0};
static ioccrfArg dbelArg1 = { "level",ioccrfArgInt,0};
static ioccrfArg *dbelArgs[2] = {&dbelArg0,&dbelArg1};
static ioccrfFuncDef dbelFuncDef = {"dbel",2,dbelArgs};
static void dbelCallFunc(ioccrfArg **args)
static const ioccrfArg dbelArg0 = { "record name",ioccrfArgString};
static const ioccrfArg dbelArg1 = { "level",ioccrfArgInt};
static const ioccrfArg *dbelArgs[2] = {&dbelArg0,&dbelArg1};
static const ioccrfFuncDef dbelFuncDef = {"dbel",2,dbelArgs};
static void dbelCallFunc(const ioccrfArgBuf *args)
{
dbel((char *)args[0]->value, *(int *)args[1]->value);
dbel(args[0].sval, args[1].ival);
}

View File

@@ -22,45 +22,44 @@ of this distribution.
#include "ioccrf.h"
/* dbLoadDatabase */
static ioccrfArg dbLoadDatabaseArg0 = { "file name",ioccrfArgString,0};
static ioccrfArg dbLoadDatabaseArg1 = { "path",ioccrfArgString,0};
static ioccrfArg dbLoadDatabaseArg2 = { "substitutions",ioccrfArgString,0};
static ioccrfArg *dbLoadDatabaseArgs[3] =
static const ioccrfArg dbLoadDatabaseArg0 = { "file name",ioccrfArgString};
static const ioccrfArg dbLoadDatabaseArg1 = { "path",ioccrfArgString};
static const ioccrfArg dbLoadDatabaseArg2 = { "substitutions",ioccrfArgString};
static const ioccrfArg *dbLoadDatabaseArgs[3] =
{
&dbLoadDatabaseArg0,&dbLoadDatabaseArg1,&dbLoadDatabaseArg2
};
static ioccrfFuncDef dbLoadDatabaseFuncDef =
static const ioccrfFuncDef dbLoadDatabaseFuncDef =
{"dbLoadDatabase",3,dbLoadDatabaseArgs};
static void dbLoadDatabaseCallFunc(ioccrfArg **args)
static void dbLoadDatabaseCallFunc(const ioccrfArgBuf *args)
{
dbLoadDatabase(
(char *)args[0]->value,(char *)args[1]->value,(char *)args[2]->value);
dbLoadDatabase(args[0].sval,args[1].sval,args[2].sval);
}
/* dbLoadRecords */
static ioccrfArg dbLoadRecordsArg0 = { "file name",ioccrfArgString,0};
static ioccrfArg dbLoadRecordsArg1 = { "substitutions",ioccrfArgString,0};
static ioccrfArg *dbLoadRecordsArgs[2] = {&dbLoadRecordsArg0,&dbLoadRecordsArg1};
static ioccrfFuncDef dbLoadRecordsFuncDef = {"dbLoadRecords",2,dbLoadRecordsArgs};
static void dbLoadRecordsCallFunc(ioccrfArg **args)
static const ioccrfArg dbLoadRecordsArg0 = { "file name",ioccrfArgString};
static const ioccrfArg dbLoadRecordsArg1 = { "substitutions",ioccrfArgString};
static const ioccrfArg *dbLoadRecordsArgs[2] = {&dbLoadRecordsArg0,&dbLoadRecordsArg1};
static const ioccrfFuncDef dbLoadRecordsFuncDef = {"dbLoadRecords",2,dbLoadRecordsArgs};
static void dbLoadRecordsCallFunc(const ioccrfArgBuf *args)
{
dbLoadRecords((char *)args[0]->value,(char *)args[1]->value);
dbLoadRecords(args[0].sval,args[1].sval);
}
/* dbLoadTemplate */
static ioccrfArg dbLoadTemplateArg0 = { "file name",ioccrfArgString,0};
static ioccrfArg *dbLoadTemplateArgs[1] = {&dbLoadTemplateArg0};
static ioccrfFuncDef dbLoadTemplateFuncDef =
static const ioccrfArg dbLoadTemplateArg0 = { "file name",ioccrfArgString};
static const ioccrfArg *dbLoadTemplateArgs[1] = {&dbLoadTemplateArg0};
static const ioccrfFuncDef dbLoadTemplateFuncDef =
{"dbLoadTemplate",1,dbLoadTemplateArgs};
static void dbLoadTemplateCallFunc(ioccrfArg **args)
static void dbLoadTemplateCallFunc(const ioccrfArgBuf *args)
{
dbLoadTemplate((char *)args[0]->value);
dbLoadTemplate(args[0].sval);
}
/* iocInit */
static ioccrfFuncDef iocInitFuncDef =
static const ioccrfFuncDef iocInitFuncDef =
{"iocInit",0,0};
static void iocInitCallFunc(ioccrfArg **args)
static void iocInitCallFunc(const ioccrfArgBuf *args)
{
iocInit();
}

View File

@@ -28,45 +28,45 @@ of this distribution.
#include "dbBkptRegister.h"
/* dbb */
static ioccrfArg dbbArg0 = { "record name",ioccrfArgString,0};
static ioccrfArg *dbbArgs[1] = {&dbbArg0};
static ioccrfFuncDef dbbFuncDef = {"dbb",1,dbbArgs};
static void dbbCallFunc(ioccrfArg **args) { dbb((char *)args[0]->value);}
static const ioccrfArg dbbArg0 = { "record name",ioccrfArgString};
static const ioccrfArg *dbbArgs[1] = {&dbbArg0};
static const ioccrfFuncDef dbbFuncDef = {"dbb",1,dbbArgs};
static void dbbCallFunc(const ioccrfArgBuf *args) { dbb(args[0].sval);}
/* dbd */
static ioccrfArg dbdArg0 = { "record name",ioccrfArgString,0};
static ioccrfArg *dbdArgs[1] = {&dbdArg0};
static ioccrfFuncDef dbdFuncDef = {"dbd",1,dbdArgs};
static void dbdCallFunc(ioccrfArg **args) { dbd((char *)args[0]->value);}
static const ioccrfArg dbdArg0 = { "record name",ioccrfArgString};
static const ioccrfArg *dbdArgs[1] = {&dbdArg0};
static const ioccrfFuncDef dbdFuncDef = {"dbd",1,dbdArgs};
static void dbdCallFunc(const ioccrfArgBuf *args) { dbd(args[0].sval);}
/* dbc */
static ioccrfArg dbcArg0 = { "record name",ioccrfArgString,0};
static ioccrfArg *dbcArgs[1] = {&dbcArg0};
static ioccrfFuncDef dbcFuncDef = {"dbc",1,dbcArgs};
static void dbcCallFunc(ioccrfArg **args) { dbc((char *)args[0]->value);}
static const ioccrfArg dbcArg0 = { "record name",ioccrfArgString};
static const ioccrfArg *dbcArgs[1] = {&dbcArg0};
static const ioccrfFuncDef dbcFuncDef = {"dbc",1,dbcArgs};
static void dbcCallFunc(const ioccrfArgBuf *args) { dbc(args[0].sval);}
/* dbs */
static ioccrfArg dbsArg0 = { "record name",ioccrfArgString,0};
static ioccrfArg *dbsArgs[1] = {&dbsArg0};
static ioccrfFuncDef dbsFuncDef = {"dbs",1,dbsArgs};
static void dbsCallFunc(ioccrfArg **args) { dbs((char *)args[0]->value);}
static const ioccrfArg dbsArg0 = { "record name",ioccrfArgString};
static const ioccrfArg *dbsArgs[1] = {&dbsArg0};
static const ioccrfFuncDef dbsFuncDef = {"dbs",1,dbsArgs};
static void dbsCallFunc(const ioccrfArgBuf *args) { dbs(args[0].sval);}
static ioccrfFuncDef dbstatFuncDef = {"dbstat",0,0};
static void dbstatCallFunc(ioccrfArg **args) { dbstat();}
static const ioccrfFuncDef dbstatFuncDef = {"dbstat",0};
static void dbstatCallFunc(const ioccrfArgBuf *args) { dbstat();}
/* dbp */
static ioccrfArg dbpArg0 = { "record name",ioccrfArgString,0};
static ioccrfArg dbpArg1 = { "interest_level",ioccrfArgInt,0};
static ioccrfArg *dbpArgs[2] = {&dbpArg0,&dbpArg1};
static ioccrfFuncDef dbpFuncDef = {"dbp",2,dbpArgs};
static void dbpCallFunc(ioccrfArg **args)
{ dbp((char *)args[0]->value,*(int *)args[1]->value);}
static const ioccrfArg dbpArg0 = { "record name",ioccrfArgString};
static const ioccrfArg dbpArg1 = { "interest_level",ioccrfArgInt};
static const ioccrfArg *dbpArgs[2] = {&dbpArg0,&dbpArg1};
static const ioccrfFuncDef dbpFuncDef = {"dbp",2,dbpArgs};
static void dbpCallFunc(const ioccrfArgBuf *args)
{ dbp(args[0].sval,args[1].ival);}
/* dbap */
static ioccrfArg dbapArg0 = { "record name",ioccrfArgString,0};
static ioccrfArg *dbapArgs[1] = {&dbapArg0};
static ioccrfFuncDef dbapFuncDef = {"dbap",1,dbapArgs};
static void dbapCallFunc(ioccrfArg **args) { dbap((char *)args[0]->value);}
static const ioccrfArg dbapArg0 = { "record name",ioccrfArgString};
static const ioccrfArg *dbapArgs[1] = {&dbapArg0};
static const ioccrfFuncDef dbapFuncDef = {"dbap",1,dbapArgs};
static void dbapCallFunc(const ioccrfArgBuf *args) { dbap(args[0].sval);}
void epicsShareAPI dbBkptRegister(void)
{

View File

@@ -18,13 +18,13 @@ of this distribution.
#include "dbCaTestRegister.h"
/* dbcar */
static ioccrfArg dbcarArg0 = { "record name",ioccrfArgString,0};
static ioccrfArg dbcarArg1 = { "level",ioccrfArgInt,0};
static ioccrfArg *dbcarArgs[2] = {&dbcarArg0,&dbcarArg1};
static ioccrfFuncDef dbcarFuncDef = {"dbcar",2,dbcarArgs};
static void dbcarCallFunc(ioccrfArg **args)
static const ioccrfArg dbcarArg0 = { "record name",ioccrfArgString};
static const ioccrfArg dbcarArg1 = { "level",ioccrfArgInt};
static const ioccrfArg *dbcarArgs[2] = {&dbcarArg0,&dbcarArg1};
static const ioccrfFuncDef dbcarFuncDef = {"dbcar",2,dbcarArgs};
static void dbcarCallFunc(const ioccrfArgBuf *args)
{
dbcar((char *)args[0]->value,*(int *)args[1]->value);
dbcar(args[0].sval,args[1].ival);
}

View File

@@ -20,109 +20,109 @@ of this distribution.
#include "dbStaticRegister.h"
/* dbDumpRecDes */
static ioccrfArg dbDumpRecDesArg0 = { "pdbbase",ioccrfArgPdbbase,0};
static ioccrfArg dbDumpRecDesArg1 = { "recordTypeName",ioccrfArgString,0};
static ioccrfArg *dbDumpRecDesArgs[2] = {&dbDumpRecDesArg0,&dbDumpRecDesArg1};
static ioccrfFuncDef dbDumpRecDesFuncDef = {"dbDumpRecDes",2,dbDumpRecDesArgs};
static void dbDumpRecDesCallFunc(ioccrfArg **args)
static const ioccrfArg dbDumpRecDesArg0 = { "pdbbase",ioccrfArgPdbbase};
static const ioccrfArg dbDumpRecDesArg1 = { "recordTypeName",ioccrfArgString};
static const ioccrfArg *dbDumpRecDesArgs[2] = {&dbDumpRecDesArg0,&dbDumpRecDesArg1};
static const ioccrfFuncDef dbDumpRecDesFuncDef = {"dbDumpRecDes",2,dbDumpRecDesArgs};
static void dbDumpRecDesCallFunc(const ioccrfArgBuf *args)
{
dbDumpRecDes(pdbbase,(char *)args[1]->value);
dbDumpRecDes(pdbbase,args[1].sval);
}
/* dbDumpPath */
static ioccrfArg dbDumpPathArg0 = { "pdbbase",ioccrfArgPdbbase,0};
static ioccrfArg *dbDumpPathArgs[1] = {&dbDumpPathArg0};
static ioccrfFuncDef dbDumpPathFuncDef = {"dbDumpPath",1,dbDumpPathArgs};
static void dbDumpPathCallFunc(ioccrfArg **args)
static const ioccrfArg dbDumpPathArg0 = { "pdbbase",ioccrfArgPdbbase};
static const ioccrfArg *dbDumpPathArgs[1] = {&dbDumpPathArg0};
static const ioccrfFuncDef dbDumpPathFuncDef = {"dbDumpPath",1,dbDumpPathArgs};
static void dbDumpPathCallFunc(const ioccrfArgBuf *args)
{
dbDumpPath(pdbbase);
}
/* dbDumpRecord */
static ioccrfArg dbDumpRecordArg0 = { "pdbbase",ioccrfArgPdbbase,0};
static ioccrfArg dbDumpRecordArg1 = { "recordTypeName",ioccrfArgString,0};
static ioccrfArg dbDumpRecordArg2 = { "interest_level",ioccrfArgInt,0};
static ioccrfArg *dbDumpRecordArgs[3] =
static const ioccrfArg dbDumpRecordArg0 = { "pdbbase",ioccrfArgPdbbase};
static const ioccrfArg dbDumpRecordArg1 = { "recordTypeName",ioccrfArgString};
static const ioccrfArg dbDumpRecordArg2 = { "interest_level",ioccrfArgInt};
static const ioccrfArg *dbDumpRecordArgs[3] =
{&dbDumpRecordArg0,&dbDumpRecordArg1,&dbDumpRecordArg2};
static ioccrfFuncDef dbDumpRecordFuncDef = {"dbDumpRecord",3,dbDumpRecordArgs};
static void dbDumpRecordCallFunc(ioccrfArg **args)
static const ioccrfFuncDef dbDumpRecordFuncDef = {"dbDumpRecord",3,dbDumpRecordArgs};
static void dbDumpRecordCallFunc(const ioccrfArgBuf *args)
{
dbDumpRecord(pdbbase,(char *)args[1]->value,*(int *)args[2]->value);
dbDumpRecord(pdbbase,args[1].sval,args[2].ival);
}
/* dbDumpMenu */
static ioccrfArg dbDumpMenuArg0 = { "pdbbase",ioccrfArgPdbbase,0};
static ioccrfArg dbDumpMenuArg1 = { "menuName",ioccrfArgString,0};
static ioccrfArg *dbDumpMenuArgs[2] = {&dbDumpMenuArg0,&dbDumpMenuArg1};
static ioccrfFuncDef dbDumpMenuFuncDef = {"dbDumpMenu",2,dbDumpMenuArgs};
static void dbDumpMenuCallFunc(ioccrfArg **args)
static const ioccrfArg dbDumpMenuArg0 = { "pdbbase",ioccrfArgPdbbase};
static const ioccrfArg dbDumpMenuArg1 = { "menuName",ioccrfArgString};
static const ioccrfArg *dbDumpMenuArgs[2] = {&dbDumpMenuArg0,&dbDumpMenuArg1};
static const ioccrfFuncDef dbDumpMenuFuncDef = {"dbDumpMenu",2,dbDumpMenuArgs};
static void dbDumpMenuCallFunc(const ioccrfArgBuf *args)
{
dbDumpMenu(pdbbase,(char *)args[1]->value);
dbDumpMenu(pdbbase,args[1].sval);
}
/* dbDumpRecordType */
static ioccrfArg dbDumpRecordTypeArg0 = { "pdbbase",ioccrfArgPdbbase,0};
static ioccrfArg dbDumpRecordTypeArg1 = { "recordTypeName",ioccrfArgString,0};
static ioccrfArg *dbDumpRecordTypeArgs[2] =
static const ioccrfArg dbDumpRecordTypeArg0 = { "pdbbase",ioccrfArgPdbbase};
static const ioccrfArg dbDumpRecordTypeArg1 = { "recordTypeName",ioccrfArgString};
static const ioccrfArg *dbDumpRecordTypeArgs[2] =
{&dbDumpRecordTypeArg0,&dbDumpRecordTypeArg1};
static ioccrfFuncDef dbDumpRecordTypeFuncDef =
static const ioccrfFuncDef dbDumpRecordTypeFuncDef =
{"dbDumpRecordType",2,dbDumpRecordTypeArgs};
static void dbDumpRecordTypeCallFunc(ioccrfArg **args)
static void dbDumpRecordTypeCallFunc(const ioccrfArgBuf *args)
{
dbDumpRecordType(pdbbase,(char *)args[1]->value);
dbDumpRecordType(pdbbase,args[1].sval);
}
/* dbDumpFldDes */
static ioccrfArg dbDumpFldDesArg0 = { "pdbbase",ioccrfArgPdbbase,0};
static ioccrfArg dbDumpFldDesArg1 = { "recordTypeName",ioccrfArgString,0};
static ioccrfArg dbDumpFldDesArg2 = { "fieldName",ioccrfArgString,0};
static ioccrfArg *dbDumpFldDesArgs[3] =
static const ioccrfArg dbDumpFldDesArg0 = { "pdbbase",ioccrfArgPdbbase};
static const ioccrfArg dbDumpFldDesArg1 = { "recordTypeName",ioccrfArgString};
static const ioccrfArg dbDumpFldDesArg2 = { "fieldName",ioccrfArgString};
static const ioccrfArg *dbDumpFldDesArgs[3] =
{&dbDumpFldDesArg0,&dbDumpFldDesArg1,&dbDumpFldDesArg2};
static ioccrfFuncDef dbDumpFldDesFuncDef = {"dbDumpFldDes",3,dbDumpFldDesArgs};
static void dbDumpFldDesCallFunc(ioccrfArg **args)
static const ioccrfFuncDef dbDumpFldDesFuncDef = {"dbDumpFldDes",3,dbDumpFldDesArgs};
static void dbDumpFldDesCallFunc(const ioccrfArgBuf *args)
{
dbDumpFldDes(pdbbase,(char *)args[1]->value,(char *)args[2]->value);
dbDumpFldDes(pdbbase,args[1].sval,args[2].sval);
}
/* dbDumpDevice */
static ioccrfArg dbDumpDeviceArg0 = { "pdbbase",ioccrfArgPdbbase,0};
static ioccrfArg dbDumpDeviceArg1 = { "recordTypeName",ioccrfArgString,0};
static ioccrfArg *dbDumpDeviceArgs[2] = {&dbDumpDeviceArg0,&dbDumpDeviceArg1};
static ioccrfFuncDef dbDumpDeviceFuncDef = {"dbDumpDevice",2,dbDumpDeviceArgs};
static void dbDumpDeviceCallFunc(ioccrfArg **args)
static const ioccrfArg dbDumpDeviceArg0 = { "pdbbase",ioccrfArgPdbbase};
static const ioccrfArg dbDumpDeviceArg1 = { "recordTypeName",ioccrfArgString};
static const ioccrfArg *dbDumpDeviceArgs[2] = {&dbDumpDeviceArg0,&dbDumpDeviceArg1};
static const ioccrfFuncDef dbDumpDeviceFuncDef = {"dbDumpDevice",2,dbDumpDeviceArgs};
static void dbDumpDeviceCallFunc(const ioccrfArgBuf *args)
{
dbDumpDevice(pdbbase,(char *)args[1]->value);
dbDumpDevice(pdbbase,args[1].sval);
}
/* dbDumpDriver */
static ioccrfArg dbDumpDriverArg0 = { "pdbbase",ioccrfArgPdbbase,0};
static ioccrfArg *dbDumpDriverArgs[1] = {&dbDumpDriverArg0};
static ioccrfFuncDef dbDumpDriverFuncDef = {"dbDumpDriver",1,dbDumpDriverArgs};
static void dbDumpDriverCallFunc(ioccrfArg **args)
static const ioccrfArg dbDumpDriverArg0 = { "pdbbase",ioccrfArgPdbbase};
static const ioccrfArg *dbDumpDriverArgs[1] = {&dbDumpDriverArg0};
static const ioccrfFuncDef dbDumpDriverFuncDef = {"dbDumpDriver",1,dbDumpDriverArgs};
static void dbDumpDriverCallFunc(const ioccrfArgBuf *args)
{
dbDumpDriver(pdbbase);
}
/* dbDumpBreaktable */
static ioccrfArg dbDumpBreaktableArg0 = { "pdbbase",ioccrfArgPdbbase,0};
static ioccrfArg dbDumpBreaktableArg1 = { "tableName",ioccrfArgString,0};
static ioccrfArg *dbDumpBreaktableArgs[2] =
static const ioccrfArg dbDumpBreaktableArg0 = { "pdbbase",ioccrfArgPdbbase};
static const ioccrfArg dbDumpBreaktableArg1 = { "tableName",ioccrfArgString};
static const ioccrfArg *dbDumpBreaktableArgs[2] =
{&dbDumpBreaktableArg0,&dbDumpBreaktableArg1};
static ioccrfFuncDef dbDumpBreaktableFuncDef =
static const ioccrfFuncDef dbDumpBreaktableFuncDef =
{"dbDumpBreaktable",2,dbDumpBreaktableArgs};
static void dbDumpBreaktableCallFunc(ioccrfArg **args)
static void dbDumpBreaktableCallFunc(const ioccrfArgBuf *args)
{
dbDumpBreaktable(pdbbase,(char *)args[1]->value);
dbDumpBreaktable(pdbbase,args[1].sval);
}
/* dbPvdDump */
static ioccrfArg dbPvdDumpArg0 = { "pdbbase",ioccrfArgPdbbase,0};
static ioccrfArg dbPvdDumpArg1 = { "verbose",ioccrfArgInt,0};
static ioccrfArg *dbPvdDumpArgs[2] = {&dbPvdDumpArg0,&dbPvdDumpArg1};
static ioccrfFuncDef dbPvdDumpFuncDef = {"dbPvdDump",2,dbPvdDumpArgs};
static void dbPvdDumpCallFunc(ioccrfArg **args)
static const ioccrfArg dbPvdDumpArg0 = { "pdbbase",ioccrfArgPdbbase};
static const ioccrfArg dbPvdDumpArg1 = { "verbose",ioccrfArgInt};
static const ioccrfArg *dbPvdDumpArgs[2] = {&dbPvdDumpArg0,&dbPvdDumpArg1};
static const ioccrfFuncDef dbPvdDumpFuncDef = {"dbPvdDump",2,dbPvdDumpArgs};
static void dbPvdDumpCallFunc(const ioccrfArgBuf *args)
{
dbPvdDump(pdbbase,*(int *)args[1]->value);
dbPvdDump(pdbbase,args[1].ival);
}
void epicsShareAPI dbStaticRegister(void)

View File

@@ -23,145 +23,145 @@ of this distribution.
#include "dbTestRegister.h"
/* dba */
static ioccrfArg dbaArg0 = { "record name",ioccrfArgString,0};
static ioccrfArg *dbaArgs[1] = {&dbaArg0};
static ioccrfFuncDef dbaFuncDef = {"dba",1,dbaArgs};
static void dbaCallFunc(ioccrfArg **args) { dba((char *)args[0]->value);}
static const ioccrfArg dbaArg0 = { "record name",ioccrfArgString};
static const ioccrfArg *dbaArgs[1] = {&dbaArg0};
static const ioccrfFuncDef dbaFuncDef = {"dba",1,dbaArgs};
static void dbaCallFunc(const ioccrfArgBuf *args) { dba(args[0].sval);}
/* dbl */
static ioccrfArg dblArg0 = { "record type",ioccrfArgString,0};
static ioccrfArg dblArg1 = { "output file",ioccrfArgString,0};
static ioccrfArg dblArg2 = { "fields",ioccrfArgString,0};
static ioccrfArg *dblArgs[3] = {&dblArg0,&dblArg1,&dblArg2};
static ioccrfFuncDef dblFuncDef = {"dbl",3,dblArgs};
static void dblCallFunc(ioccrfArg **args)
static const ioccrfArg dblArg0 = { "record type",ioccrfArgString};
static const ioccrfArg dblArg1 = { "output file",ioccrfArgString};
static const ioccrfArg dblArg2 = { "fields",ioccrfArgString};
static const ioccrfArg *dblArgs[3] = {&dblArg0,&dblArg1,&dblArg2};
static const ioccrfFuncDef dblFuncDef = {"dbl",3,dblArgs};
static void dblCallFunc(const ioccrfArgBuf *args)
{
dbl((char *)args[0]->value,(char *)args[1]->value,(char *)args[2]->value);
dbl(args[0].sval,args[1].sval,args[2].sval);
}
/* dbnr */
static ioccrfArg dbnrArg0 = { "verbose",ioccrfArgInt,0};
static ioccrfArg *dbnrArgs[1] = {&dbnrArg0};
static ioccrfFuncDef dbnrFuncDef = {"dbnr",1,dbnrArgs};
static void dbnrCallFunc(ioccrfArg **args) { dbnr(*(int *)args[0]->value);}
static const ioccrfArg dbnrArg0 = { "verbose",ioccrfArgInt};
static const ioccrfArg *dbnrArgs[1] = {&dbnrArg0};
static const ioccrfFuncDef dbnrFuncDef = {"dbnr",1,dbnrArgs};
static void dbnrCallFunc(const ioccrfArgBuf *args) { dbnr(args[0].ival);}
/* dbgrep */
static ioccrfArg dbgrepArg0 = { "record name",ioccrfArgString,0};
static ioccrfArg *dbgrepArgs[1] = {&dbgrepArg0};
static ioccrfFuncDef dbgrepFuncDef = {"dbgrep",1,dbgrepArgs};
static void dbgrepCallFunc(ioccrfArg **args) { dbgrep((char *)args[0]->value);}
static const ioccrfArg dbgrepArg0 = { "record name",ioccrfArgString};
static const ioccrfArg *dbgrepArgs[1] = {&dbgrepArg0};
static const ioccrfFuncDef dbgrepFuncDef = {"dbgrep",1,dbgrepArgs};
static void dbgrepCallFunc(const ioccrfArgBuf *args) { dbgrep(args[0].sval);}
/* dbgf */
static ioccrfArg dbgfArg0 = { "record name",ioccrfArgString,0};
static ioccrfArg *dbgfArgs[1] = {&dbgfArg0};
static ioccrfFuncDef dbgfFuncDef = {"dbgf",1,dbgfArgs};
static void dbgfCallFunc(ioccrfArg **args) { dbgf((char *)args[0]->value);}
static const ioccrfArg dbgfArg0 = { "record name",ioccrfArgString};
static const ioccrfArg *dbgfArgs[1] = {&dbgfArg0};
static const ioccrfFuncDef dbgfFuncDef = {"dbgf",1,dbgfArgs};
static void dbgfCallFunc(const ioccrfArgBuf *args) { dbgf(args[0].sval);}
/* dbpf */
static ioccrfArg dbpfArg0 = { "record name",ioccrfArgString,0};
static ioccrfArg dbpfArg1 = { "value",ioccrfArgString,0};
static ioccrfArg *dbpfArgs[2] = {&dbpfArg0,&dbpfArg1};
static ioccrfFuncDef dbpfFuncDef = {"dbpf",2,dbpfArgs};
static void dbpfCallFunc(ioccrfArg **args)
{ dbpf((char *)args[0]->value,(char *)args[1]->value);}
static const ioccrfArg dbpfArg0 = { "record name",ioccrfArgString};
static const ioccrfArg dbpfArg1 = { "value",ioccrfArgString};
static const ioccrfArg *dbpfArgs[2] = {&dbpfArg0,&dbpfArg1};
static const ioccrfFuncDef dbpfFuncDef = {"dbpf",2,dbpfArgs};
static void dbpfCallFunc(const ioccrfArgBuf *args)
{ dbpf(args[0].sval,args[1].sval);}
/* dbpr */
static ioccrfArg dbprArg0 = { "record name",ioccrfArgString,0};
static ioccrfArg dbprArg1 = { "interest_level",ioccrfArgInt,0};
static ioccrfArg *dbprArgs[2] = {&dbprArg0,&dbprArg1};
static ioccrfFuncDef dbprFuncDef = {"dbpr",2,dbprArgs};
static void dbprCallFunc(ioccrfArg **args)
{ dbpr((char *)args[0]->value,*(int *)args[1]->value);}
static const ioccrfArg dbprArg0 = { "record name",ioccrfArgString};
static const ioccrfArg dbprArg1 = { "interest_level",ioccrfArgInt};
static const ioccrfArg *dbprArgs[2] = {&dbprArg0,&dbprArg1};
static const ioccrfFuncDef dbprFuncDef = {"dbpr",2,dbprArgs};
static void dbprCallFunc(const ioccrfArgBuf *args)
{ dbpr(args[0].sval,args[1].ival);}
/* dbtr */
static ioccrfArg dbtrArg0 = { "record name",ioccrfArgString,0};
static ioccrfArg *dbtrArgs[1] = {&dbtrArg0};
static ioccrfFuncDef dbtrFuncDef = {"dbtr",1,dbtrArgs};
static void dbtrCallFunc(ioccrfArg **args) { dbtr((char *)args[0]->value);}
static const ioccrfArg dbtrArg0 = { "record name",ioccrfArgString};
static const ioccrfArg *dbtrArgs[1] = {&dbtrArg0};
static const ioccrfFuncDef dbtrFuncDef = {"dbtr",1,dbtrArgs};
static void dbtrCallFunc(const ioccrfArgBuf *args) { dbtr(args[0].sval);}
/* dbtgf */
static ioccrfArg dbtgfArg0 = { "record name",ioccrfArgString,0};
static ioccrfArg *dbtgfArgs[1] = {&dbtgfArg0};
static ioccrfFuncDef dbtgfFuncDef = {"dbtgf",1,dbtgfArgs};
static void dbtgfCallFunc(ioccrfArg **args) { dbtgf((char *)args[0]->value);}
static const ioccrfArg dbtgfArg0 = { "record name",ioccrfArgString};
static const ioccrfArg *dbtgfArgs[1] = {&dbtgfArg0};
static const ioccrfFuncDef dbtgfFuncDef = {"dbtgf",1,dbtgfArgs};
static void dbtgfCallFunc(const ioccrfArgBuf *args) { dbtgf(args[0].sval);}
/* dbtpf */
static ioccrfArg dbtpfArg0 = { "record name",ioccrfArgString,0};
static ioccrfArg dbtpfArg1 = { "value",ioccrfArgString,0};
static ioccrfArg *dbtpfArgs[2] = {&dbtpfArg0,&dbtpfArg1};
static ioccrfFuncDef dbtpfFuncDef = {"dbtpf",2,dbtpfArgs};
static void dbtpfCallFunc(ioccrfArg **args)
{ dbtpf((char *)args[0]->value,(char *)args[1]->value);}
static const ioccrfArg dbtpfArg0 = { "record name",ioccrfArgString};
static const ioccrfArg dbtpfArg1 = { "value",ioccrfArgString};
static const ioccrfArg *dbtpfArgs[2] = {&dbtpfArg0,&dbtpfArg1};
static const ioccrfFuncDef dbtpfFuncDef = {"dbtpf",2,dbtpfArgs};
static void dbtpfCallFunc(const ioccrfArgBuf *args)
{ dbtpf(args[0].sval,args[1].sval);}
/* dbior */
static ioccrfArg dbiorArg0 = { "record name",ioccrfArgString,0};
static ioccrfArg dbiorArg1 = { "interest_level",ioccrfArgInt,0};
static ioccrfArg *dbiorArgs[2] = {&dbiorArg0,&dbiorArg1};
static ioccrfFuncDef dbiorFuncDef = {"dbior",2,dbiorArgs};
static void dbiorCallFunc(ioccrfArg **args)
{ dbior((char *)args[0]->value,*(int *)args[1]->value);}
static const ioccrfArg dbiorArg0 = { "record name",ioccrfArgString};
static const ioccrfArg dbiorArg1 = { "interest_level",ioccrfArgInt};
static const ioccrfArg *dbiorArgs[2] = {&dbiorArg0,&dbiorArg1};
static const ioccrfFuncDef dbiorFuncDef = {"dbior",2,dbiorArgs};
static void dbiorCallFunc(const ioccrfArgBuf *args)
{ dbior(args[0].sval,args[1].ival);}
/* dbhcr */
static ioccrfArg dbhcrArg0 = { "filename",ioccrfArgString,0};
static ioccrfArg *dbhcrArgs[1] = {&dbhcrArg0};
static ioccrfFuncDef dbhcrFuncDef = {"dbhcr",1,dbhcrArgs};
static void dbhcrCallFunc(ioccrfArg **args) { dbhcr((char *)args[0]->value);}
static const ioccrfArg dbhcrArg0 = { "filename",ioccrfArgString};
static const ioccrfArg *dbhcrArgs[1] = {&dbhcrArg0};
static const ioccrfFuncDef dbhcrFuncDef = {"dbhcr",1,dbhcrArgs};
static void dbhcrCallFunc(const ioccrfArgBuf *args) { dbhcr(args[0].sval);}
/* gft */
static ioccrfArg gftArg0 = { "record name",ioccrfArgString,0};
static ioccrfArg *gftArgs[1] = {&gftArg0};
static ioccrfFuncDef gftFuncDef = {"gft",1,gftArgs};
static void gftCallFunc(ioccrfArg **args) { gft((char *)args[0]->value);}
static const ioccrfArg gftArg0 = { "record name",ioccrfArgString};
static const ioccrfArg *gftArgs[1] = {&gftArg0};
static const ioccrfFuncDef gftFuncDef = {"gft",1,gftArgs};
static void gftCallFunc(const ioccrfArgBuf *args) { gft(args[0].sval);}
/* pft */
static ioccrfArg pftArg0 = { "record name",ioccrfArgString,0};
static ioccrfArg pftArg1 = { "value",ioccrfArgString,0};
static ioccrfArg *pftArgs[2] = {&pftArg0,&pftArg1};
static ioccrfFuncDef pftFuncDef = {"pft",2,pftArgs};
static void pftCallFunc(ioccrfArg **args)
{ pft((char *)args[0]->value,(char *)args[1]->value);}
static const ioccrfArg pftArg0 = { "record name",ioccrfArgString};
static const ioccrfArg pftArg1 = { "value",ioccrfArgString};
static const ioccrfArg *pftArgs[2] = {&pftArg0,&pftArg1};
static const ioccrfFuncDef pftFuncDef = {"pft",2,pftArgs};
static void pftCallFunc(const ioccrfArgBuf *args)
{ pft(args[0].sval,args[1].sval);}
/* dbtpn */
static ioccrfArg dbtpnArg0 = { "record name",ioccrfArgString,0};
static ioccrfArg dbtpnArg1 = { "value",ioccrfArgString,0};
static ioccrfArg *dbtpnArgs[2] = {&dbtpnArg0,&dbtpnArg1};
static ioccrfFuncDef dbtpnFuncDef = {"dbtpn",2,dbtpnArgs};
static void dbtpnCallFunc(ioccrfArg **args)
{ dbtpn((char *)args[0]->value,(char *)args[1]->value);}
static const ioccrfArg dbtpnArg0 = { "record name",ioccrfArgString};
static const ioccrfArg dbtpnArg1 = { "value",ioccrfArgString};
static const ioccrfArg *dbtpnArgs[2] = {&dbtpnArg0,&dbtpnArg1};
static const ioccrfFuncDef dbtpnFuncDef = {"dbtpn",2,dbtpnArgs};
static void dbtpnCallFunc(const ioccrfArgBuf *args)
{ dbtpn(args[0].sval,args[1].sval);}
/* tpn */
static ioccrfArg tpnArg0 = { "record name",ioccrfArgString,0};
static ioccrfArg tpnArg1 = { "value",ioccrfArgString,0};
static ioccrfArg *tpnArgs[2] = {&tpnArg0,&tpnArg1};
static ioccrfFuncDef tpnFuncDef = {"tpn",2,tpnArgs};
static void tpnCallFunc(ioccrfArg **args)
{ tpn((char *)args[0]->value,(char *)args[1]->value);}
static const ioccrfArg tpnArg0 = { "record name",ioccrfArgString};
static const ioccrfArg tpnArg1 = { "value",ioccrfArgString};
static const ioccrfArg *tpnArgs[2] = {&tpnArg0,&tpnArg1};
static const ioccrfFuncDef tpnFuncDef = {"tpn",2,tpnArgs};
static void tpnCallFunc(const ioccrfArgBuf *args)
{ tpn(args[0].sval,args[1].sval);}
/* dblsr */
static ioccrfArg dblsrArg0 = { "record name",ioccrfArgString,0};
static ioccrfArg dblsrArg1 = { "interest_level",ioccrfArgInt,0};
static ioccrfArg *dblsrArgs[2] = {&dblsrArg0,&dblsrArg1};
static ioccrfFuncDef dblsrFuncDef = {"dblsr",2,dblsrArgs};
static void dblsrCallFunc(ioccrfArg **args)
{ dblsr((char *)args[0]->value,*(int *)args[1]->value);}
static const ioccrfArg dblsrArg0 = { "record name",ioccrfArgString};
static const ioccrfArg dblsrArg1 = { "interest_level",ioccrfArgInt};
static const ioccrfArg *dblsrArgs[2] = {&dblsrArg0,&dblsrArg1};
static const ioccrfFuncDef dblsrFuncDef = {"dblsr",2,dblsrArgs};
static void dblsrCallFunc(const ioccrfArgBuf *args)
{ dblsr(args[0].sval,args[1].ival);}
/* scanppl */
static ioccrfArg scanpplArg0 = { "rate",ioccrfArgDouble,0};
static ioccrfArg *scanpplArgs[1] = {&scanpplArg0};
static ioccrfFuncDef scanpplFuncDef = {"scanppl",1,scanpplArgs};
static void scanpplCallFunc(ioccrfArg **args)
{ scanppl(*(double *)args[0]->value);}
static const ioccrfArg scanpplArg0 = { "rate",ioccrfArgDouble};
static const ioccrfArg *scanpplArgs[1] = {&scanpplArg0};
static const ioccrfFuncDef scanpplFuncDef = {"scanppl",1,scanpplArgs};
static void scanpplCallFunc(const ioccrfArgBuf *args)
{ scanppl(args[0].dval);}
/* scanpel */
static ioccrfArg scanpelArg0 = { "event_number",ioccrfArgInt,0};
static ioccrfArg *scanpelArgs[1] = {&scanpelArg0};
static ioccrfFuncDef scanpelFuncDef = {"scanpel",1,scanpelArgs};
static void scanpelCallFunc(ioccrfArg **args)
{ scanpel(*(int *)args[0]->value);}
static const ioccrfArg scanpelArg0 = { "event_number",ioccrfArgInt};
static const ioccrfArg *scanpelArgs[1] = {&scanpelArg0};
static const ioccrfFuncDef scanpelFuncDef = {"scanpel",1,scanpelArgs};
static void scanpelCallFunc(const ioccrfArgBuf *args)
{ scanpel(args[0].ival);}
/* scanpiol */
static ioccrfFuncDef scanpiolFuncDef = {"scanpiol",0,0};
static void scanpiolCallFunc(ioccrfArg **args) { scanpiol();}
static const ioccrfFuncDef scanpiolFuncDef = {"scanpiol",0};
static void scanpiolCallFunc(const ioccrfArgBuf *args) { scanpiol();}
void epicsShareAPI dbTestRegister(void)
{

View File

@@ -18,8 +18,8 @@ of this distribution.
#include "envRegister.h"
/* epicsPrtEnvParams */
static ioccrfFuncDef epicsPrtEnvParamsFuncDef = {"epicsPrtEnvParams",0,0};
static void epicsPrtEnvParamsCallFunc(ioccrfArg **args) { epicsPrtEnvParams();}
static const ioccrfFuncDef epicsPrtEnvParamsFuncDef = {"epicsPrtEnvParams",0,0};
static void epicsPrtEnvParamsCallFunc(const ioccrfArgBuf *args) { epicsPrtEnvParams();}
void epicsShareAPI envRegister(void)
{

View File

@@ -16,30 +16,30 @@
#include "iocUtilRegister.h"
/* < (runScript) command */
static ioccrfArg runScriptArg0 = { "file name",ioccrfArgString,0};
static ioccrfArg *runScriptArgs[1] = {&runScriptArg0};
static ioccrfFuncDef runScriptFuncDef = {"<",1,runScriptArgs};
static void runScriptCallFunc(ioccrfArg **args)
static const ioccrfArg runScriptArg0 = { "file name",ioccrfArgString};
static const ioccrfArg *runScriptArgs[1] = {&runScriptArg0};
static const ioccrfFuncDef runScriptFuncDef = {"<",1,runScriptArgs};
static void runScriptCallFunc(const ioccrfArgBuf *args)
{
ioccrf ((char *)args[0]->value);
ioccrf (args[0].sval);
}
/* chdir */
static ioccrfArg chdirArg0 = { "current directory name",ioccrfArgString,0};
static ioccrfArg *chdirArgs[1] = {&chdirArg0};
static ioccrfFuncDef chdirFuncDef = {"cd",1,chdirArgs};
static void chdirCallFunc(ioccrfArg **args)
static const ioccrfArg chdirArg0 = { "current directory name",ioccrfArgString};
static const ioccrfArg *chdirArgs[1] = {&chdirArg0};
static const ioccrfFuncDef chdirFuncDef = {"cd",1,chdirArgs};
static void chdirCallFunc(const ioccrfArgBuf *args)
{
int status;
status = chdir((char *)args[0]->value);
status = chdir(args[0].sval);
if (status) {
printf ("Invalid directory path ignored\n");
}
}
/* print current working directory */
static ioccrfFuncDef pwdFuncDef = { "pwd", 0, 0 };
static void pwdCallFunc (ioccrfArg **args)
static const ioccrfFuncDef pwdFuncDef = { "pwd", 0, 0 };
static void pwdCallFunc (const ioccrfArgBuf *args)
{
char buf[256];
char *pwd = getcwd ( buf, sizeof(buf) - 1 );
@@ -49,22 +49,22 @@ static void pwdCallFunc (ioccrfArg **args)
}
/* show (thread information) */
static ioccrfArg showArg0 = { "task",ioccrfArgString,0};
static ioccrfArg showArg1 = { "task",ioccrfArgString,0};
static ioccrfArg showArg2 = { "task",ioccrfArgString,0};
static ioccrfArg showArg3 = { "task",ioccrfArgString,0};
static ioccrfArg showArg4 = { "task",ioccrfArgString,0};
static ioccrfArg showArg5 = { "task",ioccrfArgString,0};
static ioccrfArg showArg6 = { "task",ioccrfArgString,0};
static ioccrfArg showArg7 = { "task",ioccrfArgString,0};
static ioccrfArg showArg8 = { "task",ioccrfArgString,0};
static ioccrfArg showArg9 = { "task",ioccrfArgString,0};
static ioccrfArg *showArgs[10] = {
static const ioccrfArg showArg0 = { "task",ioccrfArgString};
static const ioccrfArg showArg1 = { "task",ioccrfArgString};
static const ioccrfArg showArg2 = { "task",ioccrfArgString};
static const ioccrfArg showArg3 = { "task",ioccrfArgString};
static const ioccrfArg showArg4 = { "task",ioccrfArgString};
static const ioccrfArg showArg5 = { "task",ioccrfArgString};
static const ioccrfArg showArg6 = { "task",ioccrfArgString};
static const ioccrfArg showArg7 = { "task",ioccrfArgString};
static const ioccrfArg showArg8 = { "task",ioccrfArgString};
static const ioccrfArg showArg9 = { "task",ioccrfArgString};
static const ioccrfArg *showArgs[10] = {
&showArg0,&showArg1,&showArg2,&showArg3,&showArg4,
&showArg5,&showArg6,&showArg7,&showArg8,&showArg9,
};
static ioccrfFuncDef showFuncDef = {"show",10,showArgs};
static void showCallFunc(ioccrfArg **args)
static const ioccrfFuncDef showFuncDef = {"show",10,showArgs};
static void showCallFunc(const ioccrfArgBuf *args)
{
int i = 0;
int first = 1;
@@ -74,17 +74,17 @@ static void showCallFunc(ioccrfArg **args)
unsigned long ltmp;
char *endp;
if (((cp = (char *)args[i]->value) != NULL)
if (((cp = args[i].sval) != NULL)
&& (*cp == '-')) {
level = atoi (cp + 1);
i++;
}
if ((cp = (char *)args[i]->value) == NULL) {
if ((cp = args[i].sval) == NULL) {
threadShowAll (level);
return;
}
for ( ; i < 10 ; i++) {
if ((cp = (char *)args[i]->value) == NULL)
if ((cp = args[i].sval) == NULL)
return;
ltmp = strtoul (cp, &endp, 16);
if (*endp) {
@@ -106,20 +106,21 @@ static void showCallFunc(ioccrfArg **args)
}
/* threadInit */
static ioccrfFuncDef threadInitFuncDef =
{"threadInit",0,0};
static void threadInitCallFunc(ioccrfArg **args)
static const ioccrfFuncDef threadInitFuncDef =
{"threadInit",0};
static void threadInitCallFunc(const ioccrfArgBuf *args)
{
threadInit();
}
/* putenv */
static ioccrfArg putenvArg0 = { "environment_variable=name",ioccrfArgString,0};
static ioccrfArg *putenvArgs[1] = {&putenvArg0};
static ioccrfFuncDef putenvFuncDef = {"putenv",1,putenvArgs};
static void putenvCallFunc(ioccrfArg **args)
static const ioccrfArg putenvArg0 = { "environment_variable=name",ioccrfArgString};
static const ioccrfArg *putenvArgs[1] = {&putenvArg0};
static const ioccrfFuncDef putenvFuncDef = {"putenv",1,putenvArgs};
static void putenvCallFunc(const ioccrfArgBuf *args)
{
const char *cp = (char *)args[0]->value;
const char *cp = args[0].sval;
int putenv(const char *);
if (!cp)
return;
@@ -128,8 +129,8 @@ static void putenvCallFunc(ioccrfArg **args)
}
/* iocLogInit */
static ioccrfFuncDef iocLogInitFuncDef = {"iocLogInit",0,0};
static void iocLogInitCallFunc(ioccrfArg **args)
static const ioccrfFuncDef iocLogInitFuncDef = {"iocLogInit",0};
static void iocLogInitCallFunc(const ioccrfArgBuf *args)
{
iocLogInit ();
}

View File

@@ -1,12 +1,15 @@
/* ioccrf.c */
/* Author: Marty Kraimer Date: 27APR2000 */
/* Heavily modified by Eric Norum Date: 03MAY2000 */
/* Adapted to C++ by Eric Norum Date: 18DEC2000 */
/********************COPYRIGHT NOTIFICATION**********************************
This software was developed under a United States Government license
described on the COPYRIGHT_UniversityOfChicago file included as part
of this distribution.
****************************************************************************/
#include <map>
#include <stddef.h>
#include <string.h>
#include <stdlib.h>
@@ -14,77 +17,51 @@ of this distribution.
#include <ctype.h>
#include <errno.h>
#include "cantProceed.h"
#include "registry.h"
#include "errlog.h"
#include "dbAccess.h"
#define epicsExportSharedSymbols
#include "ioccrf.h"
#include "epicsReadline.h"
typedef struct argvalue {
struct argvalue *next;
union type {
int ival;
double dval;
} type;
} argvalue;
typedef struct ioccrfFunc {
ioccrfFuncDef *pioccrfFuncDef;
struct IoccrfFunc {
ioccrfFuncDef const *pFuncDef;
ioccrfCallFunc func;
struct ioccrfFunc *pprev;
} ioccrfFunc;
static ioccrfFunc *pioccrfFuncHead = 0;
static char ioccrfID[] = "ioccrf";
#ifdef IOCSH_USE_READLINE
#include <readline/readline.h>
#include <readline/history.h>
#else
IoccrfFunc() { pFuncDef=NULL; func=NULL; }
IoccrfFunc(const ioccrfFuncDef *d, ioccrfCallFunc f) { pFuncDef=d; func=f; }
IoccrfFunc& operator=(const IoccrfFunc& rhs) { pFuncDef=rhs.pFuncDef;
func=rhs.func;
return *this; }
~IoccrfFunc() { }
};
/*
* Fake versions of some readline/history routines
* We don't want the overhead of C++ strings, so use C strings
*/
#define stifle_history(n) do { } while(0)
#define add_history(l) do { } while(0)
#define rl_bind_key(c,f) do { } while(0)
struct Cstring_cmp {
bool operator()(const char *p, const char *q) const {return strcmp(p,q)<0;}
};
#endif
/*
* The table of commands
*/
static map<const char *,IoccrfFunc,Cstring_cmp> commands;
/*
* Register a command
*/
void epicsShareAPI ioccrfRegister (ioccrfFuncDef *pioccrfFuncDef, ioccrfCallFunc func)
void epicsShareAPI ioccrfRegister (const ioccrfFuncDef *pioccrfFuncDef, ioccrfCallFunc func)
{
ioccrfFunc *pioccrfFunc;
pioccrfFunc = callocMustSucceed (1, sizeof(ioccrfFunc), "ioccrfRegister");
pioccrfFunc->pprev = pioccrfFuncHead;
/* keep list of allocated ioccrfFunc so they can be freed*/
pioccrfFuncHead = pioccrfFunc;
pioccrfFunc->pioccrfFuncDef = pioccrfFuncDef;
pioccrfFunc->func = func;
if (!registryAdd(ioccrfID, pioccrfFuncDef->name, (void *)pioccrfFunc))
errlogPrintf ("ioccrfRegister failed to add %s\n", pioccrfFuncDef->name);
commands[pioccrfFuncDef->name] = IoccrfFunc(pioccrfFuncDef, func);
}
/* free storage created by ioccrfRegister */
/*
* Free storage created by ioccrfRegister
*/
void epicsShareAPI ioccrfFree(void)
{
ioccrfFunc *pioccrfFunc = pioccrfFuncHead;
pioccrfFuncHead = 0;
while(pioccrfFunc) {
ioccrfFunc *pprev = pioccrfFunc->pprev;
free(pioccrfFunc);
pioccrfFunc = pprev;
}
commands.clear();
}
/*
* Read a line of input
*/
@@ -96,17 +73,19 @@ my_readline (FILE *fp, const char *prompt)
int linelen = 0;
int linesize = 50;
if (fp == NULL)
#ifdef IOCSH_USE_READLINE
if (fp == stdin)
return readline (prompt);
return epics_readline (prompt);
#else
fp = stdin;
#endif
line = malloc (linesize * sizeof *line);
line = (char *)malloc (linesize * sizeof *line);
if (line == NULL) {
printf ("Out of memory!\n");
return NULL;
}
if (prompt)
printf ("%s", prompt);
fputs (prompt, stdout);
while ((c = getc (fp)) != '\n') {
if (c == EOF) {
free (line);
@@ -116,7 +95,7 @@ my_readline (FILE *fp, const char *prompt)
char *cp;
linesize += 50;
cp = realloc (line, linesize * sizeof *line);
cp = (char *)realloc (line, linesize * sizeof *line);
if (cp == NULL) {
printf ("Out of memory!\n");
free (line);
@@ -142,52 +121,50 @@ showError (const char *filename, int lineno, const char *msg, ...)
if (filename)
fprintf (stderr, "%s -- Line %d -- ", filename, lineno);
vfprintf (stderr, msg, ap);
fprintf (stderr, "\n");
fputc ('\n', stderr);
va_end (ap);
}
static int
cvtArg (const char *filename, int lineno, char *arg, argvalue *pargvalue, ioccrfArg *pioccrfArg)
cvtArg (const char *filename, int lineno, char *arg, ioccrfArgBuf *argBuf, const ioccrfArg *pioccrfArg)
{
char *endp;
switch (pioccrfArg->type) {
case ioccrfArgInt:
if (arg && *arg) {
pargvalue->type.ival = strtol (arg, &endp, 0);
argBuf->ival = strtol (arg, &endp, 0);
if (*endp) {
showError (filename, lineno, "Illegal integer `%s'", arg);
return 0;
}
}
else {
pargvalue->type.ival = 0;
argBuf->ival = 0;
}
pioccrfArg->value = &pargvalue->type.ival;
break;
case ioccrfArgDouble:
if (arg && *arg) {
pargvalue->type.dval = strtod (arg, &endp);
argBuf->dval = strtod (arg, &endp);
if (*endp) {
showError (filename, lineno, "Illegal double `%s'", arg);
return 0;
}
}
else {
pargvalue->type.dval = 0.0;
argBuf->dval = 0.0;
}
pioccrfArg->value = &pargvalue->type.dval;
break;
case ioccrfArgString:
pioccrfArg->value = arg;
argBuf->sval = arg;
break;
case ioccrfArgPdbbase:
/* Argumenmt must be missing or 0 or pdbbase */
/* Argument must be missing or 0 or pdbbase */
if(!arg || !*arg || (*arg == '0') || (strcmp(arg, "pdbbase") == 0)) {
pioccrfArg->value = pdbbase;
argBuf->vval = pdbbase;
break;
}
showError (filename, lineno, "Expecting `pdbbase' got `%s'", arg);
@@ -206,7 +183,7 @@ cvtArg (const char *filename, int lineno, char *arg, argvalue *pargvalue, ioccrf
int epicsShareAPI
ioccrf (const char *pathname)
{
FILE *fp;
FILE *fp = NULL;
const char *filename = NULL;
int icin, icout;
int c, quote, inword, backslash;
@@ -214,32 +191,35 @@ ioccrf (const char *pathname)
int lineno = 0;
int argc;
char **argv = NULL;
int argvsize = 0;
int argvCapacity = 0;
int sep;
const char *prompt;
const char *ifs = " \t(),";
ioccrfFunc *pioccrfFunc;
ioccrfFuncDef *pioccrfFuncDef;
int arg;
argvalue *pargvalue, *prevargvalue, *argvalueHead = NULL;
ioccrfArg *pioccrfArg;
ioccrfArgBuf *argBuf = NULL;
int argBufCapacity = 0;
ioccrfFuncDef const *pioccrfFuncDef;
map<const char *,IoccrfFunc>::iterator cmdIter;
/*
* See if command interpreter is interactive
*/
if (pathname == NULL) {
if ((pathname == NULL) || (strcmp (pathname, "<telnet>") == 0)) {
const char *historySize;
fp = stdin;
if ((prompt = getenv ("IOCSH_PS1")) == NULL)
prompt = "iocsh> ";
if (((historySize = getenv ("IOCSH_HISTSIZE")) == NULL)
&& ((historySize = getenv ("HISTSIZE")) == NULL))
historySize = "10";
stifle_history (atoi (historySize));
/*
* FIXME: Could enable tab-completion of commands here
*/
rl_bind_key ('\t', rl_insert);
if (pathname == NULL) {
epics_stifle_history (atoi (historySize));
/*
* FIXME: Could enable tab-completion of commands here
*/
epics_bind_keys();
}
else {
fp = stdin;
}
}
else {
fp = fopen (pathname, "r");
@@ -268,10 +248,10 @@ ioccrf (const char *pathname)
break;
/*
* If interactive, add non-blank lines to history
* If using readline, add non-blank lines to history
*/
if ((fp == stdin) && *line)
add_history (line);
if ((fp == NULL) && *line)
epics_add_history (line);
/*
* Ignore comment lines
@@ -288,10 +268,10 @@ ioccrf (const char *pathname)
backslash = 0;
argc = 0;
for (;;) {
if (argc >= argvsize) {
if (argc >= argvCapacity) {
char **av;
argvsize += 50;
av = realloc (argv, argvsize * sizeof *argv);
argvCapacity += 50;
av = (char **)realloc (argv, argvCapacity * sizeof *argv);
if (av == NULL) {
printf ("Out of memory!\n");
argc = -1;
@@ -367,58 +347,105 @@ ioccrf (const char *pathname)
*/
if (strncmp (argv[0], "exit", 4) == 0)
break;
if ((strcmp (argv[0], "?") == 0)
|| (strncmp (argv[0], "help", 4) == 0)) {
if (argc == 1) {
int l, col = 0;
/*
* Look up command
*/
pioccrfFunc = 0;
if(pioccrfFuncHead)
pioccrfFunc = (ioccrfFunc *)registryFind (ioccrfID, argv[0]);
if (!pioccrfFunc) {
showError (filename, lineno, "Command %s not found.", argv[0]);
printf ("Type `help command_name' to get more information about a particular command.\n");
for (cmdIter = commands.begin() ; cmdIter != commands.end() ; cmdIter++) {
pioccrfFuncDef = cmdIter->second.pFuncDef;
l = strlen (pioccrfFuncDef->name);
if ((l + col) >= 79) {
putchar ('\n');
col = 0;
}
fputs (pioccrfFuncDef->name, stdout);
col += l;
if (col >= 64) {
putchar ('\n');
col = 0;
}
else {
do {
putchar (' ');
col++;
} while ((col % 16) != 0);
}
}
if (col)
putchar ('\n');
}
else {
for (int i = 1 ; i < argc ; i++) {
cmdIter = commands.find(argv[i]);
if (cmdIter == commands.end()) {
printf ("%s -- no such command.\n", argv[i]);
}
else {
pioccrfFuncDef = cmdIter->second.pFuncDef;
fputs (pioccrfFuncDef->name, stdout);
for (int a = 0 ; a < pioccrfFuncDef->nargs ; a++) {
const char *cp = pioccrfFuncDef->arg[a]->name;
putchar (' ');
while (*cp != '\0') {
if (isspace (*cp))
putchar ('_');
else
putchar (*cp);
cp++;
}
}
putchar ('\n');
}
}
}
continue;
}
/*
* Process arguments
* Look up command
*/
pioccrfFuncDef = pioccrfFunc->pioccrfFuncDef;
pargvalue = argvalueHead;
prevargvalue = NULL;
for (arg = 0 ; ; arg++) {
cmdIter = commands.find(argv[0]);
if (cmdIter == commands.end()) {
showError (filename, lineno, "Command %s not found.", argv[0]);
continue;
}
pioccrfFuncDef = cmdIter->second.pFuncDef;
/*
* Process arguments
* Must make local copy of pioccrfFuncDef->arg[arg] to
* ensure that this routine is thread-safe.
*/
for (int arg = 0 ; ; arg++) {
char *p = (arg < argc) ? argv[arg+1] : NULL;
if (arg == pioccrfFuncDef->nargs) {
(*pioccrfFunc->func)(pioccrfFuncDef->arg);
(*cmdIter->second.func)(argBuf);
break;
}
pioccrfArg = pioccrfFuncDef->arg[arg];
if (!pargvalue) {
pargvalue = callocMustSucceed(1, sizeof(argvalue), "ioccrf");
if ( prevargvalue ) {
prevargvalue->next = pargvalue;
}
else {
argvalueHead = pargvalue;
if (arg >= argBufCapacity) {
void *np;
argBufCapacity += 20;
np = realloc (argBuf, argBufCapacity * sizeof *argBuf);
if (np == NULL) {
fprintf (stderr, "Out of memory!\n");
argBufCapacity -= 20;
continue;
}
argBuf = (ioccrfArgBuf *)np;
}
if (!cvtArg (filename, lineno, p, pargvalue, pioccrfArg))
if (!cvtArg (filename, lineno, p, &argBuf[arg], pioccrfFuncDef->arg[arg]))
break;
prevargvalue = pargvalue;
pargvalue = prevargvalue->next;
}
}
}
if (fp != stdin)
if (fp && (fp != stdin))
fclose (fp);
free (line);
free (argv);
while (argvalueHead) {
pargvalue = argvalueHead->next;
free (argvalueHead);
argvalueHead = pargvalue;
}
free (argBuf);
return 0;
}
/* Readline automatic completion code could go here! */

View File

@@ -11,8 +11,8 @@ of this distribution.
#define INCioccrfH
#include <stdio.h>
#include "shareLib.h"
#ifdef __cplusplus
extern "C" {
#endif
@@ -24,22 +24,28 @@ typedef enum {
ioccrfArgPdbbase
}ioccrfArgType;
typedef union ioccrfArgBuf {
int ival;
double dval;
char *sval;
void *vval;
}ioccrfArgBuf;
typedef struct ioccrfArg {
const char *name;
ioccrfArgType type;
void *value; /* points to value of type typ */
}ioccrfArg;
typedef struct ioccrfFuncDef {
const char *name;
int nargs;
ioccrfArg **arg;
const ioccrfArg * const *arg;
}ioccrfFuncDef;
typedef void (*ioccrfCallFunc)(ioccrfArg **argList);
typedef void (*ioccrfCallFunc)(const ioccrfArgBuf *argBuf);
epicsShareFunc void epicsShareAPI ioccrfRegister(
ioccrfFuncDef *pioccrfFuncDef,ioccrfCallFunc func);
const ioccrfFuncDef *pioccrfFuncDef, ioccrfCallFunc func);
/* ioccrfFree frees storage used by ioccrfRegister*/
/* This should only be called when ioccrf is no longer needed*/

View File

@@ -19,23 +19,23 @@ of this distribution.
#include "osiRegister.h"
/* threadShowAll */
static ioccrfArg threadShowAllArg0 = { "level",ioccrfArgInt,0};
static ioccrfArg *threadShowAllArgs[1] = {&threadShowAllArg0};
static ioccrfFuncDef threadShowAllFuncDef =
static const ioccrfArg threadShowAllArg0 = { "level",ioccrfArgInt};
static const ioccrfArg *threadShowAllArgs[1] = {&threadShowAllArg0};
static const ioccrfFuncDef threadShowAllFuncDef =
{"threadShowAll",1,threadShowAllArgs};
static void threadShowAllCallFunc(ioccrfArg **args)
static void threadShowAllCallFunc(const ioccrfArgBuf *args)
{
threadShowAll(*(int *)args[0]->value);
threadShowAll(args[0].ival);
}
/* threadSleep */
static ioccrfArg threadSleepArg0 = { "seconds",ioccrfArgDouble,0};
static ioccrfArg *threadSleepArgs[1] = {&threadSleepArg0};
static ioccrfFuncDef threadSleepFuncDef =
static const ioccrfArg threadSleepArg0 = { "seconds",ioccrfArgDouble};
static const ioccrfArg *threadSleepArgs[1] = {&threadSleepArg0};
static const ioccrfFuncDef threadSleepFuncDef =
{"threadSleep",1,threadSleepArgs};
static void threadSleepCallFunc(ioccrfArg **args)
static void threadSleepCallFunc(const ioccrfArgBuf *args)
{
threadSleep(*(double *)args[0]->value);
threadSleep(args[0].dval);
}
void epicsShareAPI osiRegister(void)

View File

@@ -17,13 +17,13 @@ of this distribution.
#include "registerRecordDeviceDriverRegister.h"
/* registerRecordDeviceDriver */
static ioccrfArg registerRecordDeviceDriverArg0 =
{ "pdbbase",ioccrfArgPdbbase,0};
static ioccrfArg *registerRecordDeviceDriverArgs[1] =
static const ioccrfArg registerRecordDeviceDriverArg0 =
{ "pdbbase",ioccrfArgPdbbase};
static const ioccrfArg *registerRecordDeviceDriverArgs[1] =
{&registerRecordDeviceDriverArg0};
static ioccrfFuncDef registerRecordDeviceDriverFuncDef =
static const ioccrfFuncDef registerRecordDeviceDriverFuncDef =
{"registerRecordDeviceDriver",1,registerRecordDeviceDriverArgs};
static void registerRecordDeviceDriverCallFunc(ioccrfArg **args)
static void registerRecordDeviceDriverCallFunc(const ioccrfArgBuf *args)
{
registerRecordDeviceDriver(pdbbase);
}

View File

@@ -196,22 +196,22 @@ rtems_semstat (int level)
printf ("%d of %d semaphores used.\n", n, _Semaphore_Information.maximum);
}
static ioccrfArg netStatArg0 = { "level",ioccrfArgInt,0};
static ioccrfArg *netStatArgs[1] = {&netStatArg0};
static ioccrfFuncDef netStatFuncDef = {"netstat",1,netStatArgs};
static void netStatCallFunc(ioccrfArg **args)
static const ioccrfArg netStatArg0 = { "level",ioccrfArgInt};
static const ioccrfArg *netStatArgs[1] = {&netStatArg0};
static const ioccrfFuncDef netStatFuncDef = {"netstat",1,netStatArgs};
static void netStatCallFunc(const ioccrfArgBuf *args)
{
rtems_netstat(*(int *)args[0]->value);
rtems_netstat(args[0].ival);
}
static ioccrfArg semStatArg0 = { "level",ioccrfArgInt,0};
static ioccrfArg *semStatArgs[1] = {&semStatArg0};
static ioccrfFuncDef semStatFuncDef = {"semstat",1,semStatArgs};
static void semStatCallFunc(ioccrfArg **args)
static const ioccrfArg semStatArg0 = { "level",ioccrfArgInt};
static const ioccrfArg *semStatArgs[1] = {&semStatArg0};
static const ioccrfFuncDef semStatFuncDef = {"semstat",1,semStatArgs};
static void semStatCallFunc(const ioccrfArgBuf *args)
{
rtems_semstat(*(int *)args[0]->value);
rtems_semstat(args[0].ival);
}
static ioccrfFuncDef stackCheckFuncDef = {"stackCheck",0,NULL};
static void stackCheckCallFunc(ioccrfArg **args)
static const ioccrfFuncDef stackCheckFuncDef = {"stackCheck",0,NULL};
static void stackCheckCallFunc(const ioccrfArgBuf *args)
{
Stack_check_Dump_usage ();
}

View File

@@ -46,7 +46,7 @@ static char *ip_alias[] = { "IP", NULL };
static char *icmp_alias[] = { "ICMP", NULL };
static char *tcp_alias[] = { "TCP", NULL };
static char *udp_alias[] = { "UDP", NULL };
static const struct protoent prototab[] = {
static struct protoent prototab[] = {
{ "IP", ip_alias, IPPROTO_IP },
{ "ICMP", icmp_alias, IPPROTO_ICMP },
{ "TCP", tcp_alias, IPPROTO_TCP },