Skip to content

Commit

Permalink
Merge branch '3.15' into 7.0
Browse files Browse the repository at this point in the history
* 3.15: (28 commits)
  update RELEASE_NOTES
  add option EPICS_NO_CALLBACK
  replace CALLBACK -> epicsCallback
  Update dbTest.c
  Remove links to wiki-ext
  Add POD annotations from Wiki to subArrayRecord and menuAlarmStat
  Rename subArrayRecord.dbd and menuAlarmStat.dbd to .pod
  Add POD annotations to longoutRecord from Wiki
  Rename longoutRecord.dbd longoutRecord.dbd.pod
  Add POD annotations to longinRecord from Wiki
  Rename longinRecord.dbd longinRecord.dbd.pod
  Add POD annotations to subRecord from Wiki
  Rename subRecord.dbd subRecord.dbd.pod
  Add POD annotations to selRecord from Wiki
  Rename selRecord.dbd selRecord.dbd.pod
  Add POD annotations to seqRecord from Wiki
  Rename seqRecord.dbd seqRecord.dbd.pod
  Fix menu declaration test too
  Add redefinition guard to menu-generated typedefs
  Updates to existing .dbd.pod texts, add event and fanout from wiki
  ...

# Conflicts:
#	documentation/README.1st
#	documentation/README.html
#	modules/database/src/ioc/db/callback.h
#	modules/database/src/ioc/db/dbNotify.c
#	modules/database/src/ioc/db/menuAlarmStat.dbd
#	modules/database/src/ioc/db/menuFtype.dbd
#	modules/database/src/std/rec/compressRecord.dbd.pod
#	modules/database/src/std/rec/eventRecord.dbd
#	modules/database/src/std/rec/fanoutRecord.dbd
#	modules/database/src/std/rec/longinRecord.dbd
#	modules/database/src/std/rec/longoutRecord.dbd
#	modules/database/src/std/rec/selRecord.dbd
#	modules/database/src/std/rec/seqRecord.dbd
#	modules/database/src/std/rec/subArrayRecord.dbd
#	modules/database/src/std/rec/subRecord.dbd
#	modules/libcom/src/iocsh/menuAlarmStat.dbd.pod
#	modules/libcom/src/iocsh/menuFtype.dbd.pod
#	src/ioc/db/menuAlarmStat.dbd
#	src/ioc/db/menuFtype.dbd

Manually fix some move+rename
Make additional CALLBACK -> epicsCallback
preserve INT64 in menuFtype
preserve OLDSIM et al
  • Loading branch information
mdavidsaver committed Sep 10, 2019
2 parents 299aed0 + 7757402 commit 0f8876d
Show file tree
Hide file tree
Showing 88 changed files with 5,810 additions and 2,700 deletions.
344 changes: 0 additions & 344 deletions documentation/README.1st

This file was deleted.

382 changes: 0 additions & 382 deletions documentation/README.html

This file was deleted.

375 changes: 375 additions & 0 deletions documentation/README.md

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions documentation/RELEASE_NOTES.html
Expand Up @@ -1164,6 +1164,18 @@ <h2 align="center">Changes from the 3.15 branch since 3.15.6</h2>

<!-- Insert inherited items immediately below here ... -->

<h3>Add option to avoid CALLBACK conflict</h3>

<p>If a macro EPICS_NO_CALLBACK is defined, then callback.h will no longer (re)define CALLBACK.
The name 'CALLBACK' is used by the WIN32 API, and redefinition in callback.h cause errors
if some windows headers are later included.
</p>

<p>Code which defines EPICS_NO_CALLBACK, but still wishes to use callbacks, should use
the alternate name 'epicsCallback' introduced in 3.15.6, 3.16.2, and 7.0.2.
It is also possible, though not encouraged, to use 'struct callbackPvt'
which has been present since the callback API was introduced.</p>

<h3>Cleaning up with Multiple CA contexts in a Process</h3>

<p>Bruno Martins reported a problem with the CA client library at shutdown in a
Expand Down
2 changes: 1 addition & 1 deletion modules/database/src/ioc/as/asDbLib.h
Expand Up @@ -16,7 +16,7 @@
#include "shareLib.h"

typedef struct {
CALLBACK callback;
epicsCallback callback;
long status;
} ASDBCALLBACK;

Expand Down
18 changes: 9 additions & 9 deletions modules/database/src/ioc/db/callback.c
Expand Up @@ -216,7 +216,7 @@ static void callbackTask(void *arg)
epicsEventMustWait(mySet->semWakeUp);

while ((ptr = epicsRingPointerPop(mySet->queue))) {
CALLBACK *pcallback = (CALLBACK *)ptr;
epicsCallback *pcallback = (epicsCallback *)ptr;
if(!epicsRingPointerIsEmpty(mySet->queue))
epicsEventMustTrigger(mySet->semWakeUp);
mySet->queueOverflow = FALSE;
Expand Down Expand Up @@ -317,7 +317,7 @@ void callbackInit(void)
}

/* This routine can be called from interrupt context */
int callbackRequest(CALLBACK *pcallback)
int callbackRequest(epicsCallback *pcallback)
{
int priority;
int pushOK;
Expand Down Expand Up @@ -347,7 +347,7 @@ int callbackRequest(CALLBACK *pcallback)
return 0;
}

static void ProcessCallback(CALLBACK *pcallback)
static void ProcessCallback(epicsCallback *pcallback)
{
dbCommon *pRec;

Expand All @@ -358,14 +358,14 @@ static void ProcessCallback(CALLBACK *pcallback)
dbScanUnlock(pRec);
}

void callbackSetProcess(CALLBACK *pcallback, int Priority, void *pRec)
void callbackSetProcess(epicsCallback *pcallback, int Priority, void *pRec)
{
callbackSetCallback(ProcessCallback, pcallback);
callbackSetPriority(Priority, pcallback);
callbackSetUser(pRec, pcallback);
}

int callbackRequestProcessCallback(CALLBACK *pcallback,
int callbackRequestProcessCallback(epicsCallback *pcallback,
int Priority, void *pRec)
{
callbackSetProcess(pcallback, Priority, pRec);
Expand All @@ -374,11 +374,11 @@ int callbackRequestProcessCallback(CALLBACK *pcallback,

static void notify(void *pPrivate)
{
CALLBACK *pcallback = (CALLBACK *)pPrivate;
epicsCallback *pcallback = (epicsCallback *)pPrivate;
callbackRequest(pcallback);
}

void callbackRequestDelayed(CALLBACK *pcallback, double seconds)
void callbackRequestDelayed(epicsCallback *pcallback, double seconds)
{
epicsTimerId timer = (epicsTimerId)pcallback->timer;

Expand All @@ -389,7 +389,7 @@ void callbackRequestDelayed(CALLBACK *pcallback, double seconds)
epicsTimerStartDelay(timer, seconds);
}

void callbackCancelDelayed(CALLBACK *pcallback)
void callbackCancelDelayed(epicsCallback *pcallback)
{
epicsTimerId timer = (epicsTimerId)pcallback->timer;

Expand All @@ -398,7 +398,7 @@ void callbackCancelDelayed(CALLBACK *pcallback)
}
}

void callbackRequestProcessCallbackDelayed(CALLBACK *pcallback,
void callbackRequestProcessCallbackDelayed(epicsCallback *pcallback,
int Priority, void *pRec, double seconds)
{
callbackSetProcess(pcallback, Priority, pRec);
Expand Down
16 changes: 9 additions & 7 deletions modules/database/src/ioc/db/callback.h
Expand Up @@ -26,7 +26,7 @@ extern "C" {
/*
* WINDOWS also has a "CALLBACK" type def
*/
#ifdef _WIN32
#if defined(_WIN32) && !defined(EPICS_NO_CALLBACK)
# ifdef CALLBACK
# undef CALLBACK
# endif /*CALLBACK*/
Expand All @@ -44,7 +44,9 @@ typedef struct callbackPvt {
void *timer; /*for use by callback itself*/
}epicsCallback;

#if !defined(EPICS_NO_CALLBACK)
typedef epicsCallback CALLBACK;
#endif

typedef void (*CALLBACKFUNC)(struct callbackPvt*);

Expand All @@ -69,16 +71,16 @@ typedef struct callbackQueueStats {
epicsShareFunc void callbackInit(void);
epicsShareFunc void callbackStop(void);
epicsShareFunc void callbackCleanup(void);
epicsShareFunc int callbackRequest(CALLBACK *pCallback);
epicsShareFunc int callbackRequest(epicsCallback *pCallback);
epicsShareFunc void callbackSetProcess(
CALLBACK *pcallback, int Priority, void *pRec);
epicsCallback *pcallback, int Priority, void *pRec);
epicsShareFunc int callbackRequestProcessCallback(
CALLBACK *pCallback,int Priority, void *pRec);
epicsCallback *pCallback,int Priority, void *pRec);
epicsShareFunc void callbackRequestDelayed(
CALLBACK *pCallback,double seconds);
epicsShareFunc void callbackCancelDelayed(CALLBACK *pcallback);
epicsCallback *pCallback,double seconds);
epicsShareFunc void callbackCancelDelayed(epicsCallback *pcallback);
epicsShareFunc void callbackRequestProcessCallbackDelayed(
CALLBACK *pCallback, int Priority, void *pRec, double seconds);
epicsCallback *pCallback, int Priority, void *pRec, double seconds);
epicsShareFunc int callbackSetQueueSize(int size);
epicsShareFunc int callbackQueueStatus(const int reset, callbackQueueStats *result);
epicsShareFunc void callbackQueueShow(const int reset);
Expand Down
6 changes: 3 additions & 3 deletions modules/database/src/ioc/db/dbNotify.c
Expand Up @@ -69,7 +69,7 @@ typedef struct notifyPvt {
ELLNODE node; /*For free list*/
long magic;
short state;
CALLBACK callback;
epicsCallback callback;
ELLLIST waitList; /*list of records for current processNotify*/
short cancelWait;
short userCallbackWait;
Expand All @@ -86,7 +86,7 @@ typedef struct notifyGlobal {

static notifyGlobal *pnotifyGlobal = 0;

static void notifyCallback(CALLBACK *pcallback);
static void notifyCallback(epicsCallback *pcallback);

#define ellSafeAdd(list,listnode) \
{ \
Expand Down Expand Up @@ -270,7 +270,7 @@ static void processNotifyCommon(processNotify *ppn, dbCommon *precord, int first
callDone(precord, ppn);
}

static void notifyCallback(CALLBACK *pcallback)
static void notifyCallback(epicsCallback *pcallback)
{
processNotify *ppn = NULL;
dbCommon *precord;
Expand Down
12 changes: 6 additions & 6 deletions modules/database/src/ioc/db/dbScan.c
Expand Up @@ -109,7 +109,7 @@ static char *priorityName[NUM_CALLBACK_PRIORITIES] = {
/* EVENT */

typedef struct event_list {
CALLBACK callback[NUM_CALLBACK_PRIORITIES];
epicsCallback callback[NUM_CALLBACK_PRIORITIES];
scan_list scan_list[NUM_CALLBACK_PRIORITIES];
struct event_list *next;
char eventname[1]; /* actually arbitrary size */
Expand All @@ -120,7 +120,7 @@ static epicsMutexId event_lock;
/* IO_EVENT*/

typedef struct io_scan_list {
CALLBACK callback;
epicsCallback callback;
scan_list scan_list;
} io_scan_list;

Expand All @@ -141,9 +141,9 @@ static void periodicTask(void *arg);
static void initPeriodic(void);
static void deletePeriodic(void);
static void spawnPeriodic(int ind);
static void eventCallback(CALLBACK *pcallback);
static void eventCallback(epicsCallback *pcallback);
static void ioscanInit(void);
static void ioscanCallback(CALLBACK *pcallback);
static void ioscanCallback(epicsCallback *pcallback);
static void ioscanDestroy(void);
static void printList(scan_list *psl, char *message);
static void scanList(scan_list *psl);
Expand Down Expand Up @@ -448,7 +448,7 @@ int scanpiol(void) /* print pioscan_list */
return 0;
}

static void eventCallback(CALLBACK *pcallback)
static void eventCallback(epicsCallback *pcallback)
{
scan_list *psl;

Expand Down Expand Up @@ -944,7 +944,7 @@ static void spawnPeriodic(int ind)
epicsEventWait(startStopEvent);
}

static void ioscanCallback(CALLBACK *pcallback)
static void ioscanCallback(epicsCallback *pcallback)
{
ioscan_head *piosh;
int prio;
Expand Down
2 changes: 1 addition & 1 deletion modules/database/src/ioc/db/dbTest.c
Expand Up @@ -56,7 +56,7 @@ typedef struct msgBuff TAB_BUFFER;
# define MIN(x,y) (((x) < (y)) ? (x) : (y))
#endif
#ifndef MAX
# define MAX(x,y) (((x) < (y)) ? (x) : (y))
# define MAX(x,y) (((x) > (y)) ? (x) : (y))
#endif

/* Local Routines */
Expand Down
Expand Up @@ -7,6 +7,17 @@
# and higher are distributed subject to a Software License Agreement found
# in file LICENSE that is included with this distribution.
#*************************************************************************

=head1 Menu menuAlarmStat

This menu defines the possible alarm statuses that EPICS records can exhibit
which is used for C<STAT> and C<NSTA> fields of all record types.
See L<Alarm Status> for more information.

=menu menuAlarmStat

=cut

menu(menuAlarmStat) {
choice(menuAlarmStatNO_ALARM,"NO_ALARM")
choice(menuAlarmStatREAD,"READ")
Expand Down
Expand Up @@ -6,6 +6,15 @@
# EPICS BASE is distributed subject to a Software License Agreement found
# in file LICENSE that is included with this distribution.
#*************************************************************************

=head1 Menu menuFtype

This menu is used for the C<FTVL> and similar fields of many record types.

=menu menuFtype

=cut

menu(menuFtype) {
choice(menuFtypeSTRING,"STRING")
choice(menuFtypeCHAR,"CHAR")
Expand Down
2 changes: 1 addition & 1 deletion modules/database/src/std/dev/asSubRecordFunctions.c
Expand Up @@ -34,7 +34,7 @@
/* The following is provided for access security*/
/*It allows a CA client to force access security initialization*/

static void myCallback(CALLBACK *pcallback)
static void myCallback(epicsCallback *pcallback)
{
ASDBCALLBACK *pasdbcallback = (ASDBCALLBACK *)pcallback;
subRecord *precord;
Expand Down
2 changes: 1 addition & 1 deletion modules/database/src/std/dev/devAiSoftCallback.c
Expand Up @@ -36,7 +36,7 @@

typedef struct devPvt {
processNotify pn;
CALLBACK callback;
epicsCallback callback;
long options;
int status;
int smooth;
Expand Down
2 changes: 1 addition & 1 deletion modules/database/src/std/dev/devBiSoftCallback.c
Expand Up @@ -35,7 +35,7 @@

typedef struct devPvt {
processNotify pn;
CALLBACK callback;
epicsCallback callback;
long options;
int status;
struct {
Expand Down
2 changes: 1 addition & 1 deletion modules/database/src/std/dev/devLiSoftCallback.c
Expand Up @@ -35,7 +35,7 @@

typedef struct devPvt {
processNotify pn;
CALLBACK callback;
epicsCallback callback;
long options;
int status;
struct {
Expand Down
2 changes: 1 addition & 1 deletion modules/database/src/std/dev/devMbbiDirectSoftCallback.c
Expand Up @@ -35,7 +35,7 @@

typedef struct devPvt {
processNotify pn;
CALLBACK callback;
epicsCallback callback;
long options;
int status;
struct {
Expand Down
2 changes: 1 addition & 1 deletion modules/database/src/std/dev/devMbbiSoftCallback.c
Expand Up @@ -35,7 +35,7 @@

typedef struct devPvt {
processNotify pn;
CALLBACK callback;
epicsCallback callback;
long options;
int status;
struct {
Expand Down
2 changes: 1 addition & 1 deletion modules/database/src/std/dev/devSiSoftCallback.c
Expand Up @@ -37,7 +37,7 @@
typedef struct devPvt {
DBADDR dbaddr;
processNotify pn;
CALLBACK callback;
epicsCallback callback;
long options;
int status;
struct {
Expand Down
4 changes: 4 additions & 0 deletions modules/database/src/std/rec/Makefile
Expand Up @@ -55,3 +55,7 @@ stdRecords_DBD = $(patsubst %,%.dbd,$(stdRecords))
dbRecStd_SRCS += $(patsubst %,%.c,$(stdRecords))

HTMLS += $(patsubst %.dbd.pod,%.html,$(notdir $(wildcard ../rec/*Record.dbd.pod)))

vpath %.png $(SRC_DIRS)
HTMLS += image/compress-1.png
HTMLS += image/compress-2.png
4 changes: 2 additions & 2 deletions modules/database/src/std/rec/aaiRecord.c
Expand Up @@ -356,10 +356,10 @@ static long readValue(aaiRecord *prec)
recGblSetSevr(prec, SIMM_ALARM, prec->sims);

if (prec->sdly >= 0) {
CALLBACK *pvt = prec->simpvt;
epicsCallback *pvt = prec->simpvt;

if (!pvt) { /* very lazy allocation of callback structure */
pvt = calloc(1, sizeof(CALLBACK));
pvt = calloc(1, sizeof(epicsCallback));
prec->simpvt = pvt;
}
if (pvt)
Expand Down
2 changes: 1 addition & 1 deletion modules/database/src/std/rec/aaiRecord.dbd
Expand Up @@ -122,7 +122,7 @@ recordtype(aai) {
prompt("Sim. Mode Private")
special(SPC_NOMOD)
interest(4)
extra("CALLBACK *simpvt")
extra("epicsCallback *simpvt")
}
field(MPST,DBF_MENU) {
prompt("Post Value Monitors")
Expand Down
4 changes: 2 additions & 2 deletions modules/database/src/std/rec/aaoRecord.c
Expand Up @@ -367,9 +367,9 @@ static long writeValue(aaoRecord *prec)
status = pdset->write_aao(prec);
prec->pact = FALSE;
} else { /* !prec->pact && delay >= 0. */
CALLBACK *pvt = prec->simpvt;
epicsCallback *pvt = prec->simpvt;
if (!pvt) {
pvt = calloc(1, sizeof(CALLBACK)); /* very lazy allocation of callback structure */
pvt = calloc(1, sizeof(epicsCallback)); /* very lazy allocation of callback structure */
prec->simpvt = pvt;
}
if (pvt) callbackRequestProcessCallbackDelayed(pvt, prec->prio, prec, prec->sdly);
Expand Down
2 changes: 1 addition & 1 deletion modules/database/src/std/rec/aaoRecord.dbd
Expand Up @@ -122,7 +122,7 @@ recordtype(aao) {
prompt("Sim. Mode Private")
special(SPC_NOMOD)
interest(4)
extra("CALLBACK *simpvt")
extra("epicsCallback *simpvt")
}
field(MPST,DBF_MENU) {
prompt("Post Value Monitors")
Expand Down
4 changes: 2 additions & 2 deletions modules/database/src/std/rec/aiRecord.c
Expand Up @@ -508,9 +508,9 @@ static long readValue(aiRecord *prec)
}
prec->pact = FALSE;
} else { /* !prec->pact && delay >= 0. */
CALLBACK *pvt = prec->simpvt;
epicsCallback *pvt = prec->simpvt;
if (!pvt) {
pvt = calloc(1, sizeof(CALLBACK)); /* very lazy allocation of callback structure */
pvt = calloc(1, sizeof(epicsCallback)); /* very lazy allocation of callback structure */
prec->simpvt = pvt;
}
if (pvt) callbackRequestProcessCallbackDelayed(pvt, prec->prio, prec, prec->sdly);
Expand Down
2 changes: 1 addition & 1 deletion modules/database/src/std/rec/aiRecord.dbd.pod
Expand Up @@ -516,7 +516,7 @@ simulation mode.
prompt("Sim. Mode Private")
special(SPC_NOMOD)
interest(4)
extra("CALLBACK *simpvt")
extra("epicsCallback *simpvt")
}
}

Expand Down

0 comments on commit 0f8876d

Please sign in to comment.