|
|
@ -57,6 +57,9 @@
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "os_calls.h"
|
|
|
|
|
|
|
|
#include "arch.h"
|
|
|
|
|
|
|
|
|
|
|
|
/* for clearenv() */
|
|
|
|
/* for clearenv() */
|
|
|
|
#if defined(_WIN32)
|
|
|
|
#if defined(_WIN32)
|
|
|
|
#else
|
|
|
|
#else
|
|
|
@ -102,7 +105,7 @@ g_free(void* ptr)
|
|
|
|
/* output text to stdout, try to use g_write / g_writeln instead to avoid
|
|
|
|
/* output text to stdout, try to use g_write / g_writeln instead to avoid
|
|
|
|
linux / windows EOL problems */
|
|
|
|
linux / windows EOL problems */
|
|
|
|
void
|
|
|
|
void
|
|
|
|
g_printf(char* format, ...)
|
|
|
|
g_printf(const char* format, ...)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
va_list ap;
|
|
|
|
va_list ap;
|
|
|
|
|
|
|
|
|
|
|
@ -113,7 +116,7 @@ g_printf(char* format, ...)
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*****************************************************************************/
|
|
|
|
void
|
|
|
|
void
|
|
|
|
g_sprintf(char* dest, char* format, ...)
|
|
|
|
g_sprintf(char* dest, const char* format, ...)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
va_list ap;
|
|
|
|
va_list ap;
|
|
|
|
|
|
|
|
|
|
|
@ -124,7 +127,7 @@ g_sprintf(char* dest, char* format, ...)
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*****************************************************************************/
|
|
|
|
void
|
|
|
|
void
|
|
|
|
g_snprintf(char* dest, int len, char* format, ...)
|
|
|
|
g_snprintf(char* dest, int len, const char* format, ...)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
va_list ap;
|
|
|
|
va_list ap;
|
|
|
|
|
|
|
|
|
|
|
@ -135,7 +138,7 @@ g_snprintf(char* dest, int len, char* format, ...)
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*****************************************************************************/
|
|
|
|
void
|
|
|
|
void
|
|
|
|
g_writeln(char* format, ...)
|
|
|
|
g_writeln(const char* format, ...)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
va_list ap;
|
|
|
|
va_list ap;
|
|
|
|
|
|
|
|
|
|
|
@ -151,7 +154,7 @@ g_writeln(char* format, ...)
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*****************************************************************************/
|
|
|
|
void
|
|
|
|
void
|
|
|
|
g_write(char* format, ...)
|
|
|
|
g_write(const char* format, ...)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
va_list ap;
|
|
|
|
va_list ap;
|
|
|
|
|
|
|
|
|
|
|
@ -289,7 +292,7 @@ g_tcp_close(int sck)
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*****************************************************************************/
|
|
|
|
int
|
|
|
|
int
|
|
|
|
g_tcp_connect(int sck, char* address, char* port)
|
|
|
|
g_tcp_connect(int sck, const char* address, const char* port)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
struct sockaddr_in s;
|
|
|
|
struct sockaddr_in s;
|
|
|
|
struct hostent* h;
|
|
|
|
struct hostent* h;
|
|
|
@ -422,10 +425,10 @@ g_tcp_recv(int sck, void* ptr, int len, int flags)
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*****************************************************************************/
|
|
|
|
int
|
|
|
|
int
|
|
|
|
g_tcp_send(int sck, void* ptr, int len, int flags)
|
|
|
|
g_tcp_send(int sck, const void* ptr, int len, int flags)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#if defined(_WIN32)
|
|
|
|
#if defined(_WIN32)
|
|
|
|
return send(sck, (char*)ptr, len, flags);
|
|
|
|
return send(sck, (const char*)ptr, len, flags);
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
return send(sck, ptr, len, flags);
|
|
|
|
return send(sck, ptr, len, flags);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -508,7 +511,7 @@ g_abs(int i)
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*****************************************************************************/
|
|
|
|
int
|
|
|
|
int
|
|
|
|
g_memcmp(void* s1, void* s2, int len)
|
|
|
|
g_memcmp(const void* s1, const void* s2, int len)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return memcmp(s1, s2, len);
|
|
|
|
return memcmp(s1, s2, len);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -516,7 +519,7 @@ g_memcmp(void* s1, void* s2, int len)
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*****************************************************************************/
|
|
|
|
/* returns -1 on error, else return handle or file descriptor */
|
|
|
|
/* returns -1 on error, else return handle or file descriptor */
|
|
|
|
int
|
|
|
|
int
|
|
|
|
g_file_open(char* file_name)
|
|
|
|
g_file_open(const char* file_name)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#if defined(_WIN32)
|
|
|
|
#if defined(_WIN32)
|
|
|
|
return (int)CreateFile(file_name, GENERIC_READ | GENERIC_WRITE,
|
|
|
|
return (int)CreateFile(file_name, GENERIC_READ | GENERIC_WRITE,
|
|
|
@ -634,7 +637,7 @@ g_file_lock(int fd, int start, int len)
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*****************************************************************************/
|
|
|
|
/* returns error, always zero */
|
|
|
|
/* returns error, always zero */
|
|
|
|
int
|
|
|
|
int
|
|
|
|
g_set_file_rights(char* filename, int read, int write)
|
|
|
|
g_set_file_rights(const char* filename, int read, int write)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#if defined(_WIN32)
|
|
|
|
#if defined(_WIN32)
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
@ -651,7 +654,7 @@ g_set_file_rights(char* filename, int read, int write)
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*****************************************************************************/
|
|
|
|
/* returns error */
|
|
|
|
/* returns error */
|
|
|
|
int
|
|
|
|
int
|
|
|
|
g_chmod_hex(char* filename, int flags)
|
|
|
|
g_chmod_hex(const char* filename, int flags)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#if defined(_WIN32)
|
|
|
|
#if defined(_WIN32)
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
@ -678,7 +681,7 @@ g_chmod_hex(char* filename, int flags)
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*****************************************************************************/
|
|
|
|
/* returns error, always zero */
|
|
|
|
/* returns error, always zero */
|
|
|
|
int
|
|
|
|
int
|
|
|
|
g_mkdir(char* dirname)
|
|
|
|
g_mkdir(const char* dirname)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#if defined(_WIN32)
|
|
|
|
#if defined(_WIN32)
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
@ -726,7 +729,7 @@ g_set_current_dir(char* dirname)
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*****************************************************************************/
|
|
|
|
/* returns boolean, non zero if the file exists */
|
|
|
|
/* returns boolean, non zero if the file exists */
|
|
|
|
int
|
|
|
|
int
|
|
|
|
g_file_exist(char* filename)
|
|
|
|
g_file_exist(const char* filename)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#if defined(_WIN32)
|
|
|
|
#if defined(_WIN32)
|
|
|
|
return 0; // use FileAge(filename) <> -1
|
|
|
|
return 0; // use FileAge(filename) <> -1
|
|
|
@ -738,7 +741,7 @@ g_file_exist(char* filename)
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*****************************************************************************/
|
|
|
|
/* returns boolean, non zero if the directory exists */
|
|
|
|
/* returns boolean, non zero if the directory exists */
|
|
|
|
int
|
|
|
|
int
|
|
|
|
g_directory_exist(char* dirname)
|
|
|
|
g_directory_exist(const char* dirname)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#if defined(_WIN32)
|
|
|
|
#if defined(_WIN32)
|
|
|
|
return 0; // use GetFileAttributes and check return value
|
|
|
|
return 0; // use GetFileAttributes and check return value
|
|
|
@ -760,7 +763,7 @@ g_directory_exist(char* dirname)
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*****************************************************************************/
|
|
|
|
/* returns boolean */
|
|
|
|
/* returns boolean */
|
|
|
|
int
|
|
|
|
int
|
|
|
|
g_create_dir(char* dirname)
|
|
|
|
g_create_dir(const char* dirname)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#if defined(_WIN32)
|
|
|
|
#if defined(_WIN32)
|
|
|
|
return CreateDirectory(dirname, 0); // test this
|
|
|
|
return CreateDirectory(dirname, 0); // test this
|
|
|
@ -772,7 +775,7 @@ g_create_dir(char* dirname)
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*****************************************************************************/
|
|
|
|
/* returns boolean */
|
|
|
|
/* returns boolean */
|
|
|
|
int
|
|
|
|
int
|
|
|
|
g_remove_dir(char* dirname)
|
|
|
|
g_remove_dir(const char* dirname)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#if defined(_WIN32)
|
|
|
|
#if defined(_WIN32)
|
|
|
|
return RemoveDirectory(dirname); // test this
|
|
|
|
return RemoveDirectory(dirname); // test this
|
|
|
@ -784,7 +787,7 @@ g_remove_dir(char* dirname)
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*****************************************************************************/
|
|
|
|
/* returns non zero if the file was deleted */
|
|
|
|
/* returns non zero if the file was deleted */
|
|
|
|
int
|
|
|
|
int
|
|
|
|
g_file_delete(char* filename)
|
|
|
|
g_file_delete(const char* filename)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#if defined(_WIN32)
|
|
|
|
#if defined(_WIN32)
|
|
|
|
return DeleteFile(filename);
|
|
|
|
return DeleteFile(filename);
|
|
|
@ -796,7 +799,7 @@ g_file_delete(char* filename)
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*****************************************************************************/
|
|
|
|
/* returns length of text */
|
|
|
|
/* returns length of text */
|
|
|
|
int
|
|
|
|
int
|
|
|
|
g_strlen(char* text)
|
|
|
|
g_strlen(const char* text)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (text == 0)
|
|
|
|
if (text == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -808,7 +811,7 @@ g_strlen(char* text)
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*****************************************************************************/
|
|
|
|
/* returns dest */
|
|
|
|
/* returns dest */
|
|
|
|
char*
|
|
|
|
char*
|
|
|
|
g_strcpy(char* dest, char* src)
|
|
|
|
g_strcpy(char* dest, const char* src)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (src == 0 && dest != 0)
|
|
|
|
if (src == 0 && dest != 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -825,7 +828,7 @@ g_strcpy(char* dest, char* src)
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*****************************************************************************/
|
|
|
|
/* returns dest */
|
|
|
|
/* returns dest */
|
|
|
|
char*
|
|
|
|
char*
|
|
|
|
g_strncpy(char* dest, char* src, int len)
|
|
|
|
g_strncpy(char* dest, const char* src, int len)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
char* rv;
|
|
|
|
char* rv;
|
|
|
|
|
|
|
|
|
|
|
@ -846,7 +849,7 @@ g_strncpy(char* dest, char* src, int len)
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*****************************************************************************/
|
|
|
|
/* returns dest */
|
|
|
|
/* returns dest */
|
|
|
|
char*
|
|
|
|
char*
|
|
|
|
g_strcat(char* dest, char* src)
|
|
|
|
g_strcat(char* dest, const char* src)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (dest == 0 || src == 0)
|
|
|
|
if (dest == 0 || src == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -858,7 +861,7 @@ g_strcat(char* dest, char* src)
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*****************************************************************************/
|
|
|
|
/* if in = 0, return 0 else return newly alloced copy of in */
|
|
|
|
/* if in = 0, return 0 else return newly alloced copy of in */
|
|
|
|
char*
|
|
|
|
char*
|
|
|
|
g_strdup(char* in)
|
|
|
|
g_strdup(const char* in)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int len;
|
|
|
|
int len;
|
|
|
|
char* p;
|
|
|
|
char* p;
|
|
|
@ -875,21 +878,21 @@ g_strdup(char* in)
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*****************************************************************************/
|
|
|
|
int
|
|
|
|
int
|
|
|
|
g_strcmp(char* c1, char* c2)
|
|
|
|
g_strcmp(const char* c1, const char* c2)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return strcmp(c1, c2);
|
|
|
|
return strcmp(c1, c2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*****************************************************************************/
|
|
|
|
int
|
|
|
|
int
|
|
|
|
g_strncmp(char* c1, char* c2, int len)
|
|
|
|
g_strncmp(const char* c1, const char* c2, int len)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return strncmp(c1, c2, len);
|
|
|
|
return strncmp(c1, c2, len);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*****************************************************************************/
|
|
|
|
int
|
|
|
|
int
|
|
|
|
g_strcasecmp(char* c1, char* c2)
|
|
|
|
g_strcasecmp(const char* c1, const char* c2)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#if defined(_WIN32)
|
|
|
|
#if defined(_WIN32)
|
|
|
|
return stricmp(c1, c2);
|
|
|
|
return stricmp(c1, c2);
|
|
|
@ -900,7 +903,7 @@ g_strcasecmp(char* c1, char* c2)
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*****************************************************************************/
|
|
|
|
int
|
|
|
|
int
|
|
|
|
g_strncasecmp(char* c1, char* c2, int len)
|
|
|
|
g_strncasecmp(const char* c1, const char* c2, int len)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#if defined(_WIN32)
|
|
|
|
#if defined(_WIN32)
|
|
|
|
return strnicmp(c1, c2, len);
|
|
|
|
return strnicmp(c1, c2, len);
|
|
|
@ -918,7 +921,7 @@ g_atoi(char* str)
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*****************************************************************************/
|
|
|
|
int
|
|
|
|
int
|
|
|
|
g_pos(char* str, char* to_find)
|
|
|
|
g_pos(char* str, const char* to_find)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
char* pp;
|
|
|
|
char* pp;
|
|
|
|
|
|
|
|
|
|
|
@ -959,7 +962,7 @@ g_free_library(long lib)
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*****************************************************************************/
|
|
|
|
/* returns NULL if not found */
|
|
|
|
/* returns NULL if not found */
|
|
|
|
void*
|
|
|
|
void*
|
|
|
|
g_get_proc_address(long lib, char* name)
|
|
|
|
g_get_proc_address(long lib, const char* name)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (lib == 0)
|
|
|
|
if (lib == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -996,7 +999,7 @@ g_get_strerror(void)
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*****************************************************************************/
|
|
|
|
int
|
|
|
|
int
|
|
|
|
g_execvp(char* p1, char* args[])
|
|
|
|
g_execvp(const char* p1, char* args[])
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#if defined(_WIN32)
|
|
|
|
#if defined(_WIN32)
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
@ -1005,41 +1008,9 @@ g_execvp(char* p1, char* args[])
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
/* takes up to 30 parameters */
|
|
|
|
|
|
|
|
int
|
|
|
|
|
|
|
|
g_execlp(int num_params, char* param1, ...)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
#if defined(_WIN32)
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
va_list ap;
|
|
|
|
|
|
|
|
char* p[32];
|
|
|
|
|
|
|
|
int index;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (num_params > 30)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
memset(p, 0, sizeof(p));
|
|
|
|
|
|
|
|
p[0] = param1;
|
|
|
|
|
|
|
|
va_start(ap, param1);
|
|
|
|
|
|
|
|
for (index = 1; index < num_params; index++)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
p[index] = va_arg(ap, char*);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
va_end(ap);
|
|
|
|
|
|
|
|
return execlp(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7],
|
|
|
|
|
|
|
|
p[8], p[9], p[10], p[11], p[12], p[13], p[14], p[15],
|
|
|
|
|
|
|
|
p[16], p[17], p[18], p[19], p[20], p[21], p[22], p[23],
|
|
|
|
|
|
|
|
p[24], p[25], p[26], p[27], p[28], p[29], p[30], p[31],
|
|
|
|
|
|
|
|
(void*)0);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*****************************************************************************/
|
|
|
|
int
|
|
|
|
int
|
|
|
|
g_execlp3(char* a1, char* a2, char* a3)
|
|
|
|
g_execlp3(const char* a1, const char* a2, const char* a3)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#if defined(_WIN32)
|
|
|
|
#if defined(_WIN32)
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
@ -1048,32 +1019,6 @@ g_execlp3(char* a1, char* a2, char* a3)
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
int
|
|
|
|
|
|
|
|
g_execlp11(char* a1, char* a2, char* a3, char* a4, char* a5, char* a6,
|
|
|
|
|
|
|
|
char* a7, char* a8, char* a9, char* a10, char* a11)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
#if defined(_WIN32)
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
return execlp(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, (void*)0);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
int
|
|
|
|
|
|
|
|
g_execlp13(char* a1, char* a2, char* a3, char* a4, char* a5, char* a6,
|
|
|
|
|
|
|
|
char* a7, char* a8, char* a9, char* a10, char* a11,
|
|
|
|
|
|
|
|
char* a12, char* a13)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
#if defined(_WIN32)
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
return execlp(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11,
|
|
|
|
|
|
|
|
a12, a13, (void*)0);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*****************************************************************************/
|
|
|
|
void
|
|
|
|
void
|
|
|
|
g_signal(int sig_num, void (*func)(int))
|
|
|
|
g_signal(int sig_num, void (*func)(int))
|
|
|
@ -1188,7 +1133,7 @@ g_clearenv(void)
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*****************************************************************************/
|
|
|
|
int
|
|
|
|
int
|
|
|
|
g_setenv(char* name, char* value, int rewrite)
|
|
|
|
g_setenv(const char* name, const char* value, int rewrite)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#if defined(_WIN32)
|
|
|
|
#if defined(_WIN32)
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
@ -1199,7 +1144,7 @@ g_setenv(char* name, char* value, int rewrite)
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*****************************************************************************/
|
|
|
|
char*
|
|
|
|
char*
|
|
|
|
g_getenv(char* name)
|
|
|
|
g_getenv(const char* name)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#if defined(_WIN32)
|
|
|
|
#if defined(_WIN32)
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
@ -1241,8 +1186,8 @@ g_sigterm(int pid)
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*****************************************************************************/
|
|
|
|
/* returns 0 if ok */
|
|
|
|
/* returns 0 if ok */
|
|
|
|
int
|
|
|
|
int
|
|
|
|
g_getuser_info(char* username, int* gid, int* uid, char* shell, char* dir,
|
|
|
|
g_getuser_info(const char* username, int* gid, int* uid, char* shell,
|
|
|
|
char* gecos)
|
|
|
|
char* dir, char* gecos)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#if defined(_WIN32)
|
|
|
|
#if defined(_WIN32)
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
@ -1281,7 +1226,7 @@ g_getuser_info(char* username, int* gid, int* uid, char* shell, char* dir,
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*****************************************************************************/
|
|
|
|
/* returns 0 if ok */
|
|
|
|
/* returns 0 if ok */
|
|
|
|
int
|
|
|
|
int
|
|
|
|
g_getgroup_info(char* groupname, int* gid)
|
|
|
|
g_getgroup_info(const char* groupname, int* gid)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#if defined(_WIN32)
|
|
|
|
#if defined(_WIN32)
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
@ -1305,7 +1250,7 @@ g_getgroup_info(char* groupname, int* gid)
|
|
|
|
/* returns error */
|
|
|
|
/* returns error */
|
|
|
|
/* if zero is returned, then ok is set */
|
|
|
|
/* if zero is returned, then ok is set */
|
|
|
|
int
|
|
|
|
int
|
|
|
|
g_check_user_in_group(char* username, int gid, int* ok)
|
|
|
|
g_check_user_in_group(const char* username, int gid, int* ok)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#if defined(_WIN32)
|
|
|
|
#if defined(_WIN32)
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|