Skip to content

Commit

Permalink
Remove prog_char
Browse files Browse the repository at this point in the history
  • Loading branch information
maniacbug committed Mar 5, 2012
1 parent 7107b8f commit 22fe88c
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 69 deletions.
64 changes: 32 additions & 32 deletions webclient-strings.c
Original file line number Diff line number Diff line change
@@ -1,97 +1,97 @@
#include <avr/pgmspace.h>
const prog_char http_http[8] PROGMEM =
const char http_http[8] PROGMEM =
/* "http://" */
{0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0 };
const prog_char http_200[5] PROGMEM =
const char http_200[5] PROGMEM =
/* "200 " */
{0x32, 0x30, 0x30, 0x20, 0 };
const prog_char http_301[5] PROGMEM =
const char http_301[5] PROGMEM =
/* "301 " */
{0x33, 0x30, 0x31, 0x20, 0 };
const prog_char http_302[5] PROGMEM =
const char http_302[5] PROGMEM =
/* "302 " */
{0x33, 0x30, 0x32, 0x20, 0 };
const prog_char http_get[5] PROGMEM =
const char http_get[5] PROGMEM =
/* "GET " */
{0x47, 0x45, 0x54, 0x20, 0 };
const prog_char http_10[9] PROGMEM =
const char http_10[9] PROGMEM =
/* "HTTP/1.0" */
{0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0 };
const prog_char http_11[9] PROGMEM =
const char http_11[9] PROGMEM =
/* "HTTP/1.1" */
{0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, 0 };
const prog_char http_icy[4] PROGMEM =
const char http_icy[4] PROGMEM =
/* "ICY" */
{0x49, 0x43, 0x59, 0 };
const prog_char http_content_type[15] PROGMEM =
const char http_content_type[15] PROGMEM =
/* "content-type: " */
{0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0 };
const prog_char http_texthtml[10] PROGMEM =
const char http_texthtml[10] PROGMEM =
/* "text/html" */
{0x74, 0x65, 0x78, 0x74, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0 };
const prog_char http_location[11] PROGMEM =
const char http_location[11] PROGMEM =
/* "location: " */
{0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0 };
const prog_char http_host[7] PROGMEM =
const char http_host[7] PROGMEM =
/* "host: " */
{0x68, 0x6f, 0x73, 0x74, 0x3a, 0x20, 0 };
const prog_char http_crnl[3] PROGMEM =
const char http_crnl[3] PROGMEM =
/* "\r\n" */
{0xd, 0xa, 0 };
const prog_char http_index_html[12] PROGMEM =
const char http_index_html[12] PROGMEM =
/* "/index.html" */
{0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0 };
const prog_char http_404_html[10] PROGMEM =
const char http_404_html[10] PROGMEM =
/* "/404.html" */
{0x2f, 0x34, 0x30, 0x34, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0 };
const prog_char http_content_type_html[28] PROGMEM =
const char http_content_type_html[28] PROGMEM =
/* "Content-type: text/html\r\n\r\n" */
{0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0xd, 0xa, 0xd, 0xa, 0 };
const prog_char http_content_type_css [27] PROGMEM =
const char http_content_type_css [27] PROGMEM =
/* "Content-type: text/css\r\n\r\n" */
{0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x63, 0x73, 0x73, 0xd, 0xa, 0xd, 0xa, 0 };
const prog_char http_content_type_text[28] PROGMEM =
const char http_content_type_text[28] PROGMEM =
/* "Content-type: text/text\r\n\r\n" */
{0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x74, 0x65, 0x78, 0x74, 0xd, 0xa, 0xd, 0xa, 0 };
const prog_char http_content_type_png [28] PROGMEM =
const char http_content_type_png [28] PROGMEM =
/* "Content-type: image/png\r\n\r\n" */
{0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x70, 0x6e, 0x67, 0xd, 0xa, 0xd, 0xa, 0 };
const prog_char http_content_type_gif [28] PROGMEM =
const char http_content_type_gif [28] PROGMEM =
/* "Content-type: image/gif\r\n\r\n" */
{0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x67, 0x69, 0x66, 0xd, 0xa, 0xd, 0xa, 0 };
const prog_char http_content_type_jpg [29] PROGMEM =
const char http_content_type_jpg [29] PROGMEM =
/* "Content-type: image/jpeg\r\n\r\n" */
{0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x6a, 0x70, 0x65, 0x67, 0xd, 0xa, 0xd, 0xa, 0 };
const prog_char http_content_type_binary[43] PROGMEM =
const char http_content_type_binary[43] PROGMEM =
/* "Content-type: application/octet-stream\r\n\r\n" */
{0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6f, 0x63, 0x74, 0x65, 0x74, 0x2d, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0xd, 0xa, 0xd, 0xa, 0 };
const prog_char http_html[6] PROGMEM =
const char http_html[6] PROGMEM =
/* ".html" */
{0x2e, 0x68, 0x74, 0x6d, 0x6c, 0 };
const prog_char http_shtml[7] PROGMEM =
const char http_shtml[7] PROGMEM =
/* ".shtml" */
{0x2e, 0x73, 0x68, 0x74, 0x6d, 0x6c, 0 };
const prog_char http_htm[5] PROGMEM =
const char http_htm[5] PROGMEM =
/* ".htm" */
{0x2e, 0x68, 0x74, 0x6d, 0 };
const prog_char http_css[5] PROGMEM =
const char http_css[5] PROGMEM =
/* ".css" */
{0x2e, 0x63, 0x73, 0x73, 0 };
const prog_char http_png[5] PROGMEM =
const char http_png[5] PROGMEM =
/* ".png" */
{0x2e, 0x70, 0x6e, 0x67, 0 };
const prog_char http_gif[5] PROGMEM =
const char http_gif[5] PROGMEM =
/* ".gif" */
{0x2e, 0x67, 0x69, 0x66, 0 };
const prog_char http_jpg[5] PROGMEM =
const char http_jpg[5] PROGMEM =
/* ".jpg" */
{0x2e, 0x6a, 0x70, 0x67, 0 };
const prog_char http_text[6] PROGMEM =
const char http_text[6] PROGMEM =
/* ".text" */
{0x2e, 0x74, 0x65, 0x78, 0x74, 0 };
const prog_char http_txt[5] PROGMEM =
const char http_txt[5] PROGMEM =
/* ".txt" */
{0x2e, 0x74, 0x78, 0x74, 0 };
const prog_char http_user_agent_fields[77] PROGMEM =
const char http_user_agent_fields[77] PROGMEM =
/* "Connection: close\r\nUser-Agent: uIP/1.0 (; http://www.sics.se/~adam/uip/)\r\n\r\n" */
{0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0xd, 0xa, 0x55, 0x73, 0x65, 0x72, 0x2d, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x3a, 0x20, 0x75, 0x49, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x28, 0x3b, 0x20, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x73, 0x69, 0x63, 0x73, 0x2e, 0x73, 0x65, 0x2f, 0x7e, 0x61, 0x64, 0x61, 0x6d, 0x2f, 0x75, 0x69, 0x70, 0x2f, 0x29, 0xd, 0xa, 0xd, 0xa, 0 };
64 changes: 32 additions & 32 deletions webclient-strings.h
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
#include <avr/pgmspace.h>
extern const prog_char http_http[8];
extern const prog_char http_200[5];
extern const prog_char http_301[5];
extern const prog_char http_302[5];
extern const prog_char http_get[5];
extern const prog_char http_10[9];
extern const prog_char http_11[9];
extern const prog_char http_icy[4];
extern const prog_char http_content_type[15];
extern const prog_char http_texthtml[10];
extern const prog_char http_location[11];
extern const prog_char http_host[7];
extern const prog_char http_crnl[3];
extern const prog_char http_index_html[12];
extern const prog_char http_404_html[10];
extern const prog_char http_content_type_html[28];
extern const prog_char http_content_type_css [27];
extern const prog_char http_content_type_text[28];
extern const prog_char http_content_type_png [28];
extern const prog_char http_content_type_gif [28];
extern const prog_char http_content_type_jpg [29];
extern const prog_char http_content_type_binary[43];
extern const prog_char http_html[6];
extern const prog_char http_shtml[7];
extern const prog_char http_htm[5];
extern const prog_char http_css[5];
extern const prog_char http_png[5];
extern const prog_char http_gif[5];
extern const prog_char http_jpg[5];
extern const prog_char http_text[6];
extern const prog_char http_txt[5];
extern const prog_char http_user_agent_fields[77];
extern const char http_http[8];
extern const char http_200[5];
extern const char http_301[5];
extern const char http_302[5];
extern const char http_get[5];
extern const char http_10[9];
extern const char http_11[9];
extern const char http_icy[4];
extern const char http_content_type[15];
extern const char http_texthtml[10];
extern const char http_location[11];
extern const char http_host[7];
extern const char http_crnl[3];
extern const char http_index_html[12];
extern const char http_404_html[10];
extern const char http_content_type_html[28];
extern const char http_content_type_css [27];
extern const char http_content_type_text[28];
extern const char http_content_type_png [28];
extern const char http_content_type_gif [28];
extern const char http_content_type_jpg [29];
extern const char http_content_type_binary[43];
extern const char http_html[6];
extern const char http_shtml[7];
extern const char http_htm[5];
extern const char http_css[5];
extern const char http_png[5];
extern const char http_gif[5];
extern const char http_jpg[5];
extern const char http_text[6];
extern const char http_txt[5];
extern const char http_user_agent_fields[77];
8 changes: 4 additions & 4 deletions webclient.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ webclient_get(const char *host, u16_t port, const char *file)
}
/*-----------------------------------------------------------------------------------*/
unsigned char
webclient_get_P(const prog_char *host, u16_t port, const prog_char *file)
webclient_get_P(const char *host, u16_t port, const char *file)
{
unsigned char result;

Expand Down Expand Up @@ -197,7 +197,7 @@ copy_string(char *dest,
/*-----------------------------------------------------------------------------------*/
static char *
copy_string_P(char *dest,
const prog_char *src, unsigned char len)
const char *src, unsigned char len)
{
strncpy_P(dest, src, len);
return dest + len;
Expand Down Expand Up @@ -250,7 +250,7 @@ acked(void)
/*-----------------------------------------------------------------------------------*/
char *uip_appdata_ptr;
extern void uip_log(char*);
extern void uip_log_P(prog_char*);
extern void uip_log_P(char*);
/*-----------------------------------------------------------------------------------*/
static u16_t
parse_statusline(u16_t len)
Expand Down Expand Up @@ -334,7 +334,7 @@ casecmp(char *str1, const char *str2, char len)
#endif
/*-----------------------------------------------------------------------------------*/
static char
casecmp_P(char *str1, const prog_char *str2, char len)
casecmp_P(char *str1, const char *str2, char len)
{
static char c;

Expand Down
2 changes: 1 addition & 1 deletion webclient.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ void webclient_init(void);
* \retval 1 if the connection was initiated.
*/
unsigned char webclient_get(const char *host, u16_t port, const char *file);
unsigned char webclient_get_P(const prog_char *host, u16_t port, const prog_char *file);
unsigned char webclient_get_P(const char *host, u16_t port, const char *file);

/**
* Close the currently open HTTP connection.
Expand Down

0 comments on commit 22fe88c

Please sign in to comment.