This document addresses the most commonly asked questions about the Informix CGI Interface Kits. The FAQ is a compilation of questions and conversations that can help you in getting the latest information. Please help us maintain the usefulness of this FAQ by sending us your corrections and additions.
The Common Gateway Interface (CGI) is a standard for external gateway programs to interface with information servers such as the HTTP servers. Additional documentation on the CGI gateway can be obtained from NCSA Httpd Overview.
There are many navigators available on the Internet for various platforms. One of the more commonly used navigators is Netscape. To execute your CGI programs you need access to a Web server. Many HTTP compatible servers for creating hypertext and other documents available to Web browsers are available on the Internet. Some freely available servers are the NCSA and CERN servers. NCSA httpd is a HTTP/1.0 compatible server. CERN WWW server is another option. Commercial versions are available with enhanced security and many features not found in these public domain versions.
The 4GL CGI Interface Kit has been tested with c4GL version 6.0, RDS 6.0, INFORMIX-OnLine 7.10, and up. It is best to have the latest INFORMIX-4GL product version. For INFORMIX-ESQL/C, version 7.10 and up are the best options. Though our kits have been tested with the most recent versions, we do not expect any problems with the earlier versions.
Refer to Section 5.0 question number 4.
Refer to Section 5.0 question number 5.
Ranlib creates a table of contents that is added to an archive. It is possible that the ranlib command was not invoked. Try "ranlib archive filename" or try "ar -s archivefile". Also, whenever you are using ranlib et.c make sure you have a good amount of temporary swap space. If not, it is a good idea to strip the object file of the debugging info.
We do not currently support a facility for you to download the kit by anonymous ftp. All downloads have to be made through our Web site. We are aware that some of our clients have experienced problems downloading the kit. These problems were corrected. Send us a note if you are still facing problems in downloading the kit.
The purpose of cgiprintblob.ec program is to be able to print BLOBs out to the stdout. BLOBs are only supported with INFORMIX-OnLine. If you have INFORMIX-SE you will not be able to support BLOBs in your program.
This problem is usually faced by most clients who do not have the ESQL product. In the 4GL kit a couple of programs are present. Please make this change in the 4GL makefiles that make use of the INFORIX-ESQL/C library. To compile them you need to use a c4GL. The following change in your lib4glcgi.std will fix it.
CESQL = $(INFORMIXBIN)/esql
ESQL = $(INFORMIXBIN)/esql
to:
CESQL = $(INFORMIXBIN)/c4gl
ESQL = $(INFORMIXBIN)/c4gl
When I run the make command it displays the message "Making makefile lib4glcgi.mak from lib4glcgi.std" and I don't get the prompt back. What do I do?We had one of our customers experience this problem on a SunOS 4.1.3_DB 1 sun4 platform. It seems the problem is that the OSNAME variable in the lib4glcgi.std is not getting initialized to the one for your environment. A solution is to edit the libcgiusr.std file and set the OSNAME to your operating system's name. You could use the uname command to find out the OSNAME for your platform.
One of our clients had this problem when working on a SunOS platform. This was caused by the bsearch function returning an integer to a character pointer. The problem was fixed with the following:
Change in find_env function: env = bsearch(&newval, environ, env_used, sizeof(char **), env_cmp); to: env = (char **) bsearch(&newval, environ, env_used, sizeof(char **), env_cmp);
As pointed out by our client, they had a BSD compiler which couldn't handle the other _tolower function. The following changes solved the problem:
i4glaccess.c: for (pc=perms; *pc!=NULL;*pc=(char)tolower(*pc), pc++); icgigetvalue.ec: downshifted[i] = _tolower(name[i]);
Changing the macro by just removing the underscore fixed the problem here:
i4glaccess.c: for (pc=perms; *pc!=NULL;*pc=(char)tolower(*pc), pc++); icgigetvalue.ec: downshifted[i] = tolower(name[i]);
Yes, it can. The C compiler version c4GL can preprocess a ESQL code and turn the same into C source code, and can then be compiled and linked. Please make this change in the 4GL makefiles:
CESQL = $(INFORMIXBIN)/esql ESQL = $(INFORMIXBIN)/esql to CESQL = $(INFORMIXBIN)/c4gl ESQL = $(INFORMIXBIN)/c4gl
You have to build a
Let's say you had a .4gi file named testdrive.4gi and you invoked it as http://www.informix.com/cgi-bin/cgi_runner?testdrive.4gi. You would get the error message since your http server is not able to locate the .4gi file. To solve this problem, simply provide the full path in the URL. You would invoke the same file as:
http://www.informix.com/cgi-bin/cgi_runner?/usr/local/www/cgi-bin/testdrive.4gi
The release of INFORMIX-ESQL/C library before version 6.0 had the function rgetmsg. The versions after 6.0 use the function rgetlmsg. So if you are using INFORMIX-ESQL/C 4.0 or 5.0 you need to change all occurrences of rgetmsg to rgetlmsg in the programs. The parameters must also be changed. The INFORMIX-ESQL/C Programmer's Manual has a list of the prototypes for both these functions.
Porting Considerations
Informix has certified the INFORMIX-ESQL/C CGI Interface Kit for the Sun Solaris, Hewlett-Packard HP-UX, Silicon Graphics IRIX, and IBM AIX platforms. Where possible, standard UNIX commands were used so chances are the kit will also compile on your UNIX platform. In the spirit of making our products as open as possible, we will continue to certify this kit for additional platforms in the near future. The kit hasn't been adequately tested for RDS systems.
You may try. Please feel free to edit the .std files and other makefiles. You could refer to your man pages for documentation on make and make suitable changes. If you resolve problems during compilation, please send us mail indicating the error and your workaround.
NT
Is there a support for NT?
No, currently we do not have support for Windows NT.
AIX
This is a known problem. On AIX there is a header file named /usr/include/sys/localedef31.h. In the header file there is a typedef in this file declared as loc_t. This name conflicts with an Informix structure declaration in $INFORMIXDIR/incl/esql/locator.h which is pulled in on all INFORMIX-ESQL/C compiles.To make sure that you don't get the redeclaration errors, please try the following. The header file stdlib.h doesn't need to be uncommented.
You can then compile and link as normal. You can have your makefile perform these steps automatically so that your original source always contains loc_t. We are working on a better solution for this bug and shall update it soon.
The cgi_get_form_entry returns the first successful match for a given name tag.
One way is that you could use the global variable entrylist_lst to traverse through the linked list of name value pairs and copy those values that have the corresponding name tag you are looking for.
The other way is to code up a simple function like cgi_get_form_entry() in cgigetfrment.c. Instead of returning a pointer to the entry that corresponds to the name sent as a parameter, this returns a pointer to a linked list of name-value pairs that contains the selections in the multiple selection list. For example, here is a simple pseudo code:
//returns a linked list of name-value pairs that have entries corresponding to a multiple //selection list t_cgi_entry * cgi_get_form_entry(name) char *name; { //entrlist is a global variable that can be used to // traverse the list of name-value pairs t_cgi_entry *n = entrylist_list; t_cgi_entry *newlist; for(; n!= NULLENTRY; n = n->next) { if(strcmp(n->name, name) == 0 ) // add to newlist //remember to allocate space } //return head of the newlist }
Another solution is:
Have a function like // Prints to the standard output name-value pairs that have an entry same as the input // paramaeter. cgi_print_sel_list(char *name) { t_cgi_entry *n = entrylist_list; for(; n!= NULLENTRY; n = n->next) { if(strcmp(n->name, name) == 0 ) //print the value to standard output } }
We express our thanks to all users of the CGI Interface Kits and the feedback they gave us. It helped us immensely in creating this FAQ. We look forward to enhancing the functionality of the kit in the near future and thank you for your comments and suggestions. If you have a question, and would like it added to this page, please let us know.