// ptra.c (867, 1) // ptraaGetSize(paa, psize) as int // ptraaGetSize(L_PTRAA *, l_int32 *) as l_ok /// <summary> /// ptraaGetSize() /// </summary> /// <remarks> /// </remarks> /// <include file="..\CHM_Help\IncludeComments.xml" path="Comments/ptraaGetSize/*"/> /// <param name="paa">[in] - </param> /// <param name="psize">[out] - size of ptr array</param> /// <returns>0 if OK 1 on error</returns> public static int ptraaGetSize( L_Ptraa paa, out int psize) { if (paa == null) { throw new ArgumentNullException("paa cannot be Nothing"); } int _Result = Natives.ptraaGetSize(paa.Pointer, out psize); return(_Result); }
// ptra.c (983, 1) // ptraaFlattenToPtra(paa) as L_Ptra // ptraaFlattenToPtra(L_PTRAA *) as L_PTRA * /// <summary> /// (1) This 'flattens' the ptraa to a ptra, taking the items in /// each ptra, in order, starting with the first ptra, etc.<para/> /// /// (2) As a side-effect, the ptra are all removed from the ptraa /// and destroyed, leaving an empty ptraa. /// </summary> /// <remarks> /// </remarks> /// <include file="..\CHM_Help\IncludeComments.xml" path="Comments/ptraaFlattenToPtra/*"/> /// <param name="paa">[in] - ptraa</param> /// <returns>ptra, or NULL on error</returns> public static L_Ptra ptraaFlattenToPtra( L_Ptraa paa) { if (paa == null) { throw new ArgumentNullException("paa cannot be Nothing"); } IntPtr _Result = Natives.ptraaFlattenToPtra(paa.Pointer); if (_Result == IntPtr.Zero) { return(null); } return(new L_Ptra(_Result)); }
// ptra.c (941, 1) // ptraaGetPtra(paa, index, accessflag) as L_Ptra // ptraaGetPtra(L_PTRAA *, l_int32, l_int32) as L_PTRA * /// <summary> /// (1) This returns the ptra ptr. If %accessflag == L_HANDLE_ONLY, /// the ptra is left on the ptraa. If %accessflag == L_REMOVE, /// the ptr in the ptraa is set to NULL, and the caller /// is responsible for disposing of the ptra (either putting it /// back on the ptraa, or destroying it).<para/> /// /// (2) This returns NULL if there is no Ptra at the index location. /// </summary> /// <remarks> /// </remarks> /// <include file="..\CHM_Help\IncludeComments.xml" path="Comments/ptraaGetPtra/*"/> /// <param name="paa">[in] - ptraa</param> /// <param name="index">[in] - location in array</param> /// <param name="accessflag">[in] - L_HANDLE_ONLY, L_REMOVE</param> /// <returns>ptra at index location, or NULL on error or if there is no ptra there.</returns> public static L_Ptra ptraaGetPtra( L_Ptraa paa, int index, int accessflag) { if (paa == null) { throw new ArgumentNullException("paa cannot be Nothing"); } IntPtr _Result = Natives.ptraaGetPtra(paa.Pointer, index, accessflag); if (_Result == IntPtr.Zero) { return(null); } return(new L_Ptra(_Result)); }
// ptra.c (898, 1) // ptraaInsertPtra(paa, index, pa) as int // ptraaInsertPtra(L_PTRAA *, l_int32, L_PTRA *) as l_ok /// <summary> /// (1) Caller should check return value. On success, the Ptra /// is inserted in the Ptraa and is owned by it. However, /// on error, the Ptra remains owned by the caller. /// </summary> /// <remarks> /// </remarks> /// <include file="..\CHM_Help\IncludeComments.xml" path="Comments/ptraaInsertPtra/*"/> /// <param name="paa">[in] - ptraa</param> /// <param name="index">[in] - location in array for insertion</param> /// <param name="pa">[in] - to be inserted</param> /// <returns>0 if OK 1 on error</returns> public static int ptraaInsertPtra( L_Ptraa paa, int index, L_Ptra pa) { if (paa == null) { throw new ArgumentNullException("paa cannot be Nothing"); } if (pa == null) { throw new ArgumentNullException("pa cannot be Nothing"); } int _Result = Natives.ptraaInsertPtra(paa.Pointer, index, pa.Pointer); return(_Result); }
// ptra.c (826, 1) // ptraaDestroy(ppaa, freeflag, warnflag) as Object // ptraaDestroy(L_PTRAA **, l_int32, l_int32) as void /// <summary> /// (1) See ptraDestroy() for use of %freeflag and %warnflag.<para/> /// /// (2) To destroy the ptraa, we destroy each ptra, then the ptr array, /// then the ptraa, and then null the contents of the input ptr. /// </summary> /// <remarks> /// </remarks> /// <include file="..\CHM_Help\IncludeComments.xml" path="Comments/ptraaDestroy/*"/> /// <param name="ppaa">[in,out] - to be nulled</param> /// <param name="freeflag">[in] - TRUE to free each remaining item in each ptra</param> /// <param name="warnflag">[in] - TRUE to warn if any remaining items are not destroyed</param> public static void ptraaDestroy( ref L_Ptraa ppaa, int freeflag, int warnflag) { IntPtr ppaaPtr = IntPtr.Zero; if (ppaa != null) { ppaaPtr = ppaa.Pointer; } Natives.ptraaDestroy(ref ppaaPtr, freeflag, warnflag); if (ppaaPtr == IntPtr.Zero) { ppaa = null; } else { ppaa = new L_Ptraa(ppaaPtr); }; }