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