home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c185 / 1.ddi / FUNCS.EXE / CSCAPE / SOURCE / FNALPHA.C next >
Encoding:
C/C++ Source or Header  |  1989-09-07  |  1.2 KB  |  64 lines

  1. /*
  2.     fnalpha.c
  3.  
  4.     % alpha_funcs
  5.  
  6.     String editting functions (letters only).
  7.     Supports insert mode (with big cursor).
  8.     The field variable should be a char *.
  9.  
  10.     C-scape 3.1
  11.     Copyright (c) 1986, 1987, 1988 by Oakland Group, Inc.
  12.     ALL RIGHTS RESERVED.
  13.  
  14.     Revision History:
  15.     -----------------
  16.      4/06/88 jmd     added call to sed_DoSpecial
  17.      9/15/88 jmd     removed vid_Cursor calls
  18.      9/17/88 jmd     added std_ funcs
  19.     10/14/88 jdc    added var_size element to field_funcs_struct
  20.  
  21.      6/07/89 jmd    added test for mouse code (later removed)
  22. */
  23.  
  24. #include <stdio.h>
  25. #include <string.h>
  26. #include <ctype.h>
  27.  
  28. #include "cscape.h"
  29. #include "fnfunc.h"
  30. #include "scancode.h"
  31.  
  32. boolean alpha_filter(_arg1(int));
  33.  
  34. OGLOBAL field_funcs_struct alpha_funcs = {
  35.     stdBigCur_fenter,
  36.     string_fexit,
  37.     alpha_fkey,
  38.     string_senter,
  39.     string_sexit,
  40.     VAR_STRING
  41. };
  42.  
  43. void alpha_fkey(sed)
  44.     sed_type sed;
  45. /*
  46.     Hands its work to StrCommon_fkey (fnstrcom.c)
  47.     Passes a filter function (below) to decide which
  48.     characters can be typed in.
  49. */
  50. {
  51.     StrCommon_fkey(sed, alpha_filter);
  52. }
  53.  
  54.  
  55. boolean alpha_filter(key)
  56.     int key;
  57. /*
  58.     Filter function for alpha_funcs
  59.     for use with StrCommon_fkey
  60. */
  61. {
  62.     return(isalpha(key) || key == ' ');
  63. }
  64.