KCssGet

C Styled Script
Reference Manual

<< Back  End  Next >>
 
 
INDEX
Introduction
Installation
Using The CSS Executive
Language
Directives
System Library
String Library
Regular Expression Lib.
File Library
Database Library
C API
   Embedding CSS
   Writing Libraries
   API Reference
      KCssAddFunc
      KCssCall
      KCssClose
      KCssEnableTrace
      KCssGet
      KCssGetError
      KCssGetResult
      KCssIsTrace
      KCssLoadLibrary
      KCssLoadScriptFile
      KCssLoadScriptMem
      KCssOpen
      KCssSet
      KCssSetError
      KCssSetResult
      KCssShow
      KCssStartDate
      KCssStartTime
      KCssVarResize
      KCssVarSizeof
C++ API
CSS Links
  
long KCssAPI KCssGet(                    /* get var or const value */
   KCssHandle aHandle,                      /* CSS handle */
   const char *aVarName,                    /* variable name */
   char *aBuffer,                           /* buffer for value (NULL = query size) */
   long *aSize                              /* buffer size */
);

Get value of any CSS variable or constant.

On entry *aSize must be set to the actual size of the buffer. No more than this amount will be filled including zero termination. The rest of the variable content will in case be truncated. On exit *aSize is allways set to the buffersize required for holding the full value.

Pass aBuffer as NULL to only query the required buffer size.

If aSize is NULL, the API assumes your buffer is in any case large enough and will not limit the size at all (I strongly don't recommend this!).

Example:

// get size of value first for buffer allocation:
long size, errs;
errs = KCssGet(css, "adr[5][2]", NULL, &size);
if (errs) .... // error handling
 
// now allocate buffer and retrieve value
char* buf = new char[size];
errs = KCssGet(css, "adr[5][2]", buf, &size);
if (errs) .... // error handling
 
...
 
// when value no longer needed, dont forget to release buffer
delete [] buf;
 Copyright © IBK LandquartLast revised by Peter Koch, 24.02.00<< Back  Top  Next >>