From: skeezix Date: Tue, 22 Feb 2011 20:07:55 +0000 (-0500) Subject: libpnd; make pndvalidator slightly less useless.. can illustrate some pnd iteration X-Git-Tag: sz_beta3~62 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-libraries.git;a=commitdiff_plain;h=8075d3dba75ec1bf935e452595897d160f39244a libpnd; make pndvalidator slightly less useless.. can illustrate some pnd iteration --- diff --git a/apps/pndvalidator.c b/apps/pndvalidator.c index b21ab46..b3831f3 100644 --- a/apps/pndvalidator.c +++ b/apps/pndvalidator.c @@ -79,12 +79,22 @@ int main ( int argc, char *argv[] ) { printf ( "Got back a meaningful list of PXMLs.\n" ); - pnd_pxml_handle h = *pxmlapps; + unsigned int appiter = 0; + while ( 1 ) { - while ( h ) { + pnd_pxml_handle h = pxmlapps [ appiter ]; + + if ( ! h ) { + break; + } + + // if you want to just go direct to struct - not wise! + //pnd_pxml_t *p = pxmlapps [ appiter ]; + //printf ( "uid %s\n", p -> unique_id ); /* check the content */ + printf ( "Found name: '%s'\n", pnd_pxml_get_app_name_en ( h ) ); // check for required fields @@ -99,13 +109,11 @@ int main ( int argc, char *argv[] ) { // free up that particular pxml_handle within the return-list // next - pxmlapps++; - h = pxmlapps; + appiter++; } // while /* done! */ - pnd_pxml_delete ( pxmlapps ); return ( 0 ); }