12 #include "gwen_sar_fileheader_p.h"
14 #include <gwenhywfar/misc.h>
15 #include <gwenhywfar/debug.h>
26 if (strcasecmp(p_s,
"none")==0)
28 else if (strcasecmp(p_s,
"file")==0)
30 else if (strcasecmp(p_s,
"dir")==0)
32 else if (strcasecmp(p_s,
"symLink")==0)
40 if (strcasecmp(p_s,
"active")==0)
42 else if (strcasecmp(p_s,
"deleted")==0)
54 default:
return "unknown";
62 default:
return "unknown";
70 p_struct->_refCount=1;
77 p_struct->permissions=0;
82 p_struct->headerStartPos=0;
83 p_struct->headerSize=0;
94 assert(p_struct->_refCount);
95 if (p_struct->_refCount==1) {
102 p_struct->_refCount=0;
106 p_struct->_refCount--;
112 assert(p_struct->_refCount);
113 p_struct->_refCount++;
122 p_struct->status=p_src->status;
125 p_struct->flags=p_src->flags;
128 if (p_struct->path) {
129 free(p_struct->path);
133 p_struct->path=strdup(p_src->path);
137 p_struct->fileType=p_src->fileType;
140 p_struct->permissions=p_src->permissions;
143 if (p_struct->atime) {
145 p_struct->atime=
NULL;
152 if (p_struct->mtime) {
154 p_struct->mtime=
NULL;
161 if (p_struct->ctime) {
163 p_struct->ctime=
NULL;
170 p_struct->fileSize=p_src->fileSize;
173 p_struct->headerStartPos=p_src->headerStartPos;
176 p_struct->headerSize=p_src->headerSize;
179 p_struct->dataPos=p_src->dataPos;
182 p_struct->dataSize=p_src->dataSize;
185 p_struct->hashPos=p_src->hashPos;
194 p_struct->status=p_src->status;
197 p_struct->flags=p_src->flags;
200 if (p_struct->path) {
201 free(p_struct->path);
205 p_struct->path=strdup(p_src->path);
209 p_struct->fileType=p_src->fileType;
212 p_struct->permissions=p_src->permissions;
215 if (p_struct->atime) {
217 p_struct->atime=
NULL;
224 if (p_struct->mtime) {
226 p_struct->mtime=
NULL;
233 if (p_struct->ctime) {
235 p_struct->ctime=
NULL;
242 p_struct->fileSize=p_src->fileSize;
245 p_struct->headerStartPos=p_src->headerStartPos;
248 p_struct->headerSize=p_src->headerSize;
251 p_struct->dataPos=p_src->dataPos;
254 p_struct->dataSize=p_src->dataSize;
257 p_struct->hashPos=p_src->hashPos;
264 return p_struct->status;
269 return p_struct->flags;
274 return p_struct->path;
279 return p_struct->fileType;
284 return p_struct->permissions;
289 return p_struct->atime;
294 return p_struct->mtime;
299 return p_struct->ctime;
304 return p_struct->fileSize;
309 return p_struct->headerStartPos;
314 return p_struct->headerSize;
319 return p_struct->dataPos;
324 return p_struct->dataSize;
329 return p_struct->hashPos;
334 p_struct->status=p_src;
339 p_struct->status|=p_src;
344 p_struct->status&=~p_src;
349 p_struct->flags=p_src;
354 p_struct->flags|=p_src;
359 p_struct->flags&=~p_src;
364 if (p_struct->path) {
365 free(p_struct->path);
368 p_struct->path=strdup(p_src);
377 p_struct->fileType=p_src;
382 p_struct->permissions=p_src;
387 p_struct->permissions|=p_src;
392 p_struct->permissions&=~p_src;
397 if (p_struct->atime) {
400 p_struct->atime=p_src;
405 if (p_struct->mtime) {
408 p_struct->mtime=p_src;
413 if (p_struct->ctime) {
416 p_struct->ctime=p_src;
421 p_struct->fileSize=p_src;
426 p_struct->headerStartPos=p_src;
431 p_struct->headerSize=p_src;
436 p_struct->dataPos=p_src;
441 p_struct->dataSize=p_src;
446 p_struct->hashPos=p_src;
struct GWEN_TIME GWEN_TIME
GWENHYWFAR_API GWEN_TIME * GWEN_Time_dup(const GWEN_TIME *t)
#define GWEN_FREE_OBJECT(varname)
GWEN_SAR_FILEHEADER * GWEN_SarFileHeader_List_Next(const GWEN_SAR_FILEHEADER *element)
#define GWEN_NEW_OBJECT(typ, varname)
void GWEN_SarFileHeader_List_Add(GWEN_SAR_FILEHEADER *element, GWEN_SAR_FILEHEADER_LIST *list)
GWEN_SAR_FILEHEADER * GWEN_SarFileHeader_List_First(const GWEN_SAR_FILEHEADER_LIST *l)
GWENHYWFAR_API void GWEN_Time_free(GWEN_TIME *t)
GWEN_LIST2_FUNCTIONS(TYPEMAKER2_TYPE, Typemaker2_Type)
GWEN_SAR_FILEHEADER_LIST * GWEN_SarFileHeader_List_new()
#define GWEN_LIST_INIT(t, element)
#define GWEN_LIST_FUNCTIONS(t, pr)
#define GWEN_LIST_FINI(t, element)