Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ dmParamsScan(3dm) — IRIX 6.5.3f

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

dmParams(3dm)



dmParamsScan(3dm)                                            dmParamsScan(3dm)



NAME
     dmParamsScan - scan all entries of a digital media parameter/value list

SYNOPSIS
     #include <dmedia/dmparams.h>

     DMstatus dmParamsScan
            ( const DMparams* params,
             DMstatus (*scanFunc)
             ( const DMparams* params,
               const char* paramName,
               void* scanArg,
               DMboolean* stopScan ),
              void* scanArg )

DESCRIPTION
     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 DMTRUE, 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 DMSUCCESS.

     The following example will print the contents of a parameter/value list:

EXAMPLE
          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);
          }


SEE ALSO
     dmParams(3dm).










































                                                                        Page 2



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026