aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorallen <allen@61ea717e-8e0c-4c3c-b38e-e9c67f54f1f1>2000-09-14 22:04:16 +0000
committerallen <allen@61ea717e-8e0c-4c3c-b38e-e9c67f54f1f1>2000-09-14 22:04:16 +0000
commitfd715d1efa7947489d73640f8ac7f766b4a940d9 (patch)
tree8ec551202e33c6463e56066da79cfc3da66fd1c3
parentda255bb4c6b2e653f081c4bad8c957be12f4362c (diff)
This commit was generated by cvs2svn to compensate for changes in r2, which
included commits to RCS files with non-trunk default branches. git-svn-id: http://svn.cactuscode.org/arrangements/CactusConnect/HTTPDExtra/trunk@3 61ea717e-8e0c-4c3c-b38e-e9c67f54f1f1
-rw-r--r--README7
-rw-r--r--interface.ccl6
-rw-r--r--param.ccl2
-rw-r--r--schedule.ccl8
-rw-r--r--src/Groups.c186
-rw-r--r--src/Startup.c47
-rw-r--r--src/make.code.defn9
7 files changed, 265 insertions, 0 deletions
diff --git a/README b/README
new file mode 100644
index 0000000..890cffd
--- /dev/null
+++ b/README
@@ -0,0 +1,7 @@
+Cactus Code Thorn httpd_utils
+Authors : ...
+CVS info : $Header$
+--------------------------------------------------------------------------
+
+Purpose of the thorn:
+
diff --git a/interface.ccl b/interface.ccl
new file mode 100644
index 0000000..0adf86e
--- /dev/null
+++ b/interface.ccl
@@ -0,0 +1,6 @@
+# Interface definition for thorn httpd_utils
+# $Header$
+
+implements: http_utils
+
+inherits:httpd
diff --git a/param.ccl b/param.ccl
new file mode 100644
index 0000000..97a8074
--- /dev/null
+++ b/param.ccl
@@ -0,0 +1,2 @@
+# Parameter definitions for thorn httpd_utils
+# $Header$
diff --git a/schedule.ccl b/schedule.ccl
new file mode 100644
index 0000000..0760854
--- /dev/null
+++ b/schedule.ccl
@@ -0,0 +1,8 @@
+# Schedule definitions for thorn httpd_utils
+# $Header$
+
+SCHEDULE HTTPUTILS_Startup AT startup
+{
+ LANG: C
+} "Utils for httpd startup"
+
diff --git a/src/Groups.c b/src/Groups.c
new file mode 100644
index 0000000..84bfe1c
--- /dev/null
+++ b/src/Groups.c
@@ -0,0 +1,186 @@
+ /*@@
+ @file Groups.c
+ @date Wed Sep 14 23:47:43 2000
+ @author Gabrielle Allen
+ @desc
+ Pages about groups
+ @enddesc
+ @version $Header$
+ @@*/
+
+#include <stdio.h>
+
+#include "cctk.h"
+
+#include "util_String.h"
+
+#include "DevThorns/httpd/src/http_Request.h"
+
+static char *rcsid = "$Header$";
+
+CCTK_FILEVERSION(DevThorns_httpd_utils_Groups_c)
+
+/********************************************************************
+ ********************* Local Data Types ***********************
+ ********************************************************************/
+
+
+/********************************************************************
+ ********************* Local Routine Prototypes *********************
+ ********************************************************************/
+
+static int GroupsPage(cGH *cctkGH, httpRequest *request, void *data);
+
+/********************************************************************
+ ********************* Other Routine Prototypes *********************
+ ********************************************************************/
+
+/********************************************************************
+ ********************* Local Data *****************************
+ ********************************************************************/
+
+/********************************************************************
+ ********************* External Routines **********************
+ ********************************************************************/
+
+ /*@@
+ @routine HTTPUTILS_RegisterPages
+ @date Wed Sep 14 11:29:43 2000
+ @author Gabrielle Allen
+ @desc
+ Httpd utils registration routine.
+ @enddesc
+ @calls
+ @calledby
+ @history
+
+ @endhistory
+
+@@*/
+int HTTPUTILS_RegisterPages(void)
+{
+ /* Register the group info page. */
+ HTTP_RegisterPage("/groups", GroupsPage, NULL);
+}
+
+/********************************************************************
+ ********************* Local Routines *************************
+ ********************************************************************/
+
+
+/******************************************************************************
+ ***************************** Groups Page **************************************
+ ******************************************************************************/
+
+static const char *cactus_header = " \
+</HEAD>\n \
+<BODY BGCOLOR=\"#FFFFFF\" \
+ link=\"#1B831D\" vlink=\"#768000\" alink=\"#00FF00\">\n \
+<center> \
+</A> \
+<table width=70% border=0><tr><td> \
+\n";
+
+static const char *cactus_footer = \
+"</table>" \
+"\n \
+<HR size=1>\n \
+<ADDRESS><DIV ALIGN=left>\n \
+<SMALL>\n \
+<A HREF=\"http://www.cactuscode.org/\">Cactus Home Page</A><BR>\n\
+Cactus Web Interface by <A HREF=\"mailto:cactusmaint@cactuscode.org\">The Cactus Team</A><BR>\n\
+</SMALL></DIV></ADDRESS></BODY></HTML>\n";
+
+ /*@@
+ @routine GroupsPage
+ @date Thu Sep 14 23:47:43 2000
+ @author Gabrielle Allen
+ @desc
+ Displays the group description page.
+ @enddesc
+ @calls
+ @calledby
+@@*/
+static int GroupsPage(cGH *cctkGH, httpRequest *request, void *data)
+{
+ int retval;
+ char message[4098];
+
+ /* Status message */
+ strcpy(message,"HTTP/1.0 200 OK\r\n");
+
+ write(request->filedes, message, strlen(message));
+
+ /* Content-Type */
+ strcpy(message,"Content-Type: text/html\r\n\r\n");
+
+ write(request->filedes, message, strlen(message));
+
+
+ /* Start the page */
+ strcpy(message,"<HTML><HEAD><TITLE>Cactus Simulation Group Information</TITLE>\n");
+
+ write(request->filedes, message, strlen(message));
+
+ /* Write out the header part. */
+
+ retval = write(request->filedes, cactus_header, strlen(cactus_header));
+
+ {
+ int i,j;
+ int ngroups,nvars;
+
+ ngroups = CCTK_NumGroups();
+
+ strcpy(message, "<h1>Groups and Variables:</h1>"
+ "<p>This list describes the grid variables and their groups "
+ "active in this simulation. <font color=red>Red</font> indicates"
+ " that storage is active for this group (at the time of the query).</p>"
+ "<DL>");
+
+
+ for(i=0; i < ngroups; i++)
+ {
+ strcat(message, "<DD>");
+ if (CCTK_QueryGroupStorageI(cctkGH,i))
+ {
+ sprintf(message,"%s %d. <font color=red>%s</font>\n", message, i, CCTK_GroupName(i));
+ }
+ else
+ {
+ sprintf(message,"%s %d) %s\n", message, i, CCTK_GroupName(i));
+ }
+ nvars = CCTK_NumVarsInGroupI(i);
+ strcat(message,"<DL>");
+ for(j=CCTK_FirstVarIndexI(i); j < CCTK_FirstVarIndexI(i)+nvars; j++)
+ {
+ strcat(message, "<DD>");
+ sprintf(message,"%s %d. %s\n", message, j, CCTK_VarName(j) );
+
+ }
+ strcat(message,"</DL>");
+ }
+ strcat(message, "</DL>");
+
+ }
+
+ write(request->filedes, message, strlen(message));
+
+
+ /* Finish table started by blurb */
+ strcpy(message, "</td></tr></table>");
+
+ write(request->filedes, message, strlen(message));
+
+ /* Write out the footer part. */
+
+ retval = write(request->filedes, cactus_footer, strlen(cactus_footer));
+
+ /* retval = write(request->filedes, base_page, strlen(base_page)); */
+
+ return retval;
+}
+
+
+
+
diff --git a/src/Startup.c b/src/Startup.c
new file mode 100644
index 0000000..79d37c3
--- /dev/null
+++ b/src/Startup.c
@@ -0,0 +1,47 @@
+ /*@@
+ @file Startup.c
+ @date Wed Sep 13 21:26:56 2000
+ @author Tom Goodale
+ @desc
+
+ @enddesc
+ @version $Header$
+ @@*/
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "cctk.h"
+
+#include "cctk_Arguments.h"
+#include "cctk_Parameters.h"
+
+#include "DevThorns/httpd/src/httpd.h"
+
+static char *rcsid = "$Header$";
+
+CCTK_FILEVERSION(DevThorn_http_utils_Startup_c)
+
+ /*@@
+ @routine HTTP_Startup
+ @date Wed Sep 13 21:26:56 2000
+ @author Tom Goodale
+ @desc
+ Startup routine for the webserver.
+ @enddesc
+ @calls
+ @calledby
+ @history
+
+ @endhistory
+
+@@*/
+int HTTPUTILS_Startup(void)
+{
+ DECLARE_CCTK_PARAMETERS
+
+ HTTPUTILS_RegisterPages();
+
+ return 0;
+}
+
diff --git a/src/make.code.defn b/src/make.code.defn
new file mode 100644
index 0000000..3869d45
--- /dev/null
+++ b/src/make.code.defn
@@ -0,0 +1,9 @@
+# Main make.code.defn file for thorn httpd_utils
+# $Header$
+
+# Source files in this directory
+SRCS = Groups.c Startup.c
+
+# Subdirectories containing source files
+SUBDIRS =
+