This is Unofficial EPICS BASE Doxygen Site
macLib.h
Go to the documentation of this file.
1 /*************************************************************************\
2 * Copyright (c) 2007 UChicago Argonne LLC, as Operator of Argonne
3 * National Laboratory.
4 * Copyright (c) 2002 The Regents of the University of California, as
5 * Operator of Los Alamos National Laboratory.
6 * EPICS BASE is distributed subject to a Software License Agreement found
7 * in file LICENSE that is included with this distribution.
8 \*************************************************************************/
24 #ifndef INCmacLibH
25 #define INCmacLibH
26 
27 #include "ellLib.h"
28 #include "libComAPI.h"
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
36 #define MAC_SIZE 256
37 
42 typedef struct {
43  long magic;
44  int dirty;
45  int level;
46  int debug;
48  int flags;
49 } MAC_HANDLE;
50 
60 LIBCOM_API long
61 epicsStdCall macCreateHandle(
62  MAC_HANDLE **handle,
65  const char * pairs[]
69 );
78 LIBCOM_API void
79 epicsStdCall macSuppressWarning(
80  MAC_HANDLE *handle,
82  int falseTrue
83 );
84 
97 LIBCOM_API long
98 epicsStdCall macExpandString(
99  MAC_HANDLE *handle,
101  const char *src,
103  char *dest,
105  long capacity
106 );
107 
115 LIBCOM_API long
116 epicsStdCall macPutValue(
117  MAC_HANDLE *handle,
119  const char *name,
121  const char *value
122 );
123 
152 LIBCOM_API long
153 epicsStdCall macGetValue(
154  MAC_HANDLE *handle,
156  const char *name,
158  char *value,
161  long capacity
162 );
170 LIBCOM_API long
171 epicsStdCall macDeleteHandle(
172  MAC_HANDLE *handle
173 );
182 LIBCOM_API long
183 epicsStdCall macPushScope(
184  MAC_HANDLE *handle
185 );
192 LIBCOM_API long
193 epicsStdCall macPopScope(
194  MAC_HANDLE *handle
195 );
202 LIBCOM_API long
203 epicsStdCall macReportMacros(
204  MAC_HANDLE *handle
205 );
239 LIBCOM_API long
240 epicsStdCall macParseDefns(
241  MAC_HANDLE *handle,
244  const char *defns,
247  char **pairs[]
251 );
252 
261 LIBCOM_API long
262 epicsStdCall macInstallMacros(
263  MAC_HANDLE *handle,
265  char *pairs[]
269 );
270 
282 LIBCOM_API char *
283 epicsStdCall macEnvExpand(
284  const char *str
285 );
286 
296 LIBCOM_API char *
297 epicsStdCall macDefExpand(
298  const char *str,
299  MAC_HANDLE *macros
301 );
304 #ifdef __cplusplus
305 }
306 #endif
307 
308 #endif /*INCmacLibH*/
long magic
magic number (used for authentication)
Definition: macLib.h:43
Definition: link.h:174
LIBCOM_API long epicsStdCall macParseDefns(MAC_HANDLE *handle, const char *defns, char **pairs[])
Parse macro definitions into an array of {name, value} pairs.
Definition: macUtil.c:32
LIBCOM_API long epicsStdCall macGetValue(MAC_HANDLE *handle, const char *name, char *value, long capacity)
Returns the value of a macro.
Definition: macCore.c:301
LIBCOM_API long epicsStdCall macPutValue(MAC_HANDLE *handle, const char *name, const char *value)
Sets the value of a specific macro.
Definition: macCore.c:233
LIBCOM_API char *epicsStdCall macDefExpand(const char *str, MAC_HANDLE *macros)
Expands macros and environment variables in a string.
Definition: macEnv.c:26
#define str(v)
LIBCOM_API long epicsStdCall macExpandString(MAC_HANDLE *handle, const char *src, char *dest, long capacity)
Expand a string which may contain macro references.
Definition: macCore.c:174
LIBCOM_API long epicsStdCall macPushScope(MAC_HANDLE *handle)
Marks the start of a new scoping level.
Definition: macCore.c:392
LIBCOM_API char *epicsStdCall macEnvExpand(const char *str)
Expand environment variables in a string.
Definition: macEnv.c:20
A doubly-linked list library.
LIBCOM_API long epicsStdCall macPopScope(MAC_HANDLE *handle)
Retrieve the last pushed scope (like stack operations)
Definition: macCore.c:427
int flags
operating mode flags
Definition: macLib.h:48
Macro substitution context, for use by macLib routines only.
Definition: macLib.h:42
int dirty
values need expanding from raw values?
Definition: macLib.h:44
ELLLIST list
macro name / value list
Definition: macLib.h:47
int debug
debugging level
Definition: macLib.h:46
LIBCOM_API void epicsStdCall macSuppressWarning(MAC_HANDLE *handle, int falseTrue)
Disable or enable warning messages.
Definition: macCore.c:154
int level
scoping level
Definition: macLib.h:45
List header type.
Definition: ellLib.h:56
LIBCOM_API long epicsStdCall macInstallMacros(MAC_HANDLE *handle, char *pairs[])
Install set of {name, value} pairs as definitions.
Definition: macUtil.c:253
LIBCOM_API long epicsStdCall macDeleteHandle(MAC_HANDLE *handle)
Marks a handle invalid, and frees all storage associated with it.
Definition: macCore.c:360
LIBCOM_API long epicsStdCall macReportMacros(MAC_HANDLE *handle)
Reports details of current definitions.
Definition: macCore.c:471
LIBCOM_API long epicsStdCall macCreateHandle(MAC_HANDLE **handle, const char *pairs[])
Creates a new macro substitution context.
Definition: macCore.c:100