ObjFW  Diff

Differences From Artifact [ddc90ae5f2]:

To Artifact [4b04bb450d]:


27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
@class OFColor;

/**
 * @class OFStdIOStream OFStdIOStream.h ObjFW/OFStdIOStream.h
 *
 * @brief A class for providing standard input, output and error as OFStream.
 *
 * The global variables @ref of_stdin, @ref of_stdout and @ref of_stderr are
 * instances of this class and need no initialization.
 */
#ifdef OF_STDIO_STREAM_WIN32_CONSOLE_H
OF_SUBCLASSING_RESTRICTED
#endif
@interface OFStdIOStream: OFStream
#if !defined(OF_WINDOWS) && !defined(OF_AMIGAOS)







|







27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
@class OFColor;

/**
 * @class OFStdIOStream OFStdIOStream.h ObjFW/OFStdIOStream.h
 *
 * @brief A class for providing standard input, output and error as OFStream.
 *
 * The global variables @ref OFStdIn, @ref OFStdOut and @ref OFStdErr are
 * instances of this class and need no initialization.
 */
#ifdef OF_STDIO_STREAM_WIN32_CONSOLE_H
OF_SUBCLASSING_RESTRICTED
#endif
@interface OFStdIOStream: OFStream
#if !defined(OF_WINDOWS) && !defined(OF_AMIGAOS)
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162








163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180

/**
 * @brief Moves the cursor to the specified absolute position. Does nothing if
 *	  there is no underlying terminal.
 *
 * @param position The position to move the cursor to
 */
- (void)setCursorPosition: (of_point_t)position;

/**
 * @brief Moves the cursor to the specified relative position. Does nothing if
 *	  there is no underlying terminal.
 *
 * @param position The position to move the cursor to
 */
- (void)setRelativeCursorPosition: (of_point_t)position;
@end

#ifdef __cplusplus
extern "C" {
#endif
/** @file */

#ifndef OF_AMIGAOS
/**
 * @brief The standard input as an OFStream.
 */
extern OFStdIOStream *_Nullable of_stdin;

/**
 * @brief The standard output as an OFStream.
 */
extern OFStdIOStream *_Nullable of_stdout;

/**
 * @brief The standard error as an OFStream.
 */
extern OFStdIOStream *_Nullable of_stderr;
#else
extern OFStdIOStream *_Nonnull *_Nullable of_stdin_ref(void);
extern OFStdIOStream *_Nonnull *_Nullable of_stdout_ref(void);
extern OFStdIOStream *_Nonnull *_Nullable of_stderr_ref(void);
# define of_stdin (*of_stdin_ref())
# define of_stdout (*of_stdout_ref())
# define of_stderr (*of_stderr_ref())
#endif

/**
 * @brief Logs the specified printf-style format to @ref of_stderr.








 *
 * This prefixes the output with the date, timestamp, process name and PID and
 * allows `%@` as a printf-style formatted to print objects.
 */
extern void of_log(OFConstantString *format, ...);

/*!
 * @brief Logs the specified printf-style format to @ref of_stderr.
 *
 * This prefixes the output with the date, timestamp, process name and PID and
 * allows `%@` as a printf-style formatted to print objects.
 */
extern void of_logv(OFConstantString *format, va_list arguments);
#ifdef __cplusplus
}
#endif

OF_ASSUME_NONNULL_END







|







|











|




|




|

|
|
|
|
|
|



|
>
>
>
>
>
>
>
>




<
<
<
<
<
<
<
<
|





114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174








175
176
177
178
179
180

/**
 * @brief Moves the cursor to the specified absolute position. Does nothing if
 *	  there is no underlying terminal.
 *
 * @param position The position to move the cursor to
 */
- (void)setCursorPosition: (OFPoint)position;

/**
 * @brief Moves the cursor to the specified relative position. Does nothing if
 *	  there is no underlying terminal.
 *
 * @param position The position to move the cursor to
 */
- (void)setRelativeCursorPosition: (OFPoint)position;
@end

#ifdef __cplusplus
extern "C" {
#endif
/** @file */

#ifndef OF_AMIGAOS
/**
 * @brief The standard input as an OFStream.
 */
extern OFStdIOStream *_Nullable OFStdIn;

/**
 * @brief The standard output as an OFStream.
 */
extern OFStdIOStream *_Nullable OFStdOut;

/**
 * @brief The standard error as an OFStream.
 */
extern OFStdIOStream *_Nullable OFStdErr;
#else
extern OFStdIOStream *_Nonnull *_Nullable OFStdInRef(void);
extern OFStdIOStream *_Nonnull *_Nullable OFStdOutRef(void);
extern OFStdIOStream *_Nonnull *_Nullable OFStdErrRef(void);
# define OFStdIn (*OFStdInRef())
# define OFStdOut (*OFStdOutRef())
# define OFStdErr (*OFStdErrRef())
#endif

/**
 * @brief Logs the specified printf-style format to @ref OFStdErr.
 *
 * This prefixes the output with the date, timestamp, process name and PID and
 * allows `%@` as a printf-style formatted to print objects.
 */
extern void OFLog(OFConstantString *format, ...);

/*!
 * @brief Logs the specified printf-style format to @ref OFStdErr.
 *
 * This prefixes the output with the date, timestamp, process name and PID and
 * allows `%@` as a printf-style formatted to print objects.
 */








extern void OFLogV(OFConstantString *format, va_list arguments);
#ifdef __cplusplus
}
#endif

OF_ASSUME_NONNULL_END