Skip to content

Commit

Permalink
remove __cplusplus stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
lqs committed Sep 29, 2013
1 parent 6b60cb6 commit f8a595d
Show file tree
Hide file tree
Showing 9 changed files with 666 additions and 738 deletions.
217 changes: 105 additions & 112 deletions exfat_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@
#include <linux/fs.h>
#include "exfat_config.h"

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

/*----------------------------------------------------------------------*/
/* Constant & Macro Definitions */
/*----------------------------------------------------------------------*/
Expand Down Expand Up @@ -101,114 +97,111 @@ extern "C" {
#define FFS_NAMETOOLONG 18
#define FFS_ERROR 19

/*----------------------------------------------------------------------*/
/* Type Definitions */
/*----------------------------------------------------------------------*/

typedef struct {
u16 Year;
u16 Month;
u16 Day;
u16 Hour;
u16 Minute;
u16 Second;
u16 MilliSecond;
} DATE_TIME_T;

typedef struct {
u32 Offset; /* start sector number of the partition */
u32 Size; /* in sectors */
} PART_INFO_T;

typedef struct {
u32 SecSize; /* sector size in bytes */
u32 DevSize; /* block device size in sectors */
} DEV_INFO_T;

typedef struct {
u32 FatType;
u32 ClusterSize;
u32 NumClusters;
u32 FreeClusters;
u32 UsedClusters;
} VOL_INFO_T;

/* directory structure */
typedef struct {
u32 dir;
s32 size;
u8 flags;
} CHAIN_T;

/* file id structure */
typedef struct {
CHAIN_T dir;
s32 entry;
u32 type;
u32 attr;
u32 start_clu;
u64 size;
u8 flags;
s64 rwoffset;
s32 hint_last_off;
u32 hint_last_clu;
} FILE_ID_T;

typedef struct {
char Name[MAX_NAME_LENGTH * MAX_CHARSET_SIZE];
char ShortName[DOS_NAME_LENGTH + 2]; /* used only for FAT12/16/32, not used for exFAT */
u32 Attr;
u64 Size;
u32 NumSubdirs;
DATE_TIME_T CreateTimestamp;
DATE_TIME_T ModifyTimestamp;
DATE_TIME_T AccessTimestamp;
} DIR_ENTRY_T;

/*======================================================================*/
/* */
/* API FUNCTION DECLARATIONS */
/* (CHANGE THIS PART IF REQUIRED) */
/* */
/*======================================================================*/

/*----------------------------------------------------------------------*/
/* External Function Declarations */
/*----------------------------------------------------------------------*/

/* file system initialization & shutdown functions */
s32 FsInit(void);
s32 FsShutdown(void);

/* volume management functions */
s32 FsMountVol(struct super_block *sb);
s32 FsUmountVol(struct super_block *sb);
s32 FsGetVolInfo(struct super_block *sb, VOL_INFO_T *info);
s32 FsSyncVol(struct super_block *sb, s32 do_sync);

/* file management functions */
s32 FsLookupFile(struct inode *inode, char *path, FILE_ID_T *fid);
s32 FsCreateFile(struct inode *inode, char *path, u8 mode, FILE_ID_T *fid);
s32 FsReadFile(struct inode *inode, FILE_ID_T *fid, void *buffer, u64 count, u64 *rcount);
s32 FsWriteFile(struct inode *inode, FILE_ID_T *fid, void *buffer, u64 count, u64 *wcount);
s32 FsTruncateFile(struct inode *inode, u64 old_size, u64 new_size);
s32 FsMoveFile(struct inode *old_parent_inode, FILE_ID_T *fid, struct inode *new_parent_inode, struct dentry *new_dentry);
s32 FsRemoveFile(struct inode *inode, FILE_ID_T *fid);
s32 FsSetAttr(struct inode *inode, u32 attr);
s32 FsReadStat(struct inode *inode, DIR_ENTRY_T *info);
s32 FsWriteStat(struct inode *inode, DIR_ENTRY_T *info);
s32 FsMapCluster(struct inode *inode, s32 clu_offset, u32 *clu);

/* directory management functions */
s32 FsCreateDir(struct inode *inode, char *path, FILE_ID_T *fid);
s32 FsReadDir(struct inode *inode, DIR_ENTRY_T *dir_entry);
s32 FsRemoveDir(struct inode *inode, FILE_ID_T *fid);

/* debug functions */
s32 FsReleaseCache(struct super_block *sb);
#ifdef __cplusplus
}
#endif /* __cplusplus */
/*----------------------------------------------------------------------*/
/* Type Definitions */
/*----------------------------------------------------------------------*/

typedef struct {
u16 Year;
u16 Month;
u16 Day;
u16 Hour;
u16 Minute;
u16 Second;
u16 MilliSecond;
} DATE_TIME_T;

typedef struct {
u32 Offset; /* start sector number of the partition */
u32 Size; /* in sectors */
} PART_INFO_T;

typedef struct {
u32 SecSize; /* sector size in bytes */
u32 DevSize; /* block device size in sectors */
} DEV_INFO_T;

typedef struct {
u32 FatType;
u32 ClusterSize;
u32 NumClusters;
u32 FreeClusters;
u32 UsedClusters;
} VOL_INFO_T;

/* directory structure */
typedef struct {
u32 dir;
s32 size;
u8 flags;
} CHAIN_T;

/* file id structure */
typedef struct {
CHAIN_T dir;
s32 entry;
u32 type;
u32 attr;
u32 start_clu;
u64 size;
u8 flags;
s64 rwoffset;
s32 hint_last_off;
u32 hint_last_clu;
} FILE_ID_T;

typedef struct {
char Name[MAX_NAME_LENGTH * MAX_CHARSET_SIZE];
char ShortName[DOS_NAME_LENGTH + 2]; /* used only for FAT12/16/32, not used for exFAT */
u32 Attr;
u64 Size;
u32 NumSubdirs;
DATE_TIME_T CreateTimestamp;
DATE_TIME_T ModifyTimestamp;
DATE_TIME_T AccessTimestamp;
} DIR_ENTRY_T;

/*======================================================================*/
/* */
/* API FUNCTION DECLARATIONS */
/* (CHANGE THIS PART IF REQUIRED) */
/* */
/*======================================================================*/

/*----------------------------------------------------------------------*/
/* External Function Declarations */
/*----------------------------------------------------------------------*/

/* file system initialization & shutdown functions */
s32 FsInit(void);
s32 FsShutdown(void);

/* volume management functions */
s32 FsMountVol(struct super_block *sb);
s32 FsUmountVol(struct super_block *sb);
s32 FsGetVolInfo(struct super_block *sb, VOL_INFO_T *info);
s32 FsSyncVol(struct super_block *sb, s32 do_sync);

/* file management functions */
s32 FsLookupFile(struct inode *inode, char *path, FILE_ID_T *fid);
s32 FsCreateFile(struct inode *inode, char *path, u8 mode, FILE_ID_T *fid);
s32 FsReadFile(struct inode *inode, FILE_ID_T *fid, void *buffer, u64 count, u64 *rcount);
s32 FsWriteFile(struct inode *inode, FILE_ID_T *fid, void *buffer, u64 count, u64 *wcount);
s32 FsTruncateFile(struct inode *inode, u64 old_size, u64 new_size);
s32 FsMoveFile(struct inode *old_parent_inode, FILE_ID_T *fid, struct inode *new_parent_inode, struct dentry *new_dentry);
s32 FsRemoveFile(struct inode *inode, FILE_ID_T *fid);
s32 FsSetAttr(struct inode *inode, u32 attr);
s32 FsReadStat(struct inode *inode, DIR_ENTRY_T *info);
s32 FsWriteStat(struct inode *inode, DIR_ENTRY_T *info);
s32 FsMapCluster(struct inode *inode, s32 clu_offset, u32 *clu);

/* directory management functions */
s32 FsCreateDir(struct inode *inode, char *path, FILE_ID_T *fid);
s32 FsReadDir(struct inode *inode, DIR_ENTRY_T *dir_entry);
s32 FsRemoveDir(struct inode *inode, FILE_ID_T *fid);

/* debug functions */
s32 FsReleaseCache(struct super_block *sb);

#endif /* _EXFAT_API_H */

Expand Down
28 changes: 9 additions & 19 deletions exfat_bitmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,29 +37,19 @@

#include <linux/types.h>

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */



/*======================================================================*/
/* */
/* LIBRARY FUNCTION DECLARATIONS -- OTHER UTILITY FUNCTIONS */
/* (DO NOT CHANGE THIS PART !!) */
/* */
/*======================================================================*/
/*======================================================================*/
/* */
/* LIBRARY FUNCTION DECLARATIONS -- OTHER UTILITY FUNCTIONS */
/* (DO NOT CHANGE THIS PART !!) */
/* */
/*======================================================================*/

/*----------------------------------------------------------------------*/
/* Bitmap Manipulation Functions */
/*----------------------------------------------------------------------*/
/*----------------------------------------------------------------------*/
/* Bitmap Manipulation Functions */
/*----------------------------------------------------------------------*/

s32 exfat_bitmap_test(u8 *bitmap, s32 i);
void exfat_bitmap_set(u8 *bitmap, s32 i);
void exfat_bitmap_clear(u8 *bitmpa, s32 i);

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* _EXFAT_BITMAP_H */
59 changes: 26 additions & 33 deletions exfat_blkdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,44 +38,37 @@
#include <linux/fs.h>
#include "exfat_config.h"

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

/*----------------------------------------------------------------------*/
/* Constant & Macro Definitions (Non-Configurable) */
/*----------------------------------------------------------------------*/
/*----------------------------------------------------------------------*/
/* Constant & Macro Definitions (Non-Configurable) */
/*----------------------------------------------------------------------*/

/*----------------------------------------------------------------------*/
/* Type Definitions */
/*----------------------------------------------------------------------*/
/*----------------------------------------------------------------------*/
/* Type Definitions */
/*----------------------------------------------------------------------*/

typedef struct __BD_INFO_T {
s32 sector_size; /* in bytes */
s32 sector_size_bits;
s32 sector_size_mask;
s32 num_sectors; /* total number of sectors in this block device */
bool opened; /* opened or not */
} BD_INFO_T;
typedef struct __BD_INFO_T {
s32 sector_size; /* in bytes */
s32 sector_size_bits;
s32 sector_size_mask;
s32 num_sectors; /* total number of sectors in this block device */
bool opened; /* opened or not */
} BD_INFO_T;

/*----------------------------------------------------------------------*/
/* External Variable Declarations */
/*----------------------------------------------------------------------*/
/*----------------------------------------------------------------------*/
/* External Variable Declarations */
/*----------------------------------------------------------------------*/

/*----------------------------------------------------------------------*/
/* External Function Declarations */
/*----------------------------------------------------------------------*/
/*----------------------------------------------------------------------*/
/* External Function Declarations */
/*----------------------------------------------------------------------*/

s32 bdev_init(void);
s32 bdev_shutdown(void);
s32 bdev_open(struct super_block *sb);
s32 bdev_close(struct super_block *sb);
s32 bdev_read(struct super_block *sb, u32 secno, struct buffer_head **bh, u32 num_secs, s32 read);
s32 bdev_write(struct super_block *sb, u32 secno, struct buffer_head *bh, u32 num_secs, s32 sync);
s32 bdev_sync(struct super_block *sb);
#ifdef __cplusplus
}
#endif /* __cplusplus */
s32 bdev_init(void);
s32 bdev_shutdown(void);
s32 bdev_open(struct super_block *sb);
s32 bdev_close(struct super_block *sb);
s32 bdev_read(struct super_block *sb, u32 secno, struct buffer_head **bh, u32 num_secs, s32 read);
s32 bdev_write(struct super_block *sb, u32 secno, struct buffer_head *bh, u32 num_secs, s32 sync);
s32 bdev_sync(struct super_block *sb);

#endif /* _EXFAT_BLKDEV_H */

Expand Down
Loading

0 comments on commit f8a595d

Please sign in to comment.