36 #ifndef __INCLUDED_sla_hh__
37 #define __INCLUDED_sla_hh__
60 #define sla_double sla
65 #define sla_ushort sla
72 ROSE_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 );
80 #define SLA_FCN_PROTO(N,T) \
81 ROSE_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) \
90 ROSE_UTIL_API int N( int *argc \
91 , ARGVCONST char **argv \
102 #ifndef SLA_FCN_BEGIN
104 #define SLA_FCN_BEGIN(N,T) \
105 ROSE_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]); \