![Texas TMS320C6000 Programmer'S Reference Manual Download Page 29](http://html.mh-extra.com/html/texas/tms320c6000/tms320c6000_programmers-reference-manual_1093844029.webp)
File I/O Support for Embedded Systems
2-19
Operating System Abstraction API
A static buffer based system is more efficient for embedded systems since the
data must already be present in RAM or ROM. However, the efs_createfile()
function could easily be altered to use allocated buffers which are later freed
when efs_destroyfile() is called. These create and destroy functions are only
called by the sample application code, and thus the system programmer is free
to alter the operation of these functions – so long as they create ”files” that are
compatible with the rest of this API.
Get the Length of a File
efs_getfilesize
Syntax
INT32 efs_getfilesize( EFS_FILE *stream );
Parameter(s)
stream
Pointer to open stream (file)
Return Value
File size in bytes
Description
This function returns the length in bytes of the indicated file. The file must al-
ready have been opened via a call to efs_fopen().
Load Executable File and Return Entrypoint
efs_loadfunction
Syntax
EFSFUN efs_loadfunction( char *name );
Parameter(s)
name
Filename (max length of EFS_FILENAME_MAX)
Return Value
Pointer to executable function
Description
This function “loads” an executable file and returns a pointer to the entrypoint
function. The type EFSFUN is declared as:
typedef void (*EFSFUN)();
The application is really free to treat this function in whatever manner is re-
quired. This executable file is created with a call to efs_createfile() where the
pData parameter points to a function that is already loaded in memory. This
allows the HTTP server to call services “contained” in CGI files.
A static buffer based system is more efficient for embedded systems since the
data must already be present in RAM or ROM. However, the HTTP can be
made to work with physical CGI files by porting this function to load CGI.