3 YAWMPPP - PPP dock app/helper for WindowMaker
6 Author: Felipe Bergo (bergo@seul.org)
8 based on the wmppp application by
10 Martijn Pieterse (pieterse@xs4all.nl)
11 Antoine Nulle (warp@xs4all.nl)
13 This program is free software; you can redistribute it and/or modify
14 it under the terms of the GNU General Public License as published by
15 the Free Software Foundation; either version 2 of the License, or
16 (at your option) any later version.
18 This program is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU General Public License for more details.
23 You should have received a copy of the GNU General Public License
24 along with this program; if not, write to the Free Software
25 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
40 #include <sys/param.h>
41 #include <sys/types.h>
49 #include "dataxpm.xpm"
50 #include "backxpm.xpm"
52 GdkPixmap
*origback
, *myback
,*datasrc
;
53 GtkWidget
*mainw
,*mda
;
55 /* ppp related globals */
57 /* global variables */
62 char *active_interface
= "ppp0";
63 int TimerDivisor
= 60;
71 struct YAWMPPP_ISP_INFO IspData
[MAX_ISPS
];
74 struct LogStruct logconn
;
82 #define PPP_STATS_HIS 23
85 int ppp_history
[PPP_STATS_HIS
+ 1][2];
87 int pressed_button
=-1;
91 pid_t start_child
= 0;
94 int wx
,wy
,dragx
,dragy
,xlimit
,ylimit
,ipx
,ipy
;
97 main(int argc
,char **argv
) {
101 /* Parse Command Line */
104 if (strlen (ProgName
) >= 5)
105 ProgName
+= (strlen (ProgName
) - 5);
107 for (i
= 1; i
< argc
; i
++) {
116 if (strcmp (arg
+ 1, "display")) {
122 if (strcmp (arg
+ 1, "geometry")) {
132 if (strncmp (argv
[i
+ 1], "ppp", 3)) {
136 active_interface
= argv
[i
+ 1];
151 updaterate
= atoi (argv
[i
]);
152 if (updaterate
< 1 || updaterate
> 10) {
162 printf("Caution level: %d\n",caution
);
172 gtk_init(&argc
,&argv
);
178 gtk_idle_add(thinppp
,NULL
);
180 save_initial_position();
182 gdk_pixmap_unref(origback
);
183 gdk_pixmap_unref(datasrc
);
184 gdk_pixmap_unref(myback
);
195 ipx
=((gdk_screen_width()-320)/2);
197 read_initial_position();
200 mainw
=gtk_window_new(GTK_WINDOW_TOPLEVEL
);
201 gtk_widget_set_usize(mainw
,320,20);
202 gtk_widget_set_uposition(mainw
,wx
,wy
);
203 gtk_widget_realize(mainw
);
204 gdk_window_set_decorations(mainw
->window
,0);
206 xlimit
=gdk_screen_width()-320;
207 ylimit
=gdk_screen_height()-20;
209 mda
=gtk_drawing_area_new();
210 gtk_widget_set_events(mda
,GDK_EXPOSURE_MASK
|GDK_BUTTON_PRESS_MASK
|
211 GDK_BUTTON_RELEASE_MASK
|GDK_BUTTON_MOTION_MASK
);
212 gtk_drawing_area_size(GTK_DRAWING_AREA(mda
),320,20);
213 gtk_container_add(GTK_CONTAINER(mainw
),mda
);
215 sty
=gtk_widget_get_style(mainw
);
217 origback
=gdk_pixmap_create_from_xpm_d(mainw
->window
,
221 datasrc
=gdk_pixmap_create_from_xpm_d(mainw
->window
,
226 myback
=gdk_pixmap_new(mainw
->window
,320,20,-1);
227 gdk_draw_pixmap(myback
,
228 mainw
->style
->fg_gc
[GTK_WIDGET_STATE (mainw
)],
234 gtk_signal_connect(GTK_OBJECT(mda
),"expose_event",
235 GTK_SIGNAL_FUNC(exposed
),NULL
);
237 gtk_signal_connect(GTK_OBJECT(mda
),"button_press_event",
238 GTK_SIGNAL_FUNC(bpress
),NULL
);
239 gtk_signal_connect(GTK_OBJECT(mda
),"button_release_event",
240 GTK_SIGNAL_FUNC(brelease
),NULL
);
241 gtk_signal_connect(GTK_OBJECT(mda
),"motion_notify_event",
242 GTK_SIGNAL_FUNC(bmotion
),NULL
);
244 gtk_signal_connect(GTK_OBJECT(mainw
),"destroy",
245 GTK_SIGNAL_FUNC(wdestroy
),NULL
);
247 gtk_widget_show(mda
);
248 gtk_widget_show(mainw
);
252 exposed(GtkWidget
*w
,GdkEventExpose
*gee
,gpointer data
)
254 gdk_draw_pixmap(w
->window
,
255 w
->style
->fg_gc
[GTK_WIDGET_STATE (w
)],
257 gee
->area
.x
, gee
->area
.y
,
258 gee
->area
.x
, gee
->area
.y
,
259 gee
->area
.width
, gee
->area
.height
);
266 gdk_draw_pixmap(mainw
->window
,
267 mainw
->style
->fg_gc
[GTK_WIDGET_STATE (mainw
)],
273 gtk_widget_queue_resize(mda
);
277 setled(int index
,int type
)
322 paste_xpm(dx
,dy
,sx
,sy
,w
,h
);
327 paste_xpm(int dx
,int dy
,int sx
,int sy
,int w
,int h
)
329 gdk_draw_pixmap(myback
,
330 mainw
->style
->fg_gc
[GTK_WIDGET_STATE (mainw
)],
341 for (i
= 0; i
< MAX_ISPS
; i
++)
342 memset(&IspData
[i
],0,sizeof(struct YAWMPPP_ISP_INFO
));
345 signal(SIGUSR1
,sigusr_handler
);
346 signal(SIGHUP
,sigusr_handler
);
347 signal(SIGINT
,sigusr_handler
);
348 signal(SIGTERM
,sigusr_handler
);
356 thinppp(gpointer data
)
358 static int like_a_virgin
=1;
360 static long currenttime
;
361 static long lasttime
;
362 static long waittime
;
364 static int hour
, minute
;
365 static long timetolog
;
366 static long ppp_send
, ppp_sl
= -1;
367 static long ppp_recv
, ppp_rl
= -1;
368 static long ppp_sbytes
, ppp_rbytes
;
369 static long ppp_osbytes
, ppp_orbytes
;
370 static struct stat st
;
371 static int isonline
= 0;
372 static int speed_ind
= 10;
377 get_statistics (active_interface
, &ppp_rl
, &ppp_sl
,
378 &ppp_orbytes
, &ppp_osbytes
);
380 currenttime
= time (0);
386 /* 888k8 on bottom */
387 paste_xpm(ERR_DEST_X
,ERR_DEST_Y
,ERR_SRC_X
+28,ERR_SRC_Y
+9,25,8);
394 lasttime
= currenttime
;
395 currenttime
= time (0);
397 /* Check if any child has left the playground */
398 i
= waitpid (0, &status
, WNOHANG
);
399 if (i
== stop_child
&& stop_child
!= 0) {
402 setled(LED_PPP_POWER
,LED_DARK
);
403 setled(LED_PPP_RX
,LED_DARK
);
404 setled(LED_PPP_TX
,LED_DARK
);
405 /* 888k8 on bottom */
406 paste_xpm(ERR_DEST_X
,ERR_DEST_Y
,ERR_SRC_X
+28,ERR_SRC_Y
+9,25,8);
410 if (i
== start_child
&& start_child
!= 0) {
411 if (WIFEXITED (status
)) {
412 if (WEXITSTATUS (status
) == 10) {
415 paste_xpm(ERR_DEST_X
,ERR_DEST_Y
,ERR_SRC_X
+28,ERR_SRC_Y
+9,25,8);
416 setled(LED_PPP_POWER
,LED_DARK
);
424 /* On-line detectie! 1x per second */
426 if (currenttime
!= lasttime
) {
429 if (stillonline (active_interface
)) {
432 starttime
= currenttime
;
434 if (stat (STAMP_FILE
, &st
) == 0)
435 starttime
= st
.st_mtime
;
437 setled(LED_PPP_POWER
,LED_GREEN
);
441 paste_xpm(ERR_DEST_X
,ERR_DEST_Y
,ERR_SRC_X
+28,ERR_SRC_Y
+9,25,8);
443 if (IspData
[current_isp
].SpeedAction
)
444 DrawSpeedInd (IspData
[current_isp
].SpeedAction
);
446 speed_ind
= currenttime
+ 10;
450 if (!i
&& starttime
) {
452 setled(LED_PPP_POWER
,LED_RED
);
455 paste_xpm(ERR_DEST_X
,ERR_DEST_Y
,ERR_SRC_X
,ERR_SRC_Y
+9,25,8);
456 if (IspData
[current_isp
].IfDownAction
)
457 execCommand (IspData
[current_isp
].IfDownAction
);
462 if (waittime
&& waittime
<= currenttime
) {
463 setled(LED_PPP_POWER
,LED_RED
);
468 if ((starttime
)&&(!isonline
)) {
471 logconn
.start
=time(NULL
);
473 strcpy(logconn
.longname
,IspData
[current_isp
].LongName
);
474 strcpy(logconn
.shortname
,IspData
[current_isp
].ShortName
);
475 strcpy(logconn
.user
,IspData
[current_isp
].User
);
476 strcpy(logconn
.phone
,IspData
[current_isp
].Phone
);
478 if (!strlen(logconn
.shortname
))
479 strcpy(logconn
.shortname
,"empty");
480 if (!strlen(logconn
.longname
))
481 strcpy(logconn
.longname
,"empty");
482 if (!strlen(logconn
.user
))
483 strcpy(logconn
.user
,"empty");
484 if (!strlen(logconn
.phone
))
485 strcpy(logconn
.phone
,"empty");
489 if ((!starttime
)&&(isonline
)) {
491 logconn
.end
=time(NULL
);
494 make_delayed_update();
499 /* If we are on-line. Print the time we are */
501 i
= currenttime
- starttime
;
504 if (TimerDivisor
== 1)
505 if (i
> 59 * 60 + 59)
509 hour
= (i
/ 60) % 100;
510 i
= hour
* 100 + minute
;
512 DrawTime (i
, currenttime
% 2);
513 /* We are online, so we can check for send/recv packets */
515 get_statistics (active_interface
, &ppp_recv
, &ppp_send
,
516 &ppp_rbytes
, &ppp_sbytes
);
520 if (ppp_send
!= ppp_sl
)
521 setled(LED_PPP_TX
,LED_GREEN
);
523 setled(LED_PPP_TX
,LED_DARK
);
525 if (ppp_recv
!= ppp_rl
)
526 setled(LED_PPP_RX
,LED_GREEN
);
528 setled(LED_PPP_RX
,LED_DARK
);
533 /* Every five seconds we check to load on the line */
535 if (currenttime
- timetolog
>= 0) {
536 timetolog
=currenttime
+ 60;
540 if ((currenttime
- ppptime
>= 0) || (ppptime
== 0)) {
541 ppptime
= currenttime
+ updaterate
;
543 ppp_history
[PPP_STATS_HIS
][0] = ppp_rbytes
- ppp_orbytes
;
544 ppp_history
[PPP_STATS_HIS
][1] = ppp_sbytes
- ppp_osbytes
;
546 ppp_orbytes
= ppp_rbytes
;
547 ppp_osbytes
= ppp_sbytes
;
549 DrawStats (23, 9, 170, 13);
551 for (j
= 1; j
< 24; j
++) {
552 ppp_history
[j
- 1][0] = ppp_history
[j
][0];
553 ppp_history
[j
- 1][1] = ppp_history
[j
][1];
555 if (currenttime
> speed_ind
) {
556 DrawLoadInd ((ppp_history
[23][0] + ppp_history
[23][1]) / updaterate
);
567 paste_xpm(ERR_DEST_X
,ERR_DEST_Y
,ERR_SRC_X
+28,ERR_SRC_Y
+9,25,8);
569 start_child
= execCommand (IspData
[current_isp
].StartAction
);
570 setled(LED_PPP_POWER
,LED_YELLOW
);
571 waittime
= ORANGE_LED_TIMEOUT
+ currenttime
;
577 stop_child
= execCommand (IspData
[current_isp
].StopAction
);
583 current_isp
= num_isps
- 1;
593 if (current_isp
== num_isps
)
607 gtk_widget_destroy(mainw
);
617 wdestroy(GtkWidget
*w
,GdkEvent
*ev
,gpointer data
)
620 while (start_child
| stop_child
) {
621 i
= waitpid (0, &status
, WNOHANG
);
624 if (i
== start_child
)
633 bpress(GtkWidget
*w
,GdkEventButton
*geb
,gpointer data
)
643 dragx
=(int)geb
->x_root
;
644 dragy
=(int)geb
->y_root
;
649 pressed_button
=BUT_DRAG
;
653 if (inbox(x
,y
,BUT_V_X
,BUT_V_Y
,12,11)) {
654 pressed_button
=BUT_V
;
655 paste_xpm(BUT_V_X
,BUT_V_Y
,BUT_V_SRC_X
,BUT_V_SRC_Y
,12,11);
661 if (inbox(x
,y
,BUT_X_X
,BUT_X_Y
,12,11)) {
662 pressed_button
=BUT_X
;
663 paste_xpm(BUT_X_X
,BUT_X_Y
,BUT_X_SRC_X
,BUT_X_SRC_Y
,12,11);
669 if (inbox(x
,y
,BUT_R_X
,BUT_R_Y
,12,11)) {
670 pressed_button
=BUT_REW
;
671 paste_xpm(BUT_R_X
,BUT_R_Y
,BUT_R_SRC_X
,BUT_R_SRC_Y
,12,11);
677 if (inbox(x
,y
,BUT_F_X
,BUT_F_Y
,12,11)) {
678 pressed_button
=BUT_FF
;
679 paste_xpm(BUT_F_X
,BUT_F_Y
,BUT_F_SRC_X
,BUT_F_SRC_Y
,12,11);
685 if (inbox(x
,y
,BUT_C_X
,BUT_C_Y
,12,11)) {
686 pressed_button
=BUT_CONF
;
687 paste_xpm(BUT_C_X
,BUT_C_Y
,BUT_C_SRC_X
,BUT_C_SRC_Y
,12,11);
693 if (inbox(x
,y
,BUT_L_X
,BUT_L_Y
,12,11)) {
694 pressed_button
=BUT_LOG
;
695 paste_xpm(BUT_L_X
,BUT_L_Y
,BUT_L_SRC_X
,BUT_L_SRC_Y
,12,11);
701 if (inbox(x
,y
,BUT_K_X
,BUT_K_Y
,17,18)) {
702 pressed_button
=BUT_KILL
;
703 paste_xpm(BUT_K_X
,BUT_K_Y
,BUT_K_SRC_X
,BUT_K_SRC_Y
,17,18);
713 brelease(GtkWidget
*w
,GdkEventButton
*geb
,gpointer data
)
719 if (pressed_button
<0)
726 if (inbox(x
,y
,BUT_V_X
,BUT_V_Y
,12,11))
728 if (inbox(x
,y
,BUT_X_X
,BUT_X_Y
,12,11))
730 if (inbox(x
,y
,BUT_R_X
,BUT_R_Y
,12,11))
732 if (inbox(x
,y
,BUT_F_X
,BUT_F_Y
,12,11))
734 if (inbox(x
,y
,BUT_C_X
,BUT_C_Y
,12,11))
736 if (inbox(x
,y
,BUT_L_X
,BUT_L_Y
,12,11))
738 if (inbox(x
,y
,BUT_K_X
,BUT_K_Y
,17,18))
742 if (c
!=pressed_button
) {
744 paste_xpm(BUT_V_X
,BUT_V_Y
,BUT_V_SRC_X
+24,BUT_V_SRC_Y
,12,11);
745 paste_xpm(BUT_X_X
,BUT_X_Y
,BUT_X_SRC_X
+24,BUT_X_SRC_Y
,12,11);
746 paste_xpm(BUT_R_X
,BUT_R_Y
,BUT_R_SRC_X
+24,BUT_R_SRC_Y
,12,11);
747 paste_xpm(BUT_F_X
,BUT_F_Y
,BUT_F_SRC_X
+24,BUT_F_SRC_Y
,12,11);
748 paste_xpm(BUT_C_X
,BUT_C_Y
,BUT_C_SRC_X
+24,BUT_C_SRC_Y
,12,11);
749 paste_xpm(BUT_L_X
,BUT_L_Y
,BUT_L_SRC_X
+24,BUT_L_SRC_Y
,12,11);
750 paste_xpm(BUT_K_X
,BUT_K_Y
,BUT_K_SRC_X
+17,BUT_K_SRC_Y
,17,18);
755 myaction
=pressed_button
;
757 paste_xpm(BUT_V_X
,BUT_V_Y
,BUT_V_SRC_X
+24,BUT_V_SRC_Y
,12,11);
758 paste_xpm(BUT_X_X
,BUT_X_Y
,BUT_X_SRC_X
+24,BUT_X_SRC_Y
,12,11);
759 paste_xpm(BUT_R_X
,BUT_R_Y
,BUT_R_SRC_X
+24,BUT_R_SRC_Y
,12,11);
760 paste_xpm(BUT_F_X
,BUT_F_Y
,BUT_F_SRC_X
+24,BUT_F_SRC_Y
,12,11);
761 paste_xpm(BUT_C_X
,BUT_C_Y
,BUT_C_SRC_X
+24,BUT_C_SRC_Y
,12,11);
762 paste_xpm(BUT_L_X
,BUT_L_Y
,BUT_L_SRC_X
+24,BUT_L_SRC_Y
,12,11);
763 paste_xpm(BUT_K_X
,BUT_K_Y
,BUT_K_SRC_X
+17,BUT_K_SRC_Y
,17,18);
770 bmotion(GtkWidget
*w
,GdkEventMotion
*geb
,gpointer data
)
772 if (pressed_button
!=BUT_DRAG
)
778 wx
=wx
+((int)geb
->x_root
-dragx
);
779 wy
=wy
+((int)geb
->y_root
-dragy
);
782 if (wx
>xlimit
) wx
=xlimit
;
784 if (wy
>ylimit
) wy
=ylimit
;
786 dragx
=(int)geb
->x_root
;
787 dragy
=(int)geb
->y_root
;
789 gdk_window_move(mainw
->window
,wx
,wy
);
797 gdk_pointer_grab(mda
->window
,FALSE
,
798 GDK_BUTTON_RELEASE_MASK
,
807 gdk_pointer_ungrab(time(NULL
));
811 inbox(int x
,int y
,int bx
,int by
,int bw
,int bh
)
813 if ((x
>=bx
)&&(y
>=by
)&&(x
<=(bx
+bw
))&&(y
<=(by
+bh
)))
820 sigusr_handler(int signum
)
822 save_initial_position();
823 if (signum
==SIGUSR1
) {
826 if (current_isp
>=num_isps
)
841 /* lower level drawing */
848 s
= strlen (IspData
[current_isp
].ShortName
);
849 for (i
= 0; i
< 5; i
++)
852 draw_isp_char (i
, IspData
[current_isp
].ShortName
[i
]);
854 draw_isp_char (i
, ' ');
859 draw_isp_char (int pos
, char letter
)
861 int sx
= 0, sy
= 0, ac
= 0;
863 if ((!ac
) && (letter
>= 'A') && (letter
<= 'Z'))
865 sx
= UPPER_ABC_BASE_X
;
866 sy
= UPPER_ABC_BASE_Y
;
867 sy
+= 8 * ((letter
- 'A') / 12);
868 sx
+= 5 * ((letter
- 'A') % 12);
871 if ((!ac
) && (letter
>= 'a') && (letter
<= 'z'))
873 sx
= LOWER_ABC_BASE_X
;
874 sy
= LOWER_ABC_BASE_Y
;
875 sy
+= 8 * ((letter
- 'a') / 12);
876 sx
+= 5 * ((letter
- 'a') % 12);
879 if ((!ac
) && (letter
>= '0') && (letter
<= '9'))
883 sx
+= 5 * (letter
- '0');
892 paste_xpm(ISP_BASE_X
+ 5 * pos
, ISP_BASE_Y
, sx
, sy
, 4, 7);
896 DrawTime (int i
, int j
)
900 paste_xpm(TIMER_DES_X
+ 6 * 0, TIMER_DES_Y
,
901 TIMER_SZE_X
* ((i
/k
)%10)+1, TIMER_SRC_Y
,5,7);
904 paste_xpm(TIMER_DES_X
+ 6 * 1, TIMER_DES_Y
,
905 TIMER_SZE_X
* ((i
/k
)%10)+1, TIMER_SRC_Y
,5,7);
910 paste_xpm(TIMER_DES_X
+ 6 * 2 + 1, TIMER_DES_Y
,
911 62, TIMER_SRC_Y
,1,7);
913 paste_xpm(TIMER_DES_X
+ 6 * 2 + 1, TIMER_DES_Y
,
914 63, TIMER_SRC_Y
,1,7);
916 paste_xpm(TIMER_DES_X
+ 6 * 2 + 4, TIMER_DES_Y
,
917 TIMER_SZE_X
* ((i
/k
)%10)+1, TIMER_SRC_Y
,5,7);
920 paste_xpm(TIMER_DES_X
+ 6 * 3 + 4, TIMER_DES_Y
,
921 TIMER_SZE_X
* ((i
/k
)%10)+1, TIMER_SRC_Y
,5,7);
925 DrawStats (int num
, int size
, int x_left
, int y_bottom
)
930 pixels_per_byte
= size
;
931 for (j
= 0; j
< num
; j
++)
932 if ((ppp_history
[j
][0]+ppp_history
[j
][1]) > pixels_per_byte
)
933 pixels_per_byte
= ppp_history
[j
][0] + ppp_history
[j
][1];
935 pixels_per_byte
/= size
;
937 for (k
= 0; k
< num
; k
++)
938 for (j
= 0; j
< size
; j
++) {
939 if (j
< (ppp_history
[k
][0] / pixels_per_byte
))
940 paste_xpm(k
+x_left
, y_bottom
-j
,HIST_SRC_X
+2,HIST_SRC_Y
,1,1);
941 else if (j
< (ppp_history
[k
][0] + ppp_history
[k
][1]) / pixels_per_byte
)
942 paste_xpm(k
+x_left
,y_bottom
-j
,HIST_SRC_X
+1,HIST_SRC_Y
,1,1);
944 paste_xpm(k
+x_left
,y_bottom
-j
,HIST_SRC_X
,HIST_SRC_Y
,1,1);
949 PrintLittle (int i
, int *k
)
954 paste_xpm(*k
,ERR_DEST_Y
,12*5,ERR_SRC_Y
,4,8);
958 paste_xpm(*k
,ERR_DEST_Y
,45,ERR_SRC_Y
,5,8);
962 paste_xpm(*k
,ERR_DEST_Y
,i
*5 - 5,ERR_SRC_Y
,5,8);
968 DrawSpeedInd (char *speed_action
)
975 fp
= popen (speed_action
, "r");
980 while (fgets (temp
, 128, fp
))
985 if ((p
= strstr (temp
, "CONNECT")))
986 linespeed
= atoi (p
+ 8);
990 i
= (linespeed
% 1000) / 100;
995 paste_xpm(k
,ERR_DEST_Y
,ERR_SRC_X
+50,ERR_SRC_Y
,5,8);
998 PrintLittle (linespeed
% 10, &k
);
1000 } while (linespeed
);
1005 DrawLoadInd (int speed
)
1010 for (i
= 0; i
< 5; i
++)
1011 PrintLittle (-1, &k
);
1016 PrintLittle (speed
% 10, &k
);
1023 make_delayed_update(void)
1026 if (current_isp
>=num_isps
)
1036 "\nyawmppp.thin\nYet Another Window Maker PPP dock applet,\nfor non-Window Maker window managers\n\n");
1038 "version %s\n\n",VERSION
);
1039 fprintf (stderr
, "usage:\n");
1040 fprintf (stderr
, "-h this help screen\n");
1041 fprintf (stderr
, "-i <device> (ppp0, ppp1, etc)\n");
1042 fprintf (stderr
, "-t set the on-line timer to MM:SS instead of HH:MM\n");
1043 fprintf (stderr
, "-u <update rate> (1..10), default 5 seconds\n");
1044 fprintf (stderr
, "-v print the version number\n");
1045 fprintf (stderr
, "-paranoid be paranoid about open sockets\n");
1046 fprintf (stderr
, "\n");
1052 fprintf (stderr
, "%s\n", VERSION
);
1056 read_initial_position(void)
1061 sprintf(z
,"%s/.yawmppp/thin.position",p
);
1066 ipx
=atoi(strtok(z
," \t\n"));
1067 ipy
=atoi(strtok(NULL
," \t\n"));
1072 save_initial_position(void)
1077 sprintf(z
,"%s/.yawmppp/thin.position",p
);
1083 fprintf(f
,"%d %d\n",ipx
,ipy
);