New in 1.1. */ svn_error_t * svn_cmdline_fputs(const char *string, FILE *stream, apr_pool_t *pool); /** Flush output buffers of the stdio @a 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_fflush(FILE *stream); /** Return the name of the output encoding allocated in @a pool, or @c * APR_LOCALE_CHARSET if the output encoding is the same as the locale * encoding. * * @since New in 1.3. */ const char * svn_cmdline_output_encoding(apr_pool_t *pool); /** Handle @a error in preparation for immediate exit from a * command-line client. Specifically: * * Call svn_handle_error2(@a error, stderr, FALSE, @a prefix), clear * @a error, destroy @a pool iff it is non-NULL, and return EXIT_FAILURE. * * @since New in 1.3. */ int svn_cmdline_handle_exit_error(svn_error_t *error, apr_pool_t *pool, const char *prefix); /** A prompt function/baton pair, and the path to the configuration * directory. To be passed as the baton argument to the * @c svn_cmdline_*_prompt functions. * * @since New in 1.6. */ typedef struct svn_cmdline_prompt_baton2_t { svn_cancel_func_t cancel_func; void *cancel_baton; const char *config_dir; } svn_cmdline_prompt_baton2_t; /** Like svn_cmdline_prompt_baton2_t, but without the path to the * configuration directory. * * @since New in 1.4. * @deprecated Provided for backward compatibility with the 1.5 API. */ typedef struct svn_cmdline_prompt_baton_t { svn_cancel_func_t cancel_func; void *cancel_baton; } svn_cmdline_prompt_baton_t; /** Prompt the user for input, using @a prompt_str for the prompt and * @a baton (which may be @c NULL) for cancellation, and returning the * user's response in @a result, allocated in @a pool. * * @since New in 1.5. */ svn_error_t * svn_cmdline_prompt_user2(const char **result, const char *prompt_str, svn_cmdline_prompt_baton_t *baton, apr_pool_t *pool); /** Similar to svn_cmdline_prompt_user2, but without cancellation * support. * * @deprecated Provided for backward compatibility with the 1.4 API. */ SVN_DEPRECATED svn_error_t * svn_cmdline_prompt_user(const char **result, const char *prompt_str, apr_pool_t *pool); /** An implementation of @c svn_auth_simple_prompt_func_t that prompts * the user for keyboard input on the command line. * * @since New in 1.4. * * Expects a @c svn_cmdline_prompt_baton_t to be passed as @a baton. */ svn_error_t * svn_cmdline_auth_simple_prompt(svn_auth_cred_simple_t **cred_p, void *baton, const char *realm, const char *username, svn_boolean_t may_save, apr_pool_t *pool); /** An implementation of @c svn_auth_username_prompt_func_t that prompts * the user for their username via the command line. * * @since New in 1.4. * * Expects a @c svn_cmdline_prompt_baton_t to be passed as @a baton. */ svn_error_t * svn_cmdline_auth_username_prompt(svn_auth_cred_username_t **cred_p, void *baton, const char *realm, svn_boolean_t may_save, apr_pool_t *pool); /** An implementation of @c svn_auth_ssl_server_trust_prompt_func_t that * asks the user if they trust a specific ssl server via the command line. * * @since New in 1.4. * * Expects a @c svn_cmdline_prompt_baton_t to be passed as @a baton. */ svn_error_t * svn_cmdline_auth_ssl_server_trust_prompt( svn_auth_cred_ssl_server_trust_t **cred_p, void *baton, const char *realm, apr_uint32_t failures, const svn_auth_ssl_server_cert_info_t *cert_info, svn_boolean_t may_save, apr_pool_t *pool); /** An implementation of @c svn_auth_ssl_client_cert_prompt_func_t that * prompts the user for the filename of their SSL client certificate via * the command line. * * Records absolute path of the SSL client certificate file. * * @since New in 1.4. * * Expects a @c svn_cmdline_prompt_baton_t to be passed as @a baton. */ svn_error_t * svn_cmdline_auth_ssl_client_cert_prompt( svn_auth_cred_ssl_client_cert_t **cred_p, void *baton, const char *realm, svn_boolean_t may_save, apr_pool_t *pool); /** An implementation of @c svn_auth_ssl_client_cert_pw_prompt_func_t that * prompts the user for their SSL certificate password via the command line. * * @since New in 1.4. * * Expects a @c svn_cmdline_prompt_baton_t to be passed as @a baton. */ svn_error_t * svn_cmdline_auth_ssl_client_cert_pw_prompt( svn_auth_cred_ssl_client_cert_pw_t **cred_p, void *baton, const char *realm, svn_boolean_t may_save, apr_pool_t *pool); /** An implementation of @c svn_auth_plaintext_prompt_func_t that * prompts the user whether storing unencrypted passwords to disk is OK. * * Expects a @c svn_cmdline_prompt_baton2_t to be passed as @a baton. * * @since New in 1.6. */ svn_error_t * svn_cmdline_auth_plaintext_prompt(svn_boolean_t *may_save_plaintext, const char *realmstring, void *baton, apr_pool_t *pool); /** An implementation of @c svn_auth_plaintext_passphrase_prompt_func_t that * prompts the user whether storing unencrypted passphrase to disk is OK. * * Expects a @c svn_cmdline_prompt_baton2_t to be passed as @a baton. * * @since New in 1.6. */ svn_error_t * svn_cmdline_auth_plaintext_passphrase_prompt(svn_boolean_t *may_save_plaintext, const char *realmstring, void *baton, apr_pool_t *pool); /** Set @a *ab to an authentication baton allocated from @a pool and * initialized with the standard set of authentication providers used * by the command line client. * * @a non_interactive, @a username, @a password, @a config_dir, * and @a no_auth_cache are the values of the command line options * of the corresponding names. * * If @a non_interactive is @c TRUE, then the following parameters * control whether an invalid SSL certificate will be accepted * regardless of a specific verification failure: * * @a trust_server_cert_unknown_ca: If @c TRUE, accept certificates * from unknown certificate authorities. * * @a trust_server_cert_cn_mismatch: If @c TRUE, accept certificates * even if the Common Name attribute of the certificate differs from * the hostname of the server. * * @a trust_server_cert_expired: If @c TRUE, accept certificates even * if they are expired. * * @a trust_server_cert_not_yet_valid: If @c TRUE, accept certificates * from the future. * * @a trust_server_cert_other_failure: If @c TRUE, accept certificates * even if any other verification failure than the above occured. * * @a cfg is the @c SVN_CONFIG_CATEGORY_CONFIG configuration, and * @a cancel_func and @a cancel_baton control the cancellation of the * prompting providers that are initialized. * * Use @a pool for all allocations. * * @since New in 1.9. */ svn_error_t * svn_cmdline_create_auth_baton2(svn_auth_baton_t **ab, svn_boolean_t non_interactive, const char *username, const char *password, const char *config_dir, svn_boolean_t no_auth_cache, svn_boolean_t trust_server_cert_unknown_ca, svn_boolean_t trust_server_cert_cn_mismatch, svn_boolean_t trust_server_cert_expired, svn_boolean_t trust_server_cert_not_yet_valid, svn_boolean_t trust_server_cert_other_failure, svn_config_t *cfg, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool); /* Like svn_cmdline_create_auth_baton2, but with only one trust_server_cert * option which corresponds to trust_server_cert_unknown_ca. * * @deprecated Provided for backward compatibility with the 1.8 API. * @since New in 1.6. */ SVN_DEPRECATED svn_error_t * svn_cmdline_create_auth_baton(svn_auth_baton_t **ab, svn_boolean_t non_interactive, const char *username, const char *password, const char *config_dir, svn_boolean_t no_auth_cache, svn_boolean_t trust_server_cert, svn_config_t *cfg, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool); /** Similar to svn_cmdline_create_auth_baton(), but with * @a trust_server_cert always set to false. * * @since New in 1.4. * @deprecated Provided for backward compatibility with the 1.5 API. * Use svn_cmdline_create_auth_baton() instead. * * @note This deprecation does not follow the usual pattern of putting * a new number on end of the function's name. Instead, the new * function name is distinguished from the old by a grammatical * improvement: the verb "create" instead of the noun "setup". */ SVN_DEPRECATED svn_error_t * svn_cmdline_setup_auth_baton(svn_auth_baton_t **ab, svn_boolean_t non_interactive, const char *username, const char *password, const char *config_dir, svn_boolean_t no_auth_cache, svn_config_t *cfg, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* SVN_CMDLINE_H */