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