diff options
| author | realtradam <[email protected]> | 2022-03-04 03:51:38 -0500 |
|---|---|---|
| committer | realtradam <[email protected]> | 2022-03-04 03:51:38 -0500 |
| commit | 081d4ff261b1ef684e95cc74bba70b603dfa0929 (patch) | |
| tree | d8e204704e420c0b4ba9d3d0ad3ef9f3c6d333cf | |
| parent | 4cdfd5bcbadb5fe49da7c5e108e42a34b7878ad1 (diff) | |
| download | FelBind-081d4ff261b1ef684e95cc74bba70b603dfa0929.tar.gz FelBind-081d4ff261b1ef684e95cc74bba70b603dfa0929.zip | |
partially sorted json export
| -rw-r--r-- | .gitignore | 2 | ||||
| -rw-r--r-- | scan.rb | 47 |
2 files changed, 48 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c475cc9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +json.json +raylib.h @@ -1 +1,46 @@ -`ctags --output-format=json --c-kinds=pmz --language-force=c raylib.h` # convert to json +require 'json' + +parse = `ctags --output-format=json --c-kinds=pmz --language-force=c raylib.h` +File.write('json.json', parse) +$params = {} +$members = {} +$garbage = [] +$struct = [] +parse.each_line do |line| + json_line = JSON.parse line + puts json_line['kind'] + if json_line['kind'] == 'parameter' + if $params[json_line['scope']].nil? + $params[json_line['scope']] = [] + end + $params[json_line['scope']].push json_line + elsif json_line['kind'] == 'prototype' + $members[json_line['name']] = json_line + elsif json_line['kind'] == 'member' + if json_line['scopeKind'] == 'struct' + $struct.push json_line + else + $garbage.push json_line + end + else + if json_line['scopeKind'] == 'struct' + $garbage.push json_line + end + end +end + +$members.each do |key, item| + puts "Function: #{item['typeref'].gsub(/typename:[^ ]* /,'')} #{item['name']}" + $params.each do |key, param_arry| + param_arry.each do |param| + if param['scope'] == item['name'] + puts "#{param['typeref'].gsub('typename:','')} #{param['name']}" + end + end + end + puts '---' +end + +puts +puts "Struct: #{$struct.size}" +puts "Garbage: #{$garbage.size}(should be 0)" |
