aboutsummaryrefslogtreecommitdiff
path: root/gns-protocol-numbers/h.footer
diff options
context:
space:
mode:
Diffstat (limited to 'gns-protocol-numbers/h.footer')
-rw-r--r--gns-protocol-numbers/h.footer42
1 files changed, 42 insertions, 0 deletions
diff --git a/gns-protocol-numbers/h.footer b/gns-protocol-numbers/h.footer
new file mode 100644
index 0000000..15aade3
--- /dev/null
+++ b/gns-protocol-numbers/h.footer
@@ -0,0 +1,42 @@
1 {
2 .name = NULL,
3 .number = 0
4 }
5};
6
7uint16_t
8GNUNET_GNS_protocol_name_to_number (const char *name)
9{
10 int i = 0;
11 while (NULL != GNUNET_GNS_Protocols[i].name)
12 {
13 if (0 == strcmp (name, GNUNET_GNS_Protocols[i].name))
14 return GNUNET_GNS_Protocols[i].number;
15 i++;
16 }
17 return 0;
18}
19
20
21const char*
22GNUNET_GNS_protocol_number_to_name (uint16_t number)
23{
24 int i = 0;
25 while (NULL != GNUNET_GNS_Protocols[i].name)
26 {
27 if (number == GNUNET_GNS_Protocols[i].number)
28 return GNUNET_GNS_Protocols[i].name;
29 i++;
30 }
31 return NULL;
32}
33
34
35#if 0 /* keep Emacsens' auto-indent happy */
36{
37#endif
38#ifdef __cplusplus
39}
40#endif
41
42#endif