aboutsummaryrefslogtreecommitdiff
path: root/gns-protocol-numbers/h.footer
blob: 15aade3ef3a156316c87fc4735d36e8f3d2c3749 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
  {
    .name = NULL,
    .number = 0
  }
};

uint16_t
GNUNET_GNS_protocol_name_to_number (const char *name)
{
  int i = 0;
  while (NULL != GNUNET_GNS_Protocols[i].name)
  {
    if (0 == strcmp (name, GNUNET_GNS_Protocols[i].name))
      return GNUNET_GNS_Protocols[i].number;
    i++;
  }
  return 0;
}


const char*
GNUNET_GNS_protocol_number_to_name (uint16_t number)
{
  int i = 0;
  while (NULL != GNUNET_GNS_Protocols[i].name)
  {
    if (number == GNUNET_GNS_Protocols[i].number)
      return GNUNET_GNS_Protocols[i].name;
    i++;
  }
  return NULL;
}


#if 0 /* keep Emacsens' auto-indent happy */
{
#endif
#ifdef __cplusplus
}
#endif

#endif