Skip to content
Snippets Groups Projects
Commit ed839288 authored by Yukita Mayako's avatar Yukita Mayako
Browse files

Add INT32 and fixed_t to DataWrap.

parent c389d0c9
No related branches found
No related tags found
No related merge requests found
...@@ -43,6 +43,18 @@ INT16 DW_ReadINT16(DataWrap dw) ...@@ -43,6 +43,18 @@ INT16 DW_ReadINT16(DataWrap dw)
return READINT16(dw->p); return READINT16(dw->p);
} }
INT32 DW_ReadINT32(DataWrap dw)
{
CheckEOF(dw, 4);
return READINT32(dw->p);
}
fixed_t DW_ReadFixed(DataWrap dw)
{
CheckEOF(dw, 4);
return READFIXED(dw->p);
}
char *DW_ReadStringn(DataWrap dw, size_t n) char *DW_ReadStringn(DataWrap dw, size_t n)
{ {
char *string = ZZ_Alloc(n+1); char *string = ZZ_Alloc(n+1);
......
...@@ -7,13 +7,16 @@ typedef struct DataWrap_s { ...@@ -7,13 +7,16 @@ typedef struct DataWrap_s {
jmp_buf *eofjmp; jmp_buf *eofjmp;
} *DataWrap; } *DataWrap;
UINT8 DW_ReadUINT8(struct DataWrap_s *); UINT8 DW_ReadUINT8(DataWrap);
UINT16 DW_ReadUINT16(struct DataWrap_s *); UINT16 DW_ReadUINT16(DataWrap);
UINT32 DW_ReadUINT32(struct DataWrap_s *); UINT32 DW_ReadUINT32(DataWrap);
SINT8 DW_ReadSINT8(struct DataWrap_s *); SINT8 DW_ReadSINT8(DataWrap);
INT16 DW_ReadINT16(struct DataWrap_s *); INT16 DW_ReadINT16(DataWrap);
INT32 DW_ReadINT32(DataWrap);
char *DW_ReadStringn(struct DataWrap_s *, size_t n); fixed_t DW_ReadFixed(DataWrap);
char *DW_ReadStringn(DataWrap, size_t n);
DataWrap D_NewDataWrap(const void *data, size_t len, jmp_buf *eofjmp); DataWrap D_NewDataWrap(const void *data, size_t len, jmp_buf *eofjmp);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment