Changeset 454 for abnfparser
- Timestamp:
- 28/02/09 16:19:40 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
abnfparser/bap/main.c
r416 r454 58 58 printf( format, ## args ); \ 59 59 } else { \ 60 int prevcount = charcount; \ 60 61 charcount += sprintf((charbuf+charcount), format, ## args); \ 61 62 if (charcount > olenlimit) { \ 62 charcut = charbuf+olenlimit; \ 63 while (*charcut != ' ' && charcut >= charbuf) { \ 64 charcut--; \ 65 charcount++; \ 66 } \ 63 char x[1000]; \ 64 sprintf(x, format, ## args ); \ 65 if (*x == '<') { /* prose rule? */ \ 66 charcut = charbuf + prevcount - 1; /* wrap all of it */ \ 67 charcount = olenlimit + strlen(x) + 1; \ 68 } \ 69 else { \ 70 charcut = charbuf+olenlimit; \ 71 while (*charcut != ' ' && charcut >= charbuf) { \ 72 charcut--; \ 73 charcount++; \ 74 } \ 75 } \ 67 76 if (charcut != charbuf) { \ 68 *charcut++ = 0; \69 printf("%s\n", charbuf); \70 if (*charbuf == ';') { \71 memmove(charbuf+2, charcut, charcount - olenlimit); \72 *(charbuf+1) = ' '; \73 charcount -= (olenlimit-1); \74 } else { \75 memmove(charbuf+1, charcut, charcount - olenlimit); \76 *charbuf = ' '; \77 charcount -= olenlimit; \78 } \77 *charcut++ = 0; \ 78 printf("%s\n", charbuf); \ 79 if (*charbuf == ';') { \ 80 memmove(charbuf+2, charcut, charcount - olenlimit); \ 81 *(charbuf+1) = ' '; \ 82 charcount -= (olenlimit-1); \ 83 } else { \ 84 memmove(charbuf+1, charcut, charcount - olenlimit); \ 85 *charbuf = ' '; \ 86 charcount -= olenlimit; \ 87 } \ 79 88 } \ 80 89 } \ 90 /* flush the line when EOL present */ \ 81 91 charcut = strchr(charbuf, '\n'); \ 82 92 if (charcut) { \
Note: See TracChangeset
for help on using the changeset viewer.