argp-standalone / argp-standalone Goto Github PK
View Code? Open in Web Editor NEWThis project forked from ericonr/argp-standalone
This project forked from ericonr/argp-standalone
We don't have a fallback for getting/setting the program name on Windows and the BSDs, it would be nice to add one:
Lines 124 to 144 in 9c15765
The BSDs have getprogname()
and setprogname()
which get and set the program's name: https://man.openbsd.org/getprogname
Windows has a "_pgmptr" variable: https://learn.microsoft.com/en-us/cpp/c-runtime-library/pgmptr-wpgmptr?view=msvc-170 with the program's full path.
Notice that the code (which we imported from glibc) has getting program's name nicely parametrized into an __argp_basename()
function. However, it doesn't do the same with setting the program's name. We could perhaps cooperate with glibc and gnulib to add an __argp_setbasename()
(or whichever name is better) function to make everyone's life easier and remove a little #ifdef
from glibc.
We're exporting some symbols we shouldn't be exporting:
$ nm -gC build/libargp.so | grep T
000050a0 T __argp_basename
000052f0 T __argp_error_internal
00005590 T __argp_failure_internal
00005110 T __argp_short_program_name
00004920 T _argp_fmtstream_ensure
00004050 T _argp_fmtstream_update
0000a1f0 T _argp_input
0000b550 T _fini
0000b540 T _init
0000a390 T _option_is_end
0000a2f0 T _option_is_short
000054d0 T argp_error
00005750 T argp_failure
00003fb0 T argp_fmtstream_free
00004b20 T argp_fmtstream_printf
00004c90 T argp_help
00003ea0 T argp_make_fmtstream
00008f30 T argp_parse
00005170 T argp_state_help
0000a2a0 T argp_usage
0000b4e0 T mempcpy
0000b460 T strchrnul
In the example above, these are at least __argp_basename
, __argp_error_internal
,
__argp_failure_internal
, __argp_short_program_name
, mempcpy
, and strchrnul
. Possibly, that is also the case for _argp_fmtstream_ensure
,
_argp_fmtstream_update
, and _argp_input
, but I don't yet understand the code enough to tell.
Keep in mind some of these symbols are compat code, so some symbols that aren't present at all on my system (OpenBSD) are probably wrongly exported on others. We're probably exporting strndup
on mingw-w64, for instance.
Also, fixing this should generate slightly faster and smaller assembly which is always nice.
Our argp-parse.c says its license is actually LGPL-2.0-or-later:
Lines 6 to 9 in d7408f7
Maybe rebase on the latest glibc code which is LGPL-2.1-or-later?
Maybe it's time to make a new release? #18 (comment)
We have a few bugfixes and it has been 1 year, 1 release per year seems pretty good.
I suggest we use semver. This release would be version 1.6.0 because e4b4248 added a shared library.
Might want to decide on #25 before that because otherwise our shared library will be libargp.so.0.0.0.
I should also point out the current latest release of 1.5.0 had Autotools, tagging a new stable will remove it and use Meson instead.
glibc has some tests for the argp family of functions in argp/argp-test.c, argp/bug-argp1,c, argp/bug-argp2.c argp/tst-argp1.c, argp/tst-argp2.c, and argp/tst-ldbl-argp.c (check argp/Makefile's tests
target). It would be nice to port them over to this project.
We've been ported to a few platforms but have no CI for them. These are:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.