User guide

E-56
PLI Access Routines
Returns
No return value.
Example D-21 Example of acc_mod_lcb_add
#include <stdio.h>
#include "acc_user.h"
#include "vcs_acc_user.h"
/* VCS callback rtn */
void line_call_back(filename, lineno, userdata, tag)
char *filename;
int lineno;
char *userdata;
int tag;
{
handle handle_mod = (handle)userdata;
io_printf("Tag %2d, file %s, line %2d, module %s\n",
tag, filename, lineno,
acc_fetch_fullname(handle_mod));
}
/* register all modules for line callback (recursive) */
void register_lcb (parent_mod)
handle parent_mod;
{
handle child = NULL;
if (! acc_object_of_type(parent_mod, accModule)) return;
io_printf("Registering %s\n",
acc_fetch_fullname (parent_mod));
acc_mod_lcb_add (parent_mod, line_call_back, parent_mod);
while ((child = acc_next_child (parent_mod, child))) {
register_lcb (child);
}
}