path/namesys: Unified resolver struct.

This commit is contained in:
Jose Marcial Vieira Bisneto 2016-12-01 19:25:16 -03:00
parent 5b7f89bdf1
commit 9ba3112b97
2 changed files with 6 additions and 9 deletions

View file

@ -43,7 +43,13 @@
int (*func)(char**, char*); int (*func)(char**, char*);
} resolvers; } resolvers;
// Resolver provides path resolution to IPFS
// It has a pointer to a DAGService, which is uses to resolve nodes.
// TODO: now that this is more modular, try to unify this code with the
// the resolvers in namesys
typedef struct s_resolver { typedef struct s_resolver {
//DAGService DAG;
//NodeLink *lnk;
// resolveOnce looks up a name once (without recursion). // resolveOnce looks up a name once (without recursion).
int (*resolveOnce) (char **, char *); int (*resolveOnce) (char **, char *);
} resolver; } resolver;

View file

@ -35,13 +35,4 @@
int ParseCidToPath (char *dst, char *txt); int ParseCidToPath (char *dst, char *txt);
int ParsePath (char *dst, char *txt); int ParsePath (char *dst, char *txt);
int PathIsValid (char *p); int PathIsValid (char *p);
// Resolver provides path resolution to IPFS
// It has a pointer to a DAGService, which is uses to resolve nodes.
// TODO: now that this is more modular, try to unify this code with the
// the resolvers in namesys
typedef struct s_resolver {
DAGService DAG;
int (*ResolveOnce)(NodeLink **lnk, Context ctx, DAGService *ds, Node **nd, char *name);
} Resolver;
#endif // IPFS_PATH_H #endif // IPFS_PATH_H