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