<commit_before>#ifdef __cplusplus
extern "C" {
#endif
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#ifdef __cplusplus
}
#endif

#include "ppport.h"

#include <tstring.h>
#include <fileref.h>
#include <tag.h>

#define TITLE "title"
#define TITLE_LEN strlen(TITLE)

#define ARTIST "artist"
#define ARTIST_LEN strlen(ARTIST)

#define ALBUM "album"
#define ALBUM_LEN strlen(ALBUM)

#define TRACK "track"
#define TRACK_LEN strlen(TRACK)


MODULE = TagLib		PACKAGE = TagLib		

PROTOTYPES: ENABLE

HV *
read_tag(file)
    const char *file
  CODE:
    RETVAL = newHV();
    sv_2mortal((SV*)RETVAL);

    TagLib::FileRef f(file);
<commit_msg>Added undef of do_open & do_close to prevent collision with Perl libs<commit_after>#ifdef __cplusplus
extern "C" {
#endif
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#ifdef __cplusplus
}
#endif

#include "ppport.h"

#undef do_open
#undef do_close

#include <tstring.h>
#include <fileref.h>
#include <tag.h>

#define TITLE "title"
#define TITLE_LEN strlen(TITLE)

#define ARTIST "artist"
#define ARTIST_LEN strlen(ARTIST)

#define ALBUM "album"
#define ALBUM_LEN strlen(ALBUM)

#define TRACK "track"
#define TRACK_LEN strlen(TRACK)


MODULE = TagLib		PACKAGE = TagLib		

PROTOTYPES: ENABLE

HV *
read_tag(file)
    const char *file
  CODE:
    RETVAL = newHV();
    sv_2mortal((SV*)RETVAL);

    TagLib::FileRef f(file);

{'fraction_non_alphanumeric': 0.12718023255813954, 'fraction_numerical': 0.0014534883720930232, 'mean_word_length': 4.909871244635193, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6110081', 'n_tokens_mistral': 592, 'n_tokens_neox': 557, 'n_words': 140}