1*514f4c20SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*514f4c20SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*514f4c20SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*514f4c20SAndrew Rist * distributed with this work for additional information 6*514f4c20SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*514f4c20SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*514f4c20SAndrew Rist * "License"); you may not use this file except in compliance 9*514f4c20SAndrew Rist * with the License. You may obtain a copy of the License at 10*514f4c20SAndrew Rist * 11*514f4c20SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*514f4c20SAndrew Rist * 13*514f4c20SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*514f4c20SAndrew Rist * software distributed under the License is distributed on an 15*514f4c20SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*514f4c20SAndrew Rist * KIND, either express or implied. See the License for the 17*514f4c20SAndrew Rist * specific language governing permissions and limitations 18*514f4c20SAndrew Rist * under the License. 19*514f4c20SAndrew Rist * 20*514f4c20SAndrew Rist *************************************************************/ 21*514f4c20SAndrew Rist 22*514f4c20SAndrew Rist 23cdf0e10cSrcweir #ifndef _UNO_SEQUENCE2_H_ 24cdf0e10cSrcweir #define _UNO_SEQUENCE2_H_ 25cdf0e10cSrcweir 26cdf0e10cSrcweir #include <sal/types.h> 27cdf0e10cSrcweir #include <uno/data.h> 28cdf0e10cSrcweir 29cdf0e10cSrcweir #ifdef __cplusplus 30cdf0e10cSrcweir extern "C" 31cdf0e10cSrcweir { 32cdf0e10cSrcweir #endif 33cdf0e10cSrcweir 34cdf0e10cSrcweir struct _typelib_TypeDescriptionReference; 35cdf0e10cSrcweir struct _typelib_TypeDescription; 36cdf0e10cSrcweir typedef sal_Sequence uno_Sequence; 37cdf0e10cSrcweir 38cdf0e10cSrcweir /** Assigns a sequence. 39cdf0e10cSrcweir 40cdf0e10cSrcweir @param ppDest destinstaion sequence 41cdf0e10cSrcweir @param pSource source sequence 42cdf0e10cSrcweir @param pTypeDescr type description of the sequence and NOT of an element 43cdf0e10cSrcweir @param release function called each time an interface needs to 44cdf0e10cSrcweir be released; defaults (0) to uno 45cdf0e10cSrcweir */ 46cdf0e10cSrcweir void SAL_CALL uno_sequence_assign( 47cdf0e10cSrcweir uno_Sequence ** ppDest, 48cdf0e10cSrcweir uno_Sequence * pSource, 49cdf0e10cSrcweir struct _typelib_TypeDescription * pTypeDescr, 50cdf0e10cSrcweir uno_ReleaseFunc release ) 51cdf0e10cSrcweir SAL_THROW_EXTERN_C(); 52cdf0e10cSrcweir /** Assigns a sequence. 53cdf0e10cSrcweir 54cdf0e10cSrcweir @param ppDest destinstaion sequence 55cdf0e10cSrcweir @param pSource source sequence 56cdf0e10cSrcweir @param pType type of the sequence and NOT of an element 57cdf0e10cSrcweir @param release function called each time an interface needs to 58cdf0e10cSrcweir be released; defaults (0) to uno 59cdf0e10cSrcweir */ 60cdf0e10cSrcweir void SAL_CALL uno_type_sequence_assign( 61cdf0e10cSrcweir uno_Sequence ** ppDest, 62cdf0e10cSrcweir uno_Sequence * pSource, 63cdf0e10cSrcweir struct _typelib_TypeDescriptionReference * pType, 64cdf0e10cSrcweir uno_ReleaseFunc release ) 65cdf0e10cSrcweir SAL_THROW_EXTERN_C(); 66cdf0e10cSrcweir 67cdf0e10cSrcweir /** Constructs a new sequence with given elements. 68cdf0e10cSrcweir 69cdf0e10cSrcweir @param ppSequence out parameter sequence; 70cdf0e10cSrcweir 0 if memory allocation has failed 71cdf0e10cSrcweir @param pTypeDescr type description of the sequence and NOT of an 72cdf0e10cSrcweir element 73cdf0e10cSrcweir @param pElements if 0, then all elements are default constructed 74cdf0e10cSrcweir @param len number of elements 75cdf0e10cSrcweir @param acquire function called each time an interface needs to 76cdf0e10cSrcweir be acquired; defaults (0) to uno 77cdf0e10cSrcweir @return false, if memoray allocation has failed 78cdf0e10cSrcweir */ 79cdf0e10cSrcweir sal_Bool SAL_CALL uno_sequence_construct( 80cdf0e10cSrcweir uno_Sequence ** ppSequence, 81cdf0e10cSrcweir struct _typelib_TypeDescription * pTypeDescr, 82cdf0e10cSrcweir void * pElements, sal_Int32 len, 83cdf0e10cSrcweir uno_AcquireFunc acquire ) 84cdf0e10cSrcweir SAL_THROW_EXTERN_C(); 85cdf0e10cSrcweir /** Constructs a new sequence with given elements. 86cdf0e10cSrcweir 87cdf0e10cSrcweir @param ppSequence out parameter sequence; 88cdf0e10cSrcweir 0 if memory allocation has failed 89cdf0e10cSrcweir @param pType type of the sequence and NOT of an element 90cdf0e10cSrcweir @param pElements if 0, then all elements are default constructed 91cdf0e10cSrcweir @param len number of elements 92cdf0e10cSrcweir @param acquire function called each time an interface needs to 93cdf0e10cSrcweir be acquired; defaults (0) to uno 94cdf0e10cSrcweir @return false, if memoray allocation has failed 95cdf0e10cSrcweir */ 96cdf0e10cSrcweir sal_Bool SAL_CALL uno_type_sequence_construct( 97cdf0e10cSrcweir uno_Sequence ** ppSequence, 98cdf0e10cSrcweir struct _typelib_TypeDescriptionReference * pType, 99cdf0e10cSrcweir void * pElements, sal_Int32 len, 100cdf0e10cSrcweir uno_AcquireFunc acquire ) 101cdf0e10cSrcweir SAL_THROW_EXTERN_C(); 102cdf0e10cSrcweir 103cdf0e10cSrcweir /** Assures that the reference count of the given sequence is one. 104cdf0e10cSrcweir Otherwise a new copy of the sequence is created with a reference count 105cdf0e10cSrcweir of one. 106cdf0e10cSrcweir 107cdf0e10cSrcweir @param ppSequence inout sequence 108cdf0e10cSrcweir @param pTypeDescr type description of sequence 109cdf0e10cSrcweir @param acquire function called each time an interface needs to 110cdf0e10cSrcweir be acquired; defaults (0) to uno 111cdf0e10cSrcweir @param release function called each time an interface needs to 112cdf0e10cSrcweir be released; defaults (0) to uno 113cdf0e10cSrcweir @return false, if memoray allocation has failed 114cdf0e10cSrcweir */ 115cdf0e10cSrcweir sal_Bool SAL_CALL uno_sequence_reference2One( 116cdf0e10cSrcweir uno_Sequence ** ppSequence, 117cdf0e10cSrcweir struct _typelib_TypeDescription * pTypeDescr, 118cdf0e10cSrcweir uno_AcquireFunc acquire, 119cdf0e10cSrcweir uno_ReleaseFunc release ) 120cdf0e10cSrcweir SAL_THROW_EXTERN_C(); 121cdf0e10cSrcweir /** Assures that the reference count of the given sequence is one. 122cdf0e10cSrcweir Otherwise a new copy of the sequence is created with a reference count 123cdf0e10cSrcweir of one. 124cdf0e10cSrcweir 125cdf0e10cSrcweir @param ppSequence inout sequence 126cdf0e10cSrcweir @param pType type of sequence 127cdf0e10cSrcweir @param acquire function called each time an interface needs to 128cdf0e10cSrcweir be acquired; defaults (0) to uno 129cdf0e10cSrcweir @param release function called each time an interface needs to 130cdf0e10cSrcweir be released; defaults (0) to uno 131cdf0e10cSrcweir @return false, if memoray allocation has failed 132cdf0e10cSrcweir */ 133cdf0e10cSrcweir sal_Bool SAL_CALL uno_type_sequence_reference2One( 134cdf0e10cSrcweir uno_Sequence ** ppSequence, 135cdf0e10cSrcweir struct _typelib_TypeDescriptionReference * pType, 136cdf0e10cSrcweir uno_AcquireFunc acquire, 137cdf0e10cSrcweir uno_ReleaseFunc release ) 138cdf0e10cSrcweir SAL_THROW_EXTERN_C(); 139cdf0e10cSrcweir 140cdf0e10cSrcweir /** Reallocates length of a sequence. This truncates a sequence or enlarges 141cdf0e10cSrcweir it default constructing appended elements. 142cdf0e10cSrcweir 143cdf0e10cSrcweir @param ppSequence inout sequence 144cdf0e10cSrcweir @param pTypeDescr type description of sequence 145cdf0e10cSrcweir @param nSize new size of sequence 146cdf0e10cSrcweir @param acquire function called each time an interface needs to 147cdf0e10cSrcweir be acquired; defaults (0) to uno 148cdf0e10cSrcweir @param release function called each time an interface needs to 149cdf0e10cSrcweir be released; defaults (0) to uno 150cdf0e10cSrcweir @return false, if memoray allocation has failed 151cdf0e10cSrcweir */ 152cdf0e10cSrcweir sal_Bool SAL_CALL uno_sequence_realloc( 153cdf0e10cSrcweir uno_Sequence ** ppSequence, 154cdf0e10cSrcweir struct _typelib_TypeDescription * pTypeDescr, 155cdf0e10cSrcweir sal_Int32 nSize, 156cdf0e10cSrcweir uno_AcquireFunc acquire, 157cdf0e10cSrcweir uno_ReleaseFunc release ) 158cdf0e10cSrcweir SAL_THROW_EXTERN_C(); 159cdf0e10cSrcweir /** Reallocates length of a sequence. This truncates a sequence or enlarges 160cdf0e10cSrcweir it default constructing appended elements. 161cdf0e10cSrcweir 162cdf0e10cSrcweir @param ppSequence inout sequence 163cdf0e10cSrcweir @param pType type of sequence 164cdf0e10cSrcweir @param nSize new size of sequence 165cdf0e10cSrcweir @param acquire function called each time an interface needs to 166cdf0e10cSrcweir be acquired; defaults (0) to uno 167cdf0e10cSrcweir @param release function called each time an interface needs to 168cdf0e10cSrcweir be released; defaults (0) to uno 169cdf0e10cSrcweir @return false, if memoray allocation has failed 170cdf0e10cSrcweir */ 171cdf0e10cSrcweir sal_Bool SAL_CALL uno_type_sequence_realloc( 172cdf0e10cSrcweir uno_Sequence ** ppSequence, 173cdf0e10cSrcweir struct _typelib_TypeDescriptionReference * pType, 174cdf0e10cSrcweir sal_Int32 nSize, 175cdf0e10cSrcweir uno_AcquireFunc acquire, 176cdf0e10cSrcweir uno_ReleaseFunc release ) 177cdf0e10cSrcweir SAL_THROW_EXTERN_C(); 178cdf0e10cSrcweir 179cdf0e10cSrcweir #ifdef __cplusplus 180cdf0e10cSrcweir } 181cdf0e10cSrcweir #endif 182cdf0e10cSrcweir 183cdf0e10cSrcweir #endif 184