From 8075d3dba75ec1bf935e452595897d160f39244a Mon Sep 17 00:00:00 2001 From: skeezix Date: Tue, 22 Feb 2011 15:07:55 -0500 Subject: [PATCH] libpnd; make pndvalidator slightly less useless.. can illustrate some pnd iteration --- apps/pndvalidator.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) 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 ); } -- 2.39.2