einsteintoolkit / CactusConnect_HTTPDExtra.json
xinshuo's picture
Upload folder using huggingface_hub
10a2580 verified
{
"thorn_name": "CactusConnect/HTTPDExtra",
"url": "https://bitbucket.org/cactuscode/cactusconnect.git",
"configuration": "# Configuration definition for thorn http_utils\n# $Header$\n\nREQUIRES HTTPD IOUTIL\n\nOPTIONAL MPI\n{\n}\n",
"interface": "# Interface definition for thorn httpd_utils\n# $Header$\n\nimplements: http_utils\n\nUSES INCLUDE HEADER: http_Auth.h\nUSES INCLUDE HEADER: http_Content.h\n\n",
"param": "# Parameter definitions for thorn httpd_utils\n# $Header$\n\nprivate:\n\nINT viewport_refresh_seconds \"Viewport web page refresh time seconds\" STEERABLE = ALWAYS\n{\n -1: :: \"-1 for no refresh, 0 for immediate refresh\"\n} -1\n\n",
"schedule": "# Schedule definitions for thorn httpd_utils\n# $Header$\n\nSCHEDULE HTTPUTILS_Startup AT startup AFTER HTTP_Startup BEFORE IOUtil_Startup\n{\n LANG: C\n OPTIONS: GLOBAL\n} \"Utils for httpd startup\"\n",
"src": {
"make.code.defn": "# Main make.code.defn file for thorn httpd_utils\n# $Header$\n\n# Source files in this directory\nSRCS = Groups.c Startup.c IO.c Processors.c HostNames.c PtrList.c HTTPD_FileList.c TimerInfo.c\n\n# Subdirectories containing source files\nSUBDIRS = \n\n",
"PtrList_Namespace.h": "#ifndef __PTRLIST_NAMESPACE_HH__\n#define __PTRLIST_NAMESPACE_HH__\n\n#include \"PtrList.h\"\n\n/* A poor man's namespace for the PtrList module */\n\n#define NumberOfItems( a ) \\\n List_NumberOfItems( a )\n#define Remove( a, b ) \\\n List_Remove( a, b )\n#define Item( a, b ) \\\n List_Item( a, b )\n#define Insert( a, b, c ) \\\n List_Insert( a, b, c )\n#define SetItem( a, b, c ) \\\n List_SetItem( a, b, c )\n#define Append( a, b ) \\\n List_Append( a, b )\n#define RemoveItem( a, b ) \\\n List_RemoveItem( a, b )\n#define SwapItems( a, b, c ) \\\n List_SwapItems( a, b, c )\n#define Remove( a, b ) \\\n List_Remove( a, b )\n#define GetIndexOf( a, b, c ) \\\n List_GetIndexOf( a, b, c )\n#define DeleteItemsAndEmpty( a ) \\\n List_DeleteItemsAndEmpty( a )\n#define SortAccordingTo( a, b ) \\\n List_SortAccordingTo( a, b )\n#define FirstItemSuchThat( a, b ) \\\n List_FirstItemSuchThat( a, b )\n#define FindFirstIndexSuchThat( a, b ) \\\n List_FindFirstIndexSuchThat( a, b )\n\n#endif\n",
"Groups.c": " /*@@\n @file Groups.c\n @date Wed Sep 14 23:47:43 2000\n @author Gabrielle Allen\n @desc\n Pages about groups.\n @enddesc\n @version $Id$\n @@*/\n\n#include <stdio.h>\n#include <string.h>\n#include <stdlib.h>\n\n#include \"cctk.h\"\n#include \"util_String.h\"\n#include \"http_Content.h\"\n\nstatic const char *rcsid = \"$Header$\";\n\nCCTK_FILEVERSION(CactusConnect_HTTPDExtra_Groups_c)\n\n\n/********************************************************************\n ********************* External Routines **********************\n ********************************************************************/\nint HTTPUTILS_RegisterPages (void);\n\n\n/********************************************************************\n ********************* Internal Routines **********************\n ********************************************************************/\nstatic int MessagesPage(const cGH *cctkGH, httpRequest *request, void *data);\n\n\n /*@@\n @routine HTTPUTILS_RegisterPages\n @date Wed Sep 14 11:29:43 2000\n @author Gabrielle Allen\n @desc\n Httpd utils registration routine.\n @enddesc\n @calls HTTP_RegisterPage\n HTTP_ContentLink\n\n @returntype int\n @returndesc\n 0 for success\n @endreturndesc\n@@*/\nint HTTPUTILS_RegisterPages (void)\n{\n /* Register the message board page. */\n HTTP_RegisterPage (\"/Messages\", MessagesPage, NULL);\n\n HTTP_ContentLink (\"/Messages/index.html\", \"Message Board\",\n \"Collaborative simulation notepad\",\n HTTP_QUICKLINK);\n\n return (0);\n}\n\n/********************************************************************\n ******************** Internal Routines ************************\n ********************************************************************/\n\n /*@@\n @routine MessagesPage\n @date Sat Sep 16\n @author Gabrielle Allen\n @desc\n Message board for simulation.\n @enddesc\n@@*/\nstatic int MessagesPage (const cGH *GH, httpRequest *request, void *data)\n{\n int retval = 0;\n char currtime[64] = EMPTYSTRING, currdate[64] = EMPTYSTRING;\n String *message = String_New();\n const char *temp;\n static char *message_board = NULL;\n\n\n /* avoid compiler warning about unused parameter */\n data = data;\n\n if (HTTP_NumArguments( request ) > 0)\n {\n const char *name = HTTP_ArgumentValue (request, \"name\");\n const char *memo = HTTP_ArgumentValue (request, \"memo\");\n\n if (name && *name && memo && *memo)\n {\n size_t message_board_len = 0;\n /* concatenate new message, labeled with current date/time, to the\n message board */\n Util_CurrentTime (sizeof (currtime), currtime);\n Util_CurrentDate (sizeof (currdate), currdate);\n\n if (message_board)\n {\n message_board_len = strlen (message_board);\n message_board = (char *) realloc (message_board,\n message_board_len +\n strlen (currtime) + strlen (currdate)+\n strlen (name) + strlen (memo) + 60);\n }\n else\n {\n message_board_len = 0;\n message_board = (char *) malloc (strlen (currtime) + strlen (currdate) +\n strlen (name) + strlen (memo) + 60);\n }\n if (message_board)\n {\n sprintf (message_board + message_board_len,\n \"<p><strong>%s</strong> %s %s<br />\\n\\n<em>%s</em></p>\",\n name, currtime, currdate, memo);\n }\n }\n\n /* Now redirect the browser to the normal message board page */\n if (HTTP_MajorVersion( request ) < 1 ||\n (HTTP_MajorVersion( request ) == 1 && HTTP_MinorVersion( request ) < 1))\n {\n /* Older browsers don't understand 303 */\n temp = \"HTTP/1.0 302 Found\\r\\n\"\n \"Location: /Messages/index.html\\r\\n\\r\\n\";\n }\n else\n {\n temp = \"HTTP/1.0 303 See Other\\r\\n\"\n \"Location: /Messages/index.html\\r\\n\\r\\n\";\n }\n\n HTTP_Send (request, temp);\n\n return (0);\n }\n\n /* Status message */\n HTTP_SendOKHeader( request );\n\n HTTP_SetDoctype( message );\n HTTP_SendString(request, message);\n\n /* Start the page */\n HTTP_Send (request, \"<html><head><title>CACTUS Messages</title>\\n\" );\n\n HTTP_SetHeadInfo( message);\n HTTP_SendString(request, message );\n\n HTTP_Send(request, \"<style type=\\\"text/css\\\">\\n\");\n HTTP_Send(request, \" td.nomsg { background-color: #E9F4D3; }\\n\");\n HTTP_Send(request, \"</style>\\n\");\n HTTP_Send(request, \"</head>\\n<body>\\n\");\n\n /* Write out the header part */\n HTTP_SetContentHeaderString(GH, 0, message, NULL);\n HTTP_SendString(request, message);\n\n HTTP_Send (request, \n \"<h1>Message Board</h1>\\n\"\n \"<p>This page can be used to post messages during a \\n\"\n \"simulation. At the moment the messages will disappear \\n\"\n \"when the simulation finishes, but soon there will be an \\n\"\n \"option to save them to a file.</p>\\n\"\n \"<div class=\\\"centered\\\">\"\n \"<form action=\\\"/Messages/\\\">\\n\"\n \"<table>\\n\"\n \"<tr><td>Name:</td>\"\n \"<td><input type=\\\"text\\\" size=\\\"40\\\" maxlength=\\\"100\\\" name=\\\"name\\\" \"\n \"value=\\\"\\\" /></td></tr>\\n\"\n \"<tr><td valign=\\\"top\\\">Message:</td><td>\"\n \"<textarea name=\\\"memo\\\" rows=\\\"10\\\" cols=\\\"40\\\"></textarea>\\n\"\n \"</td></tr></table>\\n\"\n \"<p>\\n<input type=\\\"submit\\\" value=\\\"Submit Message\\\" />\\n</p>\\n\"\n \"<table width=\\\"80%\\\"><tr><td>\\n\"\n \"<h2>Messages:</h2></td></tr>\\n\"\n \"<tr><td><table width=\\\"100%\\\" cellpadding=\\\"5\\\" cellspacing=\\\"5\\\">\"\n \"<tr><td class=\\\"nomsg\\\">\" );\n\n temp = message_board ? message_board :\n \"No messages yet ... use the form above to add one\";\n HTTP_Send (request, temp );\n\n HTTP_Send (request, \"</td></tr></table>\\n\" );\n HTTP_Send (request, \"</td></tr></table>\\n</form>\\n</div>\\n\" );\n\n /* Write out the footer part. */\n HTTP_SetContentFooterString(GH, 0, message);\n retval = HTTP_SendString(request, message);\n\n String_Delete( message );\n return retval;\n}\n",
"PtrList.txt": " PtrList\n A C module for a list of pointers.\n\nEmbodies the idea of a list as a grocery list: the list doesn't contain\nthe groceries, it only refers to them; if you throw the list away, you\ndon't necessarily lose the produce.\n\nTypical use\n===========\n\nThe items in a PtrList are referenced as pointers to void. PtrList can be\nused directly this way, but isn't type-safe. It is usually better to write\na wrapper around PtrList for each type of data which needs to be listed,\nwhose Item() function returns a pointer to an item of that type, etc.\n\nThis can be done for simple cases with preprocessor macros, or for more\ninvolved cases with a separate header and source file.\n\n------------------------------- EXAMPLE ----------------------------------\n\n ------------------- MyList.h ------------------\ntypedef struct PtrList_tag MyListType;\n\nsize_t MyListType_NumberOfThings( const MyListType * );\nMyListType * MyListType_New( void );\n...\n\n ------------------- .c file -------------------\n\n#include \"MyList.h\"\n\nsize_t\nMyListType_NumberOfThings( const MyListType * list ) {\n return List_NumberOfItems( list );\n}\n\nMyListType *\nMyListType_New() {\n return (MyListType *)List_New();\n}\n\n-------------------------------------------------------------------\n\nLife-cycle\n==========\n\t1) Create with\n\t\tPtrList_New\n\t\tPtrList_MakeCopy\n\n\t2) Manipulate, pass to functions, etc\n\n\t3) Reclaim memory with\n\t\tPtrList_Delete\n\nEfficiency\n==========\n\nOne efficiency concern governed the internal structure of the module, namely\nhow to deal with memory needed to deal with the pointers being added.\n\nThe simplest thing would be to allocate a block of memory the size of a\npointer for each item added. For very simple applications making heavy\nuse of a list with many items, this is prohibitive. \n\nPtrList does not require a memory allocation per item to append an item. \nInternally, the PtrList maintains a list of pages of pointers, each of which\ncontains many pointers. When the first item is appended to an empty PtrList,\none of these pages is allocated and initialized, and the pointer is written\nin the page. When a second item is appended, it is written directly into\nthis existing page. Only when that page is full is another allocated. If an\nitem is inserted into a PtrList, it is inserted into the appropriate page,\nand possibly the last item on that page needs to be moved to the next page,\nbut if that page is again full, the PtrList just inserts a new empty page and\nputs the remaining item onto the new page.\n\nThe only concession made in the API to this paging structure is the creator\nfunction ListPage_NewWithPageSize( size_t size ), which allows the user to\nset the number of elements on each page. For example, if the maximum number\nof items in the list is known for the application, the page size can be set\nto that maximum, thus avoiding much of the internal paging mechanism.\n\nLimitations\n===========\n\nThe PtrList does not (at present) put much effort into compressing pages\nfrom which items are removed. So if all but one item is removed from each\npage, it will stay that way, rather than compressing the items onto fewer\npages. One improvment would be to make the list compress itself during a\nRemove call, whenever, say, a page is found to be less than half full.\n\nVarious other improvements could be made: the number of items in the list\ncould be cached for NumberOfItems.\n\nName convention\n===============\n\nIn some applications, especially when the list items are guaranteed to be\nunique, it makes sense to refer to the pointer items by their values. In\nother applications, it only makes sense to refer to them by their indices. \n\nTo distinguish between functions meant for the two cases, those which refer \nto the item by index will have Item in their name, whereas the corresponding \nfuncition that refers to the item by value does not: Remove vs RemoveItem.\n\nNamespace\n=========\n\nThe header file PtrList_Namespace.h contains macros that locally transforms\nshortened PtrList function names to the full ones. Only names following\nthe inclusion of the file are affected.\n\nSo long as no other function names in your source file collide with these\nshortened names in your file, you may use them to make your code easier to\nread.\n\nThe main creation and deletion functions are not shortened by this file.\n\nSpecial functions\n=================\n\nNote:\n\tLost_GetIndexOf\n\tList_Remove\nThese just find the first item pointer whose value is the same as the input\nvalue. Note that PtrList makes no check as to the uniqueness of pointers\nput into the list.\n\n\tList_FreeItemsInListAndEmpty\n\nIs a useful utility, but it isn't really a method of a PtrList in the sense\nthat in the common usage of the term 'list', a list doesn't throw away its\nitems. Also, be aware that this assumes the items are simple blocks of\nmemory allocated with one of the standard C library routines ('malloc', etc).\nIt just calls free on each one and removes it in the most efficient way\n(from the end of the list).\n\nFunction Reference\n==================\n\nPtrList *\nList_New( void )\n\n\tCreates a new empty list.\n\nPtrList *\nList_NewWithPageSize( size_t size )\n\n\tCreates a new empty list, and sets the internal page size.\n\nPtrList *\nList_MakeCopy( const PtrList *other )\n\n\tCreates a new list containing the same items as does the argument.\n\nvoid\nList_Delete( PtrList *list )\n\n\tFrees the list and memory it allocates internally. DOES NOT\n\tdo anything to the items pointed to by list items.\n\nstatic void\nList_HandleAddressingError()\n\n\t To be supplied by user of list code. Called when item accesssor\n\t is called with an index out of range.\n\nvoid\nList_Empty( PtrList * this )\n\n\tRemoves all the items on the list (does nothing to items pointed\n\tto by the list items).\n\nsize_t\nList_NumberOfItems( const PtrList *this )\n\n\tReturns the number of items in the list.\n\nvoid\nList_Append( PtrList *this, void * newItem )\n\n\tPuts a new item on the end of the list.\n\nvoid\nList_InsertItem( PtrList *this, size_t index, void * newItem )\n\n\tInserts the item at the specified index, shifting indices of existing\n\tlist items as necessary. If index is greater than or equal to the\n\tnumber of items initially in the list, the item is just appended.\n\nvoid *\nList_Item( const PtrList *this, size_t requestedIndex )\n\n\tReturns the item of given index; returns NULL if no such index.\n\tThe items are indexed beginning with 0;\n\nvoid\nList_SetItem( PtrList *this, size_t requestedIndex, void *value )\n\n\tSets the item of given index. Calls user-supplied addressing\n\thandler if no such item exists.\n\nvoid\nList_CopyList( PtrList *list, const PtrList * other )\n\n\tEmpties this list and puts items from other list in it.\n\nvoid *\nList_RemoveItem( PtrList *list, size_t index )\n\n\tRemoves the item of given index from the list.\n\tReturns a pointer to the item removed, or NULL if item not found.\n\nvoid\nList_Remove( PtrList *list, void * item )\n\n\tRemoves the first item in the list with pointer identical to 'item'.\n\nPLBOOL\nList_GetIndexOf( const PtrList *this, const void * item, size_t * index )\n\n\tReturns TRUE and sets the index argument to the first item in the\n\tlist with pointer identical to 'item', if such an item exists;\n\totherwise returns FALSE.\n\tNote: is inverse of Item(), if pointers in list are unique.\n\nvoid\nList_SortAccordingTo( PtrList * list, ListSortComparison comparison )\n\n\tBased on the comparison of any two items provided by the comparison \n\tfunction argument, sorts the list.\n\nvoid *\nList_FirstItemSuchThat( const PtrList *list, ListCondition condition )\n\n\tTakes a ListCondition function, returns the pointer value that \n\tsatisfies the condition, otherwise returns NULL,\n\nPLBOOL\nList_FindFirstIndexSuchThat( const PtrList *list, ListCondition condition,\n\t\t\t\t\tsize_t * index )\n\tTakes a ListCondition function, sets the index pointer to the index\n\tof the first pointer in the list that satisfies condition.\n\tOtherwise returns FALSE.\n\nvoid\nList_FreeItemsInListAndEmpty( PtrList * this )\n\n\tLists don't usually delete the things they refer to.\n\tThis function takes the list and uses it to free the listed items.\n",
"IO.c": " /*@@\n @file IO.c\n @date Sun Sep 17 16:19:17 2000\n @author Tom Goodale\n @desc\n Stuff for displaying IO callbacks on the web page.\n @enddesc\n @version $Id$\n @@*/\n\n#include <stdlib.h>\n\n#include \"cctk.h\"\n#include \"cctk_Parameters.h\"\n#include <stdlib.h>\n#include <fcntl.h>\n#ifdef HAVE_UNISTD_H\n#include <unistd.h>\n#endif\n\n#include \"CactusBase/IOUtil/src/ioutil_AdvertisedFiles.h\"\n\n#include \"http_Content.h\"\n\n#include \"HTTPD_FileList.h\"\n\n/* SW Temporary, while testing the SString module */\n#include \"CactusConnect/HTTPD/src/SString_Namespace.h\"\n\nstatic const char *rcsid = \"$Header$\";\n\nCCTK_FILEVERSION(CactusConnect_HTTPDExtra_IO_c);\n\n/********************************************************************\n ******************** Macro Definitions ************************\n ********************************************************************/\n#ifndef O_BINARY\n#define O_BINARY 0\n#endif\n\n/********************************************************************\n ********************* Internal Typedefs **********************\n ********************************************************************/\n\n/********************************************************************\n ******************** Internal Routines ************************\n ********************************************************************/\nstatic int IOFileListener(const cGH *GH, const char *filename,\n const ioAdvertisedFileDesc *description);\nstatic int AdvertisedFilePage(const cGH *GH, httpRequest *request, void *data);\nstatic int ViewportFilePage(const cGH *GH, httpRequest *request, void *data);\nstatic int SendFilePage(const cGH *GH, httpRequest *request, void *data);\n\n\n/********************************************************************\n ******************** External Routines ************************\n ********************************************************************/\nint HTTP_util_RegisterIOPages(void);\n\n\n/********************************************************************\n ********************* Local Data *****************************\n ********************************************************************/\nstatic FileList *filelist = NULL;\n\n /*@@\n @routine HTTP_util_RegisterIOPages\n @date Wed Sep 14 11:29:43 2000\n @author Gabrielle Allen\n @desc\n Registers HTTPDExtra's Output and ViewPort page.\n @enddesc\n @calls IOUtil_RegisterAdvertisedFileListener\n HTTP_RegisterPage\n HTTP_ContentLink\n\n @returntype int\n @returndesc\n 0 for success\n @endreturndesc\n@@*/\nint HTTP_util_RegisterIOPages(void)\n{\n ioAdvertisedFileListenerCallbacks listener;\n\n listener.advertise = IOFileListener;\n\n IOUtil_RegisterAdvertisedFileListener ( NULL, CCTK_THORNSTRING,\n &listener);\n\n HTTP_RegisterPage( \"/Output/index.html\", AdvertisedFilePage, NULL);\n HTTP_RegisterPage( \"/Output/viewport.html\", ViewportFilePage, NULL);\n\n HTTP_ContentLink( \"/Output/index.html\", \"Files\",\n \"Downloadable files\",\n HTTP_QUICKLINK);\n HTTP_ContentLink( \"/Output/viewport.html\", \"Viewport\",\n \"Viewport for certain output files\",\n HTTP_QUICKLINK);\n\n HTTP_RegisterPage( \"/Output\", SendFilePage, NULL);\n\n return 0;\n}\n\n\n/********************************************************************\n ******************** Internal Routines ************************\n ********************************************************************/\n /*@@\n @routine HTTP_util_ExistingFileEntry\n @date Wed Oct 07 12:49:02 2009\n @author Frank Loeffler\n @desc\n Returns the pointer to an entry with the given\n filename set or NULL if nothing was found.\n @enddesc\n@@*/\nstatic httpFileItem * HTTP_util_ExistingFileEntry(FileList *filelist,\n const char *filename)\n{\n if ( !filelist )\n return NULL;\n\n /* Look for an entry with this filename */\n const size_t n = NumberOfFiles( filelist );\n size_t i;\n httpFileItem *item;\n for (i = 0; i < n; i++)\n {\n item = HTTPD_FileList_Item(filelist, i);\n /* When entry found, return its pointer */\n if (!StringCompareCString(item->filename, filename))\n {\n return item;\n }\n }\n return NULL;\n}\n\n/*@@\n @routine IOFileListener\n @date Sun Sep 17 17:56:22 2000\n @author Tom Goodale\n @desc\n Listener for advertised files.\n @enddesc\n@@*/\nstatic int IOFileListener(const cGH *GH, const char *filename,\n const ioAdvertisedFileDesc *description)\n{\n size_t position = 0;\n (void) (GH + 0); /* avoid compiler warning about unused parameter */\n\n if( !filelist )\n filelist = HTTPD_FileList_New();\n httpFileItem *entry = HTTP_util_ExistingFileEntry(filelist, filename);\n /* If there is already an entry, we cannot change it directly (const).\n We _could_ remove it and insert a new entry, but that would probably\n be too expensive. So we do nothing and assume nothing changed\n anyway in the entry */\n if (entry)\n {\n return 0;\n }\n entry = (httpFileItem *)malloc(sizeof( httpFileItem));\n if (entry)\n {\n entry->filename = String_Make( filename);\n entry->thorn = String_Make( description->thorn);\n entry->varname = String_Make( description->varname);\n entry->mimetype = String_Make( description->mimetype);\n entry->slice = String_Make( description->slice);\n entry->description = String_Make( description->description);\n String *linknameString = String_Make( filename);\n entry->linkname = linknameString;\n /* Need to mangle the filename to get a decent linkname */\n while( FindCharFrom( linknameString, '/', &position ) )\n SetNthChar( linknameString, position, '@');\n AppendFile( filelist, entry );\n }\n return 0;\n}\n\nstatic void\nIndentAndConcatCString( String *message, const char *c, int depth )\n{\n int i;\n for ( i = 0; i < depth; i++ )\n ConcatCString( message, \"\\t\" );\n ConcatCString( message, c );\n}\n/*\n * SW\n * Build a HTML representation of the contents of filelist.\n * Denis wanted variable name on the topmost level.\n * This is about third iteration. Here, use tables to get nesting effect.\n */\nstatic size_t\nbuildList( const FileList *list, String * message, size_t itemNo, int depth )\n{\n const size_t n = NumberOfFiles( filelist );\n size_t i = 0;\n httpFileItem *lastItem = FileItem( filelist, itemNo );\n\n for ( i = itemNo; i < n; i++ )\n {\n httpFileItem *file = FileItem( filelist, i );\n if( depth == 0 )\n {\n IndentAndConcatCString( message, \"<tr>\", depth );\n ConcatCString( message, \"<td colspan=\\\"5\\\" class=\\\"variable\\\">\" );\n Concat( message, file->varname );\n ConcatCString( message, \"&nbsp;\" );\n IndentAndConcatCString( message, \"</td></tr>\\n\", depth );\n i = buildList( list, message, i, 1 );\n }\n if( depth == 1 )\n {\n if( Equals( file->varname, lastItem->varname ) )\n {\n IndentAndConcatCString( message, \"<tr>\", depth );\n ConcatCString( message, \"<td class=\\\"spacer\\\">&nbsp;</td>\"\n \"<td class=\\\"thorn\\\" colspan=\\\"4\\\">\" );\n Concat( message, file->thorn );\n IndentAndConcatCString( message, \"</td></tr>\\n\", depth );\n i = buildList( list, message, i, 2 );\n }\n else\n break;\n }\n if( depth == 2 )\n {\n if( Equals( file->thorn, lastItem->thorn )\n && Equals( file->varname, lastItem->varname ) )\n {\n IndentAndConcatCString( message, \"<tr>\", depth );\n ConcatCString( message, \"<td class=\\\"spacer\\\">&nbsp;</td>\"\n \"<td class=\\\"spacer\\\">&nbsp;</td>\\n\"\n \"<td class=\\\"slice\\\">\" );\n Concat( message, file->slice );\n\n ConcatCString( message, \"\\n\" );\n IndentAndConcatCString( message, \"</td><td class=\\\"link\\\">\\n\", depth );\n IndentAndConcatCString( message, \"<a href=\\\"/Output/\", depth );\n Concat( message, file->linkname );\n ConcatCString( message, \"\\\">\" );\n Concat( message, file->filename );\n ConcatCString( message, \"</a>\\n\" );\n IndentAndConcatCString( message, \"</td><td class=\\\"desc\\\">\\n\", depth );\n IndentAndConcatCString( message, \"\", depth );\n Concat( message, file->description );\n ConcatCString( message, \"\\n\" );\n IndentAndConcatCString( message, \"</td></tr>\\n\", depth );\n }\n else\n break;\n }\n }\n ConcatCString( message, \"\\n\" );\n return i - 1;\n}\n\n /*@@\n @routine AdvertisedFilePage\n @date Sun Sep 17 18:26:01 2000\n @author Tom Goodale\n @desc\n Page to deal with advertised files.\n @enddesc\n@@*/\nstatic int AdvertisedFilePage(const cGH *GH, httpRequest *request, void *data)\n{\n int retval = 0;\n String *message = String_New();\n\n data = data; /* avoid compiler warning about unused parameter */\n\n HTTP_SendOKHeader( request );\n\n HTTP_SetDoctype( message );\n HTTP_SendString( request, message);\n\n HTTP_Send( request, \"<html><head>\\n\" );\n HTTP_Send( request, \"<title>Cactus Downloadable Files</title>\\n\");\n\n HTTP_SetHeadInfo( message);\n HTTP_Send( request, \"<style type=\\\"text/css\\\">\"\n \"\\t.files td { text-align: left; font-family: sans-serif;\\n\"\n \"\\t padding-left: 1ex; padding-right: 1ex; }\\n\"\n \"\\t.files td.variable { background-color: #ff9;\\n\"\n \"\\t font-weight: bold; }\\n\"\n \"\\t.files td.thorn { background-color: #dff;\\n\"\n \"\\t color: black; }\\n\"\n \"\\t.files td.slice { background-color: #fde;\\n\"\n \"\\t font-family: monospace; }\\n\"\n \"\\t.files td.link { \\n\"\n \" }\\n\"\n \"\\t.files td.desc { background-color: #dff;\\n\"\n \"\\t font-style: italic; }\\n\"\n \"\\t#filescaption { border-bottom: thin black solid;\\n\"\n \"\\t margin-bottom: 1em; }\\n\"\n \"\\t</style>\\n\");\n HTTP_SendString( request, message );\n \n HTTP_Send( request, \"</head>\\n<body>\\n\");\n\n HTTP_SetContentHeaderString( GH, 0, message, NULL);\n HTTP_SendString( request, message);\n\n HTTP_Send( request, \"<h1>Downloadable Files</h1>\\n\");\n\n HTTP_Send( request,\n \"<p>From this page you can download various output files \\n\"\n \"from the simulation. Depending on the software available on your\\n\"\n \" local machine, you can change the browser properties to launch\\n\"\n \" files directly to visualization clients.</p> \\n \"\n \"<p>Some of these output files can be directly viewed on \\n\"\n \"a browser on the simulation \\n\"\n \"<a href=\\\"/Output/viewport.html\\\">viewport</a></p>\\n\"\n \"<p>Many IO methods have <dfn>steerable</dfn> parameters which \\n\"\n \"allow you to e.g. add fields and customise behaviour.\\n\"\n \"Depending on your authorisation, you can access the \\n\"\n \"<a href=\\\"/Parameters/index.html\\\">parameter steering page</a>\"\n \"</p>\\n\");\n HTTP_Send( request,\n \"<div class=\\\"centered\\\">\\n\"\n \"<table class=\\\"files\\\" id=\\\"filescaption\\\" \"\n \"frame=\\\"below\\\" cellpadding=\\\"0\\\" cellspacing=\\\"0\\\">\\n\"\n \"<tr><td class=\\\"variable\\\">\\n\"\n \"Variable</td><td class=\\\"thorn\\\">Thorn</td>\\n\"\n \"<td class=\\\"slice\\\"> Slice</td><td class=\\\"file\\\"> File</td>\\n\"\n \"<td class=\\\"desc\\\"> Description</td></tr>\\n</table>\\n\"\n \"\\n\"\n );\n\n Truncate( message, 0 );\n SortFilesAccordingTo( filelist, Variable_Thorn_Slice );\n\n HTTP_Send( request, \"<table cellpadding=\\\"0\\\" cellspacing=\\\"0\\\"\"\n \" class=\\\"files\\\">\\n\");\n buildList( filelist, message, 0, 0 );\n\n HTTP_SendString( request, message);\n HTTP_Send( request, \"\\n</table>\");\n HTTP_Send( request, \"\\n</div>\");\n\n HTTP_SetContentFooterString( GH, 0, message);\n retval = HTTP_SendString( request, message);\n\n String_Delete( message );\n return retval;\n}\n\n /*@@\n @routine SendFilePage\n @date Sun Sep 17 18:43:40 2000\n @author Tom Goodale\n @desc\n Sends an advertised file.\n @enddesc\n@@*/\n\nstatic int SendFilePage( const cGH *GH, httpRequest *request, void *data)\n{\n int found = 0;\n\n const size_t n = NumberOfFiles( filelist );\n size_t i;\n /* avoid compiler warning about unused parameters */\n (void) (GH + 0);\n data = data;\n\n for( i = 0; i < n; i++ )\n {\n httpFileItem *file = FileItem( filelist, i );\n\n if( !CompareCString( file->linkname, HTTP_Residual( request ) ))\n {\n int filedes = open( GetBuffer( file->filename), O_RDONLY | O_BINARY);\n if(filedes >= 0)\n {\n HTTP_Send( request, \"HTTP/1.0 200 OK\\r\\n\");\n\n HTTP_Send( request, \"Content-Type: \" );\n HTTP_SendString( request, file->mimetype);\n HTTP_Send( request, \"\\r\\n\\r\\n\" );\n\n HTTP_ContentSendFromFile( request, filedes);\n\n close( filedes);\n found = 1;\n }\n else\n {\n HTTP_Send( request,\"HTTP/1.0 500 Server Internal Error\\r\\n\");\n\n HTTP_Send( request, \"Content-Type: text/html\\r\\n\\r\\n\");\n HTTP_Send( request, \"<html>\\n<head>\\n\");\n HTTP_Send( request, \"<title>Error 500: Internal Error</title>\\n\");\n HTTP_Send( request, \"</head>\\n<body>\\n\");\n HTTP_Send( request, \"<div class=\\\"centered\\\"><p>Unable to open \" );\n HTTP_SendString( request, file->filename );\n HTTP_Send( request, \"</p></div>\\n\");\n HTTP_Send( request, \"</body>\\n</html>\\n\" );\n }\n break;\n }\n }\n\n if(!found)\n {\n HTTP_Send( request,\"HTTP/1.0 404 Not Found\\r\\n\");\n\n HTTP_Send( request,\"Content-Type: text/html\\r\\n\\r\\n\");\n\n HTTP_Send( request, \"<html>\\n<head>\\n\" );\n HTTP_Send( request, \"<title>Error 404: Not Found</title>\\n\" );\n HTTP_Send( request, \"</head>\\n<body>\\n\" );\n HTTP_Send( request, \"<div class=\\\"centered\\\"><p>\" );\n HTTP_Send( request, HTTP_URI( request ) );\n HTTP_Send( request, \" does not exist</p></div>\\n\" );\n HTTP_Send( request, \"</body>\\n</html>\\n\" );\n }\n return 0;\n}\n\n /*@@\n @routine AdvertisedFilePage\n @date Sun Sep 17 18:26:01 2000\n @author Tom Goodale\n @desc\n Page to deal with advertised files.\n @enddesc\n@@*/\n\nstatic int ViewportFilePage(const cGH *GH, httpRequest *request, void *data)\n{\n DECLARE_CCTK_PARAMETERS\n\n int retval = 0;\n int foundone = 0;\n String *message = String_New();\n const size_t n = NumberOfFiles( filelist );\n size_t i;\n\n (void) (GH + 0);\n data = data; /* avoid compiler warning about unused parameters */\n\n HTTP_SendOKRefreshHeader( request, viewport_refresh_seconds );\n \n HTTP_SetDoctype( message );\n HTTP_SendString( request, message);\n \n HTTP_Send( request, \"<html>\\n<head>\\n\");\n HTTP_Send( request, \"<title>Cactus Downloadable Files</title>\\n\");\n\n HTTP_SetHeadInfo( message);\n\n HTTP_Send( request, \"<style type=\\\"text/css\\\">\"\n \".files td { text-align: center; vertical-align: middle;\"\n \" font-size: smaller; font-family: sans-serif; }\\n\"\n \".files .spacer { width: 10ex;\\n\"\n \" }\\n\"\n \".files .variable { background-color: #ff9;\\n\"\n \" font-weight: bold; }\\n\"\n \".files .thorn { background-color: #dff;\\n\"\n \" color: black; }\\n\"\n \".files .slice { background-color: #fde;\\n\"\n \" font-family: monospace; }\\n\"\n \".files .link { }\\n\"\n \".files .desc { font-style: italic;\\n\"\n \" background-color: #dff; }\\n\"\n \".files img { border: 0;\\n\"\n \" }\\n\"\n \"</style>\\n\");\n\n HTTP_SendString( request, message );\n\n HTTP_Send( request, \"</head>\\n<body>\\n\");\n\n HTTP_SetContentHeaderString( GH, 0, message, NULL);\n HTTP_SendString( request, message);\n\n HTTP_Send( request, \"<h1>Viewport</h1>\\n\");\n\n HTTP_Send( request, \n \"<p>This page displays certain types of the output files \\n\"\n \"from the <a href=\\\"/Output/index.html\\\">download</a> page \\n\"\n \"as images (currently only JPEGs [mime type image/jpeg]).</p>\\n\"\n \"<p>Many IO methods have <dfn>steerable</dfn> parameters which \\n\"\n \"allow you to e.g. add fields and customise behaviour.\\n\"\n \"Depending on your authorisation, you can access the \\n\"\n \"<a href=\\\"/Parameters/index.html\\\">parameter steering page</a></p>\\n\"\n \"<div class=\\\"centered\\\">\\n\");\n\n SortFilesAccordingTo( filelist, Variable_Thorn_Slice );\n\n for ( i = 0; i < n; i++ )\n {\n httpFileItem *file = FileItem( filelist, i );\n if ( !CompareCString( file->mimetype, \"image/jpeg\"))\n {\n if (!foundone)\n {\n HTTP_Send( request, \n \"<table class=\\\"files\\\" cellspacing=\\\"5\\\" cellpadding=\\\"5\\\" \"\n \"rules=\\\"groups\\\" >\\n\"\n \"<thead>\\n<tr><th>Variable<br />Slice</th>\"\n \"<th>Description</th><th>Image</th></tr>\\n</thead>\\n\");\n foundone = 1;\n }\n HTTP_Send( request, \"<tr>\\n\" );\n HTTP_Send( request, \"<td><span class=\\\"variable\\\">\" );\n HTTP_SendString( request, file->varname );\n HTTP_Send( request, \"</span><br />\\n\" );\n HTTP_Send( request, \"<span class=\\\"slice\\\">\" );\n HTTP_SendString( request, file->slice );\n HTTP_Send( request, \"</span>\" );\n HTTP_Send( request, \"</td>\\n\" );\n HTTP_Send( request, \"<td><span class=\\\"desc\\\">\" );\n HTTP_SendString( request, file->description );\n HTTP_Send( request, \"</span></td>\\n\" );\n HTTP_Send( request, \"<td class=\\\"linkk\\\"><a href=\\\"/Output/\" );\n HTTP_SendString( request, file->linkname );\n HTTP_Send( request, \"\\\">\" );\n HTTP_Send( request, \"<img width=\\\"100\\\" height=\\\"100\\\" src=\\\"\" );\n HTTP_SendString( request, file->linkname );\n HTTP_Send( request, \"\\\" alt=\\\"\" );\n HTTP_SendString( request, file->linkname );\n HTTP_Send( request, \"\\\"/>\" );\n HTTP_Send( request, \"</a></td>\\n\" );\n HTTP_Send( request, \"</tr>\\n\" );\n }\n }\n\n if( foundone)\n HTTP_Send( request, \"</table>\\n\");\n else\n {\n HTTP_Send( request, \"<strong>\\n<p>No viewable images registered!</p>\\n\"\n \"</strong>\\n\");\n }\n\n HTTP_Send( request, \"</div>\\n\");\n\n HTTP_SetContentFooterString( GH, 0, message);\n retval = HTTP_SendString( request, message);\n\n String_Delete( message );\n\n return retval;\n}\n\n",
"HTTPD_FileList.h": "#ifndef _HTTPDFILELIST_H_\n#define _HTTPDFILELIST_H_ 1\n\n/* SW temporary explicit paths while testing SString module */\n#include \"CactusConnect/HTTPD/src/SString.h\"\n#include \"CactusConnect/HTTPD/src/SString_Namespace.h\"\n\ntypedef struct httpFileItem_tag\n{\n const String *thorn;\n const String *varname;\n const String *mimetype;\n const String *slice;\n const String *description;\n const String *filename;\n const String *linkname;\n} httpFileItem;\n\ntypedef enum {FLFALSE, FLTRUE} FLBOOL;\n\n/* a wrapper module around PtrList for type safety */\n\ntypedef struct PtrList_tag FileList;\n\n#ifdef __cplusplus\nextern \"C\"\n{\n#endif\n\nsize_t HTTPD_FileList_NumberOfItems( const FileList * );\nFileList * HTTPD_FileList_New( void );\nvoid HTTPD_FileList_Delete( FileList * );\n\nvoid HTTPD_FileList_FreeItemsInListAndEmpty( FileList * );\nvoid HTTPD_FileList_Append( FileList *, httpFileItem * item );\nhttpFileItem * HTTPD_FileList_Item( const FileList *, size_t index );\n\ntypedef int (*HTTPD_FileListSortComparison)( const httpFileItem *,\n const httpFileItem * );\nint HTTPD_FileListCompare_Var_Thorn_Slice( const httpFileItem *,\n const httpFileItem * );\n\nvoid HTTPD_FileList_SortAccordingTo( FileList *, HTTPD_FileListSortComparison comparison );\n\n#ifdef __cplusplus\n}\n#endif\n\n\n#define NumberOfFiles( a ) \\\n HTTPD_FileList_NumberOfItems( a )\n#define FileItem( a, b ) \\\n HTTPD_FileList_Item( a, b )\n#define AppendFile( a, b ) \\\n HTTPD_FileList_Append( a, b )\n#define SortFilesAccordingTo( a, b ) \\\n HTTPD_FileList_SortAccordingTo( a, b )\n#define FreeFileItemsInListAndEmpty( a ) \\\n HTTPD_FileList_FreeItemsInListAndEmpty( a )\n#define Variable_Thorn_Slice \\\n HTTPD_FileListCompare_Var_Thorn_Slice\n#endif\n",
"TimerInfo.c": " /*@@\n @file TimerInfo.c\n @date Wed Dec 16 2004\n @author Andre Werthmann\n @desc\n Pages about CCTK timers\n @enddesc\n @version $Header$\n @@*/\n\n#include \"cctk.h\"\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\n#include \"util_String.h\"\n\n#include \"httpextra_HostNames.h\"\n#include \"http_Content.h\"\n\n/* SW Temporary, while testing the SString module*/\n#include \"CactusConnect/HTTPD/src/SString.h\"\n#include \"CactusConnect/HTTPD/src/SString_Namespace.h\"\n\nstatic const char *rcsid = \"$Header$\";\n\nCCTK_FILEVERSION(CactusConnect_HTTPDExtra_TimerInfo_c)\n\n/********************************************************************\n ********************* Local Data Types ***********************\n ********************************************************************/\n\n#define DECBUFSIZE 64\n#define NUMTIMERTYPES 19\n/* static field with all know schedule bin names */\nstatic char* TI_ttypes[NUMTIMERTYPES] =\n{\n \"CCTK_STARTUP\",\n \"CCTK_WRAGH\",\n \"CCTK_PARAMCHECK\",\n \"CCTK_BASEGRID\",\n \"CCTK_INITIAL\",\n \"CCTK_POSTREGRID\",\n \"CCTK_POSTRESTRICTINITIAL\",\n \"CCTK_POSTINITIAL\",\n \"CCTK_POSTSTEP\",\n \"CCTK_RECOVER_VARIABLES\",\n \"CCTK_POST_RECOVER_VARIABLES\",\n \"CCTK_CPINITIAL\",\n \"CCTK_ANALYSIS\",\n \"CCTK_PRESTEP\",\n \"CCTK_EVOL\",\n \"CCTK_POSTRESTRICT\",\n \"CCTK_CHECKPOINT\",\n \"CCTK_TERMINATE\",\n \"CCTK_SHUTDOWN\"\n};\n/* actual number of not resolved schedule bin names */\nstatic int TI_nettypes=0;\n/* actual number of allocated entries in the field */\nstatic int TI_maxnettypes=0;\n/* dynamic field that holds the names of not resolved schedule bin names */\nstatic char** TI_ettypes=NULL;\n/* dynamic field that holds the values of clocks for timers for nicer html output later */\nstatic double** TI_oldtimes=NULL;\nstatic int TI_oldntimers=0;\nstatic int TI_oldnclocks=0;\n\n/********************************************************************\n ********************* Local Routine Prototypes *********************\n ********************************************************************/\n\nstatic int TimerInfoPage(const cGH *cctkGH, httpRequest *request, void *data);\n\n/* local list implementation, comments below */\nstatic void TI_initExtraTimerTypeField(void);\nstatic int TI_isElement(char* selem);\nstatic int TI_insertElement(char* selem);\nstatic void TI_deleteExtraTimerTypeField(void);\n\n/* helper functions, comments below */\nstatic int TI_isTimerType(const char* tName, char* tType);\nstatic char* TI_thornName(const char* tn);\nstatic char* TI_funcName(const char* tn);\nstatic char* TI_schedName(const char* tn);\n\n/********************************************************************\n ********************* Other Routine Prototypes *********************\n ********************************************************************/\n\n/********************************************************************\n ********************* Local Data *****************************\n ********************************************************************/\n\n/********************************************************************\n ********************* External Routines **********************\n ********************************************************************/\n\n /*@@\n @routine HTTPDExtra_RegisterTimerInfoPages\n @date Thu Dec 09 18:12:43 2004\n @author Andre Werthmann\n @desc\n Httpd utils registration routine.\n @enddesc\n@@*/\nint HTTPDExtra_RegisterTimerInfoPages(void);\nint HTTPDExtra_RegisterTimerInfoPages(void)\n{\n /* Register the group info page. */\n HTTP_RegisterPage(\"/TimerInfo\", TimerInfoPage, NULL);\n\n HTTP_ContentLink(\"/TimerInfo/index.html\", \"Timer Information\",\n \"CCTK Timer information\",\n HTTP_QUICKLINK);\n return 0;\n}\n\n/********************************************************************\n ********************* Local Routines *************************\n ********************************************************************/\n\n\n\n/******************************************************************************\n *************************** Groups Page **************************************\n ******************************************************************************/\n\n /*@@\n @routine TimerInfoPage\n @date Thu Dec 09 18:12:43 2004\n @author Andre Werthmann\n @desc\n Displays the cctk timer description page.\n @enddesc\n@@*/\nstatic int TimerInfoPage(const cGH *cctkGH, httpRequest *request, void *data)\n{\n int retval = 0;\n int ntimers = 0, nt = 0;\n int nclocks = 0, nc = 0;\n int i, j;\n char *sbuff;\n String *message = String_New();\n cTimerData *tdata;\n\n HTTP_SendOKHeader( request );\n\n HTTP_SetDoctype( message );\n HTTP_SendString(request, message);\n\n /* Start the page */\n HTTP_Send(request, \"<html>\\n<head>\\n\");\n HTTP_Send(request, \"<title>Cactus Simulation CCTK Timer Information</title>\\n\");\n\n HTTP_SetHeadInfo( message);\n HTTP_SendString(request, message );\n\n HTTP_Send(request, \"<style type=\\\"text/css\\\">\\n\");\n HTTP_Send(request, \" th, td { padding-left: 1em; padding-right: 1em; }\\n\");\n HTTP_Send(request, \" td.name { text-align: left; }\\n\");\n HTTP_Send(request, \" td.number { text-align: center; }\\n\");\n HTTP_Send(request, \"</style>\\n\");\n\n HTTP_Send(request, \"</head>\\n<body>\\n\");\n\n /* HTTP_Write out the header part. */\n HTTP_SetContentHeaderString(cctkGH, 0, message, NULL);\n retval = HTTP_SendString(request, message);\n\n HTTP_Send(request, \"<h1>CCTK Timer Information</h1>\\n\");\n\n HTTP_Send(request, \"<center>(changed values since last refresh are in bold characters)</center>\\n<br>\");\n\n /* init timer data */\n tdata=CCTK_TimerCreateData();\n ntimers = CCTK_NumTimers();\n nclocks = tdata->n_vals;\n\n /** init the timer clocks buffer\n * for every clock and every timer store an old value to\n * enhance html output of changed values\n * format is: TI_oldtimes[ClockNumber][TimerNumber]\n * memory is allocated dynamically if there are new timers and/or clocks\n * during computation\n */\n if (nclocks != TI_oldnclocks)\n {\n TI_oldtimes=realloc(TI_oldtimes, nclocks*sizeof(double*));\n for (i=TI_oldnclocks; i<nclocks; i++)\n {\n TI_oldtimes[i]=NULL;\n }\n TI_oldnclocks=nclocks;\n }\n if (ntimers != TI_oldntimers)\n {\n for (i=0; i<nclocks; i++)\n {\n TI_oldtimes[i]=realloc(TI_oldtimes[i], ntimers*sizeof(double));\n for (j=TI_oldntimers; j<ntimers; j++)\n {\n TI_oldtimes[i][j]=0.0;\n }\n }\n TI_oldntimers=ntimers;\n }\n\n /* start of first table */\n HTTP_Send(request, \"<h2>Timers which are associated with schedule bins</h2>\\n\");\n\n /* set table header */\n SetToCString(message, \"<div class=\\\"centered\\\">\\n<table frame=\\\"box\\\" rules=\\\"all\\\">\\n<tr>\");\n\n /* timer type - table header */\n ConcatCString(message, \"<th>Schedule Bin</th>\");\n\n /* thorn name - table header */\n ConcatCString(message, \"<th>Thorn Name</th>\");\n\n /* description name - table header */\n ConcatCString(message, \"<th>Description</th>\");\n\n /* clock names - table header */\n CCTK_TimerI(0, tdata);\n for (i=0; i<nclocks; i++)\n {\n /** assume every timer has the same number of clocks\n * take timer nr. 0 to build the table header\n */\n ConcatCString(message, \"<th>\");\n ConcatCString(message, tdata->vals[i].heading);\n ConcatCString(message, \" (\");\n ConcatCString(message, tdata->vals[i].units);\n ConcatCString(message, \")</th>\");\n }\n ConcatCString(message, \"</tr>\");\n HTTP_SendString(request, message);\n\n /* parse schedule bins */\n for (i=0; i<NUMTIMERTYPES; i++)\n {\n for (nt=0; nt<ntimers; nt++)\n {\n if (TI_isTimerType(CCTK_TimerName(nt), TI_ttypes[i]))\n {\n /* fill out timer info for timer number nr into tdata */\n CCTK_TimerI(nt, tdata);\n /* start table row */\n SetToCString(message, \"<tr>\\n\");\n\n /* timer type, first column */\n ConcatCString(message, \"<td class=\\\"type\\\">\\n\");\n sbuff=TI_schedName(TI_ttypes[i]);\n ConcatCString(message, sbuff);\n free(sbuff);\n ConcatCString(message, \"</td>\\n\");\n\n /* thorn name, second column */\n ConcatCString(message, \"<td class=\\\"name\\\">\");\n sbuff=TI_thornName(CCTK_TimerName(nt));\n ConcatCString(message, sbuff);\n free(sbuff);\n ConcatCString(message, \"</td>\\n\");\n\n /* description */\n ConcatCString(message, \"<td class=\\\"description\\\">\");\n sbuff=TI_funcName(CCTK_TimerName(nt));\n ConcatCString(message, sbuff);\n free(sbuff);\n ConcatCString(message, \"</td>\\n\");\n\n /* timer clocks, fourth... (fourth+number clocks) column */\n for (nc=0; nc<nclocks; nc++)\n {\n ConcatCString(message, \"<td class=\\\"\");\n ConcatCString(message, tdata->vals[nc].heading);\n ConcatCString(message, \"\\\">\");\n switch (tdata->vals[nc].type)\n {\n case val_int:\n ConcatDecimal(message, tdata->vals[nc].val.i);\n break;\n case val_long:\n ConcatDecimal(message, tdata->vals[nc].val.l);\n break;\n case val_double:\n /** if the new value is different from the old one\n * (changed) print it in bold characters\n */\n if ( TI_oldtimes[nc][nt] != tdata->vals[nc].val.d )\n {\n ConcatCString(message, \"<span style=\\\"font-weight:bold\\\">\");\n ConcatDouble(message, tdata->vals[nc].val.d);\n ConcatCString(message, \"</span>\");\n }\n else\n {\n ConcatDouble(message, tdata->vals[nc].val.d);\n }\n /* old value = new value */\n TI_oldtimes[nc][nt]=tdata->vals[nc].val.d;\n break;\n default:\n ConcatCString(message, \"unknown value type\");\n break;\n }\n ConcatCString(message, \"</td>\\n\");\n }\n /* end table row */\n ConcatCString(message, \"</tr>\\n\");\n HTTP_SendString(request, message);\n }\n }\n }\n retval = HTTP_Send(request, \"</table>\\n</div>\\n<br>\\n\");\n\n HTTP_Send(request, \"<h2>Timers which are associated with schedule groups</h2>\\n\");\n\n /* init the (char*) timer list of schedule bins which couldn't be associated */\n TI_initExtraTimerTypeField();\n\n /* start of second table */\n /* set table header */\n SetToCString(message, \"<div class=\\\"centered\\\">\\n<table frame=\\\"box\\\" rules=\\\"all\\\">\\n<tr>\");\n\n /* timer type - table header */\n ConcatCString(message, \"<th>Schedule Group</th>\");\n\n /* thorn name - table header */\n ConcatCString(message, \"<th>Thorn Name</th>\");\n\n /* description name - table header */\n ConcatCString(message, \"<th>Description</th>\");\n\n /* clock names - table header */\n CCTK_TimerI(0, tdata);\n for (i=0; i<nclocks; i++)\n {\n /** assume every timer has the same number of clocks\n * take timer nr. 0 to build the table header\n */\n ConcatCString(message, \"<th>\");\n ConcatCString(message, tdata->vals[i].heading);\n ConcatCString(message, \" (\");\n ConcatCString(message, tdata->vals[i].units);\n ConcatCString(message, \")</th>\");\n }\n ConcatCString(message, \"</tr>\");\n HTTP_SendString(request, message);\n\n /* second table content */\n for (i=0; i<TI_nettypes; i++)\n {\n for (nt=0; nt<ntimers; nt++)\n {\n if (TI_isTimerType(CCTK_TimerName(nt), TI_ettypes[i]))\n {\n /* fill out timer info for timer number nr into tdata */\n CCTK_TimerI(nt, tdata);\n /* start table row */\n SetToCString(message, \"<tr>\\n\");\n\n /* timer type, first column */\n ConcatCString(message, \"<td class=\\\"type\\\">\\n\");\n sbuff=TI_schedName(TI_ettypes[i]);\n ConcatCString(message, sbuff);\n free(sbuff);\n ConcatCString(message, \"</td>\\n\");\n\n /* thorn name, second column */\n ConcatCString(message, \"<td class=\\\"name\\\">\");\n sbuff=TI_thornName(CCTK_TimerName(nt));\n ConcatCString(message, sbuff);\n free(sbuff);\n ConcatCString(message, \"</td>\\n\");\n\n /* description */\n ConcatCString(message, \"<td class=\\\"description\\\">\");\n sbuff=TI_funcName(CCTK_TimerName(nt));\n ConcatCString(message, sbuff);\n free(sbuff);\n ConcatCString(message, \"</td>\\n\");\n\n /* timer clocks, fourth... (fourth+number clocks) column */\n for (nc=0; nc<nclocks; nc++)\n {\n ConcatCString(message, \"<td class=\\\"\");\n ConcatCString(message, tdata->vals[nc].heading);\n ConcatCString(message, \"\\\">\");\n\n switch (tdata->vals[nc].type)\n {\n case val_int:\n ConcatDecimal(message, tdata->vals[nc].val.i);\n break;\n case val_long:\n ConcatDecimal(message, tdata->vals[nc].val.l);\n break;\n case val_double:\n /** if the new value is different from the old one\n * (changed) print it in bold characters\n */\n if ( TI_oldtimes[nc][nt] != tdata->vals[nc].val.d )\n {\n ConcatCString(message, \"<span style=\\\"font-weight:bold\\\">\");\n ConcatDouble(message, tdata->vals[nc].val.d);\n ConcatCString(message, \"</span>\");\n }\n else\n {\n ConcatDouble(message, tdata->vals[nc].val.d);\n }\n /* old value = new value */\n TI_oldtimes[nc][nt]=tdata->vals[nc].val.d;\n\n break;\n default:\n ConcatCString(message, \"unknown value type\");\n break;\n }\n ConcatCString(message, \"</td>\\n\");\n }\n /* end table row */\n ConcatCString(message, \"</tr>\\n\");\n HTTP_SendString(request, message);\n }\n }\n }\n\n HTTP_Send(request, \"</table>\\n</div>\\n\");\n\n /* free the allocated memory for the extra timer names - list */\n TI_deleteExtraTimerTypeField();\n\n /* free timer structure memory */\n CCTK_TimerDestroyData(tdata);\n\n HTTP_SetContentFooterString(cctkGH, 0, message);\n retval = HTTP_SendString(request, message);\n\n String_Delete( message );\n\n return retval;\n}\n\n\n/* local list implementation - helper functions */\n\n/** init the local extra timer list, has to be called first\n * creates a list of all available extra timer types\n */\n/*@@\n @routine TI_initExtraTimerTypeField\n @date Thu Dec 09 18:12:43 2004\n @author Andre Werthmann\n @desc\n creates a list of all available extra timer types\n @enddesc\n @calls\n TI_isElement, TI_insertElement\n @calledby\n TimerInfoPage\n@@*/\nstatic void TI_initExtraTimerTypeField(void)\n{\n int i;\n int nt=CCTK_NumTimers();\n char* temp;\n int diff = strlen(\"in \");\n\n TI_nettypes=0;\n\n for (i=0; i<nt; i++)\n {\n temp=strstr(CCTK_TimerName(i), \"in \");\n if (temp)\n {\n if (!strstr(temp,\"CCTK_\"))\n {\n if (!TI_isElement(temp+diff))\n {\n /* do not insert a timer with no schedule bin name */\n if (strlen(temp+diff)>=2)\n {\n if (TI_insertElement(temp+diff))\n {\n /* should never happen, only if system is out of memory... */\n CCTK_WARN (0, \"out of memory !\");\n }\n }\n }\n }\n }\n }\n}\n\n/* checks if a element is member of the list */\n/*@@\n @routine TI_isElement\n @date Thu Dec 09 18:12:43 2004\n @author Andre Werthmann\n @desc\n checks if a element is member of the list\n @enddesc\n @calledby\n TI_initExtraTimerTypeField\n @@*/\nstatic int TI_isElement(char* selem)\n{\n int i;\n\n for (i=0; i<TI_nettypes; i++)\n {\n if (!strcmp(selem, TI_ettypes[i]))\n {\n return 1;\n }\n }\n return 0;\n}\n\n/* inserts a new element */\n/*@@\n @routine TI_insertElement\n @date Thu Dec 09 18:12:43 2004\n @author Andre Werthmann\n @desc\n inserts a new element\n @enddesc\n @calledby\n TI_initExtraTimerTypeField\n@@*/\nstatic int TI_insertElement(char* selem)\n{\n /* if the next insert would overflow the array, increase the array size by 30 elements */\n if ( TI_nettypes >= TI_maxnettypes )\n {\n TI_maxnettypes+=30;\n TI_ettypes=realloc(TI_ettypes, TI_maxnettypes*sizeof(char*));\n }\n /* out of memory ? */\n if (TI_ettypes==NULL) return 1;\n\n TI_ettypes[TI_nettypes]=(char*) strdup(selem);\n TI_nettypes++;\n return 0;\n}\n\n/* tests whether a timer is the timer type */\n/*@@\n @routine TI_isTimerType\n @date Thu Dec 09 18:12:43 2004\n @author Andre Werthmann\n @desc\n tests whether a timer is the timer type\n @enddesc\n @calledby\n TimerInfoPage\n@@*/\nstatic int TI_isTimerType(const char* tName, char* tType)\n{\n char* temp=strstr(tName, tType);\n if (temp)\n {\n return 1;\n }\n else\n {\n return 0;\n }\n}\n\n/* deletes all temporary allocated memory */\n/*@@\n @routine TI_deleteExtraTimerTypeField\n @date Thu Dec 09 18:12:43 2004\n @author Andre Werthmann\n @desc\n deletes all temporary allocated memory\n @enddesc\n @calledby\n TimerInfoPage\n@@*/\nstatic void TI_deleteExtraTimerTypeField(void)\n{\n int i;\n\n for (i=0; i<TI_nettypes; i++)\n {\n free(TI_ettypes[i]);\n }\n}\n\n/* returns the thornname of a given timername */\n/*@@\n @routine TI_thornName\n @date Thu Dec 09 18:12:43 2004\n @author Andre Werthmann\n @desc\n returns the thornname of a given timername\n @enddesc\n @calledby\n TimerInfoPage\n@@*/\nstatic char* TI_thornName(const char* tn)\n{\n int i;\n int sl=strlen(tn)+1;\n char* temp=(char*) malloc(sl);\n\n /* cut '[xxxx]' and break before the ':' */\n for (i=7; i<sl; i++)\n {\n if (tn[i]==':') break;\n temp[i-7]=tn[i];\n }\n temp[i-7]='\\0';\n\n return temp;\n}\n\n/* returns the functionname of a given timername */\n/*@@\n @routine TI_funcName\n @date Thu Dec 09 18:12:43 2004\n @author Andre Werthmann\n @desc\n returns the functionname of a given timername\n @enddesc\n @calledby\n TimerInfoPage\n@@*/\nstatic char* TI_funcName(const char* tn)\n{\n int i;\n int sl=strlen(tn)+1;\n char* ps=(char*) malloc(sl);\n int diff=0;\n char* temp=(char*) malloc(sl);\n\n /* break after the ':' and return pos after ': ' */\n for (i=0; i<sl; i++)\n {\n if (tn[i]==':') break;\n }\n i+=2;\n if (i>sl-1)\n {\n free (ps);\n free (temp);\n return strdup(\"malformed timer name\");\n }\n\n strncpy(temp, tn+i, sl-i);\n temp[sl-i]='\\0';\n\n /* cut schedule bin, sometimes doesn't have a leading 'CCTK_' */\n /*if (strstr(temp, \" in CCTK_\"))*/\n if (strstr(temp, \" in \"))\n {\n /*diff = strstr(temp, \" in CCTK_\")-temp;*/\n diff = strstr(temp, \" in \")-temp;\n strncpy(ps, temp, diff);\n ps[diff]='\\0';\n }\n else\n {\n free (ps);\n free (temp);\n return strdup(\"no schedule bin\");\n }\n\n free(temp);\n\n return ps;\n}\n\n/* returns schedule bin name without leading 'CCTK_' */\n/*@@\n @routine TI_schedName\n @date Thu Dec 09 18:12:43 2004\n @author Andre Werthmann\n @desc\n returns schedule bin name without leading 'CCTK_'\n @enddesc\n @calledby\n TimerInfoPage\n@@*/\nstatic char* TI_schedName(const char* tn)\n{\n int sl=strlen(tn)+1;\n int diff=strlen(\"CCTK_\");\n char* temp=(char*) malloc(sl);\n\n /* if the timername does not have a leading 'CCTK_', just copy the name */\n if (strstr(tn, \"CCTK_\"))\n {\n /* cut 'CCTK_' */\n strncpy(temp, tn+diff, sl-diff);\n temp[sl-diff]='\\0';\n }\n else\n {\n strncpy(temp, tn, sl);\n }\n\n return temp;\n}\n",
"PtrList.h": "#ifndef __PTRLIST_HH__\n#define __PTRLIST_HH__\n\n#include <stddef.h>\n\ntypedef enum { PLFALSE, PLTRUE } PLBOOL;\n\ntypedef struct PtrList_tag PtrList;\n\n#ifdef __cplusplus\nextern \"C\"\n{\n#endif\n /* Creation and deletion */\nPtrList * List_New( void );\nPtrList * List_NewWithPageSize( size_t pagesize );\nPtrList * List_MakeCopy( const PtrList * other );\nvoid List_Delete( PtrList * );\n /* Counts the items */\nsize_t List_NumberOfItems( const PtrList * );\n /* Item accessors */\nvoid * List_Item( const PtrList *, size_t index );\nvoid List_SetItem( PtrList *, size_t index, void * ptr );\n /* List manipulation */\nvoid List_Append( PtrList *, void * item );\nvoid List_Insert( PtrList *, size_t index, void * item );\nvoid * List_RemoveItem( PtrList *, size_t index );\nvoid List_SwapItems( PtrList *, size_t a_index, size_t b_index );\n /* Actions on pointer of particular value */\nvoid List_Remove( PtrList *, void * item );\nPLBOOL List_GetIndexOf( const PtrList *, const void * item,\n size_t * index );\n /* Remove all items from list */\nvoid List_Empty( PtrList * list );\n /* Copy another list */\nvoid List_CopyList( PtrList * list, const PtrList * other );\n /* Special freeing utility */\nvoid List_FreeItemsInListAndEmpty( PtrList * );\n /* Sort and Search */\ntypedef int (*ListSortComparison)( const void *, const void * );\n\nvoid List_SortAccordingTo( PtrList *, ListSortComparison );\n\ntypedef PLBOOL (*ListCondition)( const void * );\n\nvoid * List_FirstItemSuchThat( const PtrList *, ListCondition );\nPLBOOL List_FindFirstIndexSuchThat( const PtrList *,\n ListCondition condition, size_t * index );\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n",
"HTTPD_FileList.c": "#include \"HTTPD_FileList.h\"\n#include \"PtrList.h\"\n\n/* wrapper functions to make PtrList type-safe for FileList items */\n\nsize_t\nHTTPD_FileList_NumberOfItems( const FileList * list )\n{\n return List_NumberOfItems( list );\n}\n\nFileList *\nHTTPD_FileList_New()\n{\n return (FileList *)List_New();\n}\n\nvoid\nHTTPD_FileList_Delete( FileList * list )\n{\n List_Delete( list );\n}\n\nvoid\nHTTPD_FileList_FreeItemsInListAndEmpty( FileList * list )\n{\n List_FreeItemsInListAndEmpty( list );\n}\n\nvoid\nHTTPD_FileList_Append( FileList * list, httpFileItem * item )\n{\n List_Append( list, item );\n}\n\nhttpFileItem *\nHTTPD_FileList_Item( const FileList * list, size_t index )\n{\n return List_Item( list, index );\n}\n\nvoid\nHTTPD_FileList_SortAccordingTo( FileList * list,\n HTTPD_FileListSortComparison comparison )\n{\n List_SortAccordingTo( list, (ListSortComparison)comparison );\n}\n\nint\nHTTPD_FileListCompare_Var_Thorn_Slice(\n const httpFileItem * a, const httpFileItem * b )\n{\n int order = Compare( a->varname, b->varname );\n if( order == 0 )\n {\n order = Compare( a->thorn, b->thorn );\n if( order == 0 )\n return Compare( a->slice, b->slice );\n else\n return order;\n }\n else\n return order;\n}\n",
"HostNames.c": " /*@@\n @file HostNames.c\n @date Tue Nov 7 17:36:35 2000\n @author Tom Goodale\n @desc \n Routines to collect data about all hosts in a Ccatus job.\n @enddesc \n @version $Header$\n @@*/\n\n#ifndef TEST_HOSTNAMES\n#include \"cctk.h\"\n#include \"util_Network.h\"\n#endif\n\n#include <stdlib.h>\n#include <string.h>\n\n#ifdef HAVE_UNISTD_H\n#include <unistd.h>\n#endif /* HAVE_UNISTD_H */\n#ifdef HAVE_SYS_TIME_H\n#include <sys/time.h>\n#endif /* HAVE_SYS_TIME_H */\n#ifdef HAVE_SYS_TYPES_H\n#include <sys/types.h>\n#endif /* HAVE_SYS_TYPES_H */\n#ifdef HAVE_SYS_SOCKET_H\n#include <sys/socket.h>\n#endif /* HAVE_SYS_SOCKET_H */\n#ifdef HAVE_NETINET_IN_H\n#include <netinet/in.h>\n#endif /* HAVE_NETINET_IN_H */\n#ifdef HAVE_NETDB_H\n#include <netdb.h>\n#endif /* HAVE_NETDB_H */\n#ifdef HAVE_WINSOCK2_H\n#include <winsock2.h>\n#endif /* HAVE_WINSOCK2_H */\n#include <errno.h>\n\n#ifdef CCTK_MPI\n#include \"mpi.h\"\n#endif /* CCTK_MPI */\n\n#include \"httpextra_HostNames.h\"\n\nstatic const char *rcsid = \"$Header$\";\n\nCCTK_FILEVERSION(CactusConnect_HTTPDExtra_HostNames_c)\n\n/********************************************************************\n ********************* Local Data Types ***********************\n ********************************************************************/\n\n#define HOSTDATALENGTH 255\n\n/********************************************************************\n ********************* Local Routine Prototypes *********************\n ********************************************************************/\n\n/********************************************************************\n ********************* Other Routine Prototypes *********************\n ********************************************************************/\n\n/********************************************************************\n ********************* Local Data *****************************\n ********************************************************************/\n\nchar *hostdata = NULL;\n\n/********************************************************************\n ********************* External Routines **********************\n ********************************************************************/\n\n /*@@\n @routine HTTPDExtra_CollateHostData\n @date Tue Nov 7 18:10:01 2000\n @author Tom Goodale\n @desc \n Gets data about all hosts in the parallel job.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nvoid HTTPDExtra_CollateHostData(void)\n{\n int rank = 0;\n int nprocs = 1;\n char thisdata[HOSTDATALENGTH+1];\n\n Util_GetHostName(thisdata, HOSTDATALENGTH);\n\n thisdata[HOSTDATALENGTH] = 0;\n\n#ifdef CCTK_MPI\n /* Work out how many processes there are. */\n MPI_Comm_size(MPI_COMM_WORLD, &nprocs);\n /* Work out if this is proc 0 or not. */\n MPI_Comm_rank(MPI_COMM_WORLD, &rank);\n#endif\n \n if(rank == 0)\n {\n hostdata=(char *)malloc((HOSTDATALENGTH+1)*nprocs);\n \n if(!hostdata)\n {\n CCTK_WARN(0, \"Could not allocate memory\");\n }\n }\n \n#ifdef CCTK_MPI\n MPI_Gather(thisdata, HOSTDATALENGTH+1, MPI_BYTE, \n hostdata, HOSTDATALENGTH+1, MPI_BYTE,\n 0, MPI_COMM_WORLD);\n#else\n strncpy(hostdata, thisdata, HOSTDATALENGTH);\n#endif\n\n}\n \n /*@@\n @routine HTTPDExtra_RemoteHostData\n @date Tue Nov 7 18:10:38 2000\n @author Tom Goodale\n @desc \n Gets name of a remote host indexed by host process number.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nconst char *HTTPDExtra_RemoteHostName(int host)\n{\n return hostdata+host*(HOSTDATALENGTH+1);\n}\n\n/********************************************************************\n ********************* Local Routines *************************\n ********************************************************************/\n\n#ifdef TEST_HOSTNAMES\n\nint main(int argc, char *argv[])\n{\n int rank = 0;\n int nprocs = 1;\n\n#ifdef CCTK_MPI\n MPI_Init(&argc, &argv);\n\n /* Work out how many processes there are. */\n MPI_Comm_size(MPI_COMM_WORLD, &nprocs);\n \n /* Work out if this is proc 0 or not. */\n MPI_Comm_rank(MPI_COMM_WORLD, &rank);\n#endif\n\n HTTPDExtra_CollateHostData();\n\n if(rank == 0)\n {\n for(rank = 0; rank < nprocs; rank++)\n {\n printf(\"Host %d is %s\\n\", rank, HTTPDExtra_RemoteHostName(rank));\n }\n }\n\n#ifdef CCTK_MPI\n MPI_Finalize();\n#endif\n\n return 0;\n}\n\n#endif /* TESTHOSTNAMES */\n",
"PtrList.c": "#include \"PtrList.h\"\n#include <stdlib.h>\n#include <memory.h>\n\n#ifdef macintosh\n#include <string.h>\n#endif\n\n#define ITEMSONFULLPAGE 62\n#define TAKEDEFAULTSIZE 0\n#define MIN(a,b) (a<b?a:b)\n\ntypedef struct ListPage_tag ListPage;\n\ntypedef struct PtrList_tag\n{\n ListPage *firstPage;\n size_t itemsPerPage;\n} PtrList_PLACEHOLDER;\n\n/* ===========================================================================\n * ____________________________ ListPage _____________________________________\n * For efficiency, the pointers in the list are arranged into blocks,\n * called ListPage's.\n * ======================================================================== */\n\ntypedef struct ListPage_tag\n{\n size_t numberOfItems;\n size_t maxItems;\n ListPage * next;\n void * *items;\n} ListPage_PLACEHOLDER;\n\nstatic ListPage *\nListPage_New( size_t maxItems )\n{\n ListPage *new = (ListPage *)calloc( 1, sizeof( ListPage ) );\n if( new )\n {\n new->items = malloc( maxItems * sizeof( void * ) );\n new->maxItems = maxItems;\n }\n return new;\n}\n\n#define ListPage_IsFull( page ) \\\n ( ((const ListPage *)page)->numberOfItems >= page->maxItems )\n\n\nstatic ListPage *\nListPage_Dup( const ListPage * other );\n\nstatic void *\nListPage_Append( ListPage * this, void * item );\n\nstatic void *\nListPage_RemoveItem( ListPage * this, size_t index );\n\nstatic void *\nListPage_InsertItem( ListPage * this, size_t index, void * item );\n\n /* ListPage_Dup does not copy the next pointer */\nListPage *\nListPage_Dup( const ListPage * other )\n{\n ListPage * this = ListPage_New( other->maxItems );\n if( other->numberOfItems > 0 )\n memcpy( this->items, other->items,\n other->numberOfItems * sizeof( void * ) );\n\n this->maxItems = other->maxItems;\n this->numberOfItems = other->numberOfItems;\n\n return this;\n}\n\n /* Returns the input pointer if it doesn't fit on page \n * (for similarity with InsertItem) */\nvoid *\nListPage_Append( ListPage *this, void * item )\n{\n if( this->numberOfItems < this->maxItems ) /* If page not full */\n {\n *( this->items + this->numberOfItems ) = item; /* item to end*/\n this->numberOfItems++; /* Update number of items on page */\n return NULL;\n }\n return item;\n}\n\n /* Returns a pointer to the item removed, or NULL if no item found */\nvoid *\nListPage_RemoveItem( ListPage *this, size_t index )\n{\n if( index < this->numberOfItems )\n {\n const size_t lastItemToShift = this->numberOfItems - 1;\n size_t i;\n void *item = *( this->items + index );\n\n this->numberOfItems--;\n\n for( i = index; i < lastItemToShift; i++ )\n *( this->items + i ) = *( this->items + i + 1 );\n\n return item;\n }\n return NULL;\n}\n\n /* Returns a pointer to any item bumped off the page due to\n * the page being full. (could be the input item) */\nvoid *\nListPage_InsertItem( ListPage *this, size_t index, void * item )\n{\n void * remainder = NULL;\n\n if( index < this->numberOfItems )\n {\n const size_t firstItemToShift = this->numberOfItems - 1;\n size_t i;\n\n if( this->numberOfItems >= this->maxItems )\n remainder = *( this->items + firstItemToShift );\n\n this->numberOfItems = MIN( this->numberOfItems + 1,\n this->maxItems );\n\n for( i = firstItemToShift; i > index; i-- )\n *( this->items + i ) = *( this->items + i - 1 );\n\n *( this->items + index ) = item;\n }\n else\n remainder = ListPage_Append( this, item );\n\n return remainder;\n}\n\n/* ===========================================================================\n ______________________________ PtrList functions _________________________\n\n ======================================================================== */\n\nstatic void\nList_HandleAddressingError(void)\n{\n /* To taste */\n}\n\nstatic ListPage * List_Xerox( const PtrList *other);\nstatic void List_FindItemAddress( const PtrList *this, size_t itemNo,\n ListPage ** thePage, size_t *thePageIndex );\n\n /*_____________________________________________________________________\n **Constructor & Destructor**__________________________________________\n *_____________________________________________________________________\n */\n\nPtrList *\nList_New( void )\n{\n return List_NewWithPageSize( TAKEDEFAULTSIZE );\n}\n\nPtrList *\nList_NewWithPageSize( size_t itemsOnFullPage )\n{\n PtrList *new = (PtrList *)calloc( 1, sizeof( PtrList ) );\n if( new )\n {\n if( itemsOnFullPage == TAKEDEFAULTSIZE )\n new->itemsPerPage = ITEMSONFULLPAGE;\n else\n new->itemsPerPage = itemsOnFullPage;\n }\n return new;\n}\n\nPtrList *\nList_MakeCopy( const PtrList *other )\n{\n PtrList *this = (PtrList *)calloc( 1, sizeof( PtrList ) );\n this->itemsPerPage = other->itemsPerPage;\n this->firstPage = List_Xerox( other );\n return this;\n}\n\nvoid\nList_Delete( PtrList *list )\n{\n List_Empty( list );\n free( list );\n}\n\n /*_____________________________________________________________________\n **Empty**____________________________________________________________\n * Runs through the list of ListPages deleting the (previous) page.\n *_____________________________________________________________________\n */\nvoid\nList_Empty( PtrList * this )\n{\n if( this->firstPage != NULL )\n {\n ListPage *prevPage = this->firstPage,\n *startPage = this->firstPage->next;\n ListPage *page;\n\n this->firstPage = NULL; /* Prefer to do this first,\n so list is consistent */\n for( page = startPage; page != NULL; page = page->next )\n {\n free( prevPage );\n prevPage = page;\n }\n free( prevPage );\n }\n}\n /*_____________________________________________________________________\n **NumberOfItems**______________________________________________________\n * Runs through the list of ListPages totalling the items on each page.\n * -> This number could be cached.\n *______________________________________________________________________\n */\nsize_t\nList_NumberOfItems( const PtrList *this )\n{\n size_t number = 0;\n ListPage *page;\n\n for( page = this->firstPage; page != NULL; page = page->next )\n number += page->numberOfItems;\n\n return number;\n}\n /*_____________________________________________________________________\n **Append**_____________________________________________________________\n * This and Insert the only PtrList method that allocates ListPages.\n * If there are no pages with space on them, it allocates an new\n * page and links the page the the previous last page.\n * If there is space on the page, it adds the item to the end of\n * the page and updates the number of items on the page.\n *______________________________________________________________________\n */\nvoid\nList_Append( PtrList *this, void * newItem )\n{\n ListPage *page;\n\n if( this->firstPage == NULL ) /* Add first page if necessary*/\n this->firstPage = ListPage_New( this->itemsPerPage );\n\n page = this->firstPage;\n\n while( page != NULL ) /* Cycle through pages */\n { /* Try to put on page*/\n if( ListPage_Append( page, newItem ) == NULL )\n return; /* Go home with a smile */\n else if( page->next == NULL ) /* If next page doesn't exist*/\n page->next = ListPage_New( this->itemsPerPage );\n /* make new page and */\n /* link to this*/\n\n page = page->next; /* Try the next page*/\n }\n List_HandleAddressingError();\n}\n\n /*_____________________________________________________________________\n * Internal routine for List_Insert.\n * Assumes check has already been done for item address and that\n * it exists on the given page.\n *\n * It is inserted on the page. The question is, what to do if the\n * page was almost empty, and an item had to be bumped off the page\n * to accomodate it.\n *\n * Could shift all elemtents in the list up by one. Might be\n * expensive\n *\n * Strategey here will be to add a new page after the present one\n * if the next page is either full or non-existant. That way, only\n * elements on the next page are affected, and if another item is\n * added to the present page (as often happens) very little more work\n * need be done.\n *______________________________________________________________________\n */\nstatic void\nList_InsertExistingItem( PtrList *list, ListPage *page, size_t pageIndex,\n void *item )\n{\n void * remnant = ListPage_InsertItem( page, pageIndex, item );\n if( remnant ) /* An item got bumped off when inserting into page */\n {\n ListPage *next = page->next;\n if( next == NULL || ListPage_IsFull( next ) )\n {\n ListPage *new = ListPage_New( list->itemsPerPage );\n ListPage_Append( new, item ); /* Item on new */\n new->next = next; /* link new page */\n page->next = new;\n }\n else\n ListPage_InsertItem( next, 0, remnant );\n }\n}\n /*_____________________________________________________________________\n **List_Insert**\n * Inserts the item at the specified index, shifting indices of\n * existing list items as necessary. If index equals the number\n * of items in the list less one, the item is appended to the list.\n *______________________________________________________________________\n */\n\nvoid\nList_Insert( PtrList * list, size_t index, void * item )\n{\n if( index >= List_NumberOfItems( list ) )\n List_Append( list, item );\n else\n {\n ListPage *page = NULL;\n size_t pageIndex;\n\n List_FindItemAddress( list, index, &page, &pageIndex );\n\n if( page != NULL )\n List_InsertExistingItem( list, page, pageIndex, item );\n else\n List_HandleAddressingError();\n /* probably should handle an addressing error */\n }\n}\n\n /*_____________________________________________________________________\n **Item**_______________________________________________________________\n * Returns the item of given index; returns NULL if no such index.\n *______________________________________________________________________\n */\n\nvoid *\nList_Item( const PtrList *this, size_t requestedIndex )\n{\n ListPage *itsPage = NULL;\n size_t itsPageIndex;\n\n List_FindItemAddress( this, requestedIndex, &itsPage, &itsPageIndex );\n\n if( itsPage != NULL )\n return *( itsPage->items + itsPageIndex );\n\n return NULL;\n}\n /*_____________________________________________________________________\n **SetItem**____________________________________________________________\n * Sets the item of given index. Calls user-supplied addressing\n * handler if no such item exists.\n *______________________________________________________________________\n */\nvoid\nList_SetItem( PtrList *this, size_t requestedIndex, void *value )\n{\n ListPage *itsPage = NULL;\n size_t itsPageIndex;\n\n List_FindItemAddress( this, requestedIndex, &itsPage, &itsPageIndex );\n\n if( itsPage != NULL )\n *( itsPage->items + itsPageIndex ) = value;\n else\n List_HandleAddressingError();\n}\n\n /*_____________________________________________________________________\n **CopyList**_________________________________________________________\n * Empties this list and puts items from other list in it.\n *______________________________________________________________________\n */\nvoid\nList_CopyList( PtrList * this, const PtrList * other )\n{\n List_Empty( this );\n this->itemsPerPage = other->itemsPerPage;\n this->firstPage = List_Xerox( other );\n}\n /*_____________________________________________________________________\n **RemoveItem**_________________________________________________________\n * Removes the item of given index from the list by shifting all the\n * following items back by one and reducing itsNumberOfItems by one.\n * -> It would kind of be nice if this also deleted empty pages\n *______________________________________________________________________\n */\nvoid *\nList_RemoveItem( PtrList *this, const size_t requestedIndex )\n{\n ListPage *page = NULL;\n size_t pageIndex = 0;\n\n List_FindItemAddress( this, requestedIndex, &page, &pageIndex );\n\n if( page != NULL )\n return ListPage_RemoveItem( page, pageIndex );\n else\n List_HandleAddressingError();\n\n return NULL;\n}\n /*_____________________________________________________________________\n **Remove**_____________________________________________________________\n * Removes the first item in the list with matching pointer.\n * Note: No check is done for duplicate pointers in the list.\n *______________________________________________________________________\n */\nvoid\nList_Remove( PtrList *this, void * item )\n{\n size_t index = 0;\n\n if( List_GetIndexOf( this, item, &index ) )\n List_RemoveItem( this, index );\n}\n /*_____________________________________________________________________\n **GetIndexOf**_________________________________________________________\n * Inverse of Item(), if pointers in list are unique.\n * Note: No check is done for duplicate pointers in the list.\n * Returns TRUE and sets the indexi argument to the first item in the\n * list with matching pointer, if such an item exists; otherwise\n * returns FALSE.\n *______________________________________________________________________\n */\nPLBOOL\nList_GetIndexOf( const PtrList *this, const void * item, size_t * index )\n{\n size_t numItemsOnPreviousPages = 0;\n ListPage *page = NULL;\n\n for( page = this->firstPage; page != NULL; page = page->next )\n {\n const size_t numItemsOnPage = page->numberOfItems;\n size_t i;\n\n for( i = 0; i < numItemsOnPage; i++ )\n if( *( page->items + i ) == item )\n {\n *index = numItemsOnPreviousPages + i;\n return PLTRUE;\n }\n numItemsOnPreviousPages += numItemsOnPage;\n }\n return PLFALSE;\n}\n#if 0\nstatic void\nList_BubbleSort( PtrList * list, ListSortComparison comparison )\n{\n const size_t n = List_NumberOfItems( list );\n size_t i, j;\n\n for( i = 0; i < n; i++ )\n {\n void *item_i = List_Item( list, i );\n\n for( j = i + 1; j < n; j++ )\n {\n void *item_j = List_Item( list, j );\n\n if( comparison( item_i, item_j ) > 0 )\n {\n List_SwapItems( list, i, j );\n item_i = item_j;\n }\n }\n }\n}\n#endif\nvoid\nList_SwapItems( PtrList * v, size_t a, size_t b )\n{\n ListPage *aPage = NULL, *bPage = NULL;\n size_t aPageInd, bPageInd;\n\n List_FindItemAddress( v, a, &aPage, &aPageInd );\n List_FindItemAddress( v, b, &bPage, &bPageInd );\n\n if( aPage != NULL && bPage != NULL )\n {\n void *temp = *( aPage->items + aPageInd );\n *( aPage->items + aPageInd ) = *( bPage->items + bPageInd );\n *( bPage->items + bPageInd ) = temp;\n }\n}\n /* Adapted from Kernighan & Ritchie */\nstatic void\nList_Qsort( PtrList * v, size_t left, size_t right,\n ListSortComparison comparison )\n{\n size_t i, last;\n\n if( left >= right ) /* do nothing if array contains */\n return; /* fewer than two elements */\n List_SwapItems( v, left, ( left + right ) / 2); /* move partition */\n last = left; /* elem to v[0] */\n for( i = left + 1; i <= right; i++ )\n {/* SW this could be improved a lot */\n void * item_i = List_Item( v, i );\n void * item_left = List_Item( v, left );\n if( comparison( item_i, item_left ) < 0 )\n List_SwapItems( v, ++last, i );\n }\n List_SwapItems( v, left, last ); /* restore partition elem */\n/* SW NEED TO THINK ABOUT THIS */\n if( last > 0 ) /* K&R use int, so this isn't an issue for them */\n List_Qsort( v, left, last - 1, comparison );\n List_Qsort( v, last + 1, right, comparison );\n}\n\n /*_____________________________________________________________________\n **SortAccordingTo**__________________________________________________\n * Based on the comparison of any two items provided by the comparison \n * function argument, sorts the list.\n * Note here it uses a bubble sort, which is slow but easy to \n * understand. Want something faster? Write your own!\n *______________________________________________________________________\n */\nvoid\nList_SortAccordingTo( PtrList * list, ListSortComparison comparison )\n{\n size_t n = List_NumberOfItems( list );\n if( n > 1 )\n List_Qsort( list, 0, n - 1, comparison );\n}\n\n /*_____________________________________________________________________\n **FirstItemSuchThat**__________________________________________________\n * Takes a ListCondition function, returns the pointer value that \n * satisfies the condition, otherwise returns NULL,\n *______________________________________________________________________\n */\nvoid *\nList_FirstItemSuchThat( const PtrList *list, ListCondition condition )\n{\n const size_t n = List_NumberOfItems( list );\n size_t i;\n\n for( i = 0; i < n; i++ )\n if( condition( List_Item( list, i ) ) )\n return List_Item( list, i );\n\n return NULL;\n}\n\n /*_____________________________________________________________________\n **FindFirstIndexSuchThat**_____________________________________________\n * Takes a ListCondition function, sets the index pointer to the index\n * of the first pointer in the list that satisfies condition.\n * Otherwise returns PLFALSE.\n *______________________________________________________________________\n */\nPLBOOL\nList_FindFirstIndexSuchThat( const PtrList *list, ListCondition condition,\n size_t * index )\n{\n const size_t n = List_NumberOfItems( list );\n size_t i;\n\n for( i = 0; i < n; i++ )\n if( condition( List_Item( list, i ) ) )\n {\n *index = i;\n return PLTRUE;\n }\n\n return PLFALSE;\n}\n\n /*_____________________________________________________________________\n **FreeItemsInListAndEmpty**____________________________________________\n * Lists don't usually delete the things they refer to.\n * This function takes the list and uses it to free the listed items.\n *______________________________________________________________________\n */\nvoid\nList_FreeItemsInListAndEmpty( PtrList * this )\n{\n size_t i = List_NumberOfItems( this );\n void *item = NULL;\n\n while( i > 0 ) /* Remove items in reverse order for efficeincy */\n {\n i--;\n item = List_Item( this, i );\n List_RemoveItem( this, i ); /* Remove item before deleting */\n /* (for consistency) */\n free( item );\n }\n}\n /*_____________________________________________________________________\n **FindItemAddress**____________________________________________________\n * Private utility that gets the page and index relative to the page\n * given the item index. Sets *thePage to NULL if no such index.\n *______________________________________________________________________\n */\nvoid\nList_FindItemAddress( const PtrList *this, size_t itemNo,\n ListPage ** thePage, size_t *thePageIndex ) \n{\n ListPage *page = NULL;\n size_t numItemsIncludingThisPage = 0,\n numItemsOnPreviousPages = 0;\n\n *thePage = NULL;\n *thePageIndex = 0;\n\n for( page = this->firstPage; page != NULL; page = page->next )\n {\n numItemsIncludingThisPage += page->numberOfItems;\n\n if( numItemsIncludingThisPage > itemNo )\n {\n *thePage = page;\n *thePageIndex = itemNo - numItemsOnPreviousPages;\n return;\n }\n numItemsOnPreviousPages = numItemsIncludingThisPage;\n }\n}\n\n /*_____________________________________________________________________\n **Xerox**______________________________________________________________\n * Private utility that makes a duplicate of the pages in the list.\n *______________________________________________________________________\n */\nListPage *\nList_Xerox( const PtrList *list)\n{\n ListPage *copy = NULL, *newPage = NULL, *page = list->firstPage;\n\n if( list->firstPage != NULL )\n copy = newPage = ListPage_Dup( list->firstPage );\n\n if( newPage != NULL )\n do\n {\n if( page->next != NULL )\n {\n page = page->next;\n newPage->next = ListPage_Dup( page );\n }\n newPage = newPage->next;\n }\n while( newPage != NULL );\n return copy;\n}\n",
"Startup.c": " /*@@\n @file Startup.c\n @date Wed Sep 13 21:26:56 2000\n @author Tom Goodale\n @desc\n Thorn HTTPDExtra's startup routines.\n @enddesc\n @version $Id$\n @@*/\n\n#include \"cctk.h\"\n#include \"httpextra_HostNames.h\"\n\nstatic const char *rcsid = \"$Header$\";\n\nCCTK_FILEVERSION(CactusConnect_HTTPDExtra_Startup_c)\n\n\n/********************************************************************\n ******************** External Routines ************************\n ********************************************************************/\nint HTTPUTILS_Startup(void);\n\n\n /*@@\n @routine HTTP_Startup\n @date Wed Sep 13 21:26:56 2000\n @author Tom Goodale\n @desc\n Startup routine for the webserver.\n @enddesc\n @calls HTTPDExtra_CollateHostData\n HTTPUTILS_RegisterPages\n HTTP_util_RegisterIOPages\n HTTPDExtra_RegisterProcessorsPages\n\t HTTPDExtra_RegisterTimerInfoPages\n\n @returntype int\n @returndesc\n 0 for success\n @endreturndesc\n@@*/\nint HTTPUTILS_Startup(void)\n{\n /* FIXME: should put this prototype into a header file */\n extern int HTTPUTILS_RegisterPages(void);\n extern int HTTP_util_RegisterIOPages(void);\n extern int HTTPDExtra_RegisterProcessorsPages(void);\n extern int HTTPDExtra_RegisterTimerInfoPages(void);\n\n\n HTTPDExtra_CollateHostData();\n\n HTTPUTILS_RegisterPages();\n\n HTTP_util_RegisterIOPages();\n\n HTTPDExtra_RegisterProcessorsPages();\n\n HTTPDExtra_RegisterTimerInfoPages();\n \n return 0;\n}\n",
"httpextra_HostNames.h": " /*@@\n @header httpextra_HostNames.h\n @date Tue Nov 7 23:57:31 2000\n @author Tom Goodale\n @desc \n Prototypes for routines which give data about hosts in the machine.\n @enddesc\n @version $Header$\n @@*/\n\n#ifndef _HOSTNAMES_H_\n#define _HOSTNAMES_H_ 1\n\n#ifdef __cplusplus\nextern \"C\" \n{\n#endif\n\nvoid HTTPDExtra_CollateHostData(void);\n\nconst char *HTTPDExtra_RemoteHostName(int host);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* _HOSTNAMES_H_ */\n",
"Processors.c": " /*@@\n @file Processors.c\n @date Wed Nov 8 2000\n @author Gabrielle Allen\n @desc \n Pages about processors\n @enddesc\n @version $Header$ \n @@*/\n\n#include \"cctk.h\"\n\n#include \"util_String.h\"\n\n#include \"httpextra_HostNames.h\"\n#include \"http_Content.h\"\n\n/* SW Temporary, while testing the SString module*/\n#include \"CactusConnect/HTTPD/src/SString.h\"\n#include \"CactusConnect/HTTPD/src/SString_Namespace.h\"\n\nstatic const char *rcsid = \"$Header$\";\n\nCCTK_FILEVERSION(CactusConnect_HTTPDExtra_Processors_c)\n\n/********************************************************************\n ********************* Local Data Types ***********************\n ********************************************************************/\n\n/********************************************************************\n ********************* Local Routine Prototypes *********************\n ********************************************************************/\n\nstatic int ProcessorsPage(const cGH *cctkGH, httpRequest *request, void *data);\n\n\n/********************************************************************\n ********************* Other Routine Prototypes *********************\n ********************************************************************/\n\n/********************************************************************\n ********************* Local Data *****************************\n ********************************************************************/\n\n/********************************************************************\n ********************* External Routines **********************\n ********************************************************************/\n\n /*@@\n @routine HTTPDExtra_RegisterProcessorsPages\n @date Wed Sep 14 11:29:43 2000\n @author Gabrielle Allen\n @desc \n Httpd utils registration routine.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nint HTTPDExtra_RegisterProcessorsPages(void)\n{\n /* Register the group info page. */\n HTTP_RegisterPage(\"/Processors\", ProcessorsPage, NULL);\n\n HTTP_ContentLink(\"/Processors/index.html\", \"Processor Information\",\n \"Processor layout and properties\",\n HTTP_QUICKLINK);\n return 0;\n}\n\n/********************************************************************\n ********************* Local Routines *************************\n ********************************************************************/\n\n\n/******************************************************************************\n ***************************** Groups Page **************************************\n ******************************************************************************/\n\n /*@@\n @routine ProcessorsPage\n @date Thu Sep 14 23:47:43 2000\n @author Gabrielle Allen\n @desc \n Displays the processor description page.\n @enddesc \n @calls \n @calledby \n@@*/\nstatic int ProcessorsPage(const cGH *cctkGH, httpRequest *request, void *data)\n{\n int retval = 0;\n int nprocs = 0,np = 0;\n String *message = String_New();\n\n HTTP_SendOKHeader( request );\n\n HTTP_SetDoctype( message );\n HTTP_SendString(request, message);\n\n /* Start the page */\n HTTP_Send(request, \"<html>\\n<head>\\n\");\n HTTP_Send(request, \"<title>Cactus Simulation Processor Information</title>\\n\");\n\n HTTP_SetHeadInfo( message);\n HTTP_SendString(request, message );\n \n HTTP_Send(request, \"<style type=\\\"text/css\\\">\\n\");\n HTTP_Send(request, \" th, td { padding-left: 1em; padding-right: 1em; }\\n\");\n HTTP_Send(request, \" td.name { text-align: left; }\\n\");\n HTTP_Send(request, \" td.number { text-align: center; }\\n\");\n HTTP_Send(request, \"</style>\\n\");\n HTTP_Send(request, \"</head>\\n<body>\\n\");\n\n /* HTTP_Write out the header part. */\n HTTP_SetContentHeaderString(cctkGH, 0, message, NULL);\n retval = HTTP_SendString(request, message);\n \n HTTP_Send(request, \"<h1>Processor Information</h1>\\n\");\n\n HTTP_Send(request, \n \"<div class=\\\"centered\\\">\\n<table rules=\\\"cols\\\">\\n\"\n \"<tr>\"\n \"<th>Number</th>\\n\"\n \"<th>Machine Name</th>\\n\"\n \"</tr>\");\n \n nprocs = CCTK_nProcs(cctkGH);\n for (np=0;np<nprocs;np++)\n {\n SetToCString( message, \"<tr><td class=\\\"number\\\">\" );\n ConcatDecimal( message, np );\n ConcatCString( message, \"</td><td class=\\\"name\\\">\" );\n ConcatCString( message, HTTPDExtra_RemoteHostName(np) );\n ConcatCString( message, \"</td></tr>\\n\");\n HTTP_SendString(request, message );\n }\n\n retval = HTTP_Send(request, \"</table>\\n</div>\\n\");\n \n HTTP_SetContentFooterString(cctkGH, 0, message);\n retval = HTTP_SendString(request, message);\n\n String_Delete( message );\n return retval;\n}\n\n"
},
"test": {},
"doc": {
"documentation.tex": "% *======================================================================*\n% Cactus Thorn template for ThornGuide documentation\n% Author: Ian Kelley\n% Date: Sun Jun 02, 2002\n% $Header$ \n%\n% Thorn documentation in the latex file doc/documentation.tex \n% will be included in ThornGuides built with the Cactus make system.\n% The scripts employed by the make system automatically include \n% pages about variables, parameters and scheduling parsed from the \n% relevent thorn CCL files.\n% \n% This template contains guidelines which help to assure that your \n% documentation will be correctly added to ThornGuides. More \n% information is available in the Cactus UsersGuide.\n% \n% Guidelines:\n% - Do not change anything before the line\n% % BEGIN CACTUS THORNGUIDE\",\n% except for filling in the title, author, date etc. fields.\n% - You can define your own macros are OK, but they must appear after\n% the BEGIN CACTUS THORNGUIDE line, and do not redefine standard \n% latex commands.\n% - To avoid name clashes with other thorns, 'labels', 'citations', \n% 'references', and 'image' names should conform to the following \n% convention: \n% ARRANGEMENT_THORN_LABEL\n% For example, an image wave.eps in the arrangement CactusWave and \n% thorn WaveToyC should be renamed to CactusWave_WaveToyC_wave.eps\n% - Graphics should only be included using the graphix package. \n% More specifically, with the \"includegraphics\" command. Do\n% not specify any graphic file extensions in your .tex file. This \n% will allow us (later) to create a PDF version of the ThornGuide\n% via pdflatex. |\n% - References should be included with the latex \"bibitem\" command. \n% - For the benefit of our Perl scripts, and for future extensions, \n% please use simple latex. \n%\n% *======================================================================* \n% \n% Example of including a graphic image:\n% \\begin{figure}[ht]\n% \t\\begin{center}\n% \t \\includegraphics[width=6cm]{MyArrangement_MyThorn_MyFigure}\n% \t\\end{center}\n% \t\\caption{Illustration of this and that}\n% \t\\label{MyArrangement_MyThorn_MyLabel}\n% \\end{figure}\n%\n% Example of using a label:\n% \\label{MyArrangement_MyThorn_MyLabel}\n%\n% Example of a citation:\n% \\cite{MyArrangement_MyThorn_Author99}\n%\n% Example of including a reference\n% \\bibitem{MyArrangement_MyThorn_Author99}\n% {J. Author, {\\em The Title of the Book, Journal, or periodical}, 1 (1999), \n% 1--16. {\\tt http://www.nowhere.com/}}\n%\n% *======================================================================* \n\n% If you are using CVS use this line to give version information\n% $Header$\n\n\\documentclass{article}\n\n% Use the Cactus ThornGuide style file\n% (Automatically used from Cactus distribution, if you have a \n% thorn without the Cactus Flesh download this from the Cactus\n% homepage at www.cactuscode.org)\n\\usepackage{../../../../doc/latex/cactus}\n\n\\begin{document}\n\n% The author of the documentation\n\\author{} \n\n% The title of the document (not necessarily the name of the Thorn)\n\\title{HTTPDExtra}\n\n% the date your document was last changed, if your document is in CVS, \n% please us:\n% \\date{$ $Date$ $}\n\\date{}\n\n\\maketitle\n\n% Do not delete next line\n% START CACTUS THORNGUIDE\n\n% Add all definitions used in this documentation here \n% \\def\\mydef etc\n\n% Add an abstract for this thorn's documentation\n\\begin{abstract}\n\n\\end{abstract}\n\n% The following sections are suggestive only.\n% Remove them or add your own.\n\n\\section{Introduction}\n\n\\section{Physical System}\n\n\\section{Numerical Implementation}\n\n\\section{Using This Thorn}\n\n\\subsection{Obtaining This Thorn}\n\n\\subsection{Basic Usage}\n\n\\subsection{Special Behaviour}\n\n\\subsection{Interaction With Other Thorns}\n\n\\subsection{Support and Feedback}\n\n\\section{History}\n\n\\subsection{Thorn Source Code}\n\n\\subsection{Thorn Documentation}\n\n\\subsection{Acknowledgements}\n\n\n\\begin{thebibliography}{9}\n\n\\end{thebibliography}\n\n% Do not delete next line\n% END CACTUS THORNGUIDE\n\n\\end{document}\n"
}
}