Commit d101006d774c3174983d89ffae65c9e8a65c4b55
- Diff rendering mode:
- inline
- side by side
logfiles.cpp
(5 / 1)
|   | |||
| 9 | 9 | #include <ctype.h> | |
| 10 | 10 | #include <sys/time.h> | |
| 11 | 11 | #include <sys/types.h> | |
| 12 | #include <sysexits.h> | ||
| 12 | 13 | ||
| 13 | 14 | #ifdef USE_ASSERT | |
| 14 | 15 | # include <assert.h> | |
| … | … | ||
| 111 | 111 | static void outputLineDirect(struct logfile *lf) { | |
| 112 | 112 | assert(lf != NULL); | |
| 113 | 113 | assert(lf->line != NULL); | |
| 114 | fwrite(lf->line, lf->lineLength, 1, stdout); | ||
| 114 | if(fwrite(lf->line, lf->lineLength, 1, stdout) < lf->lineLength) { | ||
| 115 | perror("fwrite"); | ||
| 116 | exit(EX_IOERR); | ||
| 117 | } | ||
| 115 | 118 | } | |
| 116 | 119 | ||
| 117 | 120 | /** |
logfiles.h
(1 / 1)
|   | |||
| 41 | 41 | /* The current record */ | |
| 42 | 42 | char *line; | |
| 43 | 43 | /* Look! I know pascal! */ | |
| 44 | int lineLength; | ||
| 44 | size_t lineLength; | ||
| 45 | 45 | /* Function to output the current line */ | |
| 46 | 46 | void (*outputLine)(struct logfile *); | |
| 47 | 47 | /* The timestamp of the current record */ |

