/* This file has been generated from
 *    default.xs and
 *    ptype.header
 */

/* --------------------------------------------------------------------------------
 *  File      : default.xs
 *  Purpose   : some input for arb_proto_2_xsub unit-test
 * -------------------------------------------------------------------------------- */

#ifndef __cplusplus
#error please compile as C++
#endif

#include "XSUB.h"

static GB_shell4perl perl_shell;

/* --------------------------------------------------------------------------------
 * the following functions are hand-coded in ARB.default.xs:
 */

MODULE = FAKE PACKAGE = ARB PREFIX = P2A_
PROTOTYPES: ENABLE


MODULE = FAKE PACKAGE = BIO PREFIX = P2AT_


# --------------------------------------------------------------------------------
# functions below are auto-generated by ../../../PERLTOOLS/arb_proto_2_xsub.cxx
# using prototypes from ptype.header
# --------------------------------------------------------------------------------

# --------------------------------------------------------------------------------
MODULE = ARB  PACKAGE = ARB  PREFIX = P2A_

char *
P2A_get_type_name(gbd)
    GBDATA *gbd

  CODE:
    RETVAL = const_cast<char *>(GB_get_type_name(gbd));

  OUTPUT:
    RETVAL


void
P2A_dump_db_path(gbd)
    GBDATA *gbd

  PPCODE:
    GB_dump_db_path(gbd);


char *
P2A_fix_database(gb_main)
    GBDATA *gb_main

  CODE:
    RETVAL = const_cast<char *>(GB_fix_database(gb_main));

  OUTPUT:
    RETVAL


void
P2A_set_verbose()

  PPCODE:
    GB_set_verbose();


void
P2A_set_next_main_idx(idx)
    long idx

  PPCODE:
    GB_set_next_main_idx(idx);


GBDATA *
P2A_open(path, opent)
    char *path
    char *opent

  CODE:
    RETVAL = GB_open(const_cast<const char *>(path), const_cast<const char *>(opent));

  OUTPUT:
    RETVAL


char *
P2A_delete_database(filename)
    char *filename

  CODE:
    RETVAL = const_cast<char *>(GB_delete_database(const_cast<const char *>(filename)));

  OUTPUT:
    RETVAL


char *
P2A_set_cache_size(gbd, size)
    GBDATA *gbd
    size_t size

  CODE:
    freeset(static_pntr, GB_set_cache_size(gbd, size));
    RETVAL = static_pntr;

  OUTPUT:
    RETVAL


char *
P2A_create_index(gbd, key, case_sens, estimated_size)
    GBDATA *gbd
    char *key
    char *case_sens
    long estimated_size

  CODE:
    RETVAL = const_cast<char *>(GB_create_index(gbd, const_cast<const char *>(key), GBP_charPtr_2_GB_CASE(const_cast<const char *>(case_sens)), estimated_size));

  OUTPUT:
    RETVAL


char *
P2A_request_undo_type(gb_main, type)
    GBDATA *gb_main
    char *type

  CODE:
    RETVAL = const_cast<char *>(GB_request_undo_type(gb_main, GBP_charPtr_2_GB_UNDO_TYPE(const_cast<const char *>(type))));

  OUTPUT:
    RETVAL


char *
P2A_get_requested_undo_type(gb_main)
    GBDATA *gb_main

  CODE:
    RETVAL = const_cast<char *>(GBP_GB_UNDO_TYPE_2_charPtr(GB_get_requested_undo_type(gb_main)));

  OUTPUT:
    RETVAL


char *
P2A_undo(gb_main, type)
    GBDATA *gb_main
    char *type

  CODE:
    RETVAL = const_cast<char *>(GB_undo(gb_main, GBP_charPtr_2_GB_UNDO_TYPE(const_cast<const char *>(type))));

  OUTPUT:
    RETVAL


GBDATA *
P2A_find(gbd, key, gbs)
    GBDATA *gbd
    char *key
    char *gbs

  CODE:
    RETVAL = GB_find(gbd, const_cast<const char *>(key), GBP_charPtr_2_GB_SEARCH_TYPE(const_cast<const char *>(gbs)));

  OUTPUT:
    RETVAL


GBDATA *
P2A_find_string(gbd, key, str, case_sens, gbs)
    GBDATA *gbd
    char *key
    char *str
    char *case_sens
    char *gbs

  CODE:
    RETVAL = GB_find_string(gbd, const_cast<const char *>(key), const_cast<const char *>(str), GBP_charPtr_2_GB_CASE(const_cast<const char *>(case_sens)), GBP_charPtr_2_GB_SEARCH_TYPE(const_cast<const char *>(gbs)));

  OUTPUT:
    RETVAL


char *
P2A_command_interpreter(gb_main, str, commands, gbd, default_tree_name)
    GBDATA *gb_main
    char *str
    char *commands
    GBDATA *gbd
    char *default_tree_name

  CODE:
    freeset(static_pntr, GB_command_interpreter(gb_main, const_cast<const char *>(str), const_cast<const char *>(commands), gbd, const_cast<const char *>(default_tree_name)));
    RETVAL = static_pntr;

  OUTPUT:
    RETVAL


GB_ULONG
P2A_time_of_day()

  CODE:
    RETVAL = GB_time_of_day();

  OUTPUT:
    RETVAL


double
P2A_atof(str)
    char *str

  CODE:
    RETVAL = GB_atof(const_cast<const char *>(str));

  OUTPUT:
    RETVAL


char *
P2A_read_type(gbd)
    GBDATA *gbd

  CODE:
    RETVAL = const_cast<char *>(GBP_GB_TYPES_2_charPtr(GB_read_type(gbd)));

  OUTPUT:
    RETVAL


GBDATA *
P2A_create(father, key, type)
    GBDATA *father
    char *key
    char *type

  CODE:
    RETVAL = GB_create(father, const_cast<const char *>(key), GBP_charPtr_2_GB_TYPES(const_cast<const char *>(type)));

  OUTPUT:
    RETVAL


# --------------------------------------------------------------------------------
MODULE = ARB  PACKAGE = BIO  PREFIX = P2AT_

bool
P2AT_is_genome_db(gb_main, default_value)
    GBDATA *gb_main
    int default_value

  CODE:
    RETVAL = GEN_is_genome_db(gb_main, default_value);

  OUTPUT:
    RETVAL


char *
P2AT_origin_organism(gb_pseudo)
    GBDATA *gb_pseudo

  CODE:
    RETVAL = const_cast<char *>(GEN_origin_organism(gb_pseudo));

  OUTPUT:
    RETVAL


long
P2AT_get_organism_count(gb_main)
    GBDATA *gb_main

  CODE:
    RETVAL = GEN_get_organism_count(gb_main);

  OUTPUT:
    RETVAL


char *
P2AT_global_gene_identifier(gb_gene, gb_organism)
    GBDATA *gb_gene
    GBDATA *gb_organism

  CODE:
    freeset(static_pntr, GEN_global_gene_identifier(gb_gene, gb_organism));
    RETVAL = static_pntr;

  OUTPUT:
    RETVAL


char *
P2AT_check_arb_file(name)
    char *name

  CODE:
    RETVAL = const_cast<char *>(GBT_check_arb_file(const_cast<const char *>(name)));

  OUTPUT:
    RETVAL


char *
P2AT_get_type_of_changekey(gb_main, field_name, change_key_path)
    GBDATA *gb_main
    char *field_name
    char *change_key_path

  CODE:
    RETVAL = const_cast<char *>(GBP_GB_TYPES_2_charPtr(GBT_get_type_of_changekey(gb_main, const_cast<const char *>(field_name), const_cast<const char *>(change_key_path))));

  OUTPUT:
    RETVAL


char *
P2AT_write_sequence(gb_data, ali_name, ali_len, sequence)
    GBDATA *gb_data
    char *ali_name
    long ali_len
    char *sequence

  CODE:
    RETVAL = const_cast<char *>(GBT_write_sequence(gb_data, const_cast<const char *>(ali_name), ali_len, const_cast<const char *>(sequence)));

  OUTPUT:
    RETVAL


