]> granicus.if.org Git - procps-ng/log
procps-ng
12 years agowatch: exit when command output changes.
Kent R. Spillner [Thu, 26 Jan 2012 14:42:37 +0000 (08:42 -0600)]
watch: exit when command output changes.

Add new flags to watch (-g/--chgexit) so that it exits when the
output changes.  This is useful in builds and shell scripts, for
example when deploying webapps to block the remainder of the
deployment steps until after the webapp starts.

e.g. watch --chgexit curl http://foo/bar

12 years agoMerge remote-tracking branch 'sami/vapier'
Craig Small [Tue, 24 Jan 2012 11:36:28 +0000 (22:36 +1100)]
Merge remote-tracking branch 'sami/vapier'

12 years agops: include error.h
Mike Frysinger [Tue, 24 Jan 2012 05:44:05 +0000 (00:44 -0500)]
ps: include error.h

This code currently uses error_at_line() from error.h, so pull it in.
Long term, this might get moved to c.h as a local helper on err.h,
but I have no idea.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agoproc: pull in ctype.h where needed
Mike Frysinger [Tue, 24 Jan 2012 05:41:39 +0000 (00:41 -0500)]
proc: pull in ctype.h where needed

Fix the build warnings:

sig.c:227:5: warning: implicit declaration of function 'toupper' [-Wimplicit-function-declaration]
sig.c:231:3: warning: implicit declaration of function 'isdigit' [-Wimplicit-function-declaration]

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agouse helpers from c.h
Mike Frysinger [Tue, 24 Jan 2012 05:40:28 +0000 (00:40 -0500)]
use helpers from c.h

A few files still use the C library helpers from err.h, so migrate
them to the local c.h helpers.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agowatch: include sys/wait.h for waitpid
Mike Frysinger [Tue, 24 Jan 2012 05:36:15 +0000 (00:36 -0500)]
watch: include sys/wait.h for waitpid

Fixes build warning:
watch.c:682:3: warning: implicit declaration of
function 'waitpid' [-Wimplicit-function-declaration]

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agoinclude error.h for error() and friends
Mike Frysinger [Tue, 24 Jan 2012 05:34:51 +0000 (00:34 -0500)]
include error.h for error() and friends

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agoskill: exclude debugging strings from nls
Sami Kerola [Sun, 22 Jan 2012 00:23:10 +0000 (01:23 +0100)]
skill: exclude debugging strings from nls

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agotload: remove unnecessary goto
Sami Kerola [Sat, 21 Jan 2012 22:29:02 +0000 (23:29 +0100)]
tload: remove unnecessary goto

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agodocs: aligh top.1 header with other procps-ng utils
Sami Kerola [Sat, 21 Jan 2012 15:49:47 +0000 (16:49 +0100)]
docs: aligh top.1 header with other procps-ng utils

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agodocs: add exit values to watch.1
Sami Kerola [Sat, 21 Jan 2012 15:41:31 +0000 (16:41 +0100)]
docs: add exit values to watch.1

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agotload: check write() return value
Sami Kerola [Sat, 21 Jan 2012 15:24:33 +0000 (16:24 +0100)]
tload: check write() return value

Exit at rare events when writing to tty is unsuccessful.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agopkill: enable displaying what is killed
Sami Kerola [Sat, 21 Jan 2012 12:24:02 +0000 (13:24 +0100)]
pkill: enable displaying what is killed

Add new command line options -e, --echo to display what is
killed. Cost of this change is greater run time memory footprint,
because an union had to be changed to struct to allow name and
pid printing which what I as an user would expect to see in
verbose kill output.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agopgrep: fix compiler warning
Sami Kerola [Sat, 21 Jan 2012 01:14:21 +0000 (02:14 +0100)]
pgrep: fix compiler warning

pgrep.c:786:4: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'int' [-Wformat]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agopkill: fix error printing
Sami Kerola [Sat, 21 Jan 2012 01:09:48 +0000 (02:09 +0100)]
pkill: fix error printing

Print correct pid number of process that was where not killed
because of kill was not successful. Incorrect behaviour before
this fix is bello.

-- snip
$ ps -elf | grep dh[c]
1 S root      1409     1  0  80   0 -  1782 poll_s 02:01 ?        00:00:00 dhclient wlan0
$ pkill dhc
pkill: killing pid 1 failed: Operation not permitted
-- snip

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agops: unify cases and remove trailing dots in messages
Sami Kerola [Fri, 13 Jan 2012 21:38:47 +0000 (22:38 +0100)]
ps: unify cases and remove trailing dots in messages

Strings with lower caps & no trailing dots have greater change to
have multiple occurences, meaning less effort for translators, than
strings with them.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agoother: make AUTHORS file obsolete
Sami Kerola [Tue, 10 Jan 2012 21:03:12 +0000 (22:03 +0100)]
other: make AUTHORS file obsolete

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agodocs: remove old information from HACKING
Sami Kerola [Tue, 10 Jan 2012 20:51:06 +0000 (21:51 +0100)]
docs: remove old information from HACKING

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agops: add catastrophic_failure()
Sami Kerola [Tue, 10 Jan 2012 20:47:11 +0000 (21:47 +0100)]
ps: add catastrophic_failure()

The catastrophic_failure function tries to make bug reporting useful
by telling in which line error occured, and drops core.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agoother: tell in ChangeLog where to see changes
Sami Kerola [Mon, 9 Jan 2012 18:50:20 +0000 (19:50 +0100)]
other: tell in ChangeLog where to see changes

We do not want to maintain ChangeLog, people should look git log
instead.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agotop: avoid %cpu distortions when toggling task/thread modes
Jim Warner [Mon, 9 Jan 2012 17:26:45 +0000 (11:26 -0600)]
top: avoid %cpu distortions when toggling task/thread modes

This commit addresses a long standing buglet (debian #441166) which
surfaces when the display mode is switched between task and threads.

An extra procps refresh is now forced upon such a transition which
parallels the approach used at startup for the exact same reason.

Reference: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=441166

12 years agotop: force newline for unexpected signal abnormal exit
Jim Warner [Sun, 8 Jan 2012 15:54:05 +0000 (09:54 -0600)]
top: force newline for unexpected signal abnormal exit

This commit just restores the pre-nls behavior, which was lost
in the migration to nls string tables support.

12 years agovmstat: slabinfo (-m option) test disabled if not readable
Jim Warner [Fri, 6 Jan 2012 14:49:21 +0000 (08:49 -0600)]
vmstat: slabinfo (-m option) test disabled if not readable

The dejagnu tests for slabtop are skipped when "/proc/slabinfo" is
unreadable due to permissions.  This commit provides the same check
for vmstat under its -m (slabinfo) option.

12 years agosysctl -p has no space
Craig Small [Fri, 13 Jan 2012 12:59:26 +0000 (23:59 +1100)]
sysctl -p has no space

The man page has examples like sysctl -p filename. Optional arguments
using getopt cannot have a space between the option and argument.
So the correct format is sysctl -pfilename

13 years agoLinux version for non-linux systems
Craig Small [Mon, 9 Jan 2012 10:57:44 +0000 (21:57 +1100)]
Linux version for non-linux systems

On non-linux systems, uts.version provides the version of that
specific kernel (FreeBSD or Hurd version, for example) and not the
emulated procfs pseudo version.

On those systems we need to directly read /proc/version and parse the
string.  This change replaces Debian patches gnu-kbsd-version and
complain_unmounted_proc patches.

13 years agoChange restrict to __restrict in public includes
Craig Small [Mon, 9 Jan 2012 10:44:51 +0000 (21:44 +1100)]
Change restrict to __restrict in public includes

procps automake defines restrict which means the binaries for procps
binaries compile. However external programs may not of defined
restrict which means they will not complie if they include files found
in /usr/include/proc.

Includes from libc6 use __restrict and if is good enough for
them, its good enough for us.

13 years agowatch needs a conditonal LDADD
Craig Small [Mon, 9 Jan 2012 10:40:53 +0000 (21:40 +1100)]
watch needs a conditonal LDADD

Makes Debian patch makefile_watch_ncurses redundant.
watch was being linked to NCURSES_LIBS when it should of been
WATCH_NCURSES_LIBS which can be ncursesw with 8bit enabled.

13 years agobuild-sys: use dist-xz
Sami Kerola [Sun, 8 Jan 2012 21:09:50 +0000 (22:09 +0100)]
build-sys: use dist-xz

Even as conservative project as coreutils has switched to xz distributions so
neither should we have any reason to use gz and waste space & bandwidth.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agoother: indent FAQ file
Sami Kerola [Sat, 7 Jan 2012 23:05:05 +0000 (00:05 +0100)]
other: indent FAQ file

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agoother: update CodingStyle
Sami Kerola [Sat, 7 Jan 2012 22:57:07 +0000 (23:57 +0100)]
other: update CodingStyle

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agoother: update BUGS file
Sami Kerola [Sat, 7 Jan 2012 17:14:35 +0000 (18:14 +0100)]
other: update BUGS file

Change information submission address to be procps@freelists.org and
instruct people to send patches in 'git am' friendly format.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agoother: update TODO
Sami Kerola [Sat, 7 Jan 2012 17:02:41 +0000 (18:02 +0100)]
other: update TODO

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agoother: move files to Documentation/ directory
Sami Kerola [Sat, 7 Jan 2012 16:57:07 +0000 (17:57 +0100)]
other: move files to Documentation/ directory

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agobuild-sys: use git version as package version
Sami Kerola [Sat, 7 Jan 2012 16:51:22 +0000 (17:51 +0100)]
build-sys: use git version as package version

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agow: indicate unknown host when -f is used
Sami Kerola [Mon, 26 Dec 2011 18:07:41 +0000 (19:07 +0100)]
w: indicate unknown host when -f is used

The option -f used too print `-' to FROM column when host was not
known. This commit changes behaviour back to what it was earlier.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agopwdx: re-create invalid process id check
Sami Kerola [Mon, 26 Dec 2011 17:42:05 +0000 (18:42 +0100)]
pwdx: re-create invalid process id check

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agoUpdated NEWS with new items for procps-ng 3.3.2 v3.3.2
Craig Small [Fri, 6 Jan 2012 05:48:09 +0000 (16:48 +1100)]
Updated NEWS with new items for procps-ng 3.3.2

13 years agodocs: add preload paths to sysctl.conf.5
Sami Kerola [Thu, 5 Jan 2012 20:27:15 +0000 (21:27 +0100)]
docs: add preload paths to sysctl.conf.5

The patch also has other maintenance fixes, such as man header fixes,
high lighting corrections and add bug report address.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agodocs: clarify slabtop sort criteria listing
Sami Kerola [Thu, 5 Jan 2012 19:11:34 +0000 (20:11 +0100)]
docs: clarify slabtop sort criteria listing

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agoslabtop: total slabs & caches header fix
Sami Kerola [Thu, 5 Jan 2012 18:39:41 +0000 (19:39 +0100)]
slabtop: total slabs & caches header fix

Commit 0ac63f5bc173b09fc41fbab8776025d18621b93e messed up header
print order; the Total Slabs and Total Caches where reported in place
of each other.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agodocs: watch manual update about -e option behaviour change
Sami Kerola [Thu, 5 Jan 2012 11:23:46 +0000 (12:23 +0100)]
docs: watch manual update about -e option behaviour change

Relates to: commit 7ac61b3fa112e242bb5d52bac35ad82fb5f85f11

Signed-off-by: Sami Kerola <sami.kerola@tomtom.com>
13 years agops: corrections to messages
Sami Kerola [Thu, 5 Jan 2012 11:11:04 +0000 (12:11 +0100)]
ps: corrections to messages

Signed-off-by: Sami Kerola <sami.kerola@tomtom.com>
13 years agopgrep: correction to usage output
Sami Kerola [Thu, 5 Jan 2012 08:36:12 +0000 (09:36 +0100)]
pgrep: correction to usage output

Signed-off-by: Sami Kerola <sami.kerola@tomtom.com>
13 years agowatch: correct differences option, eliminate duplicate help text
Jim Warner [Wed, 4 Jan 2012 20:10:09 +0000 (14:10 -0600)]
watch: correct differences option, eliminate duplicate help text

13 years agowatch: halt screen at exit on error
Sami Kerola [Wed, 4 Jan 2012 19:11:33 +0000 (20:11 +0100)]
watch: halt screen at exit on error

This change allows user to see what was the last message before exit
on error, and when where the last update.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agowatch: include strutils.h
Sami Kerola [Wed, 4 Jan 2012 18:23:19 +0000 (19:23 +0100)]
watch: include strutils.h

Without the header strtod_or_err() returned random value.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agops: change PACKAGE_BUGREPORT to procps@freelists.org
Jim Warner [Wed, 4 Jan 2012 13:53:35 +0000 (07:53 -0600)]
ps: change PACKAGE_BUGREPORT to procps@freelists.org

13 years agops: update url for BUILD_WITH_WHINE error message
Jim Warner [Wed, 4 Jan 2012 13:11:53 +0000 (07:11 -0600)]
ps: update url for BUILD_WITH_WHINE error message

13 years agotop: add PACKAGE and LOCALEDIR to ATEOJ_RPTSTD output
Jim Warner [Wed, 4 Jan 2012 14:05:58 +0000 (08:05 -0600)]
top: add PACKAGE and LOCALEDIR to ATEOJ_RPTSTD output

13 years agoFor free -b make the variable a long long
Craig Small [Wed, 4 Jan 2012 22:37:58 +0000 (09:37 +1100)]
For free -b make the variable a long long

Bug-Debian: http://bugs.debian.org/654368

On systems with very large amonut of RAM when they use the -b or --bytes
option on free you get overflow and free shows a negative amount of
memory, which is obviously wrong.

13 years agoCheck for 0 repeat count and tests in free
Craig Small [Tue, 3 Jan 2012 23:07:31 +0000 (10:07 +1100)]
Check for 0 repeat count and tests in free

free checks for -c 0 now too.
testsuite has new checks for the checks.

13 years agofree -c option uses strutils
Craig Small [Tue, 3 Jan 2012 22:53:51 +0000 (09:53 +1100)]
free -c option uses strutils

The handling of the -c (count) option in free uses the standard string
handling and error utils.  The program also checks for negative counts
and errors on these.

13 years agofixed e and x options in watch
Craig Small [Tue, 3 Jan 2012 22:18:16 +0000 (09:18 +1100)]
fixed e and x options in watch

The -e option would print a confusing error message. This is because
most error messages in watch are one word.  This fix makes a more
sensible message about what went wrong.

The -x option exited before the endwin() function was called, so if the
child process died the terminal was left in a funky state. endwin is now
called just before the exit(8) for the -x option.

13 years agobuild-sys: correct all Makefile.am files for LOCALEDIR, etc
Jim Warner [Mon, 2 Jan 2012 15:08:58 +0000 (09:08 -0600)]
build-sys: correct all Makefile.am files for LOCALEDIR, etc

Some of the latest changes to Makefile.am files are missing.

This patch restores the LOCALEDIR variable, among others,
and dispenses with the include directives in the ps/ and top/
subdirectories since they're no longer needed.

13 years agotop: update some programmer documentation (no logic, just comments)
Jim Warner [Thu, 29 Dec 2011 17:50:32 +0000 (11:50 -0600)]
top: update some programmer documentation (no logic, just comments)

This commit corrects some outdated programmer comments.

Additionally, certain nls justifications might become
increasingly obscure with the passage of time so some
previous nls commit text has been added as comments.

13 years agops: update man document for redesigned help provisions
Jim Warner [Fri, 30 Dec 2011 23:01:15 +0000 (17:01 -0600)]
ps: update man document for redesigned help provisions

13 years agops: generalize help text logic, add related translator hints
Jim Warner [Mon, 2 Jan 2012 07:33:34 +0000 (01:33 -0600)]
ps: generalize help text logic, add related translator hints

This commit represents an experiment in nls help text support.

The word --help itself been made translatable along with the
help section names and their abbreviations.  Thus, the work of
the translators will ultimately alter program run-time behavior.

Perhaps someday all "long" options can behave in a similar way
which could offer a considerable benefit to other languages.
Instead of translationg just option descriptions, the long
forms of those options could also be transalated.

This commit also:
 . includes the section abbreviations in --help output
 . isolates all --help support in the ps/help.c module
 . provides (hopefully) meaningful Translator guidance
 . removes --help support from the ps/common.h header
 . removes --help support from the ps/parser.c module
 . eliminates tabs in line with the style of other ps modules
 . eliminates the need for the include/c.h header file

13 years agops: exclude debugging only code from participation in nls support
Jim Warner [Mon, 7 Nov 2011 16:21:41 +0000 (10:21 -0600)]
ps: exclude debugging only code from participation in nls support

This commit is prmarily concerned with elimnating deugging only
code from the nls template file.

It also eliminates any remaing useless trailing whitespace.

13 years agops: minor reformatting and trailing whitespace elimination
Jim Warner [Tue, 27 Dec 2011 22:22:43 +0000 (16:22 -0600)]
ps: minor reformatting and trailing whitespace elimination

This patch mostly reorganizes include files and eliminates
some useless trailing whitespace.

It also adopts the standard procps-ng unconditional approach
to nls initialization.

13 years agops: trade cumbersome GNU attributes with less wordy alternatives
Jim Warner [Mon, 2 Jan 2012 07:26:45 +0000 (01:26 -0600)]
ps: trade cumbersome GNU attributes with less wordy alternatives

13 years agoChanged the err and warns to macros
Craig Small [Tue, 3 Jan 2012 07:48:43 +0000 (18:48 +1100)]
Changed the err and warns to macros

err and warn are BSD format but they are not recommended by library
developers.  However their consiseness is useful!

The solution is to use some macros that create xerr etc which then
just map to the error() function.  The next problem is error() uses
program_invocation_name so we set this to program_invovation_short_name

This is a global set but seems to be the convention (or at least errors
are on the short name only) used everywhere else.

13 years agoMade the c and nls include explicit
Craig Small [Mon, 2 Jan 2012 06:46:17 +0000 (17:46 +1100)]
Made the c and nls include explicit

These two includes need the path otherwise the make distcheck fails.
I suspect its actually a ps/Makefile.am problem

13 years agoUpdated testsuite files for new NLS output
Craig Small [Mon, 2 Jan 2012 06:39:41 +0000 (17:39 +1100)]
Updated testsuite files for new NLS output

13 years agotranslations: group usage texts
Sami Kerola [Tue, 27 Dec 2011 20:46:16 +0000 (21:46 +0100)]
translations: group usage texts

Reference: http://www.freelists.org/post/procps/backporting,5
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agow: fix broken -o (old-style) short form option
Jim Warner [Wed, 28 Dec 2011 07:27:27 +0000 (01:27 -0600)]
w: fix broken -o (old-style) short form option

13 years agobuild-sys: re-enable 'dist' build
Jim Warner [Mon, 26 Dec 2011 22:47:19 +0000 (16:47 -0600)]
build-sys: re-enable 'dist' build

The 'build-sys: re-enable out of tree build' commit
failed to also address the 'dist' target errors.

13 years agoMerge branch 'master' into nls
Craig Small [Sun, 25 Dec 2011 22:11:27 +0000 (09:11 +1100)]
Merge branch 'master' into nls

Conflicts:
configure.ac
pmap.c
ps/Makefile.am

13 years agoRenaming libprocfs to libprocps
Craig Small [Thu, 22 Dec 2011 22:18:43 +0000 (09:18 +1100)]
Renaming libprocfs to libprocps

The library used to be called libprocps but it was renamed to make sure
there was only one. However the formatting of the library SONAME has
changed so there cannot be any confusion.

libprocps makes it clear that its a library from this project and not a
set of functions directly on the filesystem.

13 years agoFixed pmap -x Kbytes column
Craig Small [Thu, 22 Dec 2011 13:44:23 +0000 (00:44 +1100)]
Fixed pmap -x Kbytes column

The Kbytes column when using the pmap -x flag would always be zero. This
was because the diff variable was reset before it could be printed.
pmap with no -x was not impacted by this bug or fix.

13 years agoFixed slabtop -o crash
Craig Small [Thu, 22 Dec 2011 12:53:17 +0000 (23:53 +1100)]
Fixed slabtop -o crash

printw should only be used for ncurses enabled screens, slabtop -o needs
to use the standard printf function, as before.

13 years agotop: update README with benchmarks using NLS support
Jim Warner [Wed, 21 Dec 2011 16:36:15 +0000 (10:36 -0600)]
top: update README with benchmarks using NLS support

13 years agotop: additions to search narrative in man documment
Jim Warner [Wed, 21 Dec 2011 15:31:36 +0000 (09:31 -0600)]
top: additions to search narrative in man documment

13 years agotop: final cleanup following nls conflict resolutions
Jim Warner [Tue, 20 Dec 2011 21:17:26 +0000 (15:17 -0600)]
top: final cleanup following nls conflict resolutions

This patch represents the final resting place for miscellaneous
changes not otherwise encountered or for which the resolution
was incomplete or incorrect.

13 years agotop: adapt 'locate/find next' search capability for nls
Jim Warner [Tue, 20 Dec 2011 20:43:54 +0000 (14:43 -0600)]
top: adapt 'locate/find next' search capability for nls

13 years agotop: changed 'err' to 'errmsg', avoid conflict with <err.h>
Jim Warner [Fri, 9 Dec 2011 17:10:30 +0000 (11:10 -0600)]
top: changed 'err' to 'errmsg', avoid conflict with <err.h>

13 years agotop: streamlined creation of nls string tables
Jim Warner [Wed, 7 Dec 2011 10:41:14 +0000 (04:41 -0600)]
top: streamlined creation of nls string tables

The gettext documentation leads one to believe that
a printf type call is necessary for gettext string
extraction.  That turns out to be misleading and
all one really needs is the runtime gettext string
address resolution.

Thus, we can avoid our original snprintf/strdup
overhead and establish an address for the original
or translated string just by issuing the _() macro.

We create these nls string tables so that:
  1) top avoids the overhead of repeated
     runtime function calls
  2) we can control the order of top's
     strings in the .pot file
  3) translator comments don't obscure
     and clutter the main program

13 years agotop: corrected typos and clarified 'Translation' notes
Jim Warner [Wed, 7 Dec 2011 11:40:37 +0000 (05:40 -0600)]
top: corrected typos and clarified 'Translation' notes

13 years agotop: repositioned nls.h to avoid redefine of procps.h restrict
Jim Warner [Thu, 3 Nov 2011 22:31:00 +0000 (17:31 -0500)]
top: repositioned nls.h to avoid redefine of procps.h restrict

13 years agotop: added <stdlib.h> for VALIDATE_NLS which requires exit()
Jim Warner [Thu, 3 Nov 2011 22:23:21 +0000 (17:23 -0500)]
top: added <stdlib.h> for VALIDATE_NLS which requires exit()

13 years agotop: idiot! sometimes nls was misspelled nsl (but not anymore)
Jim Warner [Sat, 5 Nov 2011 23:34:50 +0000 (18:34 -0500)]
top: idiot! sometimes nls was misspelled nsl (but not anymore)

13 years agotop: added additional xgettext strings plus translator hints
Jim Warner [Mon, 7 Nov 2011 09:08:27 +0000 (03:08 -0600)]
top: added additional xgettext strings plus translator hints

13 years agotop: adapted/generalized comments for Makevars --add-comments=
Jim Warner [Sun, 6 Nov 2011 23:08:43 +0000 (17:08 -0600)]
top: adapted/generalized comments for Makevars --add-comments=

13 years agotop: finalized nls translation implementation
Jim Warner [Wed, 2 Nov 2011 17:30:03 +0000 (12:30 -0500)]
top: finalized nls translation implementation

13 years agotop: made prolog comments like those in procps:master
Jim Warner [Fri, 28 Oct 2011 15:28:37 +0000 (10:28 -0500)]
top: made prolog comments like those in procps:master

13 years agotop: provided for nls table integrity validation
Jim Warner [Sat, 29 Oct 2011 01:38:08 +0000 (20:38 -0500)]
top: provided for nls table integrity validation

13 years agotop: restored static to scat(), not needed in top_nls.c
Jim Warner [Fri, 28 Oct 2011 15:49:06 +0000 (10:49 -0500)]
top: restored static to scat(), not needed in top_nls.c

13 years agotop: corrected double #include missed at rebase
Jim Warner [Mon, 31 Oct 2011 08:46:39 +0000 (03:46 -0500)]
top: corrected double #include missed at rebase

13 years agotop: corrected missed escape seq from redesign
Jim Warner [Fri, 28 Oct 2011 15:30:40 +0000 (10:30 -0500)]
top: corrected missed escape seq from redesign

13 years agotop: optimization for show_special function
Jim Warner [Mon, 24 Oct 2011 22:20:45 +0000 (17:20 -0500)]
top: optimization for show_special function

13 years agotop: tweaked some xgettext emitted comments
Jim Warner [Thu, 27 Oct 2011 00:40:59 +0000 (19:40 -0500)]
top: tweaked some xgettext emitted comments

13 years agotop: added #include of proc/readproc.h to top.h
Jim Warner [Mon, 24 Oct 2011 22:18:57 +0000 (17:18 -0500)]
top: added #include of proc/readproc.h to top.h

13 years agotop: redesign Uniq_nlstab/show_special (nls quirks)
Jim Warner [Wed, 19 Oct 2011 19:14:37 +0000 (14:14 -0500)]
top: redesign Uniq_nlstab/show_special (nls quirks)

Until this patch, top had used some strings with
special escape sequences to produce colors, normal
text, bold text, etc.  They took the following form,
explained by an excerpt from program comments:
  ...
  Our special formatting consists of:
     "some text <_delimiter_> some more text <_delimiter_>...\n"
  Where <_delimiter_> is a single byte in the range of:
     \001 through \010  (in decimalizee, 1 - 8)
  and is used to select an 'attribute' from a capabilities table
  which is then applied to the *preceding* substring.
  ...

Unfortunately, these nonprinting values revealed
insurmountable inconsistencies in both the front-end
and back-end translation tools.

The xgettext (extraction) program would take those
special escapes, convert them and then output raw
binary values.  Thus the .pot file would contain
lots of unprintable stuff making it unreadable.

If the following was added to po/Makevars, most of
those special escapes would be preserved in their
escape notation:
  XGETTEXT_OPTIONS = ... --escape
But two escapes were converted from octal notation
and there was no way to prevent it:
  \007  -->  \a
  \010  -->  \b

After a pass through the msginit program, most of
the escapes were reconverted to raw binary values
making translation impossible.  There was no
"--escape" option for the back-end programs like
there was for xgettext.

But the real killer was the escape \004, also used
in some of top's special strings.  This value would
be silently accepted by xgettext, only to produce
the following fatal error in back-end programs like
msginit, msgfmt and msgen:
  .pot:2647: context separator <EOT> within string

To quote from one of the references below:
  "Would you create a suite of tools that silently
   allow what is destined to become a fatal error
   to pass unnoticed?"

So the bottom line was: top's special strings, in
use for the past nine years, had to be redesigned.

References:
http://www.freelists.org/post/procps/procpsng-nls-support,11
http://www.freelists.org/post/procps/procpsng-nls-support,14

13 years agotop: shortened some of the longer lines, mostly nls
Jim Warner [Mon, 17 Oct 2011 23:29:59 +0000 (18:29 -0500)]
top: shortened some of the longer lines, mostly nls

13 years agotop: relocated nls.h from top_nls.h to top_nls.c
Jim Warner [Sun, 16 Oct 2011 22:56:11 +0000 (17:56 -0500)]
top: relocated nls.h from top_nls.h to top_nls.c

13 years agotop: use existing unsigned vs. separate int
Jim Warner [Sun, 16 Oct 2011 21:47:55 +0000 (16:47 -0500)]
top: use existing unsigned vs. separate int

13 years agotop: corrected several programmer comments
Jim Warner [Sat, 15 Oct 2011 00:58:02 +0000 (19:58 -0500)]
top: corrected several programmer comments

13 years agotop: fix misapplied 'rh analysis #2: top' patch
Jim Warner [Wed, 19 Oct 2011 08:33:04 +0000 (03:33 -0500)]
top: fix misapplied 'rh analysis #2: top' patch

13 years agotop: finalized top nls support (or so he thought)
Jim Warner [Fri, 14 Oct 2011 16:45:44 +0000 (11:45 -0500)]
top: finalized top nls support (or so he thought)

summary of changes:
. adopted relative paths to 'include' and 'proc'
  dirs so that stand alone compiles are made
  easier and no one need guess their locations

. corrected several names for enums and macro
  usage reflecting fmt vs. txt

. expanded all octal escape sequences to a full
  3 digits since one already required 3 digits

. finalized translator hints (for now)

programming note:
  as an aside, by not including an argument for
  the gettext --add-comments, any preceeding c
  style comment will be propagated to the .pot
  file, if the gettext macro isn't empty.

  /* Need Not Say 'TRANSLATORS' ...
  snprintf(buf, sizeof(buf), "%s", _(   // unseen
  /* Translator Hint: ...
  snprintf(buf, sizeof(buf), "%s", _("" // seen

13 years agotop: provide extensive, generalized nls support
Jim Warner [Tue, 11 Oct 2011 19:02:59 +0000 (14:02 -0500)]
top: provide extensive, generalized nls support

Reviewed-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Jim Warner <james.warner@comcast.net>
13 years agotop: add gettext support
Sami Kerola [Sun, 9 Oct 2011 13:03:32 +0000 (15:03 +0200)]
top: add gettext support

Signed-off-by: Jim Warner <james.warner@comcast.net>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>