Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

svn_cmdline.h File Reference

Support functions for command line programs. More...

#include <apr_want.h>
#include "svn_utf.h"

Go to the source code of this file.

Functions

int svn_cmdline_init (const char *progname, FILE *error_stream)
 Set up the locale for character conversion, and initialize APR.
svn_error_tsvn_cmdline_cstring_from_utf8 (const char **dest, const char *src, apr_pool_t *pool)
 Set *dest to an output-encoded C string from UTF-8 C string src; allocate *dest in pool.
const char * svn_cmdline_cstring_from_utf8_fuzzy (const char *src, apr_pool_t *pool)
 Like svn_utf_cstring_from_utf8_fuzzy(), but converts to an output-encoded C string.
svn_error_tsvn_cmdline_cstring_to_utf8 (const char **dest, const char *src, apr_pool_t *pool)
 Set *dest to a UTF-8-encoded C string from input-encoded C string src; allocate *dest in pool.
svn_error_tsvn_cmdline_path_local_style_from_utf8 (const char **dest, const char *src, apr_pool_t *pool)
 Set *dest to an output-encoded natively-formatted path string from canonical path src; allocate *dest in pool.
svn_error_tsvn_cmdline_printf (apr_pool_t *pool, const char *fmt,...)
 Write to stdout, using a printf-like format string fmt, passed through apr_pvsprintf().
svn_error_tsvn_cmdline_fprintf (FILE *stream, apr_pool_t *pool, const char *fmt,...)
 Write to the stdio stream, using a printf-like format string fmt, passed through apr_pvsprintf().
svn_error_tsvn_cmdline_fputs (const char *string, FILE *stream, apr_pool_t *pool)
 Output the string to the stdio stream, converting from UTF-8 to the output encoding.
svn_error_tsvn_cmdline_fflush (FILE *stream)
 Flush output buffers of the stdio stream, returning an error if that fails.
const char * svn_cmdline_output_encoding (apr_pool_t *pool)
 Return the name of the output encoding allocated in pool, or APR_LOCALE_CHARSET if the output encoding is the same as the locale encoding.
int svn_cmdline_handle_exit_error (svn_error_t *error, apr_pool_t *pool, const char *prefix)
 Handle error in preparation for immediate exit from a command-line client.


Detailed Description

Support functions for command line programs.

Definition in file svn_cmdline.h.


Function Documentation

svn_error_t* svn_cmdline_fflush FILE *  stream  ) 
 

Flush output buffers of the stdio stream, returning an error if that fails.

This is just a wrapper for the standard fflush() function for consistent error handling.

Since:
New in 1.1.

svn_error_t* svn_cmdline_fprintf FILE *  stream,
apr_pool_t *  pool,
const char *  fmt,
  ...
 

Write to the stdio stream, using a printf-like format string fmt, passed through apr_pvsprintf().

All string arguments are in UTF-8; the output is converted to the output encoding. Use pool for temporary allocation.

Since:
New in 1.1.

svn_error_t* svn_cmdline_fputs const char *  string,
FILE *  stream,
apr_pool_t *  pool
 

Output the string to the stdio stream, converting from UTF-8 to the output encoding.

Use pool for temporary allocation.

Since:
New in 1.1.

int svn_cmdline_handle_exit_error svn_error_t error,
apr_pool_t *  pool,
const char *  prefix
 

Handle error in preparation for immediate exit from a command-line client.

Specifically:

Call svn_handle_error2(error, stderr, FALSE, prefix), clear error, destroy pool iff it is non-NULL, and return EXIT_FAILURE.

Since:
New in 1.3.

int svn_cmdline_init const char *  progname,
FILE *  error_stream
 

Set up the locale for character conversion, and initialize APR.

If error_stream is non-null, print error messages to the stream, using progname as the program name. Return EXIT_SUCCESS if successful, otherwise EXIT_FAILURE.

Note:
This function should be called exactly once at program startup, before calling any other APR or Subversion functions.

const char* svn_cmdline_output_encoding apr_pool_t *  pool  ) 
 

Return the name of the output encoding allocated in pool, or APR_LOCALE_CHARSET if the output encoding is the same as the locale encoding.

Since:
New in 1.3.

svn_error_t* svn_cmdline_printf apr_pool_t *  pool,
const char *  fmt,
  ...
 

Write to stdout, using a printf-like format string fmt, passed through apr_pvsprintf().

All string arguments are in UTF-8; the output is converted to the output encoding. Use pool for temporary allocation.

Since:
New in 1.1.


Generated on Sun Mar 19 11:05:32 2006 for Subversion by  doxygen 1.4.4