#ifndef READWRITE_H
# define READWRITE_H

# ifndef GPK_STD_H
#  include "gpk_std.h"
# endif
# include <stdio.h>

BOOL hop_next_record(FILE *fp);

BOOL delete_record(FILE *fp);

BOOL read_short_2(FILE *fp, short *p);
BOOL read_int_2(FILE *fp, int *p);
BOOL read_long_4(FILE *fp, long *p);
BOOL read_shorts_2(FILE *fp, int n, short *p);
BOOL read_chars(FILE *fp, int n, char *p);
BOOL read_char_1(FILE *fp, char *p);
BOOL read_uchar_1(FILE *fp, UCHAR *p);
BOOL read_TBOOL_1(FILE *fp, TBOOL *p);
#ifdef __GNUC__
BOOL read_schars(FILE *fp, int n, SCHAR *p);
BOOL read_schar_1(FILE *fp, SCHAR *p);
#else
# define read_schars(f,n,p)	read_chars(f, n, p)
# define read_schar_1(f,p)	read_char_1(f, p)
#endif

BOOL read_double_2(FILE *fp, double *q);
BOOL read_float_2(FILE *fp, float *q);
BOOL read_float_4(FILE *fp, float *q);
BOOL read_double_4(FILE *fp, double *q);

BOOL write_int_2(FILE *fp, int i);
BOOL write_long_4(FILE *fp, long i);
BOOL write_char_1(FILE *fp, char c);
BOOL write_uchar_1(FILE *fp, UCHAR c);
BOOL write_uchars(FILE *fp, int n, C UCHAR *p);
BOOL write_chars(FILE *fp, int n, C char *p);
BOOL write_charstring(FILE *fp, int n, C char *p);
BOOL write_TBOOL_1(FILE *fp, TBOOL p);
BOOL write_shorts_2(FILE *fp, int n, C short *p);
#ifdef __GNUC__
BOOL write_schar_1(FILE *fp, SCHAR c);
BOOL write_schars(FILE *fp, int n, C SCHAR *p);
#else
# define write_schar_1(f,c)	write_char_1(f,c)
# define write_schars(f,n,p) write_chars(f,n,p)
#endif

BOOL write_double_2(FILE *fp, double q);
BOOL write_double_4(FILE *fp, double q);

#endif
