- 论坛徽章:
- 0
|
odmcreate的man手册中有这样一个example
Example
Assuming that a ClassDescriptionFile file named FileName.cre exists, the following command creates object classes:
odmcreate FileName.cre
Below is the FileName.cre source file and the resulting .h file:
/* This is an example odmcreate input file */
/* FileName.cre */
class Class2 {
char keys[32];
method card;
long cash;
};
class TstObj {
long a;
char b[80];
link Class2 Class2 card Class2Ln;
};
/* End of FileName.cre */
/* This is the generated header file FileName.h */
#include <odmi.h>
struct Class2 {
long _id; /* unique object id within object class */
long _reserved; /* reserved field */
long _scratch; /* extra field for application use */
char keys[32];
char card[256]; /* method */
long cash;
};
#define Class2_Descs 3
extern struct Class Class2_CLASS[];
#define get_Class2_list (a,b,c,d,e) (struct Class2 * ) odm_get_list (a,b,c,d,e)
struct TstObj {
long _id; /* unique object id within object class */
long _reserved; /* reserved field */
long _scratch; /* extra field for application use */
long a;
char b[80];
struct Class2 *Class2Ln; /* link */
struct objlistinfo *Class2Ln_info; /* link */
char Class2Ln_Lvalue[256]; /* link */
};
#define TstObj_Descs 3
extern struct Class TstObj_CLASS[];
#define get_TstObj_list (a,b,c,d,e) (struct TstObj * ) odm_get_list (a,b,c,d,e)
/* End of generated header file FileName.h */
See "ODM Example Code and Output" in AIX Version 6.1 General Programming Concepts: Writing and Debugging Programs for another example of a
ClassDescriptionFile parameter and the resulting .h file.
但执行odmcreate FileName.cre创建对象类的时候报错:
# odmcreate FileName.cre
0518-004 odmcreate: Incorrect descriptor type specified,
line 12 in file FileName.cre. Specify a valid descriptor type.
说link Class2 Class2 card Class2Ln;这条语句指定了错误的描述符类型,应该是card的类型有问题。
哪位高手熟悉自定义odm对象类的,麻烦帮忙解释一下,非常感谢! |
|