Convert C Prototypes to RPG

20 pts.
Tags:
RPG
RPGILE
RPGLE
I need to interface our payroll progam to Vertex Q Series payroll tax software. Vertex is written in C and our payroll programs are in RPGLE. Does anyone know what the RPG prototype to this function would be? PREFIX tVprtConn POSTFIX VprtOpenPRT (char *pDataSource, char *pServerName, char *pUserID, char *pPwd, tVprtRetStatus *pRetStatus, tMsgCallBack pMessageCallBack);

Answer Wiki

Thanks. We'll let you know when a new response is added.

I was able to get this to work yesterday.  It looks like this will be a slow process as I work with each api that I need to interface with.  Thanks for the responses guys.

Here’s what I came up with:

D VprtOpenPRT PR * EXTPROC(*CWIDEN:’VprtOpenPRT’)


D pDataSource * value options(*string)


D pServerId * value options(*string)


D pUserId * value options(*string)


D pPwd * value options(*string)


D pRetStatus *


D pMessageCallBack…


D *

 

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • CharlieBrowne
    We have the Vertex data base files loaded on the AS400 so we can easily do whatever we need. I believe they also provide interface programs.
    41,380 pointsBadges:
    report
  • CharlieBrowne
    I would also check with Vertex to see if they have interface PROCs or APIs already built that you can use,
    41,380 pointsBadges:
    report
  • TomLiotta

    It's not possible to determine an appropriate RPG prototype from what you've shown. A guess can be made that could get somewhat close, but there are a couple elements that are unknown and need additional definition.

    The PREFIX and POSTFIX tokens don't seem to have any meaning. They could be C (or C++?) macros. You'll need to closely review a C/C++ compiler listing to track back to whatever those are intended to do.

    The pMessageCallBack parm appears likely to be a procedure pointer. It seem to be a PROCPTR passed by value.

    The other parms all seem to be either basic character or perhaps integer parms simply passed by reference. The pRetStatus definition could be almost anything; tVprtRetStatus type needs to be examined to know what any RPG equivalent might be.

    The PR would probably be defined for EXTPROC('VprtOpenPRT'). I'd guess that it would have a return value defined to match whatever "PREFIX tVprtConn POSTFIX" resolves to.

    Without supporting detail, I don't know what else to add. The unknown elements are similar to RPG /COPY members or to RPG constants or maybe LIKEDEFs. Whatever they are, the source items need to be known first. C compiler rules can result in obscure source code; but so can RPG when external source statements are referenced and not shown.

    Tom

    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following