J. Duke | 319a3b9 | 2007-12-01 00:00:00 +0000 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 1994-1999 Sun Microsystems, Inc. All Rights Reserved. |
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
| 4 | * |
| 5 | * This code is free software; you can redistribute it and/or modify it |
| 6 | * under the terms of the GNU General Public License version 2 only, as |
| 7 | * published by the Free Software Foundation. Sun designates this |
| 8 | * particular file as subject to the "Classpath" exception as provided |
| 9 | * by Sun in the LICENSE file that accompanied this code. |
| 10 | * |
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT |
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 14 | * version 2 for more details (a copy is included in the LICENSE file that |
| 15 | * accompanied this code). |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License version |
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, |
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
| 20 | * |
| 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
| 22 | * CA 95054 USA or visit www.sun.com if you need additional information or |
| 23 | * have any questions. |
| 24 | */ |
| 25 | |
| 26 | #ifndef _JAVASOFT_SYS_API_H_ |
| 27 | #define _JAVASOFT_SYS_API_H_ |
| 28 | |
| 29 | #include "hpi.h" |
| 30 | |
| 31 | extern HPI_MemoryInterface *hpi_memory_interface; |
| 32 | extern HPI_LibraryInterface *hpi_library_interface; |
| 33 | extern HPI_SystemInterface *hpi_system_interface; |
| 34 | extern HPI_ThreadInterface *hpi_thread_interface; |
| 35 | extern HPI_FileInterface *hpi_file_interface; |
| 36 | extern HPI_SocketInterface *hpi_socket_interface; |
| 37 | |
| 38 | #define sysMalloc(x) hpi_memory_interface->Malloc(x) |
| 39 | #define sysRealloc(x,y) hpi_memory_interface->Realloc(x,y) |
| 40 | #define sysFree(x) hpi_memory_interface->Free(x) |
| 41 | #define sysCalloc(x,y) hpi_memory_interface->Calloc(x,y) |
| 42 | #define sysStrdup(x) hpi_memory_interface->Strdup(x) |
| 43 | #define sysMapMem(x,y) hpi_memory_interface->MapMem(x,y) |
| 44 | #define sysUnmapMem(x,y,z) hpi_memory_interface->UnmapMem(x,y,z) |
| 45 | #define sysCommitMem(x,y,z) hpi_memory_interface->CommitMem(x,y,z) |
| 46 | #define sysDecommitMem(x,y,z) hpi_memory_interface->DecommitMem(x,y,z) |
| 47 | #define sysAllocBlock(x,y) hpi_memory_interface->AllocBlock(x,y) |
| 48 | #define sysFreeBlock(x) hpi_memory_interface->FreeBlock(x) |
| 49 | |
| 50 | #define sysBuildLibName(a,b,c,d) hpi_library_interface->BuildLibName(a,b,c,d) |
| 51 | #define sysBuildFunName(a,b,c,d) hpi_library_interface->BuildFunName(a,b,c,d) |
| 52 | #define sysLoadLibrary(a,b,c) hpi_library_interface->LoadLibrary(a,b,c) |
| 53 | #define sysUnloadLibrary(a) hpi_library_interface->UnloadLibrary(a) |
| 54 | #define sysFindLibraryEntry(a,b) hpi_library_interface->FindLibraryEntry(a,b) |
| 55 | |
| 56 | #define sysGetSysInfo() hpi_system_interface->GetSysInfo() |
| 57 | #define sysGetMilliTicks() hpi_system_interface->GetMilliTicks() |
| 58 | #define sysTimeMillis() hpi_system_interface->TimeMillis() |
| 59 | |
| 60 | #define sysSignal(a,b) hpi_system_interface->Signal(a,b) |
| 61 | #define sysRaise(a) hpi_system_interface->Raise(a) |
| 62 | #define sysSignalNotify(a) hpi_system_interface->SignalNotify(a) |
| 63 | #define sysSignalWait() hpi_system_interface->SignalWait() |
| 64 | #define sysShutdown() hpi_system_interface->Shutdown() |
| 65 | #define sysSetLoggingLevel(a) hpi_system_interface->SetLoggingLevel(a) |
| 66 | #define sysSetMonitoringOn(a) hpi_system_interface->SetMonitoringOn(a) |
| 67 | #define sysGetLastErrorString(a,b) hpi_system_interface->GetLastErrorString(a,b) |
| 68 | |
| 69 | #define sysThreadBootstrap(a,b,c) hpi_thread_interface->ThreadBootstrap(a,b,c) |
| 70 | #define sysThreadCreate(a,b,c,d) hpi_thread_interface->ThreadCreate(a,b,c,d) |
| 71 | #define sysThreadSelf() hpi_thread_interface->ThreadSelf() |
| 72 | #define sysThreadYield() hpi_thread_interface->ThreadYield() |
| 73 | #define sysThreadSuspend(a) hpi_thread_interface->ThreadSuspend(a) |
| 74 | #define sysThreadResume(a) hpi_thread_interface->ThreadResume(a) |
| 75 | #define sysThreadSetPriority(a,b) hpi_thread_interface->ThreadSetPriority(a,b) |
| 76 | #define sysThreadGetPriority(a,b) hpi_thread_interface->ThreadGetPriority(a,b) |
| 77 | #define sysThreadStackPointer(a) hpi_thread_interface->ThreadStackPointer(a) |
| 78 | #define sysThreadStackTop(a) hpi_thread_interface->ThreadStackTop(a) |
| 79 | #define sysThreadRegs(a,b) hpi_thread_interface->ThreadRegs(a,b) |
| 80 | #define sysThreadSingle() hpi_thread_interface->ThreadSingle() |
| 81 | #define sysThreadMulti() hpi_thread_interface->ThreadMulti() |
| 82 | #define sysThreadCheckStack() hpi_thread_interface->ThreadCheckStack() |
| 83 | #define sysThreadPostException(a,b) \ |
| 84 | hpi_thread_interface->ThreadPostException(a,b) |
| 85 | #define sysThreadInterrupt(a) hpi_thread_interface->ThreadInterrupt(a) |
| 86 | #define sysThreadIsInterrupted(a,b) \ |
| 87 | hpi_thread_interface->ThreadIsInterrupted(a,b) |
| 88 | #define sysThreadAlloc(a) hpi_thread_interface->ThreadAlloc(a) |
| 89 | #define sysThreadFree() hpi_thread_interface->ThreadFree() |
| 90 | #define sysThreadCPUTime() hpi_thread_interface->ThreadCPUTime() |
| 91 | #define sysThreadGetStatus(a,b) hpi_thread_interface->ThreadGetStatus(a,b) |
| 92 | #define sysThreadEnumerateOver(a,b) \ |
| 93 | hpi_thread_interface->ThreadEnumerateOver(a,b) |
| 94 | #define sysThreadIsRunning(a) hpi_thread_interface->ThreadIsRunning(a) |
| 95 | #define sysThreadProfSuspend(a) hpi_thread_interface->ThreadProfSuspend(a) |
| 96 | #define sysThreadProfResume(a) hpi_thread_interface->ThreadProfResume(a) |
| 97 | #define sysAdjustTimeSlice(a) hpi_thread_interface->AdjustTimeSlice(a) |
| 98 | |
| 99 | #define sysMonitorSizeof() hpi_thread_interface->MonitorSizeof() |
| 100 | #define sysMonitorInit(a) hpi_thread_interface->MonitorInit(a) |
| 101 | #define sysMonitorDestroy(a) hpi_thread_interface->MonitorDestroy(a) |
| 102 | #define sysMonitorEnter(a,b) hpi_thread_interface->MonitorEnter(a,b) |
| 103 | #define sysMonitorEntered(a,b) hpi_thread_interface->MonitorEntered(a,b) |
| 104 | #define sysMonitorExit(a,b) hpi_thread_interface->MonitorExit(a,b) |
| 105 | #define sysMonitorNotify(a,b) hpi_thread_interface->MonitorNotify(a,b) |
| 106 | #define sysMonitorNotifyAll(a,b) hpi_thread_interface->MonitorNotifyAll(a,b) |
| 107 | #define sysMonitorWait(a,b,c) hpi_thread_interface->MonitorWait(a,b,c) |
| 108 | #define sysMonitorInUse(a) hpi_thread_interface->MonitorInUse(a) |
| 109 | #define sysMonitorOwner(a) hpi_thread_interface->MonitorOwner(a) |
| 110 | #define sysMonitorGetInfo(a,b) hpi_thread_interface->MonitorGetInfo(a,b) |
| 111 | |
| 112 | #define sysThreadInterruptEvent() hpi_thread_interface->ThreadInterruptEvent() |
| 113 | #define sysThreadNativeID(a) hpi_thread_interface->ThreadNativeID(a) |
| 114 | |
| 115 | #define sysNativePath(a) hpi_file_interface->NativePath(a) |
| 116 | #define sysFileType(a) hpi_file_interface->FileType(a) |
| 117 | #define sysOpen(a,b,c) hpi_file_interface->Open(a,b,c) |
| 118 | #define sysClose(a) hpi_file_interface->Close(a) |
| 119 | #define sysSeek(a,b,c) hpi_file_interface->Seek(a,b,c) |
| 120 | #define sysSetLength(a,b) hpi_file_interface->SetLength(a,b) |
| 121 | #define sysSync(a) hpi_file_interface->Sync(a) |
| 122 | #define sysAvailable(a,b) hpi_file_interface->Available(a,b) |
| 123 | #define sysRead(a,b,c) hpi_file_interface->Read(a,b,c) |
| 124 | #define sysWrite(a,b,c) hpi_file_interface->Write(a,b,c) |
| 125 | #define sysFileSizeFD(a,b) hpi_file_interface->FileSizeFD(a,b) |
| 126 | |
| 127 | #define sysSocketClose(a) hpi_socket_interface->Close(a) |
| 128 | #define sysSocketShutdown(a,b) hpi_socket_interface->SocketShutdown(a,b) |
| 129 | #define sysSocketAvailable(a,b) hpi_socket_interface->Available(a,b) |
| 130 | #define sysConnect(a,b,c) hpi_socket_interface->Connect(a,b,c) |
| 131 | #define sysBind(a,b,c) hpi_socket_interface->Bind(a,b,c) |
| 132 | #define sysAccept(a,b,c) hpi_socket_interface->Accept(a,b,c) |
| 133 | #define sysGetSockName(a,b,c) hpi_socket_interface->GetSocketName(a,b,c) |
| 134 | #define sysSendTo(a,b,c,d,e,f) hpi_socket_interface->SendTo(a,b,c,d,e,f) |
| 135 | #define sysRecvFrom(a,b,c,d,e,f) hpi_socket_interface->RecvFrom(a,b,c,d,e,f) |
| 136 | #define sysListen(a,b) hpi_socket_interface->Listen(a,b) |
| 137 | #define sysRecv(a,b,c,d) hpi_socket_interface->Recv(a,b,c,d) |
| 138 | #define sysSend(a,b,c,d) hpi_socket_interface->Send(a,b,c,d) |
| 139 | #define sysTimeout(a,b) hpi_socket_interface->Timeout(a,b) |
| 140 | #define sysGetHostName(a, b) hpi_socket_interface->GetHostName(a, b) |
| 141 | #define sysGetHostByAddr(a, b, c) hpi_socket_interface->GetHostByAddr(a, b, c) |
| 142 | #define sysGetHostByName(a) hpi_socket_interface->GetHostByName(a) |
| 143 | #define sysSocket(a,b,c) hpi_socket_interface->Socket(a,b,c) |
| 144 | #define sysGetSockOpt(a, b, c, d, e) hpi_socket_interface->SocketGetOption(a, b, c, d, e) |
| 145 | #define sysSetSockOpt(a, b, c, d, e) hpi_socket_interface->SocketSetOption(a, b, c, d, e) |
| 146 | #define sysGetProtoByName(a) hpi_socket_interface->GetProtoByName(a) |
| 147 | |
| 148 | #define SYS_SIG_DFL HPI_SIG_DFL |
| 149 | #define SYS_SIG_ERR HPI_SIG_ERR |
| 150 | #define SYS_SIG_IGN HPI_SIG_IGN |
| 151 | |
| 152 | #define SYS_OK HPI_OK |
| 153 | #define SYS_ERR HPI_ERR |
| 154 | #define SYS_INTRPT HPI_INTRPT |
| 155 | #define SYS_TIMEOUT HPI_TIMEOUT |
| 156 | #define SYS_NOMEM HPI_NOMEM |
| 157 | #define SYS_NORESOURCE HPI_NORESOURCE |
| 158 | |
| 159 | #define SYS_THREAD_RUNNABLE HPI_THREAD_RUNNABLE |
| 160 | #define SYS_THREAD_MONITOR_WAIT HPI_THREAD_MONITOR_WAIT |
| 161 | #define SYS_THREAD_CONDVAR_WAIT HPI_THREAD_CONDVAR_WAIT |
| 162 | |
| 163 | #define MinimumPriority HPI_MINIMUM_PRIORITY |
| 164 | #define MaximumPriority HPI_MAXIMUM_PRIORITY |
| 165 | #define NormalPriority HPI_NORMAL_PRIORITY |
| 166 | |
| 167 | #define SYS_THREAD_SUSPENDED HPI_THREAD_SUSPENDED |
| 168 | #define SYS_THREAD_INTERRUPTED HPI_THREAD_INTERRUPTED |
| 169 | |
| 170 | #define PAGE_ALIGNMENT HPI_PAGE_ALIGNMENT |
| 171 | |
| 172 | #define SYS_TIMEOUT_INFINITY HPI_TIMEOUT_INFINITY |
| 173 | |
| 174 | #define SYS_FILETYPE_REGULAR HPI_FILETYPE_REGULAR |
| 175 | #define SYS_FILETYPE_DIRECTORY HPI_FILETYPE_DIRECTORY |
| 176 | #define SYS_FILETYPE_OTHER HPI_FILETYPE_OTHER |
| 177 | |
| 178 | #endif /* !_JAVASOFT_SYS_API_H_ */ |