There are cases when we cannot pass a pointer to the mwm context
directly. In these cases, we will need to refer to the mwm instance
through a global variable. This commit adds the global reference.
{ NULL }
};
+struct mwm *__mwm;
+
static void print_usage(const char *argv0)
{
printf("Usage: %s [-h]\n"
int main(int argc, char *argv[])
{
- struct mwm *mwm;
int opt;
int err;
}
} while(opt >= 0);
- err = mwm_new(&mwm);
+ err = mwm_new(&__mwm);
if(err < 0) {
fprintf(stderr, "mwm_new: %s\n", strerror(-err));
return(1);
}
- err = mwm_init(mwm);
+ err = mwm_init(__mwm);
if(err < 0) {
fprintf(stderr, "mwm_init: %s\n", strerror(-err));
} else {
- err = mwm_run(mwm);
+ err = mwm_run(__mwm);
if(err < 0) {
fprintf(stderr, "mwm_run: %s\n",
}
}
- mwm_free(&mwm);
+ mwm_free(&__mwm);
return(err);
}