$treeview $search $mathjax $extrastylesheet
librsync
2.0.2
$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 00024 #include <assert.h> 00025 #include <stdlib.h> 00026 #include <stdio.h> 00027 00028 #include "librsync.h" 00029 #include "command.h" 00030 00031 /* For debugging purposes, here are some human-readable forms. */ 00032 struct rs_op_kind_name const rs_op_kind_names[] = { 00033 {"END", RS_KIND_END}, 00034 {"COPY", RS_KIND_COPY}, 00035 {"LITERAL", RS_KIND_LITERAL}, 00036 {"SIGNATURE", RS_KIND_SIGNATURE}, 00037 {"CHECKSUM", RS_KIND_CHECKSUM}, 00038 {"INVALID", RS_KIND_INVALID}, 00039 {NULL, 0} 00040 }; 00041 00042 /** Return a human-readable name for KIND. */ 00043 char const *rs_op_kind_name(enum rs_op_kind kind) 00044 { 00045 const struct rs_op_kind_name *k; 00046 00047 for (k = rs_op_kind_names; k->kind; k++) { 00048 if (k->kind == kind) { 00049 return k->name; 00050 } 00051 } 00052 00053 return NULL; 00054 }