Common libraries collection 5

Discussing libraries simplifying applications development
  • I'll upload all the source code to SVN someday in near future, so if anyone has an ability to provide bindings for libraries to be used in other languages than assembler - you're welcome.

    Appropriate bindings for some languages to use libini may look like (without additional specifiers):

    C:

    Code: Select all

    typedef BOOL (*ini_section_callback_t)(char *filename, char *section_name);
    typedef BOOL (*ini_key_callback_t)(char *filename, char *section_name, char *key_name, char *key_value);
    
    int ini_enum_sections(char *filename, ini_section_callback_t callback);
    int ini_enum_keys(char *filename, char *section_name, ini_key_callback_t callback);
    int ini_get_str(char *filename, char *section_name, char *key_name, char *buffer, int buffer_size, char *default_value);
    int ini_set_str(char *filename, char *section_name, char *key_name, char *value, int value_size);
    int ini_get_int(char *filename, char *section_name, char *key_name, int default_value);
    int ini_set_int(char *filename, char *section_name, char *key_name, int value);
    Pascal:

    Code: Select all

    type
      PIniSectionCallback = ^TIniSectionCallback;
      TIniSectionCallback = function(FileName, SectionName: PChar): LongBool;
      PIniKeyCallback = ^TIniKeyCallback;
      TIniKeyCallback = function(FileName, SectionName, KeyName, KeyValue: PChar): LongBool;
    
    function IniEnumSections(FileName: PChar; Callback: PIniSectionCallback): Integer;
    function IniEnumKeys(FileName, SectionName: PChar; Callback: PIniKeyCallback): Integer;
    function IniGetStr(FileName, SectionName, KeyName: PChar; Buffer: PChar; BufferSize: Integer; DefaultValue: PChar): Integer;
    function IniSetStr(FileName, SectionName, KeyName: PChar; Value: PChar; ValueSize: Integer): Integer;
    function IniGetInt(FileName, SectionName, KeyName: PChar; DefaultValue: Integer): Integer;
    function IniSetInt(FileName, SectionName, KeyName: PChar; Value: Integer): Integer;
    in code we trust
  • Who is online

    Users browsing this forum: No registered users and 29 guests