2 * Copyright (C) 2008 Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #include <atompub/atom.h>
35 atom_request_new (int type, char *request)
38 req = g_slice_new (AtomRequest);
40 req->request = g_strdup (request);
47 atom_request_delete (AtomRequest *req)
50 g_free (req->request);
52 g_free (req->content);
53 g_slice_free (AtomRequest, req);
57 atom_request_type (AtomRequest *req)
63 atom_request_request (AtomRequest *req)
69 atom_request_content_set (AtomRequest *req, char *content, size_t len)
72 g_free (req->content);
73 req->content = g_malloc (len);
74 memcpy (req->content, content, len);
75 req->content_len = len;
79 atom_request_content (AtomRequest *req, char **content, size_t *len)
82 *content = req->content;
84 *len = req->content_len;