spkgdeveloper's documentation

untgz.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 \*----------------------------------------------------------------------*/
00074 #ifndef SPKG__UNTGZ_H
00075 #define SPKG__UNTGZ_H
00076 
00077 #include <glib.h>
00078 #include <time.h>
00079 #include <sys/stat.h>
00080 
00081 #include "error.h"
00082 
00083 G_BEGIN_DECLS
00084 
00085 #define UNTGZ_CORRUPT E(0) 
00086 #define UNTGZ_BLOCKED E(1) 
00087 #define UNTGZ_BADIO E(2) 
00088 #define UNTGZ_BADMETA E(3) 
00092 typedef enum { 
00093   UNTGZ_NONE=0, 
00094   UNTGZ_DIR,    
00095   UNTGZ_REG,    
00096   UNTGZ_LNK,    
00097   UNTGZ_SYM,    
00098   UNTGZ_BLK,    
00099   UNTGZ_CHR,    
00100   UNTGZ_FIFO    
00101 } untgz_filetype;
00102 
00104 struct untgz_state_internal;
00105 
00107 struct untgz_state {
00108   /* archive information */
00109   gchar*  tgzfile;     
00110   gsize   usize;       
00111   gsize   csize;       
00113   /* current file information */
00114   untgz_filetype f_type; 
00115   gchar*  f_name;      
00116   gchar*  f_link;      
00117   gsize   f_size;      
00118   gint    f_mode;      
00119   time_t  f_mtime;     
00120   uid_t   f_uid;       
00121   gid_t   f_gid;       
00122   gchar   f_uname[33]; 
00123   gchar   f_gname[33]; 
00124   guint   f_devmaj;    
00125   guint   f_devmin;    
00127   struct untgz_state_internal* i; 
00128 };
00129 
00131 typedef void(*untgz_status_cb)(struct untgz_state* s, gsize total, gsize current);
00132 
00143 extern struct untgz_state* untgz_open(const gchar* tgzfile, untgz_status_cb scb, struct error* e);
00144 
00149 extern void untgz_close(struct untgz_state* s);
00150 
00158 extern gint untgz_get_header(struct untgz_state* s);
00159 
00174 extern gint untgz_write_data(struct untgz_state* s, gchar** buf, gsize* len);
00175 
00183 extern gint untgz_write_file(struct untgz_state* s, gchar* altname);
00184 
00185 G_END_DECLS
00186 
00187 #endif
00188 
Documentation for spkg, Sun Jul 23 13:12:53 2006.