xref: /haiku/src/build/libgnuregex/printchar.c (revision 940a3a23227c26f1ca8e9fb4139fed41a85eb0a0)
1 /* Extended regular expression matching and search library,
2    version 0.12.
3    (Implements POSIX draft P10003.2/D11.2, except for
4    internationalization features.)
5 
6    Copyright (C) 1993 Free Software Foundation, Inc.
7 
8    This program is free software; you can redistribute it and/or modify
9    it under the terms of the GNU General Public License as published by
10    the Free Software Foundation; either version 2, or (at your option)
11    any later version.
12 
13    This program is distributed in the hope that it will be useful,
14    but WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16    GNU General Public License for more details.
17 
18    You should have received a copy of the GNU General Public License
19    along with this program; if not, write to the Free Software
20    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
21 
22 /* (this file was downloaded from
23  * https://raw.githubusercontent.com/ge-ne/bibtool/master/regex-0.12/test/printchar.c ,
24  * where no copyright header is included).
25  */
26 #ifdef DEBUG
27 
28 void
printchar(c)29 printchar (c)
30      char c;
31 {
32   if (c < 040 || c >= 0177)
33     {
34       putchar ('\\');
35       putchar (((c >> 6) & 3) + '0');
36       putchar (((c >> 3) & 7) + '0');
37       putchar ((c & 7) + '0');
38     }
39   else
40     putchar (c);
41 }
42 
43 #endif
44