File: serverutil.h

package info (click to toggle)
gopher 3.0.3woody2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 2,796 kB
  • ctags: 2,008
  • sloc: ansic: 23,055; perl: 1,950; sh: 1,691; makefile: 457; asm: 1
file content (104 lines) | stat: -rw-r--r-- 3,369 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/********************************************************************
 * $Author: jgoerzen $
 * $Revision: 1.2 $
 * $Date: 2000/12/20 01:19:20 $
 * $Source: /var/cvs/gopher/gopherd/serverutil.h,v $
 * $State: Exp $
 *
 * Paul Lindner, University of Minnesota CIS.
 *
 * Copyright 1991, 1992 by the Regents of the University of Minnesota
 * see the file "Copyright" in the distribution for conditions of use.
 *********************************************************************
 * MODULE: serverutil.h
 * declarations of utility functions
 *********************************************************************
 * Revision History:
 * $Log: serverutil.h,v $
 * Revision 1.2  2000/12/20 01:19:20  jgoerzen
 * Added patches from David Allen <s2mdalle@titan.vcu.edu>
 *
 * Revision 1.1.1.1  2000/08/19 00:28:56  jgoerzen
 * Import from UMN Gopher 2.3.1 after GPLization
 *
 * Revision 3.7  1995/10/04  21:05:20  lindner
 * NO_AUTH mod
 *
 * Revision 3.6  1995/09/28  21:11:31  lindner
 * More fixes...
 *
 * Revision 3.5  1995/09/26  04:59:48  lindner
 * Fix abort routines, change to Die/Warn hash over access routines..
 *
 * Revision 3.4  1995/09/25  05:02:39  lindner
 * Convert to ANSI C
 *
 * Revision 3.3  1995/02/07  08:37:38  lindner
 * Rewrite of mailfile/multifile parsing
 *
 * Revision 3.2  1994/12/20  17:20:56  lindner
 * Put environment variable setter here..
 *
 * Revision 3.1  1993/06/22  07:06:58  lindner
 * New header file..
 *
 *
 *********************************************************************/

#ifndef G_SERVERUTIL_H
#define G_SERVERUTIL_H

typedef int Splittype;
#define SPLIT_MAIL -1
#define SPLIT_UNKNOWN -2

#include <stdarg.h>
#include <stdio.h>
#include "boolean.h"

void      GplusError(int sockfd, int errclass, char *text, char **moretext);
void      Die(int sockfd, int errorlevel, char *fmt, ...);
void      Warn(int sockfd, int errorlevel, char *fmt, ...);
void      LOGGopher(int sockfd, const char *fmt, ...);

boolean   Setuid_username(char *);

int       is_mail_from_line(char *);
Splittype is_multipartfile(char *);

char      *mtm_basename( char *);
boolean   Cachetimedout(char *cache, int secs, char *dir);

boolean   isadir(char *);
void      SetEnvironmentVariable(char *, char *);
FILE*     Gpopen(int sockfd, char *cmd, char *rw);


#include "gopherdconf.h"

#ifdef NO_AUTHENTICATION
#  define CheckAccess(a,b) 
#else
   void      CheckAccess(int sockfd, Accesslevel);
#endif

/* prototypes */
void LOGGopher               (int sockfd, const char *fmt, ...);
void GplusError              (int sockfd, int errclass, 
                              char *text, char **moretext);
void Abortoutput             (int sockfd, char *errmsg);
void Die                     (int sockfd, int errorlevel, char *fmt, ...);
void Warn                    (int sockfd, int errorlevel, char *fmt, ...);
boolean Setuid_username      (char *username);
int is_mail_from_line        (char *line);
Splittype is_multipartfile   (char *line);
void process_mailfile        (int sockfd, char *Mailfname);
char *mtm_basename           (char *string);
boolean Cachetimedout        (char *cache, int secs, char *dir);
boolean isadir               (char *path);
void ServerSetArgv           (const char *fmt, ...);
FILE* Gpopen                 (int sockfd, char *cmd, char *rw);
void SetEnvironmentVariable  (char *variable, char *value);


#endif