Re: C program for QDFRTVFD API
Jevgeni Astanovski <[email protected]>
| Newsgroups | gmane.comp.lang.as400.c |
|---|---|
| Message-ID | <CAJuVQr02tw7jPGkNseMfj4Gc238HKAUet_DzK_sB0jHFT0C5bw@mail.gmail.com> |
Just curious, Frank. Why you sometime put a semicolon after a closing figure bracket? I mean this construction: }; in the ending part of function ProcessField... On Wed, Sep 10, 2014 at 12:53 PM, Frank Kolmann <[email protected]> wrote: > Hi > > > > I have coded a C program to get info from the QDFRTVFD API. > > It works and successfully retrieves Fields (incl posn and atr) and > Constants from a DSPF. > > It is here. http://wiki.midrange.com/index.php/CQDFRTVFD > > > > However the way it is coded is very inefficient because I invoke the API > for every field/constant in the DSPF. > > To be more efficient I would need to invoke the API only once and retain > the API returned data. > > I want to keep the API invoke in the called function. > > To retain data after a C program ends is , I believe the definition of > ‘memory leak’, so I cant see how I can call the API within the C program > and also retain the data after the program ends. > > I know how to pass data back to the caller, in fact that is how the field > information is returned. However for this I have memory allocated in the > caller. > The C program does a ‘malloc’ and here is where I am lost, as I cannot > see how to pass back the data in the ‘malloc’. > > Any help. TIA. > > > Frank > -- > This is the Bare Metal Programming IBM i (AS/400 and iSeries) (C400-L) mailing list > To post a message email: [email protected] > To subscribe, unsubscribe, or change list options, > visit: http://lists.midrange.com/mailman/listinfo/c400-l > or email: [email protected] > Before posting, please take a moment to review the archives > at http://archive.midrange.com/c400-l. > -- This is the Bare Metal Programming IBM i (AS/400 and iSeries) (C400-L) mailing list To post a message email: [email protected] To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/c400-l or email: [email protected] Before posting, please take a moment to review the archives at http://archive.midrange.com/c400-l.