comparison src/protocol.h @ 43:2842f50feb55 noffle

[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h, control.c, control.h, database.c, database.h, dynamicstring.c, dynamicstring.h, fetch.c, fetch.h, fetchlist.c, fetchlist.h, group.c, group.h, itemlist.c, itemlist.h, lock.c, lock.h, log.c, log.h, noffle.c, online.c, online.h, outgoing.c, outgoing.h, over.c, over.h, post.c, post.h, protocol.c, protocol.h, pseudo.c, pseudo.h, request.c, request.h, server.c, server.h, util.c, util.h, wildmat.c, wildmat.h: Moved files to the subdirectory src/ * Makefile.am, acconfig.h, configure.in, docs/Makefile.am, src/Makefile.am, Makefile.in, aclocal.m4, config.h.in, configure, install-sh, missing, mkinstalldirs, stamp-h.in, docs/Makefile.in, src/Makefile.in: Added files. They are used by aclocal, autoheader, autoconf and automake. * src/config.c, src/config.h: Renamed to configfile.c and configfile.h, because configure will generate a config.h file itself. * src/client.c, src/content.c, src/database.c, src/fetch.c, src/fetchlist.c, src/group.c, src/lock.c, src/noffle.c, src/online.c, src/outgoing.c, src/over.c, src/pseudo.c, src/request.c, src/server.c, src/util.c: Changed '#include "config.h"' to '#include "configfile.h"'. * src/client.c, src/content.c, src/database.c, src/fetch.c, src/fetchlist.c, src/group.c, src/lock.c, src/online.c, src/outgoing.c, src/post.c, src/protocol.c, src/request.c, src/server.c: Files now #include <config.h>. Added missing <stdio.h>. This removes the warnings about snprintf() not being declared. * Makefile: Removed. This is now generated by configure.
author uh1763
date Fri, 05 May 2000 22:45:56 +0100
parents
children 32ba1198c6fa
comparison
equal deleted inserted replaced
42:2467ff423c15 43:2842f50feb55
1 /*
2 protocol.h
3
4 Functions related with the NNTP protocol which are useful for both
5 the server and the client.
6
7 $Id: protocol.h 49 2000-05-05 21:45:56Z uh1763 $
8 */
9
10 #ifndef PRT_H
11 #define PRT_H
12
13 #include "dynamicstring.h"
14 #include "over.h"
15
16 #define STAT_HELP_FOLLOWS 100
17 #define STAT_DEBUG_FOLLOWS 199
18
19 #define STAT_READY_POST_ALLOW 200
20 #define STAT_READY_NO_POST_ALLOW 201
21 #define STAT_CMD_OK 202
22 #define STAT_GOODBYE 205
23 #define STAT_GRP_SELECTED 211
24 #define STAT_GRPS_FOLLOW 215
25 #define STAT_ART_FOLLOWS 220
26 #define STAT_HEAD_FOLLOWS 221
27 #define STAT_BODY_FOLLOWS 222
28 #define STAT_ART_RETRIEVED 223
29 #define STAT_OVERS_FOLLOW 224
30 #define STAT_NEW_GRP_FOLLOW 231
31 #define STAT_POST_OK 240
32 #define STAT_AUTH_ACCEPTED 281
33
34 #define STAT_SEND_ART 340
35 #define STAT_MORE_AUTH_REQUIRED 381
36
37 #define STAT_NO_SUCH_GRP 411
38 #define STAT_NO_GRP_SELECTED 412
39 #define STAT_NO_ART_SELECTED 420
40 #define STAT_NO_NEXT_ART 421
41 #define STAT_NO_PREV_ART 422
42 #define STAT_NO_SUCH_NUMB 423
43 #define STAT_NO_SUCH_ID 430
44 #define STAT_ART_REJECTED 437
45 #define STAT_POST_FAILED 441
46 #define STAT_AUTH_REQUIRED 480
47 #define STAT_AUTH_REJECTED 482
48
49 #define STAT_NO_SUCH_CMD 500
50 #define STAT_SYNTAX_ERR 501
51 #define STAT_NO_PERMISSION 502
52 #define STAT_PROGRAM_FAULT 503
53
54 /*
55 Read next line from f into Str, up to "\n" or "\r\n". Don't save "\n"
56 or "\r\n" in line. Terminate with '\0'.
57 */
58 Bool
59 Prt_getLn( Str line, FILE *f );
60
61 /*
62 Read a text line from server. Returns TRUE if line != ".", removes
63 leading '.' otherwise.
64 */
65 Bool
66 Prt_getTxtLn( Str line, Bool *err, FILE *f );
67
68 /*
69 Write text line to f. Escape "." at the beginning with another ".".
70 Terminate with "\r\n".
71 */
72 Bool
73 Prt_putTxtLn( const char* line, FILE *f );
74
75 /*
76 Write text buffer of lines each ending with '\n'.
77 Replace '\n' by "\r\n".
78 */
79 Bool
80 Prt_putTxtBuf( const char *buf, FILE *f );
81
82 /*
83 Write text-ending "."-line to f
84 */
85 Bool
86 Prt_putEndOfTxt( FILE *f );
87
88 /*
89 Splits line in field and value. Field is converted to lower-case.
90 */
91 Bool
92 Prt_getField( Str resultField, Str resultValue, const char* line );
93
94 /* Search header. Works only with single line headers (ignores continuation
95 lines */
96 Bool
97 Prt_searchHeader( const char *artTxt, const char* which, Str result );
98
99 Bool
100 Prt_isValidMsgId( const char *msgId );
101
102 void
103 Prt_genMsgId( Str msgId, const char *from, const char *suffix );
104
105 #endif