home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_11_09 / 1109055a < prev    next >
Text File  |  1993-07-21  |  1KB  |  33 lines

  1. //strdetab.h
  2. /*
  3.   strdetab takes a null-terminated string in_buf,
  4.   possibly containing tab characters and copies it to
  5.   out_buf, expanding the tab characters as it goes.
  6.   Copying stops when max_line_length characters have
  7.   been placed in out_buf or when in_buf has been
  8.   completely copied. out_buf is null-terminated
  9.   (The '\0' is in addition to max_line_length).
  10.   If char_line_length is not NULL, then
  11.   *char_line_length is set to the number of characters
  12.   in out_buf (the equivalent of strlen).
  13.  
  14.   The way that the tabs are expanded is determined by
  15.   no_of_tabs and tab_stops. tab_stops is an array
  16.   of size no_of_tabs, i.e. indexed 0 to no_of_tabs - 1.
  17.   Each entry in tab stops is a tab position.
  18.   If no_of_tabs == 1 then the first entry in
  19.   tab_stops is used to specify the position for all
  20.   tabs in the line, at intervals of tab_stops[0].
  21.  
  22.   If tab_stops is exhausted, then tabs are replaced by spaces.
  23.  
  24.   strdetab returns a pointer to out_buf.
  25. */
  26.  
  27. const char * strdetab(char * out_buf,
  28.                       const int max_line_length,
  29.                       const char * in_buf,
  30.                       const int no_of_tabs,
  31.                       const int * tab_stops,
  32.                       int * char_line_length = NULL);
  33.