1.1 --- a/Frameworks/libpurple.framework/Versions/0.5.6/Headers/mime.h Sun Jun 21 22:04:11 2009 -0400
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,219 +0,0 @@
1.4 -/*
1.5 - * Purple
1.6 - *
1.7 - * Purple is the legal property of its developers, whose names are too
1.8 - * numerous to list here. Please refer to the COPYRIGHT file distributed
1.9 - * with this source distribution
1.10 - *
1.11 - * This program is free software; you can redistribute it and/or modify
1.12 - * it under the terms of the GNU General Public License as published by
1.13 - * the Free Software Foundation; either version 2 of the License, or (at
1.14 - * your option) any later version.
1.15 - *
1.16 - * This program is distributed in the hope that it will be useful, but
1.17 - * WITHOUT ANY WARRANTY; without even the implied warranty of
1.18 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1.19 - * General Public License for more details.
1.20 - *
1.21 - * You should have received a copy of the GNU General Public License
1.22 - * along with this program; if not, write to the Free Software
1.23 - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301,
1.24 - * USA.
1.25 - */
1.26 -
1.27 -#ifndef _PURPLE_MIME_H
1.28 -#define _PURPLE_MIME_H
1.29 -
1.30 -#include <glib.h>
1.31 -#include <glib/glist.h>
1.32 -
1.33 -#ifdef __cplusplus
1.34 -extern "C" {
1.35 -#endif
1.36 -
1.37 -/**
1.38 - * @file mime.h
1.39 - * @ingroup core
1.40 - *
1.41 - * Rudimentary parsing of multi-part MIME messages into more
1.42 - * accessible structures.
1.43 - */
1.44 -
1.45 -/**
1.46 - * A MIME document.
1.47 - */
1.48 -typedef struct _PurpleMimeDocument PurpleMimeDocument;
1.49 -
1.50 -/**
1.51 - * A part of a multipart MIME document.
1.52 - */
1.53 -typedef struct _PurpleMimePart PurpleMimePart;
1.54 -
1.55 -/**
1.56 - * Allocate an empty MIME document.
1.57 - */
1.58 -PurpleMimeDocument *purple_mime_document_new(void);
1.59 -
1.60 -/**
1.61 - * Frees memory used in a MIME document and all of its parts and fields
1.62 - *
1.63 - * @param doc The MIME document to free.
1.64 - */
1.65 -void purple_mime_document_free(PurpleMimeDocument *doc);
1.66 -
1.67 -/**
1.68 - * Parse a MIME document from a NUL-terminated string.
1.69 - *
1.70 - * @param buf The NULL-terminated string containing the MIME-encoded data.
1.71 - *
1.72 - * @returns A MIME document.
1.73 - */
1.74 -PurpleMimeDocument *purple_mime_document_parse(const char *buf);
1.75 -
1.76 -/**
1.77 - * Parse a MIME document from a string
1.78 - *
1.79 - * @param buf The string containing the MIME-encoded data.
1.80 - * @param len Length of buf.
1.81 - *
1.82 - * @returns A MIME document.
1.83 - */
1.84 -PurpleMimeDocument *purple_mime_document_parsen(const char *buf, gsize len);
1.85 -
1.86 -/**
1.87 - * Write (append) a MIME document onto a GString.
1.88 - */
1.89 -void purple_mime_document_write(PurpleMimeDocument *doc, GString *str);
1.90 -
1.91 -/**
1.92 - * The list of fields in the header of a document
1.93 - *
1.94 - * @param doc The MIME document.
1.95 - *
1.96 - * @constreturn A list of strings indicating the fields (but not the values
1.97 - * of the fields) in the header of doc.
1.98 - */
1.99 -GList *purple_mime_document_get_fields(PurpleMimeDocument *doc);
1.100 -
1.101 -/**
1.102 - * Get the value of a specific field in the header of a document.
1.103 - *
1.104 - * @param doc The MIME document.
1.105 - * @param field Case-insensitive field name.
1.106 - *
1.107 - * @returns Value associated with the indicated header field, or
1.108 - * NULL if the field doesn't exist.
1.109 - */
1.110 -const char *purple_mime_document_get_field(PurpleMimeDocument *doc,
1.111 - const char *field);
1.112 -
1.113 -/**
1.114 - * Set or replace the value of a specific field in the header of a
1.115 - * document.
1.116 - *
1.117 - * @param doc The MIME document.
1.118 - * @param field Case-insensitive field name.
1.119 - * @param value Value to associate with the indicated header field,
1.120 - * of NULL to remove the field.
1.121 - */
1.122 -void purple_mime_document_set_field(PurpleMimeDocument *doc,
1.123 - const char *field,
1.124 - const char *value);
1.125 -
1.126 -/**
1.127 - * The list of parts in a multipart document.
1.128 - *
1.129 - * @param doc The MIME document.
1.130 - *
1.131 - * @constreturn List of PurpleMimePart contained within doc.
1.132 - */
1.133 -GList *purple_mime_document_get_parts(PurpleMimeDocument *doc);
1.134 -
1.135 -/**
1.136 - * Create and insert a new part into a MIME document.
1.137 - *
1.138 - * @param doc The new part's parent MIME document.
1.139 - */
1.140 -PurpleMimePart *purple_mime_part_new(PurpleMimeDocument *doc);
1.141 -
1.142 -
1.143 -/**
1.144 - * The list of fields in the header of a document part.
1.145 - *
1.146 - * @param part The MIME document part.
1.147 - *
1.148 - * @constreturn List of strings indicating the fields (but not the values
1.149 - * of the fields) in the header of part.
1.150 - */
1.151 -GList *purple_mime_part_get_fields(PurpleMimePart *part);
1.152 -
1.153 -
1.154 -/**
1.155 - * Get the value of a specific field in the header of a document part.
1.156 - *
1.157 - * @param part The MIME document part.
1.158 - * @param field Case-insensitive name of the header field.
1.159 - *
1.160 - * @returns Value of the specified header field, or NULL if the
1.161 - * field doesn't exist.
1.162 - */
1.163 -const char *purple_mime_part_get_field(PurpleMimePart *part,
1.164 - const char *field);
1.165 -
1.166 -/**
1.167 - * Get the decoded value of a specific field in the header of a
1.168 - * document part.
1.169 - */
1.170 -char *purple_mime_part_get_field_decoded(PurpleMimePart *part,
1.171 - const char *field);
1.172 -
1.173 -/**
1.174 - * Set or replace the value of a specific field in the header of a
1.175 - * document.
1.176 - *
1.177 - * @param part The part of the MIME document.
1.178 - * @param field Case-insensitive field name
1.179 - * @param value Value to associate with the indicated header field,
1.180 - * of NULL to remove the field.
1.181 - */
1.182 -void purple_mime_part_set_field(PurpleMimePart *part,
1.183 - const char *field,
1.184 - const char *value);
1.185 -
1.186 -/**
1.187 - * Get the (possibly encoded) data portion of a MIME document part.
1.188 - *
1.189 - * @param part The MIME document part.
1.190 - *
1.191 - * @returns NULL-terminated data found in the document part
1.192 - */
1.193 -const char *purple_mime_part_get_data(PurpleMimePart *part);
1.194 -
1.195 -/**
1.196 - * Get the data portion of a MIME document part, after attempting to
1.197 - * decode it according to the content-transfer-encoding field. If the
1.198 - * specified encoding method is not supported, this function will
1.199 - * return NULL.
1.200 - *
1.201 - * @param part The MIME documemt part.
1.202 - * @param data Buffer for the data.
1.203 - * @param len The length of the buffer.
1.204 - */
1.205 -void purple_mime_part_get_data_decoded(PurpleMimePart *part,
1.206 - guchar **data, gsize *len);
1.207 -
1.208 -/**
1.209 - * Get the length of the data portion of a MIME document part.
1.210 - *
1.211 - * @param part The MIME document part.
1.212 - * @returns Length of the data in the document part.
1.213 - */
1.214 -gsize purple_mime_part_get_length(PurpleMimePart *part);
1.215 -
1.216 -void purple_mime_part_set_data(PurpleMimePart *part, const char *data);
1.217 -
1.218 -#ifdef __cplusplus
1.219 -}
1.220 -#endif
1.221 -
1.222 -#endif