server/rcfile.cxx File Reference

process .backendrc for xlog, backenddaemon and ?? More...

#include <stdio.h>
#include <string.h>
#include "udanax.h"
#include "port.h"

Include dependency graph for rcfile.cxx:

Include dependency graph

Go to the source code of this file.

Defines

#define RCFILENAME   ".backendrc"
#define PORTMETANAME   "port"
#define HOSTMETANAME   "host"
#define ALLOCSIZENAME   "allocsize"
#define INCREMENTALALLOCSIZENAME   "incrementalallocsize"

Functions

void processrcfile ()
 ???


Variables

int portname = PORT
char hostname [256] = "localhost"
int incrementalallocsize = INCREMENTALALLOCSIZE
int allocsize = ALLOCSIZE


Detailed Description

process .backendrc for xlog, backenddaemon and ??

(to be defined)

Definition in file rcfile.cxx.


Define Documentation

#define ALLOCSIZENAME   "allocsize"
 

Definition at line 85 of file rcfile.cxx.

Referenced by processrcfile().

#define HOSTMETANAME   "host"
 

Definition at line 78 of file rcfile.cxx.

Referenced by processrcfile().

#define INCREMENTALALLOCSIZENAME   "incrementalallocsize"
 

Definition at line 86 of file rcfile.cxx.

Referenced by processrcfile().

#define PORTMETANAME   "port"
 

Definition at line 77 of file rcfile.cxx.

Referenced by processrcfile().

#define RCFILENAME   ".backendrc"
 

Definition at line 76 of file rcfile.cxx.

Referenced by processrcfile().


Function Documentation

void processrcfile  ) 
 

???

(to be defined)

Definition at line 110 of file rcfile.cxx.

References allocsize, ALLOCSIZENAME, HOSTMETANAME, hostname, incrementalallocsize, INCREMENTALALLOCSIZENAME, L, NULL, PORT, PORTMETANAME, portname, and RCFILENAME.

00111 {
00112     FILE *rcfd;
00113     static char buf[BUFSIZ];
00114     static char line[256];
00115     static char name[256];
00116     int temp;
00117 
00118     if ((rcfd = fopen(RCFILENAME, "r")) != NULL) {
00119         while (fgets(buf, BUFSIZ, rcfd)) {
00120             if (buf[0] != '#' && sscanf(buf, "%s = %s", name, line) == 2) {
00121 //UNUSED                if (!strcmp(name, BACKENDFILEMETANAME))
00122 //UNUSED                    strcpy(backendfilename, line);
00123 //UNUSED                else if (!strcmp(name, ACCOUNTFILEMETANAME))
00124 //UNUSED                     strcpy(accountfilename, line);
00125 //UNUSED                else
00126                 if (!strcmp(name, PORTMETANAME)) {
00127                     if (sscanf(line, "%d", &portname) < 1) {
00128                         L("Could not use port = %s, using %d\n", line, PORT);
00129                         portname = PORT;
00130                     }
00131                 } else if (!strcmp(name, HOSTMETANAME))
00132                     strcpy(hostname, line);
00133 //UNUSED                else if (!strcmp(name, BACKENDDIRECTORYMETANAME))
00134 //UNUSED                    strcpy(backenddirectoryname, line);
00135 //UNUSED                else if (!strcmp(name, BACKENDGLUEFILEMETANAME))
00136 //UNUSED                    strcpy(backendgluefilename, line);
00137 //UNUSED                else if (!strcmp(name, FRONTENDGLUEFILEMETANAME))
00138 //UNUSED                    strcpy(frontendgluefilename, line);
00139 //UNUSED                else if (!strcmp(name, FRONTENDFILEMETANAME))
00140 //UNUSED                    strcpy(frontendfilename, line);
00141                 else if (!strcmp(name, ALLOCSIZENAME)) {
00142                     temp = allocsize;
00143                     sscanf(line, "%d", &allocsize);
00144                     if (allocsize < 100000 || allocsize > 300000000) {  /* minimal sanity checking */
00145                         incrementalallocsize = temp;
00146                     }
00147                 } else if (!strcmp(name, INCREMENTALALLOCSIZENAME)) {
00148                     temp = incrementalallocsize;
00149                     sscanf(line, "%d", &incrementalallocsize);
00150                     if (incrementalallocsize < 10000 || incrementalallocsize > 100000000) {
00151                         incrementalallocsize = temp;
00152                     }
00153                 } else
00154                     L("Don't know about %s = %s\n", name, line);
00155             }
00156         }
00157         fclose(rcfd);
00158     }
00159 }


Variable Documentation

int allocsize = ALLOCSIZE
 

Definition at line 98 of file rcfile.cxx.

Referenced by initqueues(), processrcfile(), and weresurethatthisisourmorecore().

char hostname[256] = "localhost"
 

Definition at line 89 of file rcfile.cxx.

Referenced by processrcfile().

int incrementalallocsize = INCREMENTALALLOCSIZE
 

Definition at line 97 of file rcfile.cxx.

Referenced by processrcfile(), and xgrabmorecore().

int portname = PORT
 

Definition at line 88 of file rcfile.cxx.

Referenced by open_sock(), and processrcfile().


Generated on Sun Aug 21 04:18:47 2005 for Udanax-Green by doxygen1.3.4