Changeset 2498 in project


Ignore:
Timestamp:
11/25/06 22:50:47 (15 years ago)
Author:
azul
Message:

Export svn_client_info.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • svn-client/trunk/svn-client.scm

    r2482 r2498  
    1616
    1717static svn_opt_revision_t revision_head;
     18static svn_opt_revision_t revision_unspecified;
    1819
    1920char *svnwiki_user, *svnwiki_pass;
     
    146147
    147148  revision_head.kind = svn_opt_revision_head;
     149  revision_unspecified.kind = svn_opt_revision_unspecified;
    148150
    149151  return(NULL);
     
    151153))
    152154
    153 ;;;
     155;;; Info
     156
     157(define-record svn-info ptr)
     158
     159;(define (make-svn-info-with-finalizer x)
     160;  (set-finalizer! x (foreign-lambda void "free" (pointer "svn_info_t")))
     161;  (make-svn-info x))
     162
     163(define-foreign-type
     164  svn-info-type
     165  (pointer "svn_info_t")
     166  svn-info-ptr
     167  ;make-svn-info-with-finalizer)
     168  make-svn-info)
     169
     170(define svn-info-url
     171  (foreign-lambda* c-string ((svn-info-type info))
     172#<<EOF
     173  return(info->URL);
     174EOF
     175))
     176
     177(define svn-info-repos-root-url
     178  (foreign-lambda* c-string ((svn-info-type info))
     179#<<EOF
     180  return(info->repos_root_URL);
     181EOF
     182))
     183
     184(define svn-info-rev
     185  (foreign-lambda* long ((svn-info-type info))
     186#<<EOF
     187  return(info->rev);
     188EOF
     189))
    154190
    155191;;; Revisions
     
    182218(define svn-opt-revision-head
    183219  (make-svn-opt-revision (foreign-value "&revision_head" (pointer "svn_opt_revision_t"))))
     220
     221(define svn-opt-revision-unspecified
     222  (make-svn-opt-revision (foreign-value "&revision_unspecified" (pointer "svn_opt_revision_t"))))
    184223
    185224(define svn-opt-revision-number
     
    629668EOF
    630669))
     670
     671(define svn-client-info
     672  (foreign-safe-lambda* void ((c-string path_or_url) (svn-opt-revision-type peg_revision) (svn-opt-revision-type revision) (scheme-object receiver) (bool recurse) (c-string user) (c-string pass))
     673#<<EOF
     674  void *receiverroot;
     675
     676  apr_hash_t *props;
     677  apr_pool_t *pool;
     678  svn_opt_revision_t head;
     679  apr_hash_index_t *tmp;
     680  svn_error_t *err;
     681
     682  svnwiki_user = user;
     683  svnwiki_pass = pass;
     684
     685  pool = svn_pool_create(NULL);
     686
     687  receiverroot = CHICKEN_new_gc_root();
     688
     689  CHICKEN_gc_root_set(receiverroot, receiver);
     690
     691  fprintf(stderr, "peg: %d\nrev: %d\n", peg_revision->kind, revision->kind);
     692  err = svn_client_info(path_or_url, peg_revision, revision, svn_client_info_receiver, receiverroot, recurse, svn_ctx, pool);
     693  if (err)
     694    {
     695      svn_handle_error(err, stderr, FALSE);
     696      return(C_SCHEME_FALSE);
     697    }
     698
     699  apr_pool_destroy(pool);
     700
     701  CHICKEN_delete_gc_root(receiverroot);
     702
     703  return(C_SCHEME_TRUE);
     704EOF
     705))
     706
     707(define-external (svn_client_info_receiver ((pointer void) baton) (c-string path) (svn-info-type info) (apr-pool-type pool)) svn-error-type
     708  ((gc-root-ref baton) path info)
     709  svn-no-error)
Note: See TracChangeset for help on using the changeset viewer.