36#ifndef __INCLUDED_sla_hh__
37#define __INCLUDED_sla_hh__
53ROSE_UTIL_API
void sla_set_debug(
int d );
72ROSE_UTIL_API
int sla_none( std::vector<std::string> &argv,
const std::string& flind,
const std::string& assop,
const std::string& pname,
int argd=0 );
74ROSE_UTIL_API
int sla_none(
int *argc, ARGVCONST
char **argv,
const char *flind,
const char *assop,
const char *pname,
int argd );
80#define SLA_FCN_PROTO(N,T) \
81ROSE_UTIL_API int N( std::vector<std::string>& argv \
82 , const std::string& flind \
83 , const std::string& assop \
84 , const std::string& pname \
89#define SLA_FCN_PROTO(N,T) \
90ROSE_UTIL_API int N( int *argc \
91 , ARGVCONST char **argv \
104#define SLA_FCN_BEGIN(N,T) \
105ROSE_UTIL_API int N( std::vector<std::string>& argv \
106 , const std::string& flind \
107 , const std::string& assop \
108 , const std::string& pname \
113#define SLA_FCN_BEGIN(N,T) SLA_FCN_PROTO(N,T)
124 std::vector<std::string> rr(argv.size()); \
126 std::string ppname = pname; \
127 if ( !pname.empty() && pname[0] != '*' ) { \
128 ppname = "*" + ppname; \
130 nvalue = sla_str( argv, flind, assop, ppname, rr, argd ); \
131 if ( nvalue > 0 && value != NULL ) { \
132 if ( !pname.empty() && pname[0] == '*' ) { \
133 for ( i=0; i<nvalue; i++ ) M( value+i, rr[i] ); \
136 for ( i=0; i<nvalue; i++ ) M( value , rr[i] ); \
142 ARGVCONST char **rr, eol='\0'; \
144 rr = (ARGVCONST char**)malloc( (*argc)*sizeof(ARGVCONST char*) ); \
145 for ( i=0; i<*argc; i++ ) rr[i] = &eol; \
146 nvalue = sla_str( argc, argv, flind, assop, pname, rr, argd ); \
147 if ( nvalue > 0 && value != NULL ) { \
148 if ( *pname == '*' ) { \
149 for ( i=0; i<nvalue; i++ ) M( value+i, rr[i] ); \
152 for ( i=0; i<nvalue; i++ ) M( value , rr[i] ); \
164 std::vector<std::string> rr(argv.size()); \
166 std::string ppname = pname; \
167 if ( pname.empty() || pname[0] != '*' ) { \
168 ppname = "*" + ppname; \
170 nvalue = sla_str( argv, flind, assop, ppname, &rr[0], argd ); \
171 if ( nvalue > 0 && value != NULL ) { \
172 if ( !pname.empty() && pname[0] == '*' ) { \
173 for ( i=0; i<nvalue; i++ ) value[i] = C(rr[i].c_str()); \
176 for ( i=0; i<nvalue; i++ ) value[0] = C(rr[i].c_str()); \
182 ARGVCONST char **rr, eol='\0'; \
184 rr = (ARGVCONST char**)malloc( (*argc)*sizeof(ARGVCONST char*) ); \
185 for ( i=0; i<*argc; i++ ) rr[i] = &eol; \
186 nvalue = sla_str( argc, argv, flind, assop, pname, rr, argd ); \
187 if ( nvalue > 0 && value != NULL ) { \
188 if ( *pname == '*' ) { \
189 for ( i=0; i<nvalue; i++ ) value[i] = C(rr[i]); \
192 for ( i=0; i<nvalue; i++ ) value[0] = C(rr[i]); \
210SLA_FCN_PROTO( sla_str, std::string );
212SLA_FCN_PROTO( sla_str, ARGVCONST
char * );
214SLA_FCN_PROTO( sla_float,
float );
215SLA_FCN_PROTO( sla_double,
double );
216SLA_FCN_PROTO( sla_int,
int );
217SLA_FCN_PROTO( sla_short,
short );
218SLA_FCN_PROTO( sla_long,
long );
219SLA_FCN_PROTO( sla_uint,
unsigned int );
220SLA_FCN_PROTO( sla_ushort,
unsigned short );
221SLA_FCN_PROTO( sla_ulong,
unsigned long );
222SLA_FCN_PROTO( sla_char,
char );