Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

dime.h

Go to the documentation of this file.
00001 /*
00002  * $Id: dime.h 13394 2007-04-21 10:56:10Z cbiere $
00003  *
00004  * Copyright (c) 2004, Jeroen Asselman
00005  *
00006  *----------------------------------------------------------------------
00007  * This file is part of gtk-gnutella.
00008  *
00009  *  gtk-gnutella is free software; you can redistribute it and/or modify
00010  *  it under the terms of the GNU General Public License as published by
00011  *  the Free Software Foundation; either version 2 of the License, or
00012  *  (at your option) any later version.
00013  *
00014  *  gtk-gnutella is distributed in the hope that it will be useful,
00015  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  *  GNU General Public License for more details.
00018  *
00019  *  You should have received a copy of the GNU General Public License
00020  *  along with gtk-gnutella; if not, write to the Free Software
00021  *  Foundation, Inc.:
00022  *      59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00023  *----------------------------------------------------------------------
00024  */
00025 
00036 /* Dime message parsing. */
00037 
00038 #ifndef _dime_h_
00039 #define _dime_h_
00040 
00041 #include "common.h"
00042 
00043 struct dime_record;
00044 
00045 struct dime_record *dime_record_alloc(void);
00046 void dime_record_free(struct dime_record **record_ptr);
00047 
00048 size_t dime_create_record(const struct dime_record *record,
00049             char **data_ptr, gboolean first, gboolean last);
00050 
00051 gboolean dime_record_set_data(struct dime_record *record,
00052             const void *data, size_t size);
00053 gboolean dime_record_set_id(struct dime_record *record, const char *id);
00054 gboolean dime_record_set_type_uri(struct dime_record *, const char *type);
00055 gboolean dime_record_set_type_mime(struct dime_record *, const char *type);
00056 
00057 void dime_list_free(GSList **list_ptr);
00058 GSList *dime_parse_records(const gchar *data, size_t size);
00059 
00060 const char *dime_record_type(const struct dime_record *record);
00061 size_t dime_record_type_length(const struct dime_record *record);
00062 const char *dime_record_id(const struct dime_record *record);
00063 size_t dime_record_id_length(const struct dime_record *record);
00064 const char *dime_record_data(const struct dime_record *record);
00065 size_t dime_record_data_length(const struct dime_record *record);
00066 
00067 #endif  /* _dime_h_ */
00068 
00069 /* vi: set ts=4 sw=4 cindent: */

Generated on Sat Jun 30 17:53:22 2007 for gtk-gnutella by  doxygen 1.3.9.1