?? environ.h
字號:
/* Implicit filelist limits */#define FCLIM_DELETION FILELIST_CAPACITY /* Limit for deletion */#define FCLIM_ARCHIVE EXT_FILELIST_CAPACITY /* Archive filelist size */#define FCLIM_EXCLUSION FILELIST_CAPACITY /* Limit for exclusion */#define FCLIM_EA FILELIST_CAPACITY /* Limit for EA [in/ex]clusion *//* Console settings */#ifdef CR #undef CR#endif#define CR 0x0D /* CR */#ifdef LF #undef LF#endif#define LF 0x0A /* LF */#ifdef BEL #undef BEL#endif#define BEL 0x07 /* Bell */#ifdef TAB #undef TAB#endif#define TAB 0x09 /* Tab */#define TAB_POS 8 /* Tab stops spacing */#define CON_LBOUND 32 /* Lowest displayable character */#define CON_UBOUND 126 /* Highest displayable character */#if TARGET==UNIX||COMPILER==ICC||COMPILER==HIGHC||TARGET==OS2&&defined(LIBC) #define STDOUT_SETBUF_FIX /* XPG.4 libraries (namely, IBM LIBC and GLIBC) do excessive stdout buffering */#endif#if TARGET==UNIX||TARGET==OS2 #define DIRECT_TO_ANSI /* Means to reimplement screen commands via ANSI */#endif/* UNIX and DOS-style path separators */#if TARGET==UNIX #define PATH_SEPARATORS "/"#else #define PATH_SEPARATORS "\\:/" /* Path separators allowed by target OS */#endif#if TARGET==UNIX #define PATHSEP_DEFAULT '/' #define PATHSEP_DEFSTR "/"#else #define PATHSEP_DEFAULT '\\' #define PATHSEP_DEFSTR "\\"#endif/* File buffering equates (defining NO_CACHING will disable buffering) */#define CACHE_SIZE 4096 /* Allocate this amount for buffer */#define CACHE_SIZE_SFXJR 8192 /* ARJSFXJR incoming data cache size */#define PROC_BLOCK_SIZE 27648 /* Size of sequential processing block */#if TARGET==DOS #define VBUF_ADD 4096 /* Old archive stream */ #define VBUF_EXTRACT 8192 /* Input archive stream */ #define TBUF_ARJ 4096 /* Output archive stream */ #if COMPILER==BCC #define VBUF_SFX 4096 #else #define VBUF_SFX 2048 #endif#elif TARGET==OS2||TARGET==WIN32 /* Microsoft C constraints (fragmented heap, and so on...) */ #ifdef TILED #define VBUF_ADD 1024 #define VBUF_EXTRACT 1024 #define TBUF_ARJ 1024 #define VBUF_SFX 1024 #else #define VBUF_ADD 8192 #define VBUF_EXTRACT 16384 #define TBUF_ARJ 8192 #define VBUF_SFX 8192 #endif#elif TARGET==UNIX #define VBUF_ADD 8192 #define VBUF_EXTRACT 8192 #define VBUF_ARJ 8192 #define TBUF_ARJ 8192 #define VBUF_SFX 8192#else #error *** Buffering limits must be defined for the target platform!#endif#define TBUF_MINFREE 42000U /* If less memory left, tbuf>>=1 */#define VBUF_MINFREE 40000U /* If less memory left, vbuf>>=1 *//* * Error handling capabilities: * * NO_TERM_HDL disables termination handler * NO_FATAL_ERROR_HDL disables fatal error handler * */#if TARGET==DOS #define NO_TERM_HDL /* Disable termination handler */#endif#if TARGET==WIN32 #define HAVE_BREAK_HANDLER#endif/* File attribute mapping *//* DOS-way */#define FATTR_HIDDEN 0x0002#define FATTR_SYSTEM 0x0004#define FATTR_RDONLY 0x0001#define FATTR_ARCH 0x0020#define FATTR_NOARCH 0x0000#define FATTR_DIREC 0x0010#define FATTR_LABEL 0x0008/* UNIX-way */#define FATTR_IROTH 0x0004#define FATTR_IWOTH 0x0002#define FATTR_IXOTH 0x0001#define FATTR_IRGRP (FATTR_IROTH<<3)#define FATTR_IWGRP (FATTR_IWOTH<<3)#define FATTR_IXGRP (FATTR_IXOTH<<3)#define FATTR_IRUSR (FATTR_IRGRP<<3)#define FATTR_IWUSR (FATTR_IWGRP<<3)#define FATTR_IXUSR (FATTR_IXGRP<<3)#define FATTR_SVTX 0x0200 /* Sticky bit */#define FATTR_SGID 0x0400 /* Set GID on exec */#define FATTR_SUID 0x0800 /* Set UID on exec */#define FATTR_UFMASK 0x0FFF /* UID/GID/VTX + rwxrwxrwx */#define ufattr(a) ((a)&FATTR_UFMASK)/* Internal mapping for wild_list(), etc. */#define FATTR_DT_ANY 0x0000 /* Default */#define FATTR_DT_REG 0x1000 /* Regular files */#define FATTR_DT_DIR 0x2000 /* Directories */#define FATTR_DT_UXSPECIAL 0x4000 /* Links, pipes, etc. */#define uftype(a) ((a)&~FATTR_UFMASK)/* Certain capabilities of non-UNIX operating systems aren't supported at all or are heavily modified */#if TARGET==UNIX #define MAP_UNIX_ATTRS /* Convert to DOS representation */#endif#if TARGET!=UNIX #define STD_ATTRS 0x27 /* Borland compatibility mask */ /* The following is for fileinfo searches */ #define STD_FI_ATTRS (FATTR_DIREC|FATTR_HIDDEN|FATTR_SYSTEM|FATTR_RDONLY) #define STD_DIR_ATTR FATTR_DIREC #define STD_FATTR_NOARCH FATTR_NOARCH#else #define STD_FI_ATTRS (FATTR_DT_REG|FATTR_DT_DIR|FATTR_DT_UXSPECIAL) #define STD_DIR_ATTR FATTR_DT_DIR #define STD_FATTR_NOARCH 0644#endif/* Priority classes */#if TARGET==OS2||TARGET==WIN32 #define PRIORITY_CLASSES 4 /* 1...4 */#elif TARGET==UNIX #define PRIORITY_CLASSES 41 /* -20...20 -> 1...41 */#else #define PRIORITY_CLASSES 100 /* For compatibility */#endif/* OS-specific options */#if TARGET==DOS||TARGET==OS2||TARGET==WIN32 #if TARGET==DOS #define EXE_EXTENSION ".EXE" #define MOD_EXTENSION ".COM" #else #define EXE_EXTENSION ".exe" #define MOD_EXTENSION ".dll" #endif#else #define EXE_EXTENSION "" #define NULL_EXE_EXTENSION /* For ARJ_USER to construct SFX names */ #define MOD_EXTENSION ".so"#endif/* OS-dependent types */typedef unsigned short ATTRIB; /* Attributes in internal structures *//* File count type */#define FILE_COUNT unsigned long/* Hard link search structure in ffblks and properties */#if TARGET==UNIXstruct l_search{ dev_t dev; ino_t inode; nlink_t refcount; FILE_COUNT ref;};#endif/* lfn_findfirst/findnext customized structure */struct new_ffblk{ /* To stay compatible with findfirst/findnext functions that rely on DOS block format: */ #if TARGET==DOS char ff_reserved[21]; #endif #if TARGET!=UNIX char ff_attrib; #else int ff_attrib; int ff_ftype; /* Wild UNIX representation - for circular symlink treatment */ #endif unsigned long ff_ftime; unsigned long ff_fsize; char ff_name[CCHMAXPATH]; #if TARGET==DOS short ff_handle; #elif TARGET==OS2 HDIR ff_handle; #elif TARGET==WIN32 HANDLE ff_handle; #elif TARGET==UNIX DIR *ff_handle; char dir[CCHMAXPATH]; /* dirent doesn't hold it */ char wildcard[CCHMAXPATH]; /* dirent doesn't hold it */ int attrs; /* dirent doesn't hold it */ struct l_search l_search; #endif unsigned long ff_atime; unsigned long ff_ctime;};/* File information structure (used in file_find and so on) */struct file_properties{ unsigned long fsize; unsigned long ftime; unsigned long atime; unsigned long ctime; ATTRIB attrib; char type; /* One of ARJT_* */ char isarchive; /* For hardlink detection */ #if TARGET==UNIX struct l_search l_search; char islink; #endif};/* Priority structure */struct priority{ int class; int delta;};/* After defining all OS-dependent types, we may include additional files */#include "filelist.h" /* For flist_root structure *//* Exported from ENVIRON.C */extern int friendly_systems[];extern char dev_null[];extern char dev_con[];extern char cur_dir_spec[];extern char up_dir_spec[];extern char pathsep_str[];extern char all_wildcard[];extern char root_wildcard[];/* * Macro section *//* A substitution of kbhit() */#if COMPILER==BCC||COMPILER==MSC||COMPILER==MSVC #define flush_kbd() kbhit()#else #define flush_kbd() fetch_keystrokes()#endif/* OS-dependent strcmp() used for comparing filenames */#ifdef HAVE_STRCASECMP #define stricmp strcasecmp#endif#ifdef CASE_INSENSITIVE #define strcmp_os(s1, s2) stricmp(s1, s2) #define strncmp_os(s1, s2, l) strnicmp(s1, s2, l)#else #define strcmp_os(s1, s2) strcmp(s1, s2) #define strncmp_os(s1, s2, l) strncmp(s1, s2, l)#endif/* IBM's implementation of XPG4 CRT (LIBCS.DLL in OS/2) can't do localtime() properly. So we expose a timezone variable and use a homebrew implementation. May be used as a macro, i.e. real timezone converted to seconds. */#if (defined(LIBC)&&TARGET==OS2)||TARGET==WIN32 #define TZ_VAR _timezone#endif/* fchmod() to make SFX'es executable and other archives non-executable */#if TARGET==UNIX int file_acc(FILE *stream); void make_executable(FILE *stream); #define make_nonexecutable(stream) fchmod(fileno(stream), file_acc(stream)&~0111)#else #define make_executable(stream) #define make_nonexecutable(stream)#endif/* Block optimizers in insane compilers. __LINE__ is for the compiler to be unable to optimize the function arguments if called more than once. */#if COMPILER==HIGHC||COMPILER==ICC #define stop_optimizer() nullsub(__LINE__)#else /* Others are considered sane */ #define stop_optimizer()#endif/* * Exported function prototypes - see ENVIRON.C for details */#if TARGET==UNIX#define SKIP_GET_EXE_NAMEvoid get_exe_name(char *dest, char *arg);#elsevoid get_exe_name(char *dest);#endif#if TARGET==OS2&&SFX_LEVEL>=ARJSFX char *malloc_env_str(char *t); #define free_env_str(str) free(str) int system_cmd(char *cmd);#else #define malloc_env_str(t) getenv(t) #define free_env_str(str) #define system_cmd(cmd) system(cmd)#endif#if SFX_LEVEL!=ARJSFXJRint verify_heap();int verify_far_heap();#if SFX_LEVEL>=ARJSFXV&&COMPILER!=BCClong farcoreleft();#endif#if COMPILER!=BCC #ifndef SUNOS int getdisk(); int setdisk(int drive); #endif void arj_gettime(struct time *ts); void arj_getdate(struct date *ds);#else #define arj_gettime(x) gettime(x) #define arj_getdate(x) getdate(x)#endif#if TARGET==OS2&&defined(TILED) void FAR *farcalloc_based(unsigned long num, unsigned long size); void farfree_based(void FAR *ptr);#else #define farcalloc_based farcalloc #define farfree_based farfree#endifvoid set_priority(struct priority *priority);int test_for_winnt();int file_chmod(char *name, int action, int attrs);int lfn_findfirst(char *path, struct new_ffblk *new_ffblk, int attrib);int lfn_findnext(struct new_ffblk *new_ffblk);void lfn_findclose(struct new_ffblk *new_ffblk);void toupper_loc(unsigned char *ptr, int length);time_t sum_time(time_t t1, time_t t2);time_t sub_time(time_t t1, time_t t2);void case_path(char *s);int find_dupl_drivespecs(char **argtable, int args);int file_test_access(char *name);int detect_lfns();int detect_eas();void fix_ansi_name(char *name);void nullsub(int arg, ...);/* IN ARJ32, it fixes filename to comply with OEM/ANSI codepage issues */#define fix_ansi_name(name)void arj_delay(unsigned int seconds);void mem_stats();int file_exists(char *name);FILE *file_open(char *name, char *mode);void default_case_path(char *dest, char *src);int uni_getch();unsigned long get_ticks();unsigned long file_getfree(char *name);int file_find(char *name, struct file_properties *properties);#if SFX_LEVEL>=ARJ||defined(REARJ) long file_getfsize(char *name);#endifunsigned long file_getftime(char *name);int file_getlabel(char *label, char drive, ATTRIB *attrib, unsigned long *ftime);int read_line(char *buf, int size);void get_mode_str(char *str, unsigned int mode);int exec_pgm(char *cmdline);#if TARGET==OS2&&SFX_LEVEL>=ARJSFX char *malloc_env_str(char *t); #define free_env_str(str) free(str) int system_cmd(char *cmd);#else #define malloc_env_str(t) getenv(t) #define free_env_str(str) #define system_cmd(cmd) system(cmd)#endifint read_line_noecho(char *buf, int size);unsigned int get_bytes_per_cluster(char *name);void get_canonical_longname(char *cname, char *name);void get_canonical_shortname(char *cname, char *name);void install_smart_handler();int is_file(FILE *stream);int file_is_removable(char *name);int is_tty(FILE *stream);int file_mkdir(char *name);int match_wildcard(char *name, char *wcard);int file_rmdir(char *name);int file_unlink(char *name);int file_rename(char *oldname, char *newname);int dos_clear_arch_attr(char *name);int reset_drive(char *name);int fetch_keystrokes();int dos_chmod(char *name, int attrib);int file_chsize(FILE *stream, unsigned long size);int file_setftime_on_stream(FILE *stream, unsigned long ftime);int file_setatime(char *name, unsigned long ftime);int file_setctime(char *name, unsigned long ftime);int file_setftime(char *name, unsigned long ftime);int file_setlabel(char *label, char drive, ATTRIB attrib, unsigned long ftime);int file_settype(FILE *stream, int istext);void set_file_apis(int is_ansi);#if SFX_LEVEL>=ARJSFXV int create_subdir_tree(char *path, int qmode, int datatype);#else int create_subdir_tree(char *path, int datatype);#endifint is_filename_valid(char *name);int is_directory(char *name);char *malloc_subdir_wc(char *name);int file_copy(char *dest, char *src, int chk);#ifndef REARJ int wild_list(struct flist_root *root, struct flist_root *search_flist, char *name, int expand_wildcards, int recurse_subdirs, int file_type, FILE_COUNT *count);#else int wild_list(struct flist_root *root, char *name, int file_type, int expand_wildcards, int recurse_subdirs, FILE_COUNT *count);#endif#if SFX_LEVEL>=ARJSFX&&SFX_LEVEL<=ARJSFXV void file_getcwd(char *buf, int len); void file_chdir(char *dir);#endif#ifdef REARJ char *file_getcwd(char *buf); int file_chdir(char *dir); char get_sw_char();#endif#endif /* !ARJSFXJR */int file_setftime_on_hf(int hf, unsigned long ftime);#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -