diff --git a/project.toml b/project.toml index f9daa5b..f435838 100644 --- a/project.toml +++ b/project.toml @@ -107,27 +107,6 @@ entry = "@@CRT0" options = ["LIST", "MAP", "XREF", "RENT"] include = ["@@CRT1", "CGISTART", "HTTPREXX"] -# Test CGI module -[[link.module]] -name = "HTTPTEST" -entry = "@@CRT0" -options = ["LIST", "MAP", "XREF", "RENT"] -include = ["@@CRT1", "CGISTART", "HTTPTEST"] - -# Hello world CGI -[[link.module]] -name = "HELLO" -entry = "@@CRT0" -options = ["LIST", "MAP", "XREF", "RENT"] -include = ["@@CRT1", "CGISTART", "HELLO"] - -# Abend test CGI -[[link.module]] -name = "ABEND0C1" -entry = "@@CRT0" -options = ["LIST", "MAP", "XREF", "RENT"] -include = ["@@CRT1", "CGISTART", "ABEND0C1"] - # SSI handler modules [[link.module]] name = "HTTPDM" diff --git a/samplib/httpprm0 b/samplib/httpprm0 index b6e536f..c117572 100644 --- a/samplib/httpprm0 +++ b/samplib/httpprm0 @@ -46,7 +46,6 @@ DEBUG=0 # CGI=HTTPREXX /rexx/* # CGI=HTTPDM /.dm # CGI=HTTPDMTT /.dmtt -# CGI=HELLO /hello # # --- Lua CGI Settings --- # CGILUA_DATASET=HTTPD.CGILUA diff --git a/src/abend0c1.c b/src/abend0c1.c deleted file mode 100644 index aa79289..0000000 --- a/src/abend0c1.c +++ /dev/null @@ -1,20 +0,0 @@ -/* ABEND0C1.C - CGI Sample Program, should ABEND S0C1 */ -#include "httpd.h" - -#define httpx (httpd->httpx) - -int main(int argc, char **argv) -{ - CLIBPPA *ppa = __ppaget(); - CLIBGRT *grt = __grtget(); - HTTPD *httpd = grt->grtapp1; - HTTPC *httpc = grt->grtapp2; - int i; - - wtof("ABEND0C1 main PPA=%08X", ppa); - - __asm("DC\tH'0'"); - - return 1234; -} - diff --git a/src/hello.c b/src/hello.c deleted file mode 100644 index fd9f74e..0000000 --- a/src/hello.c +++ /dev/null @@ -1,32 +0,0 @@ -/* HELLO.C - CGI Sample Program, should work standalone or when linked to by HTTPD */ -#include "httpd.h" - -#define httpx (httpd->httpx) - -int main(int argc, char **argv) -{ - CLIBPPA *ppa = __ppaget(); - CLIBGRT *grt = __grtget(); - HTTPD *httpd = grt->grtapp1; - HTTPC *httpc = grt->grtapp2; - int i; - -#if 0 - wtof("HELLO main PPA=%08X", ppa); - wtof("HELLO main PPAPREV=%08X", ppa->ppaprev); - - for(i=0; i < argc; i++) { - wtof("HELLO main argv#%d=%s", i, argv[i]); - } -#endif - - if (httpd) { - http_resp(httpc,200); - http_printf(httpc, "Content-Type: %s\r\n", "text/plain"); - http_printf(httpc, "\r\n"); - } - - printf("Hello from %s\n", argv[0]); - - return 1234; -} diff --git a/src/httptest.c b/src/httptest.c deleted file mode 100644 index 578318f..0000000 --- a/src/httptest.c +++ /dev/null @@ -1,85 +0,0 @@ -/* HTTPTEST.C - CGI Program */ -#include "httpd.h" - -#define httpx (httpd->httpx) - -int main(int argc, char **argv) -{ - int rc = 0; - char ddname[12] = "DD:"; - - rc = __dsalcf(&ddname[3], - "DSN=&&testing,space=cyl(1,1),dsorg=ps,lrecl=121,blksize=12100,recfm=fb"); - if (!rc) { - FILE *fp = fopen(ddname, "w"); - if (fp) { - wtof("Opened %s for write", ddname); - wtof("lrecl=%u blksize=%u", fp->lrecl, fp->blksize); - fclose(fp); - } - - rc = __dsfree(&ddname[3]); - wtof("__dsfree(\"%s\"); rc=%d", &ddname[3], rc); - } - - return 0; -} - -#if 0 /* CGI test program */ -int main(int argc, char **argv) -{ - int rc = 0; - CLIBGRT *grt = __grtget(); - HTTPD *httpd = grt->grtapp1; - HTTPC *httpc = grt->grtapp2; - const char *p; - char buf[2048] = {0}; - - /* make sure we're running on the HTTPD server */ - if (!httpd) { - wtof("This program %s must be called by the HTTPD web server%s", ""); - /* TSO callers might not see a WTO message, so we send a STDOUT message too */ - printf("This program %s must be called by the HTTPD web server%s", "\n"); - return 12; - } - - http_resp(httpc, 200); - http_printf(httpc, "Content: text/plain\r\n"); - http_printf(httpc, "\r\n"); - - /* get the request path string */ - p = http_get_env(httpc, "REQUEST_PATH"); - if (!p) { - http_printf(httpc, "Unable to obtain REQUEST_PATH value\n"); - } - else { - http_printf(httpc, "%s: REQUEST_PATH=\"%s\"\n", argv[0], p); - } - - /* get the request method string */ - p = http_get_env(httpc, "REQUEST_METHOD"); - if (!p) { - http_printf(httpc, "Unable to obtain REQUEST_METHOD value\n"); - } - else { - http_printf(httpc, "%s: REQUEST_METHOD=\"%s\"\n", argv[0], p); - } - - if (http_cmp(p, "PUT")==0) { - http_printf(httpc, "httpc->socket=%d\n", httpc->socket); - rc = recv(httpc->socket, buf, sizeof(buf)-1, 0); - http_printf(httpc, "recv() rc=%d errno=%d\n", rc, errno); - if (rc>0) { - wtodumpf(buf, rc, "%s recv() ASCII", argv[0]); - http_atoe(buf, rc); - wtodumpf(buf, rc, "%s recv() EBCDIC", argv[0]); - buf[rc] = 0; - http_printf(httpc, "buf=\"%s\"\n", buf); - } - } - -quit: - return 0; -} - -#endif /* CGI test program */ diff --git a/src/test.c b/src/test.c deleted file mode 100644 index f8c4baf..0000000 --- a/src/test.c +++ /dev/null @@ -1,69 +0,0 @@ - - -__asm__("\n" -"SUBTASK\tDS\t0D\n" -" SAVE (14,12),,'SUBTASK'\n" -" LA 12,0(,15)\n" -" USING SUBTASK,12\n" -" LA 11,0(,1)\n" -" L 0,4(,11) get stack size\n" -" C 0,=A(STACKMIN) is stack large enough\n" -" BH GETMAIN yes, continue\n" -" L 0,=A(STACKLEN) no, use default size\n" -"GETMAIN DS 0H\n" -" GETMAIN RU,LV=(0),SP=0\n" -" ST 13,4(,1)\n" -" ST 1,8(,13)\n" -" LR 13,1\n" -" USING STACK,13\n" -" LA 0,MAINSTK stack for called functions\n" -" ST 0,SAVENAB next available byte in stack\n" -"*"); - -__asm__("\n" -" L 15,0(,11) get function address from plist\n" -" LA 1,4(11) => parameter for function\n" -" BALR 14,15 call function\n" -" LR 10,15 save return code from function\n" -"*"); - -__asm__("\n" -" LR 1,13\n" -" L 13,SAVEAREA+4\n" -" L 0,4(,11) get stack size\n" -" C 0,=A(STACKMIN) is stack large enough\n" -" BH FREEMAIN yes, continue\n" -" L 0,=A(STACKLEN) no, use default size\n" -"FREEMAIN DS 0H\n" -" FREEMAIN RU,LV=(0),A=(1),SP=0\n" -" LR 15,10\n" -" RETURN (14,12),RC=(15)\n" -"*"); - -__asm__("LTORG ,"); - -__asm__("\n" -"STACK DSECT\n" -"SAVEAREA DS 18F 00 (0) callers registers go here\n" -"SAVELWS DS A 48 (72) PL/I Language Work Space N/A\n" -"SAVENAB DS A 4C (76) next available byte -------+\n" -"* start of C function stack area |\n" -" DS 0D |\n" -"STACKMIN EQU *-STACK |\n" -"MAINSTK DS 32768F 128K bytes <-----------------------+\n" -"MAINLEN EQU *-MAINSTK\n" -"STACKLEN EQU *-STACK"); - -__asm__("CSECT ,"); - -int main(int argc, char**argv) -{ - void *func = 0; - int stack = 65536; - - __asm__("L\t0,=A(SUBTASK)\n\tST\t0,%0" : "=m"(func)); - - printf("func=%08X, stack=%d\n", func, stack); - - return 0; -}