[slang-users] C Structure help ...

Ben Duncan linux4ms at aim.com
Thu Jun 7 15:02:09 EDT 2007


Ok, I am back working on my SLAG modules after a years  worth of off time
on it ...

I have an Appgen  structure like this:


/*
***************************************************************
   The Appgen Structure
***************************************************************
*/

typedef struct
{

   DB * di_apgn;           /* OUR Appgen DB Structure Pointer */
   int di_size;            /* -1 means recompute */
   char *file_name;        /* What is OUR file name for this instance? */
   char *rec_key;          /* Appgen has a key size limit of 132 */
   int is_locked;          /* IS the file locked ? */
   int Attribute;          /* What is the LAST Attribute we dealt with? */
   int Sub_Val;            /* WHat is the LAST Multi Value ? */
   int MV_CNT;             /* Keep up with our Looping on MV's */

   char *MV_BUFFER ;       /* On AppGen MV Extract, this is WHERE   */
                           /* We keep up with the returned malloc   */
                           /* IT is OUR duty to keep with it since  */
                           /* Appgen just allocates it and pushes   */
                           /* the MV string onto it ....            */

} APGN_Type

I need to know how Do I pass that back and forth to/from  the Slang/SLAG program.

I already have done this with python where the Python example is like:

import appgen
APGN_FILE = appgen.open("MyFile", "r")
(APGN_FILE becomes a APGN_Type inside of Python)

When I need to read the file in Python, is simply do a :
APGN_FILE.readrec("PROG.NAME",0)
(Where PROG.NAME is the record key}

How do I go about doing this ?


Thanks ...

-- 
Ben Duncan   - Business Network Solutions, Inc. 336 Elton Road  Jackson MS, 
39212
"Never attribute to malice, that which can be adequately explained by stupidity"
        - Hanlon's Razor


More information about the slang-users-l mailing list