summaryrefslogtreecommitdiff
path: root/src/resolve
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-10-24 22:58:24 +0200
committerLennart Poettering <lennart@poettering.net>2015-10-24 23:05:02 +0200
commit07630cea1f3a845c09309f197ac7c4f11edd3b62 (patch)
treeaf80c7221d1466fac79a7f3a57e0d63a96f464d4 /src/resolve
parent4f5dd3943bef8a04be7e3b838b822bb9a7ad6cb3 (diff)
util-lib: split our string related calls from util.[ch] into its own file string-util.[ch]
There are more than enough calls doing string manipulations to deserve its own files, hence do something about it. This patch also sorts the #include blocks of all files that needed to be updated, according to the sorting suggestions from CODING_STYLE. Since pretty much every file needs our string manipulation functions this effectively means that most files have sorted #include blocks now. Also touches a few unrelated include files.
Diffstat (limited to 'src/resolve')
-rw-r--r--src/resolve/resolved-conf.c2
-rw-r--r--src/resolve/resolved-dns-answer.c3
-rw-r--r--src/resolve/resolved-dns-rr.c8
-rw-r--r--src/resolve/resolved-dns-zone.c6
-rw-r--r--src/resolve/resolved-link.c4
-rw-r--r--src/resolve/resolved-manager.c22
6 files changed, 24 insertions, 21 deletions
diff --git a/src/resolve/resolved-conf.c b/src/resolve/resolved-conf.c
index cc8d5fa76a..aca0d891c6 100644
--- a/src/resolve/resolved-conf.c
+++ b/src/resolve/resolved-conf.c
@@ -20,7 +20,7 @@
***/
#include "conf-parser.h"
-
+#include "string-util.h"
#include "resolved-conf.h"
int manager_parse_dns_server(Manager *m, DnsServerType type, const char *string) {
diff --git a/src/resolve/resolved-dns-answer.c b/src/resolve/resolved-dns-answer.c
index 89b9b0e1ea..e1a2865007 100644
--- a/src/resolve/resolved-dns-answer.c
+++ b/src/resolve/resolved-dns-answer.c
@@ -19,8 +19,9 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "resolved-dns-answer.h"
#include "dns-domain.h"
+#include "resolved-dns-answer.h"
+#include "string-util.h"
DnsAnswer *dns_answer_new(unsigned n) {
DnsAnswer *a;
diff --git a/src/resolve/resolved-dns-rr.c b/src/resolve/resolved-dns-rr.c
index 2bc8cc1639..c8f591d005 100644
--- a/src/resolve/resolved-dns-rr.c
+++ b/src/resolve/resolved-dns-rr.c
@@ -21,12 +21,12 @@
#include <math.h>
-#include "strv.h"
-
#include "dns-domain.h"
-#include "resolved-dns-rr.h"
-#include "resolved-dns-packet.h"
#include "dns-type.h"
+#include "resolved-dns-packet.h"
+#include "string-util.h"
+#include "strv.h"
+#include "resolved-dns-rr.h"
DnsResourceKey* dns_resource_key_new(uint16_t class, uint16_t type, const char *name) {
DnsResourceKey *k;
diff --git a/src/resolve/resolved-dns-zone.c b/src/resolve/resolved-dns-zone.c
index 8a59bd1c3c..8a6086a4de 100644
--- a/src/resolve/resolved-dns-zone.c
+++ b/src/resolve/resolved-dns-zone.c
@@ -19,11 +19,11 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "list.h"
-
-#include "resolved-dns-zone.h"
#include "dns-domain.h"
+#include "list.h"
#include "resolved-dns-packet.h"
+#include "resolved-dns-zone.h"
+#include "string-util.h"
/* Never allow more than 1K entries */
#define ZONE_MAX 1024
diff --git a/src/resolve/resolved-link.c b/src/resolve/resolved-link.c
index b9fd8e3dbc..43a3b61b08 100644
--- a/src/resolve/resolved-link.c
+++ b/src/resolve/resolved-link.c
@@ -22,9 +22,11 @@
#include <net/if.h>
#include "sd-network.h"
-#include "strv.h"
+
#include "missing.h"
#include "resolved-link.h"
+#include "string-util.h"
+#include "strv.h"
int link_new(Manager *m, Link **ret, int ifindex) {
_cleanup_(link_freep) Link *l = NULL;
diff --git a/src/resolve/resolved-manager.c b/src/resolve/resolved-manager.c
index de924e3ed9..b410e40308 100644
--- a/src/resolve/resolved-manager.c
+++ b/src/resolve/resolved-manager.c
@@ -19,26 +19,26 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <netinet/in.h>
+#include <poll.h>
#include <resolv.h>
#include <sys/ioctl.h>
-#include <poll.h>
-#include <netinet/in.h>
-#include "netlink-util.h"
-#include "network-internal.h"
-#include "socket-util.h"
#include "af-list.h"
-#include "utf8.h"
+#include "dns-domain.h"
#include "fileio-label.h"
+#include "hostname-util.h"
+#include "netlink-util.h"
+#include "network-internal.h"
#include "ordered-set.h"
#include "random-util.h"
-#include "hostname-util.h"
-
-#include "dns-domain.h"
-#include "resolved-conf.h"
#include "resolved-bus.h"
-#include "resolved-manager.h"
+#include "resolved-conf.h"
#include "resolved-llmnr.h"
+#include "resolved-manager.h"
+#include "socket-util.h"
+#include "string-util.h"
+#include "utf8.h"
#define SEND_TIMEOUT_USEC (200 * USEC_PER_MSEC)