$treeview $search $mathjax $extrastylesheet
librsync
2.3.1
$projectbrief
|
$projectbrief
|
$searchbox |
00001 /*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- 00002 * 00003 * librsync -- the library for network deltas 00004 * 00005 * Copyright (C) 2000 by Martin Pool <mbp@sourcefrog.net> 00006 * 00007 * This program is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Lesser General Public License 00009 * as published by the Free Software Foundation; either version 2.1 of 00010 * the License, or (at your option) any later version. 00011 * 00012 * This program is distributed in the hope that it will be useful, but 00013 * WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * Lesser General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Lesser General Public 00018 * License along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00020 */ 00021 00022 #include "config.h" 00023 #include <assert.h> 00024 #include <stdlib.h> 00025 #include "librsync.h" 00026 #include "command.h" 00027 00028 /* For debugging purposes, here are some human-readable forms. */ 00029 struct rs_op_kind_name const rs_op_kind_names[] = { 00030 {"END", RS_KIND_END}, 00031 {"COPY", RS_KIND_COPY}, 00032 {"LITERAL", RS_KIND_LITERAL}, 00033 {"SIGNATURE", RS_KIND_SIGNATURE}, 00034 {"CHECKSUM", RS_KIND_CHECKSUM}, 00035 {"INVALID", RS_KIND_INVALID}, 00036 {NULL, 0} 00037 }; 00038 00039 /** Return a human-readable name for KIND. */ 00040 char const *rs_op_kind_name(enum rs_op_kind kind) 00041 { 00042 const struct rs_op_kind_name *k; 00043 00044 for (k = rs_op_kind_names; k->kind; k++) { 00045 if (k->kind == kind) { 00046 return k->name; 00047 } 00048 } 00049 00050 return NULL; 00051 }