base64.c revision ab023a65562e62b85a824509d829b6fad87e00b1
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * Portions Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * Portions Copyright (C) 2001 Internet Software Consortium.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * Portions Copyright (C) 2001 Nominum, Inc.
39f1df3fbd71b6d57c31f6a1b3d7e5194ef63fccAndreas Gustafsson * Permission to use, copy, modify, and distribute this software for any
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * purpose with or without fee is hereby granted, provided that the above
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington * copyright notice and this permission notice appear in all copies.
39f1df3fbd71b6d57c31f6a1b3d7e5194ef63fccAndreas Gustafsson * THE SOFTWARE IS PROVIDED "AS IS" AND ISC AND NOMINUM DISCLAIMS ALL
39f1df3fbd71b6d57c31f6a1b3d7e5194ef63fccAndreas Gustafsson * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
39f1df3fbd71b6d57c31f6a1b3d7e5194ef63fccAndreas Gustafsson * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY
39f1df3fbd71b6d57c31f6a1b3d7e5194ef63fccAndreas Gustafsson * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
39f1df3fbd71b6d57c31f6a1b3d7e5194ef63fccAndreas Gustafsson * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
39f1df3fbd71b6d57c31f6a1b3d7e5194ef63fccAndreas Gustafsson * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
39f1df3fbd71b6d57c31f6a1b3d7e5194ef63fccAndreas Gustafsson * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
39f1df3fbd71b6d57c31f6a1b3d7e5194ef63fccAndreas Gustafsson/* $Id: base64.c,v 1.4 2005/04/27 04:57:25 sra Exp $ */
39f1df3fbd71b6d57c31f6a1b3d7e5194ef63fccAndreas Gustafssonisccc_base64_encode(isccc_region_t *source, int wordlength,
39f1df3fbd71b6d57c31f6a1b3d7e5194ef63fccAndreas Gustafsson const char *wordbreak, isccc_region_t *target)
39f1df3fbd71b6d57c31f6a1b3d7e5194ef63fccAndreas Gustafsson sr.length = source->rend - source->rstart;
39f1df3fbd71b6d57c31f6a1b3d7e5194ef63fccAndreas Gustafsson isc_buffer_init(&tb, target->rstart, target->rend - target->rstart);
39f1df3fbd71b6d57c31f6a1b3d7e5194ef63fccAndreas Gustafsson result = isc_base64_totext(&sr, wordlength, wordbreak, &tb);
c3cc5b5bcfd045692d2a36cbf2da62bc356ca69fAndreas Gustafssonisccc_base64_decode(const char *cstr, isccc_region_t *target) {
c3cc5b5bcfd045692d2a36cbf2da62bc356ca69fAndreas Gustafsson isc_buffer_init(&b, target->rstart, target->rend - target->rstart);
return (result);
return (ISC_R_SUCCESS);