namesys/path: Changed error messages to a separate file.

This commit is contained in:
Jose Marcial Vieira Bisneto 2016-12-08 07:08:34 -03:00
parent 84f24797f4
commit 7a3d0c5e0b
5 changed files with 48 additions and 60 deletions

View file

@ -1,30 +1,7 @@
#ifndef IPFS_PATH_H
#define IPFS_PATH_H
#ifdef IPFS_PATH_C
char *ErrPath[] = {
NULL,
"ErrAllocFailed",
// ErrBadPath is returned when a given path is incorrectly formatted
"invalid 'ipfs ref' path",
// Paths after a protocol must contain at least one component
"path must contain at least one component",
"TODO: ErrCidDecode",
NULL,
"no link named %s under %s"
};
#else
extern char **ErrPath;
#endif // IPFS_PATH_C
enum {
ErrAllocFailed = 1,
ErrBadPath,
ErrNoComponents,
ErrCidDecode,
ErrNoLink,
ErrNoLinkFmt
} PathErrs;
#include "ipfs/errs.h"
char* ipfs_path_from_cid (struct Cid *c);
char** ipfs_path_split_n (char *p, char *delim, int n);