2012-09-20 11:51:34 +08:00
|
|
|
/**
|
|
|
|
* xrdp: A Remote Desktop Protocol server.
|
|
|
|
*
|
|
|
|
* Copyright (C) Jay Sorg 2004-2012
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*
|
|
|
|
* generic operating system calls
|
|
|
|
*/
|
2005-01-07 08:56:38 +08:00
|
|
|
|
2005-06-28 11:04:36 +08:00
|
|
|
#if !defined(OS_CALLS_H)
|
|
|
|
#define OS_CALLS_H
|
|
|
|
|
2010-11-03 23:59:26 +08:00
|
|
|
#ifndef NULL
|
|
|
|
#define NULL 0
|
|
|
|
#endif
|
|
|
|
|
2006-12-12 14:34:17 +08:00
|
|
|
#include "arch.h"
|
|
|
|
|
2012-02-15 05:45:24 +08:00
|
|
|
int APP_CC
|
|
|
|
g_rm_temp_dir(void);
|
|
|
|
int APP_CC
|
|
|
|
g_mk_temp_dir(const char* app_name);
|
2007-09-15 13:48:13 +08:00
|
|
|
void APP_CC
|
2012-02-06 15:26:15 +08:00
|
|
|
g_init(const char* app_name);
|
2007-09-15 13:48:13 +08:00
|
|
|
void APP_CC
|
|
|
|
g_deinit(void);
|
2006-12-12 14:34:17 +08:00
|
|
|
void* APP_CC
|
2005-07-10 08:25:31 +08:00
|
|
|
g_malloc(int size, int zero);
|
2006-12-12 14:34:17 +08:00
|
|
|
void APP_CC
|
2005-07-10 08:25:31 +08:00
|
|
|
g_free(void* ptr);
|
2006-12-12 14:34:17 +08:00
|
|
|
void DEFAULT_CC
|
2006-11-05 06:05:06 +08:00
|
|
|
g_printf(const char *format, ...);
|
2006-12-12 14:34:17 +08:00
|
|
|
void DEFAULT_CC
|
2006-11-05 06:05:06 +08:00
|
|
|
g_sprintf(char* dest, const char* format, ...);
|
2006-12-12 14:34:17 +08:00
|
|
|
void DEFAULT_CC
|
2007-01-28 01:46:50 +08:00
|
|
|
g_snprintf(char* dest, int len, const char* format, ...);
|
|
|
|
void DEFAULT_CC
|
2006-11-05 06:05:06 +08:00
|
|
|
g_writeln(const char* format, ...);
|
2006-12-12 14:34:17 +08:00
|
|
|
void DEFAULT_CC
|
2006-11-05 06:05:06 +08:00
|
|
|
g_write(const char* format, ...);
|
2006-12-12 14:34:17 +08:00
|
|
|
void APP_CC
|
2005-06-28 11:04:36 +08:00
|
|
|
g_hexdump(char* p, int len);
|
2006-12-12 14:34:17 +08:00
|
|
|
void APP_CC
|
2005-06-28 11:04:36 +08:00
|
|
|
g_memset(void* ptr, int val, int size);
|
2006-12-12 14:34:17 +08:00
|
|
|
void APP_CC
|
2005-06-28 11:04:36 +08:00
|
|
|
g_memcpy(void* d_ptr, const void* s_ptr, int size);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2005-06-28 11:04:36 +08:00
|
|
|
g_getchar(void);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2005-06-28 11:04:36 +08:00
|
|
|
g_tcp_set_no_delay(int sck);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2012-06-04 16:11:11 +08:00
|
|
|
g_tcp_set_keepalive(int sck);
|
|
|
|
int APP_CC
|
2005-06-28 11:04:36 +08:00
|
|
|
g_tcp_socket(void);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2005-06-28 11:04:36 +08:00
|
|
|
g_tcp_local_socket(void);
|
2006-12-12 14:34:17 +08:00
|
|
|
void APP_CC
|
2005-06-28 11:04:36 +08:00
|
|
|
g_tcp_close(int sck);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2006-11-05 06:05:06 +08:00
|
|
|
g_tcp_connect(int sck, const char* address, const char* port);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2009-09-05 11:29:43 +08:00
|
|
|
g_tcp_local_connect(int sck, const char* port);
|
|
|
|
int APP_CC
|
2005-07-10 08:25:31 +08:00
|
|
|
g_tcp_force_send(int sck, char* data, int len);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2005-07-10 08:25:31 +08:00
|
|
|
g_tcp_force_recv(int sck, char* data, int len);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2005-07-10 08:25:31 +08:00
|
|
|
g_tcp_set_non_blocking(int sck);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2005-07-10 08:25:31 +08:00
|
|
|
g_tcp_bind(int sck, char* port);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2005-07-10 08:25:31 +08:00
|
|
|
g_tcp_local_bind(int sck, char* port);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2010-10-20 12:23:13 +08:00
|
|
|
g_tcp_bind_address(int sck, char* port, const char* address);
|
|
|
|
int APP_CC
|
2005-07-10 08:25:31 +08:00
|
|
|
g_tcp_listen(int sck);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2005-07-10 08:25:31 +08:00
|
|
|
g_tcp_accept(int sck);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2005-07-10 08:25:31 +08:00
|
|
|
g_tcp_recv(int sck, void* ptr, int len, int flags);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2006-11-05 06:05:06 +08:00
|
|
|
g_tcp_send(int sck, const void* ptr, int len, int flags);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2005-07-10 08:25:31 +08:00
|
|
|
g_tcp_last_error_would_block(int sck);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2007-04-11 11:44:46 +08:00
|
|
|
g_tcp_socket_ok(int sck);
|
|
|
|
int APP_CC
|
2006-12-10 04:53:48 +08:00
|
|
|
g_tcp_can_send(int sck, int millis);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2006-12-10 04:53:48 +08:00
|
|
|
g_tcp_can_recv(int sck, int millis);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2005-07-10 08:25:31 +08:00
|
|
|
g_tcp_select(int sck1, int sck2);
|
2006-12-12 14:34:17 +08:00
|
|
|
void APP_CC
|
2012-05-27 08:24:04 +08:00
|
|
|
g_write_ip_address(int rcv_sck, char* ip_address, int bytes);
|
2010-11-04 19:14:03 +08:00
|
|
|
void APP_CC
|
2005-07-10 08:25:31 +08:00
|
|
|
g_sleep(int msecs);
|
2008-03-31 19:07:55 +08:00
|
|
|
tbus APP_CC
|
|
|
|
g_create_wait_obj(char* name);
|
|
|
|
tbus APP_CC
|
|
|
|
g_create_wait_obj_from_socket(tbus socket, int write);
|
2008-04-04 14:50:39 +08:00
|
|
|
void APP_CC
|
|
|
|
g_delete_wait_obj_from_socket(tbus wait_obj);
|
2008-03-31 19:07:55 +08:00
|
|
|
int APP_CC
|
|
|
|
g_set_wait_obj(tbus obj);
|
|
|
|
int APP_CC
|
|
|
|
g_reset_wait_obj(tbus obj);
|
|
|
|
int APP_CC
|
|
|
|
g_is_wait_obj_set(tbus obj);
|
|
|
|
int APP_CC
|
2008-04-04 14:50:39 +08:00
|
|
|
g_delete_wait_obj(tbus obj);
|
2008-03-31 19:07:55 +08:00
|
|
|
int APP_CC
|
2012-05-27 08:24:04 +08:00
|
|
|
g_close_wait_obj(tbus obj);
|
|
|
|
int APP_CC
|
2008-03-31 19:07:55 +08:00
|
|
|
g_obj_wait(tbus* read_objs, int rcount, tbus* write_objs, int wcount,
|
|
|
|
int mstimeout);
|
2006-12-12 14:34:17 +08:00
|
|
|
void APP_CC
|
2005-07-10 08:25:31 +08:00
|
|
|
g_random(char* data, int len);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2005-07-10 08:25:31 +08:00
|
|
|
g_abs(int i);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2006-11-05 06:05:06 +08:00
|
|
|
g_memcmp(const void* s1, const void* s2, int len);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2006-11-05 06:05:06 +08:00
|
|
|
g_file_open(const char* file_name);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2012-10-14 13:48:05 +08:00
|
|
|
g_file_open_ex(const char *file_name, int aread, int awrite,
|
|
|
|
int acreate, int atrunc);
|
|
|
|
int APP_CC
|
2005-07-10 08:25:31 +08:00
|
|
|
g_file_close(int fd);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2005-07-10 08:25:31 +08:00
|
|
|
g_file_read(int fd, char* ptr, int len);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2005-07-10 08:25:31 +08:00
|
|
|
g_file_write(int fd, char* ptr, int len);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2005-07-10 08:25:31 +08:00
|
|
|
g_file_seek(int fd, int offset);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2005-07-10 08:25:31 +08:00
|
|
|
g_file_lock(int fd, int start, int len);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2006-11-05 06:05:06 +08:00
|
|
|
g_chmod_hex(const char* filename, int flags);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2011-07-08 00:09:03 +08:00
|
|
|
g_chown(const char* name, int uid, int gid);
|
|
|
|
int APP_CC
|
2006-11-05 06:05:06 +08:00
|
|
|
g_mkdir(const char* dirname);
|
2006-12-12 14:34:17 +08:00
|
|
|
char* APP_CC
|
2005-07-10 08:25:31 +08:00
|
|
|
g_get_current_dir(char* dirname, int maxlen);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2005-07-10 08:25:31 +08:00
|
|
|
g_set_current_dir(char* dirname);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2006-11-05 06:05:06 +08:00
|
|
|
g_file_exist(const char* filename);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2006-11-05 06:05:06 +08:00
|
|
|
g_directory_exist(const char* dirname);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2006-11-05 06:05:06 +08:00
|
|
|
g_create_dir(const char* dirname);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2012-05-27 12:20:19 +08:00
|
|
|
g_create_path(const char* path);
|
|
|
|
int APP_CC
|
2006-11-05 06:05:06 +08:00
|
|
|
g_remove_dir(const char* dirname);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2006-11-05 06:05:06 +08:00
|
|
|
g_file_delete(const char* filename);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2007-09-26 15:14:22 +08:00
|
|
|
g_file_get_size(const char* filename);
|
|
|
|
int APP_CC
|
2006-11-05 06:05:06 +08:00
|
|
|
g_strlen(const char* text);
|
2006-12-12 14:34:17 +08:00
|
|
|
char* APP_CC
|
2006-11-05 06:05:06 +08:00
|
|
|
g_strcpy(char* dest, const char* src);
|
2006-12-12 14:34:17 +08:00
|
|
|
char* APP_CC
|
2006-11-05 06:05:06 +08:00
|
|
|
g_strncpy(char* dest, const char* src, int len);
|
2006-12-12 14:34:17 +08:00
|
|
|
char* APP_CC
|
2006-11-05 06:05:06 +08:00
|
|
|
g_strcat(char* dest, const char* src);
|
2006-12-12 14:34:17 +08:00
|
|
|
char* APP_CC
|
2006-11-05 06:05:06 +08:00
|
|
|
g_strdup(const char* in);
|
2012-05-30 13:40:06 +08:00
|
|
|
char* APP_CC
|
|
|
|
g_strndup(const char* in, const unsigned int maxlen);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2006-11-05 06:05:06 +08:00
|
|
|
g_strcmp(const char* c1, const char* c2);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2006-11-05 06:05:06 +08:00
|
|
|
g_strncmp(const char* c1, const char* c2, int len);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2006-11-05 06:05:06 +08:00
|
|
|
g_strcasecmp(const char* c1, const char* c2);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2006-11-05 06:05:06 +08:00
|
|
|
g_strncasecmp(const char* c1, const char* c2, int len);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2010-08-10 06:52:26 +08:00
|
|
|
g_atoi(const char* str);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2007-10-15 11:47:26 +08:00
|
|
|
g_htoi(char* str);
|
|
|
|
int APP_CC
|
2006-11-05 06:05:06 +08:00
|
|
|
g_pos(char* str, const char* to_find);
|
2007-09-21 15:22:29 +08:00
|
|
|
int APP_CC
|
|
|
|
g_mbstowcs(twchar* dest, const char* src, int n);
|
|
|
|
int APP_CC
|
|
|
|
g_wcstombs(char* dest, const twchar* src, int n);
|
2007-10-27 13:53:19 +08:00
|
|
|
int APP_CC
|
|
|
|
g_strtrim(char* str, int trim_flags);
|
2006-12-12 14:34:17 +08:00
|
|
|
long APP_CC
|
2005-07-10 08:25:31 +08:00
|
|
|
g_load_library(char* in);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2005-07-10 08:25:31 +08:00
|
|
|
g_free_library(long lib);
|
2006-12-12 14:34:17 +08:00
|
|
|
void* APP_CC
|
2006-11-05 06:05:06 +08:00
|
|
|
g_get_proc_address(long lib, const char* name);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2005-07-10 08:25:31 +08:00
|
|
|
g_system(char* aexec);
|
2006-12-12 14:34:17 +08:00
|
|
|
char* APP_CC
|
2006-04-24 05:30:02 +08:00
|
|
|
g_get_strerror(void);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2009-04-20 12:31:24 +08:00
|
|
|
g_get_errno(void);
|
|
|
|
int APP_CC
|
2006-11-05 06:05:06 +08:00
|
|
|
g_execvp(const char* p1, char* args[]);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2006-11-05 06:05:06 +08:00
|
|
|
g_execlp3(const char* a1, const char* a2, const char* a3);
|
2006-12-12 14:34:17 +08:00
|
|
|
void APP_CC
|
2005-07-11 08:41:07 +08:00
|
|
|
g_signal_child_stop(void (*func)(int));
|
2008-12-30 15:38:56 +08:00
|
|
|
void APP_CC
|
|
|
|
g_signal_hang_up(void (*func)(int));
|
|
|
|
void APP_CC
|
|
|
|
g_signal_user_interrupt(void (*func)(int));
|
|
|
|
void APP_CC
|
|
|
|
g_signal_kill(void (*func)(int));
|
|
|
|
void APP_CC
|
|
|
|
g_signal_terminate(void (*func)(int));
|
|
|
|
void APP_CC
|
|
|
|
g_signal_pipe(void (*func)(int));
|
2012-02-13 14:27:51 +08:00
|
|
|
void APP_CC
|
|
|
|
g_signal_usr1(void (*func)(int));
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2005-07-10 08:25:31 +08:00
|
|
|
g_fork(void);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2005-07-10 08:25:31 +08:00
|
|
|
g_setgid(int pid);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2006-07-01 22:25:12 +08:00
|
|
|
g_initgroups(const char* user, int gid);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2008-05-08 09:39:54 +08:00
|
|
|
g_getuid(void);
|
|
|
|
int APP_CC
|
2012-10-30 11:30:48 +08:00
|
|
|
g_getgid(void);
|
|
|
|
int APP_CC
|
2005-07-10 08:25:31 +08:00
|
|
|
g_setuid(int pid);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2005-07-10 08:25:31 +08:00
|
|
|
g_waitchild(void);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2005-07-10 08:25:31 +08:00
|
|
|
g_waitpid(int pid);
|
2006-12-12 14:34:17 +08:00
|
|
|
void APP_CC
|
2005-07-10 08:25:31 +08:00
|
|
|
g_clearenv(void);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2006-11-05 06:05:06 +08:00
|
|
|
g_setenv(const char* name, const char* value, int rewrite);
|
2006-12-12 14:34:17 +08:00
|
|
|
char* APP_CC
|
2006-11-05 06:05:06 +08:00
|
|
|
g_getenv(const char* name);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2005-07-10 08:25:31 +08:00
|
|
|
g_exit(int exit_code);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2005-07-10 08:25:31 +08:00
|
|
|
g_getpid(void);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2005-07-10 08:25:31 +08:00
|
|
|
g_sigterm(int pid);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2006-11-05 06:05:06 +08:00
|
|
|
g_getuser_info(const char* username, int* gid, int* uid, char* shell,
|
|
|
|
char* dir, char* gecos);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2006-11-05 06:05:06 +08:00
|
|
|
g_getgroup_info(const char* groupname, int* gid);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2006-11-05 06:05:06 +08:00
|
|
|
g_check_user_in_group(const char* username, int gid, int* ok);
|
2006-12-12 14:34:17 +08:00
|
|
|
int APP_CC
|
2005-12-10 10:26:26 +08:00
|
|
|
g_time1(void);
|
2007-10-04 06:24:29 +08:00
|
|
|
int APP_CC
|
|
|
|
g_time2(void);
|
2009-08-15 10:49:13 +08:00
|
|
|
int APP_CC
|
|
|
|
g_time3(void);
|
2005-06-28 11:04:36 +08:00
|
|
|
|
|
|
|
#endif
|