X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=blobdiff_plain;f=file.c;h=fe6167f3a979d33533bb757f9e4eff713f7f20da;hp=2f81be63c776adf9a30f6c8bd6ac33e23acb59f7;hb=e11a17b40805b93e1e2ae80129c9d235b6d6119b;hpb=4224ac5ca008f10dd981980cb0c215ed4d2fb03a;ds=sidebyside diff --git a/file.c b/file.c index 2f81be6..fe6167f 100644 --- a/file.c +++ b/file.c @@ -1,6 +1,5 @@ /* - * Copyright (C) 2012 - * Wolfgang Bumiller + * Copyright (C) 2012, 2013 * Dale Weiler * * Permission is hereby granted, free of charge, to any person obtaining a copy of @@ -79,7 +78,7 @@ FILE *handle = NULL; file_init(); - return ((fopen_s(&handle, filename, mode) != 0) ? NULL : handle; + return (fopen_s(&handle, filename, mode) != 0) ? NULL : handle; } size_t file_read(void *buffer, size_t size, size_t count, FILE *fp) { @@ -166,6 +165,11 @@ int file_seek(FILE *fp, long int off, int whence) { return fseek(fp, off, whence); } +int file_putc(FILE *fp, int ch) { + /* Invokes file_exception on windows if fp is null */ + return fputc(ch, fp); +} + /* * Implements libc getline for systems that don't have it, which is * assmed all. This works the same as getline().