docurium 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ require 'rake/testtask'
2
+
3
+ task :default => :test
4
+
5
+ Rake::TestTask.new do |t|
6
+ t.libs << 'libs' << 'test'
7
+ t.pattern = 'test/**/*_test.rb'
8
+ end
data/lib/docurium.rb CHANGED
@@ -16,13 +16,17 @@ Rocco::Markdown = RedcarpetCompat
16
16
  class Docurium
17
17
  attr_accessor :branch, :output_dir, :data
18
18
 
19
- def initialize(config_file)
19
+ def initialize(config_file, repo = nil)
20
20
  raise "You need to specify a config file" if !config_file
21
21
  raise "You need to specify a valid config file" if !valid_config(config_file)
22
22
  @sigs = {}
23
23
  @groups = {}
24
- repo_path = Rugged::Repository.discover('.')
25
- @repo = Rugged::Repository.new(repo_path)
24
+ if repo
25
+ @repo = repo
26
+ else
27
+ repo_path = Rugged::Repository.discover('.')
28
+ @repo = Rugged::Repository.new(repo_path)
29
+ end
26
30
  clear_data
27
31
  end
28
32
 
@@ -376,10 +380,12 @@ class Docurium
376
380
  @data[:types][r[:name]] ||= {}
377
381
  wanted[:types].each do |k|
378
382
  next unless r.has_key? k
383
+ contents = r[k]
379
384
  if k == :comments
380
385
  contents = md.render r[k]
381
- else
382
- contents = r[k]
386
+ elsif k == :block
387
+ old_block = @data[:types][r[:name]][k]
388
+ contents = old_block ? [old_block, r[k]].join("\n") : r[k]
383
389
  end
384
390
  @data[:types][r[:name]][k] = contents
385
391
  end
data/lib/docurium/cli.rb CHANGED
@@ -14,7 +14,7 @@ temp = <<-TEMPLATE
14
14
  "github": "user/project",
15
15
  "input": "include/lib",
16
16
  "prefix": "lib_",
17
- "output": "docs"
17
+ "branch": "gh-pages"
18
18
  }
19
19
  TEMPLATE
20
20
  puts "Writing to #{file}"
@@ -1,3 +1,3 @@
1
1
  class Docurium
2
- Version = VERSION = '0.3.1'
2
+ Version = VERSION = '0.3.2'
3
3
  end
data/site/js/docurium.js CHANGED
@@ -634,7 +634,7 @@ $(function() {
634
634
  this.changelogView = new ChangelogView({model: this.doc})
635
635
  }
636
636
  this.doc.setVersion()
637
- this.mainView.setActive(this.ChangelogView)
637
+ this.mainView.setActive(this.changelogView)
638
638
  },
639
639
  });
640
640
 
@@ -2,5 +2,5 @@
2
2
  "name": "libgit2",
3
3
  "github": "libgit2/libgit2",
4
4
  "prefix": "git_",
5
- "output": "docs"
5
+ "branch": "gh-pages"
6
6
  }
@@ -44,7 +44,7 @@ GIT_BEGIN_DECL
44
44
  #define GIT_IDXENTRY_VALID (0x8000)
45
45
  #define GIT_IDXENTRY_STAGESHIFT 12
46
46
 
47
- /*
47
+ /**
48
48
  * Flags are divided into two parts: in-memory flags and
49
49
  * on-disk ones. Flags in GIT_IDXENTRY_EXTENDED_FLAGS
50
50
  * will get saved on-disk.
@@ -64,7 +64,7 @@ GIT_BEGIN_DECL
64
64
  #define GIT_IDXENTRY_UNPACKED (1 << 8)
65
65
  #define GIT_IDXENTRY_NEW_SKIP_WORKTREE (1 << 9)
66
66
 
67
- /*
67
+ /**
68
68
  * Extended on-disk flags:
69
69
  */
70
70
  #define GIT_IDXENTRY_INTENT_TO_ADD (1 << 13)
data/test/gen_test.rb ADDED
@@ -0,0 +1,18 @@
1
+ require 'minitest/autorun'
2
+ require 'docurium'
3
+ require 'docurium/cli'
4
+ require 'tempfile'
5
+
6
+ class GenTest < MiniTest::Unit::TestCase
7
+
8
+ # make sure we can read what we give the user
9
+ def test_read_generated_file
10
+ file = Tempfile.new 'docurium'
11
+ capture_io do
12
+ Docurium::CLI.gen(file.path)
13
+ end
14
+
15
+ Docurium.new file.path
16
+ end
17
+
18
+ end
@@ -0,0 +1,122 @@
1
+ require 'minitest/autorun'
2
+ require 'docurium'
3
+
4
+ class TestParser < Minitest::Unit::TestCase
5
+
6
+ def setup
7
+ @parser = Docurium::CParser.new
8
+ end
9
+
10
+ # e.g. parse('git2/refs.h')
11
+ def parse(path)
12
+ realpath = File.dirname(__FILE__) + '/fixtures/' + path
13
+
14
+ parser = Docurium::CParser.new
15
+ parser.parse_text(path, File.read(realpath))
16
+ end
17
+
18
+ def test_single_function
19
+ name = 'function.h'
20
+ contents = <<EOF
21
+ /**
22
+ * Do something
23
+ *
24
+ * More explanation of what we do
25
+ *
26
+ * @param string a sequence of characters
27
+ * @return an integer value
28
+ */
29
+ int some_function(char *string);
30
+ EOF
31
+
32
+ raw_comments = <<EOF
33
+ Do something
34
+
35
+ More explanation of what we do
36
+
37
+ @param string a sequence of characters
38
+ @return an integer value
39
+ EOF
40
+
41
+ actual = @parser.parse_text(name, contents)
42
+ expected = [{:file => "function.h",
43
+ :line => 9,
44
+ :body => 'int some_function(char *string);',
45
+ :rawComments => raw_comments.strip,
46
+ :type => :function,
47
+ :args => [{
48
+ :name => 'string',
49
+ :type => 'char *',
50
+ :comment => 'a sequence of characters'
51
+ }],
52
+ :return => {
53
+ :type => 'int',
54
+ :comment => 'an integer value'
55
+ },
56
+ :argline => 'char *string',
57
+ :sig => 'char *',
58
+ :description => 'Do something',
59
+ :lineto => 9,
60
+ :comments => "More explanation of what we do\n",
61
+ :decl => 'int some_function(char *string)',
62
+ :name => 'some_function'}]
63
+
64
+ assert_equal expected, actual
65
+ end
66
+
67
+ def test_single_multiline_function
68
+ name = 'function.h'
69
+ contents = <<EOF
70
+ /**
71
+ * Do something
72
+ *
73
+ * More explanation of what we do
74
+ *
75
+ * @param string a sequence of characters
76
+ * @return an integer value
77
+ */
78
+ int some_function(
79
+ char *string,
80
+ size_t len);
81
+ EOF
82
+
83
+ raw_comments = <<EOF
84
+ Do something
85
+
86
+ More explanation of what we do
87
+
88
+ @param string a sequence of characters
89
+ @return an integer value
90
+ EOF
91
+
92
+ actual = @parser.parse_text(name, contents)
93
+ expected = [{:file => "function.h",
94
+ :line => 9,
95
+ :decl => "int some_function(\n char *string,\n size_t len)",
96
+ :body => "int some_function(\n char *string,\n size_t len);",
97
+ :rawComments => raw_comments.strip,
98
+ :type => :function,
99
+ :args => [{
100
+ :name => 'string',
101
+ :type => 'char *',
102
+ :comment => 'a sequence of characters'
103
+ },
104
+ {
105
+ :name => 'len',
106
+ :type => 'size_t',
107
+ }],
108
+ :return => {
109
+ :type => 'int',
110
+ :comment => 'an integer value'
111
+ },
112
+ :argline => "char *string,\n size_t len",
113
+ :sig => 'char *::size_t',
114
+ :description => 'Do something',
115
+ :lineto => 11,
116
+ :comments => "More explanation of what we do\n",
117
+ :name => 'some_function'}]
118
+
119
+ assert_equal expected, actual
120
+ end
121
+
122
+ end
data/test/repo_test.rb CHANGED
@@ -1,52 +1,76 @@
1
- require File.expand_path "../test_helper", __FILE__
2
- require 'base64'
1
+ require 'minitest/autorun'
2
+ require 'docurium'
3
+ require 'rugged'
3
4
 
4
- context "Docurium Header Parsing" do
5
- setup do
6
- @path = File.dirname(__FILE__) + '/fixtures/git2/api.docurium'
7
- @doc = Docurium.new(@path)
8
- Dir.chdir(File.dirname(@path)) do
9
- @doc.parse_headers
5
+ class DocuriumTest < MiniTest::Unit::TestCase
6
+
7
+ def setup
8
+ @dir = Dir.mktmpdir()
9
+
10
+ @repo = Rugged::Repository.init_at(@dir, :bare)
11
+
12
+ config = <<END
13
+ {
14
+ "name": "libgit2",
15
+ "github": "libgit2/libgit2",
16
+ "prefix": "git_",
17
+ "branch": "gh-pages"
18
+ }
19
+ END
20
+
21
+ # Create an index as we would have read from the user's repository
22
+ index = Rugged::Index.new
23
+ headers = File.dirname(__FILE__) + '/fixtures/git2/'
24
+ Dir.entries(headers).each do |rel_path|
25
+ path = File.join(headers, rel_path)
26
+ next if File.directory? path
27
+ id = @repo.write(File.read(path), :blob)
28
+ index.add(:path => rel_path, :oid => id, :mode => 0100644)
10
29
  end
30
+
31
+ @path = File.dirname(__FILE__) + '/fixtures/git2/api.docurium'
32
+ @doc = Docurium.new(@path, @repo)
33
+ @doc.parse_headers(index)
11
34
  @data = @doc.data
12
35
  end
13
36
 
14
- test "can parse header files" do
37
+ def teardown
38
+ FileUtils.remove_entry(@dir)
39
+ end
40
+
41
+ def test_can_parse_headers
15
42
  keys = @data.keys.map { |k| k.to_s }.sort
16
43
  assert_equal ['files', 'functions', 'globals', 'groups', 'prefix', 'types'], keys
17
- assert_equal 150, @data[:functions].size
44
+ assert_equal 153, @data[:functions].size
18
45
  end
19
46
 
20
- test "can extract globals" do
21
- assert_equal 55, @data[:globals].size
22
- entry = @data[:globals]['GIT_IDXENTRY_EXTENDED2']
23
- assert_equal "index.h", entry[:file]
24
- assert_equal 73, entry[:line]
47
+ def test_can_extract_enum_from_define
48
+ assert_equal 41, @data[:globals].size
49
+ idxentry = @data[:types].find { |a| a[0] == 'GIT_IDXENTRY' }
50
+ assert idxentry
51
+ assert_equal 75, idxentry[1][:lineto]
52
+ # this one is on the last doc block
53
+ assert idxentry[1][:block].include? 'GIT_IDXENTRY_EXTENDED2'
54
+ # from an earlier block, should not get overwritten
55
+ assert idxentry[1][:block].include? 'GIT_IDXENTRY_UPDATE'
25
56
  end
26
57
 
27
- test "can extract structs and enums" do
58
+ def test_can_extract_structs_and_enums
28
59
  assert_equal 25, @data[:types].size
29
60
  end
30
61
 
31
- test "can parse sequential sigs" do
32
- func = @data[:functions]['git_odb_backend_pack']
33
- assert_equal 'const char *', func[:args][1][:type]
34
- func = @data[:functions]['git_odb_backend_loose']
35
- assert_equal 'const char *', func[:args][1][:type]
36
- end
37
-
38
- test "can find type usage" do
62
+ def test_can_find_type_usage
39
63
  oid = @data[:types].assoc('git_oid')
40
64
  assert_equal 10, oid[1][:used][:returns].size
41
65
  assert_equal 39, oid[1][:used][:needs].size
42
66
  end
43
67
 
44
- test "can parse normal functions" do
68
+ def test_can_parse_normal_functions
45
69
  func = @data[:functions]['git_blob_rawcontent']
46
- assert_equal 'Get a read-only buffer with the raw content of a blob.', func[:description]
70
+ assert_equal "<p>Get a read-only buffer with the raw content of a blob.</p>\n", func[:description]
47
71
  assert_equal 'const void *', func[:return][:type]
48
72
  assert_equal 'the pointer; NULL if the blob has no contents', func[:return][:comment]
49
- assert_equal 73, func[:line]
73
+ assert_equal 84, func[:line]
50
74
  assert_equal 84, func[:lineto]
51
75
  assert_equal 'blob.h', func[:file]
52
76
  assert_equal 'git_blob *blob',func[:argline]
@@ -55,47 +79,44 @@ context "Docurium Header Parsing" do
55
79
  assert_equal 'pointer to the blob', func[:args][0][:comment]
56
80
  end
57
81
 
58
- test "can parse defined functions" do
82
+ def test_can_parse_defined_functions
59
83
  func = @data[:functions]['git_tree_lookup']
60
84
  assert_equal 'int', func[:return][:type]
61
85
  assert_equal '0 on success; error code otherwise', func[:return][:comment]
62
- assert_equal 42, func[:line]
86
+ assert_equal 50, func[:line]
63
87
  assert_equal 'tree.h', func[:file]
64
88
  assert_equal 'id', func[:args][2][:name]
65
89
  assert_equal 'const git_oid *', func[:args][2][:type]
66
90
  assert_equal 'identity of the tree to locate.', func[:args][2][:comment]
67
91
  end
68
92
 
69
- test "can parse function cast args" do
93
+ def test_can_parse_function_cast_args
70
94
  func = @data[:functions]['git_reference_listcb']
71
95
  assert_equal 'int', func[:return][:type]
72
96
  assert_equal '0 on success; error code otherwise', func[:return][:comment]
73
- assert_equal 301, func[:line]
97
+ assert_equal 321, func[:line]
74
98
  assert_equal 'refs.h', func[:file]
75
99
  assert_equal 'repo', func[:args][0][:name]
76
100
  assert_equal 'git_repository *', func[:args][0][:type]
77
101
  assert_equal 'list_flags', func[:args][1][:name]
78
102
  assert_equal 'unsigned int', func[:args][1][:type]
79
103
  assert_equal 'callback', func[:args][2][:name]
80
- assert_equal 'int(*)(const char *, void *)', func[:args][2][:type]
104
+ assert_equal 'int (*)(const char *, void *)', func[:args][2][:type]
81
105
  assert_equal 'Function which will be called for every listed ref', func[:args][2][:comment]
82
106
  assert_equal 8, func[:comments].split("\n").size
83
107
  end
84
108
 
85
- test "can get the full description from multi liners" do
109
+ def test_can_get_the_full_description_from_multi_liners
86
110
  func = @data[:functions]['git_commit_create_o']
87
- desc = "Create a new commit in the repository using `git_object` instances as parameters."
111
+ desc = "<p>Create a new commit in the repository using <code>git_object</code>\ninstances as parameters.</p>\n"
88
112
  assert_equal desc, func[:description]
89
113
  end
90
114
 
91
- test "can group functions" do
92
- assert_equal 15, @data[:groups].size
115
+ def test_can_group_functions
116
+ assert_equal 14, @data[:groups].size
93
117
  group, funcs = @data[:groups].first
94
118
  assert_equal 'blob', group
95
119
  assert_equal 6, funcs.size
96
120
  end
97
121
 
98
- test "can parse data structures" do
99
- end
100
-
101
122
  end
metadata CHANGED
@@ -1,7 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docurium
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Carlos Martín Nieto
@@ -9,11 +10,12 @@ authors:
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
- date: 2014-01-13 00:00:00.000000000 Z
13
+ date: 2014-02-22 00:00:00.000000000 Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: version_sorter
16
17
  requirement: !ruby/object:Gem::Requirement
18
+ none: false
17
19
  requirements:
18
20
  - - ~>
19
21
  - !ruby/object:Gem::Version
@@ -21,6 +23,7 @@ dependencies:
21
23
  type: :runtime
22
24
  prerelease: false
23
25
  version_requirements: !ruby/object:Gem::Requirement
26
+ none: false
24
27
  requirements:
25
28
  - - ~>
26
29
  - !ruby/object:Gem::Version
@@ -28,20 +31,23 @@ dependencies:
28
31
  - !ruby/object:Gem::Dependency
29
32
  name: mustache
30
33
  requirement: !ruby/object:Gem::Requirement
34
+ none: false
31
35
  requirements:
32
- - - '>='
36
+ - - ! '>='
33
37
  - !ruby/object:Gem::Version
34
38
  version: 0.99.4
35
39
  type: :runtime
36
40
  prerelease: false
37
41
  version_requirements: !ruby/object:Gem::Requirement
42
+ none: false
38
43
  requirements:
39
- - - '>='
44
+ - - ! '>='
40
45
  - !ruby/object:Gem::Version
41
46
  version: 0.99.4
42
47
  - !ruby/object:Gem::Dependency
43
48
  name: rocco
44
49
  requirement: !ruby/object:Gem::Requirement
50
+ none: false
45
51
  requirements:
46
52
  - - ~>
47
53
  - !ruby/object:Gem::Version
@@ -49,6 +55,7 @@ dependencies:
49
55
  type: :runtime
50
56
  prerelease: false
51
57
  version_requirements: !ruby/object:Gem::Requirement
58
+ none: false
52
59
  requirements:
53
60
  - - ~>
54
61
  - !ruby/object:Gem::Version
@@ -56,6 +63,7 @@ dependencies:
56
63
  - !ruby/object:Gem::Dependency
57
64
  name: gli
58
65
  requirement: !ruby/object:Gem::Requirement
66
+ none: false
59
67
  requirements:
60
68
  - - ~>
61
69
  - !ruby/object:Gem::Version
@@ -63,6 +71,7 @@ dependencies:
63
71
  type: :runtime
64
72
  prerelease: false
65
73
  version_requirements: !ruby/object:Gem::Requirement
74
+ none: false
66
75
  requirements:
67
76
  - - ~>
68
77
  - !ruby/object:Gem::Version
@@ -70,6 +79,7 @@ dependencies:
70
79
  - !ruby/object:Gem::Dependency
71
80
  name: rugged
72
81
  requirement: !ruby/object:Gem::Requirement
82
+ none: false
73
83
  requirements:
74
84
  - - ~>
75
85
  - !ruby/object:Gem::Version
@@ -77,6 +87,7 @@ dependencies:
77
87
  type: :runtime
78
88
  prerelease: false
79
89
  version_requirements: !ruby/object:Gem::Requirement
90
+ none: false
80
91
  requirements:
81
92
  - - ~>
82
93
  - !ruby/object:Gem::Version
@@ -84,6 +95,7 @@ dependencies:
84
95
  - !ruby/object:Gem::Dependency
85
96
  name: redcarpet
86
97
  requirement: !ruby/object:Gem::Requirement
98
+ none: false
87
99
  requirements:
88
100
  - - ~>
89
101
  - !ruby/object:Gem::Version
@@ -91,6 +103,7 @@ dependencies:
91
103
  type: :runtime
92
104
  prerelease: false
93
105
  version_requirements: !ruby/object:Gem::Requirement
106
+ none: false
94
107
  requirements:
95
108
  - - ~>
96
109
  - !ruby/object:Gem::Version
@@ -98,6 +111,7 @@ dependencies:
98
111
  - !ruby/object:Gem::Dependency
99
112
  name: bundler
100
113
  requirement: !ruby/object:Gem::Requirement
114
+ none: false
101
115
  requirements:
102
116
  - - ~>
103
117
  - !ruby/object:Gem::Version
@@ -105,6 +119,7 @@ dependencies:
105
119
  type: :development
106
120
  prerelease: false
107
121
  version_requirements: !ruby/object:Gem::Requirement
122
+ none: false
108
123
  requirements:
109
124
  - - ~>
110
125
  - !ruby/object:Gem::Version
@@ -122,6 +137,7 @@ files:
122
137
  - Gemfile
123
138
  - LICENCE
124
139
  - README.md
140
+ - Rakefile
125
141
  - TODO.txt
126
142
  - bin/cm
127
143
  - docurium.gemspec
@@ -169,31 +185,33 @@ files:
169
185
  - test/fixtures/git2/thread-utils.h
170
186
  - test/fixtures/git2/tree.h
171
187
  - test/fixtures/git2/types.h
172
- - test/fixtures/git2/zlib.h
188
+ - test/gen_test.rb
189
+ - test/parser_test.rb
173
190
  - test/repo_test.rb
174
191
  - test/test_helper.rb
175
192
  homepage: https://github.com/libgit2/docurium
176
193
  licenses:
177
194
  - MIT
178
- metadata: {}
179
195
  post_install_message:
180
196
  rdoc_options: []
181
197
  require_paths:
182
198
  - lib
183
199
  required_ruby_version: !ruby/object:Gem::Requirement
200
+ none: false
184
201
  requirements:
185
- - - '>='
202
+ - - ! '>='
186
203
  - !ruby/object:Gem::Version
187
204
  version: '0'
188
205
  required_rubygems_version: !ruby/object:Gem::Requirement
206
+ none: false
189
207
  requirements:
190
- - - '>='
208
+ - - ! '>='
191
209
  - !ruby/object:Gem::Version
192
210
  version: '0'
193
211
  requirements: []
194
212
  rubyforge_project:
195
- rubygems_version: 2.0.14
213
+ rubygems_version: 1.8.23
196
214
  signing_key:
197
- specification_version: 4
215
+ specification_version: 3
198
216
  summary: A simpler, prettier Doxygen replacement.
199
217
  test_files: []
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 8f6af0d603518314439b2a7d5794f31987f2388c
4
- data.tar.gz: b9c90aac1a2896c2ffefe5df0990544e9f4e1070
5
- SHA512:
6
- metadata.gz: 5bb41fe37a9264465db9f4f686381b75c5f28e83567a973373f1a1d7d7a6c9eb26fb66d68f2749fcec02ec7c260f46823aec366c8d83fbf54abc2e841251e2fc
7
- data.tar.gz: 02935bd2512cc021c6ae65ce7886d3c0562d064e2d40bcc9e5ad1804e3b3958965d49e265a6840bb2eaccd7291de5aa35f73f767b6dad7b4bd3565077ec538ca
@@ -1,58 +0,0 @@
1
- /*
2
- * This file is free software; you can redistribute it and/or modify
3
- * it under the terms of the GNU General Public License, version 2,
4
- * as published by the Free Software Foundation.
5
- *
6
- * In addition to the permissions in the GNU General Public License,
7
- * the authors give you unlimited permission to link the compiled
8
- * version of this file into combinations with other programs,
9
- * and to distribute those combinations without any restriction
10
- * coming from the use of this file. (The General Public License
11
- * restrictions do apply in other respects; for example, they cover
12
- * modification of the file, and distribution when not linked into
13
- * a combined executable.)
14
- *
15
- * This file is distributed in the hope that it will be useful, but
16
- * WITHOUT ANY WARRANTY; without even the implied warranty of
17
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18
- * General Public License for more details.
19
- *
20
- * You should have received a copy of the GNU General Public License
21
- * along with this program; see the file COPYING. If not, write to
22
- * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
23
- * Boston, MA 02110-1301, USA.
24
- */
25
- #ifndef INCLUDE_git_zlib_h__
26
- #define INCLUDE_git_zlib_h__
27
-
28
- #include <zlib.h>
29
-
30
- /**
31
- * @file git2/zlib.h
32
- * @brief Git data compression routines
33
- * @defgroup git_zlib Git data compression routines
34
- * @ingroup Git
35
- * @{
36
- */
37
- GIT_BEGIN_DECL
38
-
39
- #if defined(NO_DEFLATE_BOUND) || ZLIB_VERNUM < 0x1200
40
- /**
41
- * deflateBound returns an upper bound on the compressed size.
42
- *
43
- * This is a stub function used when zlib does not supply the
44
- * deflateBound() implementation itself.
45
- *
46
- * @param stream the stream pointer.
47
- * @param s total length of the source data (in bytes).
48
- * @return maximum length of the compressed data.
49
- */
50
- GIT_INLINE(size_t) deflateBound(z_streamp stream, size_t s)
51
- {
52
- return (s + ((s + 7) >> 3) + ((s + 63) >> 6) + 11);
53
- }
54
- #endif
55
-
56
- /** @} */
57
- GIT_END_DECL
58
- #endif