Home | History | Annotate | Download | only in host_src
      1 /*----------------------------------------------------------------------------
      2  *
      3  * File:
      4  * eas_host.h
      5  *
      6  * Contents and purpose:
      7  * This header defines the host wrapper functions for stdio, stdlib, etc.
      8  * The host application must provide an abstraction layer for these functions
      9  * to support certain features, such as SMAF and SMF-1 conversion.
     10  *
     11  * DO NOT MODIFY THIS FILE!
     12  *
     13  * Copyright 2005 Sonic Network Inc.
     14 
     15  * Licensed under the Apache License, Version 2.0 (the "License");
     16  * you may not use this file except in compliance with the License.
     17  * You may obtain a copy of the License at
     18  *
     19  *      http://www.apache.org/licenses/LICENSE-2.0
     20  *
     21  * Unless required by applicable law or agreed to in writing, software
     22  * distributed under the License is distributed on an "AS IS" BASIS,
     23  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     24  * See the License for the specific language governing permissions and
     25  * limitations under the License.
     26  *
     27  *----------------------------------------------------------------------------
     28  * Revision Control:
     29  *   $Revision: 82 $
     30  *   $Date: 2006-07-10 11:45:19 -0700 (Mon, 10 Jul 2006) $
     31  *----------------------------------------------------------------------------
     32 */
     33 
     34 // sentinel
     35 #ifndef _EAS_HOST_H
     36 #define _EAS_HOST_H
     37 
     38 #include "eas_types.h"
     39 
     40 /* for C++ linkage */
     41 #ifdef __cplusplus
     42 extern "C" {
     43 #endif
     44 
     45 /* initialization and shutdown routines */
     46 extern EAS_RESULT EAS_HWInit(EAS_HW_DATA_HANDLE *hwInstData);
     47 extern EAS_RESULT EAS_HWShutdown(EAS_HW_DATA_HANDLE hwInstData);
     48 
     49 /* threading */
     50 extern void* EAS_HWRegisterSignalHandler();
     51 extern EAS_RESULT EAS_HWUnRegisterSignalHandler(void *cookie);
     52 
     53 /* memory functions */
     54 extern void *EAS_HWMemSet(void *s, int c, EAS_I32 n);
     55 extern void *EAS_HWMemCpy(void *s1, const void *s2, EAS_I32 n);
     56 extern EAS_I32 EAS_HWMemCmp(const void *s1, const void *s2, EAS_I32 n);
     57 
     58 /* memory allocation */
     59 extern void *EAS_HWMalloc(EAS_HW_DATA_HANDLE hwInstData, EAS_I32 size);
     60 extern void EAS_HWFree(EAS_HW_DATA_HANDLE hwInstData, void *p);
     61 
     62 /* file I/O */
     63 extern EAS_RESULT EAS_HWOpenFile(EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_LOCATOR locator, EAS_FILE_HANDLE *pFile, EAS_FILE_MODE mode);
     64 extern EAS_RESULT EAS_HWReadFile(EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *pBuffer, EAS_I32 n, EAS_I32 *pBytesRead);
     65 extern EAS_RESULT EAS_HWGetByte(EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *p);
     66 extern EAS_RESULT EAS_HWGetWord (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *p, EAS_BOOL msbFirst);
     67 extern EAS_RESULT EAS_HWGetDWord (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *p, EAS_BOOL msbFirst);
     68 extern EAS_RESULT EAS_HWFilePos (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 *pPosition);
     69 extern EAS_RESULT EAS_HWFileSeek (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 position);
     70 extern EAS_RESULT EAS_HWFileSeekOfs (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 position);
     71 extern EAS_RESULT EAS_HWFileLength (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 *pLength);
     72 extern EAS_RESULT EAS_HWDupHandle (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_FILE_HANDLE* pFile);
     73 extern EAS_RESULT EAS_HWCloseFile (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file);
     74 
     75 /* vibrate, LED, and backlight functions */
     76 extern EAS_RESULT EAS_HWVibrate(EAS_HW_DATA_HANDLE hwInstData, EAS_BOOL state);
     77 extern EAS_RESULT EAS_HWLED(EAS_HW_DATA_HANDLE hwInstData, EAS_BOOL state);
     78 extern EAS_RESULT EAS_HWBackLight(EAS_HW_DATA_HANDLE hwInstData, EAS_BOOL state);
     79 
     80 #ifdef __cplusplus
     81 } /* end extern "C" */
     82 #endif
     83 
     84 
     85 /* host yield function */
     86 extern EAS_BOOL EAS_HWYield(EAS_HW_DATA_HANDLE hwInstData);
     87 #endif /* end _EAS_HOST_H */
     88