c-ipfs/namesys/pb.c

20 lines
358 B
C
Raw Normal View History

2016-12-16 03:28:12 +00:00
#include <string.h>
#include "ipfs/namesys/pb.h"
int IpnsEntry_ValidityType_value (char *s)
{
int r;
if (!s) {
return -1; // invalid.
}
for (r = 0 ; IpnsEntry_ValidityType_name[r] ; r++) {
if (strcmp (IpnsEntry_ValidityType_name[r], s) == 0) {
return r; // found
}
}
return -1; // not found.
}