Skip to content

Commit

Permalink
Move some helper code to gammu library
Browse files Browse the repository at this point in the history
It is used there and having that separately just makes proper linking on
Windows hard.

See gammu/python-gammu#15

Signed-off-by: Michal Čihař <michal@cihar.com>
  • Loading branch information
nijel committed Jun 14, 2017
1 parent c0b922d commit 0357de3
Show file tree
Hide file tree
Showing 51 changed files with 48 additions and 66 deletions.
2 changes: 1 addition & 1 deletion gammu-detect/win32-serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include "win32-serial.h"
#include "main.h"
#include "../helper/string.c"
#include "../libgammu/misc/string.c"
#include "../helper/locales.h" /* For gettext */

void win32_serial_detect(void)
Expand Down
1 change: 0 additions & 1 deletion gammu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ target_link_libraries (gammu messagedisplay)
target_link_libraries (gammu messagecmdline)
target_link_libraries (gammu memorydisplay)
target_link_libraries (gammu printing)
target_link_libraries (gammu string)
target_link_libraries (gammu cmdline)
target_link_libraries (gammu ${CMAKE_THREAD_LIBS_INIT})

Expand Down
2 changes: 1 addition & 1 deletion gammu/backup.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "../helper/message-display.h"
#include "../helper/memory-display.h"
#include "../helper/printing.h"
#include "../helper/string.h"
#include "../libgammu/misc/string.h"
#include "../helper/cmdline.h"

/**
Expand Down
2 changes: 1 addition & 1 deletion gammu/backupsms.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#include "../helper/message-display.h"
#include "../helper/printing.h"
#include "../helper/string.h"
#include "../libgammu/misc/string.h"

void BackupSMS(int argc UNUSED, char *argv[])
{
Expand Down
2 changes: 1 addition & 1 deletion gammu/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define _gammu_common_h

#include <gammu.h>
#include "../helper/string.h"
#include "../libgammu/misc/string.h"

extern volatile gboolean gshutdown;
extern GSM_StateMachine *gsm;
Expand Down
2 changes: 1 addition & 1 deletion gammu/depend/nokia/dct3.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "../../../libgammu/phone/pfunc.h"
#include "../../../libgammu/service/gsmnet.h"
#include "../../gammu.h"
#include "../../../helper/string.h"
#include "../../../libgammu/misc/string.h"
#include "../../../helper/cmdline.h"

extern GSM_Reply_Function UserReplyFunctions3[];
Expand Down
2 changes: 1 addition & 1 deletion gammu/depend/nokia/dct4.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "../../../helper/locales.h"

#include "../../../helper/formats.h"
#include "../../../helper/string.h"
#include "../../../libgammu/misc/string.h"
#include "../../../helper/cmdline.h"

extern GSM_Reply_Function UserReplyFunctions4[];
Expand Down
2 changes: 1 addition & 1 deletion gammu/files.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include "../helper/formats.h"
#include "../helper/printing.h"
#include "../helper/string.h"
#include "../libgammu/misc/string.h"

/**
* Displays status of filesystem (if available).
Expand Down
2 changes: 1 addition & 1 deletion gammu/gammu.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include "../helper/locales.h"
#include "../helper/printing.h"
#include "../helper/string.h"
#include "../libgammu/misc/string.h"
#include "../helper/cmdline.h"

#ifdef DEBUG
Expand Down
2 changes: 1 addition & 1 deletion gammu/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "../helper/formats.h"
#include "../helper/memory-display.h"
#include "../helper/printing.h"
#include "../helper/string.h"
#include "../libgammu/misc/string.h"
#include "../helper/cmdline.h"

void GetAllMemory(int argc UNUSED, char *argv[])
Expand Down
2 changes: 1 addition & 1 deletion gammu/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "../helper/memory-display.h"
#include "../helper/message-cmdline.h"
#include "../helper/printing.h"
#include "../helper/string.h"
#include "../libgammu/misc/string.h"
#include "../helper/cmdline.h"

volatile gboolean wasincomingsms = FALSE;
Expand Down
2 changes: 1 addition & 1 deletion gammu/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include "../helper/formats.h"
#include "../helper/printing.h"
#include "../helper/string.h"
#include "../libgammu/misc/string.h"
#include "../helper/cmdline.h"

#ifdef GSM_ENABLE_NOKIA_DCT3
Expand Down
2 changes: 1 addition & 1 deletion gammu/mms.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#include "../helper/memory-display.h"
#include "../helper/printing.h"
#include "../helper/string.h"
#include "../libgammu/misc/string.h"


void GetMMSFolders(int argc UNUSED, char *argv[] UNUSED)
Expand Down
2 changes: 1 addition & 1 deletion gammu/nokia.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#include "../helper/formats.h"
#include "../helper/printing.h"
#include "../helper/string.h"
#include "../libgammu/misc/string.h"

#if defined(GSM_ENABLE_NOKIA_DCT3) || defined(GSM_ENABLE_NOKIA_DCT4)
void NokiaComposer(int argc UNUSED, char *argv[])
Expand Down
2 changes: 1 addition & 1 deletion gammu/search.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include "common.h"

#include "../helper/formats.h"
#include "../helper/string.h"
#include "../libgammu/misc/string.h"

#if defined(HAVE_WIN32_THREADS) || defined(HAVE_PTHREAD)
/**
Expand Down
16 changes: 0 additions & 16 deletions helper/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@ include_directories (
"${CMAKE_CURRENT_BINARY_DIR}/../include"
)

add_library(string STATIC string.c)
add_coverage (string)
GAMMU_TUNE_SHARED(string)

add_library(array STATIC array.c)
add_coverage (array)
GAMMU_TUNE_SHARED(array)

add_library (printing STATIC printing.c)
add_coverage (printing)
GAMMU_TUNE_SHARED(printing)
Expand All @@ -37,7 +29,6 @@ add_coverage (messagecmdline)
GAMMU_TUNE_SHARED(messagecmdline)
target_link_libraries (messagecmdline libGammu)
target_link_libraries (messagecmdline printing)
target_link_libraries (messagecmdline string)
target_link_libraries (messagecmdline cmdline)

add_library (messagedisplay STATIC message-display.c)
Expand All @@ -57,10 +48,3 @@ if(WIN32 AND NOT CMAKE_COMPILER_IS_MINGW AND NOT CMAKE_COMPILER_IS_CYGWIN)
add_library(win32dirent STATIC win32-dirent.c)
add_coverage (win32dirent)
endif(WIN32 AND NOT CMAKE_COMPILER_IS_MINGW AND NOT CMAKE_COMPILER_IS_CYGWIN)

if (NOT HAVE_STRPTIME)
add_library(strptime STATIC strptime.c)
add_coverage (strptime)
GAMMU_TUNE_SHARED(strptime)
target_link_libraries (strptime string)
endif (NOT HAVE_STRPTIME)
8 changes: 6 additions & 2 deletions libgammu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ set (LIBRARY_SRC
gsmstate.c
api.c
debug.c
misc/array.c
misc/misc.c
misc/cfg.c
misc/string.c
misc/coding/coding.c
service/sms/gsmsms.c
service/sms/gsmems.c
Expand Down Expand Up @@ -73,6 +75,10 @@ set (LIBRARY_SRC
phone/symbian/gnapgen.c
phone/s60/s60phone.c)

if (NOT HAVE_STRPTIME)
list (APPEND LIBRARY_SRC misc/strptime.c)
endif (NOT HAVE_STRPTIME)

# Own or glib based MD5 implementation
if (Glib_FOUND)
list (APPEND LIBRARY_SRC misc/coding/md5-glib.c)
Expand Down Expand Up @@ -130,8 +136,6 @@ if(CMAKE_COMPILER_IS_MINGW AND BUILD_SHARED_LIBS)
endif(CMAKE_COMPILER_IS_MINGW AND BUILD_SHARED_LIBS)


target_link_libraries (libGammu string)

if (Glib_FOUND)
target_link_libraries (libGammu ${Glib_LIBRARIES} ${GObject_LIBRARIES})
include_directories(${Glib_INCLUDE_DIRS} ${GObject_INCLUDE_DIRS})
Expand Down
2 changes: 1 addition & 1 deletion libgammu/device/bluetooth/bluetooth.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "../devfunc.h"
#include "bluetooth.h"

#include "../../../helper/string.h"
#include "../../../libgammu/misc/string.h"

#ifdef BLUEZ_FOUND
# include "bluez.h"
Expand Down
2 changes: 1 addition & 1 deletion libgammu/device/proxy/proxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "../devfunc.h"
#include "proxy.h"

#include "../../../helper/string.h"
#include "../../../libgammu/misc/string.h"

/* Expand a proxy command */
static char *
Expand Down
2 changes: 1 addition & 1 deletion libgammu/device/serial/ser_w32.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

#include "../../gsmcomon.h"
#include "ser_w32.h"
#include "../helper/string.h"
#include "../libgammu/misc/string.h"

static GSM_Error serial_close(GSM_StateMachine *s)
{
Expand Down
2 changes: 1 addition & 1 deletion libgammu/device/usb/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#include "../../gsmcomon.h"

#include "../../../helper/string.h"
#include "../../../libgammu/misc/string.h"

/**
* Nokia USB vendor ID.
Expand Down
2 changes: 1 addition & 1 deletion libgammu/gsmphones.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include <ctype.h>

#include "../helper/string.h"
#include "../libgammu/misc/string.h"

#define MAX_FEATURE_NAME_LEN 20

Expand Down
2 changes: 1 addition & 1 deletion libgammu/gsmstate.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "misc/misc.h"
#include "device/devfunc.h"

#include "../helper/string.h"
#include "../libgammu/misc/string.h"

#if defined(HAVE_GETPWUID) && defined(HAVE_GETUID)
#include <sys/types.h>
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion libgammu/misc/cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <gammu-inifile.h>
#include "coding/coding.h"

#include "../../helper/string.h"
#include "../../libgammu/misc/string.h"

/**
* Read information from file in Windows INI format style
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion libgammu/phone/at/at-sms.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include "atgen.h"
#include "atfunc.h"

#include "../../../helper/string.h"
#include "../../../libgammu/misc/string.h"

GSM_Error ATGEN_SetSMSC(GSM_StateMachine *s, GSM_SMSC *smsc)
{
Expand Down
2 changes: 1 addition & 1 deletion libgammu/phone/at/atgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#include "motorola.h"
#include "sonyericsson.h"

#include "../../../helper/string.h"
#include "../../../libgammu/misc/string.h"

#ifdef GSM_ENABLE_ALCATEL
GSM_Error ALCATEL_ProtocolVersionReply (GSM_Protocol_Message *, GSM_StateMachine *);
Expand Down
2 changes: 1 addition & 1 deletion libgammu/phone/at/motorola.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "../../service/gsmpbk.h"
#include "atgen.h"
#include <string.h>
#include "../../../helper/string.h"
#include "../../../libgammu/misc/string.h"

typedef struct {
char Command[20];
Expand Down
2 changes: 1 addition & 1 deletion libgammu/phone/dummy/dummy.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
#include "../../misc/misc.h"
#include "../pfunc.h"
#include "dummy.h"
#include "../../../helper/string.h"
#include "../../../libgammu/misc/string.h"

#ifdef WIN32
#define MKDIR(dir) _mkdir(dir)
Expand Down
2 changes: 1 addition & 1 deletion libgammu/phone/nokia/dct4s40/6510/6510file.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "../../../pfunc.h"
#include "../dct4func.h"
#include "n6510.h"
#include "../../../../../helper/string.h"
#include "../../../../../libgammu/misc/string.h"

/* shared */

Expand Down
2 changes: 1 addition & 1 deletion libgammu/phone/obex/obexgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include "../../protocol/obex/obex.h"
#include "obexfunc.h"
#include "mobex.h"
#include "../../../helper/string.h"
#include "../../../libgammu/misc/string.h"

#ifdef GSM_ENABLE_OBEXGEN

Expand Down
2 changes: 1 addition & 1 deletion libgammu/phone/s60/s60phone.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include "../pfunc.h"
#include <string.h>

#include "../../../helper/string.h"
#include "../../../libgammu/misc/string.h"

#if defined(GSM_ENABLE_S60)

Expand Down
2 changes: 1 addition & 1 deletion libgammu/service/backup/backtext.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "../../debug.h"
#include "backtext.h"

#include "../../../helper/string.h"
#include "../../../libgammu/misc/string.h"

#ifdef GSM_ENABLE_BACKUP

Expand Down
2 changes: 1 addition & 1 deletion libgammu/service/backup/gsmback.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "backics.h"
#include "backvnt.h"

#include "../../../helper/string.h"
#include "../../../libgammu/misc/string.h"

#ifdef GSM_ENABLE_BACKUP

Expand Down
2 changes: 1 addition & 1 deletion libgammu/service/gsmcal.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "gsmcal.h"
#include "../misc/coding/coding.h"

#include "../../helper/string.h"
#include "../../libgammu/misc/string.h"

void GSM_SetCalendarRecurranceRepeat(GSM_Debug_Info *di, unsigned char *rec, unsigned char *endday, GSM_CalendarEntry *entry)
{
Expand Down
2 changes: 1 addition & 1 deletion libgammu/service/gsmlogo.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "gsmlogo.h"
#include "gsmnet.h"

#include "../../helper/string.h"
#include "../../libgammu/misc/string.h"

/**
* Helper define to check error code from fwrite.
Expand Down
2 changes: 1 addition & 1 deletion libgammu/service/gsmmisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "../debug.h"
#include "gsmmisc.h"

#include "../../helper/string.h"
#include "../../libgammu/misc/string.h"

struct keys_table_position {
char whatchar;
Expand Down
5 changes: 0 additions & 5 deletions smsd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,6 @@ if(CMAKE_COMPILER_IS_MINGW AND BUILD_SHARED_LIBS)
endif(CMAKE_COMPILER_IS_MINGW AND BUILD_SHARED_LIBS)

target_link_libraries (gsmsd libGammu)
if (NOT HAVE_STRPTIME)
target_link_libraries (gsmsd strptime)
endif (NOT HAVE_STRPTIME)
target_link_libraries (gsmsd string)
target_link_libraries (gsmsd array)

# Gammu-smsd program
add_executable (gammu-smsd ${DAEMON_SRC} ${SMSD_RESOURCES})
Expand Down
2 changes: 1 addition & 1 deletion smsd/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
#include "log-event.h"
#endif

#include "../helper/string.h"
#include "../libgammu/misc/string.h"

#ifndef PATH_MAX
#ifdef MAX_PATH
Expand Down
2 changes: 1 addition & 1 deletion smsd/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#include "log.h"

#include "../helper/array.h"
#include "../libgammu/misc/array.h"

typedef enum {
DEBUG_ERROR = -1,
Expand Down
Loading

0 comments on commit 0357de3

Please sign in to comment.