Skip to content

Debug - #12

Draft
3x380V wants to merge 94 commits into
pkot:savannahfrom
3x380V:debug
Draft

Debug#12
3x380V wants to merge 94 commits into
pkot:savannahfrom
3x380V:debug

Conversation

@3x380V

@3x380V 3x380V commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Just for debugging purposes...

@3x380V
3x380V force-pushed the debug branch 3 times, most recently from 67782e8 to 718db05 Compare July 25, 2026 15:43
fabzzap and others added 27 commits July 25, 2026 17:53
mingw32 provides lower case names for Win32 header files, use lower
case names in #include directives.
Windows' mkdir() takes only 1 argument, so add a test for that.
Compilation fails with both HAVE_SETENV and WIN32 set.
Remove homebrew --enable-win option and use the standard autoconf way
to cross-compile, that is using option --host.
compat.h configuration depends on defines from config.h, however
it does not include it. Explicitely include config.h and remove
it from all files which did so only to satisfy compat.h
configuration.
compat.h is there to simplify including common header files. If we
need a number of standard header files we just include "compat.h" and
it does everything for us. Therefore all standard headers includes
are removed from the source files.

In addition add conditional includes where we did the checks in
config.h.

Include config.h where needed.

Add detection of error.h, errno.h and signal.h.
Update to the latest (7a5b65c88d3b) version from Samba's repository.
Previously connect_script was called only with valid fd, restore that.

Fixes: 4d38aee (Make device_script() generic for all connection types)
posix_spawn specification dates back to last century and its
implementation is mature enough in all systems we do support.
Thus use it if available in hope it will save us some resources.
Original fork and exec is still provided for ancient systems.
On systems without setenv()/unsetenv() a declaration of these
functions was missing (a definition done in common/compat.c).
Add it to compat.h.
Function verify_max_message_len is using static local variable
making it thread unsafe. Move that variable into incoming message
instance.
Let it compile with Microsoft Visual C++ 6.0
When sending strings to AT driver treat it as strings (char *) and
not byte arrays (unsigned char *)
snprintf function family is needed by both gnokii and libgnokii
on systems without proper snprintf support and we do not want
libgnokii to export snprintf functions. Therefore move snprintf
to convenience library and statically link it to both gnokii and
libgnokii.
We already do have a list of supported connection in connectiontypes
array, so use it here as well. This removes another #ifdeffery
and fixed bug where condition for TCP was inverted.
Avoid conflicting types for 'getenv' and 'getopt' error raised by
MSYS2 project compilers.
Device include files now do not need to include anything but gnokii.h
3x380V and others added 19 commits July 26, 2026 00:50
Register device methods into gn_device_ops structure. This
allows to remove stub functions returning -1 for not compiled
drivers.
Add AM_CONDITIONAL for platform devices to conditionally add
them to the build. Once there, move device detection in
configure.ac to live at one place.
Since stub functions are not needed anymore, remove them
as well as #ifdefs guarding platform drivers. These are
now excluded from the build conditionally.
Since stub functions are not needed anymore, remove them
as well as #ifdefs guarding platform drivers. These are
now excluded from the build conditionally.
asprintf returns -1 on error while strp is left undefined. Update
error check accordingly.
GN_ERR_MEMORYFULL relates to phone memory not host one.
SMS encoding does not respect locale returned by gn_char_get_encoding()
as g_locale_to_utf8() always uses current locale. Fix that using
utf8_encode() which also drops one glib dependency.
Replace last used glib functions with opencoded alternatives and
remove that depedency from libgnokii.
MSVC6 (and others ancient compilers) does not support variadic macros.
Undoubtedly, code is a bit less elegant, but gnokii codebase is ancient
as well as phones it supports, so it is only reasonable to support
ancient compilers as well.
All these were just updated from original Microsoft Visual C++ 6.0,
so it should be easy to recreate them eventually.
This API breaking change should be done a long time ago. Do it
now as we already broke API with commit 6d59b8b
("Move callbacks from gn_data to gn_statemachine->callbacks")
Do not shadow libtool's RM, which produces configure warning:
checking if gcc supports -c -o file.o... \
rm: cannot remove 'conftest*': No such file or directory
Current assumtion of locale setting related to gettext (NLS) causes
issue on builds without a working gettext (USE_NLS=no) where gnokii
never initializes its locale and stayes in the C locale, se every
non-ASCII iconv conversion (ucs2/utf8/wchar) fails with EILSEQ.

Locale/charset setup is independent of message translation, so move
setlocale() out of the ENABLE_NLS guard; only bindtextdomain() and
textdomain() remain NLS-specific.

Also fix non-ASCII conversions on Windows where C library cannot
derive a usable codeset from the locale.
@3x380V
3x380V force-pushed the debug branch 2 times, most recently from f98fd39 to 4e090e9 Compare July 26, 2026 08:17
AT commands are terminated by a single CR (V.250 S3), so adjust
fake AT driver to respect that and adjust output messages driver
output is compared to.

Change filter to `grep -U -v ^GNOKII`, binary mode prevents
stripping gnokii's CRs (the bare AT \r and the CR of \r\n)
on Windows.
@3x380V
3x380V force-pushed the debug branch 2 times, most recently from bca9ea2 to 74e9a22 Compare July 26, 2026 09:01
3x380V and others added 4 commits July 26, 2026 11:48
isatty(0) is the wrong interactivity test on native Windows causing
'Please enter SMS text...' prompt printed to stderr which confuses
testsuite.
@3x380V
3x380V marked this pull request as draft July 26, 2026 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants