Lines Matching defs:fp

202 				  int lineno, const char *message, FILE *fp);
204 const char *filename, FILE *fp);
205 static int _glh_write_timestamp(FILE *fp, time_t timestamp);
1018 FILE *fp; /* The output file */
1034 fp = fopen(filename, "w");
1035 if(!fp)
1057 if(fprintf(fp, "%s ", comment) < 0 ||
1058 _glh_write_timestamp(fp, node->timestamp) ||
1059 fprintf(fp, " %u\n", node->group) < 0) {
1060 return _glh_cant_save_history(glh, "Error writing", filename, fp);
1067 if(fwrite(seg->s, sizeof(char), slen, fp) != slen)
1068 return _glh_cant_save_history(glh, "Error writing", filename, fp);
1070 fputc('\n', fp);
1075 if(fclose(fp) == EOF)
1086 * closes fp and returns the error return code of _glh_save_history().
1092 * fp FILE * The stream to be closed (send NULL if not
1098 const char *filename, FILE *fp)
1102 if(fp)
1103 (void) fclose(fp);
1112 * fp FILE * The stream to write to.
1118 static int _glh_write_timestamp(FILE *fp, time_t timestamp)
1125 if(fprintf(fp, "?") < 0)
1132 if(fprintf(fp, "%04d%02d%02d%02d%02d%02d", t->tm_year + 1900, t->tm_mon + 1,
1164 FILE *fp; /* The output file */
1191 fp = fopen(filename, "r");
1192 if(!fp)
1198 for(lineno=1; fgets(line, dim, fp) != NULL; lineno++) {
1205 "Corrupt history parameter line", fp);
1217 "Corrupt timestamp", fp);
1230 "Corrupt group id", fp);
1242 "Corrupt parameter line", fp);
1248 if(fgets(line, dim, fp) == NULL)
1249 return _glh_cant_load_history(glh, filename, lineno, "Read error", fp);
1255 "Insufficient memory to record line", fp);
1268 (void) fclose(fp);
1278 int lineno, const char *message, FILE *fp)
1292 if(fp)
1293 (void) fclose(fp);