Changeset 0e3df7e for app/src/common/common.cc
- Timestamp:
- 05/08/08 15:42:37 (17 years ago)
- Branches:
- master, help
- Children:
- 40358d2
- Parents:
- adb4c8d
- git-author:
- obrebski <obrebski@…> (05/08/08 15:42:37)
- git-committer:
- obrebski <obrebski@…> (05/08/08 15:42:37)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
app/src/common/common.cc
r25ae32e r0e3df7e 15 15 bool one_field=false; 16 16 bool one_line=false; 17 char output_field_prefix[ 32];18 char input_field_prefix[ 32];17 char output_field_prefix[FIELD_PREFIX_MAXLEN]; 18 char input_field_prefix[FIELD_PREFIX_MAXLEN]; 19 19 20 20 extern int argc; … … 32 32 } 33 33 34 35 36 37 /*38 parameters:39 -name - field name, long or short40 +prefix - field name with ':' appended if long name41 return value:42 1 if correct field name, 0 otherwise43 examples:44 name prefix r.v.45 lem lem: 146 @ @ 147 :: 'undef' 048 a,b 'undef' 049 */50 int fieldprefix(char *name, char *prefix)51 {52 if (ispunct(name[0]) && name[1]=='\0') // correct short name53 {54 strcpy(prefix, name); return 1;55 }56 57 int i=0;58 while(name[i]!='\0' && isalnum(name[i])) ++i;59 60 if(name[i]=='\0' && i>0) // correct long name61 {62 sprintf(prefix,"%s:",name); return 1;63 }64 65 // incorrect66 return 0;67 }68 34 69 35
Note: See TracChangeset
for help on using the changeset viewer.