Produces the .c (source) and .h (include) files necessary for ODM application development and creates empty object classes.
odmcreate [ -p ] [ -c | -h ] ClassDescriptionFile
The odmcreate command is the ODM class compiler. The command takes as input an ASCII file that describes the objects a user wishes to use in a specific application. The odmcreate command can create empty object classes as part of its execution.
The output of the odmcreate command is a .h file (an include file) that contains the C language definitions for the object classes defined in the ASCII ClassDescriptionFile file. The resulting include file is used by the application for accessing objects stored in ODM. The odmcreate command also produces a .c file that must be compiled and bound in with the application. The .c file contains structures and definitions that are used internally by ODM at run time.
The ClassDescriptionFile parameter specifies an ASCII file that contains descriptions of one or more object classes. The general syntax for the ClassDescriptionFile parameter is as follows:
The default suffix for a ClassDescriptionFile file is .cre. If no suffix is specified on the odmcreate command, then a .cre suffix is appended. The file can have C language comments if run with the -p flag, and can include #define and #include lines that can be preprocessed if the -p flag is used to run the C language preprocessor on the file.
Note: ODM data bases are 32-bit data bases. The long type, when used in the class description file is a 32-bit data item. The long64 or int64 type, when used in the class description file is a 64-bit data item. The generated files will function the same for both 32- and 64-bit applications.
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 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs for another example of a ClassDescriptionFile parameter and the resulting .h file.
Object Data Manager (ODM) Overview in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.
The odm_create_class subroutine.
List of ODM Commands and Subroutines in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.
Understanding ODM Object Classes and Objects in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.
Understanding ODM Descriptors in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.
How to Create an Object Class in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.
How to Add Objects to an Object Class in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.
How to Store Object Classes and Objects in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.