diff --git a/wmframepic/src/age_calc.c b/wmframepic/src/age_calc.c index ead19c6..11e8855 100644 --- a/wmframepic/src/age_calc.c +++ b/wmframepic/src/age_calc.c @@ -7,30 +7,30 @@ static void calc_day_year_month(time_t today, int day_birth, int month_birth, in struct tm *struct_today; struct_today = localtime(&today); - + day_curr = struct_today->tm_mday; month_curr = struct_today->tm_mon + 1; year_curr = struct_today->tm_year + 1900; - + if((year_curr%4==0 && year_curr%100 !=0) || year_curr%400==0) months_table[2] = 29; else months_table[2] = 28; - + total_years = year_curr - year_birth; total_months = month_curr - month_birth; total_days = day_curr - day_birth; - + if(total_days < 0) { total_days += months_table[month_curr==1 ? 12 : month_curr-1]; total_months--; } - + if(total_months < 0) { total_months += 12; total_years--; } - + result[0] = total_days; result[1] = total_months; result[2] = total_years; diff --git a/wmframepic/src/main.c b/wmframepic/src/main.c index ed66049..ead268a 100644 --- a/wmframepic/src/main.c +++ b/wmframepic/src/main.c @@ -42,7 +42,7 @@ void mainloop() { XCopyArea(display, *background_pixmap, iconwin, gc_border, 0, 0, 64, 64, offset_w, offset_h); XCopyArea(display, pic_pixmap, iconwin, gc_core, 0, 0, 64, 64, offset_w, offset_h); break; - case ButtonPress: + case ButtonPress: bevent = (XButtonPressedEvent *) &event; switch (bevent->button & 0xff) { case Button1: @@ -64,7 +64,7 @@ void mainloop() { flush_background(); show_pic = True; } - + break; default: break; @@ -158,7 +158,7 @@ int main(int argc, char **argv) { XSetWMNormalHints(display, win, &sizehints); - + wmHints = XAllocWMHints(); if (wmHints == NULL) { fprintf(stderr, "%s: can't allocate memory for wm hints!\n", argv[0]); @@ -186,7 +186,7 @@ int main(int argc, char **argv) { XFree(classHint); // Let the window manager know about the link of commands XSetCommand(display, win, argv, argc); - + //XpmCreatePixmapFromData(display, root, kid_xpm, &pic_pixmap,NULL,NULL); char **xpm_file_data; if(-1 == XpmReadFileToData(file, &xpm_file_data)) { @@ -198,12 +198,12 @@ int main(int argc, char **argv) { XSelectInput(display, win, eventmask); XSelectInput(display,iconwin, eventmask); XMapWindow(display, win); - + init_variables(display, gc_core, iconwin, offset_w, offset_h, &background_pixmap); draw_screen_with_mask(); show_pic = False; - + mainloop(); return 0; } diff --git a/wmressel/HINTS b/wmressel/HINTS index e6b082d..2bc5271 100644 --- a/wmressel/HINTS +++ b/wmressel/HINTS @@ -9,7 +9,7 @@ help about them. WindowMaker -------------------------------------------------------------- WindowMaker users simply drag and drop the wmressel dockapp on -the WindowMaker Dock (preferred) or near the Clip, and then +the WindowMaker Dock (preferred) or near the Clip, and then press the rightmouse button on the outer edges of wmressel, select "Settings..." and enable the "Start when WindowMaker is started" option. diff --git a/wmressel/INSTALL b/wmressel/INSTALL index 3e78a42..94c5ba3 100644 --- a/wmressel/INSTALL +++ b/wmressel/INSTALL @@ -1,4 +1,4 @@ -Installation instructions for wmressel. +Installation instructions for wmressel. Requirements @@ -17,7 +17,7 @@ Installation 1) $ tar -zxvf wmressel-0.8.tar.gz 2) $ cd wmressel-0.8 3) $ ./configure -4) $ make +4) $ make 5) $ su root 6) # make install 7) $ wmressel & (or wmressel -h for brief help). diff --git a/wmressel/README b/wmressel/README index ec345c7..ab8af52 100644 --- a/wmressel/README +++ b/wmressel/README @@ -2,7 +2,7 @@ wmressel 0.8 (http://team.gcu-squad.org/~slix/wmressel/) -------------------------------------------------------------- Author...: Sébastien Liénard (slix@gcu-squad.org) from GCU (http://gcu-squad.org) - + I'm french, excuse me for my poor english :) Credits..: Thanks to all guys from GCU @@ -20,7 +20,7 @@ Features are: and doublescan in menu * Multiple screens support * Xinerama support - + wmressel is developped on an x86 machine running Debian/GNU Linux 3.0 Files @@ -31,11 +31,11 @@ HINTS Hints about what you can do with wmressel. BUGS Things you don't want to know ;-) TODO Things I've already planned for wmressel. COPYING GNU General Public License Version 2. - + Bugs -------------------------------------------------------------- -If you discover any bugs in this software, please send a +If you discover any bugs in this software, please send a bugreport to slix@gcu-squad.org and describe the problem as detailed as you can. @@ -43,7 +43,7 @@ the problem as detailed as you can. Copyright -------------------------------------------------------------- wmressel is copyright (c) 2002 Sébastien Liénard -and licensed through the GNU General Public License. +and licensed through the GNU General Public License. Read the COPYING file for the complete GNU license. diff --git a/wmtictactoe/CHANGES b/wmtictactoe/CHANGES index d1e5ddf..4899c8f 100644 --- a/wmtictactoe/CHANGES +++ b/wmtictactoe/CHANGES @@ -4,11 +4,11 @@ Version Description ---------------------------------------------------------------- 1.1 - Released 990830 - Added "deadmatch" game mode - + 1.0-2 - Released 990601 - - Added "quiet mode"... + - Added "quiet mode"... - hey! today is lupy's birthday... congratulations my friend! - + 1.0 - Released 990508 - Now, you can change the game mode on the fly and... I GOTTA GO! it's 10:55PM and I wanna go to night! @@ -18,7 +18,7 @@ Version Description 0.4 - Released 990422 - Implemented scoreboard - I tried to improve the X play algorithm... - + 0.3 - Released 990331 - bugs fixed by Adriel Ziesemer Júnior - Adriel improved the X play algorithm... diff --git a/wmtictactoe/README b/wmtictactoe/README index bb494ad..e07fc06 100644 --- a/wmtictactoe/README +++ b/wmtictactoe/README @@ -6,7 +6,7 @@ Author André Ribeiro Camargo (acamargo@conesul.com.br) I'm 22 years old and I live on Brazil. - Well, there are not many things to say... + Well, there are not many things to say... Description @@ -14,7 +14,7 @@ Description wmTicTacToe, as you can imagine, is a dock application game for Window Maker(but it will be run on others window managers too. You can -test it... and after, give me your feedback...) +test it... and after, give me your feedback...) wmTicTacToe is being developped on Pentium 133 machine running Linux/Conectiva Guarani, and I can't test on other machines 'cos I don't @@ -44,12 +44,12 @@ How do I play wmTicTacToe? -deadmatch Click with right button change between scoreboard and gameboard. In scoreboard, click with middle button reset the score, with -right button go to gameboard screen and click with left button change the +right button go to gameboard screen and click with left button change the game mode. - In gameboard, click with left button to play, right button go to + In gameboard, click with left button to play, right button go to scoreboard screen and middle button to reset the game... ... and, don't forget, the game has Offensive and Defensive mode! - + Deadmatch! ===================================---------------------------------------- @@ -69,7 +69,7 @@ TODO Stuff I've planned for future wmTicTacToe releases. licenca_gnu.html GNU General Public License Version 2 translated to Portuguese. -Bugs +Bugs ===================================---------------------------------------- If you discover any bugs in this software, please send a bugreport @@ -77,11 +77,11 @@ to acamargo@conesul.com.br and describe the problem as detailed as you can. -Copyright +Copyright -----------------------------------======================================== wmTicTacToe is copyright (c) 1999 by André Ribeiro Camargo and -licensed through the GNU General Public License 2. Read the COPYING or +licensed through the GNU General Public License 2. Read the COPYING or licenca_gnu.html files for the complete GNU license. @@ -89,14 +89,14 @@ Thanks ===================================---------------------------------------- Thanks to: - + - creator of asclock: Beat Christen - creator of wmbreak: Adam Hunter - creators of wmmon.app: Martijn Pieterse and Antoine Nulle - creator of wmmail: Per Liden without this guys with yours dock applications, I can't write -wmTicTacToe... +wmTicTacToe... - Adriel Ziesemer Júnior(adriel@atlas.ucpel.tche.br) @@ -121,18 +121,18 @@ sparcStations or digital Alphas... etc :) - and... *tchan tchan* xiiiiiiiiiiiiiiiiiibengue! "dazed and confused" - ps.: thanks so much to Rodrigo Gruppelli(GRUPIS/OpIvy @ #mundo - brasNet ircnet)... + ps.: thanks so much to Rodrigo Gruppelli(GRUPIS/OpIvy @ #mundo + brasNet ircnet)... ...For reminder me of xibengue, linux help and to be my official beta tester... :))) - + - Jeff Mottishaw(jmottishaw@gmcorp.net) - + for to suggest "deadmatch" game mode... thank you mottie :) - Enjoy it! + Enjoy it! 'cos "Space: the final frontier" Pato Fu rulez! urbana legio omnia vincit! diff --git a/wmtictactoe/TODO b/wmtictactoe/TODO index 86ca87e..be705a2 100644 --- a/wmtictactoe/TODO +++ b/wmtictactoe/TODO @@ -4,7 +4,7 @@ TODO list for wmTicTacToe ...this is a list of things I've already planned for next version(or nexteds): - create a super hiper nice very good X play algorithm; - - Alfredo Kojima(Window Maker's creator) suggested deadmatch games + - Alfredo Kojima(Window Maker's creator) suggested deadmatch games over internet; If you're interessing, go ahead! ;) - something more? diff --git a/wmtictactoe/wmtictactoe/wmtictactoe.c b/wmtictactoe/wmtictactoe/wmtictactoe.c index 1fc88e4..f1dbd15 100644 --- a/wmtictactoe/wmtictactoe/wmtictactoe.c +++ b/wmtictactoe/wmtictactoe/wmtictactoe.c @@ -1,23 +1,23 @@ /* - wmtictactoe - the ultimate tictactoe for WindowMaker - =-=-=-=-=-= ====================================== + wmtictactoe - the ultimate tictactoe for WindowMaker + =-=-=-=-=-= ====================================== Copyright (C) 1999 André R. Camargo - Este programa é um software de livre distribuição, que pode ser copiado e - distribuído sob os termos da Licença Pública Geral GNU, conforme publicada + Este programa é um software de livre distribuição, que pode ser copiado e + distribuído sob os termos da Licença Pública Geral GNU, conforme publicada pela Free Software Foundation, versão 2 da licença ou (a critério do autor) - qualquer versão posterior. + qualquer versão posterior. - Este programa é distribuído na expectativa de ser útil aos seus usuários, + Este programa é distribuído na expectativa de ser útil aos seus usuários, porém NÃO TEM NENHUMA GARANTIA, EXPLÍCITAS OU IMPLÍCITAS, COMERCIAIS OU DE ATENDIMENTO A UMA DETERMINADA FINALIDADE. Consulte a Licença Pública Geral - GNU para maiores detalhes. + GNU para maiores detalhes. - Deve haver uma cópia da Licença Pública Geral GNU junto com este software - em inglês ou português. Caso não haja escreva para + Deve haver uma cópia da Licença Pública Geral GNU junto com este software + em inglês ou português. Caso não haja escreva para Free Software Foundation, Inc. 675 Mass Ave, - Cambridge, MA 02139, USA. + Cambridge, MA 02139, USA. acamargo@conesul.com.br André Ribeiro Camargo @@ -171,14 +171,14 @@ void game_over (void); void main (int argc, char *argv[]) { int i; - + ProgName = argv[0]; if (strlen (ProgName) >= 11) ProgName += (strlen (ProgName) - 11); game_mode = JOGO_DEFENSIVO; mute_mode = FALSE; - + for (i = 1; i < argc; i++) { char *arg = argv[i]; @@ -193,7 +193,7 @@ void main (int argc, char *argv[]) isDeadmatch = TRUE; break; } - if (strcmp (arg + 1, "display") == 0) + if (strcmp (arg + 1, "display") == 0) break; usage (); exit (1); @@ -219,7 +219,7 @@ void main (int argc, char *argv[]) fprintf (stderr, "\nPlaying on %s mode... %s", isDeadmatch ? "deadmatch" : (game_mode == JOGO_DEFENSIVO) ? "DEFENSIVE" : "OFFENSIVE", isDeadmatch ? ":) <-> (:" : (game_mode == JOGO_DEFENSIVO) ? ":(" : ":)"); } - + principal (argc, argv); } @@ -447,7 +447,7 @@ game_over () // ------------------------------------------------------------------------------------- // funcao: piscaVencedor -// descricao: pisca as jogadas da sequencia especifica vencedora +// descricao: pisca as jogadas da sequencia especifica vencedora // in: nada // out: nada void @@ -542,21 +542,21 @@ escreve_placar () { int i; int coluna_xpm = 65; - int coluna_score[6] = + int coluna_score[6] = {8, 15, 26, 33, 43, 50 }; char placar[7]; if (isDeadmatch){ copyXPMArea(97, 74, 13, 9, 43, 88); if (!mute_mode) - sprintf(placar, - "%.2d%.2d%.2d", - game_mode == JOGO_OFENSIVO ? score_user_offensive : score_user_defensive, + sprintf(placar, + "%.2d%.2d%.2d", + game_mode == JOGO_OFENSIVO ? score_user_offensive : score_user_defensive, game_mode == JOGO_OFENSIVO ? score_deuce_offensive : score_deuce_defensive, game_mode == JOGO_OFENSIVO ? score_X_offensive : score_X_defensive); } else - // desenha o glyph do X modo ofensivo no placar + // desenha o glyph do X modo ofensivo no placar if (game_mode == JOGO_OFENSIVO) { copyXPMArea (110, 4, 13, 8, 43, 88); if (!mute_mode) @@ -566,7 +566,7 @@ escreve_placar () if (!mute_mode) sprintf(placar, "%.2d%.2d%.2d", score_user_defensive, score_deuce_defensive, score_X_defensive); } - + for (i = 0; i < 6; i++) copyXPMArea (coluna_xpm+((placar[i]-48)*6), 65, 6, 9, coluna_score[i], 100); } @@ -843,8 +843,8 @@ analisa_jogo (void) } // estima a chance de jogo em cada _quadrante_ para cada jogador - for (i = 0; i < 8; i++) - for (i2 = 0; i2 < 3; i2++) { + for (i = 0; i < 8; i++) + for (i2 = 0; i2 < 3; i2++) { if (tabuleiro[sequencias[i][i2]] == LEGENDA_VAZIO && status_jogo[i][0] > 0 && status_jogo[i][1] == 0) chance[sequencias[i][i2]][0]++; if (tabuleiro[sequencias[i][i2]] == LEGENDA_VAZIO && status_jogo[i][1] > 0 && status_jogo[i][0] == 0) @@ -873,13 +873,13 @@ analisa_jogo (void) if ( game_mode == JOGO_DEFENSIVO ? chance[i][0] > maior_chance_X : chance[i][1] > maior_chance_usuario) { limite_possibilidades = 0; possibilidades_de_jogadas[limite_possibilidades] = i; - if (game_mode == JOGO_DEFENSIVO) + if (game_mode == JOGO_DEFENSIVO) maior_chance_X = chance[i][0]; else maior_chance_usuario = chance[i][1]; } else if ( game_mode == JOGO_DEFENSIVO ? chance[i][0] == maior_chance_X : chance[i][1] == maior_chance_usuario) { limite_possibilidades++; - possibilidades_de_jogadas[limite_possibilidades] = i; + possibilidades_de_jogadas[limite_possibilidades] = i; } } } @@ -1044,7 +1044,7 @@ printversion (void) // descricao: lê o arquivo de configuracao da aplicação // in: nada // out: nada -void +void readfile (void) { FILE *rcfile; @@ -1083,7 +1083,7 @@ readfile (void) // descricao: grava o arquivo de configuracao da aplicação // in: nada // out: nada -void +void writefile (void) { FILE *rcfile; @@ -1103,7 +1103,7 @@ writefile (void) // descricao: troca o modo de jogo // in: nada // out: nada -void +void troca_game_mode (void) { game_mode = !game_mode; diff --git a/yawmppp/INSTALL b/yawmppp/INSTALL index ecba820..c9b35b3 100644 --- a/yawmppp/INSTALL +++ b/yawmppp/INSTALL @@ -1,4 +1,4 @@ -Installation instructions for YAWMPPP. +Installation instructions for YAWMPPP. Upgrading ? ----------- @@ -21,7 +21,7 @@ new version will not be able to add new data to them, ok ? NOTE! -------------------------------------------------------------- -Installing this program requires root privileges, ask your +Installing this program requires root privileges, ask your local system/network administrator kindly if she/he wants to install this software for you ;-) @@ -49,7 +49,7 @@ What the installation will do /usr/local/doc/yawmppp- and yawmppp's man page will be placed in - /usr/local/man/man1 + /usr/local/man/man1 Installation -------------------------------------------------------------- @@ -62,7 +62,7 @@ Installation As non-privileged user: -7) % yawmppp & (try 'yawmppp -h &' for help) +7) % yawmppp & (try 'yawmppp -h &' for help) If you have no ISP entries configured you'll see the yawmppp.pref GUI. diff --git a/yawmppp/README b/yawmppp/README index 9dde441..18363c2 100644 --- a/yawmppp/README +++ b/yawmppp/README @@ -20,7 +20,7 @@ Usage Hints DNS Servers Modem Ports Login/Password expects - Trouble? + Trouble? More Documentation Overview @@ -98,8 +98,8 @@ YAWMPPP features all things the standard pppd offers and gives you some additional amusements: * Integrated online timer; - * Integrated modem RX/TX LED's; - * Integrated YAWMPPP status LED; + * Integrated modem RX/TX LED's; + * Integrated YAWMPPP status LED; * Integrated autoscaling PPP transfer statistics; * Integrated bytes/second Speed-O-Meter; * Automatic detection of active ppp interfaces; @@ -115,11 +115,11 @@ INSTALL Installation instructions. CHANGELOG Description of changes. COPYING GNU General Public License Version 2. FAQ Frequently Asked Questions - + Reporting Bugs -------------- -If you discover any bugs in this software, please send a +If you discover any bugs in this software, please send a bug report to bergo@seul.org and describe the problem as detailed as you can. @@ -180,7 +180,7 @@ ISP configuration tool (yawmppp.pref) or with any other mouse button to open the connection log viewer (yawmppp.log). Window Manager Placement ------------------------- +------------------------ Window Maker: Window Maker users simply drag and drop YAWMPPP on the WindowMaker Dock or the Clip. Press the right mouse button on YAWMPPP's outer edges and diff --git a/yawmppp/configure b/yawmppp/configure index 5e55d91..d397dcf 100755 --- a/yawmppp/configure +++ b/yawmppp/configure @@ -1,7 +1,7 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.13 +# Generated automatically using autoconf version 2.13 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation @@ -1552,7 +1552,7 @@ XINC="$x_includes" XLIB="$x_libraries" if test "tmp$no_x" = "tmpyes" ; then - { echo "configure: error: + { echo "configure: error: ** You must have the X11R6 system. If you have an X11R6 system installed and are seeing this message, try using the --x-includes and --x-libraries options with configure. Use the --help option for help. @@ -2170,13 +2170,13 @@ else /*) ac_cv_path_GTKCONFIG="$GTKCONFIG" # Let the user override the test with a path. ;; - ?:/*) + ?:/*) ac_cv_path_GTKCONFIG="$GTKCONFIG" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" - for ac_dir in $ac_dummy; do + for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_GTKCONFIG="$ac_dir/$ac_word" @@ -2197,7 +2197,7 @@ fi if test "$GTKCONFIG" = "no" ; then -{ echo "configure: error: +{ echo "configure: error: -(GTK >= 1.2.1 NOT FOUND)--------------------------------------- The config application requires the GTK libary. See the README for information on how to install GTK. @@ -2231,14 +2231,14 @@ echo "configure:2212: checking for gtk+ >=1.2.1" >&5 GTK121_FINE=0 fi fi - fi + fi fi if test "$GTK121_FINE" = "1" ; then echo "$ac_t""yes" 1>&6 else echo "$ac_t""no" 1>&6 - { echo "configure: error: + { echo "configure: error: -(GTK >= 1.2.1 NOT FOUND)--------------------------------------- The config application requires the GTK libary. See the README for information on how to install GTK. diff --git a/yawmppp/configure.in b/yawmppp/configure.in index b6f6b77..429c466 100644 --- a/yawmppp/configure.in +++ b/yawmppp/configure.in @@ -148,7 +148,7 @@ else GTK121_FINE=0 fi fi - fi + fi fi if test "$GTK121_FINE" = "1" ; then diff --git a/yawmppp/install-sh b/yawmppp/install-sh index ebc6691..058b26c 100644 --- a/yawmppp/install-sh +++ b/yawmppp/install-sh @@ -115,7 +115,7 @@ fi if [ x"$dir_arg" != x ]; then dst=$src src="" - + if [ -d $dst ]; then instcmd=: else @@ -124,7 +124,7 @@ if [ x"$dir_arg" != x ]; then else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad +# might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] @@ -134,7 +134,7 @@ else echo "install: $src does not exist" exit 1 fi - + if [ x"$dst" = x ] then echo "install: no destination specified" @@ -162,7 +162,7 @@ dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then -defaultIFS=' +defaultIFS=' ' IFS="${IFS-${defaultIFS}}" @@ -201,17 +201,17 @@ else # If we're going to rename the final executable, determine the name now. - if [ x"$transformarg" = x ] + if [ x"$transformarg" = x ] then dstfile=`basename $dst` else - dstfile=`basename $dst $transformbasename | + dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename - if [ x"$dstfile" = x ] + if [ x"$dstfile" = x ] then dstfile=`basename $dst` else @@ -242,7 +242,7 @@ else # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && - $doit $mvcmd $dsttmp $dstdir/$dstfile + $doit $mvcmd $dsttmp $dstdir/$dstfile fi && diff --git a/yawmppp/src/dockapp/Makefile.in b/yawmppp/src/dockapp/Makefile.in index a73275e..39a23b5 100644 --- a/yawmppp/src/dockapp/Makefile.in +++ b/yawmppp/src/dockapp/Makefile.in @@ -9,19 +9,19 @@ EOBJS = ../isprc.o ../ycommon.o ../misc.o ../list.o PROGINST = @INSTALL@ PIXMAPS = dockxpm.xpm -all: yawmppp_bin getmodemspeed_bin +all: yawmppp_bin getmodemspeed_bin $(OBJS): %.o : %.c $(DOTHS) $(PIXMAPS) $(CC) -c $(CFLAGS) $(RLFLAG) $< -o $*.o -yawmppp_bin: $(OBJS) +yawmppp_bin: $(OBJS) $(CC) -o yawmppp $^ $(EOBJS) -lXext $(LIBDIR) $(LIBS) getmodemspeed_bin: getmodemspeed.c $(CC) $(CFLAGS) getmodemspeed.c -o yagetmodemspeed clean: - rm -f $(OBJS) yawmppp yagetmodemspeed + rm -f $(OBJS) yawmppp yagetmodemspeed distclean: rm -f Makefile *~ diff --git a/yawmppp/src/dockapp/getmodemspeed.c b/yawmppp/src/dockapp/getmodemspeed.c index 6530e6e..80e2ab1 100644 --- a/yawmppp/src/dockapp/getmodemspeed.c +++ b/yawmppp/src/dockapp/getmodemspeed.c @@ -4,7 +4,7 @@ int main(void) { FILE *fd; char temp[256]; - + fd = popen("tac /etc/ppp/connect-errors | grep '['CONNECT'|'CARRIER']' | head -1", "r"); while (fgets(temp, 256, fd)) { diff --git a/yawmppp/src/dockapp/wmgeneral.c b/yawmppp/src/dockapp/wmgeneral.c index 1b726ae..3a8e543 100644 --- a/yawmppp/src/dockapp/wmgeneral.c +++ b/yawmppp/src/dockapp/wmgeneral.c @@ -67,7 +67,7 @@ void RedrawWindow (void); void AddMouseRegion (int, int, int, int, int); int CheckMouseRegion (int, int); -static void +static void GetXPM (XpmIcon * wmgen, char *pixmap_bytes[]) { @@ -89,7 +89,7 @@ GetXPM (XpmIcon * wmgen, char *pixmap_bytes[]) } } -static Pixel +static Pixel GetColor (char *name) { @@ -110,7 +110,7 @@ GetColor (char *name) return color.pixel; } -static int +static int flush_expose (Window w) { @@ -123,7 +123,7 @@ flush_expose (Window w) return i; } -void +void RedrawWindow (void) { @@ -135,7 +135,7 @@ RedrawWindow (void) 0, 0, wmgen.attributes.width, wmgen.attributes.height, 0, 0); } -void +void RedrawWindowXY (int x, int y) { @@ -147,7 +147,7 @@ RedrawWindowXY (int x, int y) x, y, wmgen.attributes.width, wmgen.attributes.height, 0, 0); } -void +void AddMouseRegion (int index, int left, int top, int right, int bottom) { @@ -161,7 +161,7 @@ AddMouseRegion (int index, int left, int top, int right, int bottom) } } -int +int CheckMouseRegion (int x, int y) { @@ -184,7 +184,7 @@ CheckMouseRegion (int x, int y) return (i - 1); } -void +void createXBMfromXPM (char *xbm, char **xpm, int sx, int sy) { @@ -221,7 +221,7 @@ createXBMfromXPM (char *xbm, char **xpm, int sx, int sy) } } -void +void copyXPMArea (int x, int y, int sx, int sy, int dx, int dy) { @@ -229,14 +229,14 @@ copyXPMArea (int x, int y, int sx, int sy, int dx, int dy) } -void +void copyXBMArea (int x, int y, int sx, int sy, int dx, int dy) { XCopyArea (display, wmgen.mask, wmgen.pixmap, NormalGC, x, y, sx, sy, dx, dy); } -void +void setMaskXY (int x, int y) { @@ -244,7 +244,7 @@ setMaskXY (int x, int y) XShapeCombineMask (display, iconwin, ShapeBounding, x, y, pixmask, ShapeSet); } -void +void openXwindow (int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bits, int pixmask_width, int pixmask_height) { diff --git a/yawmppp/src/dockapp/yawmppp.c b/yawmppp/src/dockapp/yawmppp.c index d379618..12c9886 100644 --- a/yawmppp/src/dockapp/yawmppp.c +++ b/yawmppp/src/dockapp/yawmppp.c @@ -245,7 +245,7 @@ yawmppp_routine (int argc, char **argv) close_ppp(); grab_isp_info(1); - + /* Open the display */ createXBMfromXPM (dock_mask_bits, dockxpm_xpm, @@ -652,7 +652,7 @@ DrawStats (int num, int size, int x_left, int y_bottom) for (k = 0; k < num; k++) for (j = 0; j < size; j++) - { + { if (j < (ppp_history[k][0] / pixels_per_byte)) copyXPMArea (58 + 2, 92, 1, 1, k + x_left, y_bottom - j); else if (j < (ppp_history[k][0] + ppp_history[k][1]) / pixels_per_byte) @@ -753,9 +753,9 @@ DrawLoadInd (int speed) void usage (void) { - fprintf (stderr, + fprintf (stderr, "\nyawmppp - Yet Another Window Maker PPP dock applet\n\n"); - fprintf (stderr, + fprintf (stderr, "version %s\n\n",VERSION); fprintf (stderr, "usage:\n"); fprintf (stderr, "-h this help screen\n"); diff --git a/yawmppp/src/gtklog/loglist.c b/yawmppp/src/gtklog/loglist.c index cec35b8..b3dab8e 100644 --- a/yawmppp/src/gtklog/loglist.c +++ b/yawmppp/src/gtklog/loglist.c @@ -240,7 +240,7 @@ create_loglist(void) dhw[9]=gtk_hbox_new(FALSE,2); dhw[10]=gtk_label_new("Raw log listing (unfiltered):"); - + gtk_box_pack_start(GTK_BOX(mvb),dhw[9],FALSE,FALSE,4); gtk_box_pack_start(GTK_BOX(dhw[9]),dhw[10],FALSE,FALSE,2); @@ -376,7 +376,7 @@ prepend_log_entry(char *logline) struct logentry *le; le=(struct logentry *)g_malloc0(sizeof(struct logentry)); - + if ((p=strtok(logline,"\t\n"))==NULL) { g_free(le); return; } le->start=(time_t)atol(p); @@ -394,7 +394,7 @@ prepend_log_entry(char *logline) if ((p=strtok(NULL,"\t\n"))==NULL) { g_free(le); return; } strncpy(le->phone,p,32); - + if ((p=strtok(NULL,"\t\n"))==NULL) { g_free(le); return; } strncpy(le->user,p,32); @@ -538,7 +538,7 @@ make_resume(void) strcat(temp,aux); gtk_label_set_text(GTK_LABEL(lresume[0]),temp); - + if (ec) avg=olt/ec; else @@ -634,12 +634,12 @@ hgra_configure(GtkWidget *widget,GdkEventConfigure *ee,gpointer data) float fac; GdkFont *fn; char tmp[64]; - + if (hcanvas!=NULL) gdk_pixmap_unref(hcanvas); - + mygc=gdk_gc_new(widget->window); - + hcanvas=gdk_pixmap_new(widget->window,x=widget->allocation.width, y=widget->allocation.height,-1); gdk_draw_rectangle(hcanvas,widget->style->white_gc,TRUE,0,0,x,y); @@ -672,7 +672,7 @@ hgra_configure(GtkWidget *widget,GdkEventConfigure *ee,gpointer data) cx+=2*xs; } - gdk_draw_line(hcanvas,widget->style->black_gc,0,y-18,x-1,y-18); + gdk_draw_line(hcanvas,widget->style->black_gc,0,y-18,x-1,y-18); gdk_rgb_gc_set_foreground(mygc,0xffffff); gdk_draw_rectangle(hcanvas,mygc,TRUE,0,0,22*4,13); @@ -711,12 +711,12 @@ wgra_configure(GtkWidget *widget,GdkEventConfigure *ee,gpointer data) long max; float fac; GdkFont *fn; - + if (wcanvas!=NULL) gdk_pixmap_unref(wcanvas); - + mygc=gdk_gc_new(widget->window); - + wcanvas=gdk_pixmap_new(widget->window,x=widget->allocation.width, y=widget->allocation.height,-1); gdk_draw_rectangle(wcanvas,widget->style->white_gc,TRUE,0,0,x,y); @@ -744,7 +744,7 @@ wgra_configure(GtkWidget *widget,GdkEventConfigure *ee,gpointer data) cx+=xs; } - gdk_draw_line(wcanvas,widget->style->black_gc,0,y-18,x-1,y-18); + gdk_draw_line(wcanvas,widget->style->black_gc,0,y-18,x-1,y-18); gdk_rgb_gc_set_foreground(mygc,0xffffff); gdk_draw_rectangle(wcanvas,mygc,TRUE,0,0,23*4,13); @@ -770,7 +770,7 @@ time_menu(GtkMenuItem *gmi,gpointer data) time_t t; x=*((int *)data); - + t=time(NULL); his=localtime(&t); diff --git a/yawmppp/src/gtksetup/applet.c b/yawmppp/src/gtksetup/applet.c index 41f3f68..8953caa 100644 --- a/yawmppp/src/gtksetup/applet.c +++ b/yawmppp/src/gtksetup/applet.c @@ -203,7 +203,7 @@ create_preferences_panel(void) tp=gdk_pixmap_create_from_xpm_d (applet->window, &mask, &style->bg[GTK_STATE_NORMAL], (gchar **) cmd_up_xpm); - up=gtk_pixmap_new(tp,mask); gtk_widget_show(up); gdk_pixmap_unref(tp); + up=gtk_pixmap_new(tp,mask); gtk_widget_show(up); gdk_pixmap_unref(tp); up_button=aw[20]=gtk_button_new(); gtk_container_add(GTK_CONTAINER(aw[20]),up); @@ -238,7 +238,7 @@ create_preferences_panel(void) rp=gtk_vbox_new(FALSE,0); gtk_box_pack_start(GTK_BOX(mhb),rp,TRUE,TRUE,2); - + aw[4]=hlabel_new("Description"); aw[6]=hlabel_new("Display Handle"); aw[8]=hlabel_new("Phone number"); @@ -279,7 +279,7 @@ create_preferences_panel(void) bhb=gtk_hbox_new(TRUE,4); gtk_box_pack_start(GTK_BOX(ghb),bhb,TRUE,TRUE,2); - + cb[0]=gtk_button_new_with_label(" Apply "); cb[1]=gtk_button_new_with_label(" Cancel "); cb[2]=gtk_button_new_with_label(" OK"); @@ -495,7 +495,7 @@ load_rc_entries(void) isp_count=GetISPInfo(p,&rc_entries[0],MAX_ISPS); read_ppp_options_from_rc(p); - + for(i=0;iLongName,wii->LongName); strcpy(pii->ShortName,wii->ShortName); pii->nologin=wii->nologin; - + /* get device and chat script filename from "Start" file */ f=fopen(wii->PPPLine,"r"); if (!f) return; @@ -764,7 +764,7 @@ pop_advanced(GtkWidget *gw,gpointer data) esb=gtk_hbox_new(FALSE,2); esp=gtk_button_new_with_label(" Additional conversation... "); - adv_nl=gtk_check_button_new_with_label("Don't generate login/password pairs"); + adv_nl=gtk_check_button_new_with_label("Don't generate login/password pairs"); for(i=0;i<5;i++) { gtk_box_pack_start(GTK_BOX(av[2]),l[i],FALSE,FALSE,1); @@ -839,7 +839,7 @@ pop_advanced(GtkWidget *gw,gpointer data) gtk_box_pack_start(GTK_BOX(av[0]),hs,FALSE,FALSE,4); bhb=gtk_hbox_new(TRUE,4); - + gtk_box_pack_start(GTK_BOX(av[0]),bhb,FALSE,FALSE,4); bt[0]=gtk_button_new_with_label(" Help "); @@ -879,7 +879,7 @@ pop_advanced(GtkWidget *gw,gpointer data) if (!(pii->ppp.override)) enable_local_ppp(FALSE); - + gtk_signal_connect (GTK_OBJECT (bt[0]), "clicked", GTK_SIGNAL_FUNC (pop_help), NULL); gtk_signal_connect (GTK_OBJECT (bt[2]), "clicked", @@ -915,7 +915,7 @@ ppp_override_toggle(GtkToggleButton *gtb,gpointer data) void adv_ok (GtkWidget * widget, gpointer data) { - struct PREF_ISP_INFO *pii; + struct PREF_ISP_INFO *pii; pii=&pref_entries[selected_entry]; strcpy(pii->ModemInit1,gtk_entry_get_text(GTK_ENTRY(adv_e[0]))); @@ -945,7 +945,7 @@ adv_ok (GtkWidget * widget, gpointer data) pii->ppp.pap=AUTH_REFUSE; if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(adv_w[10]))) pii->ppp.pap=AUTH_DONTCARE; - + gtk_widget_destroy(advdlg); } @@ -1110,7 +1110,7 @@ write_and_apply_data(void) MSGBOX_ICON_ERROR); return(-1); } - + fprintf(f,"%s\n",pref_entries[i].Device); fprintf(f,"%s\n",pref_entries[i].ModemSpeed); fprintf(f,"%s\n",pref_entries[i].PulseDial); @@ -1252,7 +1252,7 @@ write_and_apply_data(void) modippp.chap=pref_entries[i].ppp.chap; modippp.pap=pref_entries[i].ppp.pap; } - + fprintf(f, "%s\n%s\nuser \"%s\"\n%sconnect '%s -v -f"\ " /etc/ppp/peers/%s_chat.%d'\n", @@ -1276,7 +1276,7 @@ write_and_apply_data(void) MSGBOX_ICON_ERROR); return(-1); } - + fprintf(f,"#!/bin/sh\n"); fprintf(f,"\n# this script was generated by yawmppp.pref (the YAWMPPP\n"); fprintf(f,"# GUI configuration app) and will copy some files from\n"); @@ -1294,7 +1294,7 @@ write_and_apply_data(void) fprintf(f,"# ISP entry %d\n",i); - sprintf(yet,"%s_yawmppp_isp%d",v_user,i); + sprintf(yet,"%s_yawmppp_isp%d",v_user,i); fprintf(f,"chown root %s/.yawmppp2/%s\n",v_home,yet); fprintf(f,"cp -f %s/.yawmppp2/%s /etc/ppp/peers/%s\n",v_home,yet,yet); fprintf(f,"chown %s /etc/ppp/peers/%s\n",v_user,yet); @@ -1323,7 +1323,7 @@ write_and_apply_data(void) fprintf(f,"flag file\n"); fclose(f); } - + /* send signal to yawmppp dock applet (so it rereads the config) */ sprintf(aux,"%s/yawmppp.pid",tmp); f=fopen(aux,"r"); @@ -1370,7 +1370,7 @@ write_and_apply_data(void) f=fopen(aux,"r"); if (f!=NULL) { fclose(f); - unlink(aux); + unlink(aux); } } else { sprintf(aux,"%s/root_apply.sh",tmp); @@ -1493,7 +1493,7 @@ make_ppp_pane(void) h=gtk_hbox_new(TRUE,2); gtk_box_pack_start(GTK_BOX(bv),h,TRUE,TRUE,1); - + v[0]=gtk_vbox_new(FALSE,1); v[1]=gtk_vbox_new(FALSE,1); v[2]=gtk_vbox_new(FALSE,1); @@ -1711,7 +1711,7 @@ void get_ppp_pane(void) pppo.linectl =!!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ppp_pw[10])); pppo.usepeerdns =!!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ppp_pw[30])); - + for(i=11;i<15;i++) if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ppp_pw[i]))) pppo.flowctl=i-11; @@ -1963,7 +1963,7 @@ void pop_expect(GtkWidget *w,gpointer data) gtk_box_pack_start(GTK_BOX(v1),sw,TRUE,TRUE,4); gtk_widget_show(sw); gtk_container_set_border_width(GTK_CONTAINER(sw),4); - + exp_cl=cl=gtk_clist_new(2); gtk_clist_set_shadow_type(GTK_CLIST(cl),GTK_SHADOW_IN); gtk_clist_set_selection_mode(GTK_CLIST(cl),GTK_SELECTION_SINGLE); @@ -2011,12 +2011,12 @@ void pop_expect(GtkWidget *w,gpointer data) gtk_box_pack_start(GTK_BOX(bb),lb[i],FALSE,TRUE,2); gtk_widget_show(lb[i]); } - + hs=gtk_hseparator_new(); gtk_box_pack_start(GTK_BOX(v1),hs,FALSE,FALSE,4); bhb=gtk_hbox_new(TRUE,4); - + gtk_box_pack_start(GTK_BOX(v1),bhb,FALSE,FALSE,4); bt[0]=gtk_button_new_with_label(" Help "); @@ -2193,7 +2193,7 @@ void exp_add_delay(void) { struct PREF_ISP_INFO *pii; - pii=&pref_entries[selected_entry]; + pii=&pref_entries[selected_entry]; pii->s_expect[pii->nExpectPairs][0]=0; pii->s_send[pii->nExpectPairs][0]=0; pii->nExpectPairs++; @@ -2205,7 +2205,7 @@ exp_remove(void) { struct PREF_ISP_INFO *pii; int i; - pii=&pref_entries[selected_entry]; + pii=&pref_entries[selected_entry]; pii->nExpectPairs--; for(i=exp_sel;inExpectPairs;i++) { strcpy(pii->s_send[i],pii->s_send[i+1]); @@ -2257,7 +2257,7 @@ exp_add(void) gtk_box_pack_start(GTK_BOX(v1),ea[6],FALSE,TRUE,2); gtk_box_pack_start(GTK_BOX(v1),ea[7],FALSE,TRUE,1); - + for(i=0;i<4;i++) gtk_box_pack_start(GTK_BOX(ea[7]),ea[8+i],FALSE,TRUE,4); @@ -2280,7 +2280,7 @@ exp_add(void) void expa_ok (GtkWidget * widget, gpointer data) { - struct PREF_ISP_INFO *pii; + struct PREF_ISP_INFO *pii; pii=&pref_entries[selected_entry]; strncpy(pii->s_expect[pii->nExpectPairs],gtk_entry_get_text(GTK_ENTRY(expa_e[0])),31); strncpy(pii->s_send[pii->nExpectPairs],gtk_entry_get_text(GTK_ENTRY(expa_e[1])),31); @@ -2308,7 +2308,7 @@ extract_delimited_string(char *dest,char *src,int count,char delim,int max) char *p,*it; int cur,on; char last; - + dest[0]=0; p=dest; @@ -2485,7 +2485,7 @@ add_man(char *manpage,GtkWidget *text,int index) gtk_text_insert(GTK_TEXT(text),fixedfont,NULL,NULL,man_help[index], strlen(man_help[index])); gtk_text_thaw(GTK_TEXT(text)); - while(gtk_events_pending()) + while(gtk_events_pending()) gtk_main_iteration(); return; } @@ -2517,7 +2517,7 @@ add_man(char *manpage,GtkWidget *text,int index) strlen(YAWMPPP_CANT_MAN)); } gtk_text_thaw(GTK_TEXT(text)); - while(gtk_events_pending()) + while(gtk_events_pending()) gtk_main_iteration(); } @@ -2528,13 +2528,13 @@ add_docfile(char *source,GtkWidget *text,int index) char *buf; char line[512]; long tlen,blen; - + if (man_flag[index]) { gtk_text_freeze(GTK_TEXT(text)); gtk_text_insert(GTK_TEXT(text),fixedfont,NULL,NULL,man_help[index], strlen(man_help[index])); gtk_text_thaw(GTK_TEXT(text)); - while(gtk_events_pending()) + while(gtk_events_pending()) gtk_main_iteration(); return; } @@ -2562,7 +2562,7 @@ add_docfile(char *source,GtkWidget *text,int index) strlen(YAWMPPP_CANT_MAN)); } gtk_text_thaw(GTK_TEXT(text)); - while(gtk_events_pending()) + while(gtk_events_pending()) gtk_main_iteration(); } @@ -2631,7 +2631,7 @@ run_as_root(char *what) gtk_label_set_justify(GTK_LABEL(lb),GTK_JUSTIFY_LEFT); gtk_box_pack_start(GTK_BOX(ehb),lb,FALSE,TRUE,4); - + hs=gtk_hseparator_new(); gtk_box_pack_start(GTK_BOX(mv),hs,FALSE,TRUE,4); @@ -2668,7 +2668,7 @@ run_as_root(char *what) GTK_SIGNAL_FUNC (pwd_cancel), NULL); gtk_signal_connect (GTK_OBJECT (b[2]), "clicked", GTK_SIGNAL_FUNC (pwd_view), NULL); - + pwdb[0]=b[0]; pwdb[1]=b[1]; pwdb[2]=b[2]; @@ -2726,7 +2726,7 @@ pwd_view(GtkWidget *gw,gpointer data) GtkWidget *v,*txt,*hs,*hb,*b_close,*hh,*vsb; GdkFont *fixed; - fixed=gdk_font_load("-*-fixed-medium-r-normal--14-*-*-*-*-*-*"); + fixed=gdk_font_load("-*-fixed-medium-r-normal--14-*-*-*-*-*-*"); sprintf(z,"View Script: %s",cmdtorun); @@ -2735,7 +2735,7 @@ pwd_view(GtkWidget *gw,gpointer data) gtk_window_set_transient_for(GTK_WINDOW(swnd),GTK_WINDOW(wpwd)); gtk_window_set_title(GTK_WINDOW(swnd),z); gtk_window_set_policy(GTK_WINDOW(swnd),TRUE,TRUE,TRUE); - gtk_container_set_border_width(GTK_CONTAINER(swnd),4); + gtk_container_set_border_width(GTK_CONTAINER(swnd),4); v=gtk_vbox_new(FALSE,2); gtk_container_add(GTK_CONTAINER(swnd),v); @@ -2750,7 +2750,7 @@ pwd_view(GtkWidget *gw,gpointer data) hs=gtk_hseparator_new(); gtk_box_pack_start(GTK_BOX(v),hs,FALSE,FALSE,4); - + hb=gtk_hbox_new(FALSE,8); gtk_box_pack_start(GTK_BOX(v),hb,FALSE,TRUE,4); diff --git a/yawmppp/src/gtksetup/msgbox.c b/yawmppp/src/gtksetup/msgbox.c index 5eda9b6..83446f5 100644 --- a/yawmppp/src/gtksetup/msgbox.c +++ b/yawmppp/src/gtksetup/msgbox.c @@ -68,7 +68,7 @@ message_box(GtkWindow *parent,char *txt,char *title,MsgBoxType mbt,MsgBoxIcon mb gtk_container_set_border_width(GTK_CONTAINER(msgbox),4); gtk_window_set_position(GTK_WINDOW(msgbox),GTK_WIN_POS_CENTER); gtk_window_set_policy(GTK_WINDOW(msgbox),TRUE,TRUE,TRUE); - gtk_widget_realize(msgbox); + gtk_widget_realize(msgbox); style=gtk_widget_get_style(msgbox); if (mbi!=MSGBOX_ICON_NONE) { diff --git a/yawmppp/src/gtksetup/msgbox.h b/yawmppp/src/gtksetup/msgbox.h index 29e6e0b..7e3d4f3 100644 --- a/yawmppp/src/gtksetup/msgbox.h +++ b/yawmppp/src/gtksetup/msgbox.h @@ -1,9 +1,9 @@ /* GPL'd (C) 1999-2000 Felipe Bergo -- bergo@seul.org */ -/* +/* This module is built up of the following files: - + msgbox.h msgbox.cc _OR_ msgbox.c question.xpm @@ -49,7 +49,7 @@ typedef enum /* prototype */ -/* +/* obs 1: this call blocks until the user picks a choice. obs 2: parent can be NULL. obs 3: you must have a gtk_main loop running before calling it. @@ -61,12 +61,12 @@ MsgBoxResult message_box(GtkWindow *parent, MsgBoxType mbt, MsgBoxIcon mbi); -/* +/* excerpt from my 900-page book "The Ultimate Guide to Message Box Icons Felipe Bergo - 0th edition - Prentice Room publishers, + Prentice Room publishers, ISBN 6666-6666-6666" MSGBOX_ICON_NONE No icon. @@ -78,7 +78,7 @@ MsgBoxResult message_box(GtkWindow *parent, MSGBOX_ICON_QUESTION Should be used on any questions, like confirmations. Currently included - icon is a white question mark in a + icon is a white question mark in a green circle. "question.xpm" MSGBOX_ICON_EXCLAMATION Should be used on warnings, like when diff --git a/yawmppp/src/isprc.c b/yawmppp/src/isprc.c index db1a6c4..ae8c9bb 100644 --- a/yawmppp/src/isprc.c +++ b/yawmppp/src/isprc.c @@ -48,17 +48,17 @@ GetISPInfo(char *rcname,struct YAWMPPP_ISP_INFO *wii,int max) num_isps=0; /* level 0 */ - while( fgets(temp,128,f) ) { + while( fgets(temp,128,f) ) { strcpy(work,temp); q=work; q=strtok(q,tokens); if (!q) continue; if (!strcmp(q,"ISP.BEGIN")) { if (num_isps>=max) continue; - + /* enter ISP.BEGIN block */ memset(&wii[num_isps],0,sizeof(struct YAWMPPP_ISP_INFO)); - + wii[num_isps].ppp.override=0; wii[num_isps].ppp.noipdefault=1; wii[num_isps].ppp.noauth=1; @@ -71,7 +71,7 @@ GetISPInfo(char *rcname,struct YAWMPPP_ISP_INFO *wii,int max) strcpy(work,temp); q=work; q=strtok(q,tokens); - + if (!strcmp(q,KEY_LONGNAME)) { q=strtok(NULL,tokens2); if (q) strncpy(wii[num_isps].LongName,q,128); diff --git a/yawmppp/src/list.c b/yawmppp/src/list.c index f804b2c..d9f7329 100644 --- a/yawmppp/src/list.c +++ b/yawmppp/src/list.c @@ -1,11 +1,11 @@ -/* Generic single linked list to keep various information +/* Generic single linked list to keep various information Copyright (C) 1993, 1994 Free Software Foundation, Inc. Author: Kresten Krab Thorup Many modifications by Alfredo K. Kojima - + This file is part of GNU CC. @@ -38,7 +38,7 @@ Boston, MA 02111-1307, USA. */ /* Return a cons cell produced from (head . tail) */ -INLINE LinkedList* +INLINE LinkedList* list_cons(void* head, LinkedList* tail) { LinkedList* cell; @@ -63,7 +63,7 @@ list_length(LinkedList* list) return i; } -/* Return the Nth element of LIST, where N count from zero. If N +/* Return the Nth element of LIST, where N count from zero. If N larger than the list length, NULL is returned */ INLINE void* @@ -84,7 +84,7 @@ list_nth(int index, LinkedList* list) INLINE void list_remove_head(LinkedList** list) { - if (!*list) return; + if (!*list) return; if ((*list)->tail) { LinkedList* tail = (*list)->tail; /* fetch next */ @@ -116,7 +116,7 @@ INLINE LinkedList * list_remove_elem(LinkedList* list, void* elem) { LinkedList *tmp; - + if (list) { if (list->head == elem) { tmp = list->tail; diff --git a/yawmppp/src/list.h b/yawmppp/src/list.h index af0f22c..be101ef 100644 --- a/yawmppp/src/list.h +++ b/yawmppp/src/list.h @@ -1,4 +1,4 @@ -/* Generic single linked list to keep various information +/* Generic single linked list to keep various information Copyright (C) 1993, 1994 Free Software Foundation, Inc. Author: Kresten Krab Thorup diff --git a/yawmppp/src/misc.c b/yawmppp/src/misc.c index 34281e2..c36cdb4 100644 --- a/yawmppp/src/misc.c +++ b/yawmppp/src/misc.c @@ -1,9 +1,9 @@ /* dock.c- built-in Dock module for WindowMaker - * + * * WindowMaker window manager - * + * * Copyright (c) 1997 Alfredo K. Kojima - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -28,7 +28,7 @@ *---------------------------------------------------------------------- * parse_command-- * Divides a command line into a argv/argc pair. - *---------------------------------------------------------------------- + *---------------------------------------------------------------------- */ #define PRC_ALPHA 0 #define PRC_BLANK 1 @@ -64,11 +64,11 @@ next_token(char *word, char **next) t = ret = malloc(strlen(word)+1); ptr = word; - + state = 0; *t = 0; while (1) { - if (*ptr==0) + if (*ptr==0) ctype = PRC_EOS; else if (*ptr=='\\') ctype = PRC_ESCAPE; @@ -98,12 +98,12 @@ next_token(char *word, char **next) t = strdup(ret); free(ret); - + if (ctype==PRC_EOS) *next = NULL; else *next = ptr; - + return t; } @@ -118,7 +118,7 @@ parse_command(char *command, char ***argv, int *argc) line = command; do { token = next_token(line, &line); - if (token) { + if (token) { list = list_cons(token, list); } } while (token!=NULL && line!=NULL); @@ -141,15 +141,15 @@ execCommand(char *command) int argc; parse_command(command, &argv, &argc); - + if (argv==NULL) { return 0; } - + if ((pid=fork())==0) { char **args; int i; - + args = malloc(sizeof(char*)*(argc+1)); if (!args) exit(10); diff --git a/yawmppp/src/thinppp/thinppp.c b/yawmppp/src/thinppp/thinppp.c index 9d2a831..5cebdde 100644 --- a/yawmppp/src/thinppp/thinppp.c +++ b/yawmppp/src/thinppp/thinppp.c @@ -97,9 +97,9 @@ int main(int argc,char **argv) { int i; - + /* Parse Command Line */ - + ProgName = argv[0]; if (strlen (ProgName) >= 5) ProgName += (strlen (ProgName) - 5); @@ -182,7 +182,7 @@ main(int argc,char **argv) { gdk_pixmap_unref(origback); gdk_pixmap_unref(datasrc); gdk_pixmap_unref(myback); - + return 0; } @@ -340,13 +340,13 @@ init_ppp(void) int i; for (i = 0; i < MAX_ISPS; i++) memset(&IspData[i],0,sizeof(struct YAWMPPP_ISP_INFO)); - + make_config_dir(); signal(SIGUSR1,sigusr_handler); signal(SIGHUP,sigusr_handler); signal(SIGINT,sigusr_handler); signal(SIGTERM,sigusr_handler); - + write_pid_file(); clean_guards(); grab_isp_info(1); @@ -370,7 +370,7 @@ thinppp(gpointer data) static struct stat st; static int isonline = 0; static int speed_ind = 10; - + int i,j; if (like_a_virgin) { @@ -420,31 +420,31 @@ thinppp(gpointer data) start_child = 0; } } - + /* On-line detectie! 1x per second */ - + if (currenttime != lasttime) { i = 0; - + if (stillonline (active_interface)) { i = 1; if (!starttime) { starttime = currenttime; - + if (stat (STAMP_FILE, &st) == 0) starttime = st.st_mtime; - + setled(LED_PPP_POWER,LED_GREEN); waittime = 0; - + /* 88k8 on bottom */ paste_xpm(ERR_DEST_X,ERR_DEST_Y,ERR_SRC_X+28,ERR_SRC_Y+9,25,8); - + if (IspData[current_isp].SpeedAction) DrawSpeedInd (IspData[current_isp].SpeedAction); - + speed_ind = currenttime + 10; - refresh(); + refresh(); } } if (!i && starttime) { @@ -458,23 +458,23 @@ thinppp(gpointer data) refresh(); } } - + if (waittime && waittime <= currenttime) { setled(LED_PPP_POWER,LED_RED); refresh(); waittime = 0; } - + if ((starttime)&&(!isonline)) { isonline=1; - + logconn.start=time(NULL); logconn.status=0; strcpy(logconn.longname,IspData[current_isp].LongName); strcpy(logconn.shortname,IspData[current_isp].ShortName); strcpy(logconn.user,IspData[current_isp].User); strcpy(logconn.phone,IspData[current_isp].Phone); - + if (!strlen(logconn.shortname)) strcpy(logconn.shortname,"empty"); if (!strlen(logconn.longname)) @@ -483,7 +483,7 @@ thinppp(gpointer data) strcpy(logconn.user,"empty"); if (!strlen(logconn.phone)) strcpy(logconn.phone,"empty"); - + make_guards(); } if ((!starttime)&&(isonline)) { @@ -495,59 +495,59 @@ thinppp(gpointer data) if (caution>0) close_ppp(); } - + /* If we are on-line. Print the time we are */ if (starttime) { - i = currenttime - starttime; + i = currenttime - starttime; i /= TimerDivisor; - + if (TimerDivisor == 1) if (i > 59 * 60 + 59) i /= 60; - + minute = i % 60; hour = (i / 60) % 100; i = hour * 100 + minute; - + DrawTime (i, currenttime % 2); /* We are online, so we can check for send/recv packets */ - + get_statistics (active_interface, &ppp_recv, &ppp_send, &ppp_rbytes, &ppp_sbytes); if (caution>1) close_ppp(); - + if (ppp_send != ppp_sl) setled(LED_PPP_TX,LED_GREEN); else setled(LED_PPP_TX,LED_DARK); - + if (ppp_recv != ppp_rl) setled(LED_PPP_RX,LED_GREEN); else setled(LED_PPP_RX,LED_DARK); - + ppp_sl = ppp_send; ppp_rl = ppp_recv; - + /* Every five seconds we check to load on the line */ - + if (currenttime - timetolog >= 0) { timetolog=currenttime + 60; make_guards(); } - - if ((currenttime - ppptime >= 0) || (ppptime == 0)) { + + if ((currenttime - ppptime >= 0) || (ppptime == 0)) { ppptime = currenttime + updaterate; - + ppp_history[PPP_STATS_HIS][0] = ppp_rbytes - ppp_orbytes; ppp_history[PPP_STATS_HIS][1] = ppp_sbytes - ppp_osbytes; - + ppp_orbytes = ppp_rbytes; ppp_osbytes = ppp_sbytes; - + DrawStats (23, 9, 170, 13); - + for (j = 1; j < 24; j++) { ppp_history[j - 1][0] = ppp_history[j][0]; ppp_history[j - 1][1] = ppp_history[j][1]; @@ -556,7 +556,7 @@ thinppp(gpointer data) DrawLoadInd ((ppp_history[23][0] + ppp_history[23][1]) / updaterate); } } - + refresh(); } @@ -570,7 +570,7 @@ thinppp(gpointer data) setled(LED_PPP_POWER,LED_YELLOW); waittime = ORANGE_LED_TIMEOUT + currenttime; refresh(); - } + } break; case BUT_X: if (stop_child == 0) @@ -614,7 +614,7 @@ thinppp(gpointer data) } gboolean -wdestroy(GtkWidget *w,GdkEvent *ev,gpointer data) +wdestroy(GtkWidget *w,GdkEvent *ev,gpointer data) { int i; while (start_child | stop_child) { @@ -904,7 +904,7 @@ DrawTime (int i, int j) paste_xpm(TIMER_DES_X + 6 * 1, TIMER_DES_Y, TIMER_SZE_X * ((i/k)%10)+1, TIMER_SRC_Y,5,7); k=k/10; - + /* colon */ if (j) paste_xpm(TIMER_DES_X + 6 * 2 + 1, TIMER_DES_Y, @@ -912,7 +912,7 @@ DrawTime (int i, int j) else paste_xpm(TIMER_DES_X + 6 * 2 + 1, TIMER_DES_Y, 63, TIMER_SRC_Y,1,7); - + paste_xpm(TIMER_DES_X + 6 * 2 + 4, TIMER_DES_Y, TIMER_SZE_X * ((i/k)%10)+1, TIMER_SRC_Y,5,7); k=k/10; @@ -926,16 +926,16 @@ DrawStats (int num, int size, int x_left, int y_bottom) { int pixels_per_byte; int j, k; - + pixels_per_byte = size; for (j = 0; j < num; j++) if ((ppp_history[j][0]+ppp_history[j][1]) > pixels_per_byte) pixels_per_byte = ppp_history[j][0] + ppp_history[j][1]; - + pixels_per_byte /= size; - + for (k = 0; k < num; k++) - for (j = 0; j < size; j++) { + for (j = 0; j < size; j++) { if (j < (ppp_history[k][0] / pixels_per_byte)) paste_xpm(k+x_left, y_bottom-j,HIST_SRC_X+2,HIST_SRC_Y,1,1); else if (j < (ppp_history[k][0] + ppp_history[k][1]) / pixels_per_byte) @@ -971,29 +971,29 @@ DrawSpeedInd (char *speed_action) FILE *fp; char *p; char temp[128]; - + fp = popen (speed_action, "r"); - + if (fp) { linespeed = 0; - + while (fgets (temp, 128, fp)) ; - + pclose (fp); - + if ((p = strstr (temp, "CONNECT"))) linespeed = atoi (p + 8); - + k = ERR_DEST_X+25; - + i = (linespeed % 1000) / 100; linespeed /= 1000; PrintLittle (i, &k); - + k -= 5; paste_xpm(k,ERR_DEST_Y,ERR_SRC_X+50,ERR_SRC_Y,5,8); - + do { PrintLittle (linespeed % 10, &k); linespeed /= 10; @@ -1011,7 +1011,7 @@ DrawLoadInd (int speed) PrintLittle (-1, &k); k = ERR_DEST_X+25; - + do { PrintLittle (speed % 10, &k); speed /= 10; @@ -1032,9 +1032,9 @@ make_delayed_update(void) void usage (void) { - fprintf (stderr, + fprintf (stderr, "\nyawmppp.thin\nYet Another Window Maker PPP dock applet,\nfor non-Window Maker window managers\n\n"); - fprintf (stderr, + fprintf (stderr, "version %s\n\n",VERSION); fprintf (stderr, "usage:\n"); fprintf (stderr, "-h this help screen\n"); @@ -1065,7 +1065,7 @@ read_initial_position(void) fgets(z,255,f); ipx=atoi(strtok(z," \t\n")); ipy=atoi(strtok(NULL," \t\n")); - fclose(f); + fclose(f); } void diff --git a/yawmppp/src/ycommon.c b/yawmppp/src/ycommon.c index 2d7e578..1d60bec 100644 --- a/yawmppp/src/ycommon.c +++ b/yawmppp/src/ycommon.c @@ -141,9 +141,9 @@ make_guards(void) p = getenv ("HOME"); strcpy (temp, p); strcat (temp, "/.yawmppp2/.floatlog"); - f=fopen(temp,"w"); + f=fopen(temp,"w"); if (!f) return; - + logconn.end=time(NULL); fprintf(f,"%lu\n%lu\n%d\n",logconn.start,logconn.end,logconn.status); fprintf(f,"%s\n%s\n%s\n",logconn.longname,logconn.shortname,logconn.phone); @@ -162,7 +162,7 @@ write_log(void) p = getenv ("HOME"); strcpy (temp, p); strcat (temp, "/.yawmppp2/logfile"); - f=fopen(temp,"a"); + f=fopen(temp,"a"); if (!f) return; s=strlen(logconn.phone); @@ -229,7 +229,7 @@ open_ppp(void) return; if ((ppp_h = socket (AF_INET, SOCK_DGRAM, 0)) >= 0) - ppp_open = 1; + ppp_open = 1; } void @@ -399,7 +399,7 @@ stillonline (char *ifs) #ifdef FREEBSD strcpy(req.ifr_name,active_interface); open_ppp(); - if (!ppp_open) + if (!ppp_open) return 0; if (ioctl(ppp_h,SIOCGIFFLAGS,&req)>=0) { if (req.ifr_flags&IFF_UP)