Haiku API Bindings
SupportKit
Not logged in

Documentation | SupportKit

SYNOPSIS

Perl

use HaikuR1::SupportKit;

Python

from HaikuR1.SupportKit import int_to_code, code_to_int

DESCRIPTION

Acts as the entry point for the classes and submodules in the Support Kit. Also contains two utility functions.

For more information on the Support Kit, see the Be Book introduction and the Haiku Book introduction.

CLASSES AND SUBMODULES

FUNCTIONS

These utility functions are not part of the Haiku R1 API; they are for convenience. The built-in type codes and message constants are 32-bit integers whose individual bytes are equivalent to ASCII characters; this makes it easy to print the bytes of a constant directly to the console when writing code in C++.

However, it's not as easy with interpreted languages, so these functions map between the integer values and the 4-character strings.

Perl

use HaikuR1::SupportKit qw(:util)

Python

Python does not support export tags.

int_to_code

Converts an integer type to a string code.

Perl

my $code = int_to_code($type);

Python

code = int_to_code(type)

code_to_int

Converts a string code to an integer type.

Perl

my $type= code_to_int($code);

Python

type= code_to_int(code)