List Info

Thread: Module development




Module development
user name
2007-01-15 18:33:04
_______________________________________________ Monetra-support mailing list Monetra-supportlists.mainstreetsoftworks.com http://lists.mainstreetsoftworks.com/mailman/listinfo/monetra-support
Re: Module development
user name
2007-01-15 18:48:22
> Hi,
> I downloaded the module source 5.5 & 5.51 from this
location:
> 
> _https:
//www.mainstreetsoftworks.com/p/52.html_
> 
> And I'm looking at the monetra_pgsql module
specifically.
> 
> The handler entry is defined as this:
> 
> M_dbhandler_entry Postgres_dbhandler = {
>         NULL,
>         Postgres_BeginTransaction,
>         Postgres_CommitTransaction,
>         Postgres_statement_terminator,
>         NULL,
>         Postgres_Connect,
>         Postgres_Disconnect,
>         Postgres_CreateTable,
>         Postgres_DoTrans,
>         Postgres_Maintenance
> };
> 
> However, in monetra_module_entry.h (From Monetra v5.5) 
this struct is
> defined as:
> 
> typedef struct M_dbhandler_entry {
>     int (*config_reader)();
>     int (*C_DB_BeginTransaction)(char **tables, int
num_tables, int
> sql_conn_num);
>     int (*C_DB_CommitTransaction)(char **tables, int
num_tables, int
> sql_conn_num);
>     const char * (*C_DB_convert_type)(const char
*type); /* Convert 
> TEXT to VARCHAR(), etc */
>     const char * (*C_DB_select_lock_hint)(int
exclusive, int at_end); /*
> Lock hint text for SELECT transactions */
>     int (*C_DB_Connect)(int sql_conn_num);
>     int (*C_DB_Disconnect)(int sql_conn_num);
>     M_SQL_Result * (*C_DB_DoTrans)(int sql_conn_num);
>     int (*C_DB_Maintenance)(int level, char
**outstatus);
> } M_dbhandler_entry;
> 
> 
> These two do not seem compatible.   Am I missing
something? 
> Is there a better place to get the latest module
source?


Where are you looking at the monetra_module_entry.h?
The one distributed with Monetra v5.5 itself (as installed
through the Monetra Installer, and by default in
/usr/local/monetra/include/) has this definition:

typedef struct M_dbhandler_entry {
        int (*config_reader)(void);
        int (*C_DB_BeginTransaction)(char **tables, int
num_tables, int
sql_conn_num);
                /* Start DB transaction in SERIALIZABLE
isolation level,
                 * or exclusively lock specified tables
(ORACLE or MySQL
style)
                 */
        int (*C_DB_CommitTransaction)(char **tables, int
num_tables, int
sql_conn_num);
                /* Commit DB transaction, and unlock
specified tables
manually
                 * if necessary */
        const char * (*C_DB_statement_terminator)(void); /*
Should
statement end in a ';' ? */
        const char * (*C_DB_select_lock_hint)(int exclusive,
int
at_end); /* Lock hint text for SELECT transactions */
        int (*C_DB_Connect)(int sql_conn_num);
        int (*C_DB_Disconnect)(int sql_conn_num);
        M_SQL_Result * (*C_DB_CreateTable)(int sql_conn_num,
const char
*table_name, M_SQL_table_layout *fields,
                                           int num_fields);
        M_SQL_Result * (*C_DB_DoTrans)(int sql_conn_num);
        int (*C_DB_Maintenance)(int level, char
**outstatus);
} M_dbhandler_entry;


Perhaps you have a different version other than Monetra 5.5
installed on your system?  I think that structure you
pasted
looks consistent with Monetra 5.3's interface.  If it did
infact come with a Monetra 5.5, please let me know your
platform/version (and potentially architecture or glibc
version),
so I can validate the binary for Monetra 5.5 as it would
have
had the wrong distributables with it.

The monetra modules source are accurate here for Monetra
5.5,
whereas it is the header file which is not.

-Brad
_______________________________________________
Monetra-support mailing list
Monetra-supportlists.mainstreetsoftworks.com
http://lists.mainstreetsoftworks.com/mailma
n/listinfo/monetra-support

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )