aboutsummaryrefslogtreecommitdiff
path: root/src/Content.c
diff options
context:
space:
mode:
authortradke <tradke@1faa4e14-9dd3-4be0-9f0e-ffe519881164>2001-04-03 11:52:30 +0000
committertradke <tradke@1faa4e14-9dd3-4be0-9f0e-ffe519881164>2001-04-03 11:52:30 +0000
commit9440c6b2556d012a91c44eee00c56790819b722f (patch)
tree570ff51e6484286a8aef911fd7e1e3670b4f989b /src/Content.c
parentf205b15ff648ff94aa3c3ab40a66a2cc9404f864 (diff)
Fixed most of the compiler warnings.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusConnect/HTTPD/trunk@120 1faa4e14-9dd3-4be0-9f0e-ffe519881164
Diffstat (limited to 'src/Content.c')
-rw-r--r--src/Content.c61
1 files changed, 40 insertions, 21 deletions
diff --git a/src/Content.c b/src/Content.c
index 8745f26..3563a53 100644
--- a/src/Content.c
+++ b/src/Content.c
@@ -11,6 +11,8 @@
@version $Header$
@@*/
+#include "cctk.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -19,7 +21,7 @@
#include <unistd.h>
#endif
-#include "cctk.h"
+#include "cctk_Version.h"
#include "cctk_Parameter.h"
#include "cctk_ActiveThorns.h"
@@ -84,6 +86,8 @@ static int CookieTestPage(cGH *cctkGH, httpRequest *request, void *data);
********************* Other Routine Prototypes *********************
********************************************************************/
+void HTTP_ContentWork(cGH *GH);
+int HTTP_RegisterPages(void);
int HTTPi_RegisterGroupsPages(void);
int HTTPi_RegisterThornPages(void);
int HTTPi_RegisterParameterPages(void);
@@ -119,8 +123,11 @@ static const char *notauthorized_page =
@endhistory
@@*/
-void HTTP_ContentWork(CCTK_ARGUMENTS)
+void HTTP_ContentWork(cGH *GH)
{
+ /* avoid compiler warning about unused parameter */
+ GH = GH;
+
#if 0
HTTP_SteerDispatch();
#endif
@@ -202,19 +209,19 @@ int HTTP_ContentLink(const char *URL,
int flags)
{
int retval;
- struct httpLink *link;
+ struct httpLink *hlink;
struct httpLink *last;
struct httpLink *current;
- link = (struct httpLink *)malloc(sizeof(struct httpLink));
+ hlink = (struct httpLink *)malloc(sizeof(struct httpLink));
- if(link)
+ if(hlink)
{
- link->URL = Util_Strdup(URL);
- link->name = Util_Strdup(name);
- link->description = Util_Strdup(description);
- link->flags = flags;
- link->next = NULL;
+ hlink->URL = Util_Strdup(URL);
+ hlink->name = Util_Strdup(name);
+ hlink->description = Util_Strdup(description);
+ hlink->flags = flags;
+ hlink->next = NULL;
/* Put on list */
if(ContentLinks)
@@ -223,11 +230,11 @@ int HTTP_ContentLink(const char *URL,
{
last = current;
}
- last->next = link;
+ last->next = hlink;
}
else
{
- ContentLinks = link;
+ ContentLinks = hlink;
}
retval = 0;
@@ -292,15 +299,17 @@ static int MainPage(cGH *cctkGH, httpRequest *request, void *data)
DECLARE_CCTK_PARAMETERS
int retval;
- int filelen;
char message[10098];
char title[4098];
char menu[4098];
char *dir;
char *file;
- struct httpLink *link;
+ struct httpLink *hlink;
int seconds,minutes,hours,days,weeks,months,years,millenia;
+ /* avoid compiler warning about unused parameter */
+ data = data;
+
/* Status message */
strcpy(message,"HTTP/1.0 200 OK\r\n");
@@ -393,11 +402,11 @@ static int MainPage(cGH *cctkGH, httpRequest *request, void *data)
"<H3>Available options:</H3>\n"
"<dl>\n");
- for(link = ContentLinks; link; link=link->next)
+ for(hlink = ContentLinks; hlink; hlink=hlink->next)
{
sprintf(message,
"%s<dt> <A HREF=\"%s\">%s</a> <dd>%s \n",
- message, link->URL, link->name, link->description);
+ message, hlink->URL, hlink->name, hlink->description);
}
@@ -484,7 +493,7 @@ static int MainPage(cGH *cctkGH, httpRequest *request, void *data)
strcat(message,"</ul><li> Parameter filename <font color=red>");
HTTP_Write(request, message, strlen(message));
- filelen = CCTK_ParameterFilename(4098,message);
+ CCTK_ParameterFilename(4098,message);
Util_SplitFilename(&dir,&file,message);
HTTP_Write(request, file, strlen(file));
@@ -496,7 +505,7 @@ static int MainPage(cGH *cctkGH, httpRequest *request, void *data)
strcpy(message,"<li>Estimated time per iteration:<UL> ");
sprintf(message,"%s <LI><font color=red>%f</font> seconds</UL>",
- message,((float)CCTK_RunTime()/(float)cctkGH->cctk_iteration));
+ message,CCTK_RunTime()/(double)cctkGH->cctk_iteration);
HTTP_Write(request, message, strlen(message));
strcpy(message,"<li>Estimated time to completion:<UL> ");
@@ -688,6 +697,9 @@ static int ShowStaticPage(cGH *cctkGH, httpRequest *request, void *data)
char message[1024];
struct httpStaticPage *page;
+ /* avoid compiler warning about unused parameter */
+ cctkGH = cctkGH;
+
if(data)
{
page = (struct httpStaticPage *)data;
@@ -730,13 +742,15 @@ static int ControlPage(cGH *cctkGH, httpRequest *request, void *data)
{
DECLARE_CCTK_PARAMETERS
- int retval;
char message[4098];
int notauthorised;
char thisuser[USER_LENGTH+1];
+ /* avoid compiler warning about unused parameter */
+ data = data;
+
notauthorised = HTTP_AuthenticateBasic(request, "user", thisuser, USER_LENGTH);
if(!notauthorised)
@@ -863,7 +877,7 @@ static int ControlPage(cGH *cctkGH, httpRequest *request, void *data)
/* Write out the footer part. */
HTTP_ContentFooter(cctkGH, 0, 4098, message);
- retval = HTTP_Write(request, message, strlen(message));
+ HTTP_Write(request, message, strlen(message));
}
else
{
@@ -1298,6 +1312,9 @@ static int AboutPage(cGH *cctkGH, httpRequest *request, void *data)
int retval;
char message[4098];
+ /* avoid compiler warning about unused parameter */
+ data = data;
+
/* Status message */
strcpy(message,"HTTP/1.0 200 OK\r\n");
@@ -1369,10 +1386,12 @@ static int CookieTestPage(cGH *cctkGH, httpRequest *request, void *data)
{
int retval;
char message[4098];
- struct httpuFileList *list;
const char *value;
char *value2;
+ /* avoid compiler warning about unused parameter */
+ data = data;
+
/* Status message */
strcpy(message,"HTTP/1.0 200 OK\r\n");