2 * delta.h: private delta library things
4 * ====================================================================
5 * Licensed to the Apache Software Foundation (ASF) under one
6 * or more contributor license agreements. See the NOTICE file
7 * distributed with this work for additional information
8 * regarding copyright ownership. The ASF licenses this file
9 * to you under the Apache License, Version 2.0 (the
10 * "License"); you may not use this file except in compliance
11 * with the License. You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing,
16 * software distributed under the License is distributed on an
17 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18 * KIND, either express or implied. See the License for the
19 * specific language governing permissions and limitations
21 * ====================================================================
24 /* ==================================================================== */
27 #include <apr_pools.h>
30 #include "svn_delta.h"
32 #ifndef SVN_LIBSVN_DELTA_H
33 #define SVN_LIBSVN_DELTA_H
38 #endif /* __cplusplus */
41 /* Private interface for text deltas. */
43 /* The standard size of one svndiff window. */
45 #define SVN_DELTA_WINDOW_SIZE 102400
48 /* Context/baton for building an operation sequence. */
50 typedef struct svn_txdelta__ops_baton_t {
51 int num_ops; /* current number of ops */
52 int src_ops; /* current number of source copy ops */
53 int ops_size; /* number of ops allocated */
54 svn_txdelta_op_t *ops; /* the operations */
56 svn_stringbuf_t *new_data; /* any new data used by the operations */
57 } svn_txdelta__ops_baton_t;
60 /* Insert a delta op into the delta window being built via BUILD_BATON. If
61 OPCODE is svn_delta_new, bytes from NEW_DATA are copied into the window
62 data and OFFSET is ignored. Otherwise NEW_DATA is ignored. All
63 allocations are performed in POOL. */
64 void svn_txdelta__insert_op(svn_txdelta__ops_baton_t *build_baton,
65 enum svn_delta_action opcode,
71 /* Remove / truncate the last delta ops spanning the last MAX_LEN bytes
72 from the delta window being built via BUILD_BATON starting. Return the
73 number of bytes that were actually removed. */
75 svn_txdelta__remove_copy(svn_txdelta__ops_baton_t *build_baton,
78 /* Allocate a delta window from POOL. */
79 svn_txdelta_window_t *
80 svn_txdelta__make_window(const svn_txdelta__ops_baton_t *build_baton,
84 /* Create xdelta window data. Allocate temporary data from POOL. */
85 void svn_txdelta__xdelta(svn_txdelta__ops_baton_t *build_baton,
87 apr_size_t source_len,
88 apr_size_t target_len,
94 #endif /* __cplusplus */
96 #endif /* SVN_LIBSVN_DELTA_H */