Logo Search packages:      
Sourcecode: cmus version File versions  Download package


 * Copyright 2004-2005 Timo Hirvonen
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of the
 * License, or (at your option) any later version.
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 * 02111-1307, USA.

#ifndef _HTTP_H
#define _HTTP_H

#include "keyval.h"

#include <unistd.h>

 * 1xx indicates an informational message only
 * 2xx indicates success of some kind
 * 3xx redirects the client to another URL
 * 4xx indicates an error on the client's part
 * 5xx indicates an error on the server's part

00035 struct http_uri {
      char *user;
      char *pass;
      char *host;
      char *path;
      int port;

00043 struct http_get {
      struct http_uri uri;
      int fd;
      struct keyval *headers;
      char *reason;
      int code;

int http_parse_uri(const char *uri, struct http_uri *u);

/* frees contents of @u, not @u itself */
void http_free_uri(struct http_uri *u);

int http_open(struct http_get *hg, int timeout_ms);

 * returns:  0 success
 *          -1 check errno
 *          -2 parse error
int http_get(struct http_get *hg, struct keyval *headers, int timeout_ms);
void http_get_free(struct http_get *hg);

char *http_read_body(int fd, size_t *size, int timeout_ms);
char *base64_encode(const char *str);


Generated by  Doxygen 1.6.0   Back to index