librsync  2.3.4
msg.c
Go to the documentation of this file.
1/*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*-
2 *
3 * librsync -- the library for network deltas
4 *
5 * Copyright (C) 2000, 2001 by Martin Pool <mbp@sourcefrog.net>
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public License
9 * as published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 */
21
22 /*=
23 | Welcome to Arco AM/PM Mini-Market. We
24 | would like to advise our customers
25 | that any individual who offers to
26 | pump gas, wash windows or solicit
27 | products is not employed by or
28 | associated with this facility. We
29 | discourage any contact with these
30 | individuals and ask that you report
31 | any problems to uniformed personal
32 | inside. Thankyou for shopping at
33 | Arco, and have a nice day.
34 */
35
36/** \file msg.c
37 * error messages for re_result values.
38 *
39 * \todo (Suggestion by tridge) Add a function which outputs a complete text
40 * description of a job, including only the fields relevant to the current
41 * encoding function. */
42
43#include "config.h" /* IWYU pragma: keep */
44#include "librsync.h"
45
46char const *rs_strerror(rs_result r)
47{
48 switch (r) {
49 case RS_DONE:
50 return "OK";
51 case RS_RUNNING:
52 return "still running";
53 case RS_BLOCKED:
54 return "blocked waiting for input or output buffers";
55 case RS_BAD_MAGIC:
56 return "bad magic number at start of stream";
57 case RS_INPUT_ENDED:
58 return "unexpected end of input";
59 case RS_CORRUPT:
60 return "stream corrupt";
62 return "unimplemented case";
63 case RS_MEM_ERROR:
64 return "out of memory";
65 case RS_IO_ERROR:
66 return "IO error";
67 case RS_SYNTAX_ERROR:
68 return "bad command line syntax";
70 return "library internal error";
71
72 default:
73 return "unexplained problem";
74 }
75}
Public header for librsync.
rs_result
Return codes from nonblocking rsync operations.
Definition: librsync.h:180
@ RS_MEM_ERROR
Out of memory.
Definition: librsync.h:189
@ RS_RUNNING
The job is still running, and not yet finished or blocked.
Definition: librsync.h:183
@ RS_UNIMPLEMENTED
Author is lazy.
Definition: librsync.h:197
@ RS_DONE
Completed successfully.
Definition: librsync.h:181
@ RS_CORRUPT
Unbelievable value in stream.
Definition: librsync.h:198
@ RS_INPUT_ENDED
Unexpected end of input file, perhaps due to a truncated file or dropped network connection.
Definition: librsync.h:190
@ RS_SYNTAX_ERROR
Command line syntax error.
Definition: librsync.h:188
@ RS_BAD_MAGIC
Bad magic number at start of stream.
Definition: librsync.h:193
@ RS_INTERNAL_ERROR
Probably a library bug.
Definition: librsync.h:199
@ RS_BLOCKED
Blocked waiting for more data.
Definition: librsync.h:182
@ RS_IO_ERROR
Error in file or network IO.
Definition: librsync.h:187
char const * rs_strerror(rs_result r)
Return an English description of a rs_result value.
Definition: msg.c:46