spkgdeveloper's documentation

sys.h

00001 /*----------------------------------------------------------------------*\
00002 |* spkg - The Unofficial Slackware Linux Package Manager                *|
00003 |*                                      designed by Ondøej Jirman, 2005 *|
00004 |*----------------------------------------------------------------------*|
00005 |*          No copy/usage restrictions are imposed on anybody.          *|
00006 \*----------------------------------------------------------------------*/
00015 #ifndef SPKG__SYS_H
00016 #define SPKG__SYS_H
00017 
00018 #include <glib.h>
00019 #include <signal.h>
00020 #include <time.h>
00021 #include <sys/stat.h>
00022 
00023 #include "error.h"
00024 
00025 G_BEGIN_DECLS
00026 
00028 typedef enum { 
00029   SYS_ERR=0, 
00030   SYS_NONE,  
00031   SYS_DIR,   
00032   SYS_REG,   
00033   SYS_SYM,   
00034   SYS_BLK,   
00035   SYS_CHR,   
00036   SYS_FIFO,  
00037   SYS_SOCK   
00038 } sys_ftype;
00039 
00046 extern sys_ftype sys_file_type(const gchar* path, gboolean deref);
00047 
00055 extern sys_ftype sys_file_type_stat(const gchar* path, gboolean deref, struct stat* s);
00056 
00063 extern time_t sys_file_mtime(const gchar* path, gboolean deref);
00064 
00070 extern gint sys_rm_rf(const gchar* path);
00071 
00077 extern gint sys_mkdir_p(const gchar* path);
00078 
00083 extern void sys_sigblock(sigset_t* sigs);
00084 
00089 extern void sys_sigunblock(sigset_t* sigs);
00090 
00097 extern gint sys_lock_new(const gchar* path, struct error* e);
00098 
00106 extern gint sys_lock_trywait(gint fd, gint timeout, struct error* e);
00107 
00114 extern gint sys_lock_put(gint fd, struct error* e);
00115 
00120 extern void sys_lock_del(gint fd);
00121 
00130 extern gint sys_write_buffer_to_file(const gchar* file, const gchar* buf, gsize len, struct error* e);
00131 
00132 G_END_DECLS
00133 
00134 #endif
00135 
Documentation for spkg, Sun Jul 23 13:12:53 2006.