lighttpd1.4/src/status_counter.h

43 lines
983 B
C
Raw Normal View History

#ifndef _STATUS_COUNTER_H_
#define _STATUS_COUNTER_H_
#include "first.h"
#include "base_decls.h"
2018-09-23 04:06:07 +00:00
static inline
int *status_counter_get_counter(const char *s, size_t len);
2018-09-23 04:06:07 +00:00
static inline
void status_counter_inc(const char *s, size_t len);
2018-09-23 04:06:07 +00:00
static inline
void status_counter_dec(const char *s, size_t len);
2018-09-23 04:06:07 +00:00
static inline
void status_counter_set(const char *s, size_t len, int val);
2018-09-23 04:06:07 +00:00
/* inline status counter routines */
#include "plugin.h"
2018-09-23 04:06:07 +00:00
2019-10-09 03:31:34 +00:00
__attribute_returns_nonnull__
2018-09-23 04:06:07 +00:00
static inline
int *status_counter_get_counter(const char *s, size_t len) {
return array_get_int_ptr(&plugin_stats, s, len);
2018-09-23 04:06:07 +00:00
}
static inline
void status_counter_inc(const char *s, size_t len) {
++(*array_get_int_ptr(&plugin_stats, s, len));
2018-09-23 04:06:07 +00:00
}
static inline
void status_counter_dec(const char *s, size_t len) {
--(*array_get_int_ptr(&plugin_stats, s, len));
2018-09-23 04:06:07 +00:00
}
static inline
void status_counter_set(const char *s, size_t len, int val) {
*array_get_int_ptr(&plugin_stats, s, len) = val;
2018-09-23 04:06:07 +00:00
}
#endif