[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[svnpatch-diff branch] Questions about new public functions in svn_wc.h

From: Arfrever Frehtes Taifersar Arahesis <Arfrever.FTA_at_GMail.Com>
Date: Mon, 16 Feb 2009 23:58:28 +0100

Hello Charles Acknin,

svn_wc.h on svnpatch-diff branch contains some new public functions:

========================================================================

    /**
     *
     * @defgroup svn_wc_svnpatch svnpatch related functions
     *
     * @{
     *
     */
    
    /* Output -- Writing */
    
    /* Append @a number into @a target stream. */
    svn_error_t *
    svn_wc_write_number(svn_stream_t *target,
                        apr_pool_t *pool,
                        const apr_uint64_t number);
    
    /* Append @a str into @a target stream. Is binary-able. */
    svn_error_t *
    svn_wc_write_string(svn_stream_t *target,
                        apr_pool_t *pool,
                        const svn_string_t *str);
    
    /* Append @a s cstring into @a target stream. */
    svn_error_t *
    svn_wc_write_cstring(svn_stream_t *target,
                         apr_pool_t *pool,
                         const char *s);
    
    /* Append @a word into @a target stream. */
    svn_error_t *
    svn_wc_write_word(svn_stream_t *target,
                      apr_pool_t *pool,
                      const char *word);
    
    /* Append a list of properties @a props into @a target. */
    svn_error_t *
    svn_wc_write_proplist(svn_stream_t *target,
                          apr_hash_t *props,
                          apr_pool_t *pool);
    
    /* Begin a list, appended into @target */
    svn_error_t *
    svn_wc_start_list(svn_stream_t *target);
    
    /* End a list, appended into @target */
    svn_error_t *
    svn_wc_end_list(svn_stream_t *target);
    
    /* Append a tuple into @target in a printf-like fashion.
     * @see svn_ra_svn_write_tuple() for further details with the format. */
    svn_error_t *
    svn_wc_write_tuple(svn_stream_t *target,
                       apr_pool_t *pool,
                       const char *fmt, ...);
    
    /* Append a command into @target, using the same format notation as
     * svn_wc_write_tuple(). */
    svn_error_t *
    svn_wc_write_cmd(svn_stream_t *target,
                     apr_pool_t *pool,
                     const char *cmdname,
                     const char *fmt, ...);
    
    /* Input -- Reading */
    
    svn_error_t *
    svn_wc_read_item(svn_stream_t *from,
                     apr_pool_t *pool,
                     svn_ra_svn_item_t **item);
    
    svn_error_t *
    svn_wc_parse_tuple(apr_array_header_t *list,
                       apr_pool_t *pool,
                       const char *fmt, ...);
    
    svn_error_t *
    svn_wc_read_tuple(svn_stream_t *from,
                      apr_pool_t *pool,
                      const char *fmt, ...);
    
    /* Drive @a diff_editor against @a decoded_patch_file's clear-text
     * Editor Commands. */
    svn_error_t *
    svn_wc_apply_svnpatch(apr_file_t *decoded_patch_file,
                          const svn_delta_editor_t *diff_editor,
                          void *diff_edit_baton,
                          apr_pool_t *pool);
    
    /* Run an external patch program against @a patch_path patch file. @a
     * outfile and @a errfile are respectively connected to the external
     * program's stdout and stderr pipes when executed. @a config is looked
     * up for the SVN_CONFIG_OPTION_PATCH_CMD entry to use as the patch
     * program. If missing or @a config is @c NULL, the function tries to
     * execute 'patch' literally, which should work on most *NIX systems at
     * least. This involves searching into $PATH. The external program is
     * given the patch file via its stdin pipe.
     *
     * The program is passed the '--force' argument when @a force is set.
     */
    svn_error_t *
    svn_wc_apply_unidiff(const char *patch_path,
                         svn_boolean_t force,
                         apr_file_t *outfile,
                         apr_file_t *errfile,
                         apr_hash_t *config,
                         apr_pool_t *pool);
    
    /** @} end group: svnpatch related functions */

========================================================================

I have some questions and suggestions:

  - Are all these functions specific to libsvn_wc?
    (If not, then they could be in libsvn_subr.)

  - If these functions are specific to svnpatch, then their names should
    contain "svnpatch", e.g. svn_wc_svnpatch_write_number().

  - Do these functions have to be public?

  - svn_wc_write_proplist() isn't used anywhere. Is this function needed?

  - svn_wc_read_item(), svn_wc_parse_tuple() and svn_wc_read_tuple()
    should have doc strings.

  - Could you improve doc strings of these functions? (e.g. add purpose
    of every function etc.)

-- 
Arfrever Frehtes Taifersar Arahesis

Received on 2009-02-17 00:00:14 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.