summaryrefslogtreecommitdiff
path: root/sal/inc
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2003-03-26 15:47:28 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2003-03-26 15:47:28 +0000
commite6611cc2ef5960e9f32c56da44fafd02446f53e6 (patch)
tree6358ced419ac9412ae39cbb7032f602ff0e7de7c /sal/inc
parent243a97038bdab8f2ec448df19c88ac2638035531 (diff)
MWS_SRX644: migrate branch mws_srx644 -> HEAD
Diffstat (limited to 'sal/inc')
-rw-r--r--sal/inc/osl/conditn.h51
-rw-r--r--sal/inc/osl/conditn.hxx39
-rw-r--r--sal/inc/osl/endian.h10
-rw-r--r--sal/inc/osl/file.h5
-rw-r--r--sal/inc/osl/interlck.h6
-rw-r--r--sal/inc/osl/module.hxx40
-rw-r--r--sal/inc/osl/mutex.h7
-rw-r--r--sal/inc/osl/nlsupport.h9
-rw-r--r--sal/inc/osl/process.h341
-rw-r--r--sal/inc/osl/semaphor.h32
-rw-r--r--sal/inc/osl/semaphor.hxx33
-rw-r--r--sal/inc/osl/thread.hxx103
-rw-r--r--sal/inc/osl/time.h17
-rw-r--r--sal/inc/osl/util.h7
-rw-r--r--sal/inc/rtl/math.h90
-rw-r--r--sal/inc/rtl/math.hxx43
-rw-r--r--sal/inc/rtl/string.h41
-rw-r--r--sal/inc/rtl/textcvt.h10
-rw-r--r--sal/inc/rtl/textenc.h6
-rw-r--r--sal/inc/rtl/tres.h98
-rw-r--r--sal/inc/rtl/ustrbuf.hxx29
-rw-r--r--sal/inc/rtl/ustring.h5
-rw-r--r--sal/inc/rtl/ustring.hxx35
-rw-r--r--sal/inc/sal/config.h15
-rw-r--r--sal/inc/sal/mathconf.h88
-rw-r--r--sal/inc/sal/types.h56
-rw-r--r--sal/inc/systools/win32/uwinapi.h6
27 files changed, 558 insertions, 664 deletions
diff --git a/sal/inc/osl/conditn.h b/sal/inc/osl/conditn.h
index dcb8e67e0c70..b258e98def74 100644
--- a/sal/inc/osl/conditn.h
+++ b/sal/inc/osl/conditn.h
@@ -2,9 +2,9 @@
*
* $RCSfile: conditn.h,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: obr $ $Date: 2001-11-08 15:48:05 $
+ * last change: $Author: hr $ $Date: 2003-03-26 16:45:35 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -71,28 +71,18 @@
extern "C" {
#endif
-/** condition synchronization object handle
- @seealso osl_createCondition()
-*/
typedef void* oslCondition;
-/** enumeration of possible error values for conditions
- @seealso osl_waitCondition()
-*/
typedef enum {
- /** successful completion */
- osl_cond_result_ok,
- /** an unspecified error occured */
- osl_cond_result_error,
- /** blocking operation timed out */
- osl_cond_result_timeout,
+ osl_cond_result_ok, /* successful completion */
+ osl_cond_result_error, /* error occured, check osl_getLastSocketError() for details */
+ osl_cond_result_timeout, /* blocking operation timed out */
osl_cond_result_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
} oslConditionResult;
/** Creates a condition.
The condition is in the reset-state.
- @return a pointer to the created condition object or
- NULL if the condition could not be created.
+ @returns 0 if condition could not be created.
*/
oslCondition SAL_CALL osl_createCondition(void);
@@ -101,41 +91,32 @@ oslCondition SAL_CALL osl_createCondition(void);
*/
void SAL_CALL osl_destroyCondition(oslCondition Condition);
-/** Sets the condition state to set
- Any call to osl_waitCondition() will not block, osl_checkCondition()
- returns sal_True.
+/** Sets condition to True => wait() will not block, check() returns True.
NOTE: ALL threads waiting on this condition are unblocked!
-
@param Condition handle to a created condition.
- @return sal_True if the condition has been set or
- sal_False if the system-call failed.
+ @return False if system-call failed.
*/
sal_Bool SAL_CALL osl_setCondition(oslCondition Condition);
-/** Resets condition to unset state
- Any call to osl_waitCondition() will block, osl_checkCondition()
- will return sal_False.
-
+/** Sets condition to False => wait() will block, check() returns False
@param Condition handle to a created condition.
- @return sal_True if the condition has been unset or
- sal_False if the system-call failed.
+ @return False if system-call failed.
*/
sal_Bool SAL_CALL osl_resetCondition(oslCondition Condition);
-/** Blocks if condition is not set.
- If condition has been destroyed prematurely, osl_waitCondition()
- will return sal_False.
+/** Blocks if condition is not set<BR>
+ If condition has been destroyed prematurely, wait() will
+ return with False.
@param Condition handle to a created condition.
@param pTimeout Tiemout value or NULL for infinite waiting
- @return on of the following result values: osl_cond_result_ok,
- osl_cond_result_error, osl_cond_result_timeout.
-
+ @return False if system-call failed.
*/
oslConditionResult SAL_CALL osl_waitCondition(oslCondition Condition, const TimeValue* pTimeout);
/** Queries the state of the condition without blocking.
@param Condition handle to a created condition.
- @return sal_True if condition is in set state or sal_False otherwise.
+ @return True: condition is set. <BR>
+ False: condition is not set. <BR>
*/
sal_Bool SAL_CALL osl_checkCondition(oslCondition Condition);
diff --git a/sal/inc/osl/conditn.hxx b/sal/inc/osl/conditn.hxx
index 65859e30e80c..fe10706c1255 100644
--- a/sal/inc/osl/conditn.hxx
+++ b/sal/inc/osl/conditn.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: conditn.hxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: obr $ $Date: 2001-11-08 15:48:05 $
+ * last change: $Author: hr $ $Date: 2003-03-26 16:45:35 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -73,12 +73,7 @@
namespace osl
{
- /** Thread synchronization object
- A condition is a thread synchronization method with two different states:
- set (sal_True) and unset (sal_False). When in unset state, any thread
- calling the wait() method will be blocked until the state changes to set.
- */
class Condition
{
public:
@@ -90,55 +85,41 @@ namespace osl
result_timeout = osl_cond_result_timeout
};
- /** Constructs a condition object.
-
- The initial state of the condition is false/unset.
-
- @seealso ::osl_createCondition()
+ /* Create a condition.
*/
Condition()
{
condition = osl_createCondition();
}
- /** Release the OS-structures and free condition data-structure.
-
- @seealso ::osl_destroyCondition()
- */
+ /* Release the OS-structures and free condition data-structure.
+ */
~Condition()
{
osl_destroyCondition(condition);
}
- /** Release all waiting threads, check() returns sal_True.
-
- @seealso ::osl_setCondition()
- */
+ /* Release all waiting threads, check returns sal_True.
+ */
void set()
{
osl_setCondition(condition);
}
- /** Reset condition to false: wait() will block, check() returns sal_False.
-
- @seealso ::osl_resetCondition()
- */
+ /* Reset condition to false: wait() will block, check() returns sal_False.
+ */
void reset() {
osl_resetCondition(condition);
}
/** Blocks the calling thread until condition is set.
-
- @seealso ::osl_waitCondition()
- */
+ */
Result wait(const TimeValue *pTimeout = 0)
{
return (Result) osl_waitCondition(condition, pTimeout);
}
/** Checks if the condition is set without blocking.
-
- @seealso ::osl_checkCondition()
*/
sal_Bool check()
{
diff --git a/sal/inc/osl/endian.h b/sal/inc/osl/endian.h
index 909dea9a5d59..f81412fdcab3 100644
--- a/sal/inc/osl/endian.h
+++ b/sal/inc/osl/endian.h
@@ -2,9 +2,9 @@
*
* $RCSfile: endian.h,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: svesik $ $Date: 2001-04-26 15:27:19 $
+ * last change: $Author: hr $ $Date: 2003-03-26 16:45:35 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -158,10 +158,6 @@ extern "C" {
# endif
#endif
-#ifdef S390
-# define _BIG_ENDIAN
-#endif
-
#ifdef _WIN16
# define _LITTLE_ENDIAN
#endif
@@ -202,7 +198,7 @@ extern "C" {
*/
#if !defined(_WIN32) && !defined(_WIN16) && !defined(OS2) && \
!defined(LINUX) && !defined(NETBSD) && !defined(SCO) && \
- !defined(AIX) && !defined(HPUX) && !defined(S390) && \
+ !defined(AIX) && !defined(HPUX) && \
!defined(SOLARIS) && !defined(IRIX) && !defined(MACOS) && \
!defined(MACOSX) && !defined(FREEBSD)
# error "Target plattform not specified !"
diff --git a/sal/inc/osl/file.h b/sal/inc/osl/file.h
index 121840b5f6a7..1fa43222dc99 100644
--- a/sal/inc/osl/file.h
+++ b/sal/inc/osl/file.h
@@ -2,9 +2,9 @@
*
* $RCSfile: file.h,v $
*
- * $Revision: 1.24 $
+ * $Revision: 1.25 $
*
- * last change: $Author: tra $ $Date: 2002-11-29 09:01:36 $
+ * last change: $Author: hr $ $Date: 2003-03-26 16:45:36 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1406,7 +1406,6 @@ oslFileError SAL_CALL osl_createTempFile(
oslFileHandle* pHandle,
rtl_uString** ppustrTempFileURL);
-
#ifdef __cplusplus
}
#endif
diff --git a/sal/inc/osl/interlck.h b/sal/inc/osl/interlck.h
index de21c98287a3..db518e9125db 100644
--- a/sal/inc/osl/interlck.h
+++ b/sal/inc/osl/interlck.h
@@ -2,9 +2,9 @@
*
* $RCSfile: interlck.h,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: obr $ $Date: 2001-11-12 14:40:49 $
+ * last change: $Author: hr $ $Date: 2003-03-26 16:45:36 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -70,8 +70,6 @@
extern "C" {
#endif
-/** Counter with atomic in-/decrease operations
-*/
typedef sal_Int32 oslInterlockedCount;
/** Increments the count variable addressed by pCount.
diff --git a/sal/inc/osl/module.hxx b/sal/inc/osl/module.hxx
index b936da2a010d..fbfb75719a95 100644
--- a/sal/inc/osl/module.hxx
+++ b/sal/inc/osl/module.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: module.hxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: obr $ $Date: 2001-11-12 15:51:50 $
+ * last change: $Author: hr $ $Date: 2003-03-26 16:45:36 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -73,51 +73,29 @@
namespace osl
{
-/** A class representing a share library module
-*/
class Module
{
Module( const Module&);
Module& operator = ( const Module&);
public:
- /** Lookup URL of module which is mapped at the specified address.
- @param addr specifies an address in the process memory space
- @param pustrURL receives the URL of the module that is mapped at pv
- @return sal_True on success, sal_False if no module can be found at the specified address
- */
static sal_Bool getUrlFromAddress(void * addr, ::rtl::OUString & libraryUrl) {
return osl_getModuleURLFromAddress(addr, &libraryUrl.pData);
}
- /** Constructs an uninitialized module object.
- */
Module(): m_Module(0){}
- /** Contructs the module object and loads the shared library or module.
- @param strModuleName the module to load
- @seealso ::osl_loadModule()
- */
Module( const ::rtl::OUString& strModuleName, sal_Int32 nRtldMode = SAL_LOADMODULE_DEFAULT)
{
load( strModuleName, nRtldMode);
}
- /** Unloads the module and destructs the object
- @seealso ::osl_unloadModule()
- */
~Module()
{
osl_unloadModule(m_Module);
}
- /** Loads the shared library or module.
-
- A previously loaded module will be unloaded before the new one gets loaded.
- @param strModuleName the module to load
- @seealso ::osl_loadModule()
- */
sal_Bool SAL_CALL load( const ::rtl::OUString& strModuleName,
sal_Int32 nRtldMode = SAL_LOADMODULE_DEFAULT)
{
@@ -126,9 +104,6 @@ public:
return is();
}
- /** Unloads the module.
- @seealso ::osl_unloadModule()
- */
void SAL_CALL unload()
{
if (m_Module)
@@ -138,27 +113,16 @@ public:
}
}
- /** Checks if a module is loaded.
- @return sal_True if the module is loaded, sal_False if not
- */
sal_Bool SAL_CALL is() const
{
return m_Module != NULL;
}
- /** Extract a symbol from the module.
- @param strSymbolName the symbol to extract.
- @return the address of the symbol
- @seealso ::osl_getSymbol()
- */
void* SAL_CALL getSymbol( const ::rtl::OUString& strSymbolName)
{
return ( osl_getSymbol( m_Module, strSymbolName.pData ) );
}
- /** Cast operator to oslModule.
- @return the oslModule handle
- */
operator oslModule() const
{
return m_Module;
diff --git a/sal/inc/osl/mutex.h b/sal/inc/osl/mutex.h
index 93ad68c9099f..329d3b168011 100644
--- a/sal/inc/osl/mutex.h
+++ b/sal/inc/osl/mutex.h
@@ -2,9 +2,9 @@
*
* $RCSfile: mutex.h,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: obr $ $Date: 2001-11-08 15:48:05 $
+ * last change: $Author: hr $ $Date: 2003-03-26 16:45:37 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -71,9 +71,6 @@ extern "C" {
#endif
struct _oslMutexImpl;
-
-/** a handle to a mutex synchronization object
-*/
typedef struct _oslMutexImpl * oslMutex;
/** Create a thread-local mutex.
diff --git a/sal/inc/osl/nlsupport.h b/sal/inc/osl/nlsupport.h
index fa75f9a2c87d..0bbeb26b5401 100644
--- a/sal/inc/osl/nlsupport.h
+++ b/sal/inc/osl/nlsupport.h
@@ -2,9 +2,9 @@
*
* $RCSfile: nlsupport.h,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: obr $ $Date: 2001-11-12 15:51:50 $
+ * last change: $Author: hr $ $Date: 2003-03-26 16:45:37 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -75,14 +75,15 @@
extern "C" {
#endif
-/** Determines the text encoding used by the underlying platform for the
+/**
+ Determines the text encoding used by the underlying platform for the
specified locale.
@param pLocale
the locale to return the text encoding for. If this parameter is NULL,
the default locale of the current process is used.
- @return the rtl_TextEncoding that matches the platform specific encoding
+ @returns the rtl_TextEncoding that matches the platform specific encoding
description or RTL_TEXTENCODING_DONTKNOW if no mapping is available.
*/
diff --git a/sal/inc/osl/process.h b/sal/inc/osl/process.h
index c3237f893632..a9cc417ad41a 100644
--- a/sal/inc/osl/process.h
+++ b/sal/inc/osl/process.h
@@ -2,9 +2,9 @@
*
* $RCSfile: process.h,v $
*
- * $Revision: 1.13 $
+ * $Revision: 1.14 $
*
- * last change: $Author: tra $ $Date: 2002-11-28 13:35:38 $
+ * last change: $Author: hr $ $Date: 2003-03-26 16:45:37 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -162,317 +162,208 @@ typedef struct {
# pragma pack()
#endif
-/** Process handle.
-
- @see osl_executeProcess()
- @see osl_terminateProcess()
- @see osl_freeProcessHandle()
- @see osl_getProcessInfo()
- @see osl_joinProcess()
+/** Process handle
+ @see osl_executeProcess
+ @see osl_terminateProcess
+ @see osl_freeProcessHandle
+ @see osl_getProcessInfo
+ @see osl_joinProcess
*/
typedef void* oslProcess;
/** Execute a process.
-
- @param pustrImageName [in]
- Denotes the file URL of the executable image to be started.
-
- @param pustrArguments [in]
- Is an array of argument strings.
-
- @param nArgument [in]
- The number of arguments provided.
-
- @param Options [in]
- Is a combination of int-constants to describe the mode of execution.
-
- @param Security [in]
- Describes a the user and his rights for wich the process is started.
-
- @param pustrWorkDir [in]
- Denotes the file URL of the working directory of the new process.
-
- @param strEnviroments [in]
- Is an array of strings wich describes the enviroment to set.
+ @param strImageName [in] denotes the name of the executable to be started.
+ @param strArguments [in] is an array of argument strings.
+ @param nArgument [in] the number of arguments provided.
+ @param Options [in] is a combination of int-constants to describe the mode of execution.
+ @param Security [in] describes a the user and his rights for wich the process is started.
+ @param strDirectory [in] denotes the name of the startup directory.
+ @param strEnviroments [in] is an array of strings wich describes the enviroment to set.
Each string has the form "variable=value".
-
- @param nEnvironmentVars [in]
- The number of environment vars to set.
-
- @param pProcess [out]
- Points to a oslProcess variable, in wich the processhandle is returned.
-
- @return
- osl_Process_E_None if the executable could be started, otherwise an error-code.
-
- @see osl_executeProcess_WithRedirectedIO()
- @see osl_freeProcessHandle()
- @see osl_loginUser()
+ @param nEnvironmentVars [in] the number of environment vars to set.
+ @param pProcess [out] points to a oslProcess variable, in wich the processhandle is returned.
+ @return osl_Process_E_None if the executable could be started, otherwise an error-code.
+ @see osl_executeProcess_WithRedirectedIO
+ @see osl_freeProcessHandle
+ @see osl_loginUser
*/
-
-oslProcessError SAL_CALL osl_executeProcess(rtl_uString *pustrImageName,
- rtl_uString *pustrArguments[],
+oslProcessError SAL_CALL osl_executeProcess(rtl_uString *strImageName,
+ rtl_uString *strArguments[],
sal_uInt32 nArguments,
oslProcessOption Options,
oslSecurity Security,
- rtl_uString *pustrWorkDir,
- rtl_uString *pustrEnvironment[],
+ rtl_uString *strWorkDir,
+ rtl_uString *strEnvironment[],
sal_uInt32 nEnvironmentVars,
oslProcess *pProcess);
-/** Execute a process and redirected child process standard IO.
-
- @param pustrImageName [in]
- Denotes the file URL of the executable image to be started.
-
- @param pustrArguments [in]
- Is an array of argument strings.
-
- @param nArgument [in]
- The number of arguments provided.
-
- @param Options [in]
- Is a combination of int-constants to describe the mode of execution.
-
- @param Security [in]
- Describes a the user and his rights for wich the process is started.
-
- @param pustrWorkDir [in]
- Denotes the file URL of the working directory of the new process.
-
- @param pustrEnviroment [in]
- Is an array of strings wich describes the enviroment to set.
+/** Execute a process and redirected child process standard IO
+ @param strImageName [in] denotes the name of the executable to be started.
+ @param strArguments [in] is an array of argument strings.
+ @param nArgument [in] the number of arguments provided.
+ @param Options [in] is a combination of int-constants to describe the mode of execution.
+ @param Security [in] describes a the user and his rights for wich the process is started.
+ @param strDirectory [in] denotes the name of the startup directory.
+ @param strEnviroments [in] is an array of strings wich describes the enviroment to set.
Each string has the form "variable=value".
-
- @param nEnvironmentVars [in]
- The number of environment vars to set.
-
- @param pResource [in]
- Is a NULL terminated array of resources to transmit to the client process.
-
- @param pProcess [out]
- Points to a oslProcess variable, in wich the processhandle is returned.
-
- @param pChildInputWrite [out]
- Points to a oslFileHandle variable that receives the handle which can
+ @param nEnvironmentVars [in] the number of environment vars to set.
+ @param pResource [in] is a NULL terminated array of resources to transmit to the client process.
+ @param pProcess [out] points to a oslProcess variable, in wich the processhandle is returned.
+ @param pChildInputWrite [out] points to a oslFileHandle variable that receives the handle which can
be used to write to child process standard input device. Handle has to be closed with osl_closeFile
if no longer used.
-
- @param pChildOutputRead [out]
- Points to a oslFileHandle variable that receives the handle which can be used to read from
- child process standard output device. Handle has to be closed with osl_closeFile if no longer used.
-
- @param pChildErrorRead [out]
- Points to a oslFileHandle variable that receives the handle which can be used to read from child
- process standard error device. Handle has to be closed with osl_closeFile if no longer used.
-
- @return
- osl_Process_E_None if the executable could be started, otherwise an error-code.
-
- @see osl_executeProcess()
- @see osl_freeProcessHandle()
- @see osl_loginUser()
- @see osl_closeFile()
+ @param pChildOutputRead [out] points to a oslFileHandle variable that receives the handle which can
+ be used to read from child process standard output device. Handle has to be closed with osl_closeFile
+ if no longer used.
+ @param pChildErrorRead [out] points to a oslFileHandle variable that receives the handle which can
+ be used to read from child process standard error device. Handle has to be closed with osl_closeFile
+ if no longer used.
+ @return osl_Process_E_None if the executable could be started, otherwise an error-code.
+ @see osl_executeProcess
+ @see osl_freeProcessHandle
+ @see osl_loginUser
+ @see osl_closeFile
*/
-
-oslProcessError SAL_CALL osl_executeProcess_WithRedirectedIO(rtl_uString *pustrImageName,
- rtl_uString *pustrArguments[],
+oslProcessError SAL_CALL osl_executeProcess_WithRedirectedIO(rtl_uString *strImageName,
+ rtl_uString *strArguments[],
sal_uInt32 nArguments,
oslProcessOption Options,
oslSecurity Security,
- rtl_uString *pustrWorkDir,
- rtl_uString *pustrEnvironment[],
+ rtl_uString *strWorkDir,
+ rtl_uString *strEnvironment[],
sal_uInt32 nEnvironmentVars,
oslProcess *pProcess,
oslFileHandle *pChildInputWrite,
oslFileHandle *pChildOutputRead,
oslFileHandle *pChildErrorRead);
+/** Terminate a process
+ @param Process [in] the handle of the process to be terminated
-/** Terminate a process.
-
- @param Process [in]
- The handle of the process to be terminated.
-
- @see osl_executeProcess()
- @see osl_getProcess()
- @see osl_joinProcess()
-*/
-
+ @see osl_executeProcess
+ @see osl_getProcess
+ @see osl_joinProcess
+ */
oslProcessError SAL_CALL osl_terminateProcess(oslProcess Process);
-/** Retrieve the process handle of a process identifier
+/** @deprecated
+ Retrieve the process handle of a process identifier
+ @param Ident [in] a process identifier
- @deprecated
-
- @param Ident [in]
- A process identifier.
-
- @return
- The process handle on success, NULL in all other cases.
+ @return the process handle on success, NULL in all other cases
*/
-
oslProcess SAL_CALL osl_getProcess(oslProcessIdentifier Ident);
/** Free the specified proces-handle.
-
@param Process [in]
- The handle of the process.
-
- @see osl_executeProcess()
- @see osl_executeProcess_WithRedirectedIO()
*/
-
void SAL_CALL osl_freeProcessHandle(oslProcess Process);
-/** Wait for completation of the specified child-process.
-
+/** Wait for completation of the specified childprocess.
@param Process [in]
- The handle of the process.
-
- @return
- ols_Process_E_None on success, otherwise an error code.
-
- @see osl_executeProcess()
- @see osl_executeProcess_WithRedirectedIO()
+ @return ols_Process_E_None
+ @see osl_executeProcess
*/
-
oslProcessError SAL_CALL osl_joinProcess(oslProcess Process);
-
-/** Retrieves information about a Process.
+/** Wait with a timeout for the completion of the specified child
+ process.
@param Process [in]
- The handle of the process.
-
- @param Fields [in]
- The information which is to be retrieved this can be one or more of
- osl_Process_IDENTIFIER
- osl_Process_EXITCODE
- osl_Process_CPUTIMES
- osl_Process_HEAPUSAGE
+ A process identifier.
- @param pInfo [out]
- A pointer to a vaid oslProcessInfo structure. The Size field has to be initialized with the size
- of the oslProcessInfo structure. On success the the Field member holds the (or'ed) retrieved
- valid information fields.
+ @param pTimeout [in]
+ A timeout value or NULL for infinite waiting.
+ The unit of resolution is second.
@return
osl_Process_E_None on success
- osl_Process_E_Unknown on failure.
+ osl_Process_E_TimedOut waiting for the child process timed out
+ osl_Process_E_Unknown an error occured or the parameter are invalid
- @see osl_executeProcess()
- @see osl_executeProcess_WithRedirectedIO()
+ @see osl_executeProcess
+*/
+oslProcessError SAL_CALL osl_joinProcessWithTimeout(oslProcess Process, const TimeValue* pTimeout);
+
+/** Retrieves information about a Process
+ @param Process [in] the process handle of the process
+ @param Field [in] the information which is to be retrieved
+ this can be one or more of
+ osl_Process_IDENTIFIER
+ osl_Process_EXITCODE
+ osl_Process_CPUTIMES
+ osl_Process_HEAPUSAGE
+ @param pInfo [out] a pointer to a vaid oslProcessInfo structure.
+ the Size field has to be initialized with the size
+ of the oslProcessInfo structure.
+ on success the the Field member holds the (or'ed)
+ retrieved valid information fields.
+ @return osl_Process_E_None on success, osl_Process_E_Unknown on failure.
*/
+oslProcessError SAL_CALL osl_getProcessInfo(oslProcess Process, oslProcessData Fields,
+ oslProcessInfo* pInfo);
-oslProcessError SAL_CALL osl_getProcessInfo(
- oslProcess Process,
- oslProcessData Fields,
- oslProcessInfo* pInfo);
-
-
-/** Get the file name of the executable.
-
- @param ppustrFile [out]
- Receives the file URL of the executable image.
-
- @return
- osl_Process_E_None or does not return.
-
- @see osl_executeProcess()
- @see osl_executeProcess_WithRedirectedIO()
+/** Get the filename of the executable.
+ @param strFile [out] the string that receives the executable file path.
+ @return osl_Process_E_None or does not return.
+ @see osl_executeProcess
*/
+oslProcessError SAL_CALL osl_getExecutableFile(rtl_uString **strFile);
-oslProcessError SAL_CALL osl_getExecutableFile(rtl_uString **ppustrFile);
-
-
-/** Get the number of command line arguments.
-
- @return
- The number of commandline arguments passed to the main function of
- this process.
-
- @see osl_getCommandArg()
+/** @return the number of commandline arguments passed to the main-function of
+ this process
+ @see osl_getCommandArg
*/
-
sal_uInt32 SAL_CALL osl_getCommandArgCount();
-
-/** Get the nArg-th command line argument passed to the main function of this process.
-
- @param nArg [in]
- The number of the argument to return.
-
- @param pustrCommandArg [out]
- The string receives the nArg-th command-line argument.
-
- @return
- osl_Process_E_None or does not return.
-
- @see osl_getCommandArgCount()
+/** Get the nArg-th command-line argument passed to the main-function of this process.
+ @param nArg [in] The number of the argument to return.
+ @param strCommandArg [out] The string receives the nArg-th command-line argument.
+ @return osl_Process_E_None or does not return.
+ @see osl_executeProcess
*/
-
-oslProcessError SAL_CALL osl_getCommandArg(sal_uInt32 nArg, rtl_uString **pustrCommandArg);
+oslProcessError SAL_CALL osl_getCommandArg(sal_uInt32 nArg, rtl_uString **strCommandArg);
/** Get the value of one enviroment variable.
-
- @param pustrVar [in]
- Denotes the name of the variable to get.
-
- @param ppustrValue [out]
- String that receives the value of environment variable.
+ @param strVar [in] denotes the name of the variable to get.
+ @param strValue [out] string that receives the value of environment variable.
*/
-
-oslProcessError SAL_CALL osl_getEnvironment(rtl_uString *pustrVar, rtl_uString **ppustrValue);
-
+oslProcessError SAL_CALL osl_getEnvironment(rtl_uString *strVar, rtl_uString **strValue);
/** Get the working directory of the current process as a file URL.
The file URL is encoded as common for the OSL file API.
-
- @param ppustrWorkingDir [out]
- String that receives the working directory URL.
+ @param pustrWorkingDir [out] string that receives the working directory file URL.
*/
-oslProcessError SAL_CALL osl_getProcessWorkingDir( rtl_uString **ppustrWorkingDir );
-
+oslProcessError SAL_CALL osl_getProcessWorkingDir( rtl_uString **pustrWorkingDir );
/** Get the locale the process is currently running in.
The unix implementation caches the value it returns, so if you have to change the locale
your are running in, you will have to use osl_setProcessLocale therefor.
- @param ppLocale [out]
- A pointer that receives the currently selected locale structure.
-
- @see osl_setProcessLocale()
+ @param ppLocale [out] a pointer that receives the currently selected locale structure
+ @see osl_setProcessLocale
*/
oslProcessError SAL_CALL osl_getProcessLocale( rtl_Locale ** ppLocale );
-
/** Change the locale of the process.
- @param pLocale [in]
- A pointer to the locale to be set.
-
- @see osl_getProcessLocale()
+ @param pLocale [in] a pointer to the locale to be set
+ @see osl_getProcessLocale
*/
oslProcessError SAL_CALL osl_setProcessLocale( rtl_Locale * pLocale );
-/** @internal
-*/
sal_Bool SAL_CALL osl_sendResourcePipe(oslPipe Pipe, oslSocket Socket);
-/** @internal
-*/
-
oslSocket SAL_CALL osl_receiveResourcePipe(oslPipe Pipe);
#ifdef __cplusplus
diff --git a/sal/inc/osl/semaphor.h b/sal/inc/osl/semaphor.h
index 40d75d4af0b9..320d283eebb4 100644
--- a/sal/inc/osl/semaphor.h
+++ b/sal/inc/osl/semaphor.h
@@ -2,9 +2,9 @@
*
* $RCSfile: semaphor.h,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: obr $ $Date: 2001-11-12 15:51:50 $
+ * last change: $Author: hr $ $Date: 2003-03-26 16:45:37 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -72,36 +72,34 @@ extern "C" {
typedef void* oslSemaphore;
-/** Creates a semaphore.
+/** Creates a semaphore.<BR>
@param InitialCount denotes the starting value the semaphore. If you set it to
zero, the first acquire() blocks. Otherwise InitialCount acquire()s are
immedeatly successfull.
- @return NULL if the semaphore could not be created, otherwise a handle
- to the created semaphore object.
+ @return 0 if the semaphore could not be created, otherwise a handle to the sem.
*/
oslSemaphore SAL_CALL osl_createSemaphore(sal_uInt32 initialCount);
-/** Release the OS-structures and free semaphore data-structure.
+/** Release the OS-structures and free semaphore data-structure
+ @return fbbb
*/
void SAL_CALL osl_destroySemaphore(oslSemaphore Semaphore);
-/** Decrease the count of a semaphore.
-
- It will block if it tries to decrease below zero.
- @return sal_False if the system-call failed.
+/** acquire() decreases the count. It will block if it tries to
+ decrease below zero.
+ @return False if the system-call failed.
*/
sal_Bool SAL_CALL osl_acquireSemaphore(oslSemaphore Semaphore);
-/** tries to decreases the count of a semaphore.
-
- @return sal_False if it would decrease the count below zero.
- (acquire() would block). If it could successfully
- decrease the count, it will return sal_True.
+/** tryToAcquire() tries to decreases the count. It will
+ return with False if it would decrease the count below zero.
+ (When acquire() would block.) If it could successfully
+ decrease the count, it will return True.
*/
sal_Bool SAL_CALL osl_tryToAcquireSemaphore(oslSemaphore Semaphore);
-/** Increases the count of a semaphore.
- @return sal_False if the system-call failed.
+/** release() increases the count.
+ @return False if the system-call failed.
*/
sal_Bool SAL_CALL osl_releaseSemaphore(oslSemaphore Semaphore);
diff --git a/sal/inc/osl/semaphor.hxx b/sal/inc/osl/semaphor.hxx
index 8e0b14e47957..a37b997ade76 100644
--- a/sal/inc/osl/semaphor.hxx
+++ b/sal/inc/osl/semaphor.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: semaphor.hxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: obr $ $Date: 2001-11-12 15:51:50 $
+ * last change: $Author: hr $ $Date: 2003-03-26 16:45:37 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -75,11 +75,11 @@ namespace osl
public:
- /** Creates a semaphore.
+ /** Creates a semaphore.<BR>
@param InitialCount denotes the starting value the semaphore. If you set it to
zero, the first acquire() blocks. Otherwise InitialCount acquire()s are
immedeatly successfull.
- @seealso ::osl_createSemaphore()
+ @return 0 if the semaphore could not be created, otherwise a handle to the sem.
*/
Semaphore(sal_uInt32 initialCount)
@@ -88,39 +88,34 @@ namespace osl
}
/** Release the OS-structures and free semaphore data-structure
- @seealso ::osl_destroySemaphore()
+ @return fbbb
*/
~Semaphore()
{
osl_destroySemaphore(semaphore);
}
- /** Decreases the count of the semaphore object.
-
- It will block if it tries to decrease below zero.
- @return sal_False if the system-call failed
- @seealso ::osl_acquireSemaphore()
+ /** acquire() decreases the count. It will block if it tries to
+ decrease below zero.
+ @return False if the system-call failed.
*/
sal_Bool acquire()
{
return osl_acquireSemaphore(semaphore);
}
- /** Tries to decreases the count of the semaphore.
-
- @return sal_False if it would decrease the count below zero
- (acquire() would block). If it could successfully
- decrease the count, it will return sal_True.
- @seealso ::osl_tryToAcquireSemaphore()
+ /** tryToAcquire() tries to decreases the count. It will
+ return with False if it would decrease the count below zero.
+ (When acquire() would block.) If it could successfully
+ decrease the count, it will return True.
*/
sal_Bool tryToAcquire()
{
return osl_tryToAcquireSemaphore(semaphore);
}
- /** Increases the count.
- @return sal_False if the system-call failed.
- @seealso ::osl_releaseSemaphore()
+ /** release() increases the count.
+ @return False if the system-call failed.
*/
sal_Bool release()
{
diff --git a/sal/inc/osl/thread.hxx b/sal/inc/osl/thread.hxx
index 862ad19eb188..b38dc685ef7b 100644
--- a/sal/inc/osl/thread.hxx
+++ b/sal/inc/osl/thread.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: thread.hxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: jl $ $Date: 2001-10-23 08:48:16 $
+ * last change: $Author: hr $ $Date: 2003-03-26 16:45:38 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -88,8 +88,6 @@ namespace osl
*/
extern "C" inline void SAL_CALL threadFunc( void* param);
-/** The Thread class is a c++ wrapper for the C thread API.
- */
class Thread
{
Thread( const Thread& );
@@ -107,24 +105,11 @@ public:
Thread(): m_hThread(0){}
- /** Destroyes the thread.
-
- @see osl_destroyThread
- */
virtual ~Thread()
{
osl_destroyThread( m_hThread);
}
- /** Creates a thread.
-
- In order to create a thread one has to supply a class that inherits this Thread class
- and one has to provide an implementations for the run function. When create is called
- then the run function is executed.
- @see osl_createThread
- @see osl_createSuspendedThread
-
- */
sal_Bool SAL_CALL create()
{
OSL_ASSERT(m_hThread == 0); // only one running thread per instance
@@ -138,12 +123,6 @@ public:
return m_hThread != 0;
}
- /** Creates a thread that is suspended.
-
- To run the thread one has to call resume.
-
- @see osl_createSuspendedThread
- */
sal_Bool SAL_CALL createSuspended()
{
OSL_ASSERT(m_hThread == 0); // only one running thread per instance
@@ -154,117 +133,67 @@ public:
return m_hThread != 0;
}
- /** Suspends the thread.
-
- @see osl_suspendThread
- */
virtual void SAL_CALL suspend()
{
osl_suspendThread(m_hThread);
}
- /** Puts the thread in a running state if it is currently suspended.
-
- @see osl_resumeThread
- */
virtual void SAL_CALL resume()
{
osl_resumeThread(m_hThread);
}
- /** Terminates the thread.
-
- @see osl_terminateThread
- */
virtual void SAL_CALL terminate()
{
osl_terminateThread(m_hThread);
}
- /**
-
- @see osl_joinWithThread
- */
virtual void SAL_CALL join()
{
osl_joinWithThread(m_hThread);
}
- /** Determines if this thread is running or not.
- @return true, if thread is running, false otherwise.
- @see osl_isThreadRunning
- */
sal_Bool SAL_CALL isRunning()
{
return m_hThread != 0 && osl_isThreadRunning(m_hThread);
}
- /** Sets the priority of this thread.
-
- @see osl_setThreadPriority
- */
void SAL_CALL setPriority( oslThreadPriority Priority)
{
osl_setThreadPriority(m_hThread, Priority);
}
- /** Returns the priority of this thread.
-
- @see osl_getThreadPriority
- */
oslThreadPriority SAL_CALL getPriority()
{
return osl_getThreadPriority(m_hThread);
}
- /** Returns the identifier this thread.
- @see osl_getThreadIdentifier
- */
oslThreadIdentifier SAL_CALL getIdentifier() const
{
return osl_getThreadIdentifier(m_hThread);
}
- /** Returns the identifier of the current thread.
-
- @see osl_getThreadIdentifier
- */
static oslThreadIdentifier SAL_CALL getCurrentIdentifier()
{
return osl_getThreadIdentifier(0);
}
- /** Blocks the current thread for the specified amount of time.
-
- @see osl_waitThread
- */
static void SAL_CALL wait(const TimeValue& Delay)
{
osl_waitThread(&Delay);
}
- /** Has the operating system to run another thread and put this thread into
- suspended state until it is being scheduled again.
-
- @see osl_yieldThread
- */
static void SAL_CALL yield()
{
osl_yieldThread();
}
- /**
- @see osl_scheduleThread
- */
virtual sal_Bool SAL_CALL schedule()
{
return osl_scheduleThread(m_hThread);
}
- /** Extractor (or cast operator) for the thread handle.
-
- */
SAL_CALL operator oslThread() const
{
return m_hThread;
@@ -277,20 +206,8 @@ protected:
*/
friend void SAL_CALL threadFunc( void* param);
- /** The run function is run automatically after create has been called.
-
- run has to be provided by the class that inherits the Thread class.
- Put all code that has to be performed by the thread into this function.
-
- */
virtual void SAL_CALL run() = 0;
- /** Notifies the instance of this class that the termination of this
- thread is imminent.
-
- In order to process this notification one has to override this
- function.
- */
virtual void SAL_CALL onTerminated()
{
}
@@ -311,19 +228,13 @@ class ThreadData
ThreadData( const ThreadData& );
ThreadData& operator= (const ThreadData& );
public:
- /** Create a thread specific local data key.
-
- @see osl_createThreadKey
- */
+ /// Create a thread specific local data key
ThreadData( oslThreadKeyCallbackFunction pCallback= 0 )
{
m_hKey = osl_createThreadKey( pCallback );
}
- /** Destroy a thread specific local data key.
-
- @see osl_destroyThreadKey
- */
+ /// Destroy a thread specific local data key
~ThreadData()
{
osl_destroyThreadKey(m_hKey);
@@ -331,7 +242,6 @@ public:
/** Set the data associated with the data key.
@returns True if operation was successfull
- @see osl_setThreadKeyData
*/
sal_Bool SAL_CALL setData(void *pData)
{
@@ -340,16 +250,13 @@ public:
/** Get the data associated with the data key.
@returns The data asscoitaed with the data key or
- NULL if no data was set.
- @see osl_getThreadKeyData
+ NULL if no data was set
*/
void* SAL_CALL getData()
{
return osl_getThreadKeyData(m_hKey);
}
- /** Extractor (or cast operator) for the key handle.
- */
operator oslThreadKey() const
{
return m_hKey;
diff --git a/sal/inc/osl/time.h b/sal/inc/osl/time.h
index 22e10ef6fbf6..3be6fb4127d7 100644
--- a/sal/inc/osl/time.h
+++ b/sal/inc/osl/time.h
@@ -2,9 +2,9 @@
*
* $RCSfile: time.h,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: obr $ $Date: 2001-11-08 15:48:05 $
+ * last change: $Author: hr $ $Date: 2003-03-26 16:45:40 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -80,8 +80,8 @@ extern "C" {
# pragma pack(1)
#endif
-/** Time since Jan-01-1970
-*/
+/* Time since Jan-01-1970 */
+
typedef struct {
sal_uInt32 Seconds;
sal_uInt32 Nanosec;
@@ -98,10 +98,9 @@ typedef struct {
/* oslDateTime */
/****************************************************************************/
-/** Contains all elements of a timestamp as an own member
-*/
typedef struct _oslDateTime
{
+ /*----------------------------------------------------------------------*/
/** contains the nanoseconds .
*/
sal_uInt32 NanoSeconds;
@@ -110,26 +109,32 @@ typedef struct _oslDateTime
*/
sal_uInt16 Seconds;
+ /*----------------------------------------------------------------------*/
/** contains the minutes (0-59).
*/
sal_uInt16 Minutes;
+ /*----------------------------------------------------------------------*/
/** contains the hour (0-23).
*/
sal_uInt16 Hours;
+ /*----------------------------------------------------------------------*/
/** is the day of month (1-31).
*/
sal_uInt16 Day;
+ /*----------------------------------------------------------------------*/
/** is the day of week (0-6 , 0 : Sunday).
*/
sal_uInt16 DayOfWeek;
+ /*----------------------------------------------------------------------*/
/** is the month of year (1-12).
*/
sal_uInt16 Month;
+ /*----------------------------------------------------------------------*/
/** is the year.
*/
sal_uInt16 Year;
diff --git a/sal/inc/osl/util.h b/sal/inc/osl/util.h
index 2f56fd6e6f4d..feb961ce552e 100644
--- a/sal/inc/osl/util.h
+++ b/sal/inc/osl/util.h
@@ -2,9 +2,9 @@
*
* $RCSfile: util.h,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: obr $ $Date: 2001-11-12 15:51:50 $
+ * last change: $Author: hr $ $Date: 2003-03-26 16:45:41 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -69,8 +69,9 @@
extern "C" {
#endif
-/** Retrieves an ethernet address of the machine.
+/**
@param pEthernetAddr 6 bytes of memory
+
@return sal_True if the ethernetaddress could be retrieved. <br>
sal_False if no address could be found. This may be either because
there is no ethernet card or there is no appropriate algorithm
diff --git a/sal/inc/rtl/math.h b/sal/inc/rtl/math.h
index 12f528a36e6d..6a2bf9127c2f 100644
--- a/sal/inc/rtl/math.h
+++ b/sal/inc/rtl/math.h
@@ -2,9 +2,9 @@
*
* $RCSfile: math.h,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: sb $ $Date: 2002-11-04 15:21:35 $
+ * last change: $Author: hr $ $Date: 2003-03-26 16:45:48 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -69,7 +69,8 @@
extern "C" {
#endif /* __cplusplus */
-/** Formatting modes for rtl_math_doubleToString and rtl_math_doubleToUString.
+/** Formatting modes for rtl_math_doubleToString and rtl_math_doubleToUString
+ and rtl_math_doubleToUStringBuffer.
*/
enum rtl_math_StringFormat
{
@@ -154,6 +155,23 @@ enum rtl_math_RoundingMode
rtl_math_RoundingMode_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
};
+/** Special decimal places constants for rtl_math_doubleToString and
+ rtl_math_doubleToUString and rtl_math_doubleToUStringBuffer.
+ */
+enum rtl_math_DecimalPlaces
+{
+ /** Value to be used with rtl_math_StringFormat_Automatic.
+ */
+ rtl_math_DecimalPlaces_Max = 0x7ffffff,
+
+ /** Value to be used with rtl_math_StringFormat_G.
+ In fact the same value as rtl_math_DecimalPlaces_Max, just an alias for
+ better understanding.
+ */
+ rtl_math_DecimalPlaces_DefaultSignificance = 0x7ffffff
+};
+
+
/** Conversions analogous to sprintf() using internal rounding.
+/-HUGE_VAL are converted to "1.#INF" and "-1.#INF", NAN values are
@@ -170,10 +188,10 @@ enum rtl_math_RoundingMode
If non-null, it points to the current capacity of pResult, which is
considered to point to a string buffer (pResult must not itself be null in
this case, and must point to a string that has room for the given capacity).
- The string representation of the given double value is appended to pResult.
- If pResult's current capacity is too small, a new string buffer will be
- allocated in pResult as necessary, and pResultCapacity will contain the new
- capacity on return.
+ The string representation of the given double value is inserted into pResult
+ at position nResultOffset. If pResult's current capacity is too small, a
+ new string buffer will be allocated in pResult as necessary, and
+ pResultCapacity will contain the new capacity on return.
@param nResultOffset
If pResult is used as a string buffer (i.e., pResultCapacity is non-null),
@@ -184,14 +202,24 @@ enum rtl_math_RoundingMode
The value to convert.
@param eFormat
- The format to use. If eFormat == rtl_math_StringFormat_G and
- nDecPlaces < 0, the default number (currently 6) of decimals is generated.
- If eFormat == rtl_math_StringFormat_Automatic and nDecPlaces < 0, the
- highest number of significant decimals possible is generated.
+ The format to use, one of rtl_math_StringFormat.
@param nDecPlaces
- The number of decimals to be generated. Must be non-negative, expect as
- described for the eFormat parameter.
+ The number of decimals to be generated. Effectively fValue is rounded at
+ this position, specifying nDecPlaces <= 0 accordingly rounds the value
+ before the decimal point and fills with zeros.
+ If eFormat == rtl_math_StringFormat_Automatic and nDecPlaces ==
+ rtl_math_DecimalPlaces_Max, the highest number of significant decimals
+ possible is generated.
+ If eFormat == rtl_math_StringFormat_G, nDecPlaces specifies the number of
+ significant digits instead. If nDecPlaces ==
+ rtl_math_DecimalPlaces_DefaultSignificance, the default number (currently 6
+ as implemented by most libraries) of significant digits is generated.
+ According to the ANSI C90 standard the E style will be used only if the
+ exponent resulting from the conversion is less than -4 or greater than or
+ equal to the precision. However, as opposed to the ANSI standard, trailing
+ zeros are not necessarily removed from the fractional portion of the result
+ unless bEraseTrailingDecZeros == true was specified.
@param cDecSeparator
The decimal separator.
@@ -200,7 +228,8 @@ enum rtl_math_RoundingMode
Either null (no grouping is used), or a null-terminated list of group
lengths. Each group length must be strictly positive. If the number of
digits in a conversion exceeds the specified range, the last (highest) group
- length is repeated as needed.
+ length is repeated as needed. Values are applied from right to left, for a
+ grouping of 1,00,00,000 you'd have to specify pGroups={3,2,0}.
@param cGroupSeparator
The group separator. Ignored if pGroups is null.
@@ -235,10 +264,10 @@ void SAL_CALL rtl_math_doubleToString(rtl_String ** pResult,
If non-null, it points to the current capacity of pResult, which is
considered to point to a string buffer (pResult must not itself be null in
this case, and must point to a string that has room for the given capacity).
- The string representation of the given double value is appended to pResult.
- If pResult's current capacity is too small, a new string buffer will be
- allocated in pResult as necessary, and pResultCapacity will contain the new
- capacity on return.
+ The string representation of the given double value is inserted into pResult
+ at position nResultOffset. If pResult's current capacity is too small, a
+ new string buffer will be allocated in pResult as necessary, and
+ pResultCapacity will contain the new capacity on return.
@param nResultOffset
If pResult is used as a string buffer (i.e., pResultCapacity is non-null),
@@ -249,14 +278,24 @@ void SAL_CALL rtl_math_doubleToString(rtl_String ** pResult,
The value to convert.
@param eFormat
- The format to use. If eFormat == rtl_math_StringFormat_G and
- nDecPlaces < 0, the default number (currently 6) of decimals is generated.
- If eFormat == rtl_math_StringFormat_Automatic and nDecPlaces < 0, the
- highest number of significant decimals possible is generated.
+ The format to use, one of rtl_math_StringFormat.
@param nDecPlaces
- The number of decimals to be generated. Must be non-negative, expect as
- described for the eFormat parameter.
+ The number of decimals to be generated. Effectively fValue is rounded at
+ this position, specifying nDecPlaces <= 0 accordingly rounds the value
+ before the decimal point and fills with zeros.
+ If eFormat == rtl_math_StringFormat_Automatic and nDecPlaces ==
+ rtl_math_DecimalPlaces_Max, the highest number of significant decimals
+ possible is generated.
+ If eFormat == rtl_math_StringFormat_G, nDecPlaces specifies the number of
+ significant digits instead. If nDecPlaces ==
+ rtl_math_DecimalPlaces_DefaultSignificance, the default number (currently 6
+ as implemented by most libraries) of significant digits is generated.
+ According to the ANSI C90 standard the E style will be used only if the
+ exponent resulting from the conversion is less than -4 or greater than or
+ equal to the precision. However, as opposed to the ANSI standard, trailing
+ zeros are not necessarily removed from the fractional portion of the result
+ unless bEraseTrailingDecZeros == true was specified.
@param cDecSeparator
The decimal separator.
@@ -265,7 +304,8 @@ void SAL_CALL rtl_math_doubleToString(rtl_String ** pResult,
Either null (no grouping is used), or a null-terminated list of group
lengths. Each group length must be strictly positive. If the number of
digits in a conversion exceeds the specified range, the last (highest) group
- length is repeated as needed.
+ length is repeated as needed. Values are applied from right to left, for a
+ grouping of 1,00,00,000 you'd have to specify pGroups={3,2,0}.
@param cGroupSeparator
The group separator. Ignored if pGroups is null.
diff --git a/sal/inc/rtl/math.hxx b/sal/inc/rtl/math.hxx
index 9347464fe6e6..d2b262813df3 100644
--- a/sal/inc/rtl/math.hxx
+++ b/sal/inc/rtl/math.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: math.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: sb $ $Date: 2002-11-06 15:49:29 $
+ * last change: $Author: hr $ $Date: 2003-03-26 16:45:48 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -65,6 +65,7 @@
#include "rtl/math.h"
#include "rtl/string.hxx"
#include "rtl/ustring.hxx"
+#include "rtl/ustrbuf.hxx"
#include "sal/mathconf.h"
#include "sal/types.h"
@@ -134,6 +135,42 @@ inline rtl::OUString doubleToUString(double fValue,
return aResult;
}
+/** A wrapper around rtl_math_doubleToUString that appends to an
+ rtl::OUStringBuffer.
+ */
+inline void doubleToUStringBuffer( rtl::OUStringBuffer& rBuffer, double fValue,
+ rtl_math_StringFormat eFormat,
+ sal_Int32 nDecPlaces,
+ sal_Unicode cDecSeparator,
+ sal_Int32 const * pGroups,
+ sal_Unicode cGroupSeparator,
+ bool bEraseTrailingDecZeros = false)
+{
+ rtl_uString ** pData;
+ sal_Int32 * pCapacity;
+ rBuffer.accessInternals( &pData, &pCapacity );
+ rtl_math_doubleToUString( pData, pCapacity, rBuffer.getLength(), fValue,
+ eFormat, nDecPlaces, cDecSeparator, pGroups,
+ cGroupSeparator, bEraseTrailingDecZeros);
+}
+
+/** A wrapper around rtl_math_doubleToUString that appends to an
+ rtl::OUStringBuffer, with no grouping.
+ */
+inline void doubleToUStringBuffer( rtl::OUStringBuffer& rBuffer, double fValue,
+ rtl_math_StringFormat eFormat,
+ sal_Int32 nDecPlaces,
+ sal_Unicode cDecSeparator,
+ bool bEraseTrailingDecZeros = false)
+{
+ rtl_uString ** pData;
+ sal_Int32 * pCapacity;
+ rBuffer.accessInternals( &pData, &pCapacity );
+ rtl_math_doubleToUString( pData, pCapacity, rBuffer.getLength(), fValue,
+ eFormat, nDecPlaces, cDecSeparator, 0, 0,
+ bEraseTrailingDecZeros);
+}
+
/** A wrapper around rtl_math_stringToDouble.
*/
inline double stringToDouble(rtl::OString const & rString,
@@ -174,7 +211,7 @@ inline double stringToDouble(rtl::OUString const & rString,
/** A wrapper around rtl_math_round.
*/
inline double round(
- double fValue, int nDecPlaces,
+ double fValue, int nDecPlaces = 0,
rtl_math_RoundingMode eMode = rtl_math_RoundingMode_Corrected)
{
return rtl_math_round(fValue, nDecPlaces, eMode);
diff --git a/sal/inc/rtl/string.h b/sal/inc/rtl/string.h
index 9023d2ba32f5..17ca68080ac0 100644
--- a/sal/inc/rtl/string.h
+++ b/sal/inc/rtl/string.h
@@ -2,9 +2,9 @@
*
* $RCSfile: string.h,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: sb $ $Date: 2001-10-30 13:41:07 $
+ * last change: $Author: hr $ $Date: 2003-03-26 16:45:49 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1159,6 +1159,43 @@ sal_Int32 SAL_CALL rtl_string_getToken( rtl_String ** newStr , rtl_String * str,
*/
void SAL_CALL rtl_uString2String( rtl_String ** newStr, const sal_Unicode * str, sal_Int32 len, rtl_TextEncoding encoding, sal_uInt32 convertFlags ) SAL_THROW_EXTERN_C();
+/**
+ Converts a Unicode string to a byte string, signalling failure.
+
+ @param pTarget
+ An out parameter receiving the converted string. Must not be null itself, and
+ must contain either null or a pointer to a valid rtl_String; the contents are
+ not modified if conversion fails (rtl_convertUStringToString returns false).
+
+ @param pSource
+ The Unicode string. May only be null if nLength is zero.
+
+ @param nLength
+ The length of the Unicode string. Must be non-negative.
+
+ @param nEncoding
+ The text encoding to convert into. Must be an octet encoding (i.e.,
+ rtl_isOctetTextEncoding(nEncoding) must return true).
+
+ @param nFlags
+ A combination of RTL_UNICODETOTEXT_FLAGS that detail how to do the conversion
+ (see rtl_convertUnicodeToText). RTL_UNICODETOTEXT_FLAGS_FLUSH need not be
+ included, it is implicitly assumed. Typical uses are either
+ RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR |
+ RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR (fail if a Unicode character cannot be
+ converted to the target nEncoding) or OUSTRING_TO_OSTRING_CVTFLAGS (make a
+ best efforts conversion).
+
+ @return
+ True if the conversion succeeded, false otherwise.
+ */
+sal_Bool SAL_CALL rtl_convertUStringToString(rtl_String ** pTarget,
+ sal_Unicode const * pSource,
+ sal_Int32 nLength,
+ rtl_TextEncoding nEncoding,
+ sal_uInt32 nFlags)
+ SAL_THROW_EXTERN_C();
+
#ifdef __cplusplus
}
#endif
diff --git a/sal/inc/rtl/textcvt.h b/sal/inc/rtl/textcvt.h
index 5f07c432ea1c..1049af3469b0 100644
--- a/sal/inc/rtl/textcvt.h
+++ b/sal/inc/rtl/textcvt.h
@@ -2,9 +2,9 @@
*
* $RCSfile: textcvt.h,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: sb $ $Date: 2001-10-29 15:14:45 $
+ * last change: $Author: hr $ $Date: 2003-03-26 16:45:49 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -115,6 +115,9 @@ void SAL_CALL rtl_resetTextToUnicodeContext( rtl_TextToUni
#define RTL_TEXTTOUNICODE_FLAGS_INVALID_IGNORE ((sal_uInt32)0x0200)
#define RTL_TEXTTOUNICODE_FLAGS_INVALID_DEFAULT ((sal_uInt32)0x0300)
#define RTL_TEXTTOUNICODE_FLAGS_FLUSH ((sal_uInt32)0x8000)
+#define RTL_TEXTTOUNICODE_FLAGS_GLOBAL_SIGNATURE 0x10000
+ /* Accept any global document signatures (for example, in UTF-8, a leading
+ EF BB BF encoding the Byte Order Mark U+FEFF) */
#define RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_MASK ((sal_uInt32)0x000F)
#define RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_MASK ((sal_uInt32)0x00F0)
@@ -184,6 +187,9 @@ void SAL_CALL rtl_resetUnicodeToTextContext( rtl_UnicodeTo
#define RTL_UNICODETOTEXT_FLAGS_PRIVATE_IGNORE ((sal_uInt32)0x2000)
#define RTL_UNICODETOTEXT_FLAGS_NOCOMPOSITE ((sal_uInt32)0x4000)
#define RTL_UNICODETOTEXT_FLAGS_FLUSH ((sal_uInt32)0x8000)
+#define RTL_UNICODETOTEXT_FLAGS_GLOBAL_SIGNATURE 0x10000
+ /* Write any global document signatures (for example, in UTF-8, a leading
+ EF BB BF encoding the Byte Order Mark U+FEFF) */
#define RTL_UNICODETOTEXT_FLAGS_UNDEFINED_MASK ((sal_uInt32)0x000F)
#define RTL_UNICODETOTEXT_FLAGS_INVALID_MASK ((sal_uInt32)0x00F0)
diff --git a/sal/inc/rtl/textenc.h b/sal/inc/rtl/textenc.h
index 68f04a4ca2b0..019abdd8ad3b 100644
--- a/sal/inc/rtl/textenc.h
+++ b/sal/inc/rtl/textenc.h
@@ -2,9 +2,9 @@
*
* $RCSfile: textenc.h,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: sb $ $Date: 2002-03-19 15:08:29 $
+ * last change: $Author: hr $ $Date: 2003-03-26 16:45:50 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -174,6 +174,7 @@ typedef sal_uInt16 rtl_TextEncoding;
#define RTL_TEXTENCODING_GB_18030 (RTL_TEXTENC_CAST( 85 ))
#define RTL_TEXTENCODING_BIG5_HKSCS (RTL_TEXTENC_CAST( 86 ))
#define RTL_TEXTENCODING_TIS_620 (RTL_TEXTENC_CAST( 87 ))
+#define RTL_TEXTENCODING_KOI8_U (RTL_TEXTENC_CAST( 88 ))
/* ATTENTION! Whenever some encoding is added here, make sure to update
* rtl_isOctetEncoding in tencinfo.c.
*/
@@ -225,6 +226,7 @@ Cyrillic (DOS/OS2-855) RTL_TEXTENCODING_IBM_855
Cyrillic (DOS/OS2-866/Russian) RTL_TEXTENCODING_IBM_866
Cyrillic (ISO-8859-5) RTL_TEXTENCODING_ISO_8859_5
Cyrillic (KOI8-R) RTL_TEXTENCODING_KOI8_R
+Cyrillic (KOI8-U) RTL_TEXTENCODING_KOI8_U
Cyrillic (Windows-1251) RTL_TEXTENCODING_MS_1251
Greek (Apple Macintosh) RTL_TEXTENCODING_APPLE_GREEK
diff --git a/sal/inc/rtl/tres.h b/sal/inc/rtl/tres.h
index 9ecbb00e6714..0555f741bd67 100644
--- a/sal/inc/rtl/tres.h
+++ b/sal/inc/rtl/tres.h
@@ -5,6 +5,14 @@
#include <osl/diagnose.h>
#endif
+#ifndef _RTL_STRING_H_
+#include <rtl/string.h>
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* comandline flags */
#define rtl_tres_Flag_BOOM 0x00000001
#define rtl_tres_Flag_VERBOSE 0x00000002
@@ -19,30 +27,84 @@
#define rtl_tres_Flag_PASSED 0x10000000
#define rtl_tres_Flag_OK 0x20000000
-#ifdef __cplusplus
-extern "C" {
-#endif
-typedef void* rtlTestResult;
-rtlTestResult SAL_CALL rtl_tres_create
- (
- const sal_Char* meth,
- sal_uInt32 flags
- );
+ /* forward declaration and type definition */
+struct _rtl_TestResult;
+typedef struct _rtl_TestResult rtl_TestResult;
+
-sal_Bool SAL_CALL rtl_tres_state
- (
- rtlTestResult res,
- sal_Bool bSuccess,
- sal_Char* pTestMsg,
- sal_Char* pFuncName
- );
+typedef void* rtl_funcstate;
+typedef void* rtl_cmpstate;
-sal_Bool SAL_CALL rtl_tres_destroy( rtlTestResult res );
+ /* type definitions of function pointers wich can be overloaded */
+typedef sal_Bool (SAL_CALL *rtl_tres_state_ptr)(
+ rtl_TestResult*,
+ sal_Bool,
+ const sal_Char*,
+ const sal_Char*,
+ sal_Bool
+ );
+
+typedef void (SAL_CALL *rtl_tres_end_ptr)( rtl_TestResult*, const sal_Char* );
+typedef sal_Bool (SAL_CALL *rtl_tres_ispassed_ptr)( rtl_TestResult* );
+typedef sal_Bool (SAL_CALL *rtl_tres_isok_ptr)( rtl_TestResult* );
+typedef rtl_funcstate (SAL_CALL *rtl_tres_funcstate_ptr)( rtl_TestResult* );
+typedef sal_Bool (SAL_CALL *rtl_tres_isbit_ptr)( rtl_TestResult*,
+ sal_uInt32 );
+
+typedef rtl_funcstate (SAL_CALL *rtl_tres_getnextfuncstate_ptr)
+ ( rtl_funcstate );
+typedef rtl_funcstate (SAL_CALL *rtl_tres_getprevfuncstate_ptr)
+ ( rtl_funcstate );
+typedef sal_uInt32 (SAL_CALL *rtl_tres_getflags_ptr)( rtl_funcstate );
+typedef rtl_String* (SAL_CALL *rtl_tres_getname_ptr)( rtl_funcstate );
+typedef sal_uInt32 (SAL_CALL *rtl_tres_getstart_ptr)( rtl_funcstate );
+typedef sal_uInt32 (SAL_CALL *rtl_tres_getstop_ptr)( rtl_funcstate );
+typedef rtl_cmpstate (SAL_CALL *rtl_tres_getcmpstate_ptr)( rtl_funcstate );
+
+typedef sal_Bool (SAL_CALL *rtl_tres_getstat_ptr)( rtl_cmpstate );
+typedef rtl_String* (SAL_CALL *rtl_tres_getmsg_ptr)( rtl_cmpstate );
+typedef rtl_cmpstate (SAL_CALL *rtl_tres_getnextcmpstate_ptr)( rtl_cmpstate );
+
+ /* type definition of vtable structure for testresult */
+typedef struct _rtl_TestResult_vtable
+{
+ sal_uInt32 vtablesize;
+ rtl_tres_state_ptr state_;
+ rtl_tres_end_ptr end_;
+ rtl_tres_ispassed_ptr ispassed;
+ rtl_tres_isok_ptr isok;
+ rtl_tres_funcstate_ptr funcstate;
+ rtl_tres_isbit_ptr isbit;
+ rtl_tres_getnextfuncstate_ptr nextfuncstate;
+ rtl_tres_getprevfuncstate_ptr prevfuncstate;
+ rtl_tres_getflags_ptr flags;
+ rtl_tres_getname_ptr name;
+ rtl_tres_getstart_ptr start;
+ rtl_tres_getstop_ptr stop;
+ rtl_tres_getcmpstate_ptr cmpstate;
+ rtl_tres_getstat_ptr stat;
+ rtl_tres_getmsg_ptr msg;
+ rtl_tres_getnextcmpstate_ptr nextcmpstate;
+
+} rtl_TestResult_vtable;
+
+ /* type definition of testresult structure */
+struct _rtl_TestResult
+{
+ rtl_TestResult_vtable * pFuncs;
+ void * pExternalData;
+
+};
+
+
+ /* exports */
+rtl_TestResult* SAL_CALL rtl_tres_create( const sal_Char* meth, sal_uInt32 flags );
+void SAL_CALL rtl_tres_destroy( rtl_TestResult* res );
#ifdef __cplusplus
}
#endif
-#endif
+#endif /* _RTL_TRES_H_ */
diff --git a/sal/inc/rtl/ustrbuf.hxx b/sal/inc/rtl/ustrbuf.hxx
index 5831d821c101..f188db606e5a 100644
--- a/sal/inc/rtl/ustrbuf.hxx
+++ b/sal/inc/rtl/ustrbuf.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ustrbuf.hxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: sb $ $Date: 2001-10-30 13:41:07 $
+ * last change: $Author: hr $ $Date: 2003-03-26 16:45:52 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -722,6 +722,29 @@ public:
sal_Unicode sz[RTL_USTR_MAX_VALUEOFDOUBLE];
return insert( offset, sz, rtl_ustr_valueOfDouble( sz, d ) );
}
+
+ /** Allows access to the internal data of this OUStringBuffer, for effective
+ manipulation.
+
+ This method should be used with care. After you have called this
+ method, you may use the returned pInternalData or pInternalCapacity only
+ as long as you make no other method call on this OUStringBuffer.
+
+ @param pInternalData
+ This output parameter receives a pointer to the internal data
+ (rtl_uString pointer). pInternalData itself must not be null.
+
+ @param pInternalCapacity
+ This output parameter receives a pointer to the internal capacity.
+ pInternalCapacity itself must not be null.
+ */
+ inline void accessInternals(rtl_uString *** pInternalData,
+ sal_Int32 ** pInternalCapacity)
+ {
+ *pInternalData = &pData;
+ *pInternalCapacity = &nCapacity;
+ }
+
private:
/**
A pointer to the data structur which contains the data.
@@ -738,5 +761,3 @@ private:
#endif /* __cplusplus */
#endif /* _RTL_USTRBUF_HXX_ */
-
-
diff --git a/sal/inc/rtl/ustring.h b/sal/inc/rtl/ustring.h
index df37c8d9b4e4..7e91ce5a6c78 100644
--- a/sal/inc/rtl/ustring.h
+++ b/sal/inc/rtl/ustring.h
@@ -2,9 +2,9 @@
*
* $RCSfile: ustring.h,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: jsc $ $Date: 2002-03-08 14:02:37 $
+ * last change: $Author: hr $ $Date: 2003-03-26 16:45:52 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -994,6 +994,7 @@ double SAL_CALL rtl_ustr_toDouble( const sal_Unicode * str ) SAL_THROW_EXTERN_C(
/** The implementation of a Unicode string.
+ @internal
*/
typedef struct _rtl_uString
{
diff --git a/sal/inc/rtl/ustring.hxx b/sal/inc/rtl/ustring.hxx
index c59913cff841..d037a70b0e42 100644
--- a/sal/inc/rtl/ustring.hxx
+++ b/sal/inc/rtl/ustring.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ustring.hxx,v $
*
- * $Revision: 1.13 $
+ * $Revision: 1.14 $
*
- * last change: $Author: sb $ $Date: 2002-10-17 13:06:16 $
+ * last change: $Author: hr $ $Date: 2003-03-26 16:45:53 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1063,6 +1063,37 @@ public:
}
/**
+ Converts to an OString, signalling failure.
+
+ @param pTarget
+ An out parameter receiving the converted OString. Must not be null; the
+ contents are not modified if conversion fails (convertToOString returns
+ false).
+
+ @param nEncoding
+ The text encoding to convert into. Must be an octet encoding (i.e.,
+ rtl_isOctetTextEncoding(nEncoding) must return true).
+
+ @param nFlags
+ A combination of RTL_UNICODETOTEXT_FLAGS that detail how to do the
+ conversion (see rtl_convertUnicodeToText). RTL_UNICODETOTEXT_FLAGS_FLUSH
+ need not be included, it is implicitly assumed. Typical uses are either
+ RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR |
+ RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR (fail if a Unicode character cannot
+ be converted to the target nEncoding) or OUSTRING_TO_OSTRING_CVTFLAGS
+ (make a best efforts conversion).
+
+ @return
+ True if the conversion succeeded, false otherwise.
+ */
+ inline bool convertToString(OString * pTarget, rtl_TextEncoding nEncoding,
+ sal_uInt32 nFlags)
+ {
+ return rtl_convertUStringToString(&pTarget->pData, pData->buffer,
+ pData->length, nEncoding, nFlags);
+ }
+
+ /**
Returns the string representation of the sal_Bool argument.
If the sal_Bool is true, the string "true" is returned.
diff --git a/sal/inc/sal/config.h b/sal/inc/sal/config.h
index d12adbc2bbf6..98ea9bc123d7 100644
--- a/sal/inc/sal/config.h
+++ b/sal/inc/sal/config.h
@@ -2,8 +2,8 @@
*
* $RCSfile: config.h,v $
*
- * $Revision: 1.15 $
- * last change: $Author: hro $ $Date: 2002-12-10 12:18:23 $
+ * $Revision: 1.16 $
+ * last change: $Author: hr $ $Date: 2003-03-26 16:45:57 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -81,6 +81,12 @@ extern "C" {
#define SAL_SYSCONFIGFILE( name ) name ".ini"
#ifdef _MSC_VER
+
+/* warnings ought to be disabled using /wd:n option of msvc.net compiler */
+#if _MSC_VER < 1300
+/* no performance warning: int to bool */
+#pragma warning( disable : 4800 )
+
/* No warning for: C++ Exception Specification ignored */
#pragma warning( disable : 4290 )
@@ -88,14 +94,15 @@ extern "C" {
/* No warning for: identifier was truncated to '255' characters in the browser information */
#pragma warning( disable : 4786 )
#endif
+#endif /* _MSC_VER < 1300 */
/* Provide ISO C99 compatible versions of snprint and vsnprintf */
#ifndef _SNPRINTF_H
#include <systools/win32/snprintf.h>
#endif
-#endif
-#endif
+#endif /* defined _MSC_VER */
+#endif /* defined WIN32 */
/* BR: 16bit fuer Borland-Compiler */
#ifdef __BORLANDC__
diff --git a/sal/inc/sal/mathconf.h b/sal/inc/sal/mathconf.h
index 1c248010f460..c72d795ac396 100644
--- a/sal/inc/sal/mathconf.h
+++ b/sal/inc/sal/mathconf.h
@@ -2,9 +2,9 @@
*
* $RCSfile: mathconf.h,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: sb $ $Date: 2002-11-06 15:48:48 $
+ * last change: $Author: hr $ $Date: 2003-03-26 16:45:58 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -65,7 +65,6 @@
#include "osl/endian.h"
#include <float.h>
-#include <limits.h>
#if defined SOLARIS
#include <ieeefp.h>
@@ -75,79 +74,21 @@
extern "C" {
#endif /* __cplusplus */
-/** @descr
- Handle FP errors using exceptions and setjmp/longjmp? DON'T in C++!
- Switch off with SAL_MATH_FPCONTROL() and just calculate, test results with
- SAL_MATH_FINITE(d), 0==error (INFinitiy, NaN), else ok.
- */
-#if 0
-#define SAL_MATH_FPSIGNAL_JUMP 1
-#else /* 0 */
-#define SAL_MATH_FPSIGNAL_JUMP 0
-#endif /* 0 */
-
-
-/* signal() ID for FP exceptions */
-#if defined RS6000
-#define SAL_MATH_SIGFPE SIGTRAP
-#else /* RS6000 */
-#define SAL_MATH_SIGFPE SIGFPE
-#endif /* RS6000 */
-
-/* SAL_MATH_FPCONTROL(): switch FP exceptions on/off, depending on
- SAL_MATH_FPSIGNAL_JUMP
- SAL_MATH_FPRESET(): reinitialize math package
-*/
-#if defined WNT || defined WIN
-
-#define SAL_MATH_FPEXCEPTIONS_ON() _control87( _MCW_EM, 0 )
+/* Generally, the C standard guarantees that at program startup, "trapping or
+ stopping (if supported) is disabled on all [floating-point] exceptions"
+ (F.7.3/1 of the August 3, 1998 draft of C99), and that during program
+ execution, "a programmer can safely assume default modes (or be unaware of
+ them)" (7.6/2, footnote 161 of the August 3, 1998 draft of C99). Reportedly,
+ on Windows there are printer drivers that switch on exceptions. To avoid
+ problems, the SAL_MATH_FPEXCEPTIONS_OFF macro can be used to explicitly
+ switch off exceptions (on Windows).
+ */
+#if defined WNT
#define SAL_MATH_FPEXCEPTIONS_OFF() _control87( _MCW_EM, _MCW_EM )
-#define SAL_MATH_FPRESET() _fpreset()
-
-#elif defined OS2
-
-#define SAL_MATH_FPEXCEPTIONS_ON() _control87( MCW_EM, 0 )
-#define SAL_MATH_FPEXCEPTIONS_OFF() _control87( MCW_EM, MCW_EM )
-#define SAL_MATH_FPRESET() _fpreset()
-
-#elif defined RS6000
-
-#define SAL_MATH_FPEXCEPTIONS_ON() fp_enable_all()
-#define SAL_MATH_FPEXCEPTIONS_OFF() fp_disable_all()
-#define SAL_MATH_FPRESET()
-
-#elif defined LINUX
-
-#include <fpu_control.h>
-
-void sal_math_setfpucw( fpu_control_t set );
-
-#if defined POWERPC
-/* set bit to 1 to enable that exception */
-/* _FPU_MASK_ZM | _FPU_MASK_OM | _FPU_MASK_UM | _FPU_MASK_IM */
-#define SAL_MATH_FPEXCEPTIONS_ON() sal_math_setfpucw(_FPU_DEFAULT | 0x000000F0)
-#define SAL_MATH_FPEXCEPTIONS_OFF() sal_math_setfpucw(_FPU_DEFAULT)
-#else /* POWERPC */
-#define SAL_MATH_FPEXCEPTIONS_ON() sal_math_setfpucw(_FPU_DEFAULT & ~0x001F)
-#define SAL_MATH_FPEXCEPTIONS_OFF() sal_math_setfpucw(_FPU_IEEE)
-#endif /* POWERPC */
-#define SAL_MATH_FPRESET()
-
-#else /* WNT, WIN, OS2, RS6000, LINUX */
-
-#define SAL_MATH_FPEXCEPTIONS_ON()
+#else /* WNT */
#define SAL_MATH_FPEXCEPTIONS_OFF()
-#define SAL_MATH_FPRESET()
-
-#endif /* WNT, WIN, OS2, RS6000, LINUX */
-
-
-#if SAL_MATH_FPSIGNAL_JUMP
-#define SAL_MATH_FPCONTROL() SAL_MATH_FPEXCEPTIONS_ON()
-#else /* SAL_MATH_FPSIGNAL_JUMP */
-#define SAL_MATH_FPCONTROL() SAL_MATH_FPEXCEPTIONS_OFF()
-#endif /* SAL_MATH_FPSIGNAL_JUMP */
+#endif /* WNT */
/* SAL_MATH_FINITE(d): test double d on INFINITY, NaN et al. */
@@ -229,6 +170,7 @@ union sal_math_Double
#endif /* IEEE 754 supported */
+
#if defined __cplusplus
}
#endif /* __cplusplus */
diff --git a/sal/inc/sal/types.h b/sal/inc/sal/types.h
index 337bd761529b..2266eccd5a9f 100644
--- a/sal/inc/sal/types.h
+++ b/sal/inc/sal/types.h
@@ -2,9 +2,9 @@
*
* $RCSfile: types.h,v $
*
- * $Revision: 1.17 $
+ * $Revision: 1.18 $
*
- * last change: $Author: svesik $ $Date: 2002-03-18 00:43:54 $
+ * last change: $Author: hr $ $Date: 2003-03-26 16:45:58 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -62,14 +62,7 @@
#ifndef _SAL_TYPES_H_
#define _SAL_TYPES_H_
-#ifndef _SAL_CONFIG_H_
#include <sal/config.h>
-#endif
-
-#ifndef INCLUDED_STDLIB_H
-#include <stdlib.h>
-#define INCLUDED_STDLIB_H
-#endif
#ifdef __cplusplus
extern "C" {
@@ -118,7 +111,7 @@ typedef unsigned long sal_Size;
#define SAL_MAX_ENUM 0x7fff
#endif
-#if defined(_MSC_VER) || (defined(WNT) && defined(__GNUC__))
+#ifdef _MSC_VER
# define SAL_DLLEXPORT __declspec(dllexport)
# define SAL_CALL __cdecl
# define SAL_CALL_ELLIPSE __cdecl
@@ -138,9 +131,9 @@ typedef unsigned long sal_Size;
# error("unknown platform")
#endif
-/* Use this for pure virtual classes, e.g. class SAL_NO_VTABLE Foo { ...
- This hinders the compiler from setting a generic vtable stating that
- a pure virtual function was called and thus slightly reduces code size.
+/** Use this for pure virtual classes, e.g. class SAL_NO_VTABLE Foo { ...
+ This hinders the compiler from setting a generic vtable stating that
+ a pure virtual function was called and thus slightly reduces code size.
*/
#ifdef _MSC_VER
#define SAL_NO_VTABLE __declspec(novtable)
@@ -155,21 +148,21 @@ typedef unsigned long sal_Size;
#endif
/** This is the binary specification of a SAL sequence.
+ <br>
*/
typedef struct _sal_Sequence
{
- /** reference count of sequence
+ /** reference count of sequence<br>
*/
sal_Int32 nRefCount;
- /** element count
+ /** element count<br>
*/
sal_Int32 nElements;
- /** elements array
+ /** elements array<br>
*/
char elements[1];
} sal_Sequence;
-/** calculated header size excluding elements array
-*/
+
#define SAL_SEQUENCE_HEADER_SIZE ((sal_Size)&((sal_Sequence *)0)->elements)
#ifdef SAL_W32
@@ -179,12 +172,12 @@ typedef struct _sal_Sequence
#endif
-/* Wrap C++ const_cast, reinterpret_cast and static_cast expressions in
- macros to keep code portable to old compilers (since most compilers still
- lack RTTI support, dynamic_cast is not included here).
-*/
+/** Wrap C++ const_cast, reinterpret_cast and static_cast expressions in
+ macros to keep code portable to old compilers (since most compilers still
+ lack RTTI support, dynamic_cast is not included here).
+ */
#ifdef __cplusplus
-#if defined SAL_W32 || defined SOLARIS || defined LINUX || defined MACOSX || defined FREEBSD || defined NETBSD || defined IRIX
+#if defined SAL_W32 || defined SOLARIS || defined LINUX || defined MACOSX || defined FREEBSD || defined NETBSD
#define SAL_CONST_CAST(type, expr) (const_cast< type >(expr))
#define SAL_REINTERPRET_CAST(type, expr) (reinterpret_cast< type >(expr))
#define SAL_STATIC_CAST(type, expr) (static_cast< type >(expr))
@@ -195,15 +188,15 @@ typedef struct _sal_Sequence
#endif /* SAL_W32, SOLARIS, LINUX */
#endif /* __cplusplus */
-/* Definition of function throw clause macros. These have been introduced
- to reduce code size by balancing out compiler bugs.
+/** Definition of function throw clause macros. These have been introduced
+ to reduce code size by balancing out compiler bugs.
- These macros are ONLY for function declarations,
- use common C++ throw statement for throwing exceptions, e.g.
- throw RuntimeException();
+ These macros are ONLY for function declarations,
+ use common C++ throw statement for throwing exceptions, e.g.
+ throw RuntimeException();
- SAL_THROW() should be used for all C++ functions, e.g. SAL_THROW( () )
- SAL_THROW_EXTERN_C() should be used for all C functions
+ SAL_THROW() should be used for all C++ functions, e.g. SAL_THROW( () )
+ SAL_THROW_EXTERN_C() should be used for all C functions
*/
#ifdef __cplusplus
#if defined(__GNUC__) || defined(__SUNPRO_CC) || defined(__sgi)
@@ -218,9 +211,8 @@ typedef struct _sal_Sequence
#endif
+
#ifdef __cplusplus
-/** definition of a no acquire enum for ctors
-*/
enum __sal_NoAcquire
{
/** definition of a no acquire enum for ctors
diff --git a/sal/inc/systools/win32/uwinapi.h b/sal/inc/systools/win32/uwinapi.h
index 6788dc7e94c0..6abaf0468c50 100644
--- a/sal/inc/systools/win32/uwinapi.h
+++ b/sal/inc/systools/win32/uwinapi.h
@@ -2,9 +2,9 @@
*
* $RCSfile: uwinapi.h,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: hro $ $Date: 2002-08-26 13:45:01 $
+ * last change: $Author: hr $ $Date: 2003-03-26 16:45:59 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -121,6 +121,8 @@ EXTERN_C WINBASEAPI DWORD WINAPI GetUserDomainW( LPWSTR lpBuffer, DWORD nBuffser
#define GetUserDomain GetUserDomainA
#endif
+EXTERN_C WINBASEAPI DWORD WINAPI GetProcessId( HANDLE hProcess );
+
/* macro that calculates the count of elements of a static array */
#define elementsof(buf) (sizeof(buf) / sizeof((buf)[0]))