Main Page   Compound List   File List   Header Files   Sources   Compound Members   File Members  

cgiapi.c

00001 
00024 
00025 #pragma option -1 /* create 80186 code */
00026 
00027 #include "cgiapi_t.h"
00028 #include "cgiapi.h"
00029 
00030 #include <dos.h>
00031 #include <string.h>
00032 
00033 unsigned int CGIInstall(CGI_Entry far* CGIEntry, char far* name, method_t method, void far* CGIFuncPt)
00034 {
00035     union  REGS  inregs;
00036     union  REGS  outregs;
00037     
00038     CGIEntry->PathPtr = name;
00039     CGIEntry->method = method;
00040     CGIEntry->CgiFuncPtr = CGIFuncPt;
00041 
00042     inregs.h.ah   = CGI_INSTALL;
00043     inregs.x.dx   = FP_SEG(CGIEntry);
00044     inregs.x.si   = FP_OFF(CGIEntry);
00045 
00046     int86(CGIVECT,&inregs,&outregs);
00047 
00048     return (unsigned int) outregs.x.dx;   
00049 }
00050 
00051 unsigned int CGIRemove(CGI_Entry far* CGIEntry)
00052 {
00053     union  REGS  inregs;
00054     union  REGS  outregs;
00055 
00056     inregs.h.ah   = CGI_REMOVE;
00057     inregs.x.dx   = FP_SEG(CGIEntry->PathPtr);
00058     inregs.x.si   = FP_OFF(CGIEntry->PathPtr);
00059     int86(CGIVECT,&inregs,&outregs);
00060 
00061     return (unsigned int) outregs.x.dx;
00062 }
00063 
00064 void CGIResponse(rpCgiPtr CGIRequest, response_t responseCode, response_t responseType, char far* responseData, size_t length)
00065 {
00066     CGIRequest->fHttpResponse = responseCode;
00067     CGIRequest->fDataType = responseType;
00068     CGIRequest->fResponseBufferPtr = responseData;
00069     CGIRequest->fResponseBufferLength = length;
00070 }
00071 
00072 void CGIGetFirstFormItem(char far* argumentBuffer, FormItem far* firstFormItem)
00073 {
00074     union  REGS  inregs;
00075     union  REGS  outregs;
00076     struct SREGS segregs;
00077 
00078     inregs.h.ah = CGI_GETFORMITEM;
00079     inregs.x.bx = FP_SEG(argumentBuffer);
00080     inregs.x.si = FP_OFF(argumentBuffer);
00081     segregs.es  = FP_SEG(firstFormItem);
00082     inregs.x.di = FP_OFF(firstFormItem);
00083 
00084     int86x(CGIVECT,&inregs,&outregs,&segregs);
00085 }
00086 
00087 char far* CGIGetNextFormItem(char far* argumentBuffer, FormItem far** nextFormItem)
00088 {
00089     union  REGS  inregs;
00090     union  REGS  outregs;
00091     struct SREGS segregs;
00092 
00093     char far* nextBuffer = NULL;
00094 
00095     inregs.h.ah = CGI_FINDNEXTITEM;
00096     inregs.x.bx = FP_SEG(argumentBuffer);
00097     inregs.x.si = FP_OFF(argumentBuffer);
00098     
00099     int86x(CGIVECT,&inregs,&outregs,&segregs);
00100 
00101     //printf("dx,ax: %x,%x\n", outregs.x.dx, outregs.x.ax); 
00102     if( outregs.x.dx == 0 ) {
00103         //printf("dx: %x\n", outregs.x.dx);        
00104         nextBuffer = MK_FP(segregs.es, outregs.x.di);
00105         CGIGetFirstFormItem(nextBuffer, *nextFormItem);
00106     } else {
00107         *nextFormItem = NULL;
00108     }
00109 
00110     return nextBuffer;
00111 }

Generated at Fri Jun 9 21:00:19 2000 for CGIAPI by doxygen 1.0.0 written by Dimitri van Heesch, © 1997-1999