GME  13
svn_cmdline.h
Go to the documentation of this file.
00001 
00028 
00029 
00030 #ifndef SVN_CMDLINE_H
00031 #define SVN_CMDLINE_H
00032 
00033 #include <apr_pools.h>
00034 #include <apr_getopt.h>
00035 
00036 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00037 #define APR_WANT_STDIO
00038 #endif
00039 #include <apr_want.h>
00040 
00041 #include "svn_types.h"
00042 #include "svn_auth.h"
00043 #include "svn_config.h"
00044 
00045 #ifdef __cplusplus
00046 extern "C" {
00047 #endif /* __cplusplus */
00048 
00049 
00059 int
00060 svn_cmdline_init(const char *progname,
00061                  FILE *error_stream);
00062 
00063 
00067 svn_error_t *
00068 svn_cmdline_cstring_from_utf8(const char **dest,
00069                               const char *src,
00070                               apr_pool_t *pool);
00071 
00074 const char *
00075 svn_cmdline_cstring_from_utf8_fuzzy(const char *src,
00076                                     apr_pool_t *pool);
00077 
00081 svn_error_t *
00082 svn_cmdline_cstring_to_utf8(const char **dest,
00083                             const char *src,
00084                             apr_pool_t *pool);
00085 
00089 svn_error_t *
00090 svn_cmdline_path_local_style_from_utf8(const char **dest,
00091                                        const char *src,
00092                                        apr_pool_t *pool);
00093 
00101 svn_error_t *
00102 svn_cmdline_printf(apr_pool_t *pool,
00103                    const char *fmt,
00104                    ...)
00105        __attribute__((format(printf, 2, 3)));
00106 
00114 svn_error_t *
00115 svn_cmdline_fprintf(FILE *stream,
00116                     apr_pool_t *pool,
00117                     const char *fmt,
00118                     ...)
00119        __attribute__((format(printf, 3, 4)));
00120 
00126 svn_error_t *
00127 svn_cmdline_fputs(const char *string,
00128                   FILE *stream,
00129                   apr_pool_t *pool);
00130 
00137 svn_error_t *
00138 svn_cmdline_fflush(FILE *stream);
00139 
00146 const char *
00147 svn_cmdline_output_encoding(apr_pool_t *pool);
00148 
00157 int
00158 svn_cmdline_handle_exit_error(svn_error_t *error,
00159                               apr_pool_t *pool,
00160                               const char *prefix);
00161 
00168 typedef struct svn_cmdline_prompt_baton2_t {
00169   svn_cancel_func_t cancel_func;
00170   void *cancel_baton;
00171   const char *config_dir;
00172 } svn_cmdline_prompt_baton2_t;
00173 
00180 typedef struct svn_cmdline_prompt_baton_t {
00181   svn_cancel_func_t cancel_func;
00182   void *cancel_baton;
00183 } svn_cmdline_prompt_baton_t;
00184 
00191 svn_error_t *
00192 svn_cmdline_prompt_user2(const char **result,
00193                          const char *prompt_str,
00194                          svn_cmdline_prompt_baton_t *baton,
00195                          apr_pool_t *pool);
00196 
00202 SVN_DEPRECATED
00203 svn_error_t *
00204 svn_cmdline_prompt_user(const char **result,
00205                         const char *prompt_str,
00206                         apr_pool_t *pool);
00207 
00215 svn_error_t *
00216 svn_cmdline_auth_simple_prompt(svn_auth_cred_simple_t **cred_p,
00217                                void *baton,
00218                                const char *realm,
00219                                const char *username,
00220                                svn_boolean_t may_save,
00221                                apr_pool_t *pool);
00222 
00223 
00231 svn_error_t *
00232 svn_cmdline_auth_username_prompt(svn_auth_cred_username_t **cred_p,
00233                                  void *baton,
00234                                  const char *realm,
00235                                  svn_boolean_t may_save,
00236                                  apr_pool_t *pool);
00237 
00238 
00246 svn_error_t *
00247 svn_cmdline_auth_ssl_server_trust_prompt(
00248   svn_auth_cred_ssl_server_trust_t **cred_p,
00249   void *baton,
00250   const char *realm,
00251   apr_uint32_t failures,
00252   const svn_auth_ssl_server_cert_info_t *cert_info,
00253   svn_boolean_t may_save,
00254   apr_pool_t *pool);
00255 
00256 
00267 svn_error_t *
00268 svn_cmdline_auth_ssl_client_cert_prompt(
00269   svn_auth_cred_ssl_client_cert_t **cred_p,
00270   void *baton,
00271   const char *realm,
00272   svn_boolean_t may_save,
00273   apr_pool_t *pool);
00274 
00275 
00283 svn_error_t *
00284 svn_cmdline_auth_ssl_client_cert_pw_prompt(
00285   svn_auth_cred_ssl_client_cert_pw_t **cred_p,
00286   void *baton,
00287   const char *realm,
00288   svn_boolean_t may_save,
00289   apr_pool_t *pool);
00290 
00298 svn_error_t *
00299 svn_cmdline_auth_plaintext_prompt(svn_boolean_t *may_save_plaintext,
00300                                   const char *realmstring,
00301                                   void *baton,
00302                                   apr_pool_t *pool);
00303 
00311 svn_error_t *
00312 svn_cmdline_auth_plaintext_passphrase_prompt(svn_boolean_t *may_save_plaintext,
00313                                              const char *realmstring,
00314                                              void *baton,
00315                                              apr_pool_t *pool);
00316 
00317 
00334 svn_error_t *
00335 svn_cmdline_create_auth_baton(svn_auth_baton_t **ab,
00336                               svn_boolean_t non_interactive,
00337                               const char *username,
00338                               const char *password,
00339                               const char *config_dir,
00340                               svn_boolean_t no_auth_cache,
00341                               svn_boolean_t trust_server_cert,
00342                               svn_config_t *cfg,
00343                               svn_cancel_func_t cancel_func,
00344                               void *cancel_baton,
00345                               apr_pool_t *pool);
00346 
00359 SVN_DEPRECATED
00360 svn_error_t *
00361 svn_cmdline_setup_auth_baton(svn_auth_baton_t **ab,
00362                              svn_boolean_t non_interactive,
00363                              const char *username,
00364                              const char *password,
00365                              const char *config_dir,
00366                              svn_boolean_t no_auth_cache,
00367                              svn_config_t *cfg,
00368                              svn_cancel_func_t cancel_func,
00369                              void *cancel_baton,
00370                              apr_pool_t *pool);
00371 
00372 #ifdef __cplusplus
00373 }
00374 #endif /* __cplusplus */
00375 
00376 #endif /* SVN_CMDLINE_H */