GPAC
Open Source Multimedia Framework. For more information, check out http://gpac.wp.mines-telecom.fr
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups
os_divers.c File Reference
#include <gpac/tools.h>
#include <gpac/network.h>
#include <time.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <dirent.h>
#include <unistd.h>
#include <sys/times.h>
#include <sys/resource.h>
#include <errno.h>
#include <locale.h>
#include <termios.h>
#include <fcntl.h>
+ Include dependency graph for os_divers.c:

Data Structures

struct  GF_GlobalLock
 
struct  GF_GlobalLock
 

Macros

#define SLEEP_ABS_SELECT   1
 
#define CPF_CLOEXEC   1
 

Functions

u32 gf_sys_clock ()
 System clock query. More...
 
void gf_sleep (u32 ms)
 Sleeps thread/process. More...
 
GF_Err gf_rmdir (char *DirPathName)
 Delete Directory. More...
 
GF_Err gf_mkdir (char *DirPathName)
 Create Directory. More...
 
static Bool delete_dir (void *cbck, char *item_name, char *item_path)
 
GF_Err gf_cleanup_dir (char *DirPathName)
 Create Directory. More...
 
GF_Err gf_delete_file (const char *fileName)
 File Deletion. More...
 
GF_Err gf_move_file (const char *fileName, const char *newFileName)
 File Move. More...
 
void gf_rand_init (Bool Reset)
 PseudoRandom Integer Generation Initialization. More...
 
u32 gf_rand ()
 PseudoRandom Integer Generation. More...
 
u64 gf_file_modification_time (const char *filename)
 File Modification Time. More...
 
FILE * gf_temp_file_new ()
 Temporary File Creation. More...
 
void gf_utc_time_since_1970 (u32 *sec, u32 *msec)
 gets UTC time More...
 
void gf_get_user_name (char *buf, u32 buf_size)
 user name More...
 
GF_Err gf_enum_directory (const char *dir, Bool enum_directory, gf_enum_dir_item enum_dir_fct, void *cbck, const char *filter)
 Directory enumeration. More...
 
char * my_str_upr (char *str)
 
char * my_str_lwr (char *str)
 
u64 gf_f64_tell (FILE *fp)
 large file position query More...
 
u64 gf_f64_seek (FILE *fp, s64 offset, s32 whence)
 large file seeking More...
 
FILE * gf_f64_open (const char *file_name, const char *mode)
 large file opening More...
 
size_t gf_fwrite (const void *ptr, size_t size, size_t nmemb, FILE *stream)
 file writing helper More...
 
static void init_keyboard ()
 
static void close_keyboard (Bool new_line)
 
void gf_prompt_set_echo_off (Bool echo_off)
 turns prompt echo on/off More...
 
Bool gf_prompt_has_input ()
 Prompt checking. More...
 
char gf_prompt_get_char ()
 Prompt character flush. More...
 
void gf_sys_init (Bool enable_memory_tracker)
 System setup. More...
 
void gf_sys_close ()
 System closing. More...
 
Bool gf_sys_get_rti_os (u32 refresh_time_ms, GF_SystemRTInfo *rti, u32 flags)
 
Bool gf_sys_get_rti (u32 refresh_time_ms, GF_SystemRTInfo *rti, u32 flags)
 Gets Run-Time info. More...
 
char * gf_get_default_cache_directory ()
 
Bool gf_sys_get_battery_state (Bool *onBattery, u32 *onCharge, u32 *level, u32 *batteryLifeTime, u32 *batteryFullLifeTime)
 
GF_GlobalLockgf_create_PID_file (const char *resourceName)
 
GF_GlobalLockgf_global_resource_lock (const char *resourceName)
 
GF_Err gf_global_resource_unlock (GF_GlobalLock *lock)
 
void gf_net_get_ntp (u32 *sec, u32 *frac)
 gets NTP time More...
 
s32 gf_net_get_timezone ()
 gets timezone adjustment in seconds More...
 
u64 gf_net_parse_date (const char *val)
 parses date and returns UTC value for this date. Date format is an XSD dateTime format or any of the supported formats from HTTP 1.1: Sun, 06 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC 1123 Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036 Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() formatgets UTC time in milliseconds More...
 
u64 gf_net_get_utc ()
 gets UTC time in milliseconds More...
 
GF_Err gf_bin128_parse (char *string, bin128 value)
 parses 128 bit from string More...
 

Variables

static u32 sys_start_time = 0
 
static struct termios t_orig t_new
 
static s32 ch_peek = -1
 
static u32 sys_init = 0
 
static u32 last_update_time = 0
 
static u64 last_process_k_u_time = 0
 
GF_SystemRTInfo the_rti
 
static u64 last_cpu_u_k_time = 0
 
static u64 last_cpu_idle_time = 0
 
static u64 mem_at_startup = 0
 
static u64 memory_at_gpac_startup = 0
 

Data Structure Documentation

struct GF_GlobalLock
+ Collaboration diagram for GF_GlobalLock:
Data Fields
const char * resourceName
struct _GF_GlobalLock_opaque
+ Collaboration diagram for GF_GlobalLock:
Data Fields
char * resourceName
char * pidFile
int fd

Macro Definition Documentation

#define SLEEP_ABS_SELECT   1
#define CPF_CLOEXEC   1

Function Documentation

static Bool delete_dir ( void *  cbck,
char *  item_name,
char *  item_path 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

char* my_str_upr ( char *  str)
char* my_str_lwr ( char *  str)
static void init_keyboard ( )
static

+ Here is the caller graph for this function:

static void close_keyboard ( Bool  new_line)
static

+ Here is the caller graph for this function:

Bool gf_sys_get_rti_os ( u32  refresh_time_ms,
GF_SystemRTInfo rti,
u32  flags 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_GlobalLock* gf_create_PID_file ( const char *  resourceName)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

u32 sys_start_time = 0
static
struct termios t_orig t_new
static
s32 ch_peek = -1
static
u32 sys_init = 0
static
u32 last_update_time = 0
static
u64 last_process_k_u_time = 0
static
GF_SystemRTInfo the_rti
u64 last_cpu_u_k_time = 0
static
u64 last_cpu_idle_time = 0
static
u64 mem_at_startup = 0
static
u64 memory_at_gpac_startup = 0
static