summaryrefslogtreecommitdiffabout
path: root/include
authorSergey Poznyakoff <gray@gnu.org.ua>2004-08-07 09:04:49 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2004-08-07 09:04:49 (GMT)
commit59c6ecdc410336c82e15af70242c5cb532176a24 (patch) (side-by-side diff)
treeb68b4ef3bdeb0bec6a4ec1564a9eea980899ff3e /include
parent57386437e245daa5a086100c6bc4a2ec21d5ee7d (diff)
downloadmailutils-59c6ecdc410336c82e15af70242c5cb532176a24.tar.gz
mailutils-59c6ecdc410336c82e15af70242c5cb532176a24.tar.bz2
Minor changes. The screen is 80x24!
Diffstat (limited to 'include') (more/less context) (ignore whitespace changes)
-rw-r--r--include/mailutils/nntp.h185
1 files changed, 126 insertions, 59 deletions
diff --git a/include/mailutils/nntp.h b/include/mailutils/nntp.h
index 5cea852..f2f7d1f 100644
--- a/include/mailutils/nntp.h
+++ b/include/mailutils/nntp.h
@@ -50,60 +50,101 @@ extern int mu_nntp_stls (mu_nntp_t nntp);
extern int mu_nntp_mode_reader (mu_nntp_t nntp);
-/* An iterator is return with the multi-line answer. It is the responsability of
- the caller to call iterator_destroy() to dispose of the iterator. */
+/* An iterator is return with the multi-line answer. It is the responsibility
+ of the caller to call iterator_destroy() to dispose of the iterator. */
extern int mu_nntp_list_extensions (mu_nntp_t nntp, iterator_t *iterator);
extern int mu_nntp_quit (mu_nntp_t nntp);
-/* The argument name is allocated with malloc(3). The caller is responsable to call free(3) */
-extern int mu_nntp_group (mu_nntp_t nntp, const char *group, unsigned long *total, unsigned long *first,
+/* The argument name is allocated with malloc(3). The caller is responsible
+ to call free(3) */
+extern int mu_nntp_group (mu_nntp_t nntp,
+ const char *group,
+ unsigned long *total,
+ unsigned long *first,
unsigned long *last, char **name);
-/* The argument mid is allocated with malloc(3). The caller is responsable to call free(3) */
-extern int mu_nntp_last (mu_nntp_t nntp, unsigned long *number, char **mid);
-extern int mu_nntp_next (mu_nntp_t nntp, unsigned long *number, char **mid);
-
-/* The argument mid is allocated with malloc(3). The caller is responsable to call free(3).
- The caller must call stream_destoy() when done, no other commands are permitted until the stream is destroyed. */
-extern int mu_nntp_article (mu_nntp_t nntp, unsigned long number, unsigned long *pnum, char **mid, stream_t *stream);
-extern int mu_nntp_article_id (mu_nntp_t nntp, const char *id, unsigned long *pnum, char **mid, stream_t *stream);
-extern int mu_nntp_head (mu_nntp_t nntp, unsigned long number, unsigned long *pnum, char **mid, stream_t *stream);
-extern int mu_nntp_head_id (mu_nntp_t nntp, const char *name, unsigned long *pnum, char **mid, stream_t *stream);
-extern int mu_nntp_body (mu_nntp_t nntp, unsigned long number, unsigned long *pnum, char **mid, stream_t *stream);
-extern int mu_nntp_body_id (mu_nntp_t nntp, const char *id, unsigned long *pnum, char **mid, stream_t *stream);
-
-/* The argument mid is allocated with malloc(3). The caller is responsable to call free(3) */
-extern int mu_nntp_stat (mu_nntp_t nntp, unsigned long number, unsigned long *pnum, char **mid);
-extern int mu_nntp_stat_id (mu_nntp_t nntp, const char *id, unsigned long *pnum, char **mid);
-
-extern int mu_nntp_date (mu_nntp_t nntp, unsigned int *year, unsigned int *month, unsigned int *day,
- unsigned int *hour, unsigned int *minute, unsigned int *second);
-
-/* The caller must call stream_destoy() when done, no other commands are permitted until the stream is destroyed. */
+/* The argument mid is allocated with malloc(3). The caller is responsible
+ to call free(3) */
+extern int mu_nntp_last (mu_nntp_t nntp,
+ unsigned long *number, char **mid);
+extern int mu_nntp_next (mu_nntp_t nntp,
+ unsigned long *number, char **mid);
+
+/* The argument mid is allocated with malloc(3). The caller is responsible
+ to call free(3). The caller must call stream_destoy() when done, no
+ other commands are permitted until the stream is destroyed. */
+extern int mu_nntp_article (mu_nntp_t nntp, unsigned long number,
+ unsigned long *pnum, char **mid,
+ stream_t *stream);
+extern int mu_nntp_article_id (mu_nntp_t nntp, const char *id,
+ unsigned long *pnum, char **mid,
+ stream_t *stream);
+extern int mu_nntp_head (mu_nntp_t nntp, unsigned long number,
+ unsigned long *pnum, char **mid,
+ stream_t *stream);
+extern int mu_nntp_head_id (mu_nntp_t nntp, const char *name,
+ unsigned long *pnum, char **mid,
+ stream_t *stream);
+extern int mu_nntp_body (mu_nntp_t nntp, unsigned long number,
+ unsigned long *pnum, char **mid,
+ stream_t *stream);
+extern int mu_nntp_body_id (mu_nntp_t nntp, const char *id,
+ unsigned long *pnum, char **mid,
+ stream_t *stream);
+
+/* The argument mid is allocated with malloc(3). The caller is responsible
+ to call free(3) */
+extern int mu_nntp_stat (mu_nntp_t nntp, unsigned long number,
+ unsigned long *pnum, char **mid);
+extern int mu_nntp_stat_id (mu_nntp_t nntp, const char *id,
+ unsigned long *pnum, char **mid);
+
+extern int mu_nntp_date (mu_nntp_t nntp, unsigned int *year,
+ unsigned int *month, unsigned int *day,
+ unsigned int *hour, unsigned int *minute,
+ unsigned int *second);
+
+/* The caller must call stream_destoy() when done, no other commands are
+ permitted until the stream is destroyed. */
extern int mu_nntp_help (mu_nntp_t nntp, stream_t *stream);
-/* An iterator is return with the multi-line answer. It is the responsability of
- the caller to call iterator_destroy() to dispose of the iterator. */
-extern int mu_nntp_newgroups (mu_nntp_t nntp, unsigned int year, unsigned int month, unsigned int day,
- unsigned int hour, unsigned int minute, unsigned int second, int is_gmt, iterator_t *iterator);
-/* A iterator is return with the multi-line answer. It is the responsability of
- the caller to call iterator_destroy() to dispose of the iterator. */
-extern int mu_nntp_newnews (mu_nntp_t nntp, const char *wildmat, unsigned int year, unsigned int month, unsigned int day,
- unsigned int hour, unsigned int minute, unsigned int second, int is_gmt, iterator_t *iterator);
+/* An iterator is return with the multi-line answer. It is the responsibility
+ of the caller to call iterator_destroy() to dispose of the iterator. */
+extern int mu_nntp_newgroups (mu_nntp_t nntp, unsigned int year,
+ unsigned int month, unsigned int day,
+ unsigned int hour, unsigned int minute,
+ unsigned int second, int is_gmt,
+ iterator_t *iterator);
+
+/* A iterator is return with the multi-line answer. It is the responsibility
+ of the caller to call iterator_destroy() to dispose of the iterator. */
+extern int mu_nntp_newnews (mu_nntp_t nntp, const char *wildmat,
+ unsigned int year, unsigned int month,
+ unsigned int day, unsigned int hour,
+ unsigned int minute, unsigned int second,
+ int is_gmt, iterator_t *iterator);
extern int mu_nntp_post (mu_nntp_t nntp, stream_t stream);
-extern int mu_nntp_ihave (mu_nntp_t nntp, const char *mid, stream_t stream);
-
-
-/* A iterator is return with the multi-line answer. It is the responsability of
- the caller to call iterator_destroy() to dispose of the iterator. */
-extern int mu_nntp_list_active (mu_nntp_t nntp, const char *wildmat, iterator_t *iterator);
-extern int mu_nntp_list_active_times (mu_nntp_t nntp, const char *wildmat, iterator_t *iterator);
-extern int mu_nntp_list_distributions (mu_nntp_t nntp, const char *wildmat, iterator_t *iterator);
+extern int mu_nntp_ihave (mu_nntp_t nntp, const char *mid,
+ stream_t stream);
+
+
+/* A iterator is return with the multi-line answer. It is the responsibility
+ of the caller to call iterator_destroy() to dispose of the iterator. */
+extern int mu_nntp_list_active (mu_nntp_t nntp, const char *wildmat,
+ iterator_t *iterator);
+extern int mu_nntp_list_active_times (mu_nntp_t nntp,
+ const char *wildmat,
+ iterator_t *iterator);
+extern int mu_nntp_list_distributions (mu_nntp_t nntp,
+ const char *wildmat,
+ iterator_t *iterator);
extern int mu_nntp_list_distrib_pats (mu_nntp_t nntp, iterator_t *iterator);
-extern int mu_nntp_list_newsgroups (mu_nntp_t nntp, const char *wildmat, iterator_t *iterator);
+extern int mu_nntp_list_newsgroups (mu_nntp_t nntp,
+ const char *wildmat,
+ iterator_t *iterator);
/* Parse the list active response.
@@ -116,50 +157,74 @@ extern int mu_nntp_list_newsgroups (mu_nntp_t nntp, const char *wildmat, ite
'm': posting is not permitted
'm': postings will be moderated
- The argument group is allocated with malloc(3). The caller is responsable to call free(3).
+ The argument group is allocated with malloc(3). The caller is responsible
+ to call free(3).
*/
-extern int mu_nntp_parse_list_active (const char *buffer, char **group, unsigned long *high, unsigned long *low, char *status);
-extern int mu_nntp_parse_newgroups (const char *buffer, char **group, unsigned long *high, unsigned long *low, char *status);
+
+extern int mu_nntp_parse_list_active (const char *buffer, char **group,
+ unsigned long *high, unsigned long *low,
+ char *status);
+extern int mu_nntp_parse_newgroups (const char *buffer, char **group,
+ unsigned long *high, unsigned long *low,
+ char *status);
+
/* Parse the list active.times response.
"group time creator"
group: is the name of the group
time: measure in seconds since Jan 1 1970
creator: entity taht created the newsgroup
- The argument group/creator is allocated with malloc(3). The caller is responsable to call free(3).
+ The argument group/creator is allocated with malloc(3). The caller is
+ responsible to call free(3).
*/
-extern int mu_nntp_parse_list_active_times (const char *buffer, char **group, unsigned long *time, char **creator);
+
+extern int mu_nntp_parse_list_active_times (const char *buffer, char **group,
+ unsigned long *time,
+ char **creator);
/* Parse the list distributions response.
"key value"
key: field key.
value: short explaination of key
- The argument key/value is allocated with malloc(3). The caller is responsable to call free(3).
+ The argument key/value is allocated with malloc(3). The caller is responsible
+ to call free(3).
*/
-extern int mu_nntp_parse_list_distributions (const char *buffer, char **key, char **value);
+extern int mu_nntp_parse_list_distributions (const char *buffer,
+ char **key, char **value);
+
/* Parse the list distributions response.
"weight:wildmat:distrib"
weight:
wildmat:
distrib:
- The argument wildmat/distrib is allocated with malloc(3). The caller is responsable to call free(3).
+ The argument wildmat/distrib is allocated with malloc(3). The caller is
+ responsible to call free(3).
*/
-extern int mu_nntp_parse_list_distrib_pats (const char *buffer, unsigned long *weight, char **wildmat, char **distrib);
+extern int mu_nntp_parse_list_distrib_pats (const char *buffer,
+ unsigned long *weight,
+ char **wildmat, char **distrib);
+
/* Parse the list distributions response.
"group description"
- The argument group/description is allocated with malloc(3). The caller is responsable to call free(3).
+ The argument group/description is allocated with malloc(3). The caller is
+ responsible to call free(3).
*/
-extern int mu_nntp_parse_list_newsgroups (const char *buffer, char **group, char **description);
+extern int mu_nntp_parse_list_newsgroups (const char *buffer, char **group,
+ char **description);
-/* Reads the multi-line response of the server, nread will be 0 when the termination octets
- are detected. Clients should not use this function unless they are sending direct command. */
-extern int mu_nntp_readline (mu_nntp_t nntp, char *buffer, size_t buflen, size_t *nread);
+/* Reads the multi-line response of the server, nread will be 0 when the
+ termination octets are detected. Clients should not use this function
+ unless they are sending a direct command. */
+extern int mu_nntp_readline (mu_nntp_t nntp, char *buffer,
+ size_t buflen, size_t *nread);
-/* Returns the last command acknowledge. If the server supports RESP-CODE, the message
- could be retrieve, but it is up the caller to do the parsing. */
-extern int mu_nntp_response (mu_nntp_t nntp, char *buffer, size_t buflen, size_t *nread);
+/* Returns the last command acknowledge. If the server supports RESP-CODE,
+ the message could be retrieved, but it is up the caller to do the parsing.
+*/
+extern int mu_nntp_response (mu_nntp_t nntp, char *buffer,
+ size_t buflen, size_t *nread);
/* pop3_writeline copies the line in the internal buffer, a mu_pop3_send() is
needed to do the actual transmission. */
@@ -174,6 +239,8 @@ extern int mu_nntp_sendline (mu_nntp_t nntp, const char *line);
/* Transmit via the carrier the internal buffer data. */
extern int mu_nntp_send (mu_nntp_t nntp);
+extern int mu_nntp_response_code (mu_nntp_t nntp);
+
#ifdef __cplusplus
}
#endif

Return to:

Send suggestions and report system problems to the System administrator.