author | kergoth <kergoth> | 2002-01-25 22:14:26 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2002-01-25 22:14:26 (UTC) |
commit | 15318cad33835e4e2dc620d033e43cd930676cdd (patch) (unidiff) | |
tree | c2fa0399a2c47fda8e2cd0092c73a809d17f68eb /rsync/command.c | |
download | opie-15318cad33835e4e2dc620d033e43cd930676cdd.zip opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.gz opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.bz2 |
Initial revision
-rw-r--r-- | rsync/command.c | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/rsync/command.c b/rsync/command.c new file mode 100644 index 0000000..9d56733 --- a/dev/null +++ b/rsync/command.c | |||
@@ -0,0 +1,61 @@ | |||
1 | /*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- | ||
2 | * | ||
3 | * librsync -- the library for network deltas | ||
4 | * $Id$ | ||
5 | * | ||
6 | * Copyright (C) 2000 by Martin Pool <mbp@samba.org> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU Lesser General Public License | ||
10 | * as published by the Free Software Foundation; either version 2.1 of | ||
11 | * the License, or (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, but | ||
14 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | * Lesser General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU Lesser General Public | ||
19 | * License along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
21 | */ | ||
22 | |||
23 | |||
24 | #include <config_rsync.h> | ||
25 | |||
26 | #include <assert.h> | ||
27 | #include <stdlib.h> | ||
28 | #include <stdio.h> | ||
29 | |||
30 | #include "rsync.h" | ||
31 | #include "command.h" | ||
32 | |||
33 | /* For debugging purposes, here are some human-readable forms. */ | ||
34 | struct rs_op_kind_name const rs_op_kind_names[] = { | ||
35 | {"END", RS_KIND_END }, | ||
36 | {"COPY", RS_KIND_COPY }, | ||
37 | {"LITERAL", RS_KIND_LITERAL }, | ||
38 | {"SIGNATURE", RS_KIND_SIGNATURE }, | ||
39 | {"CHECKSUM", RS_KIND_CHECKSUM }, | ||
40 | {"INVALID", RS_KIND_INVALID }, | ||
41 | {NULL, 0 } | ||
42 | }; | ||
43 | |||
44 | |||
45 | /* | ||
46 | * Return a human-readable name for KIND. | ||
47 | */ | ||
48 | char const * rs_op_kind_name(enum rs_op_kind kind) | ||
49 | { | ||
50 | const struct rs_op_kind_name *k; | ||
51 | |||
52 | for (k = rs_op_kind_names; k->kind; k++) { | ||
53 | if (k->kind == kind) { | ||
54 | return k->name; | ||
55 | } | ||
56 | } | ||
57 | |||
58 | return NULL; | ||
59 | } | ||
60 | |||
61 | |||