home
·
contact
·
privacy
projects
/
plomrogue
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Server: Slightly simplify command parsing.
[plomrogue]
/
src
/
common
/
readwrite.h
diff --git
a/src/common/readwrite.h
b/src/common/readwrite.h
index d03aeacb5fb5924d71a8b542afc7a26a3b3c6bb0..cdbd386e56539917b8760a09022bb0cc834ba591 100644
(file)
--- a/
src/common/readwrite.h
+++ b/
src/common/readwrite.h
@@
-14,11
+14,11
@@
/* Wrappers to fopen(), fclose(), fgets() and fwrite() from function called "f",
* calling exit_err() upon error with appropriate error messages.
*/
/* Wrappers to fopen(), fclose(), fgets() and fwrite() from function called "f",
* calling exit_err() upon error with appropriate error messages.
*/
-extern FILE * try_fopen(char * path, char * mode, char * f);
-extern void try_fclose(FILE * file, char * f);
+extern FILE * try_fopen(char * path, char * mode, c
onst c
har * f);
+extern void try_fclose(FILE * file, c
onst c
har * f);
extern void try_fwrite(void * ptr, size_t size, size_t nmemb, FILE * stream,
extern void try_fwrite(void * ptr, size_t size, size_t nmemb, FILE * stream,
- char * f);
-extern void try_fputc(uint8_t c, FILE * file, char * f);
+ c
onst c
har * f);
+extern void try_fputc(uint8_t c, FILE * file, c
onst c
har * f);
/* Wrapper to calling fgetc() and fgets() from function "f". The return code is
* returned unless ferror() indicates an error (i.e. to signify an end of file,
/* Wrapper to calling fgetc() and fgets() from function "f". The return code is
* returned unless ferror() indicates an error (i.e. to signify an end of file,
@@
-26,8
+26,8
@@
extern void try_fputc(uint8_t c, FILE * file, char * f);
* on "file" before fgetc(), because some Unixes fgetc() remember old EOFs and
* only return those until explicitely cleared.
*/
* on "file" before fgetc(), because some Unixes fgetc() remember old EOFs and
* only return those until explicitely cleared.
*/
-extern int try_fgetc(FILE * file, char * f);
-extern char * try_fgets(char * line, int size, FILE * file, char * f);
+extern int try_fgetc(FILE * file, c
onst c
har * f);
+extern char * try_fgets(char * line, int size, FILE * file, c
onst c
har * f);
/* Write to "path_tmp" "path" + "_tmp" and return a new file at that "path_tmp"
* open for writing. "path_tmp" is malloc()'d, must be freed externally.
/* Write to "path_tmp" "path" + "_tmp" and return a new file at that "path_tmp"
* open for writing. "path_tmp" is malloc()'d, must be freed externally.
@@
-40,6
+40,9
@@
extern FILE * atomic_write_start(char * path, char ** path_tmp);
*/
extern void atomic_write_finish(FILE * file, char * path, char * path_tmp);
*/
extern void atomic_write_finish(FILE * file, char * path, char * path_tmp);
+/* Check for temp file leftover of atomic writing of "path", abort if found. */
+extern void detect_atomic_leftover(char * path);
+
/* Return largest line length from "file" (including newline chars). */
extern uint32_t textfile_width(FILE * file);
/* Return largest line length from "file" (including newline chars). */
extern uint32_t textfile_width(FILE * file);