blob: eaaa1dcce7359f8e2e4fd31a96512294239d8427 [file] [log] [blame]
adamdunkelsca9ddcb2003-03-19 14:13:31 +00001/*
2 * Copyright (c) 2002, Adam Dunkels.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above
11 * copyright notice, this list of conditions and the following
12 * disclaimer in the documentation and/or other materials provided
13 * with the distribution.
adamdunkels06f897e2004-06-06 05:59:20 +000014 * 3. The name of the author may not be used to endorse or promote
adamdunkelsca9ddcb2003-03-19 14:13:31 +000015 * products derived from this software without specific prior
16 * written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
19 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 *
30 * This file is part of the "contiki" web browser.
31 *
adamdunkels46cd1432004-07-04 17:50:39 +000032 * $Id: webclient.h,v 1.6 2004/07/04 17:50:39 adamdunkels Exp $
adamdunkelsca9ddcb2003-03-19 14:13:31 +000033 *
34 */
35#ifndef __WEBCLIENT_H__
36#define __WEBCLIENT_H__
37
38
39#include "http-strings.h"
adamdunkels09c3c762003-07-31 23:32:04 +000040#include "http-user-agent-string.h"
adamdunkels86c5f212003-11-27 15:47:24 +000041#include "resolv.h"
adamdunkels46cd1432004-07-04 17:50:39 +000042
adamdunkels2e415422003-04-10 09:04:49 +000043
adamdunkelsca9ddcb2003-03-19 14:13:31 +000044/* Callback functions that have to be implemented by the application
45 program. */
46struct webclient_state;
47void webclient_datahandler(char *data, u16_t len);
48void webclient_connected(void);
49void webclient_timedout(void);
50void webclient_aborted(void);
51void webclient_closed(void);
52
53
54/* Functions. */
55void webclient_init(void);
56unsigned char webclient_get(char *host, u16_t port, char *file);
57void webclient_close(void);
adamdunkels46cd1432004-07-04 17:50:39 +000058
59void webclient_appcall(void *state);
60/*DISPATCHER_UIPCALL(webclient_appcall, state);*/
adamdunkelsca9ddcb2003-03-19 14:13:31 +000061
62char *webclient_mimetype(void);
63char *webclient_filename(void);
64char *webclient_hostname(void);
65unsigned short webclient_port(void);
66
67#endif /* __WEBCLIENT_H__ */