Struggling with API QDFRTVFD
Frank Kolmann <[email protected]>
| Newsgroups | gmane.comp.lang.as400.c |
|---|---|
| Message-ID | <CAB-SQvidi6hNKOpy_jVvdcDxBNZ3NmUkTsBhA-ydj1-4riMSZA@mail.gmail.com> |
Hi Jevgeni
The RPG Program I have here does get the hidden field names and attributes.
For getting the basic stuff it works well.
http://wiki.midrange.com/index.php/QDFRTVFD
I am converting it to C but I am stuck on converting this line of code
if QDFFFINF.WDFFFIOA = x'01'
I coded it in C as a strncmp but I get this compile error.
I tried many things to attempt to cast from const char* to char but I
am failing.
(the C code of the program is here
http://wiki.midrange.com/index.php/CQDFRTVFD
It is a mix of the IBM code and the code I am converting , I am using the
IBM code as a guide to the conversion
also I must admit I dont really know what this code means
p_QDFFINFO = (QDFFINFO_t *)((char *) p_QDFFBASE + p_QDFFBASE->WDFFINOF);
I know it sets a pointer to the data but what does
(QDFFINFO_t *)((char *) mean ?
This is and example of the compile error I am getting.
217
|
218 17 | if (strncmp(p_QDFFFINF->WDFFFIOA, Attrib, 1) == 0)
{
218 17 + if ((_STRNCMPNULL((p_QDFFFINF->WDFFFIOA),(Attrib),(1))) ==
0) {
*=SEVERE==========> a - CZM0280 Function argument assignment between types
"const char*" and "char" is not allowed.
219 18 | NumFlds +=
1;
220 | }
However there are other uses of strncmp in the program that compile just
fine.
for example.
253 4 | for (i=0; i<p_QDFFBASE->WDFFRCS; ++i)
{
254 5 | if (strncmp(p_QDFARFTE->WDFARFNM,MyRec,10) == 0)
{
255 6 | RecIndex = i + 1; /* Entry in QDFARFTE table for the
requested name*/
256
Thanks Buck for the insight on what to return.
I think I will just allocate an array in the caller and pass in a pointer
to the array
and see how that goes.
>date: Mon, 18 Aug 2014 16:07:35 +0300
>from: Jevgeni Astanovski <[email protected]>
>
>I used this program as a starting point and successfully retrieved
>ALMOST everything.
>I needed the following:
>Format name, field name, field I/O attribute (Input, Output, Both,
>Hidden), field type and field length.
>As wrote earlier my failure was with hidden fields.
>I found one place where hidden fields names could be retrieved and
>another place where I could find (probably) these fields necessary
>attributes - but without field names!
>Names where available for all but hidden....
--
This is the Bare Metal Programming IBM i (AS/400 and iSeries) (C400-L) mailing list
To post a message email: C400-L-Zwy7GipZuJhWk0Htik3J/[email protected]
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/c400-l
or email: C400-L-request-Zwy7GipZuJhWk0Htik3J/[email protected]
Before posting, please take a moment to review the archives
at http://archive.midrange.com/c400-l.