File: nntpclient.h

package info (click to toggle)
trn4 4.0-test77-13
  • links: PTS, VCS
  • area: non-free
  • in suites: bullseye
  • size: 3,656 kB
  • sloc: ansic: 48,331; sh: 6,817; tcl: 1,696; yacc: 660; perl: 108; makefile: 24
file content (72 lines) | stat: -rw-r--r-- 2,106 bytes parent folder | download | duplicates (6)
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
/* nntpclient.h
*/ 
/* This software is copyrighted as detailed in the LICENSE file. */


#ifdef SUPPORT_NNTP

struct nntplink {
    FILE*	rd_fp;
    FILE*	wr_fp;
    time_t	last_command;
    int		port_number;
    int		flags;
#ifdef USE_GENAUTH
    int		cookiefd;
#endif
    bool	trailing_CR;
};

#define NNTP_NEW_CMD_OK		0x0001
#define NNTP_FORCE_AUTH_NEEDED	0x0002
#define NNTP_FORCE_AUTH_NOW	0x0004

EXT NNTPLINK nntplink;		/* the current server's file handles */
EXT bool nntp_allow_timeout INIT(FALSE);

#define nntp_get_a_line(buf,len,realloc) get_a_line(buf,len,realloc,nntplink.rd_fp)

/* RFC 977 defines these, so don't change them */

#define	NNTP_CLASS_INF  	'1'
#define NNTP_CLASS_OK   	'2'
#define	NNTP_CLASS_CONT 	'3'
#define	NNTP_CLASS_ERR  	'4'
#define	NNTP_CLASS_FATAL	'5'

#define	NNTP_POSTOK_VAL 	200	/* Hello -- you can post */
#define	NNTP_NOPOSTOK_VAL	201	/* Hello -- you can't post */
#define NNTP_LIST_FOLLOWS_VAL	215	/* There's a list a-comin' next */

#define NNTP_GOODBYE_VAL	400	/* Have to hang up for some reason */
#define	NNTP_NOSUCHGROUP_VAL	411	/* No such newsgroup */
#define NNTP_NONEXT_VAL		421	/* No next article */
#define NNTP_NOPREV_VAL		422	/* No previous article */
#define	NNTP_POSTFAIL_VAL	441	/* Posting failed */

#define	NNTP_AUTH_NEEDED_VAL 	480	/* Authorization Failed */
#define	NNTP_AUTH_REJECT_VAL	482	/* Authorization data rejected */

#define	NNTP_BAD_COMMAND_VAL	500	/* Command not recognized */
#define	NNTP_SYNTAX_VAL		501	/* Command syntax error */
#define	NNTP_ACCESS_VAL 	502	/* Access to server denied */
#define	NNTP_TMPERR_VAL  	503	/* Program fault, command not performed */
#define	NNTP_AUTH_BAD_VAL 	580	/* Authorization Failed */

#define	NNTP_STRLEN	512

EXT char ser_line[NNTP_STRLEN];

EXT char last_command[NNTP_STRLEN];

#endif /* SUPPORT_NNTP */

/* DON'T EDIT BELOW THIS LINE OR YOUR CHANGES WILL BE LOST! */

int nntp_connect _((char*,bool_int));
char* nntp_servername _((char*));
int nntp_command _((char*));
int nntp_check _((void));
bool nntp_at_list_end _((char*));
int nntp_gets _((char*,int));
void nntp_close _((bool_int));