/*@@ @file Groups.c @date Wed Sep 14 23:47:43 2000 @author Gabrielle Allen @desc Pages about groups @enddesc @version $Header$ @@*/ #include "cctk.h" #include "httpRequest.h" #include "Content.h" #include "SString_Namespace.h" static const char *rcsid = "$Header$"; CCTK_FILEVERSION(CactusConnect_HTTPD_Groups_c) /******************************************************************** ********************* Local Data Types *********************** ********************************************************************/ /******************************************************************** ********************* Local Routine Prototypes ********************* ********************************************************************/ static int GroupsPage(const cGH *cctkGH, httpRequest *request, void *data); /*static int watch[1024];*/ /******************************************************************** ********************* Other Routine Prototypes ********************* ********************************************************************/ int HTTPi_RegisterGroupsPages(void); /******************************************************************** ********************* Local Data ***************************** ********************************************************************/ /******************************************************************** ********************* External Routines ********************** ********************************************************************/ /*@@ @routine HTTPi_RegisterGroupPages @date Wed Sep 14 11:29:43 2000 @author Gabrielle Allen @desc Httpd utils registration routine. @enddesc @calls @calledby @history @endhistory @@*/ int HTTPi_RegisterGroupsPages(void) { /* Register the group info page. */ HTTP_RegisterPage("/Groups", GroupsPage, NULL); HTTP_ContentLink("/Groups/index.html", "Groups and Variables", "Information about grid variables and groups", HTTP_QUICKLINK); return 0; } /******************************************************************** ********************* Local Routines ************************* ********************************************************************/ /****************************************************************************** ***************************** Groups Page ************************************** ******************************************************************************/ /*@@ @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(const cGH *cctkGH, httpRequest *request, void *data) { int retval; String *message = String_New(); int i,j; int ngroups,nvars; cGroup gdata; char *groupname; /* avoid compiler warning about unused parameter */ data = data; HTTP_Send_OK_Header( request ); /* Start the page */ HTTP_SetDoctype( message ); HTTP_SendString(request, message); HTTP_Send(request,"
\n"); HTTP_Send(request,"These pages describe the grid variables and groups \n" "active in this simulation.
\n"); SetToCString(message, "This simulation contains "); ConcatDecimal(message, CCTK_NumGroups()); ConcatCString(message, " groups, and "); ConcatDecimal(message, CCTK_NumVars()); ConcatCString(message, " variables, " "set in "); ConcatDecimal(message, CCTK_MaxDim()); ConcatCString(message, "-space dimensions. \nGroups for which storage is currently\n" "assigned are written in red. \n" "The numbers in square brackets are the group and variable indices." "
\n"); retval = HTTP_SendString(request, message); retval = HTTP_Send(request,"\n"); /* Write out the footer part. */ HTTP_SetContentFooterString(cctkGH,0,message); retval = HTTP_SendString(request, message); String_Delete( message ); return retval; }