2
我有一個包含用typedef結構定義C頭文件和char定義的用typedef陣列太:使用的typedef與SWIG
/* File: test.h */
typedef struct
{
char *key;
void *value;
int size;
} cti_pair;
typedef char FOO[CONST];
的SWIG接口文件包含下列行:
/* File: test.i */
%module test
%{
#define SWIG_FILE_WITH_INIT
#include "/home/users/jdoe/workspace/project/src/lib-cti/test.h"
...
%}
#ifndef CTI_TYPES_H_
#define CTI_TYPES_H_
#include "cti_const.h"
typedef char FOO[CONST];
typedef struct
{
char *key;
void *value;
int size;
} cti_pair;
的問題是,我可以訪問cti_pair結構,但在我的Python腳本不能使用FOO(它沒有定義)。