Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

kfiledefs.h File Reference

Defines data types and structures used by KFILE module. More...

#include <dsplink.h>

Include dependency graph for kfiledefs.h:

Go to the source code of this file.

Data Structures

struct  KFILE_Interface_tag
struct  KFileObject_tag

FileName

Definition for identifying files. ============================================================================

============================================================================

typedef Pstr FileName

FnKfileOpen

Signature of the function for opening a handle to a KFILE file.

============================================================================

Parameters:
fileName Name of the file to be opened.
mode Mode for opening the file. This argument is case-sensitive. Expected modes are: "r" for read, "w" for write and "a" for append.
fileHandle Pointer to the file object.
Returns:
DSP_SOK Operation successfully completed. DSP_EINVALIDARG Invalid arguments. DSP_EFILE File not found. DSP_EMEMORY Out of memory error.
Precondition:
Subcomponent must be initialized. fileName must be valid. mode must be valid. fileHandle must be valid.
Postcondition:
fileHandle contains the fileObject on success.
See also:
FnKfileClose ============================================================================


typedef DSP_STATUS(* FnKfileOpen )(IN CONST FileName fileName, IN CONST Char8 *mode, IN Void **fileHandlePtr)

FnKfileClose

Signature of the function for closing a handle to a KFILE file.

============================================================================

Parameters:
fileHandle Handle of file to be closed, returned from KFILE_Open.
Returns:
DSP_SOK Operation successfully completed. DSP_EFILE File is not open. DSP_EPOINTER Invalid file object.
Precondition:
Subcomponent must be initialized. fileHandle must be a valid handle to a file opened earlier.
Postcondition:
Memory allocated for fileHandle is freed.
See also:
FnKfileOpen ============================================================================


typedef DSP_STATUS(* FnKfileClose )(IN Void *fileHandle)

FnKfileRead

Signature of the function for reading from a KFILE file.

============================================================================

Parameters:
buffer Buffer in which the contents of file are read.
size Size of each object to read from file.
count Number of objects to read.
fileHandle KFileObject to read from.
Returns:
DSP_SOK Operation successfully completed. DSP_EINVALIDARG Invalid arguments. DSP_EPOINTER Invalid file object. DSP_EFILE File is not open or error reading file. DSP_ERANGE The requested number of bytes is beyond EOF.
Precondition:
Subcomponent must be initialized. fileHandle must be a valid file pointer opened earlier.
Postcondition:
None
See also:
FnKfileOpen ============================================================================


typedef DSP_STATUS(* FnKfileRead )(OUT Char8 *buffer, IN Uint32 size, IN Uint32 count, IN Void *fileHandle)

FnKfileSeek

Signature of the function for repositioning the file pointer within a KFILE file.

============================================================================

Parameters:
fileHandle The fileObject to seek into.
offset Offset for positioning the file pointer.
origin Origin for calculating absolute position where file pointer is to be positioned. This can take the following values: KFILE_SeekSet KFILE_SeekCur KFILE_SeekEnd
Returns:
DSP_SOK Operation successfully completed. DSP_EINVALIDARG Invalid arguments. DSP_EPOINTER Invalid file object. DSP_EFILE File is not opened. DSP_ERANGE Offset and origin combination is beyond file size range.
Precondition:
Subcomponent must be initialized. fileHandle must be a valid handle to a file opened earlier.
Postcondition:
None
See also:
FnKfileTell ============================================================================


typedef DSP_STATUS(* FnKfileSeek )(IN Void *fileHandle, IN Int32 offset, IN KFILE_FileSeek origin)

FnKfileTell

Signature of the function for returning the current file pointer position within a KFILE file.

============================================================================

Parameters:
fileHandle The fileObject pointer.
pos Out argument for holding the current file position indicator value.
Returns:
DSP_SOK Operation successfully completed. DSP_EINVALIDARG Invalid arguments. DSP_EPOINTER Invalid file object. DSP_EFILE file is not opened.
Precondition:
Subcomponent must be initialized. fileHandle must be a valid handle to a file opened earlier.
Postcondition:
None
See also:
FnKfileSeek ============================================================================


typedef DSP_STATUS(* FnKfileTell )(IN Void *fileHandle, OUT Int32 *pos)

FnKfileGetSize

Signature of the function for returning the file size of the KFILE file.

============================================================================

Parameters:
fileHandle Handle to the file object.
size Out argument for holding the file size.
Returns:
None.
Precondition:
Subcomponent must be initialized. fileHandle must be a valid handle to a file opened earlier.
Postcondition:
None
See also:
FnKfileSeek ============================================================================


typedef Void(* FnKfileGetSize )(IN Void *fileHandle, OUT Uint32 *size)

KFILE_Interface

Structure containing interface functions exported by the KFILE OSAL subcomponent.

============================================================================

Parameters:
kfileOpen Function pointer providing the abstraction to the KFILE module's open function
kfileClose Function pointer providing the abstraction to the KFILE module's close function.
kfileRead Function pointer providing the abstraction to the KFILE module's read function.
kfileSeek Function pointer providing the abstraction to the KFILE module's seek function.
kfileTell Function pointer providing the abstraction to the KFILE module's tell function.
kfileGetSize Function pointer providing the abstraction to the KFILE module's getSize function. ============================================================================


typedef KFILE_Interface_tag KFILE_Interface

KFileObject

Definition of the KFILE object used by all KFILE functions.

============================================================================

Parameters:
signature Signature of the KFILE object.
fnTable Pointer to the KFILE function table.
fileObj Pointer to the KFILE module-specific KFILE object.
isOpen Flag to track whether the file is isOpen.
See also:
KFILE_Open () ============================================================================


typedef KFileObject_tag KFileObject

KFILE_Seek

Enumerates the values used for repositioning the file position indicator.

============================================================================

Parameters:
KFILE_SeekSet Seek from beginning of file.
KFILE_SeekCur Seek from current position.
KFILE_SeekEnd Seek from end of file. ============================================================================


enum  KFILE_FileSeek { KFILE_SeekSet = 0x00, KFILE_SeekCur = 0x01, KFILE_SeekEnd = 0x02 }

Defines

#define KFILEDEFS_H


Detailed Description

Defines data types and structures used by KFILE module.

============================================================================

Path:
/db/swcoe_asp/DSPLINK_Build/dsplink_linux_1_65_00_03/dsplink/gpp/inc/usr/
Version:
1.65.00.03 ============================================================================
Copyright:
Copyright (C) 2002-2009, Texas Instruments Incorporated - http://www.ti.com/
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

* Neither the name of Texas Instruments Incorporated nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ============================================================================

Definition in file kfiledefs.h.


Define Documentation

#define KFILEDEFS_H
 

Definition at line 44 of file kfiledefs.h.


Typedef Documentation

typedef Pstr FileName
 

Definition at line 82 of file kfiledefs.h.

typedef DSP_STATUS(* FnKfileClose)(IN Void *fileHandle)
 

Definition at line 146 of file kfiledefs.h.

typedef Void(* FnKfileGetSize)(IN Void *fileHandle, OUT Uint32 *size)
 

Definition at line 283 of file kfiledefs.h.

typedef DSP_STATUS(* FnKfileOpen)(IN CONST FileName fileName, IN CONST Char8 *mode, IN Void **fileHandlePtr)
 

Definition at line 118 of file kfiledefs.h.

typedef DSP_STATUS(* FnKfileRead)(OUT Char8 *buffer, IN Uint32 size, IN Uint32 count, IN Void *fileHandle)
 

Definition at line 182 of file kfiledefs.h.

typedef DSP_STATUS(* FnKfileSeek)(IN Void *fileHandle, IN Int32 offset, IN KFILE_FileSeek origin)
 

Definition at line 224 of file kfiledefs.h.

typedef DSP_STATUS(* FnKfileTell)(IN Void *fileHandle, OUT Int32 *pos)
 

Definition at line 258 of file kfiledefs.h.

typedef struct KFILE_Interface_tag KFILE_Interface
 

typedef struct KFileObject_tag KFileObject
 


Enumeration Type Documentation

enum KFILE_FileSeek
 

Enumerator:
KFILE_SeekSet 
KFILE_SeekCur 
KFILE_SeekEnd 

Definition at line 69 of file kfiledefs.h.

00069              {
00070     KFILE_SeekSet = 0x00,
00071     KFILE_SeekCur = 0x01,
00072     KFILE_SeekEnd = 0x02
00073 } KFILE_FileSeek ;


Generated on Fri Jul 16 14:34:07 2010 for DSP/BIOSLink by  doxygen 1.4.4