home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Datafile PD-CD 3
/
PDCD_3.iso
/
languages
/
c
/
oslib
/
Examples
/
p2-743
< prev
next >
Wrap
Text File
|
1994-03-24
|
909b
|
42 lines
#include "hourglass.h"
#include "os.h"
#include "osfile.h"
extern byte Buffer [];
extern os_error *Process_Byte (byte);
os_error *do_load_and_process (char *file_name)
{ os_error *error = NULL;
int i, size;
bool done_on = FALSE;
if ((error = xosfile_load_stamped (file_name, Buffer, NULL, NULL, NULL,
&size, NULL)) != NULL)
goto finish; /*note that osfile_load loads a file at its load address*/
if (size != 0)
{ if ((error = xhourglass_on ()) != NULL)
goto finish;
done_on = TRUE;
for (i = 0; i < size; i++)
{ if ((error = xhourglass_percentage (100*i/size)) != NULL)
goto finish;
if ((error = Process_Byte (Buffer [i])) != NULL)
goto finish;
} }
finish:
if (done_on)
{ os_error *error1;
error1 = xhourglass_off ();
if (error == NULL) error = error1;
}
return error;
}