From 057c7a4df4ec1bd70c660cfe03a590e996c744ad Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Fri, 12 Nov 2021 23:12:51 +0100 Subject: [PATCH] Move str_util to str Simplify naming. --- app/meson.build | 12 ++++++------ app/src/adb.c | 2 +- app/src/cli.c | 2 +- app/src/control_msg.c | 2 +- app/src/icon.c | 2 +- app/src/recorder.c | 2 +- app/src/server.c | 2 +- app/src/sys/win/file.c | 2 +- app/src/sys/win/process.c | 2 +- app/src/util/{str_util.c => str.c} | 2 +- app/src/util/{str_util.h => str.h} | 4 ++-- app/src/v4l2_sink.c | 2 +- app/tests/{test_strutil.c => test_str.c} | 2 +- 13 files changed, 19 insertions(+), 19 deletions(-) rename app/src/util/{str_util.c => str.c} (99%) rename app/src/util/{str_util.h => str.h} (98%) rename app/tests/{test_strutil.c => test_str.c} (99%) diff --git a/app/meson.build b/app/meson.build index 7abef1e2..4894babc 100644 --- a/app/meson.build +++ b/app/meson.build @@ -33,7 +33,7 @@ src = [ 'src/util/process.c', 'src/util/process_intr.c', 'src/util/strbuf.c', - 'src/util/str_util.c', + 'src/util/str.c', 'src/util/term.c', 'src/util/thread.c', 'src/util/tick.c', @@ -199,8 +199,8 @@ if get_option('buildtype') == 'debug' 'tests/test_cli.c', 'src/cli.c', 'src/options.c', + 'src/util/str.c', 'src/util/strbuf.c', - 'src/util/str_util.c', 'src/util/term.c', ]], ['test_clock', [ @@ -210,8 +210,8 @@ if get_option('buildtype') == 'debug' ['test_control_msg_serialize', [ 'tests/test_control_msg_serialize.c', 'src/control_msg.c', + 'src/util/str.c', 'src/util/strbuf.c', - 'src/util/str_util.c', ]], ['test_device_msg_deserialize', [ 'tests/test_device_msg_deserialize.c', @@ -224,10 +224,10 @@ if get_option('buildtype') == 'debug' 'tests/test_strbuf.c', 'src/util/strbuf.c', ]], - ['test_strutil', [ - 'tests/test_strutil.c', + ['test_str', [ + 'tests/test_str.c', + 'src/util/str.c', 'src/util/strbuf.c', - 'src/util/str_util.c', ]], ] diff --git a/app/src/adb.c b/app/src/adb.c index 39777f12..6251174e 100644 --- a/app/src/adb.c +++ b/app/src/adb.c @@ -7,7 +7,7 @@ #include "util/file.h" #include "util/log.h" -#include "util/str_util.h" +#include "util/str.h" static const char *adb_command; diff --git a/app/src/cli.c b/app/src/cli.c index d46485b2..1550c706 100644 --- a/app/src/cli.c +++ b/app/src/cli.c @@ -9,8 +9,8 @@ #include "options.h" #include "util/log.h" +#include "util/str.h" #include "util/strbuf.h" -#include "util/str_util.h" #include "util/term.h" #define STR_IMPL_(x) #x diff --git a/app/src/control_msg.c b/app/src/control_msg.c index ea552bc2..74e3315c 100644 --- a/app/src/control_msg.c +++ b/app/src/control_msg.c @@ -7,7 +7,7 @@ #include "util/buffer_util.h" #include "util/log.h" -#include "util/str_util.h" +#include "util/str.h" /** * Map an enum value to a string based on an array, without crashing on an diff --git a/app/src/icon.c b/app/src/icon.c index 8e18b102..a3efbb01 100644 --- a/app/src/icon.c +++ b/app/src/icon.c @@ -10,7 +10,7 @@ #include "compat.h" #include "util/file.h" #include "util/log.h" -#include "util/str_util.h" +#include "util/str.h" #define SCRCPY_PORTABLE_ICON_FILENAME "icon.png" #define SCRCPY_DEFAULT_ICON_PATH \ diff --git a/app/src/recorder.c b/app/src/recorder.c index 20e4340f..b9c585f4 100644 --- a/app/src/recorder.c +++ b/app/src/recorder.c @@ -6,7 +6,7 @@ #include #include "util/log.h" -#include "util/str_util.h" +#include "util/str.h" /** Downcast packet_sink to recorder */ #define DOWNCAST(SINK) container_of(SINK, struct recorder, packet_sink) diff --git a/app/src/server.c b/app/src/server.c index 0edd8a05..29c92eb3 100644 --- a/app/src/server.c +++ b/app/src/server.c @@ -12,7 +12,7 @@ #include "util/log.h" #include "util/net_intr.h" #include "util/process_intr.h" -#include "util/str_util.h" +#include "util/str.h" #define SERVER_FILENAME "scrcpy-server" diff --git a/app/src/sys/win/file.c b/app/src/sys/win/file.c index 650e0b4b..5233b177 100644 --- a/app/src/sys/win/file.c +++ b/app/src/sys/win/file.c @@ -5,7 +5,7 @@ #include #include "util/log.h" -#include "util/str_util.h" +#include "util/str.h" char * sc_file_get_executable_path(void) { diff --git a/app/src/sys/win/process.c b/app/src/sys/win/process.c index cfbb3948..4dcd542e 100644 --- a/app/src/sys/win/process.c +++ b/app/src/sys/win/process.c @@ -3,7 +3,7 @@ #include #include "util/log.h" -#include "util/str_util.h" +#include "util/str.h" #define CMD_MAX_LEN 8192 diff --git a/app/src/util/str_util.c b/app/src/util/str.c similarity index 99% rename from app/src/util/str_util.c rename to app/src/util/str.c index d15dad20..7935c6bb 100644 --- a/app/src/util/str_util.c +++ b/app/src/util/str.c @@ -1,4 +1,4 @@ -#include "str_util.h" +#include "str.h" #include #include diff --git a/app/src/util/str_util.h b/app/src/util/str.h similarity index 98% rename from app/src/util/str_util.h rename to app/src/util/str.h index 47e01344..54e32808 100644 --- a/app/src/util/str_util.h +++ b/app/src/util/str.h @@ -1,5 +1,5 @@ -#ifndef SC_STRUTIL_H -#define SC_STRUTIL_H +#ifndef SC_STR_H +#define SC_STR_H #include "common.h" diff --git a/app/src/v4l2_sink.c b/app/src/v4l2_sink.c index a35a9096..753d5b6a 100644 --- a/app/src/v4l2_sink.c +++ b/app/src/v4l2_sink.c @@ -1,7 +1,7 @@ #include "v4l2_sink.h" #include "util/log.h" -#include "util/str_util.h" +#include "util/str.h" /** Downcast frame_sink to sc_v4l2_sink */ #define DOWNCAST(SINK) container_of(SINK, struct sc_v4l2_sink, frame_sink) diff --git a/app/tests/test_strutil.c b/app/tests/test_str.c similarity index 99% rename from app/tests/test_strutil.c rename to app/tests/test_str.c index 6a53f94b..2b030885 100644 --- a/app/tests/test_strutil.c +++ b/app/tests/test_str.c @@ -5,7 +5,7 @@ #include #include -#include "util/str_util.h" +#include "util/str.h" static void test_strncpy_simple(void) { char s[] = "xxxxxxxxxx";