1 thilo.boehm 1.1 //%LICENSE////////////////////////////////////////////////////////////////
2 //
3 // Licensed to The Open Group (TOG) under one or more contributor license
4 // agreements. Refer to the OpenPegasusNOTICE.txt file distributed with
5 // this work for additional information regarding copyright ownership.
6 // Each contributor licenses this file to you under the OpenPegasus Open
7 // Source License; you may not use this file except in compliance with the
8 // License.
9 //
10 // Permission is hereby granted, free of charge, to any person obtaining a
11 // copy of this software and associated documentation files (the "Software"),
12 // to deal in the Software without restriction, including without limitation
13 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 // and/or sell copies of the Software, and to permit persons to whom the
15 // Software is furnished to do so, subject to the following conditions:
16 //
17 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
19 //
20 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 thilo.boehm 1.1 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23 // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24 // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25 // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26 // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 //
28 //////////////////////////////////////////////////////////////////////////
29 //
30 //%/////////////////////////////////////////////////////////////////////////////
31
32 #ifndef _SCMO_H_
33 #define _SCMO_H_
34
35
36 #include <Pegasus/Common/Config.h>
|
37 thilo.boehm 1.3 #include <Pegasus/Common/Linkage.h>
38 #include <Pegasus/Common/CIMDateTimeRep.h>
39 #include <Pegasus/Common/CIMType.h>
|
40 thilo.boehm 1.1 #include <Pegasus/Common/AtomicInt.h>
41 #include <Pegasus/Common/CIMQualifierList.h>
|
42 thilo.boehm 1.3 #include <Pegasus/Common/CIMObjectPath.h>
43 #include <Pegasus/Common/System.h>
|
44 thilo.boehm 1.1
45 PEGASUS_NAMESPACE_BEGIN
46
47 // Constants defining the size of the hash table used in the PropertySet
|
48 ashok.pathak 1.10 // implementation.if size need to be changed, ensure size is power of two
49 // to simplify moudulus calculation .
|
50 thilo.boehm 1.1
51 #define PEGASUS_PROPERTY_SCMB_HASHSIZE 64
52 #define PEGASUS_KEYBINDIG_SCMB_HASHSIZE 32
53
54 class SCMOClass;
|
55 thilo.boehm 1.3 class SCMOInstance;
|
56 thilo.boehm 1.1
57 // The enum of return values for SCMO functions.
58 enum SCMO_RC
59 {
60 SCMO_OK = 0,
61 SCMO_NULL_VALUE,
62 SCMO_NOT_FOUND,
63 SCMO_INDEX_OUT_OF_BOUND,
64 SCMO_NOT_SAME_ORIGIN,
65 SCMO_INVALID_PARAMETER,
|
66 thilo.boehm 1.3 SCMO_TYPE_MISSMATCH,
67 SCMO_WRONG_TYPE,
68 SCMO_NOT_AN_ARRAY,
69 SCMO_IS_AN_ARRAY
|
70 thilo.boehm 1.1 };
71
|
72 thilo.boehm 1.2 // This the definition of a relative pointer for objects stored in
73 // the single chunk memory. The memory is handled as array of chars.
|
74 thilo.boehm 1.1 struct SCMBDataPtr
75 {
76 // start index of the data area
77 Uint64 start;
|
78 marek 1.7 union
79 {
80 Uint64 __align64;
81 // size of data area
82 Uint32 size;
83 };
|
84 thilo.boehm 1.1 };
85
86 //
|
87 thilo.boehm 1.2 // This enumeration and string array defines the qualifier names
88 // defined by the DMTF (standardized and optional ).
89 //
90 // The value QUALNAME_USERDEFINED indicates that the qualifier is
|
91 thilo.boehm 1.1 // user defined and the qualifier name must be specified.
92 //
93 enum QualifierNameEnum
94 {
|
95 thilo.boehm 1.2 QUALNAME_USERDEFINED=0,
|
96 thilo.boehm 1.1 QUALNAME_ABSTRACT,
97 QUALNAME_AGGREGATE,
98 QUALNAME_AGGREGATION,
|
99 thilo.boehm 1.2 QUALNAME_ALIAS,
|
100 thilo.boehm 1.1 QUALNAME_ARRAYTYPE,
|
101 thilo.boehm 1.3 QUALNAME_ASSOCIATION,
|
102 thilo.boehm 1.2 QUALNAME_BITMAP,
103 QUALNAME_BITVALUES,
104 QUALNAME_CLASSCONSTRAINT,
105 QUALNAME_COMPOSITION,
106 QUALNAME_CORRELATABLE,
|
107 thilo.boehm 1.1 QUALNAME_COUNTER,
108 QUALNAME_DELETE,
|
109 thilo.boehm 1.2 QUALNAME_DEPRECATED,
110 QUALNAME_DESCRIPTION,
111 QUALNAME_DISPLAYDESCRIPTION,
112 QUALNAME_DISPLAYNAME,
113 QUALNAME_DN,
|
114 thilo.boehm 1.1 QUALNAME_EMBEDDEDINSTANCE,
|
115 thilo.boehm 1.2 QUALNAME_EMBEDDEDOBJECT,
116 QUALNAME_EXCEPTION,
117 QUALNAME_EXPENSIVE,
118 QUALNAME_EXPERIMENTAL,
119 QUALNAME_GAUGE,
120 QUALNAME_IFDELETE,
121 QUALNAME_IN,
|
122 thilo.boehm 1.3 QUALNAME_INDICATION,
|
123 thilo.boehm 1.2 QUALNAME_INVISIBLE,
|
124 thilo.boehm 1.1 QUALNAME_ISPUNIT,
|
125 thilo.boehm 1.2 QUALNAME_KEY,
|
126 thilo.boehm 1.1 QUALNAME_LARGE,
|
127 thilo.boehm 1.2 QUALNAME_MAPPINGSTRINGS,
128 QUALNAME_MAX,
129 QUALNAME_MAXLEN,
130 QUALNAME_MAXVALUE,
|
131 thilo.boehm 1.1 QUALNAME_METHODCONSTRAINT,
|
132 thilo.boehm 1.2 QUALNAME_MIN,
133 QUALNAME_MINLEN,
134 QUALNAME_MINVALUE,
135 QUALNAME_MODELCORRESPONDENCE,
136 QUALNAME_NONLOCAL,
137 QUALNAME_NONLOCALTYPE,
138 QUALNAME_NULLVALUE,
139 QUALNAME_OCTETSTRING,
140 QUALNAME_OUT,
141 QUALNAME_OVERRIDE,
|
142 thilo.boehm 1.1 QUALNAME_PROPAGATED,
|
143 thilo.boehm 1.2 QUALNAME_PROPERTYCONSTRAINT,
|
144 thilo.boehm 1.1 QUALNAME_PROPERTYUSAGE,
|
145 thilo.boehm 1.2 QUALNAME_PROVIDER,
146 QUALNAME_PUNIT,
147 QUALNAME_READ,
148 QUALNAME_REQUIRED,
149 QUALNAME_REVISION,
150 QUALNAME_SCHEMA,
151 QUALNAME_SOURCE,
152 QUALNAME_SOURCETYPE,
153 QUALNAME_STATIC,
154 QUALNAME_SYNTAX,
155 QUALNAME_SYNTAXTYPE,
156 QUALNAME_TERMINAL,
157 QUALNAME_TRIGGERTYPE,
158 QUALNAME_UMLPACKAGEPATH,
|
159 thilo.boehm 1.1 QUALNAME_UNITS,
|
160 thilo.boehm 1.2 QUALNAME_UNKNOWNVALUES,
|
161 thilo.boehm 1.1 QUALNAME_UNSUPPORTEDVALUES,
|
162 thilo.boehm 1.2 QUALNAME_VALUEMAP,
163 QUALNAME_VALUES,
164 QUALNAME_VERSION,
165 QUALNAME_WEEK,
|
166 thilo.boehm 1.1 QUALNAME_WRITE
167 };
168
|
169 thilo.boehm 1.3 typedef CIMDateTimeRep SCMBDateTime;
|
170 thilo.boehm 1.1
171 //
172 // This union is used to represent the values of properties, qualifiers,
|
173 thilo.boehm 1.2 // method return values, and method arguments.
|
174 thilo.boehm 1.1 //
|
175 thilo.boehm 1.2 // This union is only used for simple CIMTypes.
|
176 thilo.boehm 1.3 // If the CIMType is a String the union contains a relative pointer to the
177 // string.
178 // If the CIMType is an Array the union contains
179 // a relative pointer to of SCMBUnion[].
|
180 thilo.boehm 1.2 //
|
181 thilo.boehm 1.3 // To be able to return an absloute pointer to a string including the string
182 // length ( without trailing '\0' ) the union contains the element extString.
|
183 thilo.boehm 1.1 //
184 union SCMBUnion
185 {
|
186 thilo.boehm 1.3 struct
187 {
188 union
189 {
|
190 venkat.puvvada 1.5 Uint64 u64;
|
191 thilo.boehm 1.3 Boolean bin;
192 Uint8 u8;
193 Sint8 s8;
194 Uint16 u16;
195 Sint16 s16;
196 Uint32 u32;
197 Sint32 s32;
198 Sint64 s64;
199 Real32 r32;
200 Real64 r64;
201 Uint16 c16;
202 }val;
203 // SCMBUnion used in array values.
204 // This indicates if the single array member is a Null value.
205 // The type of size 64 is used to fill up the whole union.
206 Uint64 hasValue;
207 }simple;
208
209 SCMBDataPtr arrayValue;
210 SCMBDataPtr stringValue;
211 SCMBDateTime dateTimeValue;
212 thilo.boehm 1.3 // Used for embedded referecnes, instances, and objects
213 // as an external references to SCMO_Instances.
214 SCMOInstance* extRefPtr;
215
216 // This structure is used to handle an absolute char*
217 // including the length ( without traling '\0')
218 struct
219 {
220 Uint32 length;
221 char* pchar;
222 }extString;
|
223 thilo.boehm 1.1 };
224
225 struct SCMBValue
226 {
|
227 marek 1.7 union
228 {
229 Uint32 __align32;
230 // The CIMType of the value
231 CIMType valueType;
232 };
|
233 thilo.boehm 1.2
|
234 thilo.boehm 1.1 struct{
235 // If the value not set
236 unsigned isNull:1;
237 // If value is a type array
238 unsigned isArray:1;
239 // If value is set by the provider ( valid for SCMOInstance )
240 unsigned isSet:1;
241 } flags;
242
|
243 marek 1.7 union
244 {
245 Uint64 __align64;
246 // The number of elements if the value is a type array.
247 Uint32 valueArraySize;
248 };
|
249 thilo.boehm 1.1
250 SCMBUnion value;
251 };
252
|
253 thilo.boehm 1.3 struct SCMBKeyBindingValue
254 {
|
255 marek 1.7 union
256 {
257 Uint64 __align64;
258 // Boolean flag, if the key binding was set by the provider.
259 Sint32 isSet;
260 };
|
261 thilo.boehm 1.3 // The value of the key binding
262 SCMBUnion data;
263 };
264
265 struct SCMBUserKeyBindingElement
266 {
267 // If not 0, a relative pointer to the next element.
268 SCMBDataPtr nextElement;
|
269 marek 1.7 union
270 {
271 Uint64 __align64;
272 // The cim type
273 CIMType type;
274 };
|
275 thilo.boehm 1.3 // Relativer pointer to the key property name.
276 SCMBDataPtr name;
277 // The value.
278 SCMBKeyBindingValue value;
279 };
280
|
281 thilo.boehm 1.1 struct SCMBQualifier
282 {
283 //Boolean flag
284 Sint32 propagated;
285 QualifierNameEnum name;
|
286 marek 1.7 union
287 {
288 Uint64 __align64;
289 // The same value as CIMFlavor.
290 Uint32 flavor;
291 };
|
292 thilo.boehm 1.1 // if name == QUALNAME_USERDEFINED
293 // the ralative pointer to the user defined name
294 SCMBDataPtr userDefName;
295 // Qualifier Value
296 SCMBValue value;
297 };
298
299 struct SCMBMgmt_Header
300 {
|
301 marek 1.7 union
302 {
303 Uint64 __align64;
304 // The magic number for a SCMB memory object
305 Uint32 magic;
306 };
|
307 thilo.boehm 1.1 // Total size of the SCMB memory block( # bytes )
308 Uint64 totalSize;
309 // The # of bytes avaialable in the dynamic area of SCMB memory block.
310 Uint64 freeBytes;
311 // Index to the start of the free space in this SCMB memory block.
312 Uint64 startOfFreeSpace;
|
313 thilo.boehm 1.3 // Number of external references in this instance.
314 Uint32 numberExtRef;
315 // Size of external reference index array;
316 Uint32 sizeExtRefIndexArray;
317 // Relative pointer to the external reference Array.
318 SCMBDataPtr extRefIndexArray;
319
|
320 thilo.boehm 1.1 };
321
322 //
323 // The SCMB design needs the capability to access the properties via property
|
324 thilo.boehm 1.2 // name and index.
325 //
|
326 thilo.boehm 1.1 // Therefore the OrderedSet implementation is mapped into SCMB class properties
327 // and key bindigs.
|
328 thilo.boehm 1.2 //
|
329 thilo.boehm 1.1
330 struct SCMBClassProperty
331 {
332 // Relative pointer to property name
333 SCMBDataPtr name;
334 Uint32 nameHashTag;
335 // Flags
336 struct{
337 unsigned propagated:1;
338 unsigned isKey:1;
339 } flags;
340 // Relative pointer to the origin class name
341 SCMBDataPtr originClassName;
342 // Relative pointer to the reference class name
343 SCMBDataPtr refClassName;
|
344 thilo.boehm 1.3 // Contains the default value if specified
|
345 thilo.boehm 1.1 SCMBValue defaultValue;
|
346 marek 1.7 union
347 {
348 Uint64 __align64;
349 // Number of qualifiers in the array
350 Uint32 numberOfQualifiers;
351 };
|
352 thilo.boehm 1.1 // Relative pointer to SCMBQualifierArray
353 SCMBDataPtr qualifierArray;
354 };
355
356 struct SCMBClassPropertySet_Header
357 {
358 // Number of property nodes in the nodeArray
|
359 marek 1.7 union
360 {
361 Uint64 __align64;
362 Uint32 number;
363 };
|
364 thilo.boehm 1.1 // Used for name based lookups based on the name tags.
365 // A tag is generated by entangling the bit values of a first
|
366 thilo.boehm 1.2 // and last letter of a CIMName.
|
367 thilo.boehm 1.1 // PEGASUS_PROPERTY_SCMB_HASHSIZE is the hash size.
|
368 thilo.boehm 1.2 // The index of the hashTable is calculated doing a remainder operator
369 // with the name tag and hash size PEGASUS_PROPERTY_SCMB_HASHSIZE
|
370 thilo.boehm 1.1 // (NameTag % PEGASUS_PROPERTY_SCMB_HASHSIZE)
|
371 thilo.boehm 1.2 // The hashTable contains the index of the SCMBClassPropertyNode
|
372 thilo.boehm 1.1 // in the nodeArray.
373 Uint32 hashTable[PEGASUS_PROPERTY_SCMB_HASHSIZE];
374 // Relative pointer to the ClassPropertyNodeArray;
375 SCMBDataPtr nodeArray;
376 };
377
378 struct SCMBClassPropertyNode
379 {
380 // Is there a next node in the hash chain?
381 Sint32 hasNext;
382 // Array index of next property in hash chain.
383 Uint32 nextNode;
384 // The class property
385 SCMBClassProperty theProperty;
386 };
387
388 struct SCMBKeyBindingNode
389 {
390 // Is there a next node in the hash chain?
391 Sint32 hasNext;
392 // Array index of next property in hash chain.
393 thilo.boehm 1.1 Uint32 nextNode;
394 // Relativer pointer to the key property name.
395 SCMBDataPtr name;
396 Uint32 nameHashTag;
|
397 thilo.boehm 1.3 // The type of the key binding.
398 CIMType type;
|
399 thilo.boehm 1.1 };
400
401 struct SCMBKeyBindingSet_Header
402 {
|
403 thilo.boehm 1.3 // Number of keybindings in the nodeArray.
|
404 marek 1.7 union
405 {
406 Uint64 __align64;
407 Uint32 number;
408 };
|
409 thilo.boehm 1.1 // Used for name based lookups based on the name tags
410 // A tag is generated by entangling the bit values of a first
|
411 thilo.boehm 1.2 // and last letter of a CIMName.
412 // PEGASUS_KEYBINDIG_SCMB_HASHSIZE is the hash size.
413 // The index of the hashTable is calculated doing a remainder operator
414 // with the name tag and hash size PEGASUS_KEYBINDIG_SCMB_HASHSIZE
|
415 thilo.boehm 1.1 // (NameTag % PEGASUS_KEYBINDIG_SCMB_HASHSIZE)
|
416 thilo.boehm 1.2 // The hashTable contains the index of the SCMBKeyBindingNode
|
417 thilo.boehm 1.1 // in the keyBindingNodeArray.
418 Uint32 hashTable[PEGASUS_KEYBINDIG_SCMB_HASHSIZE];
419 // Relative pointer to an array of SCMBKeyBindingNode.
420 SCMBDataPtr nodeArray;
421 };
422
423 struct SCMBClass_Main
424 {
425 // The SCMB management header
426 SCMBMgmt_Header header;
427 // The reference counter for this class
428 AtomicInt refCount;
|
429 thilo.boehm 1.3 // Object flags
430 struct{
431 unsigned isEmpty :1;
432 }flags;
433
|
434 thilo.boehm 1.1 // SuperClassName
435 SCMBDataPtr superClassName;
436 // Relative pointer to classname
437 SCMBDataPtr className;
|
438 thilo.boehm 1.3 // Relative pointer to name space
|
439 thilo.boehm 1.1 SCMBDataPtr nameSpace;
|
440 thilo.boehm 1.2 // The key properties of this class are identified
|
441 thilo.boehm 1.1 // by a SCMBKeyPropertyMask
442 SCMBDataPtr keyPropertyMask;
|
443 thilo.boehm 1.3 // A list of index to the key properties in the property set node array.
|
444 thilo.boehm 1.1 SCMBDataPtr keyIndexList;
|
445 thilo.boehm 1.2 // Keybinding orderd set
|
446 thilo.boehm 1.1 SCMBKeyBindingSet_Header keyBindingSet;
447 // A set containing the class properties.
448 SCMBClassPropertySet_Header propertySet;
449 // Relative pointer to SCMBQualifierArray
|
450 marek 1.7 union
451 {
452 Uint64 __align64;
453 Uint32 numberOfQualifiers;
454 };
|
455 thilo.boehm 1.1 SCMBDataPtr qualifierArray;
|
456 thilo.boehm 1.2
|
457 thilo.boehm 1.1 };
458
|
459 thilo.boehm 1.2 //
460 // This is the static header information of a SCMB instance.
|
461 thilo.boehm 1.1 // It also holds a reference to the SCMB representation of the class describing
462 // the instance.
|
463 thilo.boehm 1.2 //
|
464 thilo.boehm 1.1
465 struct SCMBInstance_Main
466 {
467 // The SCMB management header
468 SCMBMgmt_Header header;
469 // The reference counter for this instance
470 AtomicInt refCount;
|
471 thilo.boehm 1.3
|
472 thilo.boehm 1.1 // Instance flags
473 struct{
474 unsigned includeQualifiers :1;
475 unsigned includeClassOrigin :1;
|
476 thilo.boehm 1.3 unsigned isClassOnly:1;
477 unsigned isCompromised:1;
478 unsigned exportSetOnly:1;
|
479 thilo.boehm 1.1 }flags;
|
480 thilo.boehm 1.3
|
481 marek 1.7 union
482 {
483 // An absolute pointer/reference to the class SCMB for this instance
484 SCMOClass* ptr;
485 // To keept 64 Bit space for the pointer the same
486 // size on 32 and 64 Bit systems.
487 Uint64 placeHolder;
488 }theClass;
489
490 // Number of key bindings of the instance
491 Uint32 numberKeyBindings;
|
492 thilo.boehm 1.3 // Number of user defined key bindings
493 Uint32 numberUserKeyBindings;
494 // Relative pointer SCMBUserKeyBindingElement
495 SCMBDataPtr userKeyBindingElement;
496 // Relative pointers to the name space name and class name.
497 // Will be initialized by with the values of the linked SCMOClass.
498 // If it was overwritten, the new value is stored in the SCMOInstance
499 // and the the flag isCompromised is set to true.
500 SCMBDataPtr instNameSpace;
501 SCMBDataPtr instClassName;
|
502 thilo.boehm 1.1 // Relative pointer to hostname
503 SCMBDataPtr hostName;
|
504 thilo.boehm 1.3 // Relative pointer to SCMBInstanceKeyBindingArray
|
505 thilo.boehm 1.1 SCMBDataPtr keyBindingArray;
506 // Number of properties of the class.
|
507 anusha.kandepu 1.8 union
508 {
509 Uint64 __align64;
510 Uint32 numberProperties;
511 };
|
512 thilo.boehm 1.1 // Relative pointer to SCMBInstancePropertyArray
513 SCMBDataPtr propertyArray;
514 };
515
516 // The index of an instance key binding is the same as the class.
|
517 thilo.boehm 1.2 // If a key binding has to be find by name, the class key binding ordered set
|
518 thilo.boehm 1.1 // has to be used to find the right index.
|
519 thilo.boehm 1.3 typedef SCMBKeyBindingValue SCMBInstanceKeyBindingArray[];
|
520 thilo.boehm 1.1
521 // The index of an instance property is the same as the class property.
|
522 thilo.boehm 1.2 // If a property has to be find by name, the class property ordered set
|
523 thilo.boehm 1.1 // has to be used to find the right index.
524 // The properties of an instances contains only the values provider.
|
525 thilo.boehm 1.2 // If a instance property does not contain a value
|
526 thilo.boehm 1.1 // the default value of the class has to be used.
527 typedef SCMBValue SCMBInstancePropertyArray[];
528
529 // It is a bit mask to identify key properties of an instance or class.
|
530 thilo.boehm 1.2 // The index of a key property in the property set is eqal to the index with in
531 // the key property mask.
|
532 thilo.boehm 1.1 // If a bit is not set (0) then it is not a key property.
533 // If a bit is set (1) then it is a key property.
534 // The array size of the key property mask is (numberOfProperties / 64)
535 typedef Uint64 SCMBKeyPropertyMask[];
536
|
537 thilo.boehm 1.3 // The static definition of the common SCMO memory functions
538 inline const void* _resolveDataPtr(
539 const SCMBDataPtr& ptr,
540 const char* base)
|
541 thilo.boehm 1.1 {
|
542 thilo.boehm 1.3 return ((ptr.start==(Uint64)0 ? NULL : (void*)&(base[ptr.start])));
543 }
|
544 thilo.boehm 1.1
|
545 thilo.boehm 1.3 inline const char* _getCharString(
546 const SCMBDataPtr& ptr,
547 const char* base)
548 {
549 return ((ptr.start==(Uint64)0 ? NULL : &(base[ptr.start])));
550 }
|
551 thilo.boehm 1.2
|
552 thilo.boehm 1.3 inline Uint32 _generateStringTag(const char* str, Uint32 len)
|
553 thilo.boehm 1.1 {
|
554 thilo.boehm 1.3 if (len == 0)
|
555 thilo.boehm 1.1 {
|
556 thilo.boehm 1.3 return 0;
|
557 thilo.boehm 1.1 }
|
558 thilo.boehm 1.3 return
559 (Uint32(CharSet::toUpperHash(str[0]) << 1) |
560 Uint32(CharSet::toUpperHash(str[len-1])));
561 }
|
562 thilo.boehm 1.1
|
563 thilo.boehm 1.3 inline Uint32 _generateSCMOStringTag(
564 const SCMBDataPtr& ptr,
565 char* base)
|
566 thilo.boehm 1.2 {
|
567 thilo.boehm 1.3 // The lenght of a SCMBDataPtr to a UTF8 string includs the trailing '\0'.
568 return _generateStringTag(_getCharString(ptr,base),ptr.size-1);
569 }
|
570 thilo.boehm 1.2
|
571 thilo.boehm 1.3 PEGASUS_COMMON_LINKAGE extern void _destroyExternalReferencesInternal(
572 SCMBMgmt_Header* memHdr);
|
573 thilo.boehm 1.1
|
574 thilo.boehm 1.3 #ifdef PEGASUS_HAS_ICU
575 Uint32 _utf8ICUncasecmp(
576 const char* a,
577 const char* b,
578 Uint32 len);
579 #endif
|
580 thilo.boehm 1.1
|
581 thilo.boehm 1.3 static inline Boolean _equalNoCaseUTF8Strings(
|
582 thilo.boehm 1.1 const SCMBDataPtr& ptr_a,
|
583 thilo.boehm 1.3 char* base,
|
584 thilo.boehm 1.1 const char* name,
|
585 thilo.boehm 1.3 Uint32 len)
586
587 {
588 #ifdef PEGASUS_HAS_ICU
589 //both are empty strings, so they are equal.
590 if (ptr_a.size == 0 && len == 0)
591 {
592 return true;
593 }
594 // size without trailing '\0' !!
595 if (ptr_a.size-1 != len)
596 {
597 return false;
598 }
599 const char* a = (const char*)_getCharString(ptr_a,base);
600 return ( _utf8ICUncasecmp(a,name,len)== 0);
601 #else
602 return System::strncasecmp(
603 &base[ptr_a.start],
604 Uint32(ptr_a.size-1),name,len);
605 #endif
606 thilo.boehm 1.3 }
|
607 thilo.boehm 1.1
608 PEGASUS_NAMESPACE_END
609
610
611 #endif
|