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

[PATCH]: Add bindings for SVN/APR time functions

From: Daniel Berlin <dan_at_dberlin.org>
Date: 2002-02-05 19:54:10 CET

Unfortunately (somewhat), we need to generate bindings for svn_time.h and
apr_time.h, because to set the proper date on imported revisions, we have
to use apr_ansi_time_to_apr_time, then svn_time_to_nts.

This ugly conversion looks like:
   newdate = _util.svn_time_to_nts(_util.apr_ansi_time_to_apr_time(time)[1], pool)
Yum.

Next, i'll see about not using svn_stringbuf everywhere.

 2002-02-05 Daniel Berlin <dan@dberlin.org>

        * util.i: Generate bindings for svn_time and apr_time, we need
        them for date support in cvs2svn.py.

        * apr.i : Add a time_t definition, so we don't need to include
        time.h.
        (long long typemaps): Change long long to apr_time_t, since SWIG will support
        long long soon, and we really only want to do this stuff for
        apr_time_t anyway.
        

Index: ./apr.i
===================================================================
--- ./apr.i
+++ ./apr.i Tue Feb 5 13:47:17 2002
@@ -43,25 +43,25 @@
 
 /* Define the time type (rather than picking up all of apr_time.h) */
 typedef apr_int64_t apr_time_t;
-
+typedef apr_int32_t time_t;
 /* -----------------------------------------------------------------------
- handle long long values so that apr_time_t works well
-*/
+ Don't generalize these to long long. SWIG is scheduled to have
+ long long support RSN, and we don't want to tangle the two. */
 
-%typemap(python,in) long long {
+%typemap(python,in) apr_time_t {
     $1 = PyLong_AsLongLong($input);
 }
 
-/* 'long long *' will always be an OUTPUT parameter */
-%typemap(ignore) long long * (long long temp) {
+/* 'apr_time_t *' will always be an OUTPUT parameter */
+%typemap(ignore) apr_time_t * (apr_time_t temp) {
     $1 = &temp;
 }
-%typemap(python,argout) long long * {
+%typemap(python,argout) apr_time_t * {
     $result = t_output_helper($result, PyLong_FromLongLong(*$1));
 }
 
 /* deal with return a return value */
-%typemap(python,out) long long {
+%typemap(python,out) apr_time_t {
     $result = t_output_helper($result, PyLong_FromLongLong($1));
 }
 
Index: ./util.i
===================================================================
--- ./util.i
+++ ./util.i Tue Feb 5 13:41:17 2002
@@ -121,6 +121,8 @@
 %include svn_io.h
 %include svn_pools.h
 %include svn_version.h
+%include svn_time.h
+%include apr_time.h
 %{
 #include <apr.h>
 #include <apr_general.h>
@@ -128,4 +130,5 @@
 #include "svn_pools.h"
 #include "svn_version.h"
 #include "swigutil.h"
+#include "svn_time.h"
 %}

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:37:04 2006

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.