dmParamsScan(3dm) dmParamsScan(3dm)
dmParamsScan - scan all entries of a digital media parameter/value list
#include <dmedia/dm_params.h>
DMstatus dmParamsScan [Toc] [Back]
( const DMparams* params,
DMstatus (*scanFunc)
( const DMparams* params,
const char* paramName,
void* scanArg,
DMboolean* stopScan ),
void* scanArg )
dmParamsScan scans all of the elements present in a parameter/value list,
calling the provided operator function on each entry. This can be used
in a program that wants to loop through the contents of a parameter/value
list.
dmParamsScan applies scanFunc to each element in a parameter/value list,
passing the name of the list entry and scanArg as parameters to scanFunc.
If scanFunc sets the value of the variable stopScan to DM_TRUE, the
parameter/value list scan will be stopped, and the return value from
scanFunc will be returned by dmParamsScan. Otherwise, dmParamsScan will
process all elements in the list and return DM_SUCCESS.
The following example will print the contents of a parameter/value list:
DMstatus
PrintParam(const DMparams *params, const char *paramName,
void *arg, DMboolean *pstop)
{
printf ("%s=", paramName);
switch(dmParamsGetType(params, paramName)) {
case DM_TYPE_INT:
printf ("%d(int)0, dmParamsGetInt(params, paramName));
break;
case DM_TYPE_LONG_LONG:
printf ("%lld(longlong)0, dmParamsGetLongLong(params, paramName));
break;
case DM_TYPE_FLOAT:
printf ("%3.3f(float)0, dmParamsGetFloat(params, paramName));
break;
default:
printf ("type(%d)0, dmParamsGetType(params, paramName));
break;
}
return DM_SUCCESS;
Page 1
dmParamsScan(3dm) dmParamsScan(3dm)
}
void
PrintParams(DMparams *params)
{
printf ("Contents of Parameter/Value List:0);
(void)dmParamsScan(params, PrintParam, 0);
}
dmParams(3dm).
PPPPaaaaggggeeee 2222 [ Back ]
|