zsv 1.3.0 → 1.4.3

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 (232) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +13 -0
  3. data/README.md +41 -3
  4. data/ext/zsv/extconf.rb +66 -49
  5. data/ext/zsv/options.c +1 -2
  6. data/ext/zsv/parser.c +14 -0
  7. data/ext/zsv/zsv_ext.c +3 -0
  8. data/lib/zsv/version.rb +1 -1
  9. metadata +6 -226
  10. data/ext/zsv/vendor/zsv-1.3.0/app/2db.c +0 -756
  11. data/ext/zsv/vendor/zsv-1.3.0/app/2json.c +0 -381
  12. data/ext/zsv/vendor/zsv-1.3.0/app/2tsv.c +0 -228
  13. data/ext/zsv/vendor/zsv-1.3.0/app/builtin/help.c +0 -123
  14. data/ext/zsv/vendor/zsv-1.3.0/app/builtin/license.c +0 -39
  15. data/ext/zsv/vendor/zsv-1.3.0/app/builtin/register.c +0 -104
  16. data/ext/zsv/vendor/zsv-1.3.0/app/builtin/thirdparty.c +0 -41
  17. data/ext/zsv/vendor/zsv-1.3.0/app/builtin/unregister.c +0 -1
  18. data/ext/zsv/vendor/zsv-1.3.0/app/builtin/version.c +0 -14
  19. data/ext/zsv/vendor/zsv-1.3.0/app/check/simdutf_wrapper.h +0 -19
  20. data/ext/zsv/vendor/zsv-1.3.0/app/check/utf8.c +0 -116
  21. data/ext/zsv/vendor/zsv-1.3.0/app/check.c +0 -194
  22. data/ext/zsv/vendor/zsv-1.3.0/app/cli.c +0 -796
  23. data/ext/zsv/vendor/zsv-1.3.0/app/cli_const.h +0 -41
  24. data/ext/zsv/vendor/zsv-1.3.0/app/cli_export.h +0 -16
  25. data/ext/zsv/vendor/zsv-1.3.0/app/cli_ini.c +0 -280
  26. data/ext/zsv/vendor/zsv-1.3.0/app/cli_internal.h +0 -36
  27. data/ext/zsv/vendor/zsv-1.3.0/app/compare.c +0 -913
  28. data/ext/zsv/vendor/zsv-1.3.0/app/compare.h +0 -23
  29. data/ext/zsv/vendor/zsv-1.3.0/app/compare_added_column.c +0 -20
  30. data/ext/zsv/vendor/zsv-1.3.0/app/compare_internal.h +0 -140
  31. data/ext/zsv/vendor/zsv-1.3.0/app/compare_sort.c +0 -91
  32. data/ext/zsv/vendor/zsv-1.3.0/app/compare_unique_colname.c +0 -81
  33. data/ext/zsv/vendor/zsv-1.3.0/app/count-pull.c +0 -82
  34. data/ext/zsv/vendor/zsv-1.3.0/app/count.c +0 -404
  35. data/ext/zsv/vendor/zsv-1.3.0/app/desc.c +0 -569
  36. data/ext/zsv/vendor/zsv-1.3.0/app/echo.c +0 -365
  37. data/ext/zsv/vendor/zsv-1.3.0/app/ext_example/my_extension.c +0 -366
  38. data/ext/zsv/vendor/zsv-1.3.0/app/ext_example/mysheet_extension.c +0 -341
  39. data/ext/zsv/vendor/zsv-1.3.0/app/ext_template/YOUR_EXTENSION_zsvext.c +0 -263
  40. data/ext/zsv/vendor/zsv-1.3.0/app/external/inih/ini.c +0 -298
  41. data/ext/zsv/vendor/zsv-1.3.0/app/external/inih/ini.h +0 -157
  42. data/ext/zsv/vendor/zsv-1.3.0/app/external/json_writer-1.01/json_numeric.c +0 -177
  43. data/ext/zsv/vendor/zsv-1.3.0/app/external/json_writer-1.01/jsonwriter.c +0 -444
  44. data/ext/zsv/vendor/zsv-1.3.0/app/external/json_writer-1.01/jsonwriter.h +0 -145
  45. data/ext/zsv/vendor/zsv-1.3.0/app/external/json_writer-1.01/utils.c +0 -110
  46. data/ext/zsv/vendor/zsv-1.3.0/app/external/memfile-1.0/include/memfile.h +0 -15
  47. data/ext/zsv/vendor/zsv-1.3.0/app/external/memfile-1.0/src/memfile.c +0 -64
  48. data/ext/zsv/vendor/zsv-1.3.0/app/external/sglib/sglib.h +0 -1955
  49. data/ext/zsv/vendor/zsv-1.3.0/app/external/simdutf/simdutf.h +0 -6802
  50. data/ext/zsv/vendor/zsv-1.3.0/app/external/sqlite3/sqlite3.c +0 -230517
  51. data/ext/zsv/vendor/zsv-1.3.0/app/external/sqlite3/sqlite3.h +0 -12174
  52. data/ext/zsv/vendor/zsv-1.3.0/app/external/sqlite3/sqlite3_and_csv_vtab.c +0 -2
  53. data/ext/zsv/vendor/zsv-1.3.0/app/external/sqlite3/sqlite3_csv_vtab-mem.c +0 -142
  54. data/ext/zsv/vendor/zsv-1.3.0/app/external/sqlite3/sqlite3_csv_vtab-mem.h +0 -49
  55. data/ext/zsv/vendor/zsv-1.3.0/app/external/sqlite3/sqlite3_csv_vtab-zsv.c +0 -485
  56. data/ext/zsv/vendor/zsv-1.3.0/app/external/sqlite3/sqlite3_csv_vtab.c +0 -1015
  57. data/ext/zsv/vendor/zsv-1.3.0/app/external/sqlite3/sqlite3ext.h +0 -663
  58. data/ext/zsv/vendor/zsv-1.3.0/app/external/sqlite3/vtab_helper.c +0 -85
  59. data/ext/zsv/vendor/zsv-1.3.0/app/external/yajl/build/yajl-2.1.1/include/yajl/yajl_common.h +0 -75
  60. data/ext/zsv/vendor/zsv-1.3.0/app/external/yajl/build/yajl-2.1.1/include/yajl/yajl_gen.h +0 -167
  61. data/ext/zsv/vendor/zsv-1.3.0/app/external/yajl/build/yajl-2.1.1/include/yajl/yajl_parse.h +0 -228
  62. data/ext/zsv/vendor/zsv-1.3.0/app/external/yajl/build/yajl-2.1.1/include/yajl/yajl_tree.h +0 -186
  63. data/ext/zsv/vendor/zsv-1.3.0/app/external/yajl/build/yajl-2.1.1/include/yajl/yajl_version.h +0 -23
  64. data/ext/zsv/vendor/zsv-1.3.0/app/external/yajl/src/api/yajl_common.h +0 -76
  65. data/ext/zsv/vendor/zsv-1.3.0/app/external/yajl/src/api/yajl_gen.h +0 -167
  66. data/ext/zsv/vendor/zsv-1.3.0/app/external/yajl/src/api/yajl_parse.h +0 -238
  67. data/ext/zsv/vendor/zsv-1.3.0/app/external/yajl/src/api/yajl_tree.h +0 -186
  68. data/ext/zsv/vendor/zsv-1.3.0/app/external/yajl/src/yajl.c +0 -184
  69. data/ext/zsv/vendor/zsv-1.3.0/app/external/yajl/src/yajl_alloc.c +0 -52
  70. data/ext/zsv/vendor/zsv-1.3.0/app/external/yajl/src/yajl_alloc.h +0 -34
  71. data/ext/zsv/vendor/zsv-1.3.0/app/external/yajl/src/yajl_buf.c +0 -103
  72. data/ext/zsv/vendor/zsv-1.3.0/app/external/yajl/src/yajl_buf.h +0 -57
  73. data/ext/zsv/vendor/zsv-1.3.0/app/external/yajl/src/yajl_bytestack.h +0 -69
  74. data/ext/zsv/vendor/zsv-1.3.0/app/external/yajl/src/yajl_encode.c +0 -220
  75. data/ext/zsv/vendor/zsv-1.3.0/app/external/yajl/src/yajl_encode.h +0 -34
  76. data/ext/zsv/vendor/zsv-1.3.0/app/external/yajl/src/yajl_gen.c +0 -362
  77. data/ext/zsv/vendor/zsv-1.3.0/app/external/yajl/src/yajl_lex.c +0 -764
  78. data/ext/zsv/vendor/zsv-1.3.0/app/external/yajl/src/yajl_lex.h +0 -117
  79. data/ext/zsv/vendor/zsv-1.3.0/app/external/yajl/src/yajl_parser.c +0 -508
  80. data/ext/zsv/vendor/zsv-1.3.0/app/external/yajl/src/yajl_parser.h +0 -78
  81. data/ext/zsv/vendor/zsv-1.3.0/app/external/yajl/src/yajl_tree.c +0 -505
  82. data/ext/zsv/vendor/zsv-1.3.0/app/external/yajl/src/yajl_version.c +0 -7
  83. data/ext/zsv/vendor/zsv-1.3.0/app/external/yajl_helper/yajl_helper/json_value.h +0 -59
  84. data/ext/zsv/vendor/zsv-1.3.0/app/external/yajl_helper/yajl_helper/yajl_helper.h +0 -208
  85. data/ext/zsv/vendor/zsv-1.3.0/app/external/yajl_helper/yajl_helper.c +0 -795
  86. data/ext/zsv/vendor/zsv-1.3.0/app/external/yajl_helper/yajl_helper_internal.h +0 -28
  87. data/ext/zsv/vendor/zsv-1.3.0/app/flatten.c +0 -851
  88. data/ext/zsv/vendor/zsv-1.3.0/app/jq.c +0 -106
  89. data/ext/zsv/vendor/zsv-1.3.0/app/jq.h +0 -6
  90. data/ext/zsv/vendor/zsv-1.3.0/app/mv.c +0 -113
  91. data/ext/zsv/vendor/zsv-1.3.0/app/noop.c +0 -90
  92. data/ext/zsv/vendor/zsv-1.3.0/app/overwrite.c +0 -295
  93. data/ext/zsv/vendor/zsv-1.3.0/app/paste.c +0 -175
  94. data/ext/zsv/vendor/zsv-1.3.0/app/pretty.c +0 -693
  95. data/ext/zsv/vendor/zsv-1.3.0/app/prop.c +0 -980
  96. data/ext/zsv/vendor/zsv-1.3.0/app/rm.c +0 -131
  97. data/ext/zsv/vendor/zsv-1.3.0/app/select/fixed.c +0 -130
  98. data/ext/zsv/vendor/zsv-1.3.0/app/select/internal.h +0 -118
  99. data/ext/zsv/vendor/zsv-1.3.0/app/select/parallel.c +0 -45
  100. data/ext/zsv/vendor/zsv-1.3.0/app/select/parallel.h +0 -41
  101. data/ext/zsv/vendor/zsv-1.3.0/app/select/processing.c +0 -107
  102. data/ext/zsv/vendor/zsv-1.3.0/app/select/rand.c +0 -20
  103. data/ext/zsv/vendor/zsv-1.3.0/app/select/regex.c +0 -61
  104. data/ext/zsv/vendor/zsv-1.3.0/app/select/search.c +0 -14
  105. data/ext/zsv/vendor/zsv-1.3.0/app/select/selection.c +0 -192
  106. data/ext/zsv/vendor/zsv-1.3.0/app/select/usage.c +0 -72
  107. data/ext/zsv/vendor/zsv-1.3.0/app/select-pull.c +0 -812
  108. data/ext/zsv/vendor/zsv-1.3.0/app/select.c +0 -753
  109. data/ext/zsv/vendor/zsv-1.3.0/app/serialize.c +0 -372
  110. data/ext/zsv/vendor/zsv-1.3.0/app/sheet/curses.h +0 -15
  111. data/ext/zsv/vendor/zsv-1.3.0/app/sheet/cursor.c +0 -119
  112. data/ext/zsv/vendor/zsv-1.3.0/app/sheet/errors.c +0 -45
  113. data/ext/zsv/vendor/zsv-1.3.0/app/sheet/file.c +0 -63
  114. data/ext/zsv/vendor/zsv-1.3.0/app/sheet/file.h +0 -12
  115. data/ext/zsv/vendor/zsv-1.3.0/app/sheet/filter.c +0 -166
  116. data/ext/zsv/vendor/zsv-1.3.0/app/sheet/handlers.c +0 -214
  117. data/ext/zsv/vendor/zsv-1.3.0/app/sheet/handlers_internal.h +0 -128
  118. data/ext/zsv/vendor/zsv-1.3.0/app/sheet/help.c +0 -43
  119. data/ext/zsv/vendor/zsv-1.3.0/app/sheet/index.c +0 -81
  120. data/ext/zsv/vendor/zsv-1.3.0/app/sheet/index.h +0 -25
  121. data/ext/zsv/vendor/zsv-1.3.0/app/sheet/key-bindings.c +0 -325
  122. data/ext/zsv/vendor/zsv-1.3.0/app/sheet/key-bindings.h +0 -73
  123. data/ext/zsv/vendor/zsv-1.3.0/app/sheet/lexer.c +0 -203
  124. data/ext/zsv/vendor/zsv-1.3.0/app/sheet/newline_handler.c +0 -7
  125. data/ext/zsv/vendor/zsv-1.3.0/app/sheet/pivot.c +0 -318
  126. data/ext/zsv/vendor/zsv-1.3.0/app/sheet/procedure.c +0 -134
  127. data/ext/zsv/vendor/zsv-1.3.0/app/sheet/procedure.h +0 -119
  128. data/ext/zsv/vendor/zsv-1.3.0/app/sheet/read-data.c +0 -322
  129. data/ext/zsv/vendor/zsv-1.3.0/app/sheet/screen_buffer.c +0 -203
  130. data/ext/zsv/vendor/zsv-1.3.0/app/sheet/screen_buffer.h +0 -36
  131. data/ext/zsv/vendor/zsv-1.3.0/app/sheet/sheet-sql.c +0 -167
  132. data/ext/zsv/vendor/zsv-1.3.0/app/sheet/sheet_internal.h +0 -36
  133. data/ext/zsv/vendor/zsv-1.3.0/app/sheet/sqlfilter.c +0 -153
  134. data/ext/zsv/vendor/zsv-1.3.0/app/sheet/terminfo.c +0 -32
  135. data/ext/zsv/vendor/zsv-1.3.0/app/sheet/transformation.c +0 -312
  136. data/ext/zsv/vendor/zsv-1.3.0/app/sheet/transformation.h +0 -29
  137. data/ext/zsv/vendor/zsv-1.3.0/app/sheet/ui_buffer.c +0 -266
  138. data/ext/zsv/vendor/zsv-1.3.0/app/sheet/usage.c +0 -9
  139. data/ext/zsv/vendor/zsv-1.3.0/app/sheet/utf8-width.c +0 -60
  140. data/ext/zsv/vendor/zsv-1.3.0/app/sheet.c +0 -1007
  141. data/ext/zsv/vendor/zsv-1.3.0/app/sql.c +0 -453
  142. data/ext/zsv/vendor/zsv-1.3.0/app/sql_internal.c +0 -101
  143. data/ext/zsv/vendor/zsv-1.3.0/app/sql_internal.h +0 -49
  144. data/ext/zsv/vendor/zsv-1.3.0/app/stack.c +0 -393
  145. data/ext/zsv/vendor/zsv-1.3.0/app/utils/arg.c +0 -322
  146. data/ext/zsv/vendor/zsv-1.3.0/app/utils/cache.c +0 -228
  147. data/ext/zsv/vendor/zsv-1.3.0/app/utils/cat.c +0 -91
  148. data/ext/zsv/vendor/zsv-1.3.0/app/utils/chunk.c +0 -240
  149. data/ext/zsv/vendor/zsv-1.3.0/app/utils/chunk.h +0 -63
  150. data/ext/zsv/vendor/zsv-1.3.0/app/utils/clock.c +0 -57
  151. data/ext/zsv/vendor/zsv-1.3.0/app/utils/db.c +0 -148
  152. data/ext/zsv/vendor/zsv-1.3.0/app/utils/dirs-no-jq.c +0 -2
  153. data/ext/zsv/vendor/zsv-1.3.0/app/utils/dirs.c +0 -427
  154. data/ext/zsv/vendor/zsv-1.3.0/app/utils/dirs_from_json.c +0 -253
  155. data/ext/zsv/vendor/zsv-1.3.0/app/utils/dirs_to_json.c +0 -121
  156. data/ext/zsv/vendor/zsv-1.3.0/app/utils/dl.c +0 -20
  157. data/ext/zsv/vendor/zsv-1.3.0/app/utils/emcc/fs_api.c +0 -159
  158. data/ext/zsv/vendor/zsv-1.3.0/app/utils/err.c +0 -24
  159. data/ext/zsv/vendor/zsv-1.3.0/app/utils/file-mem.c +0 -180
  160. data/ext/zsv/vendor/zsv-1.3.0/app/utils/file.c +0 -256
  161. data/ext/zsv/vendor/zsv-1.3.0/app/utils/index.c +0 -197
  162. data/ext/zsv/vendor/zsv-1.3.0/app/utils/index.h +0 -49
  163. data/ext/zsv/vendor/zsv-1.3.0/app/utils/jq.c +0 -400
  164. data/ext/zsv/vendor/zsv-1.3.0/app/utils/json.c +0 -120
  165. data/ext/zsv/vendor/zsv-1.3.0/app/utils/mem.c +0 -18
  166. data/ext/zsv/vendor/zsv-1.3.0/app/utils/memmem.c +0 -132
  167. data/ext/zsv/vendor/zsv-1.3.0/app/utils/os.c +0 -178
  168. data/ext/zsv/vendor/zsv-1.3.0/app/utils/overwrite.c +0 -258
  169. data/ext/zsv/vendor/zsv-1.3.0/app/utils/overwrite_writer.c +0 -246
  170. data/ext/zsv/vendor/zsv-1.3.0/app/utils/pcre2-8/pcre2-8-test.c +0 -123
  171. data/ext/zsv/vendor/zsv-1.3.0/app/utils/pcre2-8/pcre2-8.c +0 -153
  172. data/ext/zsv/vendor/zsv-1.3.0/app/utils/pcre2-8/pcre2-8.h +0 -54
  173. data/ext/zsv/vendor/zsv-1.3.0/app/utils/prop.c +0 -267
  174. data/ext/zsv/vendor/zsv-1.3.0/app/utils/signal.c +0 -53
  175. data/ext/zsv/vendor/zsv-1.3.0/app/utils/string.c +0 -357
  176. data/ext/zsv/vendor/zsv-1.3.0/app/utils/win/dir_exists_longpath.c +0 -83
  177. data/ext/zsv/vendor/zsv-1.3.0/app/utils/win/dl.c +0 -33
  178. data/ext/zsv/vendor/zsv-1.3.0/app/utils/win/fopen_longpath.c +0 -184
  179. data/ext/zsv/vendor/zsv-1.3.0/app/utils/win/foreach_dirent_longpath.c +0 -292
  180. data/ext/zsv/vendor/zsv-1.3.0/app/utils/win/io.c +0 -259
  181. data/ext/zsv/vendor/zsv-1.3.0/app/utils/win/io.h +0 -13
  182. data/ext/zsv/vendor/zsv-1.3.0/app/utils/win/mkdir_longpath.c +0 -255
  183. data/ext/zsv/vendor/zsv-1.3.0/app/utils/win/remove_longpath.c +0 -96
  184. data/ext/zsv/vendor/zsv-1.3.0/app/utils/writer.c +0 -361
  185. data/ext/zsv/vendor/zsv-1.3.0/app/zsv_command.h +0 -40
  186. data/ext/zsv/vendor/zsv-1.3.0/app/zsv_command_standalone.c +0 -16
  187. data/ext/zsv/vendor/zsv-1.3.0/app/zsv_main.h +0 -44
  188. data/ext/zsv/vendor/zsv-1.3.0/examples/js/zsv_parser_api_dummy.c +0 -3
  189. data/ext/zsv/vendor/zsv-1.3.0/examples/lib/parse_by_chunk.c +0 -100
  190. data/ext/zsv/vendor/zsv-1.3.0/examples/lib/print_my_column.c +0 -143
  191. data/ext/zsv/vendor/zsv-1.3.0/examples/lib/pull.c +0 -89
  192. data/ext/zsv/vendor/zsv-1.3.0/examples/lib/simple.c +0 -123
  193. data/ext/zsv/vendor/zsv-1.3.0/fuzz/fuzz.c +0 -16
  194. data/ext/zsv/vendor/zsv-1.3.0/include/zsv/api.h +0 -336
  195. data/ext/zsv/vendor/zsv-1.3.0/include/zsv/common.h +0 -361
  196. data/ext/zsv/vendor/zsv-1.3.0/include/zsv/ext/implementation.h +0 -62
  197. data/ext/zsv/vendor/zsv-1.3.0/include/zsv/ext/implementation_private.h +0 -113
  198. data/ext/zsv/vendor/zsv-1.3.0/include/zsv/ext/sheet.h +0 -73
  199. data/ext/zsv/vendor/zsv-1.3.0/include/zsv/ext.h +0 -329
  200. data/ext/zsv/vendor/zsv-1.3.0/include/zsv/utils/arg.h +0 -90
  201. data/ext/zsv/vendor/zsv-1.3.0/include/zsv/utils/cache.h +0 -49
  202. data/ext/zsv/vendor/zsv-1.3.0/include/zsv/utils/clock.h +0 -36
  203. data/ext/zsv/vendor/zsv-1.3.0/include/zsv/utils/compiler.h +0 -58
  204. data/ext/zsv/vendor/zsv-1.3.0/include/zsv/utils/db.h +0 -19
  205. data/ext/zsv/vendor/zsv-1.3.0/include/zsv/utils/dirs.h +0 -147
  206. data/ext/zsv/vendor/zsv-1.3.0/include/zsv/utils/dl.h +0 -22
  207. data/ext/zsv/vendor/zsv-1.3.0/include/zsv/utils/emcc/fs_api.h +0 -28
  208. data/ext/zsv/vendor/zsv-1.3.0/include/zsv/utils/err.h +0 -22
  209. data/ext/zsv/vendor/zsv-1.3.0/include/zsv/utils/file-mem.h +0 -17
  210. data/ext/zsv/vendor/zsv-1.3.0/include/zsv/utils/file.h +0 -99
  211. data/ext/zsv/vendor/zsv-1.3.0/include/zsv/utils/jq.h +0 -65
  212. data/ext/zsv/vendor/zsv-1.3.0/include/zsv/utils/json.h +0 -19
  213. data/ext/zsv/vendor/zsv-1.3.0/include/zsv/utils/mem.h +0 -19
  214. data/ext/zsv/vendor/zsv-1.3.0/include/zsv/utils/memmem.h +0 -13
  215. data/ext/zsv/vendor/zsv-1.3.0/include/zsv/utils/os.h +0 -54
  216. data/ext/zsv/vendor/zsv-1.3.0/include/zsv/utils/overwrite.h +0 -71
  217. data/ext/zsv/vendor/zsv-1.3.0/include/zsv/utils/overwrite_writer.h +0 -53
  218. data/ext/zsv/vendor/zsv-1.3.0/include/zsv/utils/prop.h +0 -107
  219. data/ext/zsv/vendor/zsv-1.3.0/include/zsv/utils/signal.h +0 -18
  220. data/ext/zsv/vendor/zsv-1.3.0/include/zsv/utils/sql.h +0 -11
  221. data/ext/zsv/vendor/zsv-1.3.0/include/zsv/utils/string.h +0 -148
  222. data/ext/zsv/vendor/zsv-1.3.0/include/zsv/utils/utf8.h +0 -41
  223. data/ext/zsv/vendor/zsv-1.3.0/include/zsv/utils/win/dl.h +0 -25
  224. data/ext/zsv/vendor/zsv-1.3.0/include/zsv/utils/writer.h +0 -101
  225. data/ext/zsv/vendor/zsv-1.3.0/include/zsv/zsv_export.h +0 -33
  226. data/ext/zsv/vendor/zsv-1.3.0/include/zsv.h +0 -20
  227. data/ext/zsv/vendor/zsv-1.3.0/src/vector_delim.c +0 -60
  228. data/ext/zsv/vendor/zsv-1.3.0/src/zsv.c +0 -484
  229. data/ext/zsv/vendor/zsv-1.3.0/src/zsv_internal.c +0 -731
  230. data/ext/zsv/vendor/zsv-1.3.0/src/zsv_scan_delim.c +0 -285
  231. data/ext/zsv/vendor/zsv-1.3.0/src/zsv_scan_fixed.c +0 -88
  232. data/ext/zsv/vendor/zsv-1.3.0/src/zsv_strencode.c +0 -51
@@ -1,131 +0,0 @@
1
- /* Copyright (C) 2022 Guarnerix Inc dba Liquidaty - All Rights Reserved
2
- * Unauthorized copying of this file, via any medium is strictly prohibited
3
- * Proprietary and confidential
4
- * Written by Matt Wong <matt@guarnerix.com>
5
- */
6
-
7
- /*
8
- * remove a given file and its cache
9
- */
10
-
11
- #include <stdlib.h>
12
- #include <stdio.h>
13
- #include <string.h>
14
- #include <unistd.h> // unlink()
15
- #include <errno.h>
16
-
17
- #define ZSV_COMMAND_NO_OPTIONS
18
- #define ZSV_COMMAND rm
19
- #include "zsv_command.h"
20
-
21
- #include <zsv/utils/dirs.h>
22
- #include <zsv/utils/cache.h>
23
-
24
- /**
25
- * TO DO: add --orphaned option to remove all orphaned caches
26
- */
27
- const char *zsv_rm_usage_msg[] = {
28
- APPNAME ": remove a file and its related cache",
29
- "",
30
- "Usage: " APPNAME " [options] <filepath>",
31
- "",
32
- "Options:",
33
- " -v,--verbose : verbose output",
34
- #ifndef NO_STDIN
35
- " -f,--force : do not prompt for confirmation",
36
- #endif
37
- " -k,--keep : do not remove related cache",
38
- " -C,--cache : only remove related cache (not the file)",
39
- NULL,
40
- };
41
-
42
- static int zsv_rm_usage(FILE *target) {
43
- for (size_t j = 0; zsv_rm_usage_msg[j]; j++)
44
- fprintf(target, "%s\n", zsv_rm_usage_msg[j]);
45
- return target == stdout ? 0 : 1;
46
- }
47
-
48
- int ZSV_MAIN_NO_OPTIONS_FUNC(ZSV_COMMAND)(int argc, const char *argv[]) {
49
- int err = 0;
50
- if (argc > 1 && (!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help")))
51
- err = zsv_rm_usage(stdout);
52
- else if (argc < 2)
53
- err = zsv_rm_usage(stderr);
54
- else {
55
- const char *filepath = NULL;
56
- char force = 0;
57
- #ifdef NO_STDIN
58
- force = 1;
59
- #endif
60
- char remove_cache = 1;
61
- char remove_file = 1;
62
- char verbose = 0;
63
- for (int i = 1; !err && i < argc; i++) {
64
- const char *arg = argv[i];
65
- if (*arg == '-') {
66
- if (!strcmp(arg, "-v") || !strcmp(arg, "--verbose"))
67
- verbose = 1;
68
- else if (!strcmp(arg, "-f") || !strcmp(arg, "--force"))
69
- force = 1;
70
- else if (!strcmp(arg, "-k") || !strcmp(arg, "--keep"))
71
- remove_cache = 0;
72
- else if (!strcmp(arg, "-C") || !strcmp(arg, "--cache"))
73
- remove_file = 0;
74
- else
75
- err = zsv_printerr(1, "Unrecognized option: %s", arg);
76
- } else if (!filepath)
77
- filepath = arg;
78
- else
79
- err = zsv_printerr(1, "Unrecognized option: %s", arg);
80
- }
81
-
82
- if (!err && !filepath)
83
- err = zsv_rm_usage(stderr);
84
- else if (remove_file == 0 && remove_cache == 0)
85
- err = fprintf(stderr, "Nothing to remove\n");
86
-
87
- if (!err) {
88
- char ok = 1;
89
- #ifndef NO_STDIN
90
- if (!force) {
91
- ok = 0;
92
- if (!remove_file)
93
- printf("Are you sure you want to remove the entire cache for the file %s?\n", filepath);
94
- else
95
- printf("Are you sure you want to remove the file %s%s?\n", filepath,
96
- remove_cache ? " and all of its cache contents" : "");
97
- char buff[64];
98
- if (fscanf(stdin, "%60s", buff) == 1 && strchr("Yy", buff[0]))
99
- ok = 1;
100
- }
101
- #endif
102
- if (ok) {
103
- if (remove_file) {
104
- if (verbose)
105
- fprintf(stderr, "Removing %s", filepath);
106
- err = unlink(filepath);
107
- if (err) {
108
- if (err == ENOENT && force)
109
- err = 0;
110
- else
111
- perror(filepath);
112
- }
113
- }
114
- if (!err) {
115
- unsigned char *cache_dir = zsv_cache_path((const unsigned char *)filepath, NULL, 0);
116
- if (!cache_dir)
117
- err = zsv_printerr(ENOMEM, "Out of memory!");
118
- else if (zsv_dir_exists((const char *)cache_dir)) {
119
- err = zsv_remove_dir_recursive(cache_dir);
120
- if (verbose) {
121
- if (!err)
122
- fprintf(stderr, "Removed cache %s", cache_dir);
123
- }
124
- }
125
- free(cache_dir);
126
- }
127
- }
128
- }
129
- }
130
- return err;
131
- }
@@ -1,130 +0,0 @@
1
- /**
2
- * Get a list of ending positions for each column name based on the ending position of each column name
3
- * where the first row is of the below form (dash = whitespace):
4
- * ----COLUMN1----COLUMN2-----COLUMN3----
5
- *
6
- * Approach:
7
- * - read the first [256k] of data [to do: alternatively, read only the first line]
8
- * - merge all read lines into a single line where line[i] = 'x' for each position i at which
9
- * a non-white char appeared in any scanned line
10
- * - from the merged line, find each instance of white followed by not-white,
11
- * but ignore the first instance of it
12
- */
13
- static enum zsv_status auto_detect_fixed_column_sizes(struct fixed *fixed, struct zsv_opts *opts, unsigned char *buff,
14
- size_t buffsize, size_t *buff_used, char verbose) {
15
- size_t max_lines = fixed->max_lines ? fixed->max_lines : 9999999999;
16
- enum zsv_status stat = zsv_status_ok;
17
-
18
- fixed->count = 0;
19
- char *line = calloc(buffsize, sizeof(*buff));
20
- if (!line) {
21
- stat = zsv_status_memory;
22
- goto auto_detect_fixed_column_sizes_exit;
23
- }
24
- memset(line, ' ', buffsize);
25
-
26
- *buff_used = fread(buff, 1, buffsize, opts->stream);
27
- if (!*buff_used) {
28
- stat = zsv_status_no_more_input;
29
- goto auto_detect_fixed_column_sizes_exit;
30
- }
31
-
32
- size_t lines_read = 0;
33
- size_t line_end = 0;
34
- size_t line_cursor = 0;
35
- char first = 1;
36
- char was_space = 1;
37
- char was_line_end = 0;
38
- for (size_t i = 0; i < *buff_used && (!line_end || max_lines == 0 || lines_read < max_lines);
39
- i++, line_cursor = was_line_end ? 0 : line_cursor + 1) {
40
- was_line_end = 0;
41
- // TO DO: support multi-byte unicode chars?
42
- switch (buff[i]) {
43
- case '\n':
44
- case '\r':
45
- if (line_cursor > line_end)
46
- line_end = line_cursor;
47
- was_line_end = 1;
48
- was_space = 1;
49
- lines_read++;
50
- break;
51
- case '\t':
52
- case '\v':
53
- case '\f':
54
- case ' ':
55
- was_space = 1;
56
- break;
57
- default:
58
- line[line_cursor] = 'x';
59
- if (was_space) {
60
- if (!line_end) { // only count columns for the first line
61
- if (first)
62
- first = 0;
63
- else
64
- fixed->count++;
65
- }
66
- }
67
- was_space = 0;
68
- }
69
- }
70
- if (!first)
71
- fixed->count++;
72
-
73
- if (!line_end) {
74
- stat = zsv_status_error;
75
- goto auto_detect_fixed_column_sizes_exit;
76
- }
77
-
78
- if (verbose)
79
- fprintf(stderr, "Calculating %zu columns from line:\n%.*s\n", fixed->count, (int)line_end, line);
80
-
81
- // allocate offsets
82
- free(fixed->offsets);
83
- fixed->offsets = NULL; // unnecessary line to silence codeQL false positive
84
- fixed->offsets = calloc(fixed->count, sizeof(*fixed->offsets));
85
- if (!fixed->offsets) {
86
- stat = zsv_status_memory;
87
- goto auto_detect_fixed_column_sizes_exit;
88
- }
89
-
90
- // now we have our merged line, so calculate the sizes
91
- // do the loop again, but assign values this time
92
- int count = 0;
93
- was_space = 1;
94
- first = 1;
95
- if (verbose)
96
- fprintf(stderr, "Running --fixed ");
97
- size_t i;
98
- for (i = 0; i < line_end; i++) {
99
- if (line[i] == 'x') {
100
- if (was_space) {
101
- if (first)
102
- first = 0;
103
- else {
104
- if (verbose)
105
- fprintf(stderr, "%s%zu", count ? "," : "", i);
106
- fixed->offsets[count++] = i;
107
- }
108
- }
109
- was_space = 0;
110
- } else
111
- was_space = 1;
112
- }
113
- if (!first) {
114
- if (verbose)
115
- fprintf(stderr, "%s%zu", count ? "," : "", i);
116
- if (i)
117
- fixed->offsets[count++] = i;
118
- fixed->count = count;
119
- }
120
- if (verbose)
121
- fprintf(stderr, "\n");
122
-
123
- // add a buffer to the last column in case subsequent lines are longer than what we scanned
124
- if (fixed->count)
125
- fixed->offsets[fixed->count - 1] += 50;
126
-
127
- auto_detect_fixed_column_sizes_exit:
128
- free(line);
129
- return stat;
130
- }
@@ -1,118 +0,0 @@
1
- #include <sys/types.h> // Required for off_t
2
-
3
- #ifndef ZSV_NO_PARALLEL
4
- #include "parallel.h"
5
- #endif
6
-
7
- #define ZSV_SELECT_MAX_COLS_DEFAULT 1024
8
- #define ZSV_SELECT_MAX_COLS_DEFAULT_S "1024"
9
-
10
- struct zsv_select_search_str {
11
- struct zsv_select_search_str *next;
12
- const char *value;
13
- size_t len;
14
- };
15
-
16
- struct zsv_select_uint_list {
17
- struct zsv_select_uint_list *next;
18
- unsigned int value;
19
- };
20
-
21
- struct fixed {
22
- size_t *offsets;
23
- size_t count;
24
- size_t max_lines; // max lines to use to calculate offsets
25
- char autodetect;
26
- };
27
-
28
- struct zsv_select_data {
29
- const char *input_path;
30
- unsigned int current_column_ix;
31
- size_t data_row_count;
32
-
33
- struct zsv_opts *opts;
34
- zsv_parser parser;
35
- unsigned int errcount;
36
-
37
- unsigned int output_col_index; // num of cols printed in current row
38
-
39
- // output columns:
40
- const char **col_argv;
41
- int col_argc;
42
- char *cols_to_print; // better: bitfield
43
-
44
- struct {
45
- unsigned int ix; // index of the input column to be output
46
- struct { // merge data: only used with --merge
47
- struct zsv_select_uint_list *indexes, **last_index;
48
- } merge;
49
- } *out2in; // array of .output_cols_count length; out2in[x] = y where x = output ix, y = input info
50
-
51
- unsigned int output_cols_count; // total count of output columns
52
-
53
- #define MAX_EXCLUSIONS 1024
54
- const unsigned char *exclusions[MAX_EXCLUSIONS];
55
- unsigned int exclusion_count;
56
-
57
- unsigned int header_name_count;
58
- unsigned char **header_names;
59
-
60
- const char *prepend_header; // --prepend-header
61
-
62
- char header_finished;
63
-
64
- char embedded_lineend;
65
-
66
- double sample_pct;
67
-
68
- unsigned sample_every_n;
69
-
70
- size_t data_rows_limit;
71
- size_t skip_data_rows;
72
-
73
- struct zsv_select_search_str *search_strings;
74
- #ifdef HAVE_PCRE2_8
75
- struct zsv_select_regex *search_regexs;
76
- #endif
77
-
78
- zsv_csv_writer csv_writer;
79
-
80
- size_t overflow_size;
81
-
82
- struct fixed fixed;
83
-
84
- #ifndef ZSV_NO_PARALLEL
85
- unsigned num_chunks;
86
- off_t end_offset_limit; // Byte offset where the current parser instance should stop
87
- off_t next_row_start; // Actual byte offset of the last row that was processed
88
- struct zsv_parallel_data *parallel_data; // Pointer to the thread management structure
89
- #endif
90
-
91
- // FLAGS
92
- unsigned char whitespace_clean_flags;
93
-
94
- unsigned char print_all_cols : 1;
95
- unsigned char use_header_indexes : 1;
96
- unsigned char no_trim_whitespace : 1;
97
- unsigned char cancelled : 1;
98
- unsigned char skip_this_row : 1;
99
- unsigned char verbose : 1;
100
- unsigned char clean_white : 1;
101
- unsigned char prepend_line_number : 1;
102
-
103
- unsigned char any_clean : 1;
104
- #define ZSV_SELECT_DISTINCT_MERGE 2
105
- unsigned char distinct : 2; // 1 = ignore subsequent cols, ZSV_SELECT_DISTINCT_MERGE = merge subsequent cols (first
106
- // non-null value)
107
- unsigned char unescape : 1;
108
- unsigned char no_header : 1; // --no-header
109
- unsigned char run_in_parallel : 1; // Flag if parallel mode is active
110
- unsigned char _ : 2; // Reduced padding by 1 bit due to addition of run_in_parallel
111
- };
112
-
113
- enum zsv_select_column_index_selection_type {
114
- zsv_select_column_index_selection_type_none = 0,
115
- zsv_select_column_index_selection_type_single,
116
- zsv_select_column_index_selection_type_range,
117
- zsv_select_column_index_selection_type_lower_bounded
118
- };
@@ -1,45 +0,0 @@
1
- #include <errno.h>
2
-
3
- static struct zsv_parallel_data *zsv_parallel_data_new(unsigned num_chunks) {
4
- struct zsv_parallel_data *pdata = calloc(1, sizeof(*pdata));
5
- if (pdata) {
6
- pdata->threads = calloc(num_chunks, sizeof(*pdata->threads));
7
- pdata->chunk_data = calloc(num_chunks, sizeof(*pdata->chunk_data));
8
- pdata->num_chunks = num_chunks;
9
- if (pdata->threads && pdata->chunk_data)
10
- return pdata;
11
- zsv_parallel_data_delete(pdata);
12
- }
13
- // if we got here, we had a memory allocation failure
14
- errno = ENOMEM;
15
- return NULL;
16
- }
17
-
18
- static void zsv_chunk_data_clear_output(struct zsv_chunk_data *c) {
19
- if (c) {
20
- #ifdef __linux__
21
- if (c->tmp_output_filename) {
22
- unlink(c->tmp_output_filename);
23
- free(c->tmp_output_filename);
24
- c->tmp_output_filename = NULL;
25
- }
26
- #else
27
- if (c->tmp_f) {
28
- zsv_memfile_close(c->tmp_f);
29
- c->tmp_f = NULL;
30
- }
31
- #endif
32
- }
33
- }
34
-
35
- static void zsv_parallel_data_delete(struct zsv_parallel_data *pdata) {
36
- if (pdata) {
37
- for (unsigned int i = 0; i < pdata->num_chunks; i++) {
38
- if (pdata->chunk_data)
39
- zsv_chunk_data_clear_output(&pdata->chunk_data[i]);
40
- }
41
- free(pdata->threads);
42
- free(pdata->chunk_data);
43
- free(pdata);
44
- }
45
- }
@@ -1,41 +0,0 @@
1
- #ifndef ZSV_SELECT_PARALLEL_H
2
- #define ZSV_SELECT_PARALLEL_H
3
-
4
- #include <sys/types.h> // Required for off_t
5
- #include <pthread.h> // Required for pthread_t
6
-
7
- /**
8
- * @brief Data structure passed to each worker thread (Chunk 2, 3, 4)
9
- * Uses in-memory output buffer to avoid I/O lock contention.
10
- */
11
- struct zsv_chunk_data {
12
- #ifdef __linux__
13
- char *tmp_output_filename; // use temp file because we can use zero-copy file concatenation
14
- #else
15
- void *tmp_f; // use zsv_memfile * because we cannot do zero-copy file concatenation
16
- #endif
17
- off_t start_offset;
18
- off_t end_offset; // Stop processing when current offset exceeds this
19
- off_t actual_next_row_start;
20
- struct zsv_opts *opts; // Configuration options (read-only)
21
- enum zsv_status status;
22
- int id;
23
- unsigned char skip : 1;
24
- unsigned char _ : 7;
25
- };
26
-
27
- /**
28
- * @brief Structure to manage thread handles and chunk data for parallel processing.
29
- */
30
- struct zsv_parallel_data {
31
- struct zsv_select_data *main_data;
32
- unsigned num_chunks;
33
- pthread_t *threads; // array of N (num_chunks) pointers
34
- struct zsv_chunk_data *chunk_data; // array of N chunk datas
35
- };
36
-
37
- static struct zsv_parallel_data *zsv_parallel_data_new(unsigned num_chunks);
38
- static void zsv_chunk_data_clear_output(struct zsv_chunk_data *c);
39
- static void zsv_parallel_data_delete(struct zsv_parallel_data *pdata);
40
-
41
- #endif
@@ -1,107 +0,0 @@
1
- #ifndef NDEBUG
2
- __attribute__((always_inline)) static inline
3
- #endif
4
- unsigned char *
5
- zsv_select_cell_clean(struct zsv_select_data *data, unsigned char *utf8_value, char *quoted, size_t *lenp) {
6
-
7
- size_t len = *lenp;
8
- // to do: option to replace or warn non-printable chars 0 - 31:
9
- // vectorized scan
10
- // replace or warn if found
11
- if (UNLIKELY(data->unescape)) {
12
- size_t new_len = zsv_strunescape_backslash(utf8_value, len);
13
- if (new_len != len) {
14
- *quoted = 1;
15
- len = new_len;
16
- }
17
- }
18
-
19
- if (UNLIKELY(!data->no_trim_whitespace))
20
- utf8_value = (unsigned char *)zsv_strtrim(utf8_value, &len);
21
-
22
- if (UNLIKELY(data->clean_white))
23
- len = zsv_strwhite(utf8_value, len, data->whitespace_clean_flags); // to do: zsv_clean
24
-
25
- if (UNLIKELY(data->embedded_lineend && *quoted)) {
26
- unsigned char *tmp;
27
- const char *to_replace[] = {"\r\n", "\r", "\n"};
28
- for (int i = 0; i < 3; i++) {
29
- while ((tmp = memmem(utf8_value, len, to_replace[i], strlen(to_replace[i])))) {
30
- if (strlen(to_replace[i]) == 1)
31
- *tmp = data->embedded_lineend;
32
- else {
33
- size_t right_len = utf8_value + len - tmp;
34
- memmove(tmp + 1, tmp + 2, right_len - 2);
35
- *tmp = data->embedded_lineend;
36
- len--;
37
- }
38
- }
39
- }
40
- if (data->no_trim_whitespace)
41
- utf8_value = (unsigned char *)zsv_strtrim(utf8_value, &len);
42
- }
43
- *lenp = len;
44
- return utf8_value;
45
- }
46
-
47
- static inline char zsv_select_row_search_hit(struct zsv_select_data *data) {
48
- if (!data->search_strings
49
- #ifdef HAVE_PCRE2_8
50
- && !data->search_regexs
51
- #endif
52
- )
53
- return 1;
54
-
55
- char have_overwrite = 0;
56
- unsigned int j = zsv_cell_count(data->parser);
57
- // Convert all bytes between cells to NUL so we can accurately search the entire row in one goe
58
- unsigned char *start = NULL;
59
- unsigned char *end = NULL;
60
- for (unsigned int i = 0; i < j; i++) {
61
- struct zsv_cell cell = zsv_get_cell(data->parser, i);
62
- if (cell.overwritten)
63
- have_overwrite = 1;
64
- if (i == 0)
65
- start = cell.str;
66
- if (UNLIKELY(data->any_clean != 0))
67
- cell.str = zsv_select_cell_clean(data, cell.str, &cell.quoted, &cell.len);
68
- if (end) {
69
- while (end < cell.str) {
70
- *end = '\0';
71
- end++;
72
- }
73
- }
74
- end = cell.str + cell.len;
75
- }
76
-
77
- if (have_overwrite) {
78
- for (unsigned int i = 0; i < j; i++) {
79
- struct zsv_cell cell = zsv_get_cell(data->parser, i);
80
- if (cell.len) {
81
- start = cell.str;
82
- end = cell.str + cell.len;
83
- for (struct zsv_select_search_str *ss = data->search_strings; ss; ss = ss->next)
84
- if (ss->value && *ss->value && end > start && memmem(start, end - start, ss->value, ss->len))
85
- return 1;
86
- #ifdef HAVE_PCRE2_8
87
- for (struct zsv_select_regex *rs = data->search_regexs; rs; rs = rs->next)
88
- if (rs->regex && zsv_pcre2_8_match(rs->regex, start, end - start))
89
- return 1;
90
- #endif
91
- }
92
- }
93
- } else {
94
- if (end > start) {
95
- for (struct zsv_select_search_str *ss = data->search_strings; ss; ss = ss->next)
96
- if (ss->value && *ss->value && end > start && memmem(start, end - start, ss->value, ss->len))
97
- return 1;
98
-
99
- #ifdef HAVE_PCRE2_8
100
- for (struct zsv_select_regex *rs = data->search_regexs; rs; rs = rs->next)
101
- if (rs->regex && zsv_pcre2_8_match(rs->regex, start, end - start))
102
- return 1;
103
- #endif
104
- }
105
- }
106
- return 0;
107
- }
@@ -1,20 +0,0 @@
1
- // demo_random_bw_1_and_100(): this is a poor random number generator. you probably
2
- // will want to use a better one
3
- static double demo_random_bw_1_and_100(void) {
4
- #ifdef HAVE_ARC4RANDOM_UNIFORM
5
- return (long double)(arc4random_uniform(1000000)) / 10000;
6
- #else
7
- double max = 100.0;
8
- unsigned int n;
9
- #ifdef HAVE_RAND_S
10
- unsigned int tries = 0;
11
- while (rand_s(&n) && tries++ < 10)
12
- ;
13
- return (double)n / ((double)UINT_MAX + 1) * max;
14
- #else
15
- unsigned int umax = ~0;
16
- n = rand();
17
- return (double)n / ((double)(umax) + 1) * max;
18
- #endif
19
- #endif
20
- }
@@ -1,61 +0,0 @@
1
- #ifdef HAVE_PCRE2_8
2
-
3
- #include "../utils/pcre2-8/pcre2-8.h"
4
-
5
- struct zsv_select_regex {
6
- struct zsv_select_regex *next;
7
- const char *pattern;
8
- regex_handle_t *regex;
9
- // unsigned char has_anchors:1;
10
- unsigned char _ : 7;
11
- };
12
-
13
- static void zsv_select_regexs_delete(struct zsv_select_regex *rs) {
14
- for (struct zsv_select_regex *next; rs; rs = next) {
15
- next = rs->next;
16
- zsv_pcre2_8_delete(rs->regex);
17
- free(rs);
18
- }
19
- }
20
-
21
- static void zsv_select_add_regex(struct zsv_select_data *data, const char *pattern) {
22
- if (pattern && *pattern) {
23
- struct zsv_select_regex *sr = calloc(1, sizeof(*sr));
24
- sr->pattern = pattern;
25
- sr->regex = zsv_pcre2_8_new(pattern, 0);
26
- if (sr->regex) {
27
- sr->next = data->search_regexs;
28
- data->search_regexs = sr;
29
- } else
30
- free(sr->regex);
31
- }
32
- }
33
-
34
- /**
35
- * @brief create a full, independent duplicate of the regex list
36
- */
37
- static struct zsv_select_regex *zsv_select_regexs_dup(struct zsv_select_regex *src) {
38
- struct zsv_select_regex *head = NULL;
39
- struct zsv_select_regex **tail = &head;
40
-
41
- while (src) {
42
- struct zsv_select_regex *new_node = calloc(1, sizeof(*new_node));
43
- if (!new_node) {
44
- zsv_select_regexs_delete(head);
45
- return NULL;
46
- }
47
-
48
- // Copy the pattern pointer (safe, strings are static/const)
49
- new_node->pattern = src->pattern;
50
-
51
- // FULL RECOMPILE: Call the standard new() function.
52
- // This creates a fresh pcre2_code AND a fresh match_data buffer.
53
- new_node->regex = zsv_pcre2_8_new(src->pattern, 0);
54
-
55
- *tail = new_node;
56
- tail = &new_node->next;
57
- src = src->next;
58
- }
59
- return head;
60
- }
61
- #endif
@@ -1,14 +0,0 @@
1
- static void zsv_select_search_str_delete(struct zsv_select_search_str *ss) {
2
- for (struct zsv_select_search_str *next; ss; ss = next) {
3
- next = ss->next;
4
- free(ss);
5
- }
6
- }
7
-
8
- static void zsv_select_add_search(struct zsv_select_data *data, const char *value) {
9
- struct zsv_select_search_str *ss = calloc(1, sizeof(*ss));
10
- ss->value = value;
11
- ss->len = value ? strlen(value) : 0;
12
- ss->next = data->search_strings;
13
- data->search_strings = ss;
14
- }