1/* 2 Copyright (c) 1990-1999 Info-ZIP. All rights reserved. 3 4 See the accompanying file LICENSE, version 1999-Oct-05 or later 5 (the contents of which are also included in zip.h) for terms of use. 6 If, for some reason, both of these files are missing, the Info-ZIP license 7 also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html 8*/ 9 10#ifndef _OSDEP_H_ 11#define _OSDEP_H_ 12 13#include <sys/types.h> 14#include <sys/stat.h> 15#include <sys/unistd.h> 16 17#define USE_EF_UT_TIME /* Enable use of "UT" extra field time info */ 18 19#define EB_L_AT_LEN 5 /* min size is an unsigned long and flag */ 20#define EB_C_AT_LEN 5 /* Length of data in local EF and flag. */ 21 22#define EB_AT_FL_NATURAL 0x01 /* data is 'natural' (not compressed) */ 23#define EB_AT_FL_BADBITS 0xfe /* bits currently undefined */ 24 25#ifndef ZP_NEED_MEMCOMPR 26 define ZP_NEED_MEMCOMPR 27#endif 28 29#define deletedir(d) rmdir(d); 30 31/* Set a file's MIME type. */ 32void setfiletype( const char *file, const char *type ); 33 34/* 35'At' extra-field layout: 36 37'At' - signature 38ef_size - size of data in this EF (little-endian unsigned short) 39full_size - uncompressed data size (little-endian unsigned long) 40flag - flags (byte) 41 flags & EB_AT_FL_NATURAL = the data is not compressed 42 flags & EB_AT_FL_BADBITS = the data is corrupted or we 43 can't handle it properly 44data - compressed or uncompressed file attribute data 45 46If flag & EB_AT_FL_NATURAL, the data is not compressed; this optimisation is 47necessary to prevent wasted space for files with small attributes. In this 48case, there should be ( ef_size - EB_L_AT_LEN ) bytes of data, and full_size 49should equal ( ef_size - EB_L_AT_LEN ). 50 51If the data is compressed, there will be ( ef_size - EB_L_AT_LEN ) bytes of 52compressed data, and full_size bytes of uncompressed data. 53 54If a file has absolutely no attributes, there will not be a 'At' extra field. 55 56The uncompressed data is arranged like this: 57 58attr_name\0 - C string 59struct attr_info (little-endian) 60attr_data (length in attr_info.ai_size) 61*/ 62 63#endif 64 65