int process_all_users (void) { DSPAM_CTX *CTX; char *user; CTX = dspam_create (NULL, NULL, _ds_read_attribute(agent_config, "Home"), DSM_TOOLS, 0); open_ctx = CTX; if (CTX == NULL) { fprintf (stderr, "Could not initialize context: %s\n", strerror (errno)); return EFAILURE; } set_libdspam_attributes(CTX); if (dspam_attach(CTX, NULL)) { LOG (LOG_WARNING, "unable to attach dspam context"); fprintf (stderr, "Unable to attach DSPAM context\n"); return EFAILURE; } user = _ds_get_nextuser (CTX); while (user != NULL) { dump_user (user); user = _ds_get_nextuser (CTX); } dspam_destroy (CTX); open_ctx = NULL; return 0; }
/* ***************************************************************************** * Function : dump_resources * Syntax : void dump_resources(const resource_t *top) * Input : * top - Top of the resource tree * Output : * nop * Description : Dump the parsed resource-tree to stdout * Remarks : ***************************************************************************** */ void dump_resources(const resource_t *top) { printf("Internal resource-tree dump:\n"); while(top) { printf("Resource: %s\nId: %s\n", get_typename(top), get_nameid_str(top->name)); switch(top->type) { case res_acc: dump_accelerator(top->res.acc); break; case res_bmp: dump_bitmap(top->res.bmp); break; case res_cur: dump_cursor(top->res.cur); break; case res_curg: dump_cursor_group(top->res.curg); break; case res_dlg: dump_dialog(top->res.dlg); break; case res_dlgex: dump_dialogex(top->res.dlgex); break; case res_fnt: dump_font(top->res.fnt); break; case res_icog: dump_icon_group(top->res.icog); break; case res_ico: dump_icon(top->res.ico); break; case res_men: dump_menu(top->res.men); break; case res_menex: dump_menuex(top->res.menex); break; case res_rdt: dump_rcdata(top->res.rdt); break; case res_stt: dump_stringtable(top->res.stt); break; case res_usr: dump_user(top->res.usr); break; case res_msg: dump_messagetable(top->res.msg); break; case res_ver: dump_versioninfo(top->res.ver); break; case res_dlginit: dump_dlginit(top->res.dlgi); break; case res_toolbar: dump_toolbar(top->res.tbt); break; case res_anicur: case res_aniico: dump_ani_curico(top->res.ani); break; default: printf("Report this: Unknown resource type parsed %08x\n", top->type); } printf("\n"); top = top->next; } }