Skip to content

Commit

Permalink
Move ui/clopts_common.[ch] to wsutil
Browse files Browse the repository at this point in the history
  • Loading branch information
randstr committed Feb 10, 2023
1 parent 0cea64a commit cf8107e
Show file tree
Hide file tree
Showing 17 changed files with 25 additions and 22 deletions.
2 changes: 1 addition & 1 deletion capture_opts.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include "capture_opts.h"
#include "ringbuffer.h"

#include <ui/clopts_common.h>
#include <wsutil/clopts_common.h>
#include <wsutil/cmdarg_err.h>
#include <wsutil/file_util.h>
#include <wsutil/ws_pipe.h>
Expand Down
2 changes: 1 addition & 1 deletion dumpcap.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
#include <sys/un.h>
#endif

#include <ui/clopts_common.h>
#include <wsutil/clopts_common.h>
#include <wsutil/privileges.h>

#include "sync_pipe.h"
Expand Down
2 changes: 1 addition & 1 deletion editcap.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
#include <winsock2.h>
#endif

#include <ui/clopts_common.h>
#include <wsutil/clopts_common.h>
#include <wsutil/cmdarg_err.h>
#include <wsutil/filesystem.h>
#include <wsutil/file_util.h>
Expand Down
2 changes: 1 addition & 1 deletion mergecap.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

#include <wiretap/wtap.h>

#include <ui/clopts_common.h>
#include <wsutil/clopts_common.h>
#include <wsutil/cmdarg_err.h>
#include <wsutil/filesystem.h>
#include <wsutil/file_util.h>
Expand Down
2 changes: 1 addition & 1 deletion randpkt.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <stdlib.h>

#include <ws_exit_codes.h>
#include <ui/clopts_common.h>
#include <wsutil/clopts_common.h>
#include <ui/failure_message.h>
#include <wsutil/cmdarg_err.h>
#include <wsutil/file_util.h>
Expand Down
2 changes: 1 addition & 1 deletion rawshark.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
#include <wsutil/report_message.h>
#include <wsutil/please_report_bug.h>
#include <wsutil/wslog.h>
#include <ui/clopts_common.h>
#include <wsutil/clopts_common.h>

#ifdef _WIN32
#include <wsutil/unicode-utils.h>
Expand Down
2 changes: 1 addition & 1 deletion sharkd.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <epan/exceptions.h>
#include <epan/epan.h>

#include <ui/clopts_common.h>
#include <wsutil/clopts_common.h>
#include <wsutil/cmdarg_err.h>
#include <wsutil/filesystem.h>
#include <wsutil/file_util.h>
Expand Down
2 changes: 1 addition & 1 deletion tfshark.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <epan/exceptions.h>
#include <epan/epan.h>

#include <ui/clopts_common.h>
#include <wsutil/clopts_common.h>
#include <wsutil/cmdarg_err.h>
#include <ui/urls.h>
#include <wsutil/filesystem.h>
Expand Down
2 changes: 1 addition & 1 deletion tshark.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include <epan/epan.h>

#include <ws_exit_codes.h>
#include <ui/clopts_common.h>
#include <wsutil/clopts_common.h>
#include <wsutil/cmdarg_err.h>
#include <ui/urls.h>
#include <wsutil/filesystem.h>
Expand Down
1 change: 0 additions & 1 deletion ui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ set(NONGENERATED_UI_SRC
alert_box.c
capture.c
capture_ui_utils.c
clopts_common.c
commandline.c
decode_as_utils.c
dissect_opts.c
Expand Down
2 changes: 1 addition & 1 deletion ui/commandline.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#include <wsutil/version_info.h>

#include <ui/clopts_common.h>
#include <wsutil/clopts_common.h>
#include <wsutil/cmdarg_err.h>
#include <wsutil/filesystem.h>
#include <wsutil/ws_assert.h>
Expand Down
2 changes: 1 addition & 1 deletion ui/dissect_opts.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <epan/dissectors/read_keytab_file.h>
#endif

#include <ui/clopts_common.h>
#include <wsutil/clopts_common.h>
#include <wsutil/cmdarg_err.h>
#include <wsutil/file_util.h>
#include <wsutil/ws_assert.h>
Expand Down
2 changes: 1 addition & 1 deletion ui/logray/logray_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#endif

#include <ws_exit_codes.h>
#include <ui/clopts_common.h>
#include <wsutil/clopts_common.h>
#include <wsutil/cmdarg_err.h>
#include <ui/urls.h>
#include <wsutil/filesystem.h>
Expand Down
2 changes: 1 addition & 1 deletion ui/qt/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#endif

#include <ws_exit_codes.h>
#include <ui/clopts_common.h>
#include <wsutil/clopts_common.h>
#include <wsutil/cmdarg_err.h>
#include <ui/urls.h>
#include <wsutil/filesystem.h>
Expand Down
2 changes: 2 additions & 0 deletions wsutil/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ set(WSUTIL_PUBLIC_HEADERS
bits_ctz.h
bitswap.h
buffer.h
clopts_common.h
cmdarg_err.h
codecs.h
color.h
Expand Down Expand Up @@ -104,6 +105,7 @@ set(WSUTIL_COMMON_FILES
base32.c
bitswap.c
buffer.c
clopts_common.c
cmdarg_err.c
codecs.c
crash_info.c
Expand Down
File renamed without changes.
18 changes: 10 additions & 8 deletions ui/clopts_common.h → wsutil/clopts_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
* SPDX-License-Identifier: GPL-2.0-or-later
*/

#ifndef __UI_CLOPTS_COMMON_H__
#define __UI_CLOPTS_COMMON_H__
#ifndef __CLOPTS_COMMON_H__
#define __CLOPTS_COMMON_H__

#include <wireshark.h>

#ifdef __cplusplus
extern "C" {
Expand All @@ -32,23 +34,23 @@ extern "C" {
// Base value for GUI specific long options
#define LONGOPT_BASE_GUI 4000

extern int
WS_DLL_PUBLIC int
get_natural_int(const char *string, const char *name);

extern int
WS_DLL_PUBLIC int
get_positive_int(const char *string, const char *name);

extern guint32
WS_DLL_PUBLIC guint32
get_guint32(const char *string, const char *name);

extern guint32
WS_DLL_PUBLIC guint32
get_nonzero_guint32(const char *string, const char *name);

extern double
WS_DLL_PUBLIC double
get_positive_double(const char *string, const char *name);

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* __UI_CLOPTS_COMMON_H__ */
#endif /* __CLOPTS_COMMON_H__ */

0 comments on commit cf8107e

Please sign in to comment.