mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-02-07 15:01:10 +00:00
We're doing it this way.
This commit is contained in:
parent
8d5e719026
commit
0f6c44d671
6 changed files with 2 additions and 34 deletions
4
ansi.c
4
ansi.c
|
@ -48,10 +48,6 @@ char *platform_strncat(char *dest, const char *src, size_t num) {
|
||||||
return strncat(dest, src, num);
|
return strncat(dest, src, num);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *platform_tmpnam(char *str) {
|
|
||||||
return tmpnam(str);
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *platform_getenv(const char *var) {
|
const char *platform_getenv(const char *var) {
|
||||||
return getenv(var);
|
return getenv(var);
|
||||||
}
|
}
|
||||||
|
|
1
gmqcc.h
1
gmqcc.h
|
@ -315,7 +315,6 @@ const char *util_ctime (const time_t *timer);
|
||||||
typedef struct fs_file_s fs_file_t;
|
typedef struct fs_file_s fs_file_t;
|
||||||
|
|
||||||
bool util_isatty(fs_file_t *);
|
bool util_isatty(fs_file_t *);
|
||||||
const char *util_tmpnam(char *);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A flexible vector implementation: all vector pointers contain some
|
* A flexible vector implementation: all vector pointers contain some
|
||||||
|
|
4
msvc.c
4
msvc.c
|
@ -76,10 +76,6 @@ char *platform_strncat(char *dest, const char *src, size_t num) {
|
||||||
return strncat_s(dest, num, src, _TRUNCATE);
|
return strncat_s(dest, num, src, _TRUNCATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *platform_tmpnam(char *str) {
|
|
||||||
return tmpnam_s(str, L_tmpnam);
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *platform_getenv(const char *var) {
|
const char *platform_getenv(const char *var) {
|
||||||
char *buffer = (char *)platform_mem_allocate(GETENV_BUFFER);
|
char *buffer = (char *)platform_mem_allocate(GETENV_BUFFER);
|
||||||
size_t size;
|
size_t size;
|
||||||
|
|
18
platform.h
18
platform.h
|
@ -185,24 +185,6 @@ const char *platform_ctime(const time_t *timer);
|
||||||
*/
|
*/
|
||||||
char *platform_strncat(char *dest, const char *src, size_t num);
|
char *platform_strncat(char *dest, const char *src, size_t num);
|
||||||
|
|
||||||
/*
|
|
||||||
* Function: platform_tmpnam
|
|
||||||
* Generates names you can use to create temporary files.
|
|
||||||
*
|
|
||||||
* Parameters:
|
|
||||||
* str - Pointer that will hold the generated name and will be identical
|
|
||||||
* to the name returned by the function. This is a convenient way
|
|
||||||
* to save the generated name.
|
|
||||||
*
|
|
||||||
* Returns:
|
|
||||||
* Pointer to the name generate or *NULL* if there is a failure. Failure
|
|
||||||
* can occur if you attempt more than TMP_MAX calls.
|
|
||||||
*
|
|
||||||
* Remarks:
|
|
||||||
* Returns a name unique in the current workign directory.
|
|
||||||
*/
|
|
||||||
const char *platform_tmpnam(char *str);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Function: platform_getenv
|
* Function: platform_getenv
|
||||||
* Get a value from the current enviroment.
|
* Get a value from the current enviroment.
|
||||||
|
|
4
test.c
4
test.c
|
@ -163,8 +163,8 @@ static int task_pclose(fs_file_t **handles) {
|
||||||
char *cmd = NULL;
|
char *cmd = NULL;
|
||||||
popen_t *open = (popen_t*)mem_a(sizeof(popen_t));
|
popen_t *open = (popen_t*)mem_a(sizeof(popen_t));
|
||||||
|
|
||||||
util_tmpnam(open->name_err);
|
tmpnam(open->name_err);
|
||||||
util_tmpnam(open->name_out);
|
tmpnam(open->name_out);
|
||||||
|
|
||||||
(void)mode; /* excluded */
|
(void)mode; /* excluded */
|
||||||
|
|
||||||
|
|
5
util.c
5
util.c
|
@ -281,11 +281,6 @@ bool util_isatty(fs_file_t *file) {
|
||||||
if (file == (fs_file_t*)stderr) return !!platform_isatty(STDERR_FILENO);
|
if (file == (fs_file_t*)stderr) return !!platform_isatty(STDERR_FILENO);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *util_tmpnam(char *str) {
|
|
||||||
return platform_tmpnam(str);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A small noncryptographic PRNG based on:
|
* A small noncryptographic PRNG based on:
|
||||||
* http://burtleburtle.net/bob/rand/smallprng.html
|
* http://burtleburtle.net/bob/rand/smallprng.html
|
||||||
|
|
Loading…
Reference in a new issue