aboutsummaryrefslogtreecommitdiffstats
path: root/src/blogc/sysinfo.h
blob: 23b7ba6f2425bba45b19992b107a5ab5ba4e8b24 (plain)
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
/*
 * blogc: A blog compiler.
 * Copyright (C) 2014-2019 Rafael G. Martins <rafael@rafaelmartins.eng.br>
 *
 * This program can be distributed under the terms of the BSD License.
 * See the file LICENSE.
 */

#ifndef ___SYSINFO_H
#define ___SYSINFO_H

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif /* HAVE_CONFIG_H */

#ifdef HAVE_UNISTD_H
#ifdef HAVE_GETHOSTNAME
#define HAVE_SYSINFO_HOSTNAME 1
#endif /* HAVE_GETHOSTNAME */
#endif /* HAVE_UNISTD_H */

#ifdef HAVE_TIME_H
#define HAVE_SYSINFO_DATETIME 1
#endif /* HAVE_TIME_H */

#include <stdbool.h>
#include <squareball.h>

char* blogc_sysinfo_get_hostname(void);
void blogc_sysinfo_inject_hostname(sb_trie_t *global);
char* blogc_sysinfo_get_username(void);
void blogc_sysinfo_inject_username(sb_trie_t *global);
char* blogc_sysinfo_get_datetime(void);
void blogc_sysinfo_inject_datetime(sb_trie_t *global);
bool blogc_sysinfo_get_inside_docker(void);
void blogc_sysinfo_inject_inside_docker(sb_trie_t *global);

#endif /* ___SYSINFO_H */