Re: Difference between rgetmsg and rgetlmsg?
Posted in 1995
>From: spitz@GANS2X.ana.med.uni-muenchen.de (Richard Spitz) >Date: 18 Aug 1995 08:59:06 GMT >X-Informix-List-Id: <news.16337> > >Dear Informixers, > >in the process of fiddling around with the ESQL-CGI-interface available >from the Informix WWW server, I stumbled across the function "rgetlmsg". > >I only have the 5.01 versions of ESQL/C and backends available, and only >the 4.0 manual :-( Apparently, the examples for the CGI interface are >written for version 7.1, and "rgetlmsg" seems not to be included in >5.01 ESQL/C. rgetlmsg() is provided in Version 6.00 ESQL/C and later versions. With 6.0x and later versions of the product, message numbers have had the range extended from +/- 32767 to the 4-byte equivalent. The rgetlmsg() is used for handling these largter message numbers. The 6.0x and later rgetmsg() function is basically: int rgetmsg(msgnum, msgstr, maxlen) short msgnum; char *msgstr; int maxstr; { int actlen; return(rgetlmsg((long)msgnum, msgstr, maxlen, &actlen)); } Yes, you're right; for most machines, the short is passed as an int, and therefore as a 32-bit quantity, but the function has the argument defined as a short, so you get what you get... The extra argument, actlen, is an output value and tells you how long the message actually is. If the message is longer than the length specified by maxlen, then the message is chopped to fit, but the full length is given in actlen. This allows you to adjust things if you want to. >What's the deal with this function? Can I safely replace it with "rgetmsg", >omitting the 4th parameter of "rgetlmsg"? It doesn't seem to be used >anywhere anyway. Given the information above, the answer to your question is 'Yes, you can use rgetmsg() in place of rgetlmsg() if you omit the 4th argument'. Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>