Skip to content
Snippets Groups Projects
Commit 9346d68a authored by benjamin.franksen's avatar benjamin.franksen
Browse files

cleaned up compatibility macros and moved them to one place in seqCom.h

parent 382f92fe
No related branches found
No related tags found
No related merge requests found
......@@ -41,8 +41,6 @@ extern "C" {
#define NOEVFLAG 0 /* argument to pvSync to remove sync */
#define DEFAULT_QUEUE_SIZE 100 /* default queue size (elements) */
#define DEFAULT_TIMEOUT 10.0 /* default timeout for SYNC operations */
/* I/O completion type (extra argument passed to seq_pvGet() and seq_pvPut()) */
......@@ -53,17 +51,15 @@ enum compType {
};
typedef struct state_set *const SS_ID; /* state set id, opaque */
typedef struct UserVar SEQ_VARS; /* defined by program, opaque */
typedef char string[MAX_STRING_SIZE]; /* the string typedef */
typedef SEQ_VARS USER_VAR; /* for compatibility */
typedef struct _seq_vars SEQ_VARS; /* struct defined in generated code */
typedef char string[MAX_STRING_SIZE]; /* representation of SNL string type */
/* these typedefs make the code more self documenting */
typedef unsigned EV_ID; /* identifier for an event */
typedef unsigned VAR_ID; /* identifier for a pv */
typedef int seqBool;
typedef struct seqProgram seqProgram; /* program object, opaque */
typedef struct seqProgram seqProgram; /* struct defined in generated code */
/*
* Function declarations for interface between state program & sequencer.
......@@ -82,8 +78,6 @@ epicsShareFunc pvStat seq_pvGetMultiple(SS_ID, VAR_ID,
unsigned, enum compType);
epicsShareFunc seqBool seq_pvGetQ(SS_ID, VAR_ID);
epicsShareFunc void seq_pvFlushQ(SS_ID, VAR_ID);
/* retain seq_pvFreeQ for compatibility */
#define seq_pvFreeQ seq_pvFlushQ
epicsShareFunc pvStat seq_pvPut(SS_ID, VAR_ID, enum compType, double tmo);
epicsShareFunc pvStat seq_pvPutMultiple(SS_ID, VAR_ID,
unsigned, enum compType);
......@@ -109,11 +103,7 @@ epicsShareFunc seqBool seq_pvConnected(SS_ID, VAR_ID);
#define seq_pvIndex(ssId, varId) varId
#define seq_ssId(ssId) _seq_ss
#define seq_pVar(ssId) _seq_vars
/* for backwards compatibility */
#define ssId _seq_ss
#define pVar _seq_vars
#define seq_pVar(ssId) _seq_var
/* global operations */
epicsShareFunc void seq_pvFlush(SS_ID);
......@@ -135,6 +125,15 @@ epicsShareFunc void seqQueueShow(epicsThreadId);
epicsShareFunc void seqStop(epicsThreadId);
epicsShareFunc epicsThreadId seq(seqProgram *, const char *, unsigned);
/* backwards compatibility macros */
/* DEPRECATED don't use in new code */
#define ssId _seq_ss
#define pVar _seq_var
#define USER_VAR SEQ_VARS
#define UserVar _seq_vars
#define seq_pvFreeQ seq_pvFlushQ
#define DEFAULT_QUEUE_SIZE 100 /* number of elements */
#ifdef __cplusplus
} /* extern "C" */
#endif
......
......@@ -152,7 +152,7 @@ static void gen_func_decls(Expr *prog)
}
}
/* Generate the UserVar struct containing all program variables with
/* Generate the struct containing all program variables with
'infinite' (global) lifetime. These are: variables declared at the
top-level, inside a state set, and inside a state. Note that state
set and state local variables are _visible_ only inside the block
......
......@@ -20,8 +20,8 @@ void gen_defn_c_code(Expr *scope, int level);
void gen_var_decl(Var *vp);
void indent(int level);
#define NM_VARS "UserVar"
#define NM_VARS_ARG "_seq_vars"
#define NM_VARS "_seq_vars"
#define NM_VARS_ARG "_seq_var"
#define NM_INITVAR "_seq_initvar_"
#define NM_CHANS "_seq_chans"
#define NM_STATES "_seq_states"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment