Subversion
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
svn_subst.h
Go to the documentation of this file.
1 /**
2  * @copyright
3  * ====================================================================
4  * Licensed to the Apache Software Foundation (ASF) under one
5  * or more contributor license agreements. See the NOTICE file
6  * distributed with this work for additional information
7  * regarding copyright ownership. The ASF licenses this file
8  * to you under the Apache License, Version 2.0 (the
9  * "License"); you may not use this file except in compliance
10  * with the License. You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing,
15  * software distributed under the License is distributed on an
16  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17  * KIND, either express or implied. See the License for the
18  * specific language governing permissions and limitations
19  * under the License.
20  * ====================================================================
21  * @endcopyright
22  *
23  * @file svn_subst.h
24  * @brief Data substitution (keywords and EOL style)
25  */
26 
27 
28 
29 #ifndef SVN_SUBST_H
30 #define SVN_SUBST_H
31 
32 #include <apr_pools.h>
33 #include <apr_hash.h>
34 #include <apr_time.h>
35 
36 #include "svn_types.h"
37 #include "svn_string.h"
38 #include "svn_io.h"
39 
40 #ifdef __cplusplus
41 extern "C" {
42 #endif /* __cplusplus */
43 
44 /* EOL conversion and keyword expansion. */
45 
46 /** The EOL used in the Repository for "native" files */
47 #define SVN_SUBST_NATIVE_EOL_STR "\n"
48 
49 /** Valid states for 'svn:eol-style' property.
50  *
51  * Property nonexistence is equivalent to 'none'.
52  */
53 typedef enum svn_subst_eol_style
54 {
55  /** An unrecognized style */
57 
58  /** EOL translation is "off" or ignored value */
60 
61  /** Translation is set to client's native eol */
63 
64  /** Translation is set to one of LF, CR, CRLF */
66 
68 
69 /** Set @a *style to the appropriate @c svn_subst_eol_style_t and @a *eol to
70  * the appropriate cstring for a given svn:eol-style property value.
71  *
72  * Set @a *eol to
73  *
74  * - @c NULL for @c svn_subst_eol_style_none, or
75  *
76  * - a NULL-terminated C string containing the native eol marker
77  * for this platform, for @c svn_subst_eol_style_native, or
78  *
79  * - a NULL-terminated C string containing the eol marker indicated
80  * by the property value, for @c svn_subst_eol_style_fixed.
81  *
82  * If @a *style is NULL, it is ignored.
83  */
84 void
86  const char **eol,
87  const char *value);
88 
89 /** Indicates whether the working copy and normalized versions of a file
90  * with the given the parameters differ. If @a force_eol_check is TRUE,
91  * the routine also accounts for all translations required due to repairing
92  * fixed eol styles.
93  *
94  * @since New in 1.4
95  *
96  */
99  const char *eol,
100  apr_hash_t *keywords,
101  svn_boolean_t special,
102  svn_boolean_t force_eol_check);
103 
104 
105 /** Values used in keyword expansion.
106  *
107  * @deprecated Provided for backward compatibility with the 1.2 API.
108  */
109 typedef struct svn_subst_keywords_t
110 {
111  /**
112  * @name svn_subst_keywords_t fields
113  * String expansion of the like-named keyword, or NULL if the keyword
114  * was not selected in the svn:keywords property.
115  * @{
116  */
117  const svn_string_t *revision;
118  const svn_string_t *date;
119  const svn_string_t *author;
120  const svn_string_t *url;
121  const svn_string_t *id;
122  /** @} */
124 
125 
126 /**
127  * Set @a *kw to a new keywords hash filled with the appropriate contents
128  * given a @a keywords_string (the contents of the svn:keywords
129  * property for the file in question), the revision @a rev, the @a url,
130  * the @a date the file was committed on, and the @a author of the last
131  * commit. Any of these can be @c NULL to indicate that the information is
132  * not present, or @c 0 for @a date.
133  *
134  * Hash keys are of type <tt>const char *</tt>.
135  * Hash values are of type <tt>svn_string_t *</tt>.
136  *
137  * All memory is allocated out of @a pool.
138  *
139  * @since New in 1.3.
140  */
141 svn_error_t *
142 svn_subst_build_keywords2(apr_hash_t **kw,
143  const char *keywords_string,
144  const char *rev,
145  const char *url,
146  apr_time_t date,
147  const char *author,
148  apr_pool_t *pool);
149 
150 /** Similar to svn_subst_build_keywords2() except that it populates
151  * an existing structure @a *kw instead of creating a keywords hash.
152  *
153  * @deprecated Provided for backward compatibility with the 1.2 API.
154  */
156 svn_error_t *
158  const char *keywords_string,
159  const char *rev,
160  const char *url,
161  apr_time_t date,
162  const char *author,
163  apr_pool_t *pool);
164 
165 
166 /** Return @c TRUE if @a a and @a b do not hold the same keywords.
167  *
168  * @a a and @a b are hashes of the form produced by
169  * svn_subst_build_keywords2().
170  *
171  * @since New in 1.3.
172  *
173  * If @a compare_values is @c TRUE, "same" means that the @a a and @a b
174  * contain exactly the same set of keywords, and the values of corresponding
175  * keywords match as well. Else if @a compare_values is @c FALSE, then
176  * "same" merely means that @a a and @a b hold the same set of keywords,
177  * although those keywords' values might differ.
178  *
179  * @a a and/or @a b may be @c NULL; for purposes of comparison, @c NULL is
180  * equivalent to holding no keywords.
181  */
183 svn_subst_keywords_differ2(apr_hash_t *a,
184  apr_hash_t *b,
185  svn_boolean_t compare_values,
186  apr_pool_t *pool);
187 
188 /** Similar to svn_subst_keywords_differ2() except that it compares
189  * two @c svn_subst_keywords_t structs instead of keyword hashes.
190  *
191  * @deprecated Provided for backward compatibility with the 1.2 API.
192  */
196  const svn_subst_keywords_t *b,
197  svn_boolean_t compare_values);
198 
199 
200 /**
201  * Copy and translate the data in @a src_stream into @a dst_stream. It is
202  * assumed that @a src_stream is a readable stream and @a dst_stream is a
203  * writable stream.
204  *
205  * If @a eol_str is non-@c NULL, replace whatever bytestring @a src_stream
206  * uses to denote line endings with @a eol_str in the output. If
207  * @a src_stream has an inconsistent line ending style, then: if @a repair
208  * is @c FALSE, return @c SVN_ERR_IO_INCONSISTENT_EOL, else if @a repair is
209  * @c TRUE, convert any line ending in @a src_stream to @a eol_str in
210  * @a dst_stream. Recognized line endings are: "\n", "\r", and "\r\n".
211  *
212  * See svn_subst_stream_translated() for details of the keyword substitution
213  * which is controlled by the @a expand and @a keywords parameters.
214  *
215  * Note that a translation request is *required*: one of @a eol_str or
216  * @a keywords must be non-@c NULL.
217  *
218  * Notes:
219  *
220  * See svn_wc__get_keywords() and svn_wc__get_eol_style() for a
221  * convenient way to get @a eol_str and @a keywords if in libsvn_wc.
222  *
223  * @since New in 1.3.
224  *
225  * @deprecated Provided for backward compatibility with the 1.5 API.
226  * Callers should use svn_subst_stream_translated() instead.
227  */
229 svn_error_t *
231  svn_stream_t *dst_stream,
232  const char *eol_str,
233  svn_boolean_t repair,
234  apr_hash_t *keywords,
235  svn_boolean_t expand,
236  apr_pool_t *scratch_pool);
237 
238 
239 /** Similar to svn_subst_translate_stream3() except relies upon a
240  * @c svn_subst_keywords_t struct instead of a hash for the keywords.
241  *
242  * @deprecated Provided for backward compatibility with the 1.2 API.
243  */
245 svn_error_t *
247  svn_stream_t *dst_stream,
248  const char *eol_str,
249  svn_boolean_t repair,
250  const svn_subst_keywords_t *keywords,
251  svn_boolean_t expand,
252  apr_pool_t *scratch_pool);
253 
254 
255 /**
256  * Same as svn_subst_translate_stream2(), but does not take a @a pool
257  * argument, instead creates a temporary subpool of the global pool, and
258  * destroys it before returning.
259  *
260  * @deprecated Provided for backward compatibility with the 1.1 API.
261  */
263 svn_error_t *
265  svn_stream_t *dst_stream,
266  const char *eol_str,
267  svn_boolean_t repair,
268  const svn_subst_keywords_t *keywords,
269  svn_boolean_t expand);
270 
271 
272 /** Return a stream which performs eol translation and keyword
273  * expansion when read from or written to. The stream @a stream
274  * is used to read and write all data.
275  *
276  * Make sure you call svn_stream_close() on the returned stream to
277  * ensure all data is flushed and cleaned up (this will also close
278  * the provided @a stream).
279  *
280  * Read operations from and write operations to the stream
281  * perform the same operation: if @a expand is @c FALSE, both
282  * contract keywords. One stream supports both read and write
283  * operations. Reads and writes may be mixed.
284  *
285  * If @a eol_str is non-@c NULL, replace whatever bytestring the input uses
286  * to denote line endings with @a eol_str in the output. If the input has
287  * an inconsistent line ending style, then: if @a repair is @c FALSE, then a
288  * subsequent read, write or other operation on the stream will return
289  * @c SVN_ERR_IO_INCONSISTENT_EOL when the inconsistency is detected, else
290  * if @a repair is @c TRUE, convert any line ending to @a eol_str.
291  * Recognized line endings are: "\n", "\r", and "\r\n".
292  *
293  * Expand and contract keywords using the contents of @a keywords as the
294  * new values. If @a expand is @c TRUE, expand contracted keywords and
295  * re-expand expanded keywords. If @a expand is @c FALSE, contract expanded
296  * keywords and ignore contracted ones. Keywords not found in the hash are
297  * ignored (not contracted or expanded). If the @a keywords hash
298  * itself is @c NULL, keyword substitution will be altogether ignored.
299  *
300  * Detect only keywords that are no longer than @c SVN_KEYWORD_MAX_LEN
301  * bytes, including the delimiters and the keyword itself.
302  *
303  * Recommendation: if @a expand is FALSE, then you don't care about the
304  * keyword values, so use empty strings as non-NULL signifiers when you
305  * build the keywords hash.
306  *
307  * The stream returned is allocated in @a result_pool.
308  *
309  * If the inner stream implements resetting via svn_stream_reset(),
310  * or marking and seeking via svn_stream_mark() and svn_stream_seek(),
311  * the translated stream will too.
312  *
313  * @since New in 1.4.
314  */
315 svn_stream_t *
317  const char *eol_str,
318  svn_boolean_t repair,
319  apr_hash_t *keywords,
320  svn_boolean_t expand,
321  apr_pool_t *result_pool);
322 
323 
324 /** Set @a *stream to a stream which performs eol translation and keyword
325  * expansion when read from or written to. The stream @a source
326  * is used to read and write all data. Make sure you call
327  * svn_stream_close() on @a stream to make sure all data are flushed
328  * and cleaned up.
329  *
330  * When @a stream is closed, then @a source will be closed.
331  *
332  * Read and write operations perform the same transformation:
333  * all data is translated to normal form.
334  *
335  * @see svn_subst_translate_to_normal_form()
336  *
337  * @since New in 1.5.
338  * @deprecated Provided for backward compatibility with the 1.5 API.
339  */
341 svn_error_t *
343  svn_stream_t *source,
344  svn_subst_eol_style_t eol_style,
345  const char *eol_str,
346  svn_boolean_t always_repair_eols,
347  apr_hash_t *keywords,
348  apr_pool_t *pool);
349 
350 
351 /** Set @a *stream to a readable stream containing the "normal form"
352  * of the special file located at @a path. The stream will be allocated
353  * in @a result_pool, and any temporary allocations will be made in
354  * @a scratch_pool.
355  *
356  * If the file at @a path is in fact a regular file, just read its content,
357  * which should be in the "normal form" for a special file. This enables
358  * special files to be written and read on platforms that do not treat them
359  * as special.
360  *
361  * @since New in 1.6.
362  */
363 svn_error_t *
365  const char *path,
366  apr_pool_t *result_pool,
367  apr_pool_t *scratch_pool);
368 
369 
370 /** Set @a *stream to a writable stream that accepts content in
371  * the "normal form" for a special file, to be located at @a path, and
372  * will create that file when the stream is closed. The stream will be
373  * allocated in @a result_pool, and any temporary allocations will be
374  * made in @a scratch_pool.
375  *
376  * If the platform does not support the semantics of the special file, write
377  * a regular file containing the "normal form" text. This enables special
378  * files to be written and read on platforms that do not treat them as
379  * special.
380  *
381  * Note: the target file is created in a temporary location, then renamed
382  * into position, so the creation can be considered "atomic".
383  *
384  * @since New in 1.6.
385  */
386 svn_error_t *
388  const char *path,
389  apr_pool_t *result_pool,
390  apr_pool_t *scratch_pool);
391 
392 
393 /** Set @a *stream to a stream which translates the special file at @a path
394  * to the internal representation for special files when read from. When
395  * written to, it does the reverse: creating a special file when the
396  * stream is closed.
397  *
398  * @since New in 1.5.
399  *
400  * @deprecated Provided for backward compatibility with the 1.5 API.
401  * Callers should use svn_subst_read_specialfile or
402  * svn_subst_create_specialfile as appropriate.
403  */
405 svn_error_t *
407  const char *path,
408  apr_pool_t *pool);
409 
410 
411 /**
412  * Copy the contents of file-path @a src to file-path @a dst atomically,
413  * either creating @a dst or overwriting @a dst if it exists, possibly
414  * performing line ending and keyword translations.
415  *
416  * The parameters @a *eol_str, @a repair, @a *keywords and @a expand are
417  * defined the same as in svn_subst_translate_stream3().
418  *
419  * In addition, it will create a special file from normal form or
420  * translate one to normal form if @a special is @c TRUE.
421  *
422  * If anything goes wrong during the copy, attempt to delete @a dst (if
423  * it exists).
424  *
425  * If @a eol_str and @a keywords are @c NULL, behavior is just a byte-for-byte
426  * copy.
427  *
428  * @a cancel_func and @a cancel_baton will be called (if not NULL)
429  * periodically to check for cancellation.
430  *
431  * @since New in 1.7.
432  */
433 svn_error_t *
434 svn_subst_copy_and_translate4(const char *src,
435  const char *dst,
436  const char *eol_str,
437  svn_boolean_t repair,
438  apr_hash_t *keywords,
439  svn_boolean_t expand,
440  svn_boolean_t special,
441  svn_cancel_func_t cancel_func,
442  void *cancel_baton,
443  apr_pool_t *pool);
444 
445 
446 /**
447  * Similar to svn_subst_copy_and_translate4() but without a cancellation
448  * function and baton.
449  *
450  * @since New in 1.3.
451  * @deprecated Provided for backward compatibility with the 1.6 API.
452  */
454 svn_error_t *
455 svn_subst_copy_and_translate3(const char *src,
456  const char *dst,
457  const char *eol_str,
458  svn_boolean_t repair,
459  apr_hash_t *keywords,
460  svn_boolean_t expand,
461  svn_boolean_t special,
462  apr_pool_t *pool);
463 
464 
465 /**
466  * Similar to svn_subst_copy_and_translate3() except that @a keywords is a
467  * @c svn_subst_keywords_t struct instead of a keywords hash.
468  *
469  * @deprecated Provided for backward compatibility with the 1.2 API.
470  * @since New in 1.1.
471  */
473 svn_error_t *
474 svn_subst_copy_and_translate2(const char *src,
475  const char *dst,
476  const char *eol_str,
477  svn_boolean_t repair,
478  const svn_subst_keywords_t *keywords,
479  svn_boolean_t expand,
480  svn_boolean_t special,
481  apr_pool_t *pool);
482 
483 /**
484  * Similar to svn_subst_copy_and_translate2() except that @a special is
485  * always set to @c FALSE.
486  *
487  * @deprecated Provided for backward compatibility with the 1.0 API.
488  */
490 svn_error_t *
491 svn_subst_copy_and_translate(const char *src,
492  const char *dst,
493  const char *eol_str,
494  svn_boolean_t repair,
495  const svn_subst_keywords_t *keywords,
496  svn_boolean_t expand,
497  apr_pool_t *pool);
498 
499 
500 /**
501  * Set @a *dst to a copy of the string @a src, possibly performing line
502  * ending and keyword translations.
503  *
504  * This is a variant of svn_subst_translate_stream3() that operates on
505  * cstrings. @see svn_subst_stream_translated() for details of the
506  * translation and of @a eol_str, @a repair, @a keywords and @a expand.
507  *
508  * If @a eol_str and @a keywords are @c NULL, behavior is just a byte-for-byte
509  * copy.
510  *
511  * Allocate @a *dst in @a pool.
512  *
513  * @since New in 1.3.
514  */
515 svn_error_t *
516 svn_subst_translate_cstring2(const char *src,
517  const char **dst,
518  const char *eol_str,
519  svn_boolean_t repair,
520  apr_hash_t *keywords,
521  svn_boolean_t expand,
522  apr_pool_t *pool);
523 
524 /**
525  * Similar to svn_subst_translate_cstring2() except that @a keywords is a
526  * @c svn_subst_keywords_t struct instead of a keywords hash.
527  *
528  * @deprecated Provided for backward compatibility with the 1.2 API.
529  */
531 svn_error_t *
532 svn_subst_translate_cstring(const char *src,
533  const char **dst,
534  const char *eol_str,
535  svn_boolean_t repair,
536  const svn_subst_keywords_t *keywords,
537  svn_boolean_t expand,
538  apr_pool_t *pool);
539 
540 /**
541  * Translate the file @a src in working copy form to a file @a dst in
542  * normal form.
543  *
544  * The values specified for @a eol_style, @a *eol_str, @a keywords and
545  * @a special, should be the ones used to translate the file to its
546  * working copy form. Usually, these are the values specified by the
547  * user in the files' properties.
548  *
549  * Inconsistent line endings in the file will be automatically repaired
550  * (made consistent) for some eol styles. For all others, an error is
551  * returned. By setting @a always_repair_eols to @c TRUE, eols will be
552  * made consistent even for those styles which don't have it by default.
553  *
554  * @note To translate a file FROM normal form, use
555  * svn_subst_copy_and_translate3().
556  *
557  * @since New in 1.4
558  * @deprecated Provided for backward compatibility with the 1.5 API
559  */
561 svn_error_t *
562 svn_subst_translate_to_normal_form(const char *src,
563  const char *dst,
564  svn_subst_eol_style_t eol_style,
565  const char *eol_str,
566  svn_boolean_t always_repair_eols,
567  apr_hash_t *keywords,
568  svn_boolean_t special,
569  apr_pool_t *pool);
570 
571 /**
572  * Set @a *stream_p to a stream that detranslates the file @a src from
573  * working copy form to normal form, allocated in @a pool.
574  *
575  * The values specified for @a eol_style, @a *eol_str, @a keywords and
576  * @a special, should be the ones used to translate the file to its
577  * working copy form. Usually, these are the values specified by the
578  * user in the files' properties.
579  *
580  * Inconsistent line endings in the file will be automatically repaired
581  * (made consistent) for some eol styles. For all others, an error is
582  * returned. By setting @a always_repair_eols to @c TRUE, eols will be
583  * made consistent even for those styles which don't have it by default.
584  *
585  * @since New in 1.4.
586  *
587  * @deprecated Provided for backward compatibility with the 1.5 API.
588  * Use svn_subst_stream_from_specialfile if the source is special;
589  * otherwise, use svn_subst_stream_translated_to_normal_form.
590  */
592 svn_error_t *
594  const char *src,
595  svn_subst_eol_style_t eol_style,
596  const char *eol_str,
597  svn_boolean_t always_repair_eols,
598  apr_hash_t *keywords,
599  svn_boolean_t special,
600  apr_pool_t *pool);
601 
602 
603 /* EOL conversion and character encodings */
604 
605 /** Translate the string @a value from character encoding @a encoding to
606  * UTF8, and also from its current line-ending style to LF line-endings. If
607  * @a encoding is @c NULL, translate from the system-default encoding.
608  *
609  * If @a translated_to_utf8 is not @c NULL, then set @a *translated_to_utf8
610  * to @c TRUE if at least one character of @a value in the source character
611  * encoding was translated to UTF-8, or to @c FALSE otherwise.
612  *
613  * If @a translated_line_endings is not @c NULL, then set @a
614  * *translated_line_endings to @c TRUE if at least one line ending was
615  * changed to LF, or to @c FALSE otherwise.
616  *
617  * If @a value has an inconsistent line ending style, then: if @a repair
618  * is @c FALSE, return @c SVN_ERR_IO_INCONSISTENT_EOL, else if @a repair is
619  * @c TRUE, convert any line ending in @a value to "\n" in
620  * @a *new_value. Recognized line endings are: "\n", "\r", and "\r\n".
621  *
622  * Set @a *new_value to the translated string, allocated in @a result_pool.
623  *
624  * @a scratch_pool is used for temporary allocations.
625  *
626  * @since New in 1.7.
627  */
628 svn_error_t *
630  svn_boolean_t *translated_to_utf8,
631  svn_boolean_t *translated_line_endings,
632  const svn_string_t *value,
633  const char *encoding,
634  svn_boolean_t repair,
635  apr_pool_t *result_pool,
636  apr_pool_t *scratch_pool);
637 
638 /** Similar to svn_subst_translate_string2(), except that the information about
639  * whether re-encoding or line ending translation were performed is discarded.
640  *
641  * @deprecated Provided for backward compatibility with the 1.6 API.
642  */
645  const svn_string_t *value,
646  const char *encoding,
647  apr_pool_t *pool);
648 
649 /** Translate the string @a value from UTF8 and LF line-endings into native
650  * character encoding and native line-endings. If @a for_output is TRUE,
651  * translate to the character encoding of the output locale, else to that of
652  * the default locale.
653  *
654  * Set @a *new_value to the translated string, allocated in @a pool.
655  */
657  const svn_string_t *value,
658  svn_boolean_t for_output,
659  apr_pool_t *pool);
660 
661 #ifdef __cplusplus
662 }
663 #endif /* __cplusplus */
664 
665 #endif /* SVN_SUBST_H */
svn_error_t * svn_subst_translate_string(svn_string_t **new_value, const svn_string_t *value, const char *encoding, apr_pool_t *pool)
Similar to svn_subst_translate_string2(), except that the information about whether re-encoding or li...
Counted-length strings for Subversion, plus some C string goodies.
svn_stream_t * svn_subst_stream_translated(svn_stream_t *stream, const char *eol_str, svn_boolean_t repair, apr_hash_t *keywords, svn_boolean_t expand, apr_pool_t *result_pool)
Return a stream which performs eol translation and keyword expansion when read from or written to...
svn_error_t * svn_subst_translate_to_normal_form(const char *src, const char *dst, svn_subst_eol_style_t eol_style, const char *eol_str, svn_boolean_t always_repair_eols, apr_hash_t *keywords, svn_boolean_t special, apr_pool_t *pool)
Translate the file src in working copy form to a file dst in normal form.
svn_error_t * svn_subst_create_specialfile(svn_stream_t **stream, const char *path, apr_pool_t *result_pool, apr_pool_t *scratch_pool)
Set *stream to a writable stream that accepts content in the &quot;normal form&quot; for a special file...
An unrecognized style.
Definition: svn_subst.h:56
svn_error_t * svn_subst_copy_and_translate3(const char *src, const char *dst, const char *eol_str, svn_boolean_t repair, apr_hash_t *keywords, svn_boolean_t expand, svn_boolean_t special, apr_pool_t *pool)
Similar to svn_subst_copy_and_translate4() but without a cancellation function and baton...
Translation is set to one of LF, CR, CRLF.
Definition: svn_subst.h:65
General file I/O for Subversion.
Values used in keyword expansion.
Definition: svn_subst.h:109
svn_error_t * svn_subst_stream_detranslated(svn_stream_t **stream_p, const char *src, svn_subst_eol_style_t eol_style, const char *eol_str, svn_boolean_t always_repair_eols, apr_hash_t *keywords, svn_boolean_t special, apr_pool_t *pool)
Set *stream_p to a stream that detranslates the file src from working copy form to normal form...
svn_error_t * svn_subst_build_keywords(svn_subst_keywords_t *kw, const char *keywords_string, const char *rev, const char *url, apr_time_t date, const char *author, apr_pool_t *pool)
Similar to svn_subst_build_keywords2() except that it populates an existing structure *kw instead of ...
svn_boolean_t svn_subst_keywords_differ2(apr_hash_t *a, apr_hash_t *b, svn_boolean_t compare_values, apr_pool_t *pool)
Return TRUE if a and b do not hold the same keywords.
Translation is set to client&#39;s native eol.
Definition: svn_subst.h:62
svn_error_t * svn_subst_translate_stream3(svn_stream_t *src_stream, svn_stream_t *dst_stream, const char *eol_str, svn_boolean_t repair, apr_hash_t *keywords, svn_boolean_t expand, apr_pool_t *scratch_pool)
Copy and translate the data in src_stream into dst_stream.
A simple counted string.
Definition: svn_string.h:96
svn_error_t * svn_subst_read_specialfile(svn_stream_t **stream, const char *path, apr_pool_t *result_pool, apr_pool_t *scratch_pool)
Set *stream to a readable stream containing the &quot;normal form&quot; of the special file located at path...
svn_error_t * svn_subst_translate_cstring(const char *src, const char **dst, const char *eol_str, svn_boolean_t repair, const svn_subst_keywords_t *keywords, svn_boolean_t expand, apr_pool_t *pool)
Similar to svn_subst_translate_cstring2() except that keywords is a svn_subst_keywords_t struct inste...
enum svn_subst_eol_style svn_subst_eol_style_t
Valid states for &#39;svn:eol-style&#39; property.
Subversion error object.
Definition: svn_types.h:90
svn_error_t * svn_subst_build_keywords2(apr_hash_t **kw, const char *keywords_string, const char *rev, const char *url, apr_time_t date, const char *author, apr_pool_t *pool)
Set *kw to a new keywords hash filled with the appropriate contents given a keywords_string (the cont...
svn_error_t * svn_subst_copy_and_translate2(const char *src, const char *dst, const char *eol_str, svn_boolean_t repair, const svn_subst_keywords_t *keywords, svn_boolean_t expand, svn_boolean_t special, apr_pool_t *pool)
Similar to svn_subst_copy_and_translate3() except that keywords is a svn_subst_keywords_t struct inst...
svn_boolean_t svn_subst_translation_required(svn_subst_eol_style_t style, const char *eol, apr_hash_t *keywords, svn_boolean_t special, svn_boolean_t force_eol_check)
Indicates whether the working copy and normalized versions of a file with the given the parameters di...
struct svn_stream_t svn_stream_t
An abstract stream of bytes–either incoming or outgoing or both.
Definition: svn_io.h:743
Subversion&#39;s data types.
svn_error_t * svn_subst_translate_stream2(svn_stream_t *src_stream, svn_stream_t *dst_stream, const char *eol_str, svn_boolean_t repair, const svn_subst_keywords_t *keywords, svn_boolean_t expand, apr_pool_t *scratch_pool)
Similar to svn_subst_translate_stream3() except relies upon a svn_subst_keywords_t struct instead of ...
#define SVN_DEPRECATED
Macro used to mark deprecated functions.
Definition: svn_types.h:58
svn_boolean_t svn_subst_keywords_differ(const svn_subst_keywords_t *a, const svn_subst_keywords_t *b, svn_boolean_t compare_values)
Similar to svn_subst_keywords_differ2() except that it compares two svn_subst_keywords_t structs inst...
svn_error_t * svn_subst_translate_cstring2(const char *src, const char **dst, const char *eol_str, svn_boolean_t repair, apr_hash_t *keywords, svn_boolean_t expand, apr_pool_t *pool)
Set *dst to a copy of the string src, possibly performing line ending and keyword translations...
svn_error_t *(* svn_cancel_func_t)(void *cancel_baton)
A user defined callback that subversion will call with a user defined baton to see if the current ope...
Definition: svn_types.h:1040
svn_error_t * svn_subst_stream_translated_to_normal_form(svn_stream_t **stream, svn_stream_t *source, svn_subst_eol_style_t eol_style, const char *eol_str, svn_boolean_t always_repair_eols, apr_hash_t *keywords, apr_pool_t *pool)
Set *stream to a stream which performs eol translation and keyword expansion when read from or writte...
svn_error_t * svn_subst_detranslate_string(svn_string_t **new_value, const svn_string_t *value, svn_boolean_t for_output, apr_pool_t *pool)
Translate the string value from UTF8 and LF line-endings into native character encoding and native li...
struct svn_subst_keywords_t svn_subst_keywords_t
Values used in keyword expansion.
int svn_boolean_t
YABT: Yet Another Boolean Type.
Definition: svn_types.h:360
svn_error_t * svn_subst_translate_stream(svn_stream_t *src_stream, svn_stream_t *dst_stream, const char *eol_str, svn_boolean_t repair, const svn_subst_keywords_t *keywords, svn_boolean_t expand)
Same as svn_subst_translate_stream2(), but does not take a pool argument, instead creates a temporary...
svn_error_t * svn_subst_copy_and_translate(const char *src, const char *dst, const char *eol_str, svn_boolean_t repair, const svn_subst_keywords_t *keywords, svn_boolean_t expand, apr_pool_t *pool)
Similar to svn_subst_copy_and_translate2() except that special is always set to FALSE.
svn_error_t * svn_subst_translate_string2(svn_string_t **new_value, svn_boolean_t *translated_to_utf8, svn_boolean_t *translated_line_endings, const svn_string_t *value, const char *encoding, svn_boolean_t repair, apr_pool_t *result_pool, apr_pool_t *scratch_pool)
Translate the string value from character encoding encoding to UTF8, and also from its current line-e...
svn_subst_eol_style
Valid states for &#39;svn:eol-style&#39; property.
Definition: svn_subst.h:53
svn_error_t * svn_subst_stream_from_specialfile(svn_stream_t **stream, const char *path, apr_pool_t *pool)
Set *stream to a stream which translates the special file at path to the internal representation for ...
EOL translation is &quot;off&quot; or ignored value.
Definition: svn_subst.h:59
void svn_subst_eol_style_from_value(svn_subst_eol_style_t *style, const char **eol, const char *value)
Set *style to the appropriate svn_subst_eol_style_t and *eol to the appropriate cstring for a given s...
svn_error_t * svn_subst_copy_and_translate4(const char *src, const char *dst, const char *eol_str, svn_boolean_t repair, apr_hash_t *keywords, svn_boolean_t expand, svn_boolean_t special, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool)
Copy the contents of file-path src to file-path dst atomically, either creating dst or overwriting ds...