aboutsummaryrefslogtreecommitdiff
path: root/gns-protocol-numbers/h.footer
blob: cb0d854881d3ddd85ce6519143188875bc071a90 (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
43
44
45
46
47
  {
    .name = NULL,
    .number = 0
  }
};

uint16_t
GNUNET_GNS_protocol_name_to_number (const char *name);

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);

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