Xtansia / anitomy-c

A C ABI wrapper for Anitomy a C++ library for parsing anime video filenames.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

anitomy-c

License Linux & OSX Build Status
anitomy-c is a C ABI wrapper for Anitomy a C++ library for parsing anime video filenames.

Requirements

Caveats & Limitations

  • Only the main general API is implemented so far:
    • Creating & destroying Anitomy instances.
    • Parsing filenames.
    • Access to Elements (const only atm).
    • Access to Options.

Example

#include <stdio.h>
#include "anitomy_c.h"

int main(void) {
  anitomy_t *anitomy = anitomy_new();

  anitomy_parse(anitomy, "[TaigaSubs]_Toradora!_(2008_-_01v2_-_Tiger_and_Dragon_[1280x720_H.264_FLAC][1234ABCD].mkv");

  elements_t *elements = anitomy_elements(anitomy);
  
  char *anime_title = elements_get(elements, kElementAnimeTitle);
  char *episode_number = elements_get(elements, kElementEpisodeNumber);
  char *release_group = elements_get(elements, kElementReleaseGroup);
  
  printf("%s #%s by %s\n", anime_title, episode_number, release_group);
  
  string_free(anime_title);
  string_free(episode_number);
  string_free(release_group);

  anitomy_destroy(anitomy);
}

About

A C ABI wrapper for Anitomy a C++ library for parsing anime video filenames.

License:Mozilla Public License 2.0


Languages

Language:C 47.3%Language:C++ 42.1%Language:CMake 10.6%