$treeview $search $mathjax $extrastylesheet
librsync
2.0.2
$projectbrief
|
$projectbrief
|
$searchbox |
00001 /*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- 00002 * 00003 * Copyright (C) 2000, 2001 by Martin Pool <mbp@sourcefrog.net> 00004 * 00005 * This program is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU Lesser General Public License as published by 00007 * the Free Software Foundation; either version 2.1 of the License, or 00008 * (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU Lesser General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU Lesser General Public License 00016 * along with this program; if not, write to the Free Software 00017 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00018 */ 00019 00020 #include "config.h" 00021 00022 #include <assert.h> 00023 #include <sys/types.h> 00024 #ifdef HAVE_INTTYPES_H 00025 # include <inttypes.h> 00026 #endif 00027 #include <stdlib.h> 00028 #include <stdio.h> 00029 00030 #include "librsync.h" 00031 00032 void rs_hexify(char *to_buf, void const *from, int from_len) 00033 { 00034 static const char hex_chars[] = "0123456789abcdef"; 00035 unsigned char const *from_buf = (unsigned char const *)from; 00036 00037 while (from_len-- > 0) { 00038 *(to_buf++) = hex_chars[((*from_buf) >> 4) & 0xf]; 00039 *(to_buf++) = hex_chars[(*from_buf) & 0xf]; 00040 from_buf++; 00041 } 00042 00043 *to_buf = 0; 00044 }