12#include "gwen_sar_fileheader_p.h"
14#include <gwenhywfar/misc.h>
15#include <gwenhywfar/debug.h>
27 if (strcasecmp(p_s,
"none")==0)
29 else if (strcasecmp(p_s,
"file")==0)
31 else if (strcasecmp(p_s,
"dir")==0)
33 else if (strcasecmp(p_s,
"symLink")==0)
42 if (strcasecmp(p_s,
"active")==0)
44 else if (strcasecmp(p_s,
"deleted")==0)
83 p_struct->_refCount=1;
90 p_struct->permissions=0;
95 p_struct->headerStartPos=0;
96 p_struct->headerSize=0;
108 assert(p_struct->_refCount);
109 if (p_struct->_refCount==1) {
112 free(p_struct->path);
116 p_struct->_refCount=0;
120 p_struct->_refCount--;
127 assert(p_struct->_refCount);
128 p_struct->_refCount++;
138 p_struct->status=p_src->status;
141 p_struct->flags=p_src->flags;
144 if (p_struct->path) {
145 free(p_struct->path);
149 p_struct->path=strdup(p_src->path);
153 p_struct->fileType=p_src->fileType;
156 p_struct->permissions=p_src->permissions;
159 if (p_struct->atime) {
161 p_struct->atime=
NULL;
168 if (p_struct->mtime) {
170 p_struct->mtime=
NULL;
177 if (p_struct->ctime) {
179 p_struct->ctime=
NULL;
186 p_struct->fileSize=p_src->fileSize;
189 p_struct->headerStartPos=p_src->headerStartPos;
192 p_struct->headerSize=p_src->headerSize;
195 p_struct->dataPos=p_src->dataPos;
198 p_struct->dataSize=p_src->dataSize;
201 p_struct->hashPos=p_src->hashPos;
211 p_struct->status=p_src->status;
214 p_struct->flags=p_src->flags;
217 if (p_struct->path) {
218 free(p_struct->path);
222 p_struct->path=strdup(p_src->path);
226 p_struct->fileType=p_src->fileType;
229 p_struct->permissions=p_src->permissions;
232 if (p_struct->atime) {
234 p_struct->atime=
NULL;
241 if (p_struct->mtime) {
243 p_struct->mtime=
NULL;
250 if (p_struct->ctime) {
252 p_struct->ctime=
NULL;
259 p_struct->fileSize=p_src->fileSize;
262 p_struct->headerStartPos=p_src->headerStartPos;
265 p_struct->headerSize=p_src->headerSize;
268 p_struct->dataPos=p_src->dataPos;
271 p_struct->dataSize=p_src->dataSize;
274 p_struct->hashPos=p_src->hashPos;
282 return p_struct->status;
288 return p_struct->flags;
294 return p_struct->path;
300 return p_struct->fileType;
306 return p_struct->permissions;
312 return p_struct->atime;
318 return p_struct->mtime;
324 return p_struct->ctime;
330 return p_struct->fileSize;
336 return p_struct->headerStartPos;
342 return p_struct->headerSize;
348 return p_struct->dataPos;
354 return p_struct->dataSize;
360 return p_struct->hashPos;
366 p_struct->status=p_src;
372 p_struct->status|=p_src;
378 p_struct->status&=~p_src;
384 p_struct->flags=p_src;
390 p_struct->flags|=p_src;
396 p_struct->flags&=~p_src;
402 if (p_struct->path) {
403 free(p_struct->path);
406 p_struct->path=strdup(p_src);
416 p_struct->fileType=p_src;
422 p_struct->permissions=p_src;
428 p_struct->permissions|=p_src;
434 p_struct->permissions&=~p_src;
440 if (p_struct->atime) {
443 p_struct->atime=p_src;
449 if (p_struct->mtime) {
452 p_struct->mtime=p_src;
458 if (p_struct->ctime) {
461 p_struct->ctime=p_src;
467 p_struct->fileSize=p_src;
473 p_struct->headerStartPos=p_src;
479 p_struct->headerSize=p_src;
485 p_struct->dataPos=p_src;
491 p_struct->dataSize=p_src;
497 p_struct->hashPos=p_src;
struct GWEN_TIME GWEN_TIME
GWENHYWFAR_API void GWEN_Time_free(GWEN_TIME *t)
GWENHYWFAR_API GWEN_TIME * GWEN_Time_dup(const GWEN_TIME *t)
#define GWEN_LIST_FINI(t, element)
#define GWEN_LIST_FUNCTIONS(t, pr)
#define GWEN_LIST_INIT(t, element)
#define GWEN_LIST2_FUNCTIONS(t, pr)
GWEN_SAR_FILEHEADER * GWEN_SarFileHeader_List_First(const GWEN_SAR_FILEHEADER_LIST *l)
GWEN_SAR_FILEHEADER * GWEN_SarFileHeader_List_Next(const GWEN_SAR_FILEHEADER *element)
void GWEN_SarFileHeader_List_Add(GWEN_SAR_FILEHEADER *element, GWEN_SAR_FILEHEADER_LIST *list)
GWEN_SAR_FILEHEADER_LIST * GWEN_SarFileHeader_List_new()
#define GWEN_FREE_OBJECT(varname)
#define GWEN_NEW_OBJECT(typ, varname)