Main Page   Modules   Data Structures   File List   Data Fields  

svn_cmdline.h

00001 /**
00002  * @copyright
00003  * ====================================================================
00004  * Copyright (c) 2000-2004 CollabNet.  All rights reserved.
00005  *
00006  * This software is licensed as described in the file COPYING, which
00007  * you should have received as part of this distribution.  The terms
00008  * are also available at http://subversion.tigris.org/license-1.html.
00009  * If newer versions of this license are posted there, you may use a
00010  * newer version instead, at your option.
00011  *
00012  * This software consists of voluntary contributions made by many
00013  * individuals.  For exact contribution history, see the revision
00014  * history and logs, available at http://subversion.tigris.org/.
00015  * ====================================================================
00016  * @endcopyright
00017  *
00018  * @file svn_cmdline.h
00019  * @brief Support functions for command line programs
00020  */
00021 
00022 
00023 
00024 
00025 #ifndef SVN_CMDLINE_H
00026 #define SVN_CMDLINE_H
00027 
00028 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00029 #define APR_WANT_STDIO
00030 #endif
00031 #include <apr_want.h>
00032 
00033 #include "svn_utf.h"
00034 
00035 #ifdef __cplusplus
00036 extern "C" {
00037 #endif /* __cplusplus */
00038 
00039 
00040 /** Set up the locale for character conversion, and initialize APR.
00041  * If @a error_stream is non-null, print error messages to the stream,
00042  * using @a progname as the program name. Return @c EXIT_SUCCESS if
00043  * successful, otherwise @c EXIT_FAILURE.
00044  *
00045  * @note This function should be called exactly once at program startup,
00046  *       before calling any other APR or Subversion functions.
00047  */
00048 int svn_cmdline_init (const char *progname, FILE *error_stream);
00049 
00050 
00051 /** Set @a *dest to an output-encoded C string from UTF-8 C string @a
00052  * src; allocate @a *dest in @a pool.
00053  */
00054 svn_error_t *svn_cmdline_cstring_from_utf8 (const char **dest,
00055                                             const char *src,
00056                                             apr_pool_t *pool);
00057 
00058 /** Like svn_utf_cstring_from_utf8_fuzzy, but converts to an
00059     output-encoded C string. */
00060 const char *svn_cmdline_cstring_from_utf8_fuzzy (const char *src,
00061                                                  apr_pool_t *pool);
00062 
00063 /** Set @a *dest to a UTF-8-encoded C string from input-encoded C
00064  * string @a src; allocate @a *dest in @a pool.
00065  */
00066 svn_error_t * svn_cmdline_cstring_to_utf8 (const char **dest,
00067                                            const char *src,
00068                                            apr_pool_t *pool);
00069 
00070 /** Set @a *dest to an output-encoded natively-formatted path string
00071  * from canonical path @a src; allocate @a *dest in @a pool.
00072  */
00073 svn_error_t *svn_cmdline_path_local_style_from_utf8 (const char **dest,
00074                                                      const char *src,
00075                                                      apr_pool_t *pool);
00076 
00077 #ifdef __cplusplus
00078 }
00079 #endif /* __cplusplus */
00080 
00081 #endif /* SVN_POOLS_H */

Generated on Tue Oct 19 09:49:47 2004 for Subversion by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002