rugged 0.27.7 → 0.27.10

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.
Files changed (409) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rugged/version.rb +1 -1
  3. data/vendor/libgit2/AUTHORS +1 -0
  4. data/vendor/libgit2/CMakeLists.txt +99 -51
  5. data/vendor/libgit2/COPYING +28 -0
  6. data/vendor/libgit2/cmake/Modules/AddCFlagIfSupported.cmake +15 -1
  7. data/vendor/libgit2/cmake/Modules/CheckPrototypeDefinition.c.in +29 -0
  8. data/vendor/libgit2/cmake/Modules/CheckPrototypeDefinition.cmake +96 -0
  9. data/vendor/libgit2/cmake/Modules/EnableWarnings.cmake +9 -8
  10. data/vendor/libgit2/cmake/Modules/FindCoreFoundation.cmake +2 -2
  11. data/vendor/libgit2/cmake/Modules/FindGSSAPI.cmake +1 -1
  12. data/vendor/libgit2/cmake/Modules/FindGSSFramework.cmake +28 -0
  13. data/vendor/libgit2/cmake/Modules/FindIconv.cmake +11 -6
  14. data/vendor/libgit2/cmake/Modules/FindPCRE.cmake +38 -0
  15. data/vendor/libgit2/cmake/Modules/FindPCRE2.cmake +37 -0
  16. data/vendor/libgit2/cmake/Modules/FindSecurity.cmake +2 -2
  17. data/vendor/libgit2/cmake/Modules/FindStatNsec.cmake +6 -0
  18. data/vendor/libgit2/cmake/Modules/PkgBuildConfig.cmake +110 -0
  19. data/vendor/libgit2/cmake/Modules/SelectGSSAPI.cmake +53 -0
  20. data/vendor/libgit2/cmake/Modules/SelectHTTPSBackend.cmake +124 -0
  21. data/vendor/libgit2/cmake/Modules/SelectHashes.cmake +66 -0
  22. data/vendor/libgit2/deps/http-parser/http_parser.c +11 -6
  23. data/vendor/libgit2/deps/ntlmclient/CMakeLists.txt +21 -0
  24. data/vendor/libgit2/deps/ntlmclient/compat.h +33 -0
  25. data/vendor/libgit2/deps/ntlmclient/crypt.h +64 -0
  26. data/vendor/libgit2/deps/ntlmclient/crypt_commoncrypto.c +120 -0
  27. data/vendor/libgit2/deps/ntlmclient/crypt_commoncrypto.h +18 -0
  28. data/vendor/libgit2/deps/ntlmclient/crypt_mbedtls.c +145 -0
  29. data/vendor/libgit2/deps/ntlmclient/crypt_mbedtls.h +18 -0
  30. data/vendor/libgit2/deps/ntlmclient/crypt_openssl.c +130 -0
  31. data/vendor/libgit2/deps/ntlmclient/crypt_openssl.h +21 -0
  32. data/vendor/libgit2/deps/ntlmclient/ntlm.c +1420 -0
  33. data/vendor/libgit2/deps/ntlmclient/ntlm.h +174 -0
  34. data/vendor/libgit2/deps/ntlmclient/ntlmclient.h +320 -0
  35. data/vendor/libgit2/deps/ntlmclient/unicode.h +36 -0
  36. data/vendor/libgit2/deps/ntlmclient/unicode_builtin.c +445 -0
  37. data/vendor/libgit2/deps/ntlmclient/unicode_iconv.c +201 -0
  38. data/vendor/libgit2/deps/ntlmclient/utf8.h +1257 -0
  39. data/vendor/libgit2/deps/ntlmclient/util.c +21 -0
  40. data/vendor/libgit2/deps/ntlmclient/util.h +14 -0
  41. data/vendor/libgit2/deps/pcre/CMakeLists.txt +140 -0
  42. data/vendor/libgit2/deps/pcre/COPYING +5 -0
  43. data/vendor/libgit2/deps/pcre/cmake/COPYING-CMAKE-SCRIPTS +22 -0
  44. data/vendor/libgit2/deps/pcre/cmake/FindEditline.cmake +17 -0
  45. data/vendor/libgit2/deps/pcre/cmake/FindPackageHandleStandardArgs.cmake +58 -0
  46. data/vendor/libgit2/deps/pcre/cmake/FindReadline.cmake +29 -0
  47. data/vendor/libgit2/deps/pcre/config.h.in +57 -0
  48. data/vendor/libgit2/deps/pcre/pcre.h +641 -0
  49. data/vendor/libgit2/deps/pcre/pcre_byte_order.c +319 -0
  50. data/vendor/libgit2/deps/pcre/pcre_chartables.c +198 -0
  51. data/vendor/libgit2/deps/pcre/pcre_compile.c +9800 -0
  52. data/vendor/libgit2/deps/pcre/pcre_config.c +190 -0
  53. data/vendor/libgit2/deps/pcre/pcre_dfa_exec.c +3676 -0
  54. data/vendor/libgit2/deps/pcre/pcre_exec.c +7173 -0
  55. data/vendor/libgit2/deps/pcre/pcre_fullinfo.c +245 -0
  56. data/vendor/libgit2/deps/pcre/pcre_get.c +669 -0
  57. data/vendor/libgit2/deps/pcre/pcre_globals.c +86 -0
  58. data/vendor/libgit2/deps/pcre/pcre_internal.h +2787 -0
  59. data/vendor/libgit2/deps/pcre/pcre_jit_compile.c +11913 -0
  60. data/vendor/libgit2/deps/pcre/pcre_maketables.c +156 -0
  61. data/vendor/libgit2/deps/pcre/pcre_newline.c +210 -0
  62. data/vendor/libgit2/deps/pcre/pcre_ord2utf8.c +94 -0
  63. data/vendor/libgit2/deps/pcre/pcre_printint.c +834 -0
  64. data/vendor/libgit2/deps/pcre/pcre_refcount.c +92 -0
  65. data/vendor/libgit2/deps/pcre/pcre_string_utils.c +211 -0
  66. data/vendor/libgit2/deps/pcre/pcre_study.c +1686 -0
  67. data/vendor/libgit2/deps/pcre/pcre_tables.c +727 -0
  68. data/vendor/libgit2/deps/pcre/pcre_ucd.c +3644 -0
  69. data/vendor/libgit2/deps/pcre/pcre_valid_utf8.c +301 -0
  70. data/vendor/libgit2/deps/pcre/pcre_version.c +98 -0
  71. data/vendor/libgit2/deps/pcre/pcre_xclass.c +268 -0
  72. data/vendor/libgit2/deps/pcre/pcreposix.c +421 -0
  73. data/vendor/libgit2/deps/pcre/pcreposix.h +117 -0
  74. data/vendor/libgit2/deps/pcre/ucp.h +224 -0
  75. data/vendor/libgit2/deps/winhttp/COPYING.GPL +993 -0
  76. data/vendor/libgit2/deps/winhttp/COPYING.LGPL +502 -0
  77. data/vendor/libgit2/deps/zlib/CMakeLists.txt +1 -0
  78. data/vendor/libgit2/deps/zlib/COPYING +27 -0
  79. data/vendor/libgit2/deps/zlib/adler32.c +0 -7
  80. data/vendor/libgit2/deps/zlib/crc32.c +0 -7
  81. data/vendor/libgit2/include/git2/annotated_commit.h +9 -0
  82. data/vendor/libgit2/include/git2/apply.h +149 -0
  83. data/vendor/libgit2/include/git2/attr.h +20 -13
  84. data/vendor/libgit2/include/git2/blame.h +4 -4
  85. data/vendor/libgit2/include/git2/blob.h +44 -12
  86. data/vendor/libgit2/include/git2/buffer.h +20 -26
  87. data/vendor/libgit2/include/git2/cert.h +135 -0
  88. data/vendor/libgit2/include/git2/checkout.h +53 -21
  89. data/vendor/libgit2/include/git2/cherrypick.h +3 -3
  90. data/vendor/libgit2/include/git2/clone.h +5 -5
  91. data/vendor/libgit2/include/git2/commit.h +25 -3
  92. data/vendor/libgit2/include/git2/common.h +35 -10
  93. data/vendor/libgit2/include/git2/config.h +29 -19
  94. data/vendor/libgit2/include/git2/cred.h +308 -0
  95. data/vendor/libgit2/include/git2/deprecated.h +493 -0
  96. data/vendor/libgit2/include/git2/describe.h +4 -4
  97. data/vendor/libgit2/include/git2/diff.h +177 -135
  98. data/vendor/libgit2/include/git2/errors.h +53 -46
  99. data/vendor/libgit2/include/git2/filter.h +8 -0
  100. data/vendor/libgit2/include/git2/index.h +74 -52
  101. data/vendor/libgit2/include/git2/indexer.h +76 -6
  102. data/vendor/libgit2/include/git2/merge.h +25 -10
  103. data/vendor/libgit2/include/git2/net.h +0 -5
  104. data/vendor/libgit2/include/git2/notes.h +1 -1
  105. data/vendor/libgit2/include/git2/object.h +17 -29
  106. data/vendor/libgit2/include/git2/odb.h +12 -11
  107. data/vendor/libgit2/include/git2/odb_backend.h +10 -9
  108. data/vendor/libgit2/include/git2/oid.h +2 -2
  109. data/vendor/libgit2/include/git2/pack.h +14 -3
  110. data/vendor/libgit2/include/git2/proxy.h +5 -3
  111. data/vendor/libgit2/include/git2/rebase.h +46 -2
  112. data/vendor/libgit2/include/git2/refs.h +34 -16
  113. data/vendor/libgit2/include/git2/remote.h +111 -14
  114. data/vendor/libgit2/include/git2/repository.h +69 -34
  115. data/vendor/libgit2/include/git2/revert.h +1 -1
  116. data/vendor/libgit2/include/git2/revwalk.h +7 -7
  117. data/vendor/libgit2/include/git2/signature.h +2 -2
  118. data/vendor/libgit2/include/git2/stash.h +5 -5
  119. data/vendor/libgit2/include/git2/status.h +26 -17
  120. data/vendor/libgit2/include/git2/submodule.h +23 -6
  121. data/vendor/libgit2/include/git2/sys/alloc.h +18 -18
  122. data/vendor/libgit2/include/git2/sys/commit.h +1 -1
  123. data/vendor/libgit2/include/git2/sys/config.h +13 -13
  124. data/vendor/libgit2/include/git2/sys/cred.h +90 -0
  125. data/vendor/libgit2/include/git2/sys/filter.h +6 -6
  126. data/vendor/libgit2/include/git2/sys/merge.h +3 -3
  127. data/vendor/libgit2/include/git2/sys/odb_backend.h +66 -22
  128. data/vendor/libgit2/include/git2/sys/path.h +14 -5
  129. data/vendor/libgit2/include/git2/sys/refdb_backend.h +76 -40
  130. data/vendor/libgit2/include/git2/sys/repository.h +5 -1
  131. data/vendor/libgit2/include/git2/sys/stream.h +92 -12
  132. data/vendor/libgit2/include/git2/sys/transport.h +129 -83
  133. data/vendor/libgit2/include/git2/tag.h +13 -4
  134. data/vendor/libgit2/include/git2/trace.h +2 -2
  135. data/vendor/libgit2/include/git2/transport.h +11 -311
  136. data/vendor/libgit2/include/git2/tree.h +4 -4
  137. data/vendor/libgit2/include/git2/types.h +25 -106
  138. data/vendor/libgit2/include/git2/version.h +3 -3
  139. data/vendor/libgit2/include/git2/worktree.h +5 -5
  140. data/vendor/libgit2/include/git2.h +4 -0
  141. data/vendor/libgit2/src/CMakeLists.txt +104 -235
  142. data/vendor/libgit2/src/alloc.c +14 -18
  143. data/vendor/libgit2/src/{stdalloc.c → allocators/stdalloc.c} +7 -8
  144. data/vendor/libgit2/src/{stdalloc.h → allocators/stdalloc.h} +4 -4
  145. data/vendor/libgit2/src/allocators/win32_crtdbg.c +118 -0
  146. data/vendor/libgit2/src/{transports/cred.h → allocators/win32_crtdbg.h} +5 -4
  147. data/vendor/libgit2/src/annotated_commit.c +18 -11
  148. data/vendor/libgit2/src/apply.c +535 -28
  149. data/vendor/libgit2/src/apply.h +3 -1
  150. data/vendor/libgit2/src/array.h +2 -2
  151. data/vendor/libgit2/src/attr.c +77 -71
  152. data/vendor/libgit2/src/attr_file.c +203 -117
  153. data/vendor/libgit2/src/attr_file.h +9 -9
  154. data/vendor/libgit2/src/attrcache.c +49 -51
  155. data/vendor/libgit2/src/attrcache.h +2 -1
  156. data/vendor/libgit2/src/blame.c +38 -18
  157. data/vendor/libgit2/src/blame.h +1 -1
  158. data/vendor/libgit2/src/blame_git.c +29 -15
  159. data/vendor/libgit2/src/blob.c +123 -37
  160. data/vendor/libgit2/src/blob.h +19 -2
  161. data/vendor/libgit2/src/branch.c +47 -23
  162. data/vendor/libgit2/src/buf_text.c +7 -6
  163. data/vendor/libgit2/src/buffer.c +60 -53
  164. data/vendor/libgit2/src/cache.c +38 -45
  165. data/vendor/libgit2/src/cache.h +3 -3
  166. data/vendor/libgit2/src/cc-compat.h +20 -3
  167. data/vendor/libgit2/src/checkout.c +77 -67
  168. data/vendor/libgit2/src/cherrypick.c +12 -6
  169. data/vendor/libgit2/src/clone.c +36 -14
  170. data/vendor/libgit2/src/clone.h +4 -0
  171. data/vendor/libgit2/src/commit.c +103 -48
  172. data/vendor/libgit2/src/commit.h +7 -0
  173. data/vendor/libgit2/src/commit_list.c +36 -78
  174. data/vendor/libgit2/src/commit_list.h +2 -2
  175. data/vendor/libgit2/src/common.h +24 -90
  176. data/vendor/libgit2/src/config.c +203 -176
  177. data/vendor/libgit2/src/config.h +8 -20
  178. data/vendor/libgit2/src/config_backend.h +96 -0
  179. data/vendor/libgit2/src/config_cache.c +41 -35
  180. data/vendor/libgit2/src/config_entries.c +229 -0
  181. data/vendor/libgit2/src/config_entries.h +24 -0
  182. data/vendor/libgit2/src/config_file.c +422 -680
  183. data/vendor/libgit2/src/config_mem.c +220 -0
  184. data/vendor/libgit2/src/config_parse.c +96 -68
  185. data/vendor/libgit2/src/config_parse.h +15 -14
  186. data/vendor/libgit2/src/config_snapshot.c +206 -0
  187. data/vendor/libgit2/src/crlf.c +219 -196
  188. data/vendor/libgit2/src/delta.c +25 -18
  189. data/vendor/libgit2/src/describe.c +42 -41
  190. data/vendor/libgit2/src/diff.c +52 -67
  191. data/vendor/libgit2/src/diff.h +2 -1
  192. data/vendor/libgit2/src/diff_driver.c +44 -46
  193. data/vendor/libgit2/src/diff_file.c +16 -14
  194. data/vendor/libgit2/src/diff_file.h +1 -1
  195. data/vendor/libgit2/src/diff_generate.c +158 -103
  196. data/vendor/libgit2/src/diff_generate.h +3 -3
  197. data/vendor/libgit2/src/diff_parse.c +4 -4
  198. data/vendor/libgit2/src/diff_print.c +34 -22
  199. data/vendor/libgit2/src/diff_stats.c +22 -7
  200. data/vendor/libgit2/src/diff_tform.c +18 -16
  201. data/vendor/libgit2/src/diff_xdiff.c +3 -3
  202. data/vendor/libgit2/src/errors.c +51 -39
  203. data/vendor/libgit2/src/errors.h +81 -0
  204. data/vendor/libgit2/src/features.h.in +9 -3
  205. data/vendor/libgit2/src/fetch.c +8 -3
  206. data/vendor/libgit2/src/fetchhead.c +12 -12
  207. data/vendor/libgit2/src/filebuf.c +28 -32
  208. data/vendor/libgit2/src/filebuf.h +2 -2
  209. data/vendor/libgit2/src/filter.c +47 -33
  210. data/vendor/libgit2/src/filter.h +0 -10
  211. data/vendor/libgit2/src/{fileops.c → futils.c} +70 -63
  212. data/vendor/libgit2/src/{fileops.h → futils.h} +6 -6
  213. data/vendor/libgit2/src/global.c +35 -55
  214. data/vendor/libgit2/src/global.h +0 -2
  215. data/vendor/libgit2/src/hash/sha1/collisiondetect.c +48 -0
  216. data/vendor/libgit2/src/hash/sha1/collisiondetect.h +19 -0
  217. data/vendor/libgit2/src/hash/{hash_common_crypto.h → sha1/common_crypto.c} +17 -17
  218. data/vendor/libgit2/src/hash/sha1/common_crypto.h +19 -0
  219. data/vendor/libgit2/src/hash/{hash_generic.c → sha1/generic.c} +22 -10
  220. data/vendor/libgit2/src/hash/{hash_generic.h → sha1/generic.h} +4 -10
  221. data/vendor/libgit2/src/hash/{hash_mbedtls.c → sha1/mbedtls.c} +15 -7
  222. data/vendor/libgit2/src/hash/{hash_mbedtls.h → sha1/mbedtls.h} +6 -7
  223. data/vendor/libgit2/src/hash/sha1/openssl.c +59 -0
  224. data/vendor/libgit2/src/hash/sha1/openssl.h +19 -0
  225. data/vendor/libgit2/src/hash/{sha1dc → sha1/sha1dc}/sha1.c +14 -3
  226. data/vendor/libgit2/src/hash/{hash_win32.c → sha1/win32.c} +47 -37
  227. data/vendor/libgit2/src/hash/{hash_win32.h → sha1/win32.h} +6 -19
  228. data/vendor/libgit2/src/hash/sha1.h +38 -0
  229. data/vendor/libgit2/src/hash.c +61 -0
  230. data/vendor/libgit2/src/hash.h +20 -21
  231. data/vendor/libgit2/src/hashsig.c +5 -5
  232. data/vendor/libgit2/src/idxmap.c +107 -61
  233. data/vendor/libgit2/src/idxmap.h +153 -31
  234. data/vendor/libgit2/src/ignore.c +38 -42
  235. data/vendor/libgit2/src/index.c +264 -199
  236. data/vendor/libgit2/src/index.h +7 -1
  237. data/vendor/libgit2/src/indexer.c +338 -167
  238. data/vendor/libgit2/src/integer.h +71 -26
  239. data/vendor/libgit2/src/iterator.c +134 -62
  240. data/vendor/libgit2/src/iterator.h +15 -0
  241. data/vendor/libgit2/src/mailmap.c +8 -8
  242. data/vendor/libgit2/src/map.h +1 -1
  243. data/vendor/libgit2/src/merge.c +137 -93
  244. data/vendor/libgit2/src/merge_driver.c +11 -11
  245. data/vendor/libgit2/src/merge_file.c +2 -2
  246. data/vendor/libgit2/src/mwindow.c +24 -29
  247. data/vendor/libgit2/src/mwindow.h +4 -4
  248. data/vendor/libgit2/src/net.c +184 -0
  249. data/vendor/libgit2/src/net.h +36 -0
  250. data/vendor/libgit2/src/netops.c +55 -156
  251. data/vendor/libgit2/src/netops.h +3 -23
  252. data/vendor/libgit2/src/notes.c +14 -9
  253. data/vendor/libgit2/src/object.c +120 -69
  254. data/vendor/libgit2/src/object.h +22 -9
  255. data/vendor/libgit2/src/object_api.c +8 -8
  256. data/vendor/libgit2/src/odb.c +111 -88
  257. data/vendor/libgit2/src/odb.h +8 -7
  258. data/vendor/libgit2/src/odb_loose.c +58 -47
  259. data/vendor/libgit2/src/odb_mempack.c +21 -34
  260. data/vendor/libgit2/src/odb_pack.c +17 -13
  261. data/vendor/libgit2/src/offmap.c +53 -35
  262. data/vendor/libgit2/src/offmap.h +108 -21
  263. data/vendor/libgit2/src/oid.c +12 -7
  264. data/vendor/libgit2/src/oidmap.c +49 -47
  265. data/vendor/libgit2/src/oidmap.h +101 -24
  266. data/vendor/libgit2/src/pack-objects.c +87 -86
  267. data/vendor/libgit2/src/pack-objects.h +2 -8
  268. data/vendor/libgit2/src/pack.c +94 -96
  269. data/vendor/libgit2/src/pack.h +16 -18
  270. data/vendor/libgit2/src/parse.c +17 -4
  271. data/vendor/libgit2/src/parse.h +3 -3
  272. data/vendor/libgit2/src/patch.c +3 -3
  273. data/vendor/libgit2/src/patch_generate.c +18 -18
  274. data/vendor/libgit2/src/patch_parse.c +147 -79
  275. data/vendor/libgit2/src/path.c +207 -62
  276. data/vendor/libgit2/src/path.h +14 -0
  277. data/vendor/libgit2/src/pathspec.c +18 -18
  278. data/vendor/libgit2/src/pool.c +26 -22
  279. data/vendor/libgit2/src/pool.h +7 -7
  280. data/vendor/libgit2/src/posix.c +10 -10
  281. data/vendor/libgit2/src/posix.h +12 -1
  282. data/vendor/libgit2/src/proxy.c +8 -3
  283. data/vendor/libgit2/src/push.c +35 -29
  284. data/vendor/libgit2/src/push.h +2 -1
  285. data/vendor/libgit2/src/reader.c +265 -0
  286. data/vendor/libgit2/src/reader.h +107 -0
  287. data/vendor/libgit2/src/rebase.c +97 -38
  288. data/vendor/libgit2/src/refdb.c +15 -3
  289. data/vendor/libgit2/src/refdb_fs.c +318 -222
  290. data/vendor/libgit2/src/reflog.c +13 -15
  291. data/vendor/libgit2/src/refs.c +122 -89
  292. data/vendor/libgit2/src/refs.h +5 -3
  293. data/vendor/libgit2/src/refspec.c +27 -33
  294. data/vendor/libgit2/src/regexp.c +221 -0
  295. data/vendor/libgit2/src/regexp.h +97 -0
  296. data/vendor/libgit2/src/remote.c +229 -178
  297. data/vendor/libgit2/src/remote.h +11 -2
  298. data/vendor/libgit2/src/repository.c +227 -172
  299. data/vendor/libgit2/src/repository.h +52 -40
  300. data/vendor/libgit2/src/reset.c +7 -7
  301. data/vendor/libgit2/src/revert.c +11 -6
  302. data/vendor/libgit2/src/revparse.c +46 -46
  303. data/vendor/libgit2/src/revwalk.c +89 -54
  304. data/vendor/libgit2/src/revwalk.h +20 -0
  305. data/vendor/libgit2/src/settings.c +22 -9
  306. data/vendor/libgit2/src/signature.c +15 -13
  307. data/vendor/libgit2/src/sortedcache.c +22 -36
  308. data/vendor/libgit2/src/sortedcache.h +1 -1
  309. data/vendor/libgit2/src/stash.c +56 -76
  310. data/vendor/libgit2/src/status.c +27 -21
  311. data/vendor/libgit2/src/stream.h +17 -2
  312. data/vendor/libgit2/src/streams/mbedtls.c +100 -80
  313. data/vendor/libgit2/src/streams/mbedtls.h +5 -2
  314. data/vendor/libgit2/src/streams/openssl.c +93 -81
  315. data/vendor/libgit2/src/streams/openssl.h +5 -2
  316. data/vendor/libgit2/src/streams/registry.c +118 -0
  317. data/vendor/libgit2/src/streams/registry.h +19 -0
  318. data/vendor/libgit2/src/streams/socket.c +55 -30
  319. data/vendor/libgit2/src/streams/stransport.c +57 -32
  320. data/vendor/libgit2/src/streams/stransport.h +5 -0
  321. data/vendor/libgit2/src/streams/tls.c +48 -20
  322. data/vendor/libgit2/src/streams/tls.h +12 -4
  323. data/vendor/libgit2/src/strmap.c +47 -74
  324. data/vendor/libgit2/src/strmap.h +108 -33
  325. data/vendor/libgit2/src/submodule.c +190 -169
  326. data/vendor/libgit2/src/submodule.h +1 -1
  327. data/vendor/libgit2/src/sysdir.c +25 -15
  328. data/vendor/libgit2/src/tag.c +39 -26
  329. data/vendor/libgit2/src/tag.h +2 -1
  330. data/vendor/libgit2/src/trace.c +2 -2
  331. data/vendor/libgit2/src/trace.h +2 -2
  332. data/vendor/libgit2/src/trailer.c +46 -32
  333. data/vendor/libgit2/src/transaction.c +30 -29
  334. data/vendor/libgit2/src/transport.c +3 -3
  335. data/vendor/libgit2/src/transports/auth.c +14 -10
  336. data/vendor/libgit2/src/transports/auth.h +10 -3
  337. data/vendor/libgit2/src/transports/auth_negotiate.c +31 -16
  338. data/vendor/libgit2/src/transports/auth_negotiate.h +2 -2
  339. data/vendor/libgit2/src/transports/auth_ntlm.c +223 -0
  340. data/vendor/libgit2/src/transports/auth_ntlm.h +35 -0
  341. data/vendor/libgit2/src/transports/cred.c +24 -24
  342. data/vendor/libgit2/src/transports/git.c +25 -30
  343. data/vendor/libgit2/src/transports/http.c +871 -335
  344. data/vendor/libgit2/src/transports/http.h +2 -0
  345. data/vendor/libgit2/src/transports/local.c +28 -28
  346. data/vendor/libgit2/src/transports/smart.c +64 -46
  347. data/vendor/libgit2/src/transports/smart.h +5 -6
  348. data/vendor/libgit2/src/transports/smart_pkt.c +162 -151
  349. data/vendor/libgit2/src/transports/smart_protocol.c +64 -94
  350. data/vendor/libgit2/src/transports/ssh.c +76 -65
  351. data/vendor/libgit2/src/transports/winhttp.c +328 -319
  352. data/vendor/libgit2/src/tree-cache.c +21 -14
  353. data/vendor/libgit2/src/tree.c +119 -112
  354. data/vendor/libgit2/src/tree.h +1 -0
  355. data/vendor/libgit2/src/unix/map.c +3 -3
  356. data/vendor/libgit2/src/unix/posix.h +1 -11
  357. data/vendor/libgit2/src/userdiff.h +3 -1
  358. data/vendor/libgit2/src/util.c +154 -93
  359. data/vendor/libgit2/src/util.h +19 -23
  360. data/vendor/libgit2/src/vector.c +15 -10
  361. data/vendor/libgit2/src/wildmatch.c +320 -0
  362. data/vendor/libgit2/src/wildmatch.h +23 -0
  363. data/vendor/libgit2/src/win32/dir.c +3 -3
  364. data/vendor/libgit2/src/win32/findfile.c +1 -1
  365. data/vendor/libgit2/src/win32/map.c +9 -11
  366. data/vendor/libgit2/src/win32/msvc-compat.h +6 -0
  367. data/vendor/libgit2/src/win32/path_w32.c +113 -9
  368. data/vendor/libgit2/src/win32/path_w32.h +18 -29
  369. data/vendor/libgit2/src/win32/posix.h +1 -4
  370. data/vendor/libgit2/src/win32/posix_w32.c +69 -44
  371. data/vendor/libgit2/src/win32/precompiled.h +0 -2
  372. data/vendor/libgit2/src/win32/thread.c +5 -10
  373. data/vendor/libgit2/src/win32/w32_buffer.c +9 -5
  374. data/vendor/libgit2/src/win32/w32_common.h +39 -0
  375. data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.c +2 -95
  376. data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.h +0 -2
  377. data/vendor/libgit2/src/win32/w32_stack.c +6 -11
  378. data/vendor/libgit2/src/win32/w32_stack.h +3 -3
  379. data/vendor/libgit2/src/win32/w32_util.c +27 -64
  380. data/vendor/libgit2/src/win32/w32_util.h +5 -49
  381. data/vendor/libgit2/src/worktree.c +44 -30
  382. data/vendor/libgit2/src/xdiff/xdiffi.c +5 -5
  383. data/vendor/libgit2/src/xdiff/xhistogram.c +1 -1
  384. data/vendor/libgit2/src/xdiff/xmerge.c +27 -15
  385. data/vendor/libgit2/src/xdiff/xpatience.c +3 -0
  386. data/vendor/libgit2/src/zstream.c +4 -4
  387. metadata +115 -38
  388. data/vendor/libgit2/deps/regex/CMakeLists.txt +0 -2
  389. data/vendor/libgit2/deps/regex/config.h +0 -7
  390. data/vendor/libgit2/deps/regex/regcomp.c +0 -3857
  391. data/vendor/libgit2/deps/regex/regex.c +0 -92
  392. data/vendor/libgit2/deps/regex/regex.h +0 -582
  393. data/vendor/libgit2/deps/regex/regex_internal.c +0 -1744
  394. data/vendor/libgit2/deps/regex/regex_internal.h +0 -819
  395. data/vendor/libgit2/deps/regex/regexec.c +0 -4369
  396. data/vendor/libgit2/include/git2/inttypes.h +0 -309
  397. data/vendor/libgit2/include/git2/sys/time.h +0 -31
  398. data/vendor/libgit2/libgit2.pc.in +0 -13
  399. data/vendor/libgit2/src/config_file.h +0 -73
  400. data/vendor/libgit2/src/fnmatch.c +0 -248
  401. data/vendor/libgit2/src/fnmatch.h +0 -48
  402. data/vendor/libgit2/src/hash/hash_collisiondetect.h +0 -47
  403. data/vendor/libgit2/src/hash/hash_openssl.h +0 -59
  404. data/vendor/libgit2/src/streams/curl.c +0 -385
  405. data/vendor/libgit2/src/streams/curl.h +0 -17
  406. /data/vendor/libgit2/deps/http-parser/{LICENSE-MIT → COPYING} +0 -0
  407. /data/vendor/libgit2/src/hash/{sha1dc → sha1/sha1dc}/sha1.h +0 -0
  408. /data/vendor/libgit2/src/hash/{sha1dc → sha1/sha1dc}/ubc_check.c +0 -0
  409. /data/vendor/libgit2/src/hash/{sha1dc → sha1/sha1dc}/ubc_check.h +0 -0
@@ -1,819 +0,0 @@
1
- /* Extended regular expression matching and search library.
2
- Copyright (C) 2002-2005, 2007, 2008, 2010 Free Software Foundation, Inc.
3
- This file is part of the GNU C Library.
4
- Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
5
-
6
- The GNU C Library is free software; you can redistribute it and/or
7
- modify it under the terms of the GNU Lesser General Public
8
- License as published by the Free Software Foundation; either
9
- version 2.1 of the License, or (at your option) any later version.
10
-
11
- The GNU C Library is distributed in the hope that it will be useful,
12
- but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
- Lesser General Public License for more details.
15
-
16
- You should have received a copy of the GNU Lesser General Public
17
- License along with the GNU C Library; if not, write to the Free
18
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19
- 02111-1307 USA. */
20
-
21
- #ifndef _REGEX_INTERNAL_H
22
- #define _REGEX_INTERNAL_H 1
23
-
24
- #include <assert.h>
25
- #include <ctype.h>
26
- #include <stdio.h>
27
- #include <stdlib.h>
28
- #include <string.h>
29
-
30
- #ifndef UNUSED
31
- # ifdef __GNUC__
32
- # define UNUSED __attribute__((unused))
33
- # else
34
- # define UNUSED
35
- # endif
36
- #endif
37
-
38
- #if defined HAVE_LANGINFO_H || defined HAVE_LANGINFO_CODESET || defined _LIBC
39
- # include <langinfo.h>
40
- #endif
41
- #if defined HAVE_LOCALE_H || defined _LIBC
42
- # include <locale.h>
43
- #endif
44
- #if defined HAVE_WCHAR_H || defined _LIBC
45
- # include <wchar.h>
46
- #endif /* HAVE_WCHAR_H || _LIBC */
47
- #if defined HAVE_WCTYPE_H || defined _LIBC
48
- # include <wctype.h>
49
- #endif /* HAVE_WCTYPE_H || _LIBC */
50
- #if defined HAVE_STDBOOL_H || defined _LIBC
51
- # include <stdbool.h>
52
- #endif /* HAVE_STDBOOL_H || _LIBC */
53
- #if !defined(ZOS_USS)
54
- #if defined HAVE_STDINT_H || defined _LIBC
55
- # include <stdint.h>
56
- #endif /* HAVE_STDINT_H || _LIBC */
57
- #endif /* !ZOS_USS */
58
- #if defined _LIBC
59
- # include <bits/libc-lock.h>
60
- #else
61
- # define __libc_lock_define(CLASS,NAME)
62
- # define __libc_lock_init(NAME) do { } while (0)
63
- # define __libc_lock_lock(NAME) do { } while (0)
64
- # define __libc_lock_unlock(NAME) do { } while (0)
65
- #endif
66
-
67
- #ifndef GAWK
68
- /* In case that the system doesn't have isblank(). */
69
- #if !defined _LIBC && !defined HAVE_ISBLANK && !defined isblank
70
- # define isblank(ch) ((ch) == ' ' || (ch) == '\t')
71
- #endif
72
- #else /* GAWK */
73
- /*
74
- * This is a mess. On glibc systems you have to define
75
- * a magic constant to get isblank() out of <ctype.h>, since it's
76
- * a C99 function. To heck with all that and borrow a page from
77
- * dfa.c's book.
78
- */
79
-
80
- static int
81
- is_blank (int c)
82
- {
83
- return (c == ' ' || c == '\t');
84
- }
85
- #endif /* GAWK */
86
-
87
- #ifdef _LIBC
88
- # ifndef _RE_DEFINE_LOCALE_FUNCTIONS
89
- # define _RE_DEFINE_LOCALE_FUNCTIONS 1
90
- # include <locale/localeinfo.h>
91
- # include <locale/elem-hash.h>
92
- # include <locale/coll-lookup.h>
93
- # endif
94
- #endif
95
-
96
- /* This is for other GNU distributions with internationalized messages. */
97
- #if (HAVE_LIBINTL_H && ENABLE_NLS) || defined _LIBC
98
- # include <libintl.h>
99
- # ifdef _LIBC
100
- # undef gettext
101
- # define gettext(msgid) \
102
- INTUSE(__dcgettext) (_libc_intl_domainname, msgid, LC_MESSAGES)
103
- # endif
104
- #else
105
- # define gettext(msgid) (msgid)
106
- #endif
107
-
108
- #ifndef gettext_noop
109
- /* This define is so xgettext can find the internationalizable
110
- strings. */
111
- # define gettext_noop(String) String
112
- #endif
113
-
114
- /* For loser systems without the definition. */
115
- #ifndef SIZE_MAX
116
- # define SIZE_MAX ((size_t) -1)
117
- #endif
118
-
119
- #ifndef NO_MBSUPPORT
120
- #include "mbsupport.h" /* gawk */
121
- #endif
122
- #ifndef MB_CUR_MAX
123
- #define MB_CUR_MAX 1
124
- #endif
125
-
126
- #if (defined MBS_SUPPORT) || _LIBC
127
- # define RE_ENABLE_I18N
128
- #endif
129
-
130
- #if __GNUC__ >= 3
131
- # define BE(expr, val) __builtin_expect (expr, val)
132
- #else
133
- # define BE(expr, val) (expr)
134
- # ifdef inline
135
- # undef inline
136
- # endif
137
- # define inline
138
- #endif
139
-
140
- /* Number of single byte character. */
141
- #define SBC_MAX 256
142
-
143
- #define COLL_ELEM_LEN_MAX 8
144
-
145
- /* The character which represents newline. */
146
- #define NEWLINE_CHAR '\n'
147
- #define WIDE_NEWLINE_CHAR L'\n'
148
-
149
- /* Rename to standard API for using out of glibc. */
150
- #ifndef _LIBC
151
- # ifdef __wctype
152
- # undef __wctype
153
- # endif
154
- # define __wctype wctype
155
- # ifdef __iswctype
156
- # undef __iswctype
157
- # endif
158
- # define __iswctype iswctype
159
- # define __btowc btowc
160
- # define __mbrtowc mbrtowc
161
- #undef __mempcpy /* GAWK */
162
- # define __mempcpy mempcpy
163
- # define __wcrtomb wcrtomb
164
- # define __regfree regfree
165
- # define attribute_hidden
166
- #endif /* not _LIBC */
167
-
168
- #ifdef __GNUC__
169
- # define __attribute(arg) __attribute__ (arg)
170
- #else
171
- # define __attribute(arg)
172
- #endif
173
-
174
- extern const char __re_error_msgid[] attribute_hidden;
175
- extern const size_t __re_error_msgid_idx[] attribute_hidden;
176
-
177
- /* An integer used to represent a set of bits. It must be unsigned,
178
- and must be at least as wide as unsigned int. */
179
- typedef unsigned long int bitset_word_t;
180
- /* All bits set in a bitset_word_t. */
181
- #define BITSET_WORD_MAX ULONG_MAX
182
- /* Number of bits in a bitset_word_t. Cast to int as most code use it
183
- * like that for counting */
184
- #define BITSET_WORD_BITS ((int)(sizeof (bitset_word_t) * CHAR_BIT))
185
- /* Number of bitset_word_t in a bit_set. */
186
- #define BITSET_WORDS (SBC_MAX / BITSET_WORD_BITS)
187
- typedef bitset_word_t bitset_t[BITSET_WORDS];
188
- typedef bitset_word_t *re_bitset_ptr_t;
189
- typedef const bitset_word_t *re_const_bitset_ptr_t;
190
-
191
- #define bitset_set(set,i) \
192
- (set[i / BITSET_WORD_BITS] |= (bitset_word_t) 1 << i % BITSET_WORD_BITS)
193
- #define bitset_clear(set,i) \
194
- (set[i / BITSET_WORD_BITS] &= ~((bitset_word_t) 1 << i % BITSET_WORD_BITS))
195
- #define bitset_contain(set,i) \
196
- (set[i / BITSET_WORD_BITS] & ((bitset_word_t) 1 << i % BITSET_WORD_BITS))
197
- #define bitset_empty(set) memset (set, '\0', sizeof (bitset_t))
198
- #define bitset_set_all(set) memset (set, '\xff', sizeof (bitset_t))
199
- #define bitset_copy(dest,src) memcpy (dest, src, sizeof (bitset_t))
200
-
201
- #define PREV_WORD_CONSTRAINT 0x0001
202
- #define PREV_NOTWORD_CONSTRAINT 0x0002
203
- #define NEXT_WORD_CONSTRAINT 0x0004
204
- #define NEXT_NOTWORD_CONSTRAINT 0x0008
205
- #define PREV_NEWLINE_CONSTRAINT 0x0010
206
- #define NEXT_NEWLINE_CONSTRAINT 0x0020
207
- #define PREV_BEGBUF_CONSTRAINT 0x0040
208
- #define NEXT_ENDBUF_CONSTRAINT 0x0080
209
- #define WORD_DELIM_CONSTRAINT 0x0100
210
- #define NOT_WORD_DELIM_CONSTRAINT 0x0200
211
-
212
- typedef enum
213
- {
214
- INSIDE_WORD = PREV_WORD_CONSTRAINT | NEXT_WORD_CONSTRAINT,
215
- WORD_FIRST = PREV_NOTWORD_CONSTRAINT | NEXT_WORD_CONSTRAINT,
216
- WORD_LAST = PREV_WORD_CONSTRAINT | NEXT_NOTWORD_CONSTRAINT,
217
- INSIDE_NOTWORD = PREV_NOTWORD_CONSTRAINT | NEXT_NOTWORD_CONSTRAINT,
218
- LINE_FIRST = PREV_NEWLINE_CONSTRAINT,
219
- LINE_LAST = NEXT_NEWLINE_CONSTRAINT,
220
- BUF_FIRST = PREV_BEGBUF_CONSTRAINT,
221
- BUF_LAST = NEXT_ENDBUF_CONSTRAINT,
222
- WORD_DELIM = WORD_DELIM_CONSTRAINT,
223
- NOT_WORD_DELIM = NOT_WORD_DELIM_CONSTRAINT
224
- } re_context_type;
225
-
226
- typedef struct
227
- {
228
- int alloc;
229
- int nelem;
230
- int *elems;
231
- } re_node_set;
232
-
233
- typedef enum
234
- {
235
- NON_TYPE = 0,
236
-
237
- /* Node type, These are used by token, node, tree. */
238
- CHARACTER = 1,
239
- END_OF_RE = 2,
240
- SIMPLE_BRACKET = 3,
241
- OP_BACK_REF = 4,
242
- OP_PERIOD = 5,
243
- #ifdef RE_ENABLE_I18N
244
- COMPLEX_BRACKET = 6,
245
- OP_UTF8_PERIOD = 7,
246
- #endif /* RE_ENABLE_I18N */
247
-
248
- /* We define EPSILON_BIT as a macro so that OP_OPEN_SUBEXP is used
249
- when the debugger shows values of this enum type. */
250
- #define EPSILON_BIT 8
251
- OP_OPEN_SUBEXP = EPSILON_BIT | 0,
252
- OP_CLOSE_SUBEXP = EPSILON_BIT | 1,
253
- OP_ALT = EPSILON_BIT | 2,
254
- OP_DUP_ASTERISK = EPSILON_BIT | 3,
255
- ANCHOR = EPSILON_BIT | 4,
256
-
257
- /* Tree type, these are used only by tree. */
258
- CONCAT = 16,
259
- SUBEXP = 17,
260
-
261
- /* Token type, these are used only by token. */
262
- OP_DUP_PLUS = 18,
263
- OP_DUP_QUESTION,
264
- OP_OPEN_BRACKET,
265
- OP_CLOSE_BRACKET,
266
- OP_CHARSET_RANGE,
267
- OP_OPEN_DUP_NUM,
268
- OP_CLOSE_DUP_NUM,
269
- OP_NON_MATCH_LIST,
270
- OP_OPEN_COLL_ELEM,
271
- OP_CLOSE_COLL_ELEM,
272
- OP_OPEN_EQUIV_CLASS,
273
- OP_CLOSE_EQUIV_CLASS,
274
- OP_OPEN_CHAR_CLASS,
275
- OP_CLOSE_CHAR_CLASS,
276
- OP_WORD,
277
- OP_NOTWORD,
278
- OP_SPACE,
279
- OP_NOTSPACE,
280
- BACK_SLASH
281
-
282
- } re_token_type_t;
283
-
284
- #ifdef RE_ENABLE_I18N
285
- typedef struct
286
- {
287
- /* Multibyte characters. */
288
- wchar_t *mbchars;
289
-
290
- /* Collating symbols. */
291
- # ifdef _LIBC
292
- int32_t *coll_syms;
293
- # endif
294
-
295
- /* Equivalence classes. */
296
- # ifdef _LIBC
297
- int32_t *equiv_classes;
298
- # endif
299
-
300
- /* Range expressions. */
301
- # ifdef _LIBC
302
- uint32_t *range_starts;
303
- uint32_t *range_ends;
304
- # else /* not _LIBC */
305
- wchar_t *range_starts;
306
- wchar_t *range_ends;
307
- # endif /* not _LIBC */
308
-
309
- /* Character classes. */
310
- wctype_t *char_classes;
311
-
312
- /* If this character set is the non-matching list. */
313
- unsigned int non_match : 1;
314
-
315
- /* # of multibyte characters. */
316
- int nmbchars;
317
-
318
- /* # of collating symbols. */
319
- int ncoll_syms;
320
-
321
- /* # of equivalence classes. */
322
- int nequiv_classes;
323
-
324
- /* # of range expressions. */
325
- int nranges;
326
-
327
- /* # of character classes. */
328
- int nchar_classes;
329
- } re_charset_t;
330
- #endif /* RE_ENABLE_I18N */
331
-
332
- typedef struct
333
- {
334
- union
335
- {
336
- unsigned char c; /* for CHARACTER */
337
- re_bitset_ptr_t sbcset; /* for SIMPLE_BRACKET */
338
- #ifdef RE_ENABLE_I18N
339
- re_charset_t *mbcset; /* for COMPLEX_BRACKET */
340
- #endif /* RE_ENABLE_I18N */
341
- int idx; /* for BACK_REF */
342
- re_context_type ctx_type; /* for ANCHOR */
343
- } opr;
344
- #if __GNUC__ >= 2
345
- re_token_type_t type : 8;
346
- #else
347
- re_token_type_t type;
348
- #endif
349
- unsigned int constraint : 10; /* context constraint */
350
- unsigned int duplicated : 1;
351
- unsigned int opt_subexp : 1;
352
- #ifdef RE_ENABLE_I18N
353
- unsigned int accept_mb : 1;
354
- /* These 2 bits can be moved into the union if needed (e.g. if running out
355
- of bits; move opr.c to opr.c.c and move the flags to opr.c.flags). */
356
- unsigned int mb_partial : 1;
357
- #endif
358
- unsigned int word_char : 1;
359
- } re_token_t;
360
-
361
- #define IS_EPSILON_NODE(type) ((type) & EPSILON_BIT)
362
-
363
- struct re_string_t
364
- {
365
- /* Indicate the raw buffer which is the original string passed as an
366
- argument of regexec(), re_search(), etc.. */
367
- const unsigned char *raw_mbs;
368
- /* Store the multibyte string. In case of "case insensitive mode" like
369
- REG_ICASE, upper cases of the string are stored, otherwise MBS points
370
- the same address that RAW_MBS points. */
371
- unsigned char *mbs;
372
- #ifdef RE_ENABLE_I18N
373
- /* Store the wide character string which is corresponding to MBS. */
374
- wint_t *wcs;
375
- int *offsets;
376
- mbstate_t cur_state;
377
- #endif
378
- /* Index in RAW_MBS. Each character mbs[i] corresponds to
379
- raw_mbs[raw_mbs_idx + i]. */
380
- int raw_mbs_idx;
381
- /* The length of the valid characters in the buffers. */
382
- int valid_len;
383
- /* The corresponding number of bytes in raw_mbs array. */
384
- int valid_raw_len;
385
- /* The length of the buffers MBS and WCS. */
386
- int bufs_len;
387
- /* The index in MBS, which is updated by re_string_fetch_byte. */
388
- int cur_idx;
389
- /* length of RAW_MBS array. */
390
- int raw_len;
391
- /* This is RAW_LEN - RAW_MBS_IDX + VALID_LEN - VALID_RAW_LEN. */
392
- int len;
393
- /* End of the buffer may be shorter than its length in the cases such
394
- as re_match_2, re_search_2. Then, we use STOP for end of the buffer
395
- instead of LEN. */
396
- int raw_stop;
397
- /* This is RAW_STOP - RAW_MBS_IDX adjusted through OFFSETS. */
398
- int stop;
399
-
400
- /* The context of mbs[0]. We store the context independently, since
401
- the context of mbs[0] may be different from raw_mbs[0], which is
402
- the beginning of the input string. */
403
- unsigned int tip_context;
404
- /* The translation passed as a part of an argument of re_compile_pattern. */
405
- RE_TRANSLATE_TYPE trans;
406
- /* Copy of re_dfa_t's word_char. */
407
- re_const_bitset_ptr_t word_char;
408
- /* 1 if REG_ICASE. */
409
- unsigned char icase;
410
- unsigned char is_utf8;
411
- unsigned char map_notascii;
412
- unsigned char mbs_allocated;
413
- unsigned char offsets_needed;
414
- unsigned char newline_anchor;
415
- unsigned char word_ops_used;
416
- int mb_cur_max;
417
- };
418
- typedef struct re_string_t re_string_t;
419
-
420
-
421
- struct re_dfa_t;
422
- typedef struct re_dfa_t re_dfa_t;
423
-
424
- #ifndef _LIBC
425
- # ifdef __i386__
426
- # define internal_function __attribute ((regparm (3), stdcall))
427
- # else
428
- # define internal_function
429
- # endif
430
- #endif
431
-
432
- #ifndef NOT_IN_libc
433
- static reg_errcode_t re_string_realloc_buffers (re_string_t *pstr,
434
- int new_buf_len)
435
- internal_function;
436
- # ifdef RE_ENABLE_I18N
437
- static void build_wcs_buffer (re_string_t *pstr) internal_function;
438
- static reg_errcode_t build_wcs_upper_buffer (re_string_t *pstr)
439
- internal_function;
440
- # endif /* RE_ENABLE_I18N */
441
- static void build_upper_buffer (re_string_t *pstr) internal_function;
442
- static void re_string_translate_buffer (re_string_t *pstr) internal_function;
443
- static unsigned int re_string_context_at (const re_string_t *input, int idx,
444
- int eflags)
445
- internal_function __attribute ((pure));
446
- #endif
447
- #define re_string_peek_byte(pstr, offset) \
448
- ((pstr)->mbs[(pstr)->cur_idx + offset])
449
- #define re_string_fetch_byte(pstr) \
450
- ((pstr)->mbs[(pstr)->cur_idx++])
451
- #define re_string_first_byte(pstr, idx) \
452
- ((idx) == (pstr)->valid_len || (pstr)->wcs[idx] != WEOF)
453
- #define re_string_is_single_byte_char(pstr, idx) \
454
- ((pstr)->wcs[idx] != WEOF && ((pstr)->valid_len == (idx) + 1 \
455
- || (pstr)->wcs[(idx) + 1] != WEOF))
456
- #define re_string_eoi(pstr) ((pstr)->stop <= (pstr)->cur_idx)
457
- #define re_string_cur_idx(pstr) ((pstr)->cur_idx)
458
- #define re_string_get_buffer(pstr) ((pstr)->mbs)
459
- #define re_string_length(pstr) ((pstr)->len)
460
- #define re_string_byte_at(pstr,idx) ((pstr)->mbs[idx])
461
- #define re_string_skip_bytes(pstr,idx) ((pstr)->cur_idx += (idx))
462
- #define re_string_set_index(pstr,idx) ((pstr)->cur_idx = (idx))
463
-
464
- #ifndef _LIBC
465
- # if HAVE_ALLOCA
466
- # if (_MSC_VER)
467
- # include <malloc.h>
468
- # define __libc_use_alloca(n) 0
469
- # else
470
- # include <alloca.h>
471
- /* The OS usually guarantees only one guard page at the bottom of the stack,
472
- and a page size can be as small as 4096 bytes. So we cannot safely
473
- allocate anything larger than 4096 bytes. Also care for the possibility
474
- of a few compiler-allocated temporary stack slots. */
475
- # define __libc_use_alloca(n) ((n) < 4032)
476
- # endif
477
- # else
478
- /* alloca is implemented with malloc, so just use malloc. */
479
- # define __libc_use_alloca(n) 0
480
- # endif
481
- #endif
482
-
483
- #define re_malloc(t,n) ((t *) malloc ((n) * sizeof (t)))
484
- /* SunOS 4.1.x realloc doesn't accept null pointers: pre-Standard C. Sigh. */
485
- #define re_realloc(p,t,n) ((p != NULL) ? (t *) realloc (p,(n)*sizeof(t)) : (t *) calloc(n,sizeof(t)))
486
- #define re_free(p) free (p)
487
-
488
- struct bin_tree_t
489
- {
490
- struct bin_tree_t *parent;
491
- struct bin_tree_t *left;
492
- struct bin_tree_t *right;
493
- struct bin_tree_t *first;
494
- struct bin_tree_t *next;
495
-
496
- re_token_t token;
497
-
498
- /* `node_idx' is the index in dfa->nodes, if `type' == 0.
499
- Otherwise `type' indicate the type of this node. */
500
- int node_idx;
501
- };
502
- typedef struct bin_tree_t bin_tree_t;
503
-
504
- #define BIN_TREE_STORAGE_SIZE \
505
- ((1024 - sizeof (void *)) / sizeof (bin_tree_t))
506
-
507
- struct bin_tree_storage_t
508
- {
509
- struct bin_tree_storage_t *next;
510
- bin_tree_t data[BIN_TREE_STORAGE_SIZE];
511
- };
512
- typedef struct bin_tree_storage_t bin_tree_storage_t;
513
-
514
- #define CONTEXT_WORD 1
515
- #define CONTEXT_NEWLINE (CONTEXT_WORD << 1)
516
- #define CONTEXT_BEGBUF (CONTEXT_NEWLINE << 1)
517
- #define CONTEXT_ENDBUF (CONTEXT_BEGBUF << 1)
518
-
519
- #define IS_WORD_CONTEXT(c) ((c) & CONTEXT_WORD)
520
- #define IS_NEWLINE_CONTEXT(c) ((c) & CONTEXT_NEWLINE)
521
- #define IS_BEGBUF_CONTEXT(c) ((c) & CONTEXT_BEGBUF)
522
- #define IS_ENDBUF_CONTEXT(c) ((c) & CONTEXT_ENDBUF)
523
- #define IS_ORDINARY_CONTEXT(c) ((c) == 0)
524
-
525
- #define IS_WORD_CHAR(ch) (isalnum (ch) || (ch) == '_')
526
- #define IS_NEWLINE(ch) ((ch) == NEWLINE_CHAR)
527
- #define IS_WIDE_WORD_CHAR(ch) (iswalnum (ch) || (ch) == L'_')
528
- #define IS_WIDE_NEWLINE(ch) ((ch) == WIDE_NEWLINE_CHAR)
529
-
530
- #define NOT_SATISFY_PREV_CONSTRAINT(constraint,context) \
531
- ((((constraint) & PREV_WORD_CONSTRAINT) && !IS_WORD_CONTEXT (context)) \
532
- || ((constraint & PREV_NOTWORD_CONSTRAINT) && IS_WORD_CONTEXT (context)) \
533
- || ((constraint & PREV_NEWLINE_CONSTRAINT) && !IS_NEWLINE_CONTEXT (context))\
534
- || ((constraint & PREV_BEGBUF_CONSTRAINT) && !IS_BEGBUF_CONTEXT (context)))
535
-
536
- #define NOT_SATISFY_NEXT_CONSTRAINT(constraint,context) \
537
- ((((constraint) & NEXT_WORD_CONSTRAINT) && !IS_WORD_CONTEXT (context)) \
538
- || (((constraint) & NEXT_NOTWORD_CONSTRAINT) && IS_WORD_CONTEXT (context)) \
539
- || (((constraint) & NEXT_NEWLINE_CONSTRAINT) && !IS_NEWLINE_CONTEXT (context)) \
540
- || (((constraint) & NEXT_ENDBUF_CONSTRAINT) && !IS_ENDBUF_CONTEXT (context)))
541
-
542
- struct re_dfastate_t
543
- {
544
- unsigned int hash;
545
- re_node_set nodes;
546
- re_node_set non_eps_nodes;
547
- re_node_set inveclosure;
548
- re_node_set *entrance_nodes;
549
- struct re_dfastate_t **trtable, **word_trtable;
550
- unsigned int context : 4;
551
- unsigned int halt : 1;
552
- /* If this state can accept `multi byte'.
553
- Note that we refer to multibyte characters, and multi character
554
- collating elements as `multi byte'. */
555
- unsigned int accept_mb : 1;
556
- /* If this state has backreference node(s). */
557
- unsigned int has_backref : 1;
558
- unsigned int has_constraint : 1;
559
- };
560
- typedef struct re_dfastate_t re_dfastate_t;
561
-
562
- struct re_state_table_entry
563
- {
564
- int num;
565
- int alloc;
566
- re_dfastate_t **array;
567
- };
568
-
569
- /* Array type used in re_sub_match_last_t and re_sub_match_top_t. */
570
-
571
- typedef struct
572
- {
573
- int next_idx;
574
- int alloc;
575
- re_dfastate_t **array;
576
- } state_array_t;
577
-
578
- /* Store information about the node NODE whose type is OP_CLOSE_SUBEXP. */
579
-
580
- typedef struct
581
- {
582
- int node;
583
- int str_idx; /* The position NODE match at. */
584
- state_array_t path;
585
- } re_sub_match_last_t;
586
-
587
- /* Store information about the node NODE whose type is OP_OPEN_SUBEXP.
588
- And information about the node, whose type is OP_CLOSE_SUBEXP,
589
- corresponding to NODE is stored in LASTS. */
590
-
591
- typedef struct
592
- {
593
- int str_idx;
594
- int node;
595
- state_array_t *path;
596
- int alasts; /* Allocation size of LASTS. */
597
- int nlasts; /* The number of LASTS. */
598
- re_sub_match_last_t **lasts;
599
- } re_sub_match_top_t;
600
-
601
- struct re_backref_cache_entry
602
- {
603
- int node;
604
- int str_idx;
605
- int subexp_from;
606
- int subexp_to;
607
- char more;
608
- char unused;
609
- unsigned short int eps_reachable_subexps_map;
610
- };
611
-
612
- typedef struct
613
- {
614
- /* The string object corresponding to the input string. */
615
- re_string_t input;
616
- #if defined _LIBC || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)
617
- const re_dfa_t *const dfa;
618
- #else
619
- const re_dfa_t *dfa;
620
- #endif
621
- /* EFLAGS of the argument of regexec. */
622
- int eflags;
623
- /* Where the matching ends. */
624
- int match_last;
625
- int last_node;
626
- /* The state log used by the matcher. */
627
- re_dfastate_t **state_log;
628
- int state_log_top;
629
- /* Back reference cache. */
630
- int nbkref_ents;
631
- int abkref_ents;
632
- struct re_backref_cache_entry *bkref_ents;
633
- int max_mb_elem_len;
634
- int nsub_tops;
635
- int asub_tops;
636
- re_sub_match_top_t **sub_tops;
637
- } re_match_context_t;
638
-
639
- typedef struct
640
- {
641
- re_dfastate_t **sifted_states;
642
- re_dfastate_t **limited_states;
643
- int last_node;
644
- int last_str_idx;
645
- re_node_set limits;
646
- } re_sift_context_t;
647
-
648
- struct re_fail_stack_ent_t
649
- {
650
- int idx;
651
- int node;
652
- regmatch_t *regs;
653
- re_node_set eps_via_nodes;
654
- };
655
-
656
- struct re_fail_stack_t
657
- {
658
- int num;
659
- int alloc;
660
- struct re_fail_stack_ent_t *stack;
661
- };
662
-
663
- struct re_dfa_t
664
- {
665
- re_token_t *nodes;
666
- size_t nodes_alloc;
667
- size_t nodes_len;
668
- int *nexts;
669
- int *org_indices;
670
- re_node_set *edests;
671
- re_node_set *eclosures;
672
- re_node_set *inveclosures;
673
- struct re_state_table_entry *state_table;
674
- re_dfastate_t *init_state;
675
- re_dfastate_t *init_state_word;
676
- re_dfastate_t *init_state_nl;
677
- re_dfastate_t *init_state_begbuf;
678
- bin_tree_t *str_tree;
679
- bin_tree_storage_t *str_tree_storage;
680
- re_bitset_ptr_t sb_char;
681
- int str_tree_storage_idx;
682
-
683
- /* number of subexpressions `re_nsub' is in regex_t. */
684
- unsigned int state_hash_mask;
685
- int init_node;
686
- int nbackref; /* The number of backreference in this dfa. */
687
-
688
- /* Bitmap expressing which backreference is used. */
689
- bitset_word_t used_bkref_map;
690
- bitset_word_t completed_bkref_map;
691
-
692
- unsigned int has_plural_match : 1;
693
- /* If this dfa has "multibyte node", which is a backreference or
694
- a node which can accept multibyte character or multi character
695
- collating element. */
696
- unsigned int has_mb_node : 1;
697
- unsigned int is_utf8 : 1;
698
- unsigned int map_notascii : 1;
699
- unsigned int word_ops_used : 1;
700
- int mb_cur_max;
701
- bitset_t word_char;
702
- reg_syntax_t syntax;
703
- int *subexp_map;
704
- #ifdef DEBUG
705
- char* re_str;
706
- #endif
707
- #if defined _LIBC
708
- __libc_lock_define (, lock)
709
- #endif
710
- };
711
-
712
- #define re_node_set_init_empty(set) memset (set, '\0', sizeof (re_node_set))
713
- #define re_node_set_remove(set,id) \
714
- (re_node_set_remove_at (set, re_node_set_contains (set, id) - 1))
715
- #define re_node_set_empty(p) ((p)->nelem = 0)
716
- #define re_node_set_free(set) re_free ((set)->elems)
717
-
718
-
719
- typedef enum
720
- {
721
- SB_CHAR,
722
- MB_CHAR,
723
- EQUIV_CLASS,
724
- COLL_SYM,
725
- CHAR_CLASS
726
- } bracket_elem_type;
727
-
728
- typedef struct
729
- {
730
- bracket_elem_type type;
731
- union
732
- {
733
- unsigned char ch;
734
- unsigned char *name;
735
- wchar_t wch;
736
- } opr;
737
- } bracket_elem_t;
738
-
739
-
740
- /* Inline functions for bitset operation. */
741
- static inline void
742
- bitset_not (bitset_t set)
743
- {
744
- int bitset_i;
745
- for (bitset_i = 0; bitset_i < BITSET_WORDS; ++bitset_i)
746
- set[bitset_i] = ~set[bitset_i];
747
- }
748
-
749
- static inline void
750
- bitset_merge (bitset_t dest, const bitset_t src)
751
- {
752
- int bitset_i;
753
- for (bitset_i = 0; bitset_i < BITSET_WORDS; ++bitset_i)
754
- dest[bitset_i] |= src[bitset_i];
755
- }
756
-
757
- static inline void
758
- bitset_mask (bitset_t dest, const bitset_t src)
759
- {
760
- int bitset_i;
761
- for (bitset_i = 0; bitset_i < BITSET_WORDS; ++bitset_i)
762
- dest[bitset_i] &= src[bitset_i];
763
- }
764
-
765
- #ifdef RE_ENABLE_I18N
766
- /* Inline functions for re_string. */
767
- static inline int
768
- internal_function __attribute ((pure))
769
- re_string_char_size_at (const re_string_t *pstr, int idx)
770
- {
771
- int byte_idx;
772
- if (pstr->mb_cur_max == 1)
773
- return 1;
774
- for (byte_idx = 1; idx + byte_idx < pstr->valid_len; ++byte_idx)
775
- if (pstr->wcs[idx + byte_idx] != WEOF)
776
- break;
777
- return byte_idx;
778
- }
779
-
780
- static inline wint_t
781
- internal_function __attribute ((pure))
782
- re_string_wchar_at (const re_string_t *pstr, int idx)
783
- {
784
- if (pstr->mb_cur_max == 1)
785
- return (wint_t) pstr->mbs[idx];
786
- return (wint_t) pstr->wcs[idx];
787
- }
788
-
789
- # ifndef NOT_IN_libc
790
- static int
791
- internal_function __attribute ((pure))
792
- re_string_elem_size_at (const re_string_t *pstr, int idx)
793
- {
794
- # ifdef _LIBC
795
- const unsigned char *p, *extra;
796
- const int32_t *table, *indirect;
797
- int32_t tmp;
798
- # include <locale/weight.h>
799
- uint_fast32_t nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
800
-
801
- if (nrules != 0)
802
- {
803
- table = (const int32_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEMB);
804
- extra = (const unsigned char *)
805
- _NL_CURRENT (LC_COLLATE, _NL_COLLATE_EXTRAMB);
806
- indirect = (const int32_t *) _NL_CURRENT (LC_COLLATE,
807
- _NL_COLLATE_INDIRECTMB);
808
- p = pstr->mbs + idx;
809
- tmp = findidx (&p);
810
- return p - pstr->mbs - idx;
811
- }
812
- else
813
- # endif /* _LIBC */
814
- return 1;
815
- }
816
- # endif
817
- #endif /* RE_ENABLE_I18N */
818
-
819
- #endif /* _REGEX_INTERNAL_H */