diff options
author | Juergen Schmidt <jsc@openoffice.org> | 2001-03-14 08:37:08 +0000 |
---|---|---|
committer | Juergen Schmidt <jsc@openoffice.org> | 2001-03-14 08:37:08 +0000 |
commit | f4f9916b9b4dfaf63fca105f6481c129813d21f1 (patch) | |
tree | 7b9a3a11dea6f497cf97c709009adf1f1f8c38bc /registry/source | |
parent | 9d73b17cac0df14084a659379eaae7e5ca6be222 (diff) |
remove vos dependencies
Diffstat (limited to 'registry/source')
-rw-r--r-- | registry/source/reflcnst.hxx | 78 | ||||
-rw-r--r-- | registry/source/reflread.cxx | 81 | ||||
-rw-r--r-- | registry/source/reflwrit.cxx | 41 | ||||
-rw-r--r-- | registry/source/regimpl.cxx | 182 | ||||
-rw-r--r-- | registry/source/registry.cxx | 36 | ||||
-rw-r--r-- | registry/source/regmap.hxx | 28 |
6 files changed, 263 insertions, 183 deletions
diff --git a/registry/source/reflcnst.hxx b/registry/source/reflcnst.hxx index 745525609..3d5f9e32f 100644 --- a/registry/source/reflcnst.hxx +++ b/registry/source/reflcnst.hxx @@ -2,9 +2,9 @@ * * $RCSfile: reflcnst.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: jsc $ $Date: 2000-10-12 08:11:51 $ + * last change: $Author: jsc $ $Date: 2001-03-14 09:36:00 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -59,15 +59,17 @@ * ************************************************************************/ -#ifndef __REFLCNST_HXX__ -#define __REFLCNST_HXX__ +#ifndef _REFLCNST_HXX_ +#define _REFLCNST_HXX_ -#ifndef __REGISTRY_REFLTYPE_HXX__ -#include <registry/refltype.hxx> +#ifndef _REGISTRY_REFLTYPE_HXX_ +#include <registry/refltype.hxx> +#endif +#ifndef _SAL_MACROS_H_ +#include <sal/macros.h> #endif #include <string.h> -#include <vos/macros.hxx> #define REGTYPE_IEEE_NATIVE 1 @@ -235,6 +237,66 @@ inline sal_uInt32 readUINT32(const sal_uInt8* buffer, sal_uInt32& v) return sizeof(sal_uInt32); } +inline sal_uInt32 writeINT64(sal_uInt8* buffer, sal_Int64 v) +{ + buffer[0] = (sal_uInt8)((v >> 56) & 0xFF); + buffer[1] = (sal_uInt8)((v >> 48) & 0xFF); + buffer[2] = (sal_uInt8)((v >> 40) & 0xFF); + buffer[3] = (sal_uInt8)((v >> 32) & 0xFF); + buffer[4] = (sal_uInt8)((v >> 24) & 0xFF); + buffer[5] = (sal_uInt8)((v >> 16) & 0xFF); + buffer[6] = (sal_uInt8)((v >> 8) & 0xFF); + buffer[7] = (sal_uInt8)((v >> 0) & 0xFF); + + return sizeof(sal_Int64); +} + +inline sal_uInt32 readINT64(const sal_uInt8* buffer, sal_Int64& v) +{ + v = ( + ((sal_Int64)buffer[0] << 56) | + ((sal_Int64)buffer[1] << 48) | + ((sal_Int64)buffer[2] << 40) | + ((sal_Int64)buffer[3] << 32) | + ((sal_Int64)buffer[4] << 24) | + ((sal_Int64)buffer[5] << 16) | + ((sal_Int64)buffer[6] << 8) | + ((sal_Int64)buffer[7] << 0) + ); + + return sizeof(sal_Int64); +} + +inline sal_uInt32 writeUINT64(sal_uInt8* buffer, sal_uInt64 v) +{ + buffer[0] = (sal_uInt8)((v >> 56) & 0xFF); + buffer[1] = (sal_uInt8)((v >> 48) & 0xFF); + buffer[2] = (sal_uInt8)((v >> 40) & 0xFF); + buffer[3] = (sal_uInt8)((v >> 32) & 0xFF); + buffer[4] = (sal_uInt8)((v >> 24) & 0xFF); + buffer[5] = (sal_uInt8)((v >> 16) & 0xFF); + buffer[6] = (sal_uInt8)((v >> 8) & 0xFF); + buffer[7] = (sal_uInt8)((v >> 0) & 0xFF); + + return sizeof(sal_uInt64); +} + +inline sal_uInt32 readUINT64(const sal_uInt8* buffer, sal_uInt64& v) +{ + v = ( + ((sal_uInt64)buffer[0] << 56) | + ((sal_uInt64)buffer[1] << 48) | + ((sal_uInt64)buffer[2] << 40) | + ((sal_uInt64)buffer[3] << 32) | + ((sal_uInt64)buffer[4] << 24) | + ((sal_uInt64)buffer[5] << 16) | + ((sal_uInt64)buffer[6] << 8) | + ((sal_uInt64)buffer[7] << 0) + ); + + return sizeof(sal_uInt64); +} + inline sal_uInt32 writeUtf8(sal_uInt8* buffer, const sal_Char* v) { sal_uInt32 size = strlen(v) + 1; @@ -246,7 +308,7 @@ inline sal_uInt32 writeUtf8(sal_uInt8* buffer, const sal_Char* v) inline sal_uInt32 readUtf8(const sal_uInt8* buffer, sal_Char* v, sal_uInt32 maxSize) { - sal_uInt32 size = VOS_MIN(strlen((const sal_Char*) buffer) + 1, maxSize); + sal_uInt32 size = SAL_MIN(strlen((const sal_Char*) buffer) + 1, maxSize); memcpy(v, buffer, size); diff --git a/registry/source/reflread.cxx b/registry/source/reflread.cxx index da98dc868..a7fdee354 100644 --- a/registry/source/reflread.cxx +++ b/registry/source/reflread.cxx @@ -2,9 +2,9 @@ * * $RCSfile: reflread.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: svesik $ $Date: 2001-02-02 13:43:58 $ + * last change: $Author: jsc $ $Date: 2001-03-14 09:36:00 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -62,12 +62,19 @@ #ifndef MAC #include <memory.h> #endif -#include <osl/types.h> - +#ifndef _SAL_TYPES_H_ +#include <sal/types.h> +#endif +#ifndef _OSL_ENDIAN_H_ +#include <osl/endian.h> +#endif +#ifndef _REGISTRY_REFLREAD_HXX_ #include <registry/reflread.hxx> +#endif + #include "reflcnst.hxx" -using namespace vos; +using namespace salhelper; static CPInfoTag aTag; @@ -134,6 +141,34 @@ public: (m_pBuffer[index+3] << 0) ); } + + inline sal_Int64 readINT64(sal_uInt32 index) const + { + return ( + ((sal_Int64)m_pBuffer[index] << 56) | + ((sal_Int64)m_pBuffer[index+1] << 48) | + ((sal_Int64)m_pBuffer[index+2] << 40) | + ((sal_Int64)m_pBuffer[index+3] << 32) | + ((sal_Int64)m_pBuffer[index+4] << 24) | + ((sal_Int64)m_pBuffer[index+5] << 16) | + ((sal_Int64)m_pBuffer[index+6] << 8) | + ((sal_Int64)m_pBuffer[index+7] << 0) + ); + } + + inline sal_uInt64 readUINT64(sal_uInt32 index) const + { + return ( + ((sal_uInt64)m_pBuffer[index] << 56) | + ((sal_uInt64)m_pBuffer[index+1] << 48) | + ((sal_uInt64)m_pBuffer[index+2] << 40) | + ((sal_uInt64)m_pBuffer[index+3] << 32) | + ((sal_uInt64)m_pBuffer[index+4] << 24) | + ((sal_uInt64)m_pBuffer[index+5] << 16) | + ((sal_uInt64)m_pBuffer[index+6] << 8) | + ((sal_uInt64)m_pBuffer[index+7] << 0) + ); + } }; BlopObject::BlopObject(const sal_uInt8* buffer, sal_uInt32 len, sal_Bool copyBuffer) @@ -270,6 +305,8 @@ public: sal_uInt16 readUINT16Constant(sal_uInt16 index); sal_Int32 readINT32Constant(sal_uInt16 index); sal_uInt32 readUINT32Constant(sal_uInt16 index); + sal_Int64 readINT64Constant(sal_uInt16 index); + sal_uInt64 readUINT64Constant(sal_uInt16 index); float readFloatConstant(sal_uInt16 index); double readDoubleConstant(sal_uInt16 index); const sal_Unicode* readStringConstant(sal_uInt16 index); @@ -449,6 +486,36 @@ sal_uInt32 ConstantPool::readUINT32Constant(sal_uInt16 index) return aUINT32; } +sal_Int64 ConstantPool::readINT64Constant(sal_uInt16 index) +{ + sal_Int64 aINT64 = sal_False; + + if (m_pIndex && (index> 0) && (index <= m_numOfEntries)) + { + if (readUINT16(m_pIndex[index - 1] + CP_OFFSET_ENTRY_TAG) == CP_TAG_CONST_INT64) + { + aINT64 = readINT64(m_pIndex[index - 1] + CP_OFFSET_ENTRY_DATA); + } + } + + return aINT64; +} + +sal_uInt64 ConstantPool::readUINT64Constant(sal_uInt16 index) +{ + sal_uInt64 aUINT64 = sal_False; + + if (m_pIndex && (index> 0) && (index <= m_numOfEntries)) + { + if (readUINT16(m_pIndex[index - 1] + CP_OFFSET_ENTRY_TAG) == CP_TAG_CONST_UINT64) + { + aUINT64 = readUINT64(m_pIndex[index - 1] + CP_OFFSET_ENTRY_DATA); + } + } + + return aUINT64; +} + float ConstantPool::readFloatConstant(sal_uInt16 index) { union @@ -668,11 +735,11 @@ RTValueType FieldList::getFieldConstValue(sal_uInt16 index, RTConstValueUnion* v ret = RT_TYPE_UINT32; break; case CP_TAG_CONST_INT64: -// value->aHyper = m_pCP->readINT64Constant(cpIndex); + value->aHyper = m_pCP->readINT64Constant(cpIndex); ret = RT_TYPE_INT64; break; case CP_TAG_CONST_UINT64: -// value->aUHyper = m_pCP->readUINT64Constant(cpIndex); + value->aUHyper = m_pCP->readUINT64Constant(cpIndex); ret = RT_TYPE_UINT64; break; case CP_TAG_CONST_FLOAT: diff --git a/registry/source/reflwrit.cxx b/registry/source/reflwrit.cxx index f5becb0db..a88781611 100644 --- a/registry/source/reflwrit.cxx +++ b/registry/source/reflwrit.cxx @@ -2,9 +2,9 @@ * * $RCSfile: reflwrit.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: svesik $ $Date: 2001-02-02 13:41:34 $ + * last change: $Author: jsc $ $Date: 2001-03-14 09:36:00 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -58,15 +58,26 @@ * * ************************************************************************/ -#include <osl/types.h> - +#ifndef _SAL_TYPES_H_ +#include <sal/types.h> +#endif +#ifndef _SAL_MACROS_H_ +#include <sal/macros.h> +#endif +#ifndef _OSL_ENDIAN_H_ +#include <osl/endian.h> +#endif +#ifndef _RTL_ALLOC_H_ #include <rtl/alloc.h> +#endif +#ifndef _REGISTRY_REFLWRIT_HXX_ #include <registry/reflwrit.hxx> +#endif #include "reflcnst.hxx" using namespace rtl; -using namespace vos; +using namespace salhelper; #ifdef MAC #define strdup(str) strcpy((sal_Char*)malloc(strlen(str)+1),str) @@ -87,11 +98,9 @@ ORealDynamicLoader* ODynamicLoader<RegistryTypeWriter_Api>::m_pLoader = NULL; #define BLOP_OFFSET_TYPE_SOURCE (BLOP_OFFSET_N_ENTRIES + sizeof(sal_uInt16)) #define BLOP_OFFSET_TYPE_CLASS (BLOP_OFFSET_TYPE_SOURCE + sizeof(sal_uInt16)) #define BLOP_OFFSET_THIS (BLOP_OFFSET_TYPE_CLASS + sizeof(sal_uInt16)) -//#define BLOP_OFFSET_SUPER (BLOP_OFFSET_THIS + sizeof(sal_uInt16)) #define BLOP_OFFSET_UIK (BLOP_OFFSET_THIS + sizeof(sal_uInt16)) #define BLOP_OFFSET_DOKU (BLOP_OFFSET_UIK + sizeof(sal_uInt16)) #define BLOP_OFFSET_FILENAME (BLOP_OFFSET_DOKU + sizeof(sal_uInt16)) -//#define BLOP_HEADER_SIZE (BLOP_OFFSET_FILENAME + sizeof(sal_uInt16)) #define BLOP_HEADER_N_ENTRIES 6 #define BLOP_OFFSET_N_SUPERTYPES 0 @@ -103,7 +112,6 @@ ORealDynamicLoader* ODynamicLoader<RegistryTypeWriter_Api>::m_pLoader = NULL; #define BLOP_FIELD_ENTRY_VALUE (BLOP_FIELD_ENTRY_TYPE + sizeof(sal_uInt16)) #define BLOP_FIELD_ENTRY_DOKU (BLOP_FIELD_ENTRY_VALUE + sizeof(sal_uInt16)) #define BLOP_FIELD_ENTRY_FILENAME (BLOP_FIELD_ENTRY_DOKU + sizeof(sal_uInt16)) -//#define BLOP_FIELD_ENTRY_SIZE (BLOP_FIELD_ENTRY_FILENAME + sizeof(sal_uInt16)) #define BLOP_FIELD_N_ENTRIES 6 #define BLOP_METHOD_SIZE 0 @@ -111,20 +119,17 @@ ORealDynamicLoader* ODynamicLoader<RegistryTypeWriter_Api>::m_pLoader = NULL; #define BLOP_METHOD_NAME (BLOP_METHOD_MODE + sizeof(sal_uInt16)) #define BLOP_METHOD_RETURN (BLOP_METHOD_NAME + sizeof(sal_uInt16)) #define BLOP_METHOD_DOKU (BLOP_METHOD_RETURN + sizeof(sal_uInt16)) -//#define BLOP_METHOD_HEADER_SIZE (BLOP_METHOD_DOKU + sizeof(sal_uInt16)) #define BLOP_METHOD_N_ENTRIES 5 #define BLOP_PARAM_TYPE 0 #define BLOP_PARAM_MODE (BLOP_PARAM_TYPE + sizeof(sal_uInt16)) #define BLOP_PARAM_NAME (BLOP_PARAM_MODE + sizeof(sal_uInt16)) -//#define BLOP_PARAM_ENTRY_SIZE (BLOP_PARAM_NAME + sizeof(sal_uInt16)) #define BLOP_PARAM_N_ENTRIES 3 #define BLOP_REFERENCE_TYPE 0 #define BLOP_REFERENCE_NAME (BLOP_REFERENCE_TYPE + sizeof(sal_uInt16)) #define BLOP_REFERENCE_DOKU (BLOP_REFERENCE_NAME + sizeof(sal_uInt16)) #define BLOP_REFERENCE_ACCESS (BLOP_REFERENCE_DOKU + sizeof(sal_uInt16)) -//#define BLOP_REFERENCE_ENTRY_SIZE (BLOP_REFERENCE_ACCESS + sizeof(sal_uInt16)) #define BLOP_REFERENCE_N_ENTRIES 4 sal_uInt32 UINT16StringLen(const sal_uInt8* wstring) @@ -154,7 +159,7 @@ sal_uInt32 writeString(sal_uInt8* buffer, const sal_Unicode* v) sal_uInt32 readString(const sal_uInt8* buffer, sal_Unicode* v, sal_uInt32 maxSize) { - sal_uInt32 len = VOS_MIN(UINT16StringLen(buffer) + 1, maxSize / 2); + sal_uInt32 len = SAL_MIN(UINT16StringLen(buffer) + 1, maxSize / 2); sal_uInt32 i; sal_uInt8* buff = (sal_uInt8*)buffer; @@ -338,10 +343,10 @@ sal_uInt32 CPInfo::getBlopSize() size += sizeof(sal_uInt32); break; case CP_TAG_CONST_INT64: -// size += sizeof(sal_Int64); + size += sizeof(sal_Int64); break; case CP_TAG_CONST_UINT64: -// size += sizeof(sal_uInt64); + size += sizeof(sal_uInt64); break; case CP_TAG_CONST_FLOAT: size += sizeof(sal_uInt32); @@ -394,10 +399,10 @@ sal_uInt32 CPInfo::toBlop(sal_uInt8* buffer, sal_uInt32 maxLen) buff += writeUINT32(buff, m_value.aConst.aULong); break; case CP_TAG_CONST_INT64: -// buff += writeUINT64(buff, m_value.aConst.aHyper); + buff += writeUINT64(buff, m_value.aConst.aHyper); break; case CP_TAG_CONST_UINT64: -// buff += writeUINT64(buff, m_value.aConst.aUHyper); + buff += writeUINT64(buff, m_value.aConst.aUHyper); break; case CP_TAG_CONST_FLOAT: buff += writeFloat(buff, m_value.aConst.aFloat); @@ -696,7 +701,7 @@ void MethodEntry::reallocParams(sal_uInt16 size) { sal_uInt16 i; - for (i = 0; i < VOS_MIN(size, m_paramCount); i++) + for (i = 0; i < SAL_MIN(size, m_paramCount); i++) { newParams[i].setData(m_params[i].m_typeName, m_params[i].m_name, m_params[i].m_mode); } @@ -719,7 +724,7 @@ void MethodEntry::reallocExcs(sal_uInt16 size) sal_uInt16 i; - for (i = 0; i < VOS_MIN(size, m_excCount); i++) + for (i = 0; i < SAL_MIN(size, m_excCount); i++) { newExcNames[i] = m_excNames[i]; } diff --git a/registry/source/regimpl.cxx b/registry/source/regimpl.cxx index 53931c934..6de80a4b2 100644 --- a/registry/source/regimpl.cxx +++ b/registry/source/regimpl.cxx @@ -2,9 +2,9 @@ * * $RCSfile: regimpl.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: svesik $ $Date: 2001-02-02 13:56:38 $ + * last change: $Author: jsc $ $Date: 2001-03-14 09:36:00 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -162,13 +162,22 @@ static sal_Bool dumpType(RegistryTypeReader& reader, const OString& sIndent) case RT_TYPE_CONSTANTS: fprintf(stdout, "type: 'constants'\n"); break; + case RT_TYPE_UNION: + fprintf(stdout, "type: 'union'\n"); + break; default: fprintf(stdout, "type: <unknown>\n"); break; } fprintf(stdout, "%sname: '%s'\n", indent, OUStringToOString(reader.getTypeName(), RTL_TEXTENCODING_UTF8).getStr()); - fprintf(stdout, "%ssuper name: '%s'\n", indent, OUStringToOString(reader.getSuperTypeName(), RTL_TEXTENCODING_UTF8).getStr()); + if (reader.getTypeClass() == RT_TYPE_UNION ) + { + fprintf(stdout, "%sdiscriminant type: '%s'\n", indent, OUStringToOString(reader.getSuperTypeName(), RTL_TEXTENCODING_UTF8).getStr()); + } else + { + fprintf(stdout, "%ssuper name: '%s'\n", indent, OUStringToOString(reader.getSuperTypeName(), RTL_TEXTENCODING_UTF8).getStr()); + } fprintf(stdout, "%sDoku: \"%s\"\n", indent, OUStringToOString(reader.getDoku(), RTL_TEXTENCODING_UTF8).getStr()); fprintf(stdout, "%sIDL source file: \"%s\"\n", indent, OUStringToOString(reader.getFileName(), RTL_TEXTENCODING_UTF8).getStr()); fprintf(stdout, "%snumber of fields: %d\n", indent, reader.getFieldCount()); @@ -184,49 +193,6 @@ static sal_Bool dumpType(RegistryTypeReader& reader, const OString& sIndent) { fprintf(stdout, "%s access=INVALID\n", indent); } - if ( (fieldAccess & RT_ACCESS_CONST) == RT_ACCESS_CONST ) - { - fprintf(stdout, "%s access=CONST\n", indent); - RTConstValue constVal = reader.getFieldConstValue(i); - - fprintf(stdout, "%s value = ", indent); - - switch (constVal.m_type) - { - case RT_TYPE_BOOL: - if (constVal.m_value.aBool) - fprintf(stdout, "TRUE"); - else - fprintf(stdout, "FALSE"); - break; - case RT_TYPE_BYTE: - fprintf(stdout, "%d", (int)constVal.m_value.aByte); - break; - case RT_TYPE_INT16: - fprintf(stdout, "%d", constVal.m_value.aShort); - break; - case RT_TYPE_UINT16: - fprintf(stdout, "%u", constVal.m_value.aUShort); - break; - case RT_TYPE_INT32: - fprintf(stdout, "%d", constVal.m_value.aLong); - break; - case RT_TYPE_UINT32: - fprintf(stdout, "%u", constVal.m_value.aULong); - break; - case RT_TYPE_FLOAT: - fprintf(stdout, "%f", constVal.m_value.aFloat); - break; - case RT_TYPE_DOUBLE: - fprintf(stdout, "%f", constVal.m_value.aDouble); - break; - case RT_TYPE_STRING: - fprintf(stdout, "%s", OUStringToOString(constVal.m_value.aString, RTL_TEXTENCODING_UTF8).getStr()); - break; - default: - break; - } - } if ( (fieldAccess & RT_ACCESS_READONLY) == RT_ACCESS_READONLY ) { fprintf(stdout, "%s access=READONLY\n", indent); @@ -267,80 +233,64 @@ static sal_Bool dumpType(RegistryTypeReader& reader, const OString& sIndent) { fprintf(stdout, "%s access=REMOVEABLE\n", indent); } - -/* - switch (reader.getFieldAccess(i)) + if ( (fieldAccess & RT_ACCESS_DEFAULT) == RT_ACCESS_DEFAULT ) { - case RT_ACCESS_INVALID: - fprintf(stdout, "%s access=INVALID\n", indent); - break; - case RT_ACCESS_CONST: - { - fprintf(stdout, "%s access=CONST\n", indent); - RTConstValue constVal = reader.getFieldConstValue(i); + fprintf(stdout, "%s access=DEFAULT\n", indent); + } + if ( (fieldAccess & RT_ACCESS_CONST) == RT_ACCESS_CONST ) + { + fprintf(stdout, "%s access=CONST\n", indent); + } - fprintf(stdout, "%s value = ", indent); + RTConstValue constVal = reader.getFieldConstValue(i); - switch (constVal.m_type) - { - case RT_TYPE_BOOL: - if (constVal.m_value.aBool) - fprintf(stdout, "TRUE"); - else - fprintf(stdout, "FALSE"); - break; - case RT_TYPE_BYTE: - fprintf(stdout, "%d", (int)constVal.m_value.aByte); - break; - case RT_TYPE_INT16: - fprintf(stdout, "%d", constVal.m_value.aShort); - break; - case RT_TYPE_UINT16: - fprintf(stdout, "%u", constVal.m_value.aUShort); - break; - case RT_TYPE_INT32: - fprintf(stdout, "%d", constVal.m_value.aLong); - break; - case RT_TYPE_UINT32: - fprintf(stdout, "%u", constVal.m_value.aULong); - break; - case RT_TYPE_FLOAT: - fprintf(stdout, "%f", constVal.m_value.aFloat); - break; - case RT_TYPE_DOUBLE: - fprintf(stdout, "%f", constVal.m_value.aDouble); - break; - case RT_TYPE_STRING: - fprintf(stdout, "%s", OUStringToOString(constVal.m_value.aString, RTL_TEXTENCODING_UTF8).getStr()); - break; - default: - break; - } - } - break; - case RT_ACCESS_READONLY: - fprintf(stdout, "%s access=READONLY ", indent); - break; - case RT_ACCESS_WRITEONLY: - fprintf(stdout, "%s access=WRITEONLY ", indent); - break; - case RT_ACCESS_READWRITE: - fprintf(stdout, "%s access=READWRITE ", indent); - break; - case RT_ACCESS_READONLY_OPTIONAL: - fprintf(stdout, "%s access=READONLY, OPTIONAL ", indent); - break; - case RT_ACCESS_WRITEONLY_OPTIONAL: - fprintf(stdout, "%s access=WRITEONLY, OPTIONAL ", indent); - break; - case RT_ACCESS_READWRITE_OPTIONAL: - fprintf(stdout, "%s access=READWRITE, OPTIONAL ", indent); - break; - default: - fprintf(stdout, "%s access=<unknown> ", indent); - break; + if ( constVal.m_type != RT_TYPE_NONE ) + { + fprintf(stdout, "%s value = ", indent); + + switch (constVal.m_type) + { + case RT_TYPE_BOOL: + if (constVal.m_value.aBool) + fprintf(stdout, "TRUE"); + else + fprintf(stdout, "FALSE"); + break; + case RT_TYPE_BYTE: + fprintf(stdout, "%d", (int)constVal.m_value.aByte); + break; + case RT_TYPE_INT16: + fprintf(stdout, "%d", constVal.m_value.aShort); + break; + case RT_TYPE_UINT16: + fprintf(stdout, "%u", constVal.m_value.aUShort); + break; + case RT_TYPE_INT32: + fprintf(stdout, "%d", constVal.m_value.aLong); + break; + case RT_TYPE_UINT32: + fprintf(stdout, "%u", constVal.m_value.aULong); + break; + case RT_TYPE_INT64: + fprintf(stdout, "%d", constVal.m_value.aHyper); + break; + case RT_TYPE_UINT64: + fprintf(stdout, "%u", constVal.m_value.aUHyper); + break; + case RT_TYPE_FLOAT: + fprintf(stdout, "%f", constVal.m_value.aFloat); + break; + case RT_TYPE_DOUBLE: + fprintf(stdout, "%f", constVal.m_value.aDouble); + break; + case RT_TYPE_STRING: + fprintf(stdout, "%s", OUStringToOString(constVal.m_value.aString, RTL_TEXTENCODING_UTF8).getStr()); + break; + default: + break; + } } -*/ + fprintf(stdout, "\n%s Doku: \"%s\"", indent, OUStringToOString(reader.getFieldDoku(i), RTL_TEXTENCODING_UTF8).getStr()); fprintf(stdout, "\n%s IDL source file: \"%s\"\n", indent, OUStringToOString(reader.getFieldFileName(i), RTL_TEXTENCODING_UTF8).getStr()); } diff --git a/registry/source/registry.cxx b/registry/source/registry.cxx index c3b438722..37ae7a7d3 100644 --- a/registry/source/registry.cxx +++ b/registry/source/registry.cxx @@ -2,9 +2,9 @@ * * $RCSfile: registry.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: svesik $ $Date: 2001-02-02 13:59:38 $ + * last change: $Author: jsc $ $Date: 2001-03-14 09:36:00 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -59,22 +59,23 @@ * ************************************************************************/ -#include <registry/registry.h> - +#ifndef _REGISTRY_REGISTRY_H_ +#include <registry/registry.h> +#endif #ifndef _REGISTRY_REGISTRY_HXX_ -#include <registry/registry.hxx> +#include <registry/registry.hxx> +#endif +#ifndef _OSL_PROCESS_H_ +#include <osl/process.h> #endif #ifndef _REGIMPL_HXX_ -#include "regimpl.hxx" +#include "regimpl.hxx" #endif - #ifndef _REGKEY_HXX_ -#include "keyimpl.hxx" +#include "keyimpl.hxx" #endif -#include <vos/process.hxx> - #if defined(WIN32) || defined(WNT) || defined(__OS2__) #include <io.h> #endif @@ -84,7 +85,7 @@ #include <unistd.h> #endif -using namespace vos; +using namespace salhelper; #if defined ( GCC ) && ( defined ( SCO ) ) ORealDynamicLoader* ODynamicLoader<Registry_Api>::m_pLoader = NULL; @@ -92,19 +93,18 @@ ORealDynamicLoader* ODynamicLoader<Registry_Api>::m_pLoader = NULL; OString getTempName() { + static OUString TMP(RTL_CONSTASCII_USTRINGPARAM("TMP")); + static OUString TEMP(RTL_CONSTASCII_USTRINGPARAM("TEMP")); + OUString uTmpPattern; sal_Char tmpPattern[512] = ""; sal_Char *pTmpName = NULL; - OStartupInfo StartupInfo; - - if (StartupInfo.getEnvironment(OUString( RTL_CONSTASCII_USTRINGPARAM("TMP") ), - uTmpPattern) != OStartupInfo::E_None) + if ( osl_getEnvironment(TMP.pData, &uTmpPattern.pData) != osl_Process_E_None ) { - if (StartupInfo.getEnvironment( OUString( RTL_CONSTASCII_USTRINGPARAM("TEMP") ), - uTmpPattern) != NAMESPACE_VOS(OStartupInfo)::E_None) + if ( osl_getEnvironment(TEMP.pData, &uTmpPattern.pData) != osl_Process_E_None ) { -#if defined(WIN32) || defined(WNT) || defined(OS2) +#if defined(SAL_W32) || defined(SAL_OS2) strcpy(tmpPattern, "."); #else strcpy(tmpPattern, "/tmp"); diff --git a/registry/source/regmap.hxx b/registry/source/regmap.hxx index 5832a8f3f..d47fef3b8 100644 --- a/registry/source/regmap.hxx +++ b/registry/source/regmap.hxx @@ -2,9 +2,9 @@ * * $RCSfile: regmap.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: jsc $ $Date: 2001-01-10 10:15:54 $ + * last change: $Author: jsc $ $Date: 2001-03-14 09:36:00 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -63,21 +63,17 @@ #define _REGMAP_HXX_ #if STLPORT_VERSION<321 -#include <hash_map.h> -#include <list.h> -#include <set.h> +#include <hash_map.h> +#include <list.h> +#include <set.h> #else -#include <hash_map> -#include <list> -#include <set> -#endif - -#ifndef _VOS_MACROS_HXX_ -#include <vos/macros.hxx> +#include <hash_map> +#include <list> +#include <set> #endif #ifndef _RTL_USTRING_HXX_ -#include <rtl/ustring.hxx> +#include <rtl/ustring.hxx> #endif using namespace rtl; @@ -108,10 +104,10 @@ struct LessString } }; -typedef NAMESPACE_STD(hash_map) <OUString, ORegKey*, HashString, EqualString> KeyMap; +typedef ::std::hash_map< OUString, ORegKey*, HashString, EqualString > KeyMap; -typedef NAMESPACE_STD(list) <ORegKey*> LinkList; +typedef ::std::list< ORegKey* > LinkList; -typedef NAMESPACE_STD(set) <OUString, LessString> StringSet; +typedef ::std::set< OUString, LessString > StringSet; #endif |