Embedded Python Documentation information

Sam Schulenburg sams at quinta.com
Wed Jun 23 13:08:49 EDT 1999


While trying to add docinfo strings to my embedded C libraries I found
the folloing documentation issue:

The following structure follows the definition for setting up the 'C'
Python interface in embedded code. What is missing is the information on
the docinfo field parameters.

================== As defined in documentation ======================
// This function is the only exported function from the
// DLL and has to be of type non-static, all other functions must be
static.
__declspec(dllexport) void initASPIPy(void)
    {
        Py_InitModule("ASPIPy",ASPIPyFuncs);
    }

// Define the Methods array
static PyMethodDef ASPIPyFuncs[] =
    { //Python_Func_Name  C_Func_Name   Method_Flags
        {"startaspi"      ,PyStart      ,METH_VARARGS},
        {"cls"            ,PyCls        ,METH_VARARGS},
        {"io6"            ,PyIO6        ,METH_VARARGS},
        {"io10"           ,PyIO10       ,METH_VARARGS},
        {"io12"           ,PyIO12       ,METH_VARARGS},
        {"settid"         ,PySetTID     ,METH_VARARGS},
        {"setasciion"     ,PySetASCIIOn ,METH_VARARGS},
        {"gettid"         ,PyGetTID     ,METH_VARARGS},

=============== End Original documentation =========



The following is the correct definition for the Methods array adding
the docinfo string:
// Define the Methods array
static PyMethodDef ASPIPyFuncs[] =
{
// P_Func_Name  C_Func_Name    Method_Flags  DocInfo
  {"startaspi"  ,PyStart      ,METH_VARARGS,"startaspi(string,flag)"},
  {"cls"        ,PyCls        ,METH_VARARGS,"cls(void) Clears screen"},
  {"io6"        ,PyIO6        ,METH_VARARGS,"io6(cdb0...cdb5}",
  {"io10"       ,PyIO10       ,METH_VARARGS,"io10(cdb0...cdb9)"},
  {"io12"       ,PyIO12       ,METH_VARARGS,"io12(cdb0..cdn11)"},
  {"settid"     ,PySetTID     ,METH_VARARGS,"settid(TID)"},
  {"setasciion" ,PySetASCIIOn ,METH_VARARGS,"setasciion(flag)"},
  {"gettid"     ,PyGetTID     ,METH_VARARGS,"gettid(void)"}
}


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.




More information about the Python-list mailing list