librsync  2.0.2
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 error messages for re_result values.
37  *
38  * \todo (Suggestion by tridge) Add a function which outputs a complete text
39  * description of a job, including only the fields relevant to the current
40  * encoding function. */
41 
42 #include "config.h"
43 
44 #include <stdlib.h>
45 #include <stdio.h>
46 
47 #include "librsync.h"
48 
49 char const *rs_strerror(rs_result r)
50 {
51  switch (r) {
52  case RS_DONE:
53  return "OK";
54  case RS_RUNNING:
55  return "still running";
56  case RS_BLOCKED:
57  return "blocked waiting for input or output buffers";
58  case RS_BAD_MAGIC:
59  return "bad magic number at start of stream";
60  case RS_INPUT_ENDED:
61  return "unexpected end of input";
62  case RS_CORRUPT:
63  return "stream corrupt";
64  case RS_UNIMPLEMENTED:
65  return "unimplemented case";
66  case RS_MEM_ERROR:
67  return "out of memory";
68  case RS_IO_ERROR:
69  return "IO error";
70  case RS_SYNTAX_ERROR:
71  return "bad command line syntax";
72  case RS_INTERNAL_ERROR:
73  return "library internal error";
74 
75  default:
76  return "unexplained problem";
77  }
78 }
Command line syntax error.
Definition: librsync.h:169
Out of memory.
Definition: librsync.h:170
Bad magic number at start of stream.
Definition: librsync.h:174
Unbelievable value in stream.
Definition: librsync.h:179
Error in file or network IO.
Definition: librsync.h:168
Public header for librsync.
Author is lazy.
Definition: librsync.h:178
char const * rs_strerror(rs_result r)
Return an English description of a rs_result value.
Definition: msg.c:49
rs_result
Return codes from nonblocking rsync operations.
Definition: librsync.h:161
Unexpected end of input file, perhaps due to a truncated file or dropped network connection.
Definition: librsync.h:171
Blocked waiting for more data.
Definition: librsync.h:163
Probably a library bug.
Definition: librsync.h:180
The job is still running, and not yet finished or blocked.
Definition: librsync.h:164
Completed successfully.
Definition: librsync.h:162