1 /*
2 Copyright (C) 2015-2021, Dirk Krause
3 SPDX-License-Identifier: BSD-3-Clause
4 */
5 
6 /*
7 	WARNING: This file was generated by the dkct program (see
8 	http://dktools.sourceforge.net/ for details).
9 	Changes you make here will be lost if dkct is run again!
10 	You should modify the original source and run dkct on it.
11 	Original source: dk4istty.ctr
12 */
13 
14 #ifndef DK4ISTTY_H_INCLUDED
15 /** Avoid multiple inclusions. */
16 #define DK4ISTTY_H_INCLUDED 1
17 
18 
19 /**	@file
20 	Check whether a file pointer
21 	is connected to a terminal.
22 
23 	CRT on Windows: Required.
24 */
25 
26 #ifndef DK4CONF_H_INCLUDED
27 #if DK4_BUILDING_DKTOOLS4
28 #include "dk4conf.h"
29 #else
30 #include <dktools-4/dk4conf.h>
31 #endif
32 #endif
33 
34 #ifndef DK4TYPES_H_INCLUDED
35 #if DK4_BUILDING_DKTOOLS4
36 #include <libdk4base/dk4types.h>
37 #else
38 #include <dktools-4/dk4types.h>
39 #endif
40 #endif
41 
42 #ifndef DK4ERROR_H_INCLUDED
43 #if DK4_BUILDING_DKTOOLS4
44 #include <libdk4base/dk4error.h>
45 #else
46 #include <dktools-4/dk4error.h>
47 #endif
48 #endif
49 
50 #ifndef STDIO_H_INCLUDED
51 #include <stdio.h>
52 #define	STDIO_H_INCLUDED	1
53 #endif
54 
55 
56 #ifdef __cplusplus
57 extern "C" {
58 #endif
59 
60 /**	Check  whether the file descriptor is connected to a
61 	tty (terminal, printer, serial line).
62 	@param	fd	File descriptor to check.
63 	@param	erp	Error report, may be NULL.
64 	@return	1 for tty, 0 for other file descriptor, -1 on error.
65 
66 	Error codes:
67 	- DK4_E_NOT_SUPPORTED<br>
68 	  if not isatty() or _isatty() function available on the system.
69 */
70 int
71 dk4istty(int fd, dk4_er_t *erp);
72 
73 /**	Check whether a FILE pointer is connected to a tty
74 	(terminal, printer, serial line).
75 	@param	fipo	FILE to check.
76 	@param	erp	Error report, may be NULL.
77 	@return 1 for tty, 0 for other file descriptor, -1 on error.
78 */
79 int
80 dk4istty_file(FILE *fipo, dk4_er_t *erp);
81 
82 #ifdef __cplusplus
83 }
84 #endif
85 
86 
87 
88 
89 #endif
90