librsync  2.0.1
msg.c
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 <[email protected]>
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  /*
24  | Welcome to Arco AM/PM Mini-Market. We
25  | would like to advise our customers
26  | that any individual who offers to
27  | pump gas, wash windows or solicit
28  | products is not employed by or
29  | associated with this facility. We
30  | discourage any contact with these
31  | individuals and ask that you report
32  | any problems to uniformed personal
33  | inside. Thankyou for shopping at
34  | Arco, and have a nice day.
35  */
36 
37 #include "config.h"
38 
39 #include <stdlib.h>
40 #include <stdio.h>
41 
42 #include "librsync.h"
43 
44 /*
45  * TODO: (Suggestion by tridge) Add a function which outputs a
46  * complete text description of a job, including only the fields
47  * relevant to the current encoding function.
48  */
49 
50 
51 char const *rs_strerror(rs_result r)
52 {
53  switch (r) {
54  case RS_DONE:
55  return "OK";
56  case RS_RUNNING:
57  return "still running";
58  case RS_BLOCKED:
59  return "blocked waiting for input or output buffers";
60  case RS_BAD_MAGIC:
61  return "bad magic number at start of stream";
62  case RS_INPUT_ENDED:
63  return "unexpected end of input";
64  case RS_CORRUPT:
65  return "stream corrupt";
66  case RS_UNIMPLEMENTED:
67  return "unimplemented case";
68  case RS_MEM_ERROR:
69  return "out of memory";
70  case RS_IO_ERROR:
71  return "IO error";
72  case RS_SYNTAX_ERROR:
73  return "bad command line syntax";
74  case RS_INTERNAL_ERROR:
75  return "library internal error";
76 
77  default:
78  return "unexplained problem";
79  }
80 }
Command line syntax error.
Definition: librsync.h:203
Out of memory.
Definition: librsync.h:204
Bad magic number at start of stream.
Definition: librsync.h:208
Unbelievable value in stream.
Definition: librsync.h:214
Error in file or network IO.
Definition: librsync.h:202
Public header for librsync.
Author is lazy.
Definition: librsync.h:213
char const * rs_strerror(rs_result r)
Return an English description of a rs_result value.
Definition: msg.c:51
rs_result
Return codes from nonblocking rsync operations.
Definition: librsync.h:192
Unexpected end of input file, perhaps due to a truncated file or dropped network connection.
Definition: librsync.h:207
Blocked waiting for more data.
Definition: librsync.h:194
Probably a library bug.
Definition: librsync.h:215
The job is still running, and not yet finished or blocked.
Definition: librsync.h:198
Completed successfully.
Definition: librsync.h:193