I would recommend vart's method. Although you could do it the messy way
screenman.h
Code:
#ifndef INCLUDED_SCREENMAN_H
#define INCLUDED_SCREENMAN_H
struct screenMan_s
{
int test;
};
extern struct screenMan_s * smp;
#endif /* INCLUDED_SCREENMAN_H */
screenman.c
Code:
#include "screenman.h"
static struct screenMan_s sm = {0};
struct screenMan_s * smp = &sm;
void screenman_init(void)
{
/* blah */
smp->test = 0; /* not required, but this is a demo :D */
}
mouse.c
Code:
#include "screenman.h"
void mousePassive(int x, int y)
{
smp->test = 5; /* just make sure you don't dereference NULL :) */
/* etc */
}