Before I start:
- Please note that I do not want to change the major design I'm presenting you here.
- Feel free to change the title if you think this one doesn't suit well
- The C++ tag is here because the solution should be equivalent for it as well
I have a header breakpoints.h
which declares:
typedef struct BreakpointInfo BreakpointInfo;
/*
* Iterate all breakpoints known to the Breakpoints service,
* including breakpoints that are created by other (remote) clients.
*/
typedef void IterateBreakpointsCallBack(BreakpointInfo *, void *);
extern void iterate_breakpoints(IterateBreakpointsCallBack * callback, void * args);
and a corresponding breakpoints.c
that defines:
struct BreakpointInfo {
Context * ctx;
LINK link_all;
/*
* A lot of members ..
*/
LINK link_hit_count;
};
Now I would like to use this functionallity in another file context.c
:
#include <tcf/services/breakpoints.h> // The header file
extern BreakpointInfo;
//extern struct BreakpointInfo; // Also did not work
void MyIterateBreakpointsCallBack(/* struct */ BreakpointInfo *bpInfo, void *args)
{
bpInfo->file;
}
void thread_function()
{
// ..
iterate_breakpoints(&MyIterateBreakpointsCallBack, 0);
// ..
}
But Intelli-Sense tells me:
BreakpointInfo *bpInfo, Error: pointer to incomplete class type is not allowed.
So the question is:
- Is that even possible without moving the definition of
BreakpointInfo
into the header file?
I don't want to change that since it is a quite complex program and I don't want to break its' design by doing such things.
It may be possible that I am using it the wrong way but why would there ba a iterate_breakpoints()
function available for me to access if I could not access BreakpointInfo
?
I hope it is clear what I am asking. Please let me know if you need anything to help me.
Best regards.