summaryrefslogtreecommitdiff
path: root/src/libs6rc/s6rc_service_id.c
blob: 3b231617cdb693332dd27ed9d5e0c5979a318027 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
/* ISC license. */

#include <stdint.h>

#include <s6-rc/db.h>

uint32_t s6rc_service_id (uint32_t const *dbn, uint8_t type, uint32_t num)
{
  uint32_t acc = 0 ;
  for (uint8_t t = 0 ; t < type ; t++) acc += dbn[t] ;
  return acc + num ;
}