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

RE: SVN Protocol

From: Ramprasad Venkata Inala <rinala_at_cordys.com>
Date: 2005-07-05 13:19:37 CEST


The below is the code for the same

#include <ctype.h>
#include <stdio.h>
#include <string.h>

#include <apr_general.h>
#include <apr_getopt.h>
#include <apr_file_io.h>

#include "svn_base64.h"
#include "svn_quoprint.h"
#include "svn_pools.h"
#include "svn_delta.h"
#include "svn_error.h"
#include "svn_ra.h"
#include "svn_string.h"

#include <jni.h>
#include "svnserver_SVNSession.h"

Java_svnserver_SVNSession_displayHelloWorld( JNIEnv *env, jobject obj,
jstring data_str )

          svn_stream_t *stdout_stream;
          svn_txdelta_stream_t *txdelta_stream;
          svn_txdelta_window_handler_t svndiff_handler;
          svn_string_t *encoder;
          svn_stringbuf_t * src_buf;
          svn_stringbuf_t * tgt_buf;
          void *svndiff_baton;
          apr_pool_t *pool;

          pool = svn_pool_create (NULL);
          src_buf = svn_stringbuf_create( "h", pool );
          tgt_buf = svn_stringbuf_create( "", pool );

          svn_txdelta (&txdelta_stream,
               svn_stream_from_stringbuf( src_buf, pool ),
               svn_stream_from_stringbuf( tgt_buf, pool ),

          //err = svn_stream_for_stdout (&stdout_stream, pool);
// I am not sure what should be given here( above or the below statement
) as I should give a string back to // java program so that it can
convert it into bytes and send it the message // across.
          txdelta_stream = svn_stream_from_stringbuf( &src_buf,
          encoder = svn_base64_encode_string(
svn_string_create("h\0",pool), pool );
          printf("encoded data:: %s$\n",encoder->data);

          svn_txdelta_to_svndiff (encoder, pool, &svndiff_handler,

           err = svn_txdelta_send_txstream (txdelta_stream,
          return (*env)->NewStringUTF(env, encoder->data);
I am unable to return the exact string/byte that is required by the
Can you please tell me how to do it?

Thanks and regards

-----Original Message-----

The information in this message is confidential and may be legally
privileged. It is intended solely for the addressee. Access to this message
by anyone else is unauthorized. If you are not the intended recipient, any
disclosure, copying, or distribution of the message, or any action or
omission taken by you in reliance on it, is prohibited and may be unlawful.
Please immediately contact the sender if you have received this message in

From: Ben Collins-Sussman [mailto:sussman@collab.net]
Sent: Tuesday, June 28, 2005 7:36 PM
To: Ramprasad Venkata Inala
Cc: Max Bowsher; dev@subversion.tigris.org
Subject: Re: SVN Protocol

On Jun 28, 2005, at 12:23 AM, Ramprasad Venkata Inala wrote:

> I am making a mistake some where or my understanding is wrong. Please
> correct me and also provide exact sequence of bytes .

Why are you trying to re-implement the whole binary differencing
language? Why not just use the public API for encoding/decoding
binary differences as provided by the public API in svn_delta.h?
Wouldn't it be easier to make JNI calls to libsvn_delta, rather than
reimplement everything?

To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Jul 5 13:20:43 2005

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.