version 1.2, 2012/09/20 14:19:45
|
version 1.4, 2016/09/14 15:12:22
|
Line 12 terms:
|
Line 12 terms:
|
All of the documentation and software included in the ELWIX and AITNET |
All of the documentation and software included in the ELWIX and AITNET |
Releases is copyrighted by ELWIX - Sofia/Bulgaria <info@elwix.org> |
Releases is copyrighted by ELWIX - Sofia/Bulgaria <info@elwix.org> |
|
|
Copyright 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 | Copyright 2004 - 2016 |
by Michael Pounov <misho@elwix.org>. All rights reserved. |
by Michael Pounov <misho@elwix.org>. All rights reserved. |
|
|
Redistribution and use in source and binary forms, with or without |
Redistribution and use in source and binary forms, with or without |
Line 54 static const unsigned char base64_table[65] =
|
Line 54 static const unsigned char base64_table[65] =
|
* www_b64encode() - Base64 encode function |
* www_b64encode() - Base64 encode function |
* |
* |
* @src = source data |
* @src = source data |
* return: NULL error or !=NULL encoded variable, after use call io_freeVar() | * return: NULL error or !=NULL encoded variable, after use call ait_freeVar() |
*/ |
*/ |
ait_val_t * |
ait_val_t * |
www_b64encode(ait_val_t * __restrict src) |
www_b64encode(ait_val_t * __restrict src) |
{ |
{ |
ait_val_t v, *ret = NULL; | ait_val_t v = AIT_VAL_INIT, *ret = NULL; |
size_t olen; |
size_t olen; |
const u_char *in, *end; |
const u_char *in, *end; |
u_char *pos, *out; |
u_char *pos, *out; |
Line 111 www_b64encode(ait_val_t * __restrict src)
|
Line 111 www_b64encode(ait_val_t * __restrict src)
|
|
|
*pos = 0; |
*pos = 0; |
|
|
if (!(ret = io_allocVar())) { | if (!(ret = ait_allocVar())) { |
www_SetErr(io_GetErrno(), "%s", io_GetError()); | www_SetErr(elwix_GetErrno(), "%s", elwix_GetError()); |
return NULL; |
return NULL; |
} else { |
} else { |
AIT_INIT_VAL2(ret, string); |
AIT_INIT_VAL2(ret, string); |
Line 126 www_b64encode(ait_val_t * __restrict src)
|
Line 126 www_b64encode(ait_val_t * __restrict src)
|
* www_b64decode() - Base64 decode function |
* www_b64decode() - Base64 decode function |
* |
* |
* @src = source encoded data |
* @src = source encoded data |
* return: NULL error or !=NULL decoded variable, after use call io_freeVar() | * return: NULL error or !=NULL decoded variable, after use call ait_freeVar() |
*/ |
*/ |
ait_val_t * |
ait_val_t * |
www_b64decode(ait_val_t * __restrict src) |
www_b64decode(ait_val_t * __restrict src) |
{ |
{ |
ait_val_t v, *ret = NULL; | ait_val_t v = AIT_VAL_INIT, *ret = NULL; |
u_char dtable[256], *s, *pos, *out, in[4], blk[4]; |
u_char dtable[256], *s, *pos, *out, in[4], blk[4]; |
register size_t i, olen, cx = 0; |
register size_t i, olen, cx = 0; |
|
|
Line 177 www_b64decode(ait_val_t * __restrict src)
|
Line 177 www_b64decode(ait_val_t * __restrict src)
|
pos--; |
pos--; |
} |
} |
|
|
if (!(ret = io_allocVar())) { | if (!(ret = ait_allocVar())) { |
www_SetErr(io_GetErrno(), "%s", io_GetError()); | www_SetErr(elwix_GetErrno(), "%s", elwix_GetError()); |
return NULL; |
return NULL; |
} else { |
} else { |
AIT_INIT_VAL2(ret, string); |
AIT_INIT_VAL2(ret, string); |