00001
00016
00017
00018 #ifndef LBFILEIO_H
00019 #define LBFILEIO_H
00020
00021 # include <stdio.h>
00022
00023
00024
00025 inline long file_length (char *path);
00026 inline long file_length_opened (FILE *fp);
00027
00028 inline long read_int32_le_file (FILE *fp);
00029 inline long read_int32_le_buf (const unsigned char *buff);
00030 inline unsigned short read_int16_le_file (FILE *fp);
00031 inline unsigned short read_int16_le_buf (const unsigned char *buff);
00032
00033 inline void write_int16_le_file (FILE *fp, unsigned short x);
00034 inline void write_int16_le_buf (unsigned char *buff, unsigned short x);
00035 inline void write_int32_le_file (FILE *fp, unsigned long x);
00036 inline void write_int32_le_buf (unsigned char *buff, unsigned long x);
00037
00038 inline long read_int32_be_file (FILE *fp);
00039 inline long read_int32_be_buf (const unsigned char *buff);
00040 inline unsigned short read_int16_be_file (FILE *fp);
00041 inline unsigned short read_int16_be_buf (const unsigned char *buff);
00042
00043 inline void write_int16_be_file (FILE *fp, unsigned short x);
00044 inline void write_int16_be_buf (unsigned char *buff, unsigned short x);
00045 inline void write_int32_be_file (FILE *fp, unsigned long x);
00046 inline void write_int32_be_buf (unsigned char *buff, unsigned long x);
00047
00048 inline unsigned char read_int8_buf (const unsigned char *buff);
00049 inline short nth_bit( unsigned char c, short n );
00050 inline short nth_bit_fourbytes( unsigned char c[4], short n );
00051
00052 #endif