chiark / gitweb /
tree-wide: remove Lennart's copyright lines
[elogind.git] / src / basic / hostname-util.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 #pragma once
3
4 #include <stdbool.h>
5 //#include <stdio.h>
6
7 #include "macro.h"
8
9 #if 0 /// UNNEEDED by elogind
10 bool hostname_is_set(void);
11 #endif // 0
12
13 char* gethostname_malloc(void);
14 #if 0 /// UNNEEDED by elogind
15 int gethostname_strict(char **ret);
16 #endif // 0
17
18 bool hostname_is_valid(const char *s, bool allow_trailing_dot) _pure_;
19 #if 0 /// UNNEEDED by elogind
20 char* hostname_cleanup(char *s);
21 #endif // 0
22
23 #define machine_name_is_valid(s) hostname_is_valid(s, false)
24
25 bool is_localhost(const char *hostname);
26 #if 0 /// UNNEEDED by elogind
27 bool is_gateway_hostname(const char *hostname);
28
29 int sethostname_idempotent(const char *s);
30
31 #endif // 0
32 int shorten_overlong(const char *s, char **ret);
33
34 int read_etc_hostname_stream(FILE *f, char **ret);
35 int read_etc_hostname(const char *path, char **ret);