156c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks/*---------------------------------------------------------------------------- 256c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks * 356c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks * File: 456c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks * eas_host.h 556c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks * 656c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks * Contents and purpose: 756c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks * This header defines the host wrapper functions for stdio, stdlib, etc. 856c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks * The host application must provide an abstraction layer for these functions 956c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks * to support certain features, such as SMAF and SMF-1 conversion. 1056c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks * 1156c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks * DO NOT MODIFY THIS FILE! 1256c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks * 1356c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks * Copyright 2005 Sonic Network Inc. 147df30109963092559d3760c0661a020f9daf1030The Android Open Source Project 157df30109963092559d3760c0661a020f9daf1030The Android Open Source Project * Licensed under the Apache License, Version 2.0 (the "License"); 167df30109963092559d3760c0661a020f9daf1030The Android Open Source Project * you may not use this file except in compliance with the License. 177df30109963092559d3760c0661a020f9daf1030The Android Open Source Project * You may obtain a copy of the License at 187df30109963092559d3760c0661a020f9daf1030The Android Open Source Project * 197df30109963092559d3760c0661a020f9daf1030The Android Open Source Project * http://www.apache.org/licenses/LICENSE-2.0 207df30109963092559d3760c0661a020f9daf1030The Android Open Source Project * 217df30109963092559d3760c0661a020f9daf1030The Android Open Source Project * Unless required by applicable law or agreed to in writing, software 227df30109963092559d3760c0661a020f9daf1030The Android Open Source Project * distributed under the License is distributed on an "AS IS" BASIS, 237df30109963092559d3760c0661a020f9daf1030The Android Open Source Project * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 247df30109963092559d3760c0661a020f9daf1030The Android Open Source Project * See the License for the specific language governing permissions and 257df30109963092559d3760c0661a020f9daf1030The Android Open Source Project * limitations under the License. 2656c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks * 2756c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks *---------------------------------------------------------------------------- 2856c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks * Revision Control: 2956c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks * $Revision: 82 $ 3056c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks * $Date: 2006-07-10 11:45:19 -0700 (Mon, 10 Jul 2006) $ 3156c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks *---------------------------------------------------------------------------- 3256c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks*/ 3356c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks 3456c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks// sentinel 3556c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks#ifndef _EAS_HOST_H 3656c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks#define _EAS_HOST_H 3756c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks 3856c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks#include "eas_types.h" 3956c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks 4056c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks/* for C++ linkage */ 4156c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks#ifdef __cplusplus 4256c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparksextern "C" { 4356c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks#endif 4456c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks 4556c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks/* initialization and shutdown routines */ 4656c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparksextern EAS_RESULT EAS_HWInit(EAS_HW_DATA_HANDLE *hwInstData); 4756c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparksextern EAS_RESULT EAS_HWShutdown(EAS_HW_DATA_HANDLE hwInstData); 4856c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks 4956c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks/* threading */ 5056c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparksextern void* EAS_HWRegisterSignalHandler(); 5156c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparksextern EAS_RESULT EAS_HWUnRegisterSignalHandler(void *cookie); 5256c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks 5356c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks/* memory functions */ 5456c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparksextern void *EAS_HWMemSet(void *s, int c, EAS_I32 n); 5556c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparksextern void *EAS_HWMemCpy(void *s1, const void *s2, EAS_I32 n); 5656c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparksextern EAS_I32 EAS_HWMemCmp(const void *s1, const void *s2, EAS_I32 n); 5756c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks 5856c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks/* memory allocation */ 5956c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparksextern void *EAS_HWMalloc(EAS_HW_DATA_HANDLE hwInstData, EAS_I32 size); 6056c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparksextern void EAS_HWFree(EAS_HW_DATA_HANDLE hwInstData, void *p); 6156c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks 6256c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks/* file I/O */ 6356c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparksextern EAS_RESULT EAS_HWOpenFile(EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_LOCATOR locator, EAS_FILE_HANDLE *pFile, EAS_FILE_MODE mode); 6456c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparksextern EAS_RESULT EAS_HWReadFile(EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *pBuffer, EAS_I32 n, EAS_I32 *pBytesRead); 6556c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparksextern EAS_RESULT EAS_HWGetByte(EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *p); 6656c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparksextern EAS_RESULT EAS_HWGetWord (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *p, EAS_BOOL msbFirst); 6756c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparksextern EAS_RESULT EAS_HWGetDWord (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *p, EAS_BOOL msbFirst); 6856c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparksextern EAS_RESULT EAS_HWFilePos (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 *pPosition); 6956c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparksextern EAS_RESULT EAS_HWFileSeek (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 position); 7056c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparksextern EAS_RESULT EAS_HWFileSeekOfs (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 position); 7156c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparksextern EAS_RESULT EAS_HWFileLength (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 *pLength); 7256c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparksextern EAS_RESULT EAS_HWDupHandle (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_FILE_HANDLE* pFile); 7356c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparksextern EAS_RESULT EAS_HWCloseFile (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file); 7456c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks 7556c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks/* vibrate, LED, and backlight functions */ 7656c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparksextern EAS_RESULT EAS_HWVibrate(EAS_HW_DATA_HANDLE hwInstData, EAS_BOOL state); 7756c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparksextern EAS_RESULT EAS_HWLED(EAS_HW_DATA_HANDLE hwInstData, EAS_BOOL state); 7856c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparksextern EAS_RESULT EAS_HWBackLight(EAS_HW_DATA_HANDLE hwInstData, EAS_BOOL state); 7956c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks 8056c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks#ifdef __cplusplus 8156c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks} /* end extern "C" */ 8256c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks#endif 8356c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks 8456c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks 8556c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks/* host yield function */ 8656c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparksextern EAS_BOOL EAS_HWYield(EAS_HW_DATA_HANDLE hwInstData); 8756c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks#endif /* end _EAS_HOST_H */ 88