11 Commits

Author SHA1 Message Date
Enrico Tröger
1526af4068 Update all copyright notices to mention only the first publish year
And so remove the current year to ease maintenance and since it is not
strictly necessary.
Also remove individual copyright holders (where appropriate) and replace
the name with "The Geany contributors". The detailed authorship
information is still available in the GIT history.

Also remove copyright notice and author names from READMEs.
2019-04-07 11:43:58 +02:00
Colomban Wendling
feca48b59e spawn: Move macros documentation so Doxygen can find them 2015-07-12 16:32:07 +02:00
Dimitar Zhekov
2f237c91a1 Prefix the WIF* macros with SPAWN_ and add short doc comments 2015-07-12 17:06:02 +03:00
Colomban Wendling
5b341b1231 spawn: Fix a typo in Windows compatibility code
Thanks to Dimitar for spotting this.
2015-07-12 14:23:08 +02:00
Colomban Wendling
7a91a8661d spawn: Do not export unnecessary API
Hide spawn_get_program_name(), spawn_async_with_pipes() and
spawn_get_exit_status_cb(), which are not used by anyone else and
should not be part of the plugin API unless explicitly required.

See http://lists.geany.org/pipermail/devel/2015-June/thread.html#9521

Note: this duplicates some documentation when a now hidden function was
referred to.
2015-07-10 18:24:23 +02:00
Matthew Brush
37794432cc Add G_BEGIN_DECLS and G_END_DECLS to spawn.h 2015-06-20 20:25:08 -07:00
Dimitar Zhekov
e838ef744b Define the WIF* and WEXITSTATUS macros in spawn.h under all OS
In particular, include <sys/types.h> and <sys/wait.h> under Unix.
2015-04-05 18:43:11 +03:00
Dimitar Zhekov
8745ba58ae Fix Windows attempts to run 2+ unquoted tokens as a program
When passed Foo Bar Qux as a command line, Windows will try to run
Foo.exe Bar Qux, then "Foo Bar.exe" Qux, and last "Foo Bar Qux.exe",
for maximum flexibility. Quoting Foo supresses this behaviour.
2015-04-01 21:16:23 +03:00
Dimitar Zhekov
7bebf64f3d Fix SPAWN_UNBUFFERED description 2015-03-29 13:51:07 +03:00
Dimitar Zhekov
faa6cd8614 Clarify that a spawn stdout/stderr cb may modify the passed string 2015-03-16 22:25:54 +02:00
Dimitar Zhekov
ce0fa6ffa1 Add a spawn module for Geany
g_spawn_async_with_pipes() under Windows has various drawbacks:

- There is no g_shell_parse_argv() for windows. It's not hard to write
  one, but the command line recreated by mscvrt may be wrong.
- GLib converts the argument vector to UNICODE. For non-UTF8 arguments,
  the result is often "Invalid string in argument vector at %d: %s:
  Invalid byte sequence in conversion input" (YMMV). Our tools (make,
  grep, gcc, ...) are "ANSI", so converting to UNICODE and then back
  only causes problems.
- For various reasons, GLib uses an intermediate program to start
  children (see gspawn-win32.c), with the side effect that the
  grandchildren output (such as make -> gcc) is not captured.
- With non-blocking pipes, the g_io_add_watch() callbacks are never
  invoked, while with blocking pipes, g_io_channel_read_line() blocks.
- Some smaller problems, explained in spawn.c as inline comments.

The spawn module tries to fix these problems, and to provide easier
APIs, which guarantee that the callbacks will synchronized as expected,
and g_io_channel_read_line() will not be required, since even under
Unix, it may buffer lines of unlimited length.

This initial commit only adds the module source and header files, and
includes it in the various build systems.

You can see PR 274 for a long discussion about the module.
2015-03-10 21:24:42 +02:00