util.o: gmqcc.h opts.def
stat.o: gmqcc.h opts.def
fs.o: gmqcc.h opts.def platform.h
-conout.o: gmqcc.h opts.def
+conout.o: gmqcc.h opts.def platform.h
opts.o: gmqcc.h opts.def platform.h
test.o: gmqcc.h opts.def platform.h
main.o: gmqcc.h opts.def lexer.h
return fwrite(ptr, size, count, stream);
}
+int platform_fflush(FILE *stream) {
+ return fflush(stream);
+}
+
int platform_vfprintf(FILE *stream, const char *format, va_list arg) {
return vfprintf(stream, format, arg);
}
bool code_write(code_t *code, const char *filename, const char *lnofile) {
prog_header_t code_header;
- FILE *fp = NULL;
+ fs_file_t *fp = NULL;
code_create_header(code, &code_header, filename, lnofile);
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
-#include <unistd.h>
-
#include "gmqcc.h"
#include "platform.h"
-#define GMQCC_IS_STDOUT(X) ((FILE*)((void*)X) == stdout)
-#define GMQCC_IS_STDERR(X) ((FILE*)((void*)X) == stderr)
+#define GMQCC_IS_STDOUT(X) ((fs_file_t*)((void*)X) == (fs_file_t*)stdout)
+#define GMQCC_IS_STDERR(X) ((fs_file_t*)((void*)X) == (fs_file_t*)stderr)
#define GMQCC_IS_DEFINE(X) (GMQCC_IS_STDERR(X) || GMQCC_IS_STDOUT(X))
typedef struct {
- FILE *handle_err;
- FILE *handle_out;
-
- int color_err;
- int color_out;
+ fs_file_t *handle_err;
+ fs_file_t *handle_out;
+ int color_err;
+ int color_out;
} con_t;
-/*
- * Doing colored output on windows is fucking stupid. The linux way is
- * the real way. So we emulate it on windows :)
- */
-#ifdef _WIN32
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-
-/*
- * Windows doesn't have constants for FILENO, sadly but the docs tell
- * use the constant values.
- */
-#undef STDERR_FILENO
-#undef STDOUT_FILENO
-#define STDERR_FILENO 2
-#define STDOUT_FILENO 1
-
-enum {
- RESET = 0,
- BOLD = 1,
- BLACK = 30,
- RED,
- GREEN,
- YELLOW,
- BLUE,
- MAGENTA,
- CYAN,
- GRAY,
- WHITE = GRAY
-};
-
-enum {
- WBLACK,
- WBLUE,
- WGREEN = 2,
- WRED = 4,
- WINTENSE = 8,
- WCYAN = WBLUE | WGREEN,
- WMAGENTA = WBLUE | WRED,
- WYELLOW = WGREEN | WRED,
- WWHITE = WBLUE | WGREEN | WRED
-};
-
-static const int ansi2win[] = {
- WBLACK,
- WRED,
- WGREEN,
- WYELLOW,
- WBLUE,
- WMAGENTA,
- WCYAN,
- WWHITE
-};
-
-static int win_fputs(FILE *h, const char *str) {
- /* state for translate */
- int acolor = 0;
- int wcolor = 0;
- int icolor = 0;
- int state = 0;
-
- /* attributes */
- int intense = -1;
- int colors[] = {-1, -1 };
- int colorpos = 1;
- int length = 0;
- CONSOLE_SCREEN_BUFFER_INFO cinfo;
- GetConsoleScreenBufferInfo (
- (GMQCC_IS_STDOUT(h)) ?
- GetStdHandle(STD_OUTPUT_HANDLE) :
- GetStdHandle(STD_ERROR_HANDLE), &cinfo
- );
- icolor = cinfo.wAttributes;
-
- while (*str) {
- if (*str == '\x1B')
- state = '\x1B';
- else if (state == '\x1B' && *str == '[')
- state = '[';
- else if (state == '[') {
- if (*str != 'm') {
- colors[colorpos] = *str;
- colorpos--;
- } else {
- int find;
- int mult;
- for (find = colorpos + 1, acolor = 0, mult = 1; find < 2; find++) {
- acolor += (colors[find] - 48) * mult;
- mult *= 10;
- }
-
- /* convert to windows color */
- if (acolor == BOLD)
- intense = WINTENSE;
- else if (acolor == RESET) {
- intense = WBLACK;
- wcolor = icolor;
- }
- else if (BLACK <= acolor && acolor <= WHITE)
- wcolor = ansi2win[acolor - 30];
- else if (acolor == 90) {
- /* special gray really white man */
- wcolor = WWHITE;
- intense = WBLACK;
- }
-
- SetConsoleTextAttribute (
- (GMQCC_IS_STDOUT(h)) ?
- GetStdHandle(STD_OUTPUT_HANDLE) :
- GetStdHandle(STD_ERROR_HANDLE),
-
- wcolor | intense | (icolor & 0xF0)
- );
- colorpos = 1;
- state = -1;
- }
- } else {
- fs_file_write(str, 1, 1, stdout);
- length ++;
- }
- str++;
- }
- /* restore */
- SetConsoleTextAttribute(
- (GMQCC_IS_STDOUT(h)) ?
- GetStdHandle(STD_OUTPUT_HANDLE) :
- GetStdHandle(STD_ERROR_HANDLE),
- icolor
- );
- return length;
-}
-#endif
-
/*
* We use standard files as default. These can be changed at any time
* with con_change(F, F)
* checks.
*/
static void con_enablecolor(void) {
- if (console.handle_err == stderr || console.handle_err == stdout)
+ if (console.handle_err == (fs_file_t*)stderr || console.handle_err == (fs_file_t*)stdout)
console.color_err = !!(platform_isatty(STDERR_FILENO));
- if (console.handle_out == stderr || console.handle_out == stdout)
+ if (console.handle_out == (fs_file_t*)stderr || console.handle_out == (fs_file_t*)stdout)
console.color_out = !!(platform_isatty(STDOUT_FILENO));
}
* arguments. This colorizes for windows as well via translate
* step.
*/
-static int con_write(FILE *handle, const char *fmt, va_list va) {
- int ln;
- #ifndef _WIN32
- ln = vfprintf(handle, fmt, va);
- #else
- {
- char data[4096];
- memset(data, 0, sizeof(data));
- platform_vsnprintf(data, sizeof(data), fmt, va);
- ln = (GMQCC_IS_DEFINE(handle)) ? win_fputs(handle, data) : fs_file_puts(handle, data);
- }
- #endif
- return ln;
+static int con_write(fs_file_t *handle, const char *fmt, va_list va) {
+ return vfprintf((FILE*)handle, fmt, va);
}
/**********************************************************************
}
void con_init() {
- console.handle_err = stderr;
- console.handle_out = stdout;
+ console.handle_err = (fs_file_t*)stderr;
+ console.handle_out = (fs_file_t*)stdout;
con_enablecolor();
}
int con_change(const char *out, const char *err) {
con_close();
- if (!out) out = (const char *)((!console.handle_out) ? stdout : console.handle_out);
- if (!err) err = (const char *)((!console.handle_err) ? stderr : console.handle_err);
+ if (!out) out = (const char *)((!console.handle_out) ? (fs_file_t*)stdout : console.handle_out);
+ if (!err) err = (const char *)((!console.handle_err) ? (fs_file_t*)stderr : console.handle_err);
if (GMQCC_IS_DEFINE(out)) {
- console.handle_out = GMQCC_IS_STDOUT(out) ? stdout : stderr;
+ console.handle_out = (fs_file_t*)(GMQCC_IS_STDOUT(out) ? stdout : stderr);
con_enablecolor();
} else if (!(console.handle_out = fs_file_open(out, "w"))) return 0;
if (GMQCC_IS_DEFINE(err)) {
- console.handle_err = GMQCC_IS_STDOUT(err) ? stdout : stderr;
+ console.handle_err = (fs_file_t*)(GMQCC_IS_STDOUT(err) ? stdout : stderr);
con_enablecolor();
} else if (!(console.handle_err = fs_file_open(err, "w"))) return 0;
* Defaultizer because stdio.h shouldn't be used anywhere except here
* and inside file.c To prevent mis-match of wrapper-interfaces.
*/
-FILE *con_default_out() {
- return (console.handle_out = stdout);
+fs_file_t *con_default_out() {
+ return (fs_file_t*)(console.handle_out = (fs_file_t*)stdout);
}
-FILE *con_default_err() {
- return (console.handle_err = stderr);
+fs_file_t *con_default_err() {
+ return (fs_file_t*)(console.handle_err = (fs_file_t*)stderr);
}
int con_verr(const char *fmt, va_list va) {
CON_RED
};
- int err = !!(level == LVL_ERROR);
- int color = (err) ? console.color_err : console.color_out;
- int (*print) (const char *, ...) = (err) ? &con_err : &con_out;
- int (*vprint)(const char *, va_list) = (err) ? &con_verr : &con_vout;
+ int err = !!(level == LVL_ERROR);
+ int color = (err) ? console.color_err : console.color_out;
+ int (*print) (const char *, ...) = (err) ? &con_err : &con_out;
+ int (*vprint)(const char *, va_list) = (err) ? &con_verr : &con_vout;
if (color)
print("\033[0;%dm%s:%d:%d: \033[0;%dm%s: \033[0m", CON_CYAN, name, (int)line, (int)column, sel[level], msgtype);
qc_program_t* prog_load(const char *filename, bool skipversion)
{
- qc_program_t *prog;
prog_header_t header;
- FILE *file = fs_file_open(filename, "rb");
+ qc_program_t *prog;
+ fs_file_t *file = fs_file_open(filename, "rb");
if (!file)
return NULL;
done:
if (len < (int)sizeof(spaces)-1) {
spaces[sizeof(spaces)-1-len] = 0;
- fs_file_puts(stdout, spaces);
+ fs_file_puts((fs_file_t*)stdout, spaces);
spaces[sizeof(spaces)-1-len] = ' ';
}
}
#include "gmqcc.h"
#include "platform.h"
-FILE *fs_file_open(const char *filename, const char *mode) {
- return platform_fopen(filename, mode);
+fs_file_t *fs_file_open(const char *filename, const char *mode) {
+ return (fs_file_t*)platform_fopen(filename, mode);
}
-size_t fs_file_read(void *buffer, size_t size, size_t count, FILE *fp) {
- return platform_fread(buffer, size, count, fp);
+size_t fs_file_read(void *buffer, size_t size, size_t count, fs_file_t *fp) {
+ return platform_fread(buffer, size, count, (FILE*)fp);
}
-int fs_file_printf(FILE *fp, const char *format, ...) {
+int fs_file_printf(fs_file_t *fp, const char *format, ...) {
int rt;
va_list va;
va_start(va, format);
- rt = platform_vfprintf(fp, format, va);
+ rt = platform_vfprintf((FILE*)fp, format, va);
va_end (va);
return rt;
}
-void fs_file_close(FILE *fp) {
- platform_fclose (fp);
+void fs_file_close(fs_file_t *fp) {
+ platform_fclose((FILE*)fp);
}
size_t fs_file_write (
const void *buffer,
size_t size,
size_t count,
- FILE *fp
+ fs_file_t *fp
) {
- return platform_fwrite(buffer, size, count, fp);
+ return platform_fwrite(buffer, size, count, (FILE*)fp);
}
-int fs_file_error(FILE *fp) {
- return platform_ferror(fp);
+int fs_file_error(fs_file_t *fp) {
+ return platform_ferror((FILE*)fp);
}
-int fs_file_getc(FILE *fp) {
- return platform_fgetc(fp);
+int fs_file_getc(fs_file_t *fp) {
+ return platform_fgetc((FILE*)fp);
}
-int fs_file_puts(FILE *fp, const char *str) {
- return platform_fputs(str, fp);
+int fs_file_puts(fs_file_t *fp, const char *str) {
+ return platform_fputs(str, (FILE*)fp);
}
-int fs_file_seek(FILE *fp, long int off, int whence) {
- return platform_fseek(fp, off, whence);
+int fs_file_seek(fs_file_t *fp, long int off, int whence) {
+ return platform_fseek((FILE*)fp, off, whence);
}
-long int fs_file_tell(FILE *fp) {
- return platform_ftell(fp);
+long int fs_file_tell(fs_file_t *fp) {
+ return platform_ftell((FILE*)fp);
+}
+
+int fs_file_flush(fs_file_t *fp) {
+ return platform_fflush((FILE*)fp);
}
/*
* Implements libc getline for systems that don't have it, which is
* assmed all. This works the same as getline().
*/
-int fs_file_getline(char **lineptr, size_t *n, FILE *stream) {
+int fs_file_getline(char **lineptr, size_t *n, fs_file_t *stream) {
int chr;
int ret;
char *pos;
pos = *n - chr + *lineptr;
}
- if (ferror(stream))
+ if (fs_file_error(stream))
return -1;
if (c == EOF) {
if (pos == *lineptr)
return platform_mkdir(path, 0700);
}
-DIR *fs_dir_open(const char *name) {
- return platform_opendir(name);
+fs_dir_t *fs_dir_open(const char *name) {
+ return (fs_dir_t*)platform_opendir(name);
}
-int fs_dir_close(DIR *dir) {
- return platform_closedir(dir);
+int fs_dir_close(fs_dir_t *dir) {
+ return platform_closedir((DIR*)dir);
}
-struct dirent *fs_dir_read(DIR *dir) {
- return platform_readdir(dir);
+fs_dirent_t *fs_dir_read(fs_dir_t *dir) {
+ return (fs_dirent_t*)platform_readdir((DIR*)dir);
}
static char *ftepp_include_find_path(const char *file, const char *pathfile)
{
- FILE *fp;
+ fs_file_t *fp;
char *filename = NULL;
const char *last_slash;
size_t len;
# endif
#endif /*! !defined (PLATFORM_BYTE_ORDER) */
-/*
- * On windows systems where we're not compiling with MING32 we need a
- * little extra help on dependinces for implementing our own dirent.h
- * in fs.c.
- */
-#if defined(_WIN32) && !defined(__MINGW32__)
-# define _WIN32_LEAN_AND_MEAN
-# include <windows.h>
-# include <io.h>
-# include <fcntl.h>
-
- struct dirent {
- long d_ino;
- unsigned short d_reclen;
- unsigned short d_namlen;
- char d_name[FILENAME_MAX];
- };
-
- typedef struct {
- struct _finddata_t dd_dta;
- struct dirent dd_dir;
- long dd_handle;
- int dd_stat;
- char dd_name[1];
- } DIR;
- /*
- * Visual studio also lacks S_ISDIR for sys/stat.h, so we emulate this as well
- * which is not hard at all.
- */
-# ifdef S_ISDIR
-# undef S_ISDIR
-# endif /*! S_ISDIR */
-# define S_ISDIR(X) ((X)&_S_IFDIR)
-#else
-# include <dirent.h>
-#endif /*! _WIN32 && !defined(__MINGW32__) */
-
/* stat.c */
void stat_info (void);
char *stat_mem_strdup (const char *, size_t, const char *, bool);
/* fs.c */
-void fs_file_close (FILE *);
-int fs_file_error (FILE *);
-int fs_file_getc (FILE *);
-int fs_file_printf (FILE *, const char *, ...);
-int fs_file_puts (FILE *, const char *);
-int fs_file_seek (FILE *, long int, int);
-long int fs_file_tell (FILE *);
+typedef struct fs_dir_s fs_dir_t;
+typedef struct fs_file_s fs_file_t;
+typedef struct dirent fs_dirent_t;
+
+void fs_file_close (fs_file_t *);
+int fs_file_error (fs_file_t *);
+int fs_file_getc (fs_file_t *);
+int fs_file_printf (fs_file_t *, const char *, ...);
+int fs_file_puts (fs_file_t *, const char *);
+int fs_file_seek (fs_file_t *, long int, int);
+long fs_file_tell (fs_file_t *);
+int fs_file_flush (fs_file_t *);
-size_t fs_file_read (void *, size_t, size_t, FILE *);
-size_t fs_file_write (const void *, size_t, size_t, FILE *);
+size_t fs_file_read (void *, size_t, size_t, fs_file_t *);
+size_t fs_file_write (const void *, size_t, size_t, fs_file_t *);
-FILE *fs_file_open (const char *, const char *);
-int fs_file_getline(char **, size_t *, FILE *);
+fs_file_t *fs_file_open (const char *, const char *);
+int fs_file_getline(char **, size_t *, fs_file_t *);
int fs_dir_make (const char *);
-DIR *fs_dir_open (const char *);
-int fs_dir_close (DIR *);
-struct dirent *fs_dir_read (DIR *);
+fs_dir_t *fs_dir_open (const char *);
+int fs_dir_close (fs_dir_t *);
+fs_dirent_t *fs_dir_read (fs_dir_t *);
/* correct.c */
typedef struct correct_trie_s {
LVL_ERROR
};
-FILE *con_default_out(void);
-FILE *con_default_err(void);
+fs_file_t *con_default_out(void);
+fs_file_t *con_default_err(void);
void con_vprintmsg (int level, const char *name, size_t line, size_t column, const char *msgtype, const char *msg, va_list ap);
void con_printmsg (int level, const char *name, size_t line, size_t column, const char *msgtype, const char *msg, ...);
lex_file* lex_open(const char *file)
{
- lex_file *lex;
- FILE *in = fs_file_open(file, "rb");
+ lex_file *lex;
+ fs_file_t *in = fs_file_open(file, "rb");
if (!in) {
lexerror(NULL, "open failed: '%s'\n", file);
} frame_macro;
typedef struct lex_file_s {
- FILE *file;
+ fs_file_t *file;
const char *open_string;
size_t open_string_length;
size_t open_string_pos;
}
/* returns the line number, or -1 on error */
-static bool progs_nextline(char **out, size_t *alen,FILE *src) {
+static bool progs_nextline(char **out, size_t *alen, fs_file_t *src) {
int len;
char *line;
char *start;
bool opts_output_free = false;
bool operators_free = false;
bool progs_src = false;
- FILE *outfile = NULL;
+ fs_file_t *outfile = NULL;
struct parser_s *parser = NULL;
struct ftepp_s *ftepp = NULL;
}
if (!vec_size(items)) {
- FILE *src;
- char *line = NULL;
- size_t linelen = 0;
- bool hasline = false;
+ fs_file_t *src;
+ char *line = NULL;
+ size_t linelen = 0;
+ bool hasline = false;
progs_src = true;
return fwrite(ptr, size, count, stream);
}
+int platform_fflush(FILE *stream) {
+ return fflush(stream);
+}
+
int platform_vfprintf(FILE *stream, const char *format, va_list arg) {
return vfprintf_s(stream, format, arg);
}
}
static size_t opts_ini_parse (
- FILE *filehandle,
+ fs_file_t *filehandle,
char *(*loadhandle)(const char *, const char *, const char *),
char **errorhandle
) {
*/
char *error = NULL;
size_t line;
- FILE *ini;
+ fs_file_t *ini;
if (!file) {
/* try ini */
typedef struct {
pak_directory_t *directories;
pak_header_t header;
- FILE *handle;
+ fs_file_t *handle;
bool insert;
} pak_file_t;
pak_directory_t *dir = NULL;
unsigned char *dat = NULL;
char *local = NULL;
- FILE *out = NULL;
+ fs_file_t *out = NULL;
if (!pak_exists(pak, file, &dir)) {
return false;
pak_directory_t dir;
unsigned char *dat;
long len;
- FILE *fp;
+ fs_file_t *fp;
/*
* We don't allow insertion on files that already exist within the
#include <time.h>
#include <stdio.h>
-#ifndef _MSC_VER
+#ifdef _WIN32
+# undef STDERR_FILENO
+# undef STDOUT_FILENO
+# define STDERR_FILENO 2
+# define STDOUT_FILENO 1
+
+# ifndef __MINGW32__
+# define _WIN32_LEAN_AND_MEAN
+# include <windows.h>
+# include <io.h>
+# include <fcntl.h>
+
+ struct dirent {
+ long d_ino;
+ unsigned short d_reclen;
+ unsigned short d_namlen;
+ char d_name[FILENAME_MAX];
+ };
+
+ typedef struct {
+ struct _finddata_t dd_dta;
+ struct dirent dd_dir;
+ long dd_handle;
+ int dd_stat;
+ char dd_name[1];
+ } DIR;
+
+# ifdef S_ISDIR
+# undef S_ISDIR
+# endif /*! S_ISDIR */
+# define S_ISDIR(X) ((X)&_S_IFDIR)
+# else
+# include <dirent.h>
+# endif /*!__MINGW32__*/
+#else
# include <sys/types.h>
# include <sys/stat.h>
+# include <unistd.h>
# include <dirent.h>
-#endif
+#endif /*!_WIN32*/
int platform_vsnprintf(char *buffer, size_t bytes, const char *format, va_list arg);
int platform_sscanf(const char *str, const char *format, ...);
FILE *platform_fopen(const char *filename, const char *mode);
size_t platform_fread(void *ptr, size_t size, size_t count, FILE *stream);
size_t platform_fwrite(const void *ptr, size_t size, size_t count, FILE *stream);
+int platform_fflush(FILE *stream);
int platform_vfprintf(FILE *stream, const char *format, va_list arg);
int platform_fclose(FILE *stream);
int platform_ferror(FILE *stream);
#include <dirent.h>
#include <unistd.h>
typedef struct {
- FILE *handles[3];
- int pipes [3];
+ fs_file_t *handles[3];
+ int pipes [3];
int stderr_fd;
int stdout_fd;
int pid;
} popen_t;
-static FILE ** task_popen(const char *command, const char *mode) {
+static fs_file_t **task_popen(const char *command, const char *mode) {
int inhandle [2];
int outhandle [2];
int errhandle [2];
data->pipes [1] = outhandle[0];
data->pipes [2] = errhandle[0];
- data->handles[0] = fdopen(inhandle [1], "w");
- data->handles[1] = fdopen(outhandle[0], mode);
- data->handles[2] = fdopen(errhandle[0], mode);
+ data->handles[0] = (fs_file_t*)fdopen(inhandle [1], "w");
+ data->handles[1] = (fs_file_t*)fdopen(outhandle[0], mode);
+ data->handles[2] = (fs_file_t*)fdopen(errhandle[0], mode);
/* sigh */
vec_free(argv);
return NULL;
}
-static int task_pclose(FILE **handles) {
+static int task_pclose(fs_file_t **handles) {
popen_t *data = (popen_t*)handles;
int status = 0;
}
#else
typedef struct {
- FILE *handles[3];
- char name_err[L_tmpnam];
- char name_out[L_tmpnam];
+ fs_file_t *handles[3];
+ char name_err[L_tmpnam];
+ char name_out[L_tmpnam];
} popen_t;
- static FILE **task_popen(const char *command, const char *mode) {
+ static fs_file_t **task_popen(const char *command, const char *mode) {
char *cmd = NULL;
popen_t *open = (popen_t*)mem_a(sizeof(popen_t));
return open->handles;
}
- static int task_pclose(FILE **files) {
+ static int task_pclose(fs_file_t **files) {
popen_t *open = ((popen_t*)files);
+
fs_file_close(files[1]);
fs_file_close(files[2]);
+
remove(open->name_err);
remove(open->name_out);
return true;
}
-static bool task_template_parse(const char *file, task_template_t *tmpl, FILE *fp, size_t *pad) {
+static bool task_template_parse(const char *file, task_template_t *tmpl, fs_file_t *fp, size_t *pad) {
char *data = NULL;
char *back = NULL;
size_t size = 0;
/* a page should be enough */
char fullfile[4096];
size_t filepadd = 0;
- FILE *tempfile = NULL;
+ fs_file_t *tempfile = NULL;
task_template_t *tmpl = NULL;
platform_snprintf(fullfile, sizeof(fullfile), "%s/%s", dir, file);
*/
typedef struct {
task_template_t *tmpl;
- FILE **runhandles;
- FILE *stderrlog;
- FILE *stdoutlog;
+ fs_file_t **runhandles;
+ fs_file_t *stderrlog;
+ fs_file_t *stdoutlog;
char *stdoutlogfile;
char *stderrlogfile;
bool compiled;
*/
static bool task_propagate(const char *curdir, size_t *pad, const char *defs) {
bool success = true;
- DIR *dir;
- struct dirent *files;
+ fs_dir_t *dir;
+ fs_dirent_t *files;
struct stat directory;
char buffer[4096];
size_t found = 0;
* left behind from a previous invoke of the test-suite.
*/
static void task_precleanup(const char *curdir) {
- DIR *dir;
- struct dirent *files;
- char buffer[4096];
+ fs_dir_t *dir;
+ fs_dirent_t *files;
+ char buffer[4096];
dir = fs_dir_open(curdir);
bool success = true;
bool process = true;
int retval = EXIT_SUCCESS;
- FILE *execute;
+ fs_file_t *execute;
char buffer[4096];
task_template_t *tmpl = task_tasks[i].tmpl;
);
}
- execute = popen(buffer, "r");
+ execute = (fs_file_t*)popen(buffer, "r");
if (!execute)
return false;
} else if (!strcmp(tmpl->proceduretype, "-pp")) {
if (!process)
fs_file_close(execute);
else
- pclose(execute);
+ pclose((FILE*)execute);
return false;
}
}
if (process)
- retval = pclose(execute);
+ retval = pclose((FILE*)execute);
else
fs_file_close(execute);
}
fs_file_puts (task_tasks[i].stderrlog, data);
- fflush(task_tasks[i].stderrlog); /* fast flush for read */
+ fs_file_flush(task_tasks[i].stderrlog); /* fast flush for read */
}
if (!task_tasks[i].compiled && strcmp(task_tasks[i].tmpl->proceduretype, "-fail")) {