[prev in list] [next in list] [prev in thread] [next in thread]
List: suse-programming-e
Subject: Re: [opensuse-programming] How do you initialise a static table with external function pointers?
From: Per Jessen <per () computer ! org>
Date: 2008-03-16 19:13:41
Message-ID: frjrh5$dl9$1 () saturn ! local ! net
[Download RAW message or body]
Per Jessen wrote:
> I've got some code that looks roughly like this:
> (global scope) :
>
> static struct action process_table[] =
> {
> { 0, process2_250 },
> { 1, process2_550 },
> .
> .
> .
> };
Additional info:
extern PROCESS_FUNC *process2_250, *process2_550 ....
struct action {
int type;
PROCESS_FUNC *action;
}
PROCESS_FUNC is a typedef for a function prototype.
I've solved the problem - I've changed 'action' to:
struct action {
int type;
PROCESS_FUNC **action;
}
and the initialization:
static struct action process_table[] =
{
{ 0, &process2_250 },
{ 1, &process2_550 },
.
.
.
};
/Per Jessen, Zürich
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-programming+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-programming+help@opensuse.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic