int iscntrl(int c) { #if !CAM_DRYOS return ((c >=0 && c <32) || c == 127); // don't want to require the whole ctype table on vxworks just for this one #else return _ctype(c,_C); #endif }
int ispunct(int c) { #if !CAM_DRYOS return _ispunct(c); #else return _ctype(c,_P); #endif }
int isxdigit(int c) { #if !CAM_DRYOS return _isxdigit(c); #else return _ctype(c,(_X|_D)); #endif }
int isalpha(int c) { #if !CAM_DRYOS return _isalpha(c); #else return _ctype(c,(_U|_L)); #endif }
int isdigit(int c) { #if !CAM_DRYOS return _isdigit(c); #else return _ctype(c,_D); #endif }
int islower(int c) { #if !CAM_DRYOS return _islower(c); #else return _ctype(c,_L); #endif }
int isupper(int c) { #if !CAM_DRYOS return _isupper(c); #else return _ctype(c,_U); #endif }
int isspace(int c) { #if !CAM_DRYOS return _isspace(c); #else return _ctype(c,_S); #endif }
struct pbc_pattern * pbc_pattern_new(struct pbc_env * env , const char * message, const char * format, ... ) { struct _message *m = _pbcP_get_message(env, message); if (m==NULL) { return NULL; } int len = strlen(format); char temp[len+1]; int n = _scan_pattern(format, temp); struct pbc_pattern * pat = _pbcP_new(n); int i; va_list ap; va_start(ap , format); const char *ptr = temp; for (i=0;i<n;i++) { struct _pattern_field * f = &(pat->f[i]); struct _field * field = _pbcM_sp_query(m->name, ptr); if (field == NULL) goto _error; f->id = field->id; f->ptype = field->type; *f->defv = *field->default_v; f->offset = va_arg(ap, int); ptr += strlen(ptr) + 1; f->ctype = _ctype(ptr); if (f->ctype < 0) goto _error; if (f->ctype == CTYPE_ARRAY && field->label == LABEL_PACKED) { f->ctype = CTYPE_PACKED; } if (_check_ctype(field, f)) goto _error; ptr += strlen(ptr) + 1; } va_end(ap); pat->count = n; qsort(pat->f , n , sizeof(struct _pattern_field), _comp_field); return pat; _error: free(pat); return NULL; }