|
From: Pradyumna D. <pv...@ps...> - 2009-03-18 21:45:42
|
Hi David,
Thank you for the prompt reply. Earlier one was my first post on the list
and your forthcoming reply has taken away most of my hesitation about asking
questions.
I had guessed that that could be a problem. I have imported the header file
containing typedefs and was still getting the same error. I also tried
directly copying the declarations -
typedef unsigned char U8; /// Generic 8 bit unsigned data type
typedef unsigned short U16; /// Generic 16 bit unsigned data type
inside the .i file. I was still getting the same error.
I think there is some mistake in the way I have been defining structures.
Specifically, the problem is coming from extern keyword before a struct
declaration. If I have declarations like - struct { }; instead of extern
struct { };, I no longer get the syntax error.
What are the situations in which 'extern' should be used and when it should
not be used? How is it going to affect the way Python functions with C?
Also, now I get a warning message - Unable to set variable of type U8 []
and Unable to set variable of type U16 []. Is there something obvious I am
missing/ doing wrong?
Regards,
Prady
On Wed, Mar 18, 2009 at 3:49 PM, David Piepgrass
<dpi...@me...>wrote:
> are U8, and U16 defined?
>
> Also you have a comma at the end of the first line instead of a semicolon.
>
> > -----Original Message-----
> > From: Pradyumna Desale [mailto:pv...@ps...]
> > Sent: Wednesday, March 18, 2009 1:22 PM
> > To: swi...@li...
> > Subject: [Swig-user] Syntax Error in input(1) - Newbie Question
> >
> > Hi All,
> >
> > I am trying to modify a .h file into .i file.
> >
> > Original .h looks like this -
> >
> > void (*ep_rx)(U8 *data, U8 len, U16 src_addr, U8 src_ep, U16 clust_id),
> > void (*ep_conf)(U8, U8));
> > void af_ep_unreg(U8 ep_num);
> > ep_entry_t *af_ep_find(U8 ep_num);
> >
> > My .i file -
> >
> > extern void (*ep_rx)(U8 *data, U8 len, U16 src_addr, U8 src_ep, U16
> > clust_id),
> > extern void (*ep_conf)(U8, U8));
> > extern void af_ep_unreg(U8 ep_num);
> > extern ep_entry_t *af_ep_find(U8 ep_num);
> >
> > I am getting the syntax error in input(1) message for all the above
> lines.
> >
> > I am using python 2.5.1, swig 1.3.35, gcc 4.3.2 on Ubuntu 8.04
> >
> > Can anyone please explain whats the problem with whatever I am doing?
> >
> > All the help is appreciated.
> >
> > Thanks and Regards,
> > Prady
> > -- ------
> > Graduate Student
> > Electrical Engineering
>
>
> --------
Graduate Student
Electrical Engineering
|