The following section describes the functions that you can use with the Compile-and-Go Library.
Generates a dynamic in-memory control table (instead of a pre-compiled static control table) for a given ASN.1 specification, which can be passed to ossinit().
If successful, returns zero. Otherwise, returns a non-zero value.
OssGlobal w, *world = &w; OssAsn1Global *aworld; void *controlHeader=NULL; OssBuf encodedData; /* length and address of encoded data */ DataPacket myPacket; aworld = ossGetAsn1CompilerHandle(userMalloc, userFree, userRealloc); rc = ossCreateControlTable(aworld, cmdLine, errFile, &controlHeader); ossinit(world, controlHeader); . . . encodedData.value = NULL; /* Intialize encoder output buffer */ encodedData.length = 0; ossEncode(world, DataPacket_PDU, &myPacket, &encodedData); . . . /* free all allocated PDUs, encoder buffers, terminate OSS runtime environment, free the control table handle, and terminate the OSS ASN.1 compiler environment. */ ossterm(world); ossDeleteControlTable(aworld, controlHeader); ossDeleteAsn1CompilerHandle(aworld);
Prepares and initializes the OSS environment to allow the dynamic creation of control tables via the ossCreateControlTable() function. Additionally, you can specify allocation, reallocation, and deallocation functions when dynamically creating control tables.
To enable the default memory routines, pass NULL to any or all of the three parameters (malloc(), free(), and realloc()).
Returns the address of a newly allocated Dynamic Control Table Creation environment variable. You can pass the returned structure to the ossCreateControlTable() function.
Releases the resources allocated by ossGetAsn1CompilerHandle(). In multi-threaded applications this function must be called after the last call to ossterm() | ossUterm() | ossWterm().
Releases the resources and control table allocated by ossCreateControlTable(). This function is called after a dynamically created control table is no longer needed and after calling ossterm().
This documentation applies to the OSS® ASN.1 Tools for C release 11.1 and later.
Copyright © 2021 OSS Nokalva, Inc. All rights reserved.
No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means electronic, mechanical, photocopying, recording or otherwise, without the prior permission of OSS Nokalva, Inc.
Every distributed copy of the OSS® ASN.1 Tools for C is associated with a specific license and related unique license number. That license determines, among other things, what functions of the OSS ASN.1 Tools for C are available to you.