home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / gnu / fax-3.2.1 / lib / libfax / msgs.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-07-31  |  3.5 KB  |  185 lines

  1. /*
  2.   This file is part of the NetFax system.
  3.  
  4.   (c) Copyright 1989 by David M. Siegel and Sundar Narasimhan.
  5.       All rights reserved.
  6.  
  7.     This program is free software; you can redistribute it and/or modify
  8.     it under the terms of the GNU General Public License as published by
  9.     the Free Software Foundation.
  10.  
  11.     This program is distributed in the hope that it will be useful, 
  12.     but WITHOUT ANY WARRANTY; without even the implied warranty of 
  13.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.     GNU General Public License for more details.
  15.  
  16.     You should have received a copy of the GNU General Public License
  17.     along with this program; if not, write to the Free Software
  18.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19. */
  20.  
  21. #include <stdio.h>
  22.  
  23. #include "c2proto.h"
  24. #include "msgs.h"
  25.  
  26. static char *modem_result_strings[] = {
  27.     "ok", "connect", "ring", "no carrier", "error", "no dialtone", "busy",
  28.     "no answer",
  29. };
  30.  
  31. char *hayes_result_msg(result)
  32.      int result;
  33. {
  34.     if (result < 0 || result > 8)
  35.       return ("unknown");
  36.     else
  37.       return (modem_result_strings[result]);
  38. }
  39.  
  40. char *faxmodem_result_msg(f)
  41.      FaxModem *f;
  42. {
  43.     return (hayes_result_msg(f->result));
  44. }
  45.  
  46. void faxmodem_print_id_strings(f, fp)
  47.      FaxModem *f;
  48.      FILE *fp;
  49. {
  50.     if (FAX_ISSET(f, FAX_F_FTSI))
  51.       fprintf(fp, "tsi: %s\n", f->ftsi_id);
  52.     if (FAX_ISSET(f, FAX_F_FCSI))
  53.       fprintf(fp, "csi: %s\n", f->fcsi_id);
  54.     if (FAX_ISSET(f, FAX_F_FCIG))
  55.       fprintf(fp, "cig: %s\n", f->fcig_id);
  56. }
  57.  
  58. char *t30_vr_string(p)
  59.      T30params *p;
  60. {
  61.     switch (p->vr) {
  62.       case VR_NORMAL:
  63.     return ("normal");
  64.       case VR_FINE:
  65.     return ("fine");
  66.       default:
  67.     return ("unknown");
  68.     }
  69. }
  70.  
  71. char *t30_br_string(p)
  72.      T30params *p;
  73. {
  74.     switch (p->br) {
  75.       case BR_2400:
  76.     return ("2400");
  77.       case BR_4800:
  78.     return ("4800");
  79.       case BR_7200:
  80.     return ("7200");
  81.       case BR_9600:
  82.     return ("9600");
  83.       default:
  84.     return ("unknown");
  85.     }
  86. }
  87.  
  88. char *t30_wd_string(p)
  89.      T30params *p;
  90. {
  91.     switch (p->wd) {
  92.       case WD_1728:
  93.     return ("215");
  94.       case WD_2048:
  95.     return ("255");
  96.       case WD_2432:
  97.     return ("303");
  98.       default:
  99.     return ("unknown");
  100.     }
  101. }
  102.  
  103. char *t30_ln_string(p)
  104.      T30params *p;
  105. {
  106.     switch (p->ln) {
  107.       case LN_A4:
  108.     return ("A4");
  109.       case LN_B4:
  110.     return ("B4");
  111.       case LN_UNLIMITED:
  112.     return ("unlimited");
  113.       default:
  114.     return ("unknown");
  115.     }
  116. }
  117.  
  118. char *t30_df_string(p)
  119.      T30params *p;
  120. {
  121.     switch (p->df) {
  122.       case DF_1DHUFFMAN:
  123.     return ("1D huffman");
  124.       case DF_2DMREAD:
  125.     return ("2D read");
  126.       case DF_2DUNCOMP:
  127.     return ("2D uncompressed");
  128.       default:
  129.     return ("unknown");
  130.     }
  131. }
  132.  
  133. char *t30_ec_string(p)
  134.      T30params *p;
  135. {
  136.     switch (p->ec) {
  137.       case EC_DA_ECM:
  138.     return ("disabled");
  139.       case EC_EN_ECM_64:
  140.     return ("ECM 64");
  141.       case EC_EN_ECM_256:
  142.     return ("ECM_256");
  143.       default:
  144.     return ("unknown");
  145.     }
  146. }
  147.  
  148. char *t30_bf_string(p)
  149.      T30params *p;
  150. {
  151.     switch(p->bf) {
  152.       case BF_DISABLED:
  153.     return ("disabled");
  154.       case BF_ENABLED:
  155.     return ("enabled");
  156.       default:
  157.     return ("unknown");
  158.     }
  159. }
  160.  
  161. char *t30_st_string(p)
  162.      T30params *p;
  163. {
  164.     switch(p->st) {
  165.       case ST_0:
  166.     return("N-0 F-0");
  167.       case ST_1:
  168.     return("N-5 F-5");
  169.       case ST_2:
  170.     return("N-10 F-5");
  171.       case ST_3:
  172.     return("N-10 F-10");
  173.       case ST_4:
  174.     return("N-20 F-10");
  175.       case ST_5:
  176.     return("N-20 F-20");
  177.       case ST_6:
  178.     return("N-40 F-20");
  179.       case ST_7:
  180.     return("N-40 F-40");
  181.       default:
  182.     return ("unknown");
  183.     }
  184. }
  185.