mailcap.h
4.65 KB
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General
Public License along with this library; if not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301 USA */
#ifndef _MAILUTILS_MAILCAP_H
#define _MAILUTILS_MAILCAP_H
#include <mailutils/types.h>
#include <mailutils/errno.h>
/* See RFC1524 (A User Agent Configuration Mechanism). */
#ifdef __cplusplus
extern "C" {
#endif
/* Create a mailcap from stream. */
int mu_mailcap_create __P((mu_mailcap_t * mailcap, stream_t stream));
/* Destroy mailcap object. */
void mu_mailcap_destroy __P((mu_mailcap_t * mailcap));
/* Return the number of entries in the mailcap file. */
int mu_mailcap_entries_count __P((mu_mailcap_t mailcap, size_t *pno));
/* Return the mailcap record number, no, of the mailcap file . */
int mu_mailcap_get_entry __P((mu_mailcap_t mailcap, size_t no,
mu_mailcap_entry_t *entry));
/* Return the number of fields in a mailcap entry */
int mu_mailcap_entry_fields_count __P((mu_mailcap_entry_t entry,
size_t *pcount));
/* Save in buffer[] the content-type of the record. */
int mu_mailcap_entry_get_typefield __P((mu_mailcap_entry_t entry,
char *buffer, size_t buflen,
size_t *pn));
/* Save in buffer[] the view command of the record. */
int mu_mailcap_entry_get_viewcommand __P((mu_mailcap_entry_t entry,
char *buffer, size_t buflen,
size_t *pn));
/* Save in buffer[] the field number no the record . */
int mu_mailcap_entry_get_field __P((mu_mailcap_entry_t entry, size_t no,
char *buffer, size_t buflen, size_t *pn));
/* Save in buffer the value of a key:
* mu_mailcap_entry_get_value __P((entry, "compose", buffer, buflen, pn));
* i.e compose="lynx %s" --> "lynx %s" will be saved in the buffer without
* the quotes. */
int mu_mailcap_entry_get_value __P((mu_mailcap_entry_t entry, const char *key,
char *buffer, size_t buflen, size_t *pn));
/* Helper function saving in buffer, the argument of "compose" field. */
int mu_mailcap_entry_get_compose __P((mu_mailcap_entry_t entry, char *buffer,
size_t buflen, size_t *pn));
/* Helper function saving in buffer, the argument of "composetyped" field. */
int mu_mailcap_entry_get_composetyped __P((mu_mailcap_entry_t entry,
char *buffer, size_t buflen,
size_t *pn));
/* Helper function saving in buffer, the argument of "edit" field. */
int mu_mailcap_entry_get_edit __P((mu_mailcap_entry_t entry, char *buffer,
size_t buflen, size_t *pn));
/* Helper function saving in buffer, the argument of "textualnewlines" field. */
int mu_mailcap_entry_get_textualnewlines __P((mu_mailcap_entry_t entry,
char *buffer, size_t buflen,
size_t *pn));
/* Helper function saving in buffer, the argument of "test" field. */
int mu_mailcap_entry_get_test __P((mu_mailcap_entry_t entry,
char *buffer, size_t buflen, size_t *pn));
/* Helper function saving in buffer, the argument of "x11-bitmap" field. */
int mu_mailcap_entry_get_x11bitmap __P((mu_mailcap_entry_t entry,
char *buffer, size_t buflen, size_t *pn));
/* Helper function saving in buffer, the argument of "description" field. */
int mu_mailcap_entry_get_description __P((mu_mailcap_entry_t entry,
char *buffer, size_t buflen,
size_t *pn));
/* Helper function saving in buffer, the argument of "nametemplate" field. */
int mu_mailcap_entry_get_nametemplate __P((mu_mailcap_entry_t entry,
char *buffer, size_t buflen,
size_t *pn));
/* Helper function saving in buffer, the argument of "notes" field. */
int mu_mailcap_entry_get_notes __P((mu_mailcap_entry_t entry, char *buffer,
size_t buflen, size_t *pn));
/* Helper function. Returns *on != 0 if the flag "needsterminal" is in the
record. */
int mu_mailcap_entry_needsterminal __P((mu_mailcap_entry_t entry, int *on));
/* Helper function. Returns *on != 0 if the flag "copiousoutput" is in the
record. */
int mu_mailcap_entry_copiousoutput __P((mu_mailcap_entry_t entry, int *on));
#ifdef __cplusplus
}
#endif
#endif