158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
|
}
if( pzLine ){
*pzLine = zLine + index;
}
}
/*
** This is the legacy comment printing algorithm. Currently, it is being
** retained primarily for testing and comparison purposes.
**
** Given a comment string, format that string for printing on a TTY.
** Assume that the output cursors is indent spaces from the left margin
** and that a single line can contain no more than width characters.
** Indent all subsequent lines by indent.
**
** Returns the number of new lines emitted.
*/
static int comment_print_legacy(
const char *zText, /* The comment text to be printed. */
int indent, /* Number of spaces to indent each non-initial line. */
int width /* Maximum number of characters per line. */
|
|
|
|
|
|
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
|
}
if( pzLine ){
*pzLine = zLine + index;
}
}
/*
** This is the legacy comment printing algorithm. It is being retained
** for backward compatibility.
**
** Given a comment string, format that string for printing on a TTY.
** Assume that the output cursors is indent spaces from the left margin
** and that a single line can contain no more than 'width' characters.
** Indent all subsequent lines by 'indent'.
**
** Returns the number of new lines emitted.
*/
static int comment_print_legacy(
const char *zText, /* The comment text to be printed. */
int indent, /* Number of spaces to indent each non-initial line. */
int width /* Maximum number of characters per line. */
|
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
|
}
fossil_print("%s\n", zBuf);
lineCnt++;
}
}
/*
** Given a comment string, format that string for printing on a TTY.
** Assume that the output cursors is indent spaces from the left margin
** and that a single line can contain no more than width characters.
** Indent all subsequent lines by indent.
**
** Returns the number of new lines emitted.
*/
int comment_print(
const char *zText, /* The comment text to be printed. */
int indent, /* Number of spaces to indent each non-initial line. */
int width, /* Maximum number of characters per line. */
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
|
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
|
}
fossil_print("%s\n", zBuf);
lineCnt++;
}
}
/*
** This is the comment printing function. The comment printing algorithm
** contained within it attempts to preserve the formatting present within
** the comment string itself while honoring line width limitations. There
** are several flags that modify the default behavior of this function:
**
** COMMENT_PRINT_LEGACY: Forces use of the legacy comment printing
** algorithm. For backward compatibility,
** this is the default.
**
** COMMENT_PRINT_TRIM_SPACE: Trims leading and trailing spaces where
** they do not materially impact formatting
** (i.e. at the start of the comment string
** -AND- right before each line indentation).
** This flag does not apply to the legacy
** comment printing algorithm.
**
** COMMENT_PRINT_WORD_BREAK: Attempts to break lines on word boundaries
** while honoring the logical line length.
** If this flag is not specified, honoring the
** logical line length may result in breaking
** lines in the middle of words. This flag
** does not apply to the legacy comment
** printing algorithm.
**
** Given a comment string, format that string for printing on a TTY.
** Assume that the output cursors is indent spaces from the left margin
** and that a single line can contain no more than 'width' characters.
** Indent all subsequent lines by 'indent'.
**
** Returns the number of new lines emitted.
*/
int comment_print(
const char *zText, /* The comment text to be printed. */
int indent, /* Number of spaces to indent each non-initial line. */
int width, /* Maximum number of characters per line. */
|