path: Fixed ErrPath error.

This commit is contained in:
Jose Marcial Vieira Bisneto 2016-11-29 20:34:59 -03:00
parent d6e92026a2
commit d761e6062b
2 changed files with 15 additions and 10 deletions

View file

@ -1,16 +1,20 @@
#ifndef IPFS_PATH_H #ifndef IPFS_PATH_H
#define IPFS_PATH_H #define IPFS_PATH_H
char *ErrPath[] = { #ifdef IPFS_PATH_C
NULL, char *ErrPath[] = {
// ErrBadPath is returned when a given path is incorrectly formatted NULL,
"invalid 'ipfs ref' path", // ErrBadPath is returned when a given path is incorrectly formatted
// Paths after a protocol must contain at least one component "invalid 'ipfs ref' path",
"path must contain at least one component", // Paths after a protocol must contain at least one component
"TODO: ErrCidDecode", "path must contain at least one component",
NULL, "TODO: ErrCidDecode",
"no link named %s under %s" NULL,
}; "no link named %s under %s"
};
#else
extern char **ErrPath;
#endif // IPFS_PATH_C
enum { enum {
ErrBadPath = 1, ErrBadPath = 1,

View file

@ -1,6 +1,7 @@
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <ipfs/cid/cid.h> #include <ipfs/cid/cid.h>
#define IPFS_PATH_C
#include <ipfs/path/path.h> #include <ipfs/path/path.h>
// FromCid safely converts a cid.Cid type to a Path type // FromCid safely converts a cid.Cid type to a Path type