aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorswhite <swhite@1faa4e14-9dd3-4be0-9f0e-ffe519881164>2004-04-19 13:10:13 +0000
committerswhite <swhite@1faa4e14-9dd3-4be0-9f0e-ffe519881164>2004-04-19 13:10:13 +0000
commitb6727f88dd115b1176003e695182dfecd5f7d4c0 (patch)
tree85507db841b578c6463c1067cb225ef00f93a11c /src
parentf74e95157e422e2b3f583582f3cb0f5adbc6868d (diff)
Addresses Cactus bug 923
Made the download list to be organized by variable, then by data output type, then by slice. To facilitate list manipulation, added temporarily a list module 'PtrList', which perhaps may prove of more general use in the future. Pursuant to Cactus bug 907 Added parameter HTTPExtra::viewport_refresh_seconds to send Refresh header to web browser. Made ViewPort window to respond to viewport_refresh_seconds parameter General HTML improvements...checked with Amaya and lynx. Re-organized CSS info in HTTPD web pages. Got rid of httpuMimeType code which didn't do anything. git-svn-id: http://svn.cactuscode.org/arrangements/CactusConnect/HTTPD/trunk@195 1faa4e14-9dd3-4be0-9f0e-ffe519881164
Diffstat (limited to 'src')
-rw-r--r--src/Authorisation.c2
-rw-r--r--src/Content.c16
-rw-r--r--src/Expression.c2
-rw-r--r--src/Groups.c11
-rw-r--r--src/Headers.c20
-rw-r--r--src/Parameters.c18
-rw-r--r--src/Redirect.c7
-rw-r--r--src/SString.h12
-rw-r--r--src/Server.c5
-rw-r--r--src/Sockets.c3
-rw-r--r--src/Startup.c4
-rw-r--r--src/Steer.c2
-rw-r--r--src/Thorns.c3
-rw-r--r--src/base64.c4
-rw-r--r--src/http.c1
-rw-r--r--src/httpRequest.h2
16 files changed, 41 insertions, 71 deletions
diff --git a/src/Authorisation.c b/src/Authorisation.c
index e909eec..4a91759 100644
--- a/src/Authorisation.c
+++ b/src/Authorisation.c
@@ -10,8 +10,6 @@
#include "cctk.h"
-#include <stdio.h>
-#include <stdlib.h>
#include <string.h>
#ifdef HAVE_UNISTD_H
diff --git a/src/Content.c b/src/Content.c
index b32c516..1370c2e 100644
--- a/src/Content.c
+++ b/src/Content.c
@@ -13,9 +13,7 @@
#include "cctk.h"
-#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
@@ -23,9 +21,6 @@
#include "cctk_Version.h"
-#include "cctk_Parameter.h"
-#include "cctk_ActiveThorns.h"
-
#include "util_String.h"
#include "util_Network.h"
@@ -35,14 +30,11 @@
#include "Steer.h"
#include "Cookies.h"
-#include "Content.h"
-
-#include "cctk_Arguments.h"
#include "cctk_Parameters.h"
#include "SString_Namespace.h"
-#define EMPTYSTRING {'\0'}
+#include "Content.h"
static const char *rcsid = "$Header$";
@@ -399,6 +391,9 @@ static int MainPage(const cGH *cctkGH, httpRequest *request, void *data)
HTTP_Send(request, "<title>Running CACTUS Status Information</title>\n");
HTTP_SetHeadInfo( message);
HTTP_SendString(request, message );
+ HTTP_Send(request, "<style type=\"text/css\">\n"
+ "\ttd.authenticate { text-align: center; background-color: #E5FFA2; }\n"
+ "</style>\n");
HTTP_Send(request, "</head>\n<body>\n");
/* Write out the main header part */
@@ -857,6 +852,9 @@ static int ControlPage(const cGH *cctkGH, httpRequest *request, void *data)
HTTP_SetHeadInfo( message);
HTTP_SendString(request, message );
+ HTTP_Send(request, "<style type=\"text/css\">\n"
+ "\t.controls td { text-align: left; vertical-align: middle; } \n"
+ "</style>\n" );
HTTP_Send(request, "</head>\n<body>\n");
diff --git a/src/Expression.c b/src/Expression.c
index 883efb2..82b2e30 100644
--- a/src/Expression.c
+++ b/src/Expression.c
@@ -12,8 +12,6 @@
#include "cctk.h"
#endif
-#include <stdio.h>
-#include <stdlib.h>
#include <string.h>
#include "Expression.h"
diff --git a/src/Groups.c b/src/Groups.c
index b16ff8a..a12269b 100644
--- a/src/Groups.c
+++ b/src/Groups.c
@@ -8,14 +8,8 @@
@version $Header$
@@*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
#include "cctk.h"
-#include "util_String.h"
-
#include "httpRequest.h"
#include "Content.h"
@@ -118,6 +112,11 @@ static int GroupsPage(const cGH *cctkGH, httpRequest *request, void *data)
HTTP_SetHeadInfo( message);
HTTP_SendString(request, message );
+ HTTP_Send(request,"<style type=\"text/css\">\n"
+ "\ttable.groups { background-color: #E9F4D3; } \n"
+ "\t\t.groups td { text-align: left; } \n"
+ "</style>\n");
+
HTTP_Send(request,"</head>\n<body>\n");
/* HTTP_Write out the header part. */
diff --git a/src/Headers.c b/src/Headers.c
index 97b50e9..f24ac49 100644
--- a/src/Headers.c
+++ b/src/Headers.c
@@ -56,6 +56,9 @@ static const char *cactus_styles =
" a:link { color: #1B831D; }\n"
" a:visited { color: #768000; }\n"
" a:active { color: green; }\n"
+" div.centered { text-align: center; } \n"
+" div.centered table { margin: auto; } \n"
+" span.hilite { color: red; } \n"
" td.menu { color: black; background-color: #E5FFA2; \n"
" text-align: left; vertical-align: top; width: 20ex; \n"
" font-size: small; }\n"
@@ -65,25 +68,12 @@ static const char *cactus_styles =
" margin-top: 1.2em; margin-bottom: 0; } \n"
" td.menu span.simulation_name { font-style: italic; } \n"
" td.menu kbd { font-family: monospace; font-style: normal; } \n"
-" .controls td { text-align: left; vertical-align: middle; } \n"
-" .params th { text-align: right; } \n"
-" .params td { text-align: center; vertical-align: middle; } \n"
-" .params td.description { font-size: small; } \n"
-" table.groups { background-color: #E9F4D3; } \n"
-" .groups td { text-align: left; } \n"
-" .paramtable td { text-align: left; vertical-align: middle; } \n"
-" .paramtable td.description { font-size: small; } \n"
-" .thornparams th { text-align: right; } \n"
-" .thorns td { text-align: left; } \n"
" .footer td { font-size: small; vertical-align: top; } \n"
" .footer td.by { text-align: right; } \n"
" .footer img { border: 0; } \n"
-" div.banner, div.centered { text-align: center; } \n"
+" div.banner { text-align: center; } \n"
" div.banner table { margin: auto; } \n"
" div.banner img { border: 0; } \n"
-" div.centered table { margin: auto; } \n"
-" td.authenticate { text-align: center; background-color: #E5FFA2; }\n"
-" span.hilite { color: red; } \n"
"</style>\n";
static const char *cactus_footer =
@@ -114,6 +104,8 @@ static const char * cactus_doctype =
void HTTP_SetHeadInfo( String *header)
{
SetToCString( header, cactus_styles );
+ ConcatCString( header, "<meta name=\"content-type\" "
+ "content=\"text/html; charset=iso-8859-15\" />\n");
}
void HTTP_SetDoctype( String *header)
{
diff --git a/src/Parameters.c b/src/Parameters.c
index 084a27e..c195fc7 100644
--- a/src/Parameters.c
+++ b/src/Parameters.c
@@ -17,23 +17,17 @@
#include "cctk.h"
-#include "cctk_Parameter.h"
-#include "cctk_ActiveThorns.h"
-
#include "util_String.h"
#include "httpRequest.h"
#include "Auth.h"
#include "Steer.h"
-#include "Cookies.h"
#include "Content.h"
-#include "cctk_Arguments.h"
#include "cctk_Parameters.h"
-#include "SStringHTML.h"
#include "SString_Namespace.h"
#include "SStringHTML_Namespace.h"
@@ -358,10 +352,15 @@ static int ThornParameterPage(const cGH *cctkGH, httpRequest *request, void *dat
HTTP_SetHeadInfo( message);
HTTP_SendString(request, message );
- Truncate( message, 0 );
+
+ HTTP_Send(request, "<style type=\"text/css\">\n"
+ "\t.paramtable td { text-align: left; vertical-align: middle; } \n"
+ "\t.paramtable td.description { font-size: small; } \n"
+ "</style> \n");
HTTP_Send(request, "</head>\n<body>\n");
+ Truncate( message, 0 );
if (CCTK_NumCompiledThorns()>0)
{
@@ -758,10 +757,13 @@ static int ParameterPage(const cGH *cctkGH, httpRequest *request, void *data)
HTTP_SetHeadInfo( message);
HTTP_SendString(request, message );
- Truncate( message, 0 );
+ HTTP_Send(request, "<style type=\"text/css\">\n"
+ ".paramtable td.description { font-size: small; } \n"
+ "</style>\n");
HTTP_Send(request,"</head>\n<body>\n");
+ Truncate( message, 0 );
/* Menu for this page */
first = 1;
diff --git a/src/Redirect.c b/src/Redirect.c
index 5502e5c..ced0287 100644
--- a/src/Redirect.c
+++ b/src/Redirect.c
@@ -8,10 +8,6 @@
@version $Id$
@@*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
#include "cctk.h"
#ifdef CCTK_MPI
@@ -114,7 +110,8 @@ int HTTP_SetupRedirect(int port,
#ifdef HTTPD_DEBUG
printf("alladdr is %s\n", alladdr);
#endif
- strcpy(httpmaster,alladdr); /* the 0th element is the master hostname */
+ strncpy(httpmaster,alladdr, sizeof(httpmaster)); /* the 0th element is the master hostname */
+ httpmaster[sizeof(httpmaster) - 1] = '\0';
/* so compare my addr to the list sequentially */
for(i=0;i<nprocs;i++)
diff --git a/src/SString.h b/src/SString.h
index 81c6c85..1a7a5d4 100644
--- a/src/SString.h
+++ b/src/SString.h
@@ -2,7 +2,7 @@
@file SString.h
@date 02.04.2004
@author Steve White
- @desc Module for generic operations on strings
+ @desc C Module for generic operations on strings
@enddesc
@version $Header$
@@*/
@@ -11,16 +11,16 @@
#include <stddef.h>
-#ifdef __cplusplus
-extern "C"
-{
-#endif
typedef struct String_tag String; /* The abstract type for a String */
-typedef char SSCHAR; /* but could be Unicode */
+typedef char SSCHAR; /* Could be Unicode... */
typedef enum { SSFALSE, SSTRUE } SSBOOL;
+#ifdef __cplusplus
+extern "C"
+{
+#endif
/* String creation and deletion */
String *String_New( void );
String *String_Copy( const String *other );
diff --git a/src/Server.c b/src/Server.c
index dee7f10..4f7a9b4 100644
--- a/src/Server.c
+++ b/src/Server.c
@@ -8,16 +8,11 @@
@version $Header$
@@*/
-#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "cctk.h"
-#include "cctk_Constants.h"
-#include "cctk_Groups.h"
-#include "cctk_GroupsOnGH.h"
-#include "cctk_Parameter.h"
#include "cctk_Parameters.h"
#include "util_Hash.h"
diff --git a/src/Sockets.c b/src/Sockets.c
index b080ed0..7857df2 100644
--- a/src/Sockets.c
+++ b/src/Sockets.c
@@ -15,7 +15,6 @@
#include "util_Network.h"
#include "SocketUtils.h"
-#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
@@ -226,7 +225,7 @@ int HTTP_Poll(cGH *cctkGH, long sec, long usec)
fd_set read_fd_set = active_fd_set;
struct sockaddr_in clientname;
struct timeval timeout;
- httpSocket *this, *next;
+ httpSocket *this;
timeout.tv_sec = sec;
diff --git a/src/Startup.c b/src/Startup.c
index 1ca6bef..108eb3d 100644
--- a/src/Startup.c
+++ b/src/Startup.c
@@ -14,10 +14,6 @@
#include <pthread.h>
#endif
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "cctk_Parameter.h"
#include "cctk_Arguments.h"
#include "cctk_Parameters.h"
diff --git a/src/Steer.c b/src/Steer.c
index 4d2c379..ed87922 100644
--- a/src/Steer.c
+++ b/src/Steer.c
@@ -17,8 +17,6 @@
#include <pthread.h>
#endif
-#include <stdio.h>
-#include <stdlib.h>
#include <string.h>
#ifdef CCTK_MPI
diff --git a/src/Thorns.c b/src/Thorns.c
index b7c8463..2577418 100644
--- a/src/Thorns.c
+++ b/src/Thorns.c
@@ -131,6 +131,9 @@ static int ThornMainPage(const cGH *cctkGH, httpRequest *request, void *data)
HTTP_SetHeadInfo( message);
HTTP_SendString(request, message );
+ HTTP_Send(request,"<style type=\"text/css\">\n"
+ "\t.thorns td { text-align: left; } \n"
+ "</style>\n");
HTTP_Send(request,"</head>\n<body>\n");
/* HTTP_SendString out the header part. */
diff --git a/src/base64.c b/src/base64.c
index 842ceb7..f209acf 100644
--- a/src/base64.c
+++ b/src/base64.c
@@ -54,12 +54,8 @@
* IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#include <sys/types.h>
#include <ctype.h>
-#include <stdio.h>
-
-#include <stdlib.h>
#include <string.h>
#define Assert(Cond) if (!(Cond)) abort()
diff --git a/src/http.c b/src/http.c
index fface5f..c9cdd4d 100644
--- a/src/http.c
+++ b/src/http.c
@@ -11,7 +11,6 @@
#include "cctk.h"
#include "cctk_Parameters.h"
-#include <stdio.h>
#include <stdlib.h>
#ifdef HAVE_SYS_TIME_H
diff --git a/src/httpRequest.h b/src/httpRequest.h
index ebfa9d9..fe1c0eb 100644
--- a/src/httpRequest.h
+++ b/src/httpRequest.h
@@ -53,8 +53,8 @@ const char * HTTP_Arg_Name( const httpArg *arg );
const char * HTTP_Arg_Value( const httpArg *arg );
#ifdef __cplusplus
}
-
#endif
+
#include "httpSString.h"
#endif /* __HTTP_REQUEST_H__ */