/*@@ @file Processors.c @date Wed Nov 8 2000 @author Gabrielle Allen @desc Pages about processors @enddesc @version $Header$ @@*/ #include "cctk.h" #include "util_String.h" #include "httpextra_HostNames.h" #include "HTTPDUtils.h" static const char *rcsid = "$Header$"; CCTK_FILEVERSION(CactusConnect_HTTPDExtra_Processors_c) /******************************************************************** ********************* Local Data Types *********************** ********************************************************************/ /******************************************************************** ********************* Local Routine Prototypes ********************* ********************************************************************/ static int ProcessorsPage(const cGH *cctkGH, httpRequest *request, void *data); /******************************************************************** ********************* Other Routine Prototypes ********************* ********************************************************************/ /******************************************************************** ********************* Local Data ***************************** ********************************************************************/ /******************************************************************** ********************* External Routines ********************** ********************************************************************/ /*@@ @routine HTTPDExtra_RegisterProcessorsPages @date Wed Sep 14 11:29:43 2000 @author Gabrielle Allen @desc Httpd utils registration routine. @enddesc @calls @calledby @history @endhistory @@*/ int HTTPDExtra_RegisterProcessorsPages(void) { /* Register the group info page. */ HTTP_RegisterPage("/Processors", ProcessorsPage, NULL); HTTP_ContentLink("/Processors/index.html", "Processor Information", "Processor layout and properties", HTTP_QUICKLINK); return 0; } /******************************************************************** ********************* Local Routines ************************* ********************************************************************/ /****************************************************************************** ***************************** Groups Page ************************************** ******************************************************************************/ /*@@ @routine ProcessorsPage @date Thu Sep 14 23:47:43 2000 @author Gabrielle Allen @desc Displays the processor description page. @enddesc @calls @calledby @@*/ static int ProcessorsPage(const cGH *cctkGH, httpRequest *request, void *data) { int retval = 0; int nprocs = 0,np = 0; String *message = String_New(); SendHTTP_OK_Header( request ); SetHTML_Doctype( message ); Send_HTTP_String(request, message); /* Start the page */ Send_HTTP(request, "\n\n"); Send_HTTP(request, "Cactus Simulation Processor Information\n"); SetHTML_HeadHeader( message); Send_HTTP_String(request, message ); Send_HTTP(request, "\n"); Send_HTTP(request, "\n\n"); /* HTTP_Write out the header part. */ SetHTML_ContentHeader(cctkGH, 0, message, NULL); retval = Send_HTTP_String(request, message); Send_HTTP(request, "

Processor Information

\n"); Send_HTTP(request, "
\n\n" "" "\n" "\n" ""); nprocs = CCTK_nProcs(cctkGH); for (np=0;np\n"); Send_HTTP_String(request, message ); } retval = Send_HTTP(request, "
NumberMachine Name
" ); ConcatDecimal( message, np ); ConcatCString( message, "" ); ConcatCString( message, HTTPDExtra_RemoteHostName(np) ); ConcatCString( message, "
\n
\n"); SetHTML_ContentFooter(cctkGH, 0, message); retval = Send_HTTP_String(request, message); String_Delete( message ); return retval; }