|
Œ Hello Robert, You wrote: >Can somebody help me define a prototype definition to call the following C >API via RPG. I have tried various different methods for the protype >field types and I can't get to to work. Showing us the C prototype for this function would be much more useful than showing the code. However, here is my best guess based on the information at hand. The C data type 'long' is a 4-byte signed integer (generally, and on the AS/400 specifically) thus maps to RPG IVs 10-digit integer data type. Everything else in this program is just a fixed-length character string (implemented as arrays because C doesn't know what a fixed length character field is) and arrays are passed by reference (Well, really the array name is just a pointer and that is passed by value but it amounts to the same thing). The only awkward thing is the 2 dimensional array for 'rule_array' but we can presume that it is simply a 4*8 matrix implemented linearly in storage thus equivalent to a char(32). It would map quite happily to an array in a multiple occurrence data structure. DName+++++++++++ETDsFrom+++To/L+++IDc.Keywords+++++++++++++++++++++++++++++ d CSNBKTB PR d rt_cod 10I 0 d rs_cod 10I 0 d exit_data_len... d 10I 0 d exit_data 4 d key_token 64 d key_type 8 d rule_array_count... d 10I 0 d rule_array 32 d key_value 16 d mkvno 10I 0 d key_register_no... d 10I 0 d secure_token 8 d control_vector 16 d init_vector 8 d pad_char 10I 0 d crypto_period_st... d 4 d crypto_period_en... d 4 There is also a remote chance you may need to null-terminate some of the character strings. NOTE: For those of you confused by why there are no pointers in my prototype, remember: passing a pointer by value is the same as passing a variable by reference. If that prototype doesn't work then check that the parameter order is correct. I think it is right but there is a possibility I made a mistake (I thought I was wrong once but it turned out I was mistaken). For complete accuracy I would want to see either: The C prototype for CSNBKTB or The entry point source for CSNBKTB Regards, Simon Coulter. «»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«» «» FlyByNight Software AS/400 Technical Specialists «» «» Eclipse the competition - run your business on an IBM AS/400. «» «» «» «» Phone: +61 3 9419 0175 Mobile: +61 0411 091 400 /"\ «» «» Fax: +61 3 9419 0175 mailto: shc@flybynight.com.au \ / «» «» X «» «» ASCII Ribbon campaign against HTML E-Mail / \ «» «»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.