Big cleanup: Remove trailing whitespace from files (except those imported

from external sources).
This commit is contained in:
mmdolze
2010-10-30 18:04:21 +00:00
parent 49cd060374
commit fd9b2ce713
113 changed files with 856 additions and 856 deletions
+2 -2
View File
@@ -73,7 +73,7 @@ if ($opt{V}) {
exit(0);
}
# check number of arguments
# check number of arguments
usage(1) if ($#ARGV >= 0);
@@ -197,7 +197,7 @@ my $status = shift;
}
else {
print STDERR "For help, type: $progname -h\n";
}
}
exit($status);
}
+6 -6
View File
@@ -50,9 +50,9 @@ my $PORT = "13666";
my $PING = "ping";
# list of hosts to be ping'ed
my @MACHINES = ("lcdproc.omnipotent.net",
my @MACHINES = ("lcdproc.omnipotent.net",
"www.linux.org",
"www.daemonnews.org",
"www.daemonnews.org",
"127.0.0.1",
"seurat",
"rodin",
@@ -86,7 +86,7 @@ if ($opt{V}) {
exit(0);
}
# check number of arguments
# check number of arguments
#usage(1) if ($#ARGV >= 0);
# set variables
@@ -152,7 +152,7 @@ while (1) {
`$PING -c 1 $machine`;
$pingstatus{$machine} = ($?) ? 0 : 1;
}
# count reachablei (up) machines
@list = grep { $pingstatus{$_} == 1 } @MACHINES;
print $remote "widget_set pings one 1 2 {Machines Up: ",scalar(@list),"}\n";
@@ -201,7 +201,7 @@ my $status = shift;
}
else {
print STDERR "For help, type: $progname -h\n";
}
}
exit($status);
}
@@ -232,7 +232,7 @@ B<iosock.pl>
B<iosock.pl> is a small example client for LCDd, the lcdproc server.
It tries to ping the servers given as parameters and displays on the LCD
whether they are reachable or not.
whether they are reachable or not.
If no hosts are given as parameters a built-in list of default machines will be checked.
=head1 OPTIONS
+9 -9
View File
@@ -60,7 +60,7 @@ more-than-2-line (typically 4-line) displays.
how long to keep this client running (default is 5 seconds).
-v <verbosity>
set logging verbosity level to <verbosity>.
set logging verbosity level to <verbosity>.
-V
display the present version number of lcdident.
@@ -91,17 +91,17 @@ Perl 5.004;
=head1 DISCLAMER
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
=head1 SEE ALSO
@@ -262,7 +262,7 @@ while(defined(my $input = <$remote>)) { }
# all done
grace();
# send a SIGINT or SIGTERM to exit nicely.
# To be called on exit and on SIGINT or SIGTERM.
@@ -283,7 +283,7 @@ my $status = shift;
print STDERR " where <options> are\n" .
" -s <server> connect to <server> (default: $server)\n" .
" -p <port> connect to <port> on <server> (default: $port)\n" .
" -t <seconds> how long to hold the client screen up (default: $waittime seconds).\n" .
" -t <seconds> how long to hold the client screen up (default: $waittime seconds).\n" .
" -v <verbosity> verbosity level (default: $verbose, max verbosity: 5)\n" .
" -h show this help page\n" .
" -V display version number\n";
+7 -7
View File
@@ -80,7 +80,7 @@ if ($opt{V}) {
exit(0);
}
# check number of arguments
# check number of arguments
usage(1) if ($#ARGV != 0);
@@ -114,11 +114,11 @@ my $lcdresponse = <$remote>;
# get width & height from server's greet message
if ($lcdresponse =~ /\bwid\s+(\d+)\b/) {
$width = 0 + $1;
}
}
if ($lcdresponse =~ /\bhgt\s+(\d+)\b/) {
$lines = (0 + $1) - 1;
$top = $lines;
}
}
# Turn off blocking mode...
fcntl($remote, F_SETFL, O_NONBLOCK);
@@ -170,13 +170,13 @@ while (1) {
if ($key eq 'Down') {
$top-- if ($top > $lines);
}
elsif ($key eq 'Up') {
elsif ($key eq 'Up') {
$top++;
}
elsif ($key eq 'Right') {
$left++;
}
elsif ($key eq 'Left') {
elsif ($key eq 'Left') {
$left-- if ($left > 1);
}
}
@@ -205,7 +205,7 @@ while (1) {
use integer; # calculate integers like in C
my $w = 8 + 8 * ($idx / 8) - $idx;
my $subst = " " x $w;
$line =~ s/\t/" " x $w/e;
}
@@ -266,7 +266,7 @@ my $status = shift;
}
else {
print STDERR "For help, type: $progname -h\n";
}
}
exit($status);
}
+4 -4
View File
@@ -100,7 +100,7 @@ if ($opt{V}) {
exit(0);
}
# check number of arguments
# check number of arguments
usage(1) if ($#ARGV >= 0);
@@ -207,7 +207,7 @@ while(1) {
# To be called on exit and on SIGINT or SIGTERM.
sub grace() {
print "Exiting...\n" if ($verbose >= 5);
# release keys
print $remote "client_del_key Left\n";
$lcdresponse = <$remote>;
@@ -215,7 +215,7 @@ sub grace() {
$lcdresponse = <$remote>;
print $remote "client_del_key Enter\n";
$lcdresponse = <$remote>;
# close socket
close($remote);
exit;
@@ -252,7 +252,7 @@ my $status = shift;
}
else {
print STDERR "For help, type: $progname -h\n";
}
}
exit($status);
}
+1 -1
View File
@@ -1,4 +1,4 @@
# lcdexec LCDproc client configuration file
# lcdexec LCDproc client configuration file
## general options for lcdexec ##
[lcdexec]
+16 -16
View File
@@ -281,7 +281,7 @@ int menu_sock_send(MenuEntry *me, MenuEntry *parent, int sock)
if (sock_printf(sock, "menu_set_item \"%s\" \"%d\" -menu_result quit\n",
parent_id, me->id) < 0)
return -1;
}
}
else {
if ((parent != NULL) && (me->id != 0)) {
if (sock_printf(sock, "menu_add_item \"%s\" \"%d\" menu \"%s\"\n",
@@ -293,14 +293,14 @@ int menu_sock_send(MenuEntry *me, MenuEntry *parent, int sock)
for (entry = me->children; entry != NULL; entry = entry->next) {
if (menu_sock_send(entry, me, sock) < 0)
return -1;
}
}
}
}
break;
case MT_ARG_SLIDER:
if (sock_printf(sock, "menu_add_item \"%s\" \"%d\" slider -text \"%s\""
" -value %d -minvalue %d -maxvalue %d"
" -mintext \"%s\" -maxtext \"%s\" -stepsize %d\n",
parent_id, me->id, me->displayname,
parent_id, me->id, me->displayname,
me->data.slider.value,
me->data.slider.minval,
me->data.slider.maxval,
@@ -313,7 +313,7 @@ int menu_sock_send(MenuEntry *me, MenuEntry *parent, int sock)
if (sock_printf(sock, "menu_set_item \"%s\" \"%d\" -next _quit_\n",
parent_id, me->id) < 0)
return -1;
}
}
break;
case MT_ARG_RING:
{
@@ -331,7 +331,7 @@ int menu_sock_send(MenuEntry *me, MenuEntry *parent, int sock)
if (sock_printf(sock, "menu_add_item \"%s\" \"%d\" ring -text \"%s\""
" -value %d -strings \"%s\"\n",
parent_id, me->id, me->displayname,
parent_id, me->id, me->displayname,
me->data.ring.value,
tmp) < 0)
return -1;
@@ -341,12 +341,12 @@ int menu_sock_send(MenuEntry *me, MenuEntry *parent, int sock)
if (sock_printf(sock, "menu_set_item \"%s\" \"%d\" -next _quit_\n",
parent_id, me->id) < 0)
return -1;
}
}
break;
case MT_ARG_NUMERIC:
if (sock_printf(sock, "menu_add_item \"%s\" \"%d\" numeric -text \"%s\""
" -value %d -minvalue %d -maxvalue %d\n",
parent_id, me->id, me->displayname,
parent_id, me->id, me->displayname,
me->data.numeric.value,
me->data.numeric.minval,
me->data.numeric.maxval) < 0)
@@ -356,14 +356,14 @@ int menu_sock_send(MenuEntry *me, MenuEntry *parent, int sock)
if (sock_printf(sock, "menu_set_item \"%s\" \"%d\" -next _quit_\n",
parent_id, me->id) < 0)
return -1;
}
}
break;
case MT_ARG_ALPHA:
if (sock_printf(sock, "menu_add_item \"%s\" \"%d\" alpha -text \"%s\""
" -value \"%s\" -minlength %d -maxlength %d"
" -allow_caps false -allow_noncaps false"
" -allow_numbers false -allowed_extra \"%s\"\n",
parent_id, me->id, me->displayname,
parent_id, me->id, me->displayname,
me->data.alpha.value,
me->data.alpha.minlen,
me->data.alpha.maxlen,
@@ -374,12 +374,12 @@ int menu_sock_send(MenuEntry *me, MenuEntry *parent, int sock)
if (sock_printf(sock, "menu_set_item \"%s\" \"%d\" -next _quit_\n",
parent_id, me->id) < 0)
return -1;
}
}
break;
case MT_ARG_IP:
if (sock_printf(sock, "menu_add_item \"%s\" \"%d\" ip -text \"%s\""
" -value \"%s\" -v6 %s\n",
parent_id, me->id, me->displayname,
parent_id, me->id, me->displayname,
me->data.ip.value,
boolValueName[me->data.ip.v6]) < 0)
return -1;
@@ -388,12 +388,12 @@ int menu_sock_send(MenuEntry *me, MenuEntry *parent, int sock)
if (sock_printf(sock, "menu_set_item \"%s\" \"%d\" -next _quit_\n",
parent_id, me->id) < 0)
return -1;
}
}
break;
case MT_ARG_CHECKBOX:
if (sock_printf(sock, "menu_add_item \"%s\" \"%d\" checkbox -text \"%s\""
" -value %s -allow_gray %s\n",
parent_id, me->id, me->displayname,
parent_id, me->id, me->displayname,
triGrayValueName[me->data.checkbox.value],
boolValueName[me->data.checkbox.allow_gray]) < 0)
return -1;
@@ -402,7 +402,7 @@ int menu_sock_send(MenuEntry *me, MenuEntry *parent, int sock)
if (sock_printf(sock, "menu_set_item \"%s\" \"%d\" -next _quit_\n",
parent_id, me->id) < 0)
return -1;
}
}
break;
case MT_ARG_ACTION | MT_AUTOMATIC:
if (sock_printf(sock, "menu_add_item \"%s\" \"%d\" action \"%s\"\n",
@@ -515,7 +515,7 @@ void menu_free(MenuEntry *me)
free(me->data.checkbox.map[i]);
me->data.checkbox.map[i] = NULL;
}
}
}
default:
break;
}
+12 -12
View File
@@ -155,7 +155,7 @@ int machine_get_battstat(int *acstat, int *battflag, int *percent)
*percent = (int)((double)curCapacity/(double)maxCapacity * 100);
/* There is a way to check this through the IOKit,
but I am not sure what gets returned for kIOPSLowWarnLevelKey and kIOPSDeadWarnLevelKey,
but I am not sure what gets returned for kIOPSLowWarnLevelKey and kIOPSDeadWarnLevelKey,
and this is easier.
*/
if (*battflag == LCDP_BATT_UNKNOWN) {
@@ -314,20 +314,20 @@ int machine_get_meminfo(meminfo_type *result)
int machine_get_procs(LinkedList *procs)
{
struct kinfo_proc *kprocs;
procinfo_type *p;
int nproc, i;
int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_ALL, 0 };
size_t size = 0;
/* Call sysctl with a NULL buffer as a dry run. */
/* Call sysctl with a NULL buffer as a dry run. */
if ( sysctl(mib, 4, NULL, &size, NULL, 0 ) < 0)
{
perror("Failure calling sysctl");
return FALSE;
}
/* Allocate a buffer based on previous results of sysctl. */
/* Allocate a buffer based on previous results of sysctl. */
kprocs = (struct kinfo_proc *)alloca(size);
if (kprocs == NULL)
{
@@ -341,7 +341,7 @@ int machine_get_procs(LinkedList *procs)
return FALSE;
}
nproc = size / sizeof(struct kinfo_proc);
nproc = size / sizeof(struct kinfo_proc);
for (i = 0; i < nproc; i++, kprocs++)
{
@@ -380,7 +380,7 @@ int machine_get_procs(LinkedList *procs)
} else {
/* This error pops up very often because of Mac OS X security fixes.
It might pop up all of the time on an intel Mac.
Basically, we cannot get many tasks unless we are root.
Basically, we cannot get many tasks unless we are root.
perror("task_for_pid");
printf("process: %s, owner:%d\n", kprocs->kp_proc.p_comm, kprocs->kp_eproc.e_pcred.p_ruid); */
p->totl = 0;
@@ -420,7 +420,7 @@ int machine_get_smpload(load_type *result, int *numcpus)
}
return(TRUE);
}
}
int machine_get_uptime(double *up, double *idle)
{
@@ -449,7 +449,7 @@ int machine_get_uptime(double *up, double *idle)
}
static int swapmode(int *rettotal, int *retfree)
{
{
#ifdef VM_SWAPUSAGE
size_t size;
struct xsw_usage xsu;
@@ -471,7 +471,7 @@ static int swapmode(int *rettotal, int *retfree)
*rettotal = (xsu.xsu_total/1024);
*retfree = ((xsu.xsu_total-xsu.xsu_used)/1024);
return(TRUE);
return(TRUE);
#endif
*rettotal = 0;
@@ -487,16 +487,16 @@ int machine_get_iface_stats (IfaceInfo *interface)
int name[6] = {CTL_NET, PF_LINK, NETLINK_GENERIC, IFMIB_SYSTEM, IFMIB_IFCOUNT};
size_t len;
struct ifmibdata ifmd; /* ifmibdata contains the network statistics */
len = sizeof(rows);
/* get number of interfaces */
if (sysctl(name, 5, &rows, &len, 0, 0) == 0) {
interface->status = down; /* set status down by default */
name[3] = IFMIB_IFDATA;
name[4] = 0;
name[5] = IFDATA_GENERAL;
len = sizeof(ifmd);
/* walk through all interfaces in the ifmib table from last to first */
for ( ; rows > 0; rows--) {
+7 -7
View File
@@ -332,7 +332,7 @@ int machine_get_procs(LinkedList *procs)
kvm_close(kvmd);
return(FALSE);
}
#if (__FreeBSD_version > 500000)
#if (__FreeBSD_version > 500000)
strncpy(p->name, kprocs->ki_comm, 15);
#else
strncpy(p->name, kprocs->kp_proc.p_comm, 15);
@@ -341,10 +341,10 @@ int machine_get_procs(LinkedList *procs)
#if (__FreeBSD_version > 500000)
p->totl = kprocs->ki_size / 1024;
p->number = kprocs->ki_pid;
#else
#else
p->totl = kprocs->kp_eproc.e_vm.vm_map.size / 1024;
p->number = kprocs->kp_proc.p_pid;
#endif
#endif
LL_Push(procs, (void *)p);
kprocs++;
@@ -387,7 +387,7 @@ int machine_get_smpload(load_type *result, int *numcpus)
if (pcpudata == NULL || pcpudata == (void *) -1)
return(FALSE);
/* extract the data for single CPU */
load.user = (unsigned long) (pcpudata->pc_cp_time[CP_USER]);
load.nice = (unsigned long) (pcpudata->pc_cp_time[CP_NICE]);
@@ -477,10 +477,10 @@ static int swapmode(int *retavail, int *retfree)
}
/*************************************************************************
* Read interface statistics from system and store in the struct
* passed as a pointer. If there are no errors, it returns 1. If errors,
* Read interface statistics from system and store in the struct
* passed as a pointer. If there are no errors, it returns 1. If errors,
* returns 0.
*************************************************************************
*************************************************************************
*/
int machine_get_iface_stats (IfaceInfo *interface)
{
+10 -10
View File
@@ -512,7 +512,7 @@ int machine_get_smpload(load_type *result, int *numcpus)
result[ncpu].nice = curr_load[ncpu].nice - last_load[ncpu].nice;
result[ncpu].system = curr_load[ncpu].system - last_load[ncpu].system;
result[ncpu].idle = curr_load[ncpu].idle - last_load[ncpu].idle;
// struct assignment is legal in C89
last_load[ncpu] = curr_load[ncpu];
@@ -546,10 +546,10 @@ int machine_get_uptime(double *up, double *idle)
/*************************************************************************
* Read interface statistics from system and store in the struct
* passed as a pointer. If there are no errors, it returns 1. If errors,
* Read interface statistics from system and store in the struct
* passed as a pointer. If there are no errors, it returns 1. If errors,
* returns 0.
*************************************************************************
*************************************************************************
*/
int machine_get_iface_stats (IfaceInfo *interface)
{
@@ -564,21 +564,21 @@ int machine_get_iface_stats (IfaceInfo *interface)
/* Skip first 2 header lines of file */
fgets(buffer, sizeof(buffer), file);
fgets(buffer, sizeof(buffer), file);
/* By default, treat interface as down */
interface->status = down;
/* Search iface_name and scan values */
while ((fgets(buffer, sizeof(buffer), file) != NULL)) {
if (strstr(buffer, interface->name)) {
/* interface exists */
interface->status = up; /* is up */
interface->last_online = time(NULL); /* save actual time */
/* search ':' and skip over it */
ch_pointer = strchr(buffer, ':');
ch_pointer++;
/* Now ch_pointer points to values of iface_name */
/* Scan values from here */
sscanf(ch_pointer, "%lf %lf %*s %*s %*s %*s %*s %*s %lf %lf",
@@ -587,8 +587,8 @@ int machine_get_iface_stats (IfaceInfo *interface)
&interface->tr_byte,
&interface->tr_pkt);
/* if is the first time we call this function,
* old values are the same as new so we don't
/* if is the first time we call this function,
* old values are the same as new so we don't
* get big speeds when calculating
*/
if (first_time) {
+1 -1
View File
@@ -4,7 +4,7 @@ sysconf_DATA = lcdvc.conf
bin_PROGRAMS = lcdvc
lcdvc_SOURCES = lcdvc.c lcdvc.h lcd_link.c lcd_link.h vc_link.c vc_link.h
lcdvc_SOURCES = lcdvc.c lcdvc.h lcd_link.c lcd_link.h vc_link.c vc_link.h
lcdvc_LDADD = ../../shared/libLCDstuff.a
+14 -14
View File
@@ -29,7 +29,7 @@ and displays them via LCDproc (http://lcdproc.omnipotent.net/)
=item B<METAR-Code>
The METAR code related of the city you want weather observations.
The METAR code related of the city you want weather observations.
For fun, here are some example METAR codes:
LA : KLAX
@@ -50,18 +50,18 @@ http://www.nws.noaa.gov/oso/oso1/oso12/metar.htm
=item Cannot connect to LCDproc port
By default, lcdMetar tries to connect to localhost port 13666. If you get this
By default, lcdMetar tries to connect to localhost port 13666. If you get this
error, that means that this is not possible to connect to this port. You can change
the port lcdMetar connects to by modifying the script's variables $host and $port.
=item METAR is too short! Something went wrong.
The METAR data we received is not what we expected, check out NOOA's web site
The METAR data we received is not what we expected, check out NOOA's web site
(http://weather.noaa.gov/) to see if something has changed.
=item Can't connect to METAR source
lcdMetar tried to fetch weather observations from NOAA's web site and failed. It
lcdMetar tried to fetch weather observations from NOAA's web site and failed. It
will retry in 15 minutes.
=back
@@ -74,22 +74,22 @@ These are all available on CPAN: http://www.cpan.org/
=head1 DISCLAMER
Data distribution via the Internet is not considered an operational
delivery mechanism by the NWS due to our inability to insure access
to this service, therefore, the information available here shall not
Data distribution via the Internet is not considered an operational
delivery mechanism by the NWS due to our inability to insure access
to this service, therefore, the information available here shall not
be used for flight planning or other operational purposes.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
=head1 BUGS
@@ -249,7 +249,7 @@ while (1) {
print "Sleeping for 15 minutes.\n" if ($verbose >= 5);
sleep 900;
}
# Should never go there since above is an infinite loop,
# Should never go there since above is an infinite loop,
# send a SIGINT or SIGTERM to exit nicely.
# To be called on exit and on SIGINT or SIGTERM.