Programmer Guide > Creating an OPI Option > wvh_askeys
  

wvh_askeys
Obtains the key names for a given associative array.
C Usage
long wvh_askeys(asarr_wvh, keys)
WVH asarr_wvh
char **keys
Input Parameters
asarr_wvh—A PV-WAVE variable handle for an existing PV‑WAVE ASARR variable.
keys—A pointer to an array of character pointers large enough to hold all of the keys in the ASARR.
Returned Status
OPI_SUCCESS—Successful assignment occurred.
OPI_FAILURE—The arguments are invalid or inconsistent.
OPI_DO_NOT_PROCEED—Catastrophic errors occurred and execution should not continue. The calling C-code should do its cleaning up (free malloc’s space, free handles, etc.) and return to its caller immediately.
Discussion
The PV-WAVE ASARR variable you pass in must already exist in your PV‑WAVE session, either retrieved by your C routine or created by wave_assign_asarr.
The keys parameter should be declared as a char ** with enough space allocated to hold a character pointer for each key in the ASARR. You may use the wvh_nelems() routine to determine programmatically how many keys an ASARR contains. The easiest way is to declare it in your routine is:
char *keys[20];  /* where the ASARR holds 20 or fewer keys. */
PV-WAVE allocates the individual key strings and places them in the provided space. You need to free these when you are done with them.
wvh_askeys currently supports only the C language interface.
For more information and example usage, see the example OPI in the wave/demo/interapp/opilist-1_0 directory.
For more general information about creating PV-WAVE variables in your C routine, see the documentation for the wave_assign_* routines.

Version 2017.1
Copyright © 2019, Rogue Wave Software, Inc. All Rights Reserved.