Added assertions
git-svn-id: svn://svn.cc65.org/cc65/trunk@2202 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
|
||||
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
/* common */
|
||||
#include "xmalloc.h"
|
||||
@@ -51,6 +52,28 @@
|
||||
|
||||
|
||||
|
||||
void FileSetPos (FILE* F, unsigned long Pos)
|
||||
/* Seek to the given absolute position, fail on errors */
|
||||
{
|
||||
if (fseek (F, Pos, SEEK_SET) != 0) {
|
||||
Error ("Cannot seek: %s", strerror (errno));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
unsigned long FileGetPos (FILE* F)
|
||||
/* Return the current file position, fail on errors */
|
||||
{
|
||||
long Pos = ftell (F);
|
||||
if (Pos < 0) {
|
||||
Error ("Error in ftell: %s", strerror (errno));
|
||||
}
|
||||
return Pos;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Write8 (FILE* F, unsigned Val)
|
||||
/* Write an 8 bit value to the file */
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user