typedef char *strconst;
typedef U32 PV;
typedef char *op_tr_array;
-typedef int comment;
+typedef int comment_t;
typedef SV *svindex;
typedef OP *opindex;
typedef IV IV64;
bs.fread((char*)(argp),(len),(nelem),bs.data)
#define BGET_FGETC() bs.fgetc(bs.data)
#else
-#define BGET_FREAD(argp, len, nelem) PerlIO_fread((argp), (len), (nelem), fp)
+#define BGET_FREAD(argp, len, nelem) PerlIO_read(fp, (argp), (len)*(nelem))
#define BGET_FGETC() PerlIO_getc(fp)
#endif /* INDIRECT_BGET_MACROS */
#define BGET_U32(arg) \
- BGET_FREAD(&arg, sizeof(U32), 1); arg = ntohl((U32)arg)
+ BGET_FREAD(&arg, sizeof(U32), 1); arg = PerlSock_ntohl((U32)arg)
#define BGET_I32(arg) \
- BGET_FREAD(&arg, sizeof(I32), 1); arg = (I32)ntohl((U32)arg)
+ BGET_FREAD(&arg, sizeof(I32), 1); arg = (I32)PerlSock_ntohl((U32)arg)
#define BGET_U16(arg) \
- BGET_FREAD(&arg, sizeof(U16), 1); arg = ntohs((U16)arg)
+ BGET_FREAD(&arg, sizeof(U16), 1); arg = PerlSock_ntohs((U16)arg)
#define BGET_U8(arg) arg = BGET_FGETC()
#if INDIRECT_BGET_MACROS
BGET_U32(arg); \
if (arg) { \
New(666, pv.xpv_pv, arg, char); \
- PerlIO_fread(pv.xpv_pv, 1, arg, fp);\
+ PerlIO_read(fp, pv.xpv_pv, arg); \
pv.xpv_len = arg; \
pv.xpv_cur = arg - 1; \
} else { \
} STMT_END
#endif /* INDIRECT_BGET_MACROS */
-#define BGET_comment(arg) \
+#define BGET_comment_t(arg) \
do { arg = BGET_FGETC(); } while (arg != '\n' && arg != EOF)
/*
New(666, ary, 256, unsigned short); \
BGET_FREAD(ary, 256, 2); \
for (i = 0; i < 256; i++) \
- ary[i] = ntohs(ary[i]); \
+ ary[i] = PerlSock_ntohs(ary[i]); \
arg = (char *) ary; \
} while (0)
arg = atof(str); \
} STMT_END
-#define BGET_objindex(arg) STMT_START { \
- U32 ix; \
- BGET_U32(ix); \
- arg = obj_list[ix]; \
+#define BGET_objindex(arg, type) STMT_START { \
+ U32 ix; \
+ BGET_U32(ix); \
+ arg = (type)obj_list[ix]; \
} STMT_END
+#define BGET_svindex(arg) BGET_objindex(arg, svindex)
+#define BGET_opindex(arg) BGET_objindex(arg, opindex)
#define BSET_ldspecsv(sv, arg) sv = specialsv_list[arg]