first commit
This commit is contained in:
37
project/fm_viewer/data/fileio.c
Normal file
37
project/fm_viewer/data/fileio.c
Normal file
@@ -0,0 +1,37 @@
|
||||
#include "fileio.h"
|
||||
|
||||
int read_long(FILE *in)
|
||||
{
|
||||
int c;
|
||||
|
||||
c=getc(in);
|
||||
c=c+(getc(in)<<8);
|
||||
c=c+(getc(in)<<16);
|
||||
c=c+(getc(in)<<24);
|
||||
return c;
|
||||
}
|
||||
|
||||
int read_word(FILE *in)
|
||||
{
|
||||
int c;
|
||||
|
||||
c=getc(in);
|
||||
c=c+(getc(in)<<8);
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
int read_chars(FILE *in, char *s, int count)
|
||||
{
|
||||
int t;
|
||||
|
||||
for (t=0; t<count; t++)
|
||||
{
|
||||
s[t]=getc(in);
|
||||
}
|
||||
|
||||
s[t]=0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user