📄 plxfs.h
字号:
/**************************************************************************\
*
* Pollex Mobile Platform
*
* Copyright (c) 2004 by Pollex Mobile Software Co., Ltd.
* All Rights Reserved
*
* Model :
*
* Purpose :
*
* Author :
*
*-------------------------------------------------------------------------
*
* $Archive:: $
* $Workfile:: $
* $Revision:: $ $Date:: $
*
\**************************************************************************/
#ifndef _PLXFS_H_
#define _PLXFS_H_
#ifdef __cplusplus
extern "C" {
#endif
#include "plxdef.h"
#ifndef SEEK_SET
#define SEEK_SET 0
#endif
#ifndef SEEK_CUR
#define SEEK_CUR 1
#endif
#ifndef SEEK_END
#define SEEK_END 2
#endif
#ifndef _FILE_DEFINED // prevent conflicting with win32
#ifndef __STDIO_DECLS // prevent conflicting with ARM ads1.2
struct _iobuf {
int unused;
};
typedef struct _iobuf FILE;
#endif
#endif
#ifndef _SIZE_T_DEFINED
typedef unsigned int size_t;
#define _SIZE_T_DEFINED
#endif
#ifdef fopen
#undef fopen
#endif
#ifdef fopen
#undef fopen
#endif
#ifdef fclose
#undef fclose
#endif
#ifdef fread
#undef fread
#endif
#ifdef fwrite
#undef fwrite
#endif
#ifdef remove
#undef remove
#endif
#ifdef rename
#undef rename
#endif
#ifdef fseek
#undef fseek
#endif
#ifdef ftell
#undef ftell
#endif
#ifdef fseek
#undef fseek
#endif
#ifdef mkdir
#undef mkdir
#endif
#ifdef rmdir
#undef rmdir
#endif
#ifdef fflush
#undef fflush
#endif
#ifdef GetFileSize
#undef GetFileSize
#endif
#define fopen plx_fopen
#define fclose plx_fclose
#define fread plx_fread
#define fwrite plx_fwrite
#define fseek plx_fseek
#define ftell plx_ftell
#define remove plx_remove
#define rename plx_rename
#define mkdir plx_mkdir
#define rmdir plx_rmdir
#define fflush plx_fflush
#define GetFileSize plx_GetFileSize
#define plx_GetAvailableSize GetAvailableSize
FILE * plx_fopen(const char *filename, const char *mode );
int plx_fclose( FILE *stream );
size_t plx_fread( void *buffer, size_t size, size_t count, FILE *stream );
size_t plx_fwrite( const void *buffer, size_t size, size_t count, FILE *stream );
int plx_fseek( void *stream, long offset, int origin );
long plx_ftell( void *stream );
int plx_remove(const char * pfilename);
int plx_rename( const char *oldname, const char *newname );
int plx_mkdir( const char *dirname );
int plx_rmdir( const char *dirname );
int plx_fflush( FILE *stream );
long plx_GetFileSize( FILE *stream );
#define PLX_FILENAME_LEN 64
typedef struct plx_findentry {
int filetype;
unsigned long filesize;
// unsigned long fileatime;
// unsigned long filemtime;
// unsigned long filectime;
char filename[PLX_FILENAME_LEN];
} PLXFINDENTRY, * PPLXFINDENTRY;
typedef struct hm_findhandle {
PLXFINDENTRY find;
/* other fields not obvious to user */
} * PLXFINDHANDLE;
// pollex file type
#define PLXFT_FILE 0x0001
#define PLXFT_DIR 0x0002
#define PLXFT_OTHER 0x0003
PLXFINDHANDLE plx_FindFirstFile (const char * filename);
int plx_FindNextFile (PLXFINDHANDLE findHandle);
void plx_FindClose (PLXFINDHANDLE findHandle);
#ifdef GetAvailableSize
#undef GetAvailableSize
#define GetAvailableSize plx_GetAvailableSize
#endif
unsigned long GetAvailableSize(const char *drive);
#ifndef FILE_ATTRIBUTE_ARCHIVE
#define FILE_ATTRIBUTE_ARCHIVE 0x00000020
#endif
#ifndef FILE_ATTRIBUTE_HIDDEN
#define FILE_ATTRIBUTE_HIDDEN 0x00000002
#endif
#ifndef FILE_ATTRIBUTE_NORMAL
#define FILE_ATTRIBUTE_NORMAL 0x00000080
#endif
#ifndef FILE_ATTRIBUTE_OFFLINE
#define FILE_ATTRIBUTE_OFFLINE 0x00001000
#endif
#ifndef FILE_ATTRIBUTE_READONLY
#define FILE_ATTRIBUTE_READONLY 0x00000001
#endif
#ifndef FILE_ATTRIBUTE_SYSTEM
#define FILE_ATTRIBUTE_SYSTEM 0x00000004
#endif
#ifndef FILE_ATTRIBUTE_TEMPORARY
#define FILE_ATTRIBUTE_TEMPORARY 0x00000100
#endif
#ifndef FILE_ATTRIBUTE_DIRECTORY
#define FILE_ATTRIBUTE_DIRECTORY 0x00000010
#endif
#ifndef FILE_ATTRIBUTE_ENCRYPTED
#define FILE_ATTRIBUTE_ENCRYPTED 0x00000040
#endif
#ifndef FILE_ATTRIBUTE_SPARSE_FILE
#define FILE_ATTRIBUTE_SPARSE_FILE 0x00000200
#endif
#ifndef FILE_ATTRIBUTE_REPARSE_POINT
#define FILE_ATTRIBUTE_REPARSE_POINT 0x00000400
#endif
#ifndef FILE_ATTRIBUTE_COMPRESSED
#define FILE_ATTRIBUTE_COMPRESSED 0x00000800
#endif
#ifndef FILE_ATTRIBUTE_NOT_CONTENT_INDEXED
#define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 0x00002000
#endif
#ifdef SetFileAttributes
#undef SetFileAttributes
#endif
#ifdef GetFileAttributes
#undef GetFileAttributes
#endif
#define SetFileAttributes plx_SetFileAttributes
#define GetFileAttributes plx_GetFileAttributes
BOOL SetFileAttributes( const char * filename, DWORD dwFileAttributes);
DWORD GetFileAttributes( const char * filename );
#ifdef __cplusplus
}
#endif
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -