API Guide
2-220 API Functions 601355 Rev A
42 printf ( “Enter number of Criteria in
group ==> “ );
43 numcrit = atoi(gets(input));
44 for ( i = 0 ; i < numcrit ; i++ )
45 {
46 /* create the criteria for a media
stat field */
47 criteriah = VS_Criteria_Create();
48 if ( criteriah ==
(VST_CRITERIA_HANDLE) NULL )
49 {
50 /* could not allocate handle */
51 rc = VSE_FALSE;
52 break;
53 }
54 printf ( “Enter the media’s field
number ==> “ );
55 field = atoi(gets(input));
56 printf ( “Enter the sort order
(Ascending - 1, Descending - 2)
==>“ );
57 sort = atoi(gets(input));
58 /* set the criteria parameters */
59 VS_Criteria_SetFields (
criteriah,
60 VSID_FIELD,
field,
61
VSID_MOUNT_CRITERIA_ORDER, sort,
62 VSID_ENDFIELD );
63 /* populate the critera with
expressions */
64 /* (upto 4) */
65 printf ( “Enter the number of
criteria expressions ==> “ );
66 numexpr = atoi(gets(input));
67 for ( j = 0 ; j < numexpr ; j++ )
68 {
69 /* create an expression for
this criteria */
70 exprh =
VS_Expression_Create();