aboutsummaryrefslogtreecommitdiff
path: root/src/mime.c
diff options
context:
space:
mode:
authorDiego Nehab <diego@tecgraf.puc-rio.br>2004-01-24 02:47:24 +0000
committerDiego Nehab <diego@tecgraf.puc-rio.br>2004-01-24 02:47:24 +0000
commit62a4c505e488c714e8795ea85564504562d30301 (patch)
treef270f53f26905b7275cea172e52ebc269a41c695 /src/mime.c
parent0c9f420a3549df3fb331bb24157b65a3301641d4 (diff)
downloadluasocket-62a4c505e488c714e8795ea85564504562d30301.tar.gz
luasocket-62a4c505e488c714e8795ea85564504562d30301.tar.bz2
luasocket-62a4c505e488c714e8795ea85564504562d30301.zip
Working on the manual...
Making better tests for error messages. Changed a few names. Moved gethostname to inet.c.
Diffstat (limited to 'src/mime.c')
-rw-r--r--src/mime.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/mime.c b/src/mime.c
index 8e97f8b..95cd400 100644
--- a/src/mime.c
+++ b/src/mime.c
@@ -27,12 +27,12 @@ static const char EQCRLF[3] = {'=', CR, LF};
27/*=========================================================================*\ 27/*=========================================================================*\
28* Internal function prototypes. 28* Internal function prototypes.
29\*=========================================================================*/ 29\*=========================================================================*/
30static int mime_global_fmt(lua_State *L); 30static int mime_global_wrp(lua_State *L);
31static int mime_global_b64(lua_State *L); 31static int mime_global_b64(lua_State *L);
32static int mime_global_unb64(lua_State *L); 32static int mime_global_unb64(lua_State *L);
33static int mime_global_qp(lua_State *L); 33static int mime_global_qp(lua_State *L);
34static int mime_global_unqp(lua_State *L); 34static int mime_global_unqp(lua_State *L);
35static int mime_global_qpfmt(lua_State *L); 35static int mime_global_qpwrp(lua_State *L);
36static int mime_global_eol(lua_State *L); 36static int mime_global_eol(lua_State *L);
37 37
38static void b64setup(UC *b64unbase); 38static void b64setup(UC *b64unbase);
@@ -54,10 +54,10 @@ static luaL_reg func[] = {
54 { "eol", mime_global_eol }, 54 { "eol", mime_global_eol },
55 { "qp", mime_global_qp }, 55 { "qp", mime_global_qp },
56 { "unqp", mime_global_unqp }, 56 { "unqp", mime_global_unqp },
57 { "qpfmt", mime_global_qpfmt }, 57 { "qpwrp", mime_global_qpwrp },
58 { "b64", mime_global_b64 }, 58 { "b64", mime_global_b64 },
59 { "unb64", mime_global_unb64 }, 59 { "unb64", mime_global_unb64 },
60 { "fmt", mime_global_fmt }, 60 { "wrp", mime_global_wrp },
61 { NULL, NULL } 61 { NULL, NULL }
62}; 62};
63 63
@@ -127,13 +127,13 @@ static const char *optlstring(lua_State *L, int n, const char *v, size_t *l)
127\*=========================================================================*/ 127\*=========================================================================*/
128/*-------------------------------------------------------------------------*\ 128/*-------------------------------------------------------------------------*\
129* Incrementaly breaks a string into lines 129* Incrementaly breaks a string into lines
130* A, n = fmt(l, B, length, marker) 130* A, n = wrp(l, B, length, marker)
131* A is a copy of B, broken into lines of at most 'length' bytes. 131* A is a copy of B, broken into lines of at most 'length' bytes.
132* 'l' is how many bytes are left for the first line of B. 132* 'l' is how many bytes are left for the first line of B.
133* 'n' is the number of bytes left in the last line of A. 133* 'n' is the number of bytes left in the last line of A.
134* Marker is the end-of-line marker. 134* Marker is the end-of-line marker.
135\*-------------------------------------------------------------------------*/ 135\*-------------------------------------------------------------------------*/
136static int mime_global_fmt(lua_State *L) 136static int mime_global_wrp(lua_State *L)
137{ 137{
138 size_t size = 0; 138 size_t size = 0;
139 int left = (int) luaL_checknumber(L, 1); 139 int left = (int) luaL_checknumber(L, 1);
@@ -526,14 +526,14 @@ static int mime_global_unqp(lua_State *L)
526 526
527/*-------------------------------------------------------------------------*\ 527/*-------------------------------------------------------------------------*\
528* Incrementally breaks a quoted-printed string into lines 528* Incrementally breaks a quoted-printed string into lines
529* A, n = qpfmt(l, B, length) 529* A, n = qpwrp(l, B, length)
530* A is a copy of B, broken into lines of at most 'length' bytes. 530* A is a copy of B, broken into lines of at most 'length' bytes.
531* 'l' is how many bytes are left for the first line of B. 531* 'l' is how many bytes are left for the first line of B.
532* 'n' is the number of bytes left in the last line of A. 532* 'n' is the number of bytes left in the last line of A.
533* There are two complications: lines can't be broken in the middle 533* There are two complications: lines can't be broken in the middle
534* of an encoded =XX, and there might be line breaks already 534* of an encoded =XX, and there might be line breaks already
535\*-------------------------------------------------------------------------*/ 535\*-------------------------------------------------------------------------*/
536static int mime_global_qpfmt(lua_State *L) 536static int mime_global_qpwrp(lua_State *L)
537{ 537{
538 size_t size = 0; 538 size_t size = 0;
539 int left = (int) luaL_checknumber(L, 1); 539 int left = (int) luaL_checknumber(L, 1);