📄 gefax.c
字号:
/* gefax: (gefax is a easy frontend for efax. With efax you can send faxesover your modem to someone else.) Copyright (C) 2000 Rainer Wiener <rainer@konqui.de>This program is free software; you can redistribute it and/ormodify it under the terms of the GNU Public License as published bythe Free Software Foundation; either version 2 of the License, or (atyour option) any later version.This program is distibuted in the hope that it will be useful, butWITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNUGeneral Public Licence for more details.You should have received a copy of the GNU General Public Licencealong with this program; if not, write to the Free SoftwareFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.*/ #include <gtk/gtk.h>#include <stdio.h>#include <glib.h>#include <unistd.h>#include <string.h>#include <sys/types.h>#include <sys/time.h>#include <sys/wait.h>#include <getopt.h>#include <stdlib.h>#include "gefaxentry.h"#include "gefaxerror.h"#include "gefaxinfo.h"#include "gefaxoption.h"#include "gefaxcover.h"#include "gefaxview.h"#define EXEC_PROG_NAME "/usr/bin/fax"#define EXEC_PROG_NAME_xv "//usr/X11R6/bin/xv"#define MAX_LINE_LENGTH 200#define GEFAX_OPTIONS ".gefax.opt" char buffer[1024];GtkWidget *waitwindow, *window3, *window2, *filew, *file2, *faxfrom5, *from4;GString *faxnr, *filenam, *to1, *from1, *faxfrom1, *file10;int makecover,viewps;gpointer pstr;GtkFileSelection *fs;GtkWidget *entry, *window10;GString *fax2, *name2;int kil;int mypipe[2];char *md5sum[1024];FILE *stream;pid_t myprocess; // Prozess IDvoid destroy(GtkWidget *widget, gpointer data){ kill(myprocess,"SIGKILL"); gtk_main_quit();}void waitinfos(){ GtkWidget *waittable, *waitlabel; waitwindow = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_widget_set_usize (GTK_WIDGET (waitwindow), 200, 200); gtk_window_set_title (GTK_WINDOW (waitwindow), "Wait ..."); gtk_container_border_width (GTK_CONTAINER (waitwindow) , 10); waittable = gtk_table_new(100, 20, TRUE); gtk_container_add(GTK_CONTAINER(waitwindow), waittable); waitlabel = gtk_label_new("Please wait efax is running....."); gtk_table_attach_defaults(GTK_TABLE(waittable), waitlabel, 0, 20, 0, 100); gtk_widget_show(waitwindow); }void send(GtkWidget *widget, gpointer data){ GString *aus2, *aus1, *faxaus, *fileaus; char *fargv[5]; // args for execv char *sys; int result, status; FILE *c; aus2=g_string_new(NULL); aus1=g_string_new(NULL); faxaus = g_string_new(faxnr->str); fileaus = g_string_new(filenam->str); if ((faxnr->len==0) || (filenam->len==0)) { fehler1(); return; } else { c = fopen(filenam->str,"r"); if (!c) { fehler2(); return; } if (makecover==1) { creat_cover(); (void) g_string_assign( aus2, "gefax.txt" ); } else { (void) g_string_assign( aus2, " "); } (void) g_string_assign( aus1, "send " ); fargv[0] = EXEC_PROG_NAME; // Programmname mu
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -