vimb.git
10 years agoRevert "Set z-index on hint container instead of every item."
Daniel Carl [Mon, 6 Jan 2014 17:16:49 +0000 (18:16 +0100)]
Revert "Set z-index on hint container instead of every item."

This reverts commit 9ad874b2dfa20b13bb7a0fd2871ce34602983ad0.

The z-index on the single items seems to be essential to display the hint
labels on some pages.

10 years agoFixed typo in word prompt.
Daniel Carl [Sun, 5 Jan 2014 19:02:14 +0000 (20:02 +0100)]
Fixed typo in word prompt.

10 years agoMerge branch 'hinting-g-mode'
Daniel Carl [Sun, 5 Jan 2014 18:56:22 +0000 (19:56 +0100)]
Merge branch 'hinting-g-mode'

Conflicts:
src/hints.js

10 years agoFixed orphaned line in manual page.
Daniel Carl [Sun, 5 Jan 2014 10:44:18 +0000 (11:44 +0100)]
Fixed orphaned line in manual page.

10 years agoSet z-index on hint container instead of every item.
Daniel Carl [Sun, 5 Jan 2014 10:28:22 +0000 (11:28 +0100)]
Set z-index on hint container instead of every item.

10 years agoMerge remote-tracking branch 'stabledog/master'
Daniel Carl [Sat, 4 Jan 2014 18:55:15 +0000 (19:55 +0100)]
Merge remote-tracking branch 'stabledog/master'

10 years agoFixed hints not opened in new window on duckduckgo (#59).
Daniel Carl [Sat, 4 Jan 2014 16:40:15 +0000 (17:40 +0100)]
Fixed hints not opened in new window on duckduckgo (#59).

There are some pages that use mouse event observers that open link href
programmatic and ignore the target attribute that vimb uses to open link into
new window. So this patch fires the click related mouse events with the
additional set CTRL key that is considered by those scripts and also other
browsers to open the resource into new window.

10 years agoAllow to open links into new window by ctrl and left mouse.
Daniel Carl [Sat, 4 Jan 2014 15:55:54 +0000 (16:55 +0100)]
Allow to open links into new window by ctrl and left mouse.

10 years agoFixed some grammar
Les Matheson [Wed, 1 Jan 2014 06:21:12 +0000 (22:21 -0800)]
Fixed some grammar

10 years agoAdded hint how to compile against gtk3 libs.
Daniel Carl [Fri, 27 Dec 2013 13:56:12 +0000 (14:56 +0100)]
Added hint how to compile against gtk3 libs.

10 years agoFixed none marked active completion items with gtk3.
Daniel Carl [Fri, 27 Dec 2013 13:54:45 +0000 (14:54 +0100)]
Fixed none marked active completion items with gtk3.

10 years agoRemoved white right border in completion with gtk3.
Daniel Carl [Fri, 27 Dec 2013 13:44:12 +0000 (14:44 +0100)]
Removed white right border in completion with gtk3.

10 years agoFixed wrong completion window size with gtk3.
Daniel Carl [Fri, 27 Dec 2013 13:40:32 +0000 (14:40 +0100)]
Fixed wrong completion window size with gtk3.

10 years agoDon't start download for failed requests.
Daniel Carl [Thu, 26 Dec 2013 18:27:20 +0000 (19:27 +0100)]
Don't start download for failed requests.

If request to resources where blocked by a proxy or could not bedelivered
properly vimb considered these responses without any mime type as downloads.

10 years agoDon't hint images that are surrounded by link (#53).
Daniel Carl [Sat, 21 Dec 2013 18:14:05 +0000 (19:14 +0100)]
Don't hint images that are surrounded by link (#53).

10 years agoAdded extended hint modes g;X (#53).
Daniel Carl [Sat, 21 Dec 2013 17:38:32 +0000 (18:38 +0100)]
Added extended hint modes g;X (#53).

These hint modes are taken from pentadactyl and works like the other hint
modes, accept that the hints are not cleared after a hint was fired using a
numeric filter.

10 years agoMerge branch 'master' into hinting-g-mode
Daniel Carl [Fri, 20 Dec 2013 23:53:27 +0000 (00:53 +0100)]
Merge branch 'master' into hinting-g-mode

10 years agoRemoved -s LDFLAG to get usefull backtraces.
Daniel Carl [Fri, 20 Dec 2013 23:50:51 +0000 (00:50 +0100)]
Removed -s LDFLAG to get usefull backtraces.

This flag should be set by packagers if a small binary is the target.

10 years agoLeaf hint mode if hint prompt is not valid.
Daniel Carl [Thu, 19 Dec 2013 23:49:23 +0000 (00:49 +0100)]
Leaf hint mode if hint prompt is not valid.

10 years agoSimplified the config stuff in hints.js.
Daniel Carl [Thu, 19 Dec 2013 23:33:47 +0000 (00:33 +0100)]
Simplified the config stuff in hints.js.

10 years agoChange variable name in hints.js.
Daniel Carl [Thu, 19 Dec 2013 22:35:00 +0000 (23:35 +0100)]
Change variable name in hints.js.

10 years agoReset hints number filter on new text filtering (#53).
Daniel Carl [Thu, 19 Dec 2013 18:41:06 +0000 (19:41 +0100)]
Reset hints number filter on new text filtering (#53).

10 years agoKeep active hint focused if it's still valid (#53).
Daniel Carl [Thu, 19 Dec 2013 18:10:09 +0000 (19:10 +0100)]
Keep active hint focused if it's still valid (#53).

If a hint is focussed and later filter will keep it valid, the hint also keeps
focussed.

10 years agoSave the active hint object instead of idx.
Daniel Carl [Thu, 19 Dec 2013 16:16:04 +0000 (17:16 +0100)]
Save the active hint object instead of idx.

This make some things easier.

10 years agoAdded new hinting filter behaviour to man page.
Daniel Carl [Thu, 19 Dec 2013 13:17:18 +0000 (14:17 +0100)]
Added new hinting filter behaviour to man page.

10 years agoFixed none left hint mode if no hint is available (#53).
Daniel Carl [Thu, 19 Dec 2013 12:44:54 +0000 (13:44 +0100)]
Fixed none left hint mode if no hint is available (#53).

10 years agoLittle code style changes in hints.js.
Daniel Carl [Thu, 19 Dec 2013 12:16:30 +0000 (13:16 +0100)]
Little code style changes in hints.js.

10 years agoIncrease z-index of active hint label.
Daniel Carl [Thu, 19 Dec 2013 00:08:24 +0000 (01:08 +0100)]
Increase z-index of active hint label.

This allows to see the label while stepping though the hints via <Tab> event
if hint label overlaps each other.

10 years agoUse relative font size for hint labels.
Daniel Carl [Wed, 18 Dec 2013 23:55:43 +0000 (00:55 +0100)]
Use relative font size for hint labels.

10 years agoUsed a little bit more object orientation for hints (#53).
Daniel Carl [Wed, 18 Dec 2013 20:45:01 +0000 (21:45 +0100)]
Used a little bit more object orientation for hints (#53).

10 years agoChanged the way hints are processed in js (#53).
Daniel Carl [Sun, 15 Dec 2013 20:33:30 +0000 (21:33 +0100)]
Changed the way hints are processed in js (#53).

To allow to enable the new hint modes g;{MODE} it's better to filter the hint
texts without using xPath. So we filter only those items that are actual valid
and don't need to query the whole document for matching items.
On the other side, do we have more control about how the pattern matching is
done, case sensitive, matching word beginnings or fuzzy search or what ever.

10 years agoMoved completion flag setting to completion.c.
Daniel Carl [Sat, 7 Dec 2013 14:39:22 +0000 (15:39 +0100)]
Moved completion flag setting to completion.c.

It's the better place to handle the flags than doing it in ex.c.

10 years agoFixed wrong keys for history prev/next in manual page.
Daniel Carl [Sat, 23 Nov 2013 16:07:23 +0000 (17:07 +0100)]
Fixed wrong keys for history prev/next in manual page.

10 years agoReleased version 2.0.
Daniel Carl [Fri, 22 Nov 2013 11:58:00 +0000 (12:58 +0100)]
Released version 2.0.

10 years agoFixed none found :qunshift command.
Daniel Carl [Tue, 12 Nov 2013 19:36:37 +0000 (20:36 +0100)]
Fixed none found :qunshift command.

The command was put onto the wrong place so we could not find it and
considered this command as unknown. Now it's put to the right place to get it
working.
By the way some missed pre-compiler flags added.

10 years agoFixed :qpush and :qunshift without parameters (#52).
Daniel Carl [Tue, 12 Nov 2013 19:28:02 +0000 (20:28 +0100)]
Fixed :qpush and :qunshift without parameters (#52).

These commands should use current URI if they where called without any
parameter, but cause of the migration of the way how we parse the inputbox, we
got always a parameter or better right hand side.

10 years agoSetup the signal handlers as late as possible.
Daniel Carl [Sat, 9 Nov 2013 00:39:03 +0000 (01:39 +0100)]
Setup the signal handlers as late as possible.

10 years agoDon't handle home page opening twice.
Daniel Carl [Sat, 9 Nov 2013 00:27:52 +0000 (01:27 +0100)]
Don't handle home page opening twice.

We set the homepage to open if not uri was given when vimb was called. But the
vb_load_uri() function did also a check if a uri was given. Now only
vb_load_uri handles the opening of home page.

10 years agoRemoved duplicate gtk_widget_show_all.
Daniel Carl [Sat, 9 Nov 2013 00:18:23 +0000 (01:18 +0100)]
Removed duplicate gtk_widget_show_all.

This increases the startup time a little.

10 years agoFixed wrong mode after click into form field (#51).
Daniel Carl [Fri, 8 Nov 2013 22:46:47 +0000 (23:46 +0100)]
Fixed wrong mode after click into form field (#51).

10 years agoAllow hinting ';e' and 'gi' also for input without type attribute.
Daniel Carl [Thu, 7 Nov 2013 10:24:34 +0000 (11:24 +0100)]
Allow hinting ';e' and 'gi' also for input without type attribute.

This enables to focus the search box of google, that has not type attribute.

10 years agoHold current prompt chars.
Daniel Carl [Mon, 4 Nov 2013 19:47:17 +0000 (20:47 +0100)]
Hold current prompt chars.

This allows to handle the command mode <C-U> command right and to not remove
chars from prompts like ';o'.

10 years agoShow error message if ex command is not known.
Daniel Carl [Mon, 4 Nov 2013 19:00:45 +0000 (20:00 +0100)]
Show error message if ex command is not known.

10 years agoChanged the history indicator chars.
Daniel Carl [Sun, 3 Nov 2013 19:09:10 +0000 (20:09 +0100)]
Changed the history indicator chars.

The chars for the history indicator from those of vimprobable to those that
pentadactyl uses '-' = can go back and '+' can go forward.

10 years agoChanged config order.
Daniel Carl [Sun, 3 Nov 2013 19:04:54 +0000 (20:04 +0100)]
Changed config order.

10 years agoAllow to set cookie accept policy.
Daniel Carl [Sun, 3 Nov 2013 18:14:57 +0000 (19:14 +0100)]
Allow to set cookie accept policy.

New setting ':set cookie-accept={always,never,origin}'.

10 years agoFixed missed free of soup_date.
Daniel Carl [Sat, 2 Nov 2013 23:04:19 +0000 (00:04 +0100)]
Fixed missed free of soup_date.

10 years agoFixed none remove file for editor command.
Daniel Carl [Sat, 2 Nov 2013 17:41:37 +0000 (18:41 +0100)]
Fixed none remove file for editor command.

10 years agoFixed missed query for search of selection.
Daniel Carl [Fri, 1 Nov 2013 12:15:43 +0000 (13:15 +0100)]
Fixed missed query for search of selection.

If the search was started from the current selected text, the query was not
given to the search command. That means the '*' and '#' commands did not work.

10 years agoAdded //*[@href] to hinting xpath.
Daniel Carl [Thu, 31 Oct 2013 19:44:45 +0000 (20:44 +0100)]
Added //*[@href] to hinting xpath.

This allow to hint also links on pages that use own namespaces like
http://5digits.org/help/pentadactyl/ where '//a' would not find any match.

10 years agoRemoved 'area' element from hinting xpath.
Daniel Carl [Thu, 31 Oct 2013 18:15:13 +0000 (19:15 +0100)]
Removed 'area' element from hinting xpath.

The area elements will be seen as invisible and therefor not shown, so we
don't need to fetch them via xpath.

10 years agoFixed none working prev/next patterns (#50).
Daniel Carl [Mon, 28 Oct 2013 22:08:48 +0000 (23:08 +0100)]
Fixed none working prev/next patterns (#50).

The prev/next pattern did not work properly because of the surrounding single
quotes. Additional to this they where case sensitive and did not match very
well. So the default pattern where reformulated with plain JavaScript regex
syntax and 'i' flag for none case sensitive matching.

10 years agoFixed wrong keylabel to ascii conversion for <CR>.
Daniel Carl [Mon, 28 Oct 2013 21:17:07 +0000 (22:17 +0100)]
Fixed wrong keylabel to ascii conversion for <CR>.

10 years agoCombine concatenated strings on script minify.
Daniel Carl [Mon, 28 Oct 2013 21:04:01 +0000 (22:04 +0100)]
Combine concatenated strings on script minify.

If there are string concatenated like "foo" + "bar", combine them to "foobar".

10 years agoDon't use invisible links for prev/next.
Daniel Carl [Mon, 28 Oct 2013 20:38:36 +0000 (21:38 +0100)]
Don't use invisible links for prev/next.

10 years agoAdded new ]] and [[ commands.
Daniel Carl [Sun, 27 Oct 2013 22:42:45 +0000 (23:42 +0100)]
Added new ]] and [[ commands.

These commands allow to open next/previous page by regex pattern configured
using new settings 'previouspattern' and 'nextpattern'.

10 years agoAllow | char in rhs of command if escaped.
Daniel Carl [Sun, 27 Oct 2013 20:39:06 +0000 (21:39 +0100)]
Allow | char in rhs of command if escaped.

10 years agoDon't check element points for hinting.
Daniel Carl [Wed, 23 Oct 2013 07:55:48 +0000 (09:55 +0200)]
Don't check element points for hinting.

The check if the upper left or center point of an element if that element is
the element fails for various links with linebreaks. So the hinting was
adapted to that what pentadactyl will show.

10 years agoFixed different load percent in title and statusbar.
Daniel Carl [Wed, 23 Oct 2013 07:47:31 +0000 (09:47 +0200)]
Fixed different load percent in title and statusbar.

10 years agoShow url in window title until page title is received.
Daniel Carl [Tue, 22 Oct 2013 19:34:02 +0000 (21:34 +0200)]
Show url in window title until page title is received.

10 years agoFixed error if there is no title set in update_title.
Daniel Carl [Tue, 22 Oct 2013 19:07:46 +0000 (21:07 +0200)]
Fixed error if there is no title set in update_title.

10 years agoAdded feature to enable/disable progress in window title.
Daniel Carl [Tue, 22 Oct 2013 18:59:16 +0000 (20:59 +0200)]
Added feature to enable/disable progress in window title.

10 years agoShow history indicator '[+-]' in statusbar.
Daniel Carl [Tue, 22 Oct 2013 18:54:24 +0000 (20:54 +0200)]
Show history indicator '[+-]' in statusbar.

10 years agoRemoved unused function.
Daniel Carl [Tue, 22 Oct 2013 18:08:05 +0000 (20:08 +0200)]
Removed unused function.

10 years agoShow load progress in window title.
Daniel Carl [Tue, 22 Oct 2013 18:06:25 +0000 (20:06 +0200)]
Show load progress in window title.

This make it easier to see if the page is loaded event if its in a background
tab.

10 years agoAdded settings to manual page.
Daniel Carl [Mon, 21 Oct 2013 21:31:34 +0000 (23:31 +0200)]
Added settings to manual page.

10 years agoRemoved webkit setting alias for 'print-backgrounds'.
Daniel Carl [Mon, 21 Oct 2013 20:25:53 +0000 (22:25 +0200)]
Removed webkit setting alias for 'print-backgrounds'.

The alias 'backgrounds' might be irritating, because this setting applies only
for the print output.

10 years agoAllow to set user defined http headers (#45).
Daniel Carl [Mon, 21 Oct 2013 20:13:05 +0000 (22:13 +0200)]
Allow to set user defined http headers (#45).

10 years agoSet default home page to project website.
Daniel Carl [Mon, 21 Oct 2013 18:11:54 +0000 (20:11 +0200)]
Set default home page to project website.

10 years agoSet new cookie expire time if timeout is not 0.
Daniel Carl [Mon, 21 Oct 2013 17:32:50 +0000 (19:32 +0200)]
Set new cookie expire time if timeout is not 0.

10 years agoRemoved the filtering for favicons.
Daniel Carl [Mon, 21 Oct 2013 17:23:52 +0000 (19:23 +0200)]
Removed the filtering for favicons.

This should be solved in webkit itself or in a generic way with soup session.
But at the moment it looks like this costs more cpu cycles instead of having a
noticeable benefit.

10 years agoRemoved cookie policy setting.
Daniel Carl [Mon, 21 Oct 2013 10:37:10 +0000 (12:37 +0200)]
Removed cookie policy setting.

This does not work without setting the first party url and needs much more
implementation to get it work. So we should do this later and make this
behaviour configurable for the user too.

10 years agoMerge branch 'new-key-handling'
Daniel Carl [Sun, 20 Oct 2013 12:25:31 +0000 (14:25 +0200)]
Merge branch 'new-key-handling'

Conflicts:
src/command.c
src/main.c

10 years agoRemoved useless --dump-config option.
Daniel Carl [Sat, 19 Oct 2013 18:24:35 +0000 (20:24 +0200)]
Removed useless --dump-config option.

This allowed to print only those options, that where defined in default.h, but
this isn't the whole default config (lags the webkit settings) so it might not
be very useful. Maybe it will be readded later together with new ex command
:set all.

10 years agoAdded noremap counterparts for the xmap commands.
Daniel Carl [Sat, 19 Oct 2013 18:11:11 +0000 (20:11 +0200)]
Added noremap counterparts for the xmap commands.

10 years agoRemove old mapping if the lhs is mapped new.
Daniel Carl [Sat, 19 Oct 2013 16:23:25 +0000 (18:23 +0200)]
Remove old mapping if the lhs is mapped new.

10 years agoAdded new ex command :hardcopy to open print dialog.
Daniel Carl [Sat, 19 Oct 2013 16:02:38 +0000 (18:02 +0200)]
Added new ex command :hardcopy to open print dialog.

10 years agoDocumented shot ex commands in manual page.
Daniel Carl [Sat, 19 Oct 2013 15:40:29 +0000 (17:40 +0200)]
Documented shot ex commands in manual page.

Remove the :source command from manual page, because this command does not
exist.

10 years agoUse SHOWCMD_LEN to be the number of chars without NULL byte.
Daniel Carl [Sat, 19 Oct 2013 14:45:06 +0000 (16:45 +0200)]
Use SHOWCMD_LEN to be the number of chars without NULL byte.

10 years agoMoved key mapping and label mapping array together.
Daniel Carl [Sat, 19 Oct 2013 14:44:37 +0000 (16:44 +0200)]
Moved key mapping and label mapping array together.

10 years agoSimplified CSI processing a little.
Daniel Carl [Sat, 19 Oct 2013 14:23:46 +0000 (16:23 +0200)]
Simplified CSI processing a little.

10 years agoRemoved the git version stuff.
Daniel Carl [Tue, 15 Oct 2013 21:49:10 +0000 (23:49 +0200)]
Removed the git version stuff.

The git version could lead to cases where the version seems to be wrong, in
the case where no tags are pulled from upstream. So I decided to throw this
away. Bay the was the none posix sed command to convert project name to word
starting with upper case char, was replaces by a awk call.

10 years agoChanged CR key from 0x0a -> 0x0d like vim does.
Daniel Carl [Tue, 15 Oct 2013 20:56:07 +0000 (22:56 +0200)]
Changed CR key from 0x0a -> 0x0d like vim does.

Change order of key processing parts. Use fix keyvalue mapping before running
the gdk_keyval_to_unicode(). This should be a little faster and avoids bugs,
when compiled against the GTK3 libs, where the GDK_Return is handled by
gdk_keyval_to_unicode() which wasn't th fact with GDK2.

10 years agoFixed none applied completion active colors.
Daniel Carl [Tue, 15 Oct 2013 20:02:56 +0000 (22:02 +0200)]
Fixed none applied completion active colors.

10 years agoMoved ex command expansion to parsing.
Daniel Carl [Tue, 15 Oct 2013 19:33:48 +0000 (21:33 +0200)]
Moved ex command expansion to parsing.

By the way the expansion for '~/' to home dir was added.

10 years agoReleased version 0.1.10.
Daniel Carl [Sun, 13 Oct 2013 19:44:02 +0000 (21:44 +0200)]
Released version 0.1.10.

10 years agoAdded ':normal' command to run normal mode commands from input box.
Daniel Carl [Sun, 13 Oct 2013 19:06:04 +0000 (21:06 +0200)]
Added ':normal' command to run normal mode commands from input box.

This allows to run normal mode commands from input box, for example after
setting some options like ':set scripts!|no! R'.

10 years agoAllow to have commands with bang.
Daniel Carl [Sun, 13 Oct 2013 18:52:02 +0000 (20:52 +0200)]
Allow to have commands with bang.

10 years agoAdded strict-focus setting.
Daniel Carl [Sun, 13 Oct 2013 16:44:57 +0000 (18:44 +0200)]
Added strict-focus setting.

This allows to ignore possible focused form fields on pages that forces vimb
into input mode. If 'strict-focus' is on, vimb removes the focus from form
fields event if the page say that say should be focussed,

10 years agoAdded CTRL-V to pass the next key without mapping.
Daniel Carl [Sun, 13 Oct 2013 15:52:50 +0000 (17:52 +0200)]
Added CTRL-V to pass the next key without mapping.

10 years agoUse index of hints internal instead or number.
Daniel Carl [Sat, 12 Oct 2013 23:41:30 +0000 (01:41 +0200)]
Use index of hints internal instead or number.

This fastens the hint processing a little and uses less code than searching
for the hint with a given number in the internals of the hinting javascript.

10 years agoDon't use GNU extension in sed script.
Daniel Carl [Sat, 12 Oct 2013 20:41:07 +0000 (22:41 +0200)]
Don't use GNU extension in sed script.

Simplified the rules to match only comments used in the hints scripts.

10 years agoDon't use GNU extension in sed script.
Daniel Carl [Sat, 12 Oct 2013 20:41:07 +0000 (22:41 +0200)]
Don't use GNU extension in sed script.

Simplified the rules to match only comments used in the hints scripts.

10 years agoChanged hinting visibility check.
Daniel Carl [Sat, 12 Oct 2013 11:15:32 +0000 (13:15 +0200)]
Changed hinting visibility check.

Don't even check if the point in the center of the element is the element
itself, because this caused broken links to be not hintable, if the second
link line didn't reach the center of the above line. So now the element is
checked for the upper left corner too.

10 years agoChanged hinting visibility check.
Daniel Carl [Sat, 12 Oct 2013 11:15:32 +0000 (13:15 +0200)]
Changed hinting visibility check.

Don't even check if the point in the center of the element is the element
itself, because this caused broken links to be not hintable, if the second
link line didn't reach the center of the above line. So now the element is
checked for the upper left corner too.

11 years agoMoved show command to normal.c.
Daniel Carl [Mon, 7 Oct 2013 22:24:35 +0000 (00:24 +0200)]
Moved show command to normal.c.

We don't generate the show command for non bound mappings. This might save cpu
cycles. The show commands for the normal mode are set from the keypress
handler. So we can handle show commands like vim where an incomplete mapped
command like ':nmap foo 12g', where the '12g' should appear in show command as
incomplete command.

Now the show commands keys are displayed like in vim with <hex> for none
printable keys.

11 years agoAllow utf8 for keybinds.
Daniel Carl [Sun, 6 Oct 2013 20:57:03 +0000 (22:57 +0200)]
Allow utf8 for keybinds.

Used some key processing stuff from vim.

11 years agoRemoved mode_input_focusout callback.
Daniel Carl [Thu, 3 Oct 2013 18:50:51 +0000 (20:50 +0200)]
Removed mode_input_focusout callback.

This breaks the switching to input mode via hinting, because if the hints
caused entering the input mode we move the focus from inputbox, that called
the callback that forced switching to normal mode.

11 years agoAdded include to ex.c.
Daniel Carl [Thu, 3 Oct 2013 18:23:19 +0000 (20:23 +0200)]
Added include to ex.c.

<sys/wait.h> is needed for WIFEXITED and WEXITSTATUS macros.

Thanks Leonardo Taccari for this patch.

11 years agoAdded missed include to compile on NetBSD.
Daniel Carl [Thu, 3 Oct 2013 18:16:46 +0000 (20:16 +0200)]
Added missed include to compile on NetBSD.

<sys/wait.h> is needed for WIFEXITED and WEXITSTATUS macros.

Thanks Leonardo Taccari for this patch.