• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 /* memory functions */
50 extern void *EAS_HWMemSet(void *s, int c, EAS_I32 n);
51 extern void *EAS_HWMemCpy(void *s1, const void *s2, EAS_I32 n);
52 extern EAS_I32 EAS_HWMemCmp(const void *s1, const void *s2, EAS_I32 n);
53 
54 /* memory allocation */
55 extern void *EAS_HWMalloc(EAS_HW_DATA_HANDLE hwInstData, EAS_I32 size);
56 extern void EAS_HWFree(EAS_HW_DATA_HANDLE hwInstData, void *p);
57 
58 /* file I/O */
59 extern EAS_RESULT EAS_HWOpenFile(EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_LOCATOR locator, EAS_FILE_HANDLE *pFile, EAS_FILE_MODE mode);
60 extern EAS_RESULT EAS_HWReadFile(EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *pBuffer, EAS_I32 n, EAS_I32 *pBytesRead);
61 extern EAS_RESULT EAS_HWGetByte(EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *p);
62 extern EAS_RESULT EAS_HWGetWord (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *p, EAS_BOOL msbFirst);
63 extern EAS_RESULT EAS_HWGetDWord (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *p, EAS_BOOL msbFirst);
64 extern EAS_RESULT EAS_HWFilePos (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 *pPosition);
65 extern EAS_RESULT EAS_HWFileSeek (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 position);
66 extern EAS_RESULT EAS_HWFileSeekOfs (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 position);
67 extern EAS_RESULT EAS_HWFileLength (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 *pLength);
68 extern EAS_RESULT EAS_HWDupHandle (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_FILE_HANDLE* pFile);
69 extern EAS_RESULT EAS_HWCloseFile (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file);
70 
71 /* vibrate, LED, and backlight functions */
72 extern EAS_RESULT EAS_HWVibrate(EAS_HW_DATA_HANDLE hwInstData, EAS_BOOL state);
73 extern EAS_RESULT EAS_HWLED(EAS_HW_DATA_HANDLE hwInstData, EAS_BOOL state);
74 extern EAS_RESULT EAS_HWBackLight(EAS_HW_DATA_HANDLE hwInstData, EAS_BOOL state);
75 
76 #ifdef __cplusplus
77 } /* end extern "C" */
78 #endif
79 
80 
81 /* host yield function */
82 extern EAS_BOOL EAS_HWYield(EAS_HW_DATA_HANDLE hwInstData);
83 #endif /* end _EAS_HOST_H */
84