mirror of
https://github.com/tailix/libkernaux.git
synced 2024-11-13 11:04:27 -05:00
1.4 KiB
1.4 KiB
Common
- Add your name to COPYING.
- If you change the behavior (even just fix a bug) of libkernaux (stable) or libc, add a record to ChangeLog.
C language
- Create
typedef
s with the names of relatedstruct
s. Use this name with a prefixstruct
to declare the data itself, withoth the prefix to declare a pointer or an array:
typedef struct FooBar { int car; } *FooBar;
static struct FooBar FooBar_create();
static void FooBar FooBar_init(FooBar foobar);
static void FooBar_do_something(FooBar foobar);
// Initialize:
struct FooBar foobar = FooBar_create();
// or
struct FooBar foobar;
FooBar_init(&foobar);
// Use:
FooBar foobar_ptr = &foobar;
FooBar_do_something(&foobar);
typedef struct FooBar { int car; } FooBar[1];
static struct FooBar FooBar_create();
static void FooBar FooBar_init(FooBar foobar);
static void FooBar_do_something(FooBar foobar);
// Initialize:
FooBar foobar = { FooBar_create() };
// or
FooBar foobar;
FooBar_init(foobar);
// Use:
FooBar_do_something(foobar);
Python
Nothing here yet.
Ruby
Matz's Ruby interpreter
Use RuboCop. See bindings/ruby/.rubocop.yml
mruby
Use RuboCop. See bindings/mruby/.rubocop.yml
Rust
Use rustfmt and Clippy. See bindings/rust/rustfmt.toml