/* * Print object to specified stream. */ void jpilot_print_file( JPilotFile *pilotFile, FILE *stream ) { GList *node; g_return_if_fail( pilotFile != NULL ); fprintf( stream, "JPilotFile:\n" ); fprintf( stream, "file spec: '%s'\n", pilotFile->path ); fprintf( stream, " metadata: %s\n", pilotFile->readMetadata ? "yes" : "no" ); fprintf( stream, " ret val: %d\n", pilotFile->retVal ); node = pilotFile->customLabels; while( node ) { fprintf( stream, " c label: %s\n", (gchar *)node->data ); node = g_list_next( node ); } node = pilotFile->labelInd; while( node ) { fprintf( stream, " labelind: %d\n", GPOINTER_TO_INT(node->data) ); node = g_list_next( node ); } addrcache_print( pilotFile->addressCache, stream ); fprintf( stream, " ret val: %d\n", pilotFile->retVal ); fprintf( stream, " have pc3: %s\n", pilotFile->havePC3 ? "yes" : "no" ); fprintf( stream, " pc3 time: %lu\n", pilotFile->pc3ModifyTime ); addritem_print_item_folder( pilotFile->addressCache->rootFolder, stream ); }
/* * Display object to specified stream. */ void vcard_print_file( VCardFile *cardFile, FILE *stream ) { g_return_if_fail( cardFile != NULL ); fprintf( stream, "VCardFile:\n" ); fprintf( stream, "file spec: '%s'\n", cardFile->path ); fprintf( stream, " ret val: %d\n", cardFile->retVal ); addrcache_print( cardFile->addressCache, stream ); addritem_print_item_folder( cardFile->addressCache->rootFolder, stream ); }
/* * Display object to specified stream. */ void syldap_print_data( SyldapServer *ldapServer, FILE *stream ) { g_return_if_fail( ldapServer != NULL ); fprintf( stream, "SyldapServer:\n" ); fprintf( stream, "host name: '%s'\n", ldapServer->hostName ); fprintf( stream, " port: %d\n", ldapServer->port ); fprintf( stream, " base dn: '%s'\n", ldapServer->baseDN ); fprintf( stream, " bind dn: '%s'\n", ldapServer->bindDN ); fprintf( stream, "bind pass: '******'\n", ldapServer->bindPass ); fprintf( stream, " criteria: '%s'\n", ldapServer->searchCriteria ); fprintf( stream, "searchval: '%s'\n", ldapServer->searchValue ); fprintf( stream, "max entry: %d\n", ldapServer->maxEntries ); fprintf( stream, " num read: %d\n", ldapServer->entriesRead ); fprintf( stream, " ret val: %d\n", ldapServer->retVal ); addrcache_print( ldapServer->addressCache, stream ); addritem_print_item_folder( ldapServer->addressCache->rootFolder, stream ); }
/** * Print address item for debug. * \param aio Address item to format. * \param stream Output stream. */ void addritem_print_item( AddrItemObject *aio, FILE *stream ) { g_return_if_fail( aio != NULL ); if( aio->type == ITEMTYPE_PERSON ) { ItemPerson *item = ( ItemPerson * ) aio; addritem_print_item_person( item, stream ); } else if( aio->type == ITEMTYPE_EMAIL ) { ItemEMail *item = ( ItemEMail * ) aio; addritem_print_item_email( item, stream ); } else if( aio->type == ITEMTYPE_GROUP ) { ItemGroup *item = ( ItemGroup * ) aio; addritem_print_item_group( item, stream ); } else if( aio->type == ITEMTYPE_FOLDER ) { ItemFolder *item = ( ItemFolder * ) aio; addritem_print_item_folder( item, stream ); } }
/** * Print address folder item contents for debug. * \param folder Folder to process. * \param stream Output stream. */ void addritem_print_item_folder( ItemFolder *folder, FILE *stream ) { GList *node; /* ItemPerson *person; */ ItemFolder *parent; g_return_if_fail( folder != NULL ); fprintf( stream, "Folder:\n" ); fprintf( stream, "\tt/u: %d : '%s'\n", ADDRITEM_TYPE(folder), ADDRITEM_ID(folder) ); fprintf( stream, "\tsub: %d\n", ADDRITEM_SUBTYPE(folder) ); fprintf( stream, "\tnam: '%s'\n", ADDRITEM_NAME(folder) ); fprintf( stream, "\trem: '%s'\n", folder->remarks ); fprintf( stream, "\ttyp: %d\n", folder->folderType ); fprintf( stream, "\thid: %s\n", folder->isHidden ? "hidden" : "visible" ); fprintf( stream, "\t---\n" ); parent = ( ItemFolder * ) ADDRITEM_PARENT(folder); if( parent ) { fprintf( stream, "\tpar: %s : %s\n", ADDRITEM_ID(parent), ADDRITEM_NAME(parent) ); } else { fprintf( stream, "\tpar: NULL\n" ); } node = folder->listFolder; while( node ) { AddrItemObject *aio = node->data; if( aio ) { if( aio->type == ITEMTYPE_FOLDER ) { ItemFolder *item = ( ItemFolder * ) aio; addritem_print_item_folder( item, stream ); } } else { fprintf( stream, "\t\tpid : ???\n" ); } node = g_list_next( node ); } node = folder->listPerson; while( node ) { AddrItemObject *aio = node->data; if( aio ) { if( aio->type == ITEMTYPE_PERSON ) { ItemPerson *item = ( ItemPerson * ) aio; addritem_print_item_person( item, stream ); } } else { fprintf( stream, "\t\tpid : ???\n" ); } node = g_list_next( node ); } node = folder->listGroup; while( node ) { AddrItemObject *aio = node->data; if( aio ) { if( aio->type == ITEMTYPE_GROUP ) { ItemGroup *item = ( ItemGroup * ) aio; addritem_print_item_group( item, stream ); } } else { fprintf( stream, "\t\tpid : ???\n" ); } node = g_list_next( node ); } fprintf( stream, "\t###\n" ); }