亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? qrun.c

?? 使用efax的fax工具程序
?? C
字號:
/* * qrun.c - Fax spool processor for Renaissoft Qfax 1.3 * Copyright 1994-1996 Robert LeBlanc and Renaissoft */#include <stdio.h>#include <stdlib.h>#include <string.h>#include <unistd.h>#include <time.h>#include "qfax.h"/* Non-exported function prototypes */void kill_daemon(void);void start_daemon(void);int send_fax(char *dialstring, char *filelist);char *error_message(int errcode);void notify_sender(int errcode, char *prefix, char *recipient, char *subject);int ok_to_call(char *dialstring);char *make_pagelist(char *prefix);void store_fax(char *prefix);char *make_pagelist(char *prefix){/*   Scans the FAXQUEUE directory for all pages with the same prefix, in   order to assemble a whitespace-separated list of files to be sent.*/  static char list[COMMENTLEN];  char cmd[LINELEN];  char tmp[LINELEN];  FILE *ls;  sprintf(cmd, "%s -1 %s.[0-9][0-9][0-9]", LS, prefix);  strcpy(list, "");  ls = popen(cmd, "r");  while (fscanf(ls, "%s", tmp) != EOF) {    strcat(list, " ");    strcat(list, tmp);  }  pclose(ls);  return(list);}void store_fax(char *prefix){/*   Move all files relating to a given fax to STOREDIR, where they can sit   indefinitely until the owner decides what to do with them.  By moving   them out of the spool directory, we prevent Qrun from trying to send   them out again the next time it's invoked.  Presumably this is done   only once the maximum number of attempts has been made without success.*/  char cmd[LINELEN];  sprintf(cmd, "rm -f %s.try", prefix);  system(cmd);  sprintf(cmd, "mv %s.* %s", prefix, STOREDIR);  system(cmd);}int ok_to_call(char *dialstring){/*   Returns true if it's ok to place the call at this time.  The idea is to   make sure that long-distance faxes only get sent out between their   designated hours.*/  int result;  int hstart, hend, mstart, mend, hnow, mnow;  int vstart, vend;  char *ptr;  char timerange[10];  char tstart[10];  char tstop[10];  struct tm  *tp;  time_t now;  if ((dialstring[0] == '1') || (dialstring[0] == '0')) {    strcpy(timerange, LDPERIOD);    ptr = strchr(timerange, '-');    *ptr = '\0';    strcpy(tstart, timerange);    strcpy(tstop, (++ptr));    if (strcasecmp(tstart, tstop) == 0) {      result = 1;    } else {      now = time(NULL);      tp = localtime(&now);      hnow = tp->tm_hour;      mnow = tp->tm_min;      vstart = atoi(tstart);      vend = atoi(tstop);      hstart = (vstart / 100);      if (hstart == 24)	hstart = 0;      mstart = (vstart % 100);      hend = (vend / 100);      if (hend == 24)	hend = 0;      mend = (vend % 100);      if (hend < hstart) {	if ((hnow > hstart) || (hnow < hend)) {	  result = 1;	} else if ((hnow == hstart) && (mnow >= mstart)) {	  result = 1;	} else {	  result = 0;	}      } else if (hend > hstart) {	if ((hnow > hstart) && (hnow < hend)) {	  result = 1;	} else if ((hnow == hstart) && (mnow >= mstart)) {	  result = 1;	} else {	  result = 0;	}      } else {	if ((mnow >= mstart) && (mnow < mend))	  result = 1;	else	  result = 0;      }    }  } else {    result = 1;  }  return (result);}void kill_daemon(void){/*   Kills the most recent active fax answer process and writes a .stop   file to prevent init() from respawning another one until further   notice.  This is useful to avoid interruptions from incoming calls   while we're trying to dial out.*/  char cmd[LINELEN];  sprintf(cmd, "%s stop > /dev/null", FAXSCRIPT);  system(cmd);  sleep(2);}void start_daemon(void){/*   Removes any .stop files that might be preventing init() from spawning   a new fax answer process.  We use this once we're done sending out   faxes, so that we can continue to receive incoming calls.   NOTE: You MUST have an entry in your inittab file running "fax answer",   since this routine does NOT actually restart Efax.*/  char cmd[LINELEN];  sprintf(cmd, "%s start", FAXSCRIPT);  system(cmd);}int send_fax(char *dialstring, char *pagelist){/*   Calls "send fax" with the given phone number and page list to   send.  Since Efax does its own error-trapping, we need to modify   the FAX script to write the resulting error code to a file called   RESULT just before it terminates, so that we can read and return   this value for our purposes.*/  char cmd[LINELEN];  int errcode;  FILE *ifp;  sprintf(cmd, "%s send %s %s > /dev/null", FAXSCRIPT, dialstring, pagelist);  system(cmd);  ifp = fopen(RESULT, "r");  fscanf(ifp, "%d", &errcode);  fclose(ifp);  return (errcode);}char *error_message(int errcode){/*   Returns an error message based on an Efax error code.  These messages   and codes come from the man page for Efax, and are subject to change.*/  static char message[255];  switch(errcode) {  case 0:    strcpy(message, "Fax was successfully transmitted.");    break;  case 1:    strcpy(message, "Modem was busy (device in use), retrying later.");    break;  case 2:    strcpy(message, "General error occurred (file not found, disk full, etc.).");    break;  case 3:    strcpy(message, "Modem protocol error occurred.");    break;  case 4:    strcpy(message, "Modem was not responding.");    break;  case 5:    strcpy(message, "Efax was terminated by a signal.");    break;  default:    strcpy(message, "An unknown error has occurred.  Please send in a bug report.");  }  return(message);}void notify_sender(int errcode, char *prefix, char *recipient, char *subject){/*   Sends the (local) sender of the fax an e-mail message notifying him that   an attempt to send the fax was made, and the results of this attempt.   The time in the e-mail header should serve as a timestamp record of when   the fax was last attempted, and the recipient's name and the subject of   the fax are quoted for reference.*/  char cmd[LINELEN];  char tmp[LINELEN];  char sender[ALIASLEN];  char letter[COMMENTLEN];  char timestr[SHORTLEN];  char *ptr;  FILE *ifp;  int code;  strcpy(tmp, prefix);  ptr = strrchr(tmp, '.');  *ptr = '\0';  ptr = strrchr(tmp, '.');  strcpy(sender, (++ptr));  strcpy(letter, "An attempt to send your fax\n\n");  sprintf(tmp, ">>>      To: %s\n", recipient);  strcat(letter, tmp);  sprintf(tmp, ">>> Subject: %s\n\n", subject);  strcat(letter, tmp);  strcat(letter, "was made, with the following results:\n\n");  sprintf(tmp, "%s.try", prefix);  if ((ifp = fopen(tmp, "r")) != NULL) {    while (fscanf(ifp, "%d\n", &code) != EOF) {      strcpy(timestr, getsline(ifp));      sprintf(tmp, "%s: [%d] %s\n", timestr, code, error_message(code));      strcat(letter, tmp);    }    fclose(ifp);  }  strcpy(timestr, timestring());  sprintf(tmp, "%s: [%d] %s\n", timestr, errcode, error_message(errcode));  strcat(letter, tmp);  if (errcode > 0) {    strcpy(cmd, prefix);    ptr = strrchr(cmd, '/');    strcpy(cmd, (++ptr));    sprintf(tmp, "\nYour fax, %s.*,has been moved to %s.\n",	    cmd, STOREDIR);    strcat(letter, tmp);    sprintf(tmp, "To send it again, move these files back to %s.\n", FAXQUEUE);    strcat(letter, tmp);  }  sprintf(cmd, "echo \"%s\" | mail -s \"Fax Transmission Notification\" %s",	  letter, sender);  system(cmd);}void main(int argc, char *argv[]){  int i, faxes, errcode, code, tries;  char cmdlist[MAXFAXES][LINELEN];  char dialstring[PHONELEN];  char recipient[LONGLEN];  char subject[LINELEN];  char prefix[LINELEN];  char timestr[SHORTLEN];  char tmp[LINELEN];  char username[SHORTLEN];  FILE *ifp, *ofp;  /*     Assemble a list of the faxes waiting in FAXQUEUE to go out.  */  faxes = make_cmdlist(cmdlist);  if (!faxes)  /*     No faxes waiting to be sent, so we have nothing to do.   */    exit(EXIT_SUCCESS);#ifdef USE_DAEMON  /*     Kill any existing fax answer daemon, just to be sure that we aren't     interrupted before we seize the line.   */  kill_daemon();#endif  if (argc > 1)    strcpy(username, argv[1]);  else    username[0] = '\0';  for (i=0; i < faxes; i++) {    get_cmdinfo(cmdlist[i], dialstring, recipient, subject);    if (ok_to_call(dialstring)) {      strcpy(prefix, make_prefix(cmdlist[i]));      if ((argc == 1) || (strstr(prefix, username) != NULL)) {        errcode = send_fax(dialstring, make_pagelist(prefix));        if (!errcode) {          /* No errors, delete the fax and notify the sender */          notify_sender(errcode, prefix, recipient, subject);          delete_fax(prefix);        } else {          /* 	     An error occurred, so let's see whether we should	     try again or give up.           */          sprintf(tmp, "%s.try", prefix);          if ((ifp = fopen(tmp, "r")) != NULL) {	    /* We've tried to send this fax before */	    tries = 0;	    while (!feof(ifp)) {	      fscanf(ifp, "%d\n", &code);	      fgets(timestr, SHORTLEN, ifp);	      tries++;            }	    fclose(ifp);	    if (tries >= MAXTRIES) {	      /*	         We've reached our limit; give up, store the fax and	         notify the sender.	       */	      notify_sender(errcode, prefix, recipient, subject);	      store_fax(prefix);	    } else {	      /*	         Try again next time Qrun is invoked, but make a note	         of the fact that we tried, writing the errorcode and	         the time/date to the *.try file.	       */	      ofp = fopen(tmp, "a");	      strcpy(timestr, timestring());	      fprintf(ofp, "%d\n%s\n", errcode, timestr);	      fclose(ofp);	    }          } else {	    /*	       We've never tried to send this fax before, so we make a	       record of the fact that we've failed once now.	     */	    ofp = fopen(tmp, "a");	    strcpy(timestr, timestring());	    fprintf(ofp, "%d\n%s\n", errcode, timestr);	    fclose(ofp);          }        }        sleep(15);      }    }  }#ifdef USE_DAEMON  /*      Restart the fax answer daemon so we can continue to receive     incoming faxes, now that we're done sending.   */  start_daemon();#endif  exit(EXIT_SUCCESS);}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产美女在线精品| 在线成人午夜影院| 国产伦精一区二区三区| 琪琪久久久久日韩精品| 亚洲bt欧美bt精品| 婷婷中文字幕综合| 日日夜夜免费精品| 麻豆91在线播放| 久久国产精品72免费观看| 麻豆国产一区二区| 精品一区二区免费| 国模大尺度一区二区三区| 国产在线精品一区二区| 国产98色在线|日韩| jvid福利写真一区二区三区| 91在线观看污| 欧美色窝79yyyycom| 欧美一区二区三级| 久久综合九色综合欧美98 | 天堂蜜桃一区二区三区 | 色又黄又爽网站www久久| 99国产精品国产精品久久| 91在线无精精品入口| 在线观看区一区二| 在线不卡一区二区| 精品国产亚洲在线| 中文字幕一区在线观看| 亚洲综合久久久| 六月丁香婷婷色狠狠久久| 国产成人啪午夜精品网站男同| 成人av午夜影院| 欧美三级资源在线| 久久久久久久久99精品| 亚洲欧美偷拍三级| 奇米综合一区二区三区精品视频| 国产精品一级黄| 色诱视频网站一区| 精品精品欲导航| 国产精品夫妻自拍| 日本欧美一区二区| 床上的激情91.| 欧美精品自拍偷拍| 国产亚洲欧美在线| 亚洲自拍偷拍av| 国产一区二区不卡老阿姨| 91免费视频观看| 精品三级在线看| 亚洲精品乱码久久久久久黑人| 日韩国产精品久久久久久亚洲| 国产成人高清视频| 欧美日本韩国一区| 国产精品视频一二三| 午夜欧美在线一二页| 从欧美一区二区三区| 欧美精品久久99| 中文字幕乱码日本亚洲一区二区| 亚洲午夜精品一区二区三区他趣| 国产综合色产在线精品| 欧美自拍偷拍一区| 欧美韩国日本一区| 奇米影视在线99精品| 91猫先生在线| 国产精品系列在线| 蜜桃精品视频在线观看| 99久久99久久精品国产片果冻| 日韩精品影音先锋| 亚洲综合免费观看高清在线观看| 国产精品一区一区| 欧美一区三区二区| 亚洲永久精品大片| 成人高清免费观看| 久久影院视频免费| 美女视频网站久久| 欧美三日本三级三级在线播放| 中文字幕一区二区三区精华液 | 美女免费视频一区| 91久久线看在观草草青青 | 麻豆视频观看网址久久| 欧美亚洲高清一区| 亚洲日本va午夜在线影院| 国产乱人伦偷精品视频不卡| 91精品国产综合久久香蕉麻豆| 亚洲精选免费视频| voyeur盗摄精品| 国产清纯白嫩初高生在线观看91 | 综合久久久久综合| 国产麻豆欧美日韩一区| 日韩欧美三级在线| 天天综合网 天天综合色| 在线中文字幕一区二区| 亚洲视频一区二区在线| 成人激情动漫在线观看| 久久精品男人天堂av| 久久er精品视频| 欧美哺乳videos| 精品一区二区三区欧美| 日韩一区二区三区av| 奇米色一区二区| 777奇米成人网| 日本欧美一区二区三区乱码| 777xxx欧美| 日韩**一区毛片| 日韩亚洲欧美高清| 九一九一国产精品| 精品国产麻豆免费人成网站| 精品中文字幕一区二区| 久久夜色精品国产欧美乱极品| 久久草av在线| 国产亚洲一区二区三区四区| 国产精品1区2区3区在线观看| 久久久午夜精品| 粉嫩一区二区三区性色av| 亚洲欧洲精品天堂一级| 日本乱人伦一区| 一区二区三区精品视频在线| 在线观看成人小视频| 午夜欧美大尺度福利影院在线看| 91精品国产欧美一区二区成人| 蜜臀av一级做a爰片久久| 久久青草国产手机看片福利盒子| 国产精品77777竹菊影视小说| 欧美经典三级视频一区二区三区| av日韩在线网站| 亚洲国产精品久久久久秋霞影院| 欧美丰满高潮xxxx喷水动漫| 精东粉嫩av免费一区二区三区| 国产亚洲一二三区| 99国产精品一区| 午夜视频在线观看一区| 欧美精品一区二区三区很污很色的| 国产精品一二二区| 亚洲黄色免费电影| 欧美一级免费观看| 国产福利一区二区三区视频| 亚洲欧美电影一区二区| 9191精品国产综合久久久久久| 精品午夜一区二区三区在线观看| 国产精品美女久久久久久久久| 91久久久免费一区二区| 另类小说欧美激情| 国产精品美女久久福利网站| 欧美三级资源在线| 国产乱码精品一区二区三区av | 久久女同互慰一区二区三区| 成人免费视频一区| 亚洲妇熟xx妇色黄| 欧美精品一区二区久久久 | 亚洲黄色录像片| 欧美α欧美αv大片| av电影天堂一区二区在线观看| 五月天久久比比资源色| 中文字幕欧美日韩一区| 欧美日免费三级在线| 久久99久久99| 亚洲一区二区三区视频在线播放| 精品国内二区三区| 91成人免费电影| 福利电影一区二区| 日韩激情在线观看| 国产精品三级av| 日韩免费一区二区三区在线播放| av影院午夜一区| 国产在线精品免费av| 一区二区三区欧美激情| 久久精品无码一区二区三区| 欧美老肥妇做.爰bbww| heyzo一本久久综合| 韩国理伦片一区二区三区在线播放 | 日韩欧美黄色影院| 日本高清免费不卡视频| 成人毛片在线观看| 久久精品999| 首页亚洲欧美制服丝腿| 自拍av一区二区三区| 国产亚洲欧洲一区高清在线观看| 3d动漫精品啪啪一区二区竹菊| 色综合天天在线| 国产91富婆露脸刺激对白| 免费精品视频在线| 亚洲国产日韩在线一区模特 | 高清在线不卡av| 久久99久久99小草精品免视看| 丝袜亚洲另类欧美综合| 亚洲欧美一区二区三区久本道91| 中文av一区二区| 久久久不卡网国产精品二区| 日韩欧美亚洲一区二区| 3d动漫精品啪啪一区二区竹菊| 欧美亚州韩日在线看免费版国语版| 成人精品小蝌蚪| 国产不卡视频一区二区三区| 韩国精品在线观看| 老司机精品视频在线| 日本免费新一区视频| 天天综合天天综合色| 三级久久三级久久| 免费成人在线观看| 美女网站一区二区| 免费观看一级欧美片| 蜜臀久久久99精品久久久久久|