blob: b5d06f4eef9e9b0ecd967d8fc3823604c80cb0ba (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
/* ISC license. */
#include "service.h"
common_t const *service_common (db_t const *db, stype_t stype, uint32_t i)
{
if (stype >= STYPE_PHAIL) return 0 ;
if (i >= db->n[stype]) return 0 ;
switch (stype)
{
case STYPE_LONGRUN : return &db->longruns[i].common ;
case STYPE_ONESHOT : return &db->oneshots[i].common ;
case STYPE_EXTERNAL : return &db->externals[i].common ;
case STYPE_BUNDLE : return &db->bundles[i].common ;
case STYPE_VIRTUAL : return &db->virtuals[i].common ;
default : return 0 ;
}
}
|