EPICS Base  7.0.6.1
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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 * SPDX-License-Identifier: EPICS
7 * EPICS BASE is distributed subject to a Software License Agreement found
8 * in file LICENSE that is included with this distribution.
9 \*************************************************************************/
25 #ifndef INCmacLibH
26 #define INCmacLibH
27 
28 #include "ellLib.h"
29 #include "libComAPI.h"
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
37 #define MAC_SIZE 256
38 
43 typedef struct {
44  long magic;
45  int dirty;
46  int level;
47  int debug;
49  int flags;
50 } MAC_HANDLE;
51 
61 LIBCOM_API long
62 epicsStdCall macCreateHandle(
63  MAC_HANDLE **handle,
66  const char * pairs[]
70 );
79 LIBCOM_API void
80 epicsStdCall macSuppressWarning(
81  MAC_HANDLE *handle,
83  int falseTrue
84 );
85 
98 LIBCOM_API long
99 epicsStdCall macExpandString(
100  MAC_HANDLE *handle,
102  const char *src,
104  char *dest,
106  long capacity
107 );
108 
116 LIBCOM_API long
117 epicsStdCall macPutValue(
118  MAC_HANDLE *handle,
120  const char *name,
122  const char *value
123 );
124 
153 LIBCOM_API long
154 epicsStdCall macGetValue(
155  MAC_HANDLE *handle,
157  const char *name,
159  char *value,
162  long capacity
163 );
171 LIBCOM_API long
172 epicsStdCall macDeleteHandle(
173  MAC_HANDLE *handle
174 );
183 LIBCOM_API long
184 epicsStdCall macPushScope(
185  MAC_HANDLE *handle
186 );
193 LIBCOM_API long
194 epicsStdCall macPopScope(
195  MAC_HANDLE *handle
196 );
203 LIBCOM_API long
204 epicsStdCall macReportMacros(
205  MAC_HANDLE *handle
206 );
240 LIBCOM_API long
241 epicsStdCall macParseDefns(
242  MAC_HANDLE *handle,
245  const char *defns,
248  char **pairs[]
252 );
253 
262 LIBCOM_API long
263 epicsStdCall macInstallMacros(
264  MAC_HANDLE *handle,
266  char *pairs[]
270 );
271 
283 LIBCOM_API char *
284 epicsStdCall macEnvExpand(
285  const char *str
286 );
287 
297 LIBCOM_API char *
298 epicsStdCall macDefExpand(
299  const char *str,
300  MAC_HANDLE *macros
302 );
305 #ifdef __cplusplus
306 }
307 #endif
308 
309 #endif /*INCmacLibH*/
Definition: link.h:175
LIBCOM_API char *epicsStdCall macEnvExpand(const char *str)
Expand environment variables in a string.
long magic
magic number (used for authentication)
Definition: macLib.h:44
LIBCOM_API long epicsStdCall macParseDefns(MAC_HANDLE *handle, const char *defns, char **pairs[])
Parse macro definitions into an array of {name, value} pairs.
LIBCOM_API long epicsStdCall macInstallMacros(MAC_HANDLE *handle, char *pairs[])
Install set of {name, value} pairs as definitions.
int level
scoping level
Definition: macLib.h:46
int dirty
values need expanding from raw values?
Definition: macLib.h:45
int debug
debugging level
Definition: macLib.h:47
LIBCOM_API long epicsStdCall macDeleteHandle(MAC_HANDLE *handle)
Marks a handle invalid, and frees all storage associated with it.
LIBCOM_API long epicsStdCall macPutValue(MAC_HANDLE *handle, const char *name, const char *value)
Sets the value of a specific macro.
LIBCOM_API char *epicsStdCall macDefExpand(const char *str, MAC_HANDLE *macros)
Expands macros and environment variables in a string.
A doubly-linked list library.
List header type.
Definition: ellLib.h:57
LIBCOM_API long epicsStdCall macExpandString(MAC_HANDLE *handle, const char *src, char *dest, long capacity)
Expand a string which may contain macro references.
LIBCOM_API long epicsStdCall macCreateHandle(MAC_HANDLE **handle, const char *pairs[])
Creates a new macro substitution context.
LIBCOM_API long epicsStdCall macPopScope(MAC_HANDLE *handle)
Retrieve the last pushed scope (like stack operations)
LIBCOM_API long epicsStdCall macReportMacros(MAC_HANDLE *handle)
Reports details of current definitions.
LIBCOM_API long epicsStdCall macGetValue(MAC_HANDLE *handle, const char *name, char *value, long capacity)
Returns the value of a macro.
ELLLIST list
macro name / value list
Definition: macLib.h:48
int flags
operating mode flags
Definition: macLib.h:49
LIBCOM_API void epicsStdCall macSuppressWarning(MAC_HANDLE *handle, int falseTrue)
Disable or enable warning messages.
Macro substitution context, for use by macLib routines only.
Definition: macLib.h:43
LIBCOM_API long epicsStdCall macPushScope(MAC_HANDLE *handle)
Marks the start of a new scoping level.