00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00031 #ifndef _SYSTEMCALLS_H_
00032 #define _SYSTEMCALLS_H_
00033
00034 #include "constants.h"
00035 #include <gtk/gtk.h>
00036
00037 #define MAX_ARGS (10)
00038 #define MAX_FILENAME_SIZE (1024)
00039
00040
00041
00042
00043 #define SA_OS_ADDRESS (152)
00044 #define SA_OS_LENGTH (1)
00045 int scSyssetWrite_OSUpdate(gboolean ready_to_update);
00046
00047
00048 #define SA_CONNECT_ADDRESS (153)
00049 #define SA_CONNECT_LENGTH (1)
00050 int scSyssetWrite_FSUpdate(gboolean ready_to_update);
00051
00052
00053 #define SA_FS_ADDRESS (156)
00054 #define SA_FS_LENGTH (1)
00055 int scSyssetWrite_Connect(gboolean connect_after_reboot);
00056
00057
00058 #define PROGRESS_CALLBACK_TIMEOUT (5000)
00059
00060
00061 #define POWERMGMTIFACE "/dev/battery"
00062
00063 #define BATTERY_IOCTL_BASE 'b'
00064 #define BATTERY_IOCTL_READ_CHARGE _IOR( BATTERY_IOCTL_BASE,1,unsigned int)
00065 #define BATTERY_IOCTL_READ_CURRENT _IOR( BATTERY_IOCTL_BASE,16,unsigned int)
00066
00067
00068 int scCheckFileIntegrity(char *szDir, char *szFile);
00069
00076 double scGetDiskSpaceFree(const char* path);
00077
00086 typedef void scUnpackProgressCallback_t(int Progress);
00087
00088
00089
00090 void setDownloadHistory(char *dir);
00091
00092 int scEmptyDirectory(char *szDir);
00093
00094 void scRemoveFile(char *szDir, char *szFile);
00095
00096 void scFlushFileBuffers();
00097
00098 int shell_exec(const char *cmd);
00099
00100 int fork_exec(const int argc, char *const argv[]);
00101
00102 int recursive_dircopy(const char * source, const char * dest, GSourceFunc progress_callback);
00103
00104 int fileExists(const char* filename);
00105
00106 int delDir(const char* sDir);
00107
00108 char *dirCopy(const char* dirPath, const char* destinationDir, GSourceFunc progress_callback);
00109
00110 char *fileCopy(const char* filePath, const char* destinationDir, GSourceFunc progress_callback);
00111 void fileCopy_abort(void);
00112
00113 const int mkdirhier(const char *path, mode_t mode);
00114
00115 void createDownloadHistoryEntry(const char *filePath);
00116
00117 char * strtolower(register char *s);
00118
00119 pid_t get_forkexec_child_pid();
00120
00126 int get_battery_charge(void);
00127
00128 #endif // _SYSTEMCALLS_H_