Sha256: d5ffb9798ed69c809df34d7499fde5b6a8b5006acc662ebb1f2598ce41985aca

Contents?: true

Size: 1.19 KB

Versions: 1

Compression:

Stored size: 1.19 KB

Contents

<% if header? %>
// <%= FFIDB.header %>

<% end %>
#include <cstdarg>     // for va_list
#include <cstdbool>    // for bool
#include <cstddef>     // for size_t
#include <cstdint>     // for {,u}int*_t
#include <sys/types.h> // for off_t, ssize_t
<% for library in @libraries %>

namespace <%= self.options[:module] || library&.name || :lib %> {
<% for enum in @enums[library] || [] %>

  <% if enum.comment %>
<%= format_comment(enum.comment, '  //') %>
  <% end %>
  enum <%= enum.name %> {
  <% for name, value in enum.values || {} %>
    <%= name %> = <%= value %>,
  <% end %>
  };
<% end %>
<% for struct in @structs[library] || [] %>

  <% if struct.comment %>
<%= format_comment(struct.comment, '  //') %>
  <% end %>
  struct <%= struct.name %> {
  <% for name, type in struct.fields || {} %>
    <%= type %> <%= name %>;
  <% end %>
  };
<% end %>
<% for function in @functions[library] || [] %>

  <% if function.comment %>
<%= format_comment(function.comment, '  //') %>
  <% end %>
  extern "C" <%= function.type %> <%= function.name %>(<%=
    function.parameters.each_value.map { |p| "#{p.type} #{p.name}" }.join(', ')
  %>);
<% end %>
} // <%= self.options[:module] || library&.name || :lib %>
<% end %>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ffidb-0.13.0 etc/templates/cpp.erb