Added path pointer used to return value in Resolve and ResolveN.

This commit is contained in:
Jose Marcial Vieira Bisneto 2016-11-24 07:52:15 -03:00
parent 7ddba70ada
commit 05c45666e5
3 changed files with 43 additions and 15 deletions

View file

@ -11,7 +11,8 @@
"Could not resolve name.",
"Could not resolve name (recursion limit exceeded).",
"expired record",
"unrecognized validity type"
"unrecognized validity type",
"not a valid proquint string"
};
enum {
@ -21,7 +22,8 @@
ErrResolveFailed,
ErrResolveRecursion,
ErrExpiredRecord,
ErrUnrecognizedValidity
ErrUnrecognizedValidity,
ErrInvalidProquint
} NamesysErrs;
typedef struct s_resolvers {
@ -29,6 +31,11 @@
int (*func)(char**, char*);
} resolvers;
typedef struct s_resolver {
// resolveOnce looks up a name once (without recursion).
int (*resolveOnce) (char **, char *);
} resolver;
//TODO ciPrivKey from c-libp2p-crypto
typedef void* ciPrivKey;
@ -42,4 +49,11 @@
resolvers *resolver;
publishers *Publisher;
} mpns;
int resolve (resolver *r, char **p, char *str, int depth, char **prefixes);
int Resolve(char **path, char *name);
int ResolveN(char **path, char *name, int depth);
int resolveOnce (char **path, char *name);
int Publish (char *proto, ciPrivKey name, char *value);
int PublishWithEOL (char *proto, ciPrivKey name, char *value, time_t eol);
#endif //NAMESYS_H