Kaydet (Commit) 164b6ce7 authored tarafından Arnaud Versini's avatar Arnaud Versini

General cleanup in sal module for all and unix.

Remove useless comments and header, and de duplicate a small declaration.

Change-Id: I0d4475cbbd61ea964f8e586cf0e1f68eb91c4948
Reviewed-on: https://gerrit.libreoffice.org/6016Reviewed-by: 's avatarArnaud Versini <arnaud.versini@libreoffice.org>
Tested-by: 's avatarArnaud Versini <arnaud.versini@libreoffice.org>
üst 9fb9b057
......@@ -66,7 +66,7 @@ inline bool isSubStr( char const* pStr, rtl::OString const& subStr )
return rtl_str_indexOfStr( pStr, subStr.getStr() ) >= 0;
}
struct DebugBaseMutex : ::rtl::Static<osl::Mutex, DebugBaseMutex> {};
struct DebugBaseMutex : rtl::Static<osl::Mutex, DebugBaseMutex> {};
} // anon namespace
......
......@@ -25,7 +25,6 @@
#include "sal/log.hxx"
#include "osl/module.h"
#include "osl/module.hxx"
#include "osl/thread.h"
#include "rtl/malformeduriexception.hxx"
#include "rtl/uri.hxx"
#include "rtl/ustring.h"
......@@ -40,22 +39,22 @@ oslModule SAL_CALL osl_loadModuleRelative(
oslGenericFunction const baseModule, rtl_uString * const relativePath,
sal_Int32 const mode)
{
::rtl::OUString base;
if (!::osl::Module::getUrlFromAddress(baseModule, base)) {
rtl::OUString base;
if (!osl::Module::getUrlFromAddress(baseModule, base)) {
SAL_INFO("sal.osl","osl::Module::getUrlFromAddress failed");
return NULL;
}
::rtl::OUString abs;
rtl::OUString abs;
try {
abs = ::rtl::Uri::convertRelToAbs(base, relativePath);
} catch (const ::rtl::MalformedUriException & e) {
abs = rtl::Uri::convertRelToAbs(base, relativePath);
} catch (const rtl::MalformedUriException & e) {
(void) e; // avoid warnings
SAL_INFO("sal.osl",
"rtl::MalformedUriException <" << e.getMessage() << ">");
//TODO: let some OSL_TRACE variant take care of text conversion?
return NULL;
}
return ::osl_loadModule(abs.pData, mode);
return osl_loadModule(abs.pData, mode);
}
#endif // !DISABLE_DYNLOADING
......
......@@ -17,9 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "rtl/ustring.hxx"
#include "osl/time.h"
#include <stdio.h>
/*
......
......@@ -19,7 +19,7 @@
#if defined (SOLARIS) || defined (FREEBSD) || defined (NETBSD) || \
defined (OPENBSD) || defined (DRAGONFLY)
defined (OPENBSD) || defined (DRAGONFLY) || defined (MACOSX)
#ifdef __cplusplus
extern "C" {
......@@ -53,22 +53,4 @@ struct frame {
#include <execinfo.h>
#endif
#if defined (MACOSX)
#ifdef __cplusplus
extern "C" {
#endif
/* backtrace function with same behaviour as defined in GNU libc */
int backtrace( void **buffer, int max_frames );
void backtrace_symbols_fd( void **buffer, int size, int fd );
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* defined MACOSX */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -37,9 +37,6 @@ typedef struct _oslConditionImpl
} oslConditionImpl;
/*****************************************************************************/
/* osl_createCondition */
/*****************************************************************************/
oslCondition SAL_CALL osl_createCondition()
{
oslConditionImpl* pCond;
......@@ -89,9 +86,6 @@ oslCondition SAL_CALL osl_createCondition()
return (oslCondition)pCond;
}
/*****************************************************************************/
/* osl_destroyCondition */
/*****************************************************************************/
void SAL_CALL osl_destroyCondition(oslCondition Condition)
{
oslConditionImpl* pCond;
......@@ -118,9 +112,6 @@ void SAL_CALL osl_destroyCondition(oslCondition Condition)
return;
}
/*****************************************************************************/
/* osl_setCondition */
/*****************************************************************************/
sal_Bool SAL_CALL osl_setCondition(oslCondition Condition)
{
oslConditionImpl* pCond;
......@@ -171,9 +162,6 @@ sal_Bool SAL_CALL osl_setCondition(oslCondition Condition)
}
/*****************************************************************************/
/* osl_resetCondition */
/*****************************************************************************/
sal_Bool SAL_CALL osl_resetCondition(oslCondition Condition)
{
oslConditionImpl* pCond;
......@@ -212,9 +200,6 @@ sal_Bool SAL_CALL osl_resetCondition(oslCondition Condition)
return sal_True;
}
/*****************************************************************************/
/* osl_waitCondition */
/*****************************************************************************/
oslConditionResult SAL_CALL osl_waitCondition(oslCondition Condition, const TimeValue* pTimeout)
{
oslConditionImpl* pCond;
......@@ -315,9 +300,6 @@ oslConditionResult SAL_CALL osl_waitCondition(oslCondition Condition, const Time
return Result;
}
/*****************************************************************************/
/* osl_checkCondition */
/*****************************************************************************/
sal_Bool SAL_CALL osl_checkCondition(oslCondition Condition)
{
sal_Bool State;
......
......@@ -60,9 +60,7 @@ static void osl_diagnose_backtrace_Impl (
((f != 0) ? (*(f))((s)) : (void)fprintf(stderr, "%s", (s)))
#if defined (LINUX) || defined (SOLARIS)
/************************************************************************/
/* osl_diagnose_frame_Impl */
/************************************************************************/
static void osl_diagnose_frame_Impl (
oslDebugMessageFunc f,
int depth,
......@@ -102,9 +100,6 @@ static void osl_diagnose_frame_Impl (
}
#endif
/************************************************************************/
/* osl_diagnose_backtrace_Impl */
/************************************************************************/
#if defined(LINUX)
#include <execinfo.h>
......@@ -126,7 +121,6 @@ static void osl_diagnose_backtrace_Impl (oslDebugMessageFunc f)
#elif defined(SOLARIS)
#include <pthread.h>
#include <setjmp.h>
#include <sys/frame.h>
......@@ -190,10 +184,6 @@ static void osl_diagnose_backtrace_Impl (oslDebugMessageFunc f)
#endif /* (LINUX || SOLARIS) */
/************************************************************************/
/* osl_assertFailedLine */
/************************************************************************/
namespace {
// getenv is not thread safe, so minimize use of result:
......@@ -255,17 +245,11 @@ sal_Bool SAL_CALL osl_assertFailedLine (
return doAbort;
}
/************************************************************************/
/* osl_breakDebug */
/************************************************************************/
void SAL_CALL osl_breakDebug()
{
abort();
}
/************************************************************************/
/* osl_reportError */
/************************************************************************/
sal_Int32 SAL_CALL osl_reportError (
sal_uInt32 nType,
const sal_Char* pszMessage)
......@@ -275,9 +259,6 @@ sal_Int32 SAL_CALL osl_reportError (
return 0;
}
/************************************************************************/
/* osl_setDebugMessageFunc */
/************************************************************************/
oslDebugMessageFunc SAL_CALL osl_setDebugMessageFunc (
oslDebugMessageFunc pNewFunc)
{
......@@ -286,9 +267,6 @@ oslDebugMessageFunc SAL_CALL osl_setDebugMessageFunc (
return pOldFunc;
}
/************************************************************************/
/* osl_setDetailedDebugMessageFunc */
/************************************************************************/
pfunc_osl_printDetailedDebugMessage SAL_CALL osl_setDetailedDebugMessageFunc (
pfunc_osl_printDetailedDebugMessage pNewFunc)
{
......
......@@ -183,12 +183,6 @@ struct FileHandle_Impl
};
};
/*******************************************************************
*
* FileHandle_Impl implementation
*
******************************************************************/
FileHandle_Impl::Allocator &
FileHandle_Impl::Allocator::get()
{
......@@ -747,9 +741,6 @@ oslFileHandle osl::detail::createFileHandleFromFD( int fd )
return (oslFileHandle)(pImpl);
}
/*******************************************************************
* osl_file_adjustLockFlags
******************************************************************/
static int osl_file_adjustLockFlags (const char * path, int flags)
{
#ifdef MACOSX
......@@ -780,9 +771,6 @@ static int osl_file_adjustLockFlags (const char * path, int flags)
return flags;
}
/****************************************************************************
* osl_file_queryLocking
***************************************************************************/
static bool osl_file_queryLocking (sal_uInt32 uFlags)
{
#if !defined HAVE_O_EXLOCK
......@@ -832,9 +820,6 @@ SAL_CALL osl_openMemoryAsFile( void *address, size_t size, oslFileHandle *pHandl
#endif
/****************************************************************************
* osl_openFile
***************************************************************************/
#ifdef HAVE_O_EXLOCK
#define OPEN_WRITE_FLAGS ( O_RDWR | O_EXLOCK | O_NONBLOCK )
#define OPEN_CREATE_FLAGS ( O_CREAT | O_RDWR | O_EXLOCK | O_NONBLOCK )
......@@ -1042,9 +1027,6 @@ SAL_CALL osl_openFile( rtl_uString* ustrFileURL, oslFileHandle* pHandle, sal_uIn
return osl_openFilePath (buffer, pHandle, uFlags);
}
/****************************************************************************/
/* osl_closeFile */
/****************************************************************************/
oslFileError
SAL_CALL osl_closeFile( oslFileHandle Handle )
{
......@@ -1084,9 +1066,6 @@ SAL_CALL osl_closeFile( oslFileHandle Handle )
return (result);
}
/************************************************
* osl_syncFile
***********************************************/
oslFileError
SAL_CALL osl_syncFile(oslFileHandle Handle)
{
......@@ -1110,9 +1089,6 @@ SAL_CALL osl_syncFile(oslFileHandle Handle)
return osl_File_E_None;
}
/************************************************
* osl_fileGetOSHandle
***********************************************/
oslFileError
SAL_CALL osl_getFileOSHandle(
oslFileHandle Handle,
......@@ -1128,9 +1104,6 @@ SAL_CALL osl_getFileOSHandle(
return osl_File_E_None;
}
/*******************************************
osl_mapFile
********************************************/
oslFileError
SAL_CALL osl_mapFile (
oslFileHandle Handle,
......@@ -1244,9 +1217,6 @@ unmapFile (void* pAddr, sal_uInt64 uLength)
// folder osl_mapFile just returns a pointer to the file inside the
// already mmapped .apk archive.
/*******************************************
osl_unmapFile
********************************************/
oslFileError
SAL_CALL osl_unmapFile (void* pAddr, sal_uInt64 uLength)
{
......@@ -1255,9 +1225,6 @@ SAL_CALL osl_unmapFile (void* pAddr, sal_uInt64 uLength)
#endif
/*******************************************
osl_unmapMappedFile
********************************************/
oslFileError
SAL_CALL osl_unmapMappedFile (oslFileHandle Handle, void* pAddr, sal_uInt64 uLength)
{
......@@ -1274,9 +1241,6 @@ SAL_CALL osl_unmapMappedFile (oslFileHandle Handle, void* pAddr, sal_uInt64 uLen
return osl_File_E_None;
}
/*******************************************
osl_readLine
********************************************/
oslFileError
SAL_CALL osl_readLine (
oslFileHandle Handle,
......@@ -1297,9 +1261,6 @@ SAL_CALL osl_readLine (
return (result);
}
/*******************************************
osl_readFile
********************************************/
oslFileError
SAL_CALL osl_readFile (
oslFileHandle Handle,
......@@ -1326,9 +1287,6 @@ SAL_CALL osl_readFile (
return (result);
}
/*******************************************
osl_writeFile
********************************************/
oslFileError
SAL_CALL osl_writeFile (
oslFileHandle Handle,
......@@ -1357,9 +1315,6 @@ SAL_CALL osl_writeFile (
return (result);
}
/*******************************************
osl_readFileAt
********************************************/
oslFileError
SAL_CALL osl_readFileAt (
oslFileHandle Handle,
......@@ -1390,9 +1345,6 @@ SAL_CALL osl_readFileAt (
return pImpl->readFileAt (nOffset, pBuffer, nBytesRequested, pBytesRead);
}
/*******************************************
osl_writeFileAt
********************************************/
oslFileError
SAL_CALL osl_writeFileAt (
oslFileHandle Handle,
......@@ -1425,9 +1377,6 @@ SAL_CALL osl_writeFileAt (
return pImpl->writeFileAt (nOffset, pBuffer, nBytesToWrite, pBytesWritten);
}
/****************************************************************************/
/* osl_isEndOfFile */
/****************************************************************************/
oslFileError
SAL_CALL osl_isEndOfFile( oslFileHandle Handle, sal_Bool *pIsEOF )
{
......@@ -1441,9 +1390,6 @@ SAL_CALL osl_isEndOfFile( oslFileHandle Handle, sal_Bool *pIsEOF )
return osl_File_E_None;
}
/************************************************
* osl_getFilePos
***********************************************/
oslFileError
SAL_CALL osl_getFilePos( oslFileHandle Handle, sal_uInt64* pPos )
{
......@@ -1457,9 +1403,6 @@ SAL_CALL osl_getFilePos( oslFileHandle Handle, sal_uInt64* pPos )
return osl_File_E_None;
}
/*******************************************
osl_setFilePos
********************************************/
oslFileError
SAL_CALL osl_setFilePos (oslFileHandle Handle, sal_uInt32 uHow, sal_Int64 uOffset)
{
......@@ -1504,9 +1447,6 @@ SAL_CALL osl_setFilePos (oslFileHandle Handle, sal_uInt32 uHow, sal_Int64 uOffse
return pImpl->setPos (nPos + nOffset);
}
/****************************************************************************
* osl_getFileSize
****************************************************************************/
oslFileError
SAL_CALL osl_getFileSize( oslFileHandle Handle, sal_uInt64* pSize )
{
......@@ -1520,9 +1460,6 @@ SAL_CALL osl_getFileSize( oslFileHandle Handle, sal_uInt64* pSize )
return osl_File_E_None;
}
/************************************************
* osl_setFileSize
***********************************************/
oslFileError
SAL_CALL osl_setFileSize( oslFileHandle Handle, sal_uInt64 uSize )
{
......
......@@ -21,10 +21,6 @@
#include "file_error_transl.h"
#include <osl/diagnose.h>
/********************************************
* oslTranslateFileError
*******************************************/
oslFileError oslTranslateFileError(sal_Bool bIsError, int Errno)
{
oslFileError osl_error = osl_File_E_invalidError;
......
......@@ -363,10 +363,6 @@ namespace
return (pStr + rtl_ustr_getLength(pStr));
}
/*********************************************
********************************************/
sal_Unicode* ustrchrcat(const sal_Unicode chr, sal_Unicode* d)
{
sal_Unicode* p = ustrtoend(d);
......@@ -375,10 +371,6 @@ namespace
return d;
}
/******************************************************
*
******************************************************/
bool _islastchr(sal_Unicode* pStr, sal_Unicode Chr)
{
sal_Unicode* p = ustrtoend(pStr);
......@@ -424,10 +416,6 @@ namespace
return aPath;
}
/******************************************************
*
******************************************************/
oslFileError _osl_resolvepath(
/*inout*/ sal_Unicode* path,
/*inout*/ bool* failed)
......@@ -677,10 +665,6 @@ namespace
return bfound;
}
/*********************************************
********************************************/
bool find_in_searchPath(const rtl::OUString& file_path, rtl_uString* search_path, rtl::OUString& result)
{
return (search_path && osl::searchPath(file_path, rtl::OUString(search_path), result));
......
......@@ -32,9 +32,6 @@
extern int osl_isSingleCPU;
/*****************************************************************************/
/* osl_incrementInterlockedCount */
/*****************************************************************************/
oslInterlockedCount SAL_CALL osl_incrementInterlockedCount(oslInterlockedCount* pCount)
{
// Fast case for old, slow, single CPU Intel machines for whom
......@@ -110,9 +107,6 @@ oslInterlockedCount SAL_CALL osl_decrementInterlockedCount(oslInterlockedCount*
static pthread_mutex_t InterLock = PTHREAD_MUTEX_INITIALIZER;
/*****************************************************************************/
/* osl_incrementInterlockedCount */
/*****************************************************************************/
oslInterlockedCount SAL_CALL osl_incrementInterlockedCount(oslInterlockedCount* pCount)
{
oslInterlockedCount Count;
......@@ -124,9 +118,6 @@ oslInterlockedCount SAL_CALL osl_incrementInterlockedCount(oslInterlockedCount*
return (Count);
}
/*****************************************************************************/
/* osl_decrementInterlockedCount */
/*****************************************************************************/
oslInterlockedCount SAL_CALL osl_decrementInterlockedCount(oslInterlockedCount* pCount)
{
oslInterlockedCount Count;
......
......@@ -72,9 +72,6 @@ oslMutex SAL_CALL osl_createMutex()
return pMutex;
}
/*****************************************************************************/
/* osl_destroyMutex */
/*****************************************************************************/
void SAL_CALL osl_destroyMutex(oslMutexImpl *pMutex)
{
OSL_ASSERT(pMutex);
......@@ -96,9 +93,6 @@ void SAL_CALL osl_destroyMutex(oslMutexImpl *pMutex)
return;
}
/*****************************************************************************/
/* osl_acquireMutex */
/*****************************************************************************/
sal_Bool SAL_CALL osl_acquireMutex(oslMutexImpl *pMutex)
{
OSL_ASSERT(pMutex);
......@@ -121,9 +115,6 @@ sal_Bool SAL_CALL osl_acquireMutex(oslMutexImpl *pMutex)
return sal_False;
}
/*****************************************************************************/
/* osl_tryToAcquireMutex */
/*****************************************************************************/
sal_Bool SAL_CALL osl_tryToAcquireMutex(oslMutexImpl *pMutex)
{
OSL_ASSERT(pMutex);
......@@ -142,9 +133,6 @@ sal_Bool SAL_CALL osl_tryToAcquireMutex(oslMutexImpl *pMutex)
return sal_False;
}
/*****************************************************************************/
/* osl_releaseMutex */
/*****************************************************************************/
sal_Bool SAL_CALL osl_releaseMutex(oslMutexImpl *pMutex)
{
OSL_ASSERT(pMutex);
......@@ -167,9 +155,6 @@ sal_Bool SAL_CALL osl_releaseMutex(oslMutexImpl *pMutex)
return sal_False;
}
/*****************************************************************************/
/* osl_getGlobalMutex */
/*****************************************************************************/
static oslMutexImpl globalMutexImpl;
......
......@@ -39,10 +39,6 @@ sal_Bool SAL_CALL osl_psz_getUserIdent(oslSecurity Security, sal_Char *pszIdent,
oslPipe SAL_CALL osl_psz_createPipe(const sal_Char *pszPipeName, oslPipeOptions Options, oslSecurity Security);
/*****************************************************************************/
/* enum oslPipeError */
/*****************************************************************************/
static struct
{
int errcode;
......@@ -97,10 +93,6 @@ static oslPipeError osl_PipeErrorFromNative(int nativeType)
#define ERROR_FROM_NATIVE(y) osl_PipeErrorFromNative(y)
/*****************************************************************************/
/* osl_create/destroy-PipeImpl */
/*****************************************************************************/
oslPipe __osl_createPipeImpl()
{
oslPipe pPipeImpl;
......@@ -122,9 +114,6 @@ void __osl_destroyPipeImpl(oslPipe pImpl)
}
/*****************************************************************************/
/* osl_createPipe */
/*****************************************************************************/
oslPipe SAL_CALL osl_createPipe(rtl_uString *ustrPipeName, oslPipeOptions Options, oslSecurity Security)
{
oslPipe pPipe=0;
......@@ -434,9 +423,6 @@ void SAL_CALL osl_closePipe( oslPipe pPipe )
}
/*****************************************************************************/
/* osl_acceptPipe */
/*****************************************************************************/
oslPipe SAL_CALL osl_acceptPipe(oslPipe pPipe)
{
int s, flags;
......@@ -502,9 +488,6 @@ oslPipe SAL_CALL osl_acceptPipe(oslPipe pPipe)
return pAcceptedPipe;
}
/*****************************************************************************/
/* osl_receivePipe */
/*****************************************************************************/
sal_Int32 SAL_CALL osl_receivePipe(oslPipe pPipe,
void* pBuffer,
sal_Int32 BytesToRead)
......@@ -532,10 +515,6 @@ sal_Int32 SAL_CALL osl_receivePipe(oslPipe pPipe,
return nRet;
}
/*****************************************************************************/
/* osl_sendPipe */
/*****************************************************************************/
sal_Int32 SAL_CALL osl_sendPipe(oslPipe pPipe,
const void* pBuffer,
sal_Int32 BytesToSend)
......@@ -564,10 +543,6 @@ sal_Int32 SAL_CALL osl_sendPipe(oslPipe pPipe,
return nRet;
}
/*****************************************************************************/
/* osl_getLastPipeError */
/*****************************************************************************/
oslPipeError SAL_CALL osl_getLastPipeError(oslPipe pPipe)
{
(void) pPipe; /* unused */
......
......@@ -336,10 +336,6 @@ static sal_Bool DeInitSignal()
#if defined (SAL_ENABLE_CRASH_REPORT) && defined(INCLUDE_BACKTRACE)
/*****************************************************************************/
/* Generate MD5 checksum */
/*****************************************************************************/
static sal_uInt32 calc_md5_checksum( const char *filename, sal_uInt8 *pChecksum, sal_uInt32 nChecksumLen )
{
sal_uInt32 nBytesProcessed = 0;
......@@ -937,9 +933,6 @@ static void DUMPCURRENTALLOCS()
}
#endif
/*****************************************************************************/
/* SignalHandlerFunction */
/*****************************************************************************/
void SignalHandlerFunction(int Signal)
{
oslSignalInfo Info;
......@@ -1020,9 +1013,6 @@ void SignalHandlerFunction(int Signal)
}
}
/*****************************************************************************/
/* osl_addSignalHandler */
/*****************************************************************************/
oslSignalHandler SAL_CALL osl_addSignalHandler(oslSignalHandlerFunction Handler, void* pData)
{
oslSignalHandlerImpl* pHandler;
......@@ -1056,9 +1046,6 @@ oslSignalHandler SAL_CALL osl_addSignalHandler(oslSignalHandlerFunction Handler,
return (NULL);
}
/*****************************************************************************/
/* osl_removeSignalHandler */
/*****************************************************************************/
sal_Bool SAL_CALL osl_removeSignalHandler(oslSignalHandler Handler)
{
oslSignalHandlerImpl *pHandler, *pPrevious = NULL;
......@@ -1100,9 +1087,6 @@ sal_Bool SAL_CALL osl_removeSignalHandler(oslSignalHandler Handler)
return (sal_False);
}
/*****************************************************************************/
/* osl_raiseSignal */
/*****************************************************************************/
oslSignalAction SAL_CALL osl_raiseSignal(sal_Int32 UserSignal, void* UserData)
{
oslSignalInfo Info;
......@@ -1124,9 +1108,6 @@ oslSignalAction SAL_CALL osl_raiseSignal(sal_Int32 UserSignal, void* UserData)
return (Action);
}
/*****************************************************************************/
/* osl_setErrorReporting */
/*****************************************************************************/
sal_Bool SAL_CALL osl_setErrorReporting( sal_Bool bEnable )
{
sal_Bool bOld = bErrorReportingEnabled;
......
This diff is collapsed.
......@@ -269,10 +269,6 @@ static oslFileError osl_create_temp_file_impl_(
return osl_error;
}
/*****************************************************************
* osl_createTempFile
*****************************************************************/
oslFileError SAL_CALL osl_createTempFile(
rtl_uString* pustrDirectoryURL,
oslFileHandle* pHandle,
......
......@@ -135,18 +135,12 @@ static sal_uInt16 insertThreadId (pthread_t hThread);
static sal_uInt16 lookupThreadId (pthread_t hThread);
static void removeThreadId (pthread_t hThread);
/*****************************************************************************/
/* osl_thread_init_Impl */
/*****************************************************************************/
static void osl_thread_init_Impl (void)
{
osl_thread_priority_init_Impl();
osl_thread_textencoding_init_Impl();
}
/*****************************************************************************/
/* osl_thread_construct_Impl */
/*****************************************************************************/
Thread_Impl* osl_thread_construct_Impl (void)
{
Thread_Impl* pImpl = malloc (sizeof(Thread_Impl));
......@@ -160,9 +154,6 @@ Thread_Impl* osl_thread_construct_Impl (void)
return (pImpl);
}
/*****************************************************************************/
/* osl_thread_destruct_Impl */
/*****************************************************************************/
static void osl_thread_destruct_Impl (Thread_Impl ** ppImpl)
{
OSL_ASSERT(ppImpl);
......@@ -176,9 +167,6 @@ static void osl_thread_destruct_Impl (Thread_Impl ** ppImpl)
}
}
/*****************************************************************************/
/* osl_thread_cleanup_Impl */
/*****************************************************************************/
static void osl_thread_cleanup_Impl (Thread_Impl * pImpl)
{
pthread_t thread;
......@@ -208,9 +196,6 @@ static void osl_thread_cleanup_Impl (Thread_Impl * pImpl)
}
}
/*****************************************************************************/
/* osl_thread_start_Impl */
/*****************************************************************************/
static void* osl_thread_start_Impl (void* pData)
{
int terminate;
......@@ -260,9 +245,6 @@ static void* osl_thread_start_Impl (void* pData)
return (0);
}
/*****************************************************************************/
/* osl_thread_create_Impl */
/*****************************************************************************/
static oslThread osl_thread_create_Impl (
oslWorkerFunction pWorker,
void* pThreadData,
......@@ -329,9 +311,6 @@ static oslThread osl_thread_create_Impl (
return ((oslThread)(pImpl));
}
/*****************************************************************************/
/* osl_createThread */
/*****************************************************************************/
oslThread osl_createThread (
oslWorkerFunction pWorker,
void * pThreadData)
......@@ -342,9 +321,6 @@ oslThread osl_createThread (
THREADIMPL_FLAGS_ATTACHED);
}
/*****************************************************************************/
/* osl_createSuspendedThread */
/*****************************************************************************/
oslThread osl_createSuspendedThread (
oslWorkerFunction pWorker,
void * pThreadData)
......@@ -356,9 +332,6 @@ oslThread osl_createSuspendedThread (
THREADIMPL_FLAGS_SUSPENDED );
}
/*****************************************************************************/
/* osl_destroyThread */
/*****************************************************************************/
void SAL_CALL osl_destroyThread(oslThread Thread)
{
if (Thread != NULL) {
......@@ -374,9 +347,6 @@ void SAL_CALL osl_destroyThread(oslThread Thread)
}
}
/*****************************************************************************/
/* osl_resumeThread */
/*****************************************************************************/
void SAL_CALL osl_resumeThread(oslThread Thread)
{
Thread_Impl* pImpl= (Thread_Impl*)Thread;
......@@ -397,9 +367,6 @@ void SAL_CALL osl_resumeThread(oslThread Thread)
pthread_mutex_unlock (&(pImpl->m_Lock));
}
/*****************************************************************************/
/* osl_suspendThread */
/*****************************************************************************/
void SAL_CALL osl_suspendThread(oslThread Thread)
{
Thread_Impl* pImpl= (Thread_Impl*)Thread;
......@@ -425,9 +392,6 @@ void SAL_CALL osl_suspendThread(oslThread Thread)
pthread_mutex_unlock (&(pImpl->m_Lock));
}
/*****************************************************************************/
/* osl_isThreadRunning */
/*****************************************************************************/
sal_Bool SAL_CALL osl_isThreadRunning(const oslThread Thread)
{
sal_Bool active;
......@@ -443,9 +407,6 @@ sal_Bool SAL_CALL osl_isThreadRunning(const oslThread Thread)
return (active);
}
/*****************************************************************************/
/* osl_joinWithThread */
/*****************************************************************************/
void SAL_CALL osl_joinWithThread(oslThread Thread)
{
pthread_t thread;
......@@ -476,9 +437,6 @@ void SAL_CALL osl_joinWithThread(oslThread Thread)
}
}
/*****************************************************************************/
/* osl_terminateThread */
/*****************************************************************************/
void SAL_CALL osl_terminateThread(oslThread Thread)
{
Thread_Impl* pImpl= (Thread_Impl*)Thread;
......@@ -501,9 +459,6 @@ void SAL_CALL osl_terminateThread(oslThread Thread)
pthread_mutex_unlock (&(pImpl->m_Lock));
}
/*****************************************************************************/
/* osl_scheduleThread */
/*****************************************************************************/
sal_Bool SAL_CALL osl_scheduleThread(oslThread Thread)
{
int terminate;
......@@ -532,9 +487,6 @@ sal_Bool SAL_CALL osl_scheduleThread(oslThread Thread)
return (terminate == 0);
}
/*****************************************************************************/
/* osl_waitThread */
/*****************************************************************************/
void SAL_CALL osl_waitThread(const TimeValue* pDelay)
{
if (pDelay)
......@@ -875,9 +827,6 @@ void SAL_CALL osl_setThreadPriority (
#endif /* NO_PTHREAD_PRIORITY */
}
/*****************************************************************************/
/* osl_getThreadPriority */
/*****************************************************************************/
oslThreadPriority SAL_CALL osl_getThreadPriority(const oslThread Thread)
{
#ifndef NO_PTHREAD_PRIORITY
......@@ -944,9 +893,6 @@ typedef struct _wrapper_pthread_key
oslThreadKeyCallbackFunction pfnCallback;
} wrapper_pthread_key;
/*****************************************************************************/
/* osl_createThreadKey */
/*****************************************************************************/
oslThreadKey SAL_CALL osl_createThreadKey( oslThreadKeyCallbackFunction pCallback )
{
wrapper_pthread_key *pKey = (wrapper_pthread_key*)rtl_allocateMemory(sizeof(wrapper_pthread_key));
......@@ -965,9 +911,6 @@ oslThreadKey SAL_CALL osl_createThreadKey( oslThreadKeyCallbackFunction pCallbac
return ((oslThreadKey)pKey);
}
/*****************************************************************************/
/* osl_destroyThreadKey */
/*****************************************************************************/
void SAL_CALL osl_destroyThreadKey(oslThreadKey Key)
{
wrapper_pthread_key *pKey = (wrapper_pthread_key*)Key;
......@@ -978,18 +921,12 @@ void SAL_CALL osl_destroyThreadKey(oslThreadKey Key)
}
}
/*****************************************************************************/
/* osl_getThreadKeyData */
/*****************************************************************************/
void* SAL_CALL osl_getThreadKeyData(oslThreadKey Key)
{
wrapper_pthread_key *pKey = (wrapper_pthread_key*)Key;
return pKey ? pthread_getspecific(pKey->m_key) : NULL;
}
/*****************************************************************************/
/* osl_setThreadKeyData */
/*****************************************************************************/
sal_Bool SAL_CALL osl_setThreadKeyData(oslThreadKey Key, void *pData)
{
sal_Bool bRet;
......@@ -1040,9 +977,6 @@ static void osl_thread_textencoding_init_Impl (void)
g_thread.m_textencoding.m_default = defaultEncoding;
}
/*****************************************************************************/
/* osl_getThreadTextEncoding */
/*****************************************************************************/
rtl_TextEncoding SAL_CALL osl_getThreadTextEncoding()
{
rtl_TextEncoding threadEncoding;
......@@ -1059,9 +993,6 @@ rtl_TextEncoding SAL_CALL osl_getThreadTextEncoding()
return threadEncoding;
}
/*****************************************************************************/
/* osl_setThreadTextEncoding */
/*****************************************************************************/
rtl_TextEncoding osl_setThreadTextEncoding(rtl_TextEncoding Encoding)
{
rtl_TextEncoding oldThreadEncoding = osl_getThreadTextEncoding();
......
......@@ -53,10 +53,6 @@ typedef struct timeval osl_time_t;
static osl_time_t startTime;
/*--------------------------------------------------
* osl_getSystemTime
*-------------------------------------------------*/
sal_Bool SAL_CALL osl_getSystemTime(TimeValue* tv)
{
#ifdef __MACH__
......@@ -94,10 +90,6 @@ sal_Bool SAL_CALL osl_getSystemTime(TimeValue* tv)
}
/*--------------------------------------------------
* osl_getDateTimeFromTimeValue
*-------------------------------------------------*/
sal_Bool SAL_CALL osl_getDateTimeFromTimeValue( const TimeValue* pTimeVal, oslDateTime* pDateTime )
{
struct tm *pSystemTime;
......@@ -128,10 +120,6 @@ sal_Bool SAL_CALL osl_getDateTimeFromTimeValue( const TimeValue* pTimeVal, oslDa
return sal_False;
}
/*--------------------------------------------------
* osl_getTimeValueFromDateTime
*--------------------------------------------------*/
sal_Bool SAL_CALL osl_getTimeValueFromDateTime( const oslDateTime* pDateTime, TimeValue* pTimeVal )
{
struct tm aTime;
......@@ -199,10 +187,6 @@ sal_Bool SAL_CALL osl_getTimeValueFromDateTime( const oslDateTime* pDateTime, Ti
}
/*--------------------------------------------------
* osl_getLocalTimeFromSystemTime
*--------------------------------------------------*/
sal_Bool SAL_CALL osl_getLocalTimeFromSystemTime( const TimeValue* pSystemTimeVal, TimeValue* pLocalTimeVal )
{
struct tm *pLocalTime;
......@@ -236,10 +220,6 @@ sal_Bool SAL_CALL osl_getLocalTimeFromSystemTime( const TimeValue* pSystemTimeVa
return sal_False;
}
/*--------------------------------------------------
* osl_getSystemTimeFromLocalTime
*--------------------------------------------------*/
sal_Bool SAL_CALL osl_getSystemTimeFromLocalTime( const TimeValue* pLocalTimeVal, TimeValue* pSystemTimeVal )
{
struct tm *pLocalTime;
......
......@@ -34,18 +34,10 @@
#include "osl/diagnose.h"
/*****************************************************************************/
/* Static Module Functions */
/*****************************************************************************/
static int osl_getHWAddr(const char *ifname, char* hard_addr);
static int osl_checkAddr(const char* addr);
/*****************************************************************************/
/* osl_getEthernetAddress */
/*****************************************************************************/
sal_Bool SAL_CALL osl_getEthernetAddress( sal_uInt8 * pAddr )
{
#ifdef SOLARIS
......@@ -111,10 +103,6 @@ sal_Bool SAL_CALL osl_getEthernetAddress( sal_uInt8 * pAddr )
}
/*****************************************************************************/
/* osl_getHWAddr */
/*****************************************************************************/
static int osl_getHWAddr(const char *ifname, char* hard_addr)
{
int ret=0;
......@@ -197,10 +185,6 @@ static int osl_getHWAddr(const char *ifname, char* hard_addr)
}
/*****************************************************************************/
/* osl_checkAddr */
/*****************************************************************************/
static int osl_checkAddr(const char* addr)
{
if (addr[0]==0 && addr[1]==0 &&
......@@ -219,10 +203,6 @@ static int osl_checkAddr(const char* addr)
#include <sys/types.h>
#include <sys/processor.h>
/*****************************************************************************/
/* osl_InitSparcV9 */
/*****************************************************************************/
void osl_InterlockedCountSetV9(sal_Bool bV9);
/*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment