40 using namespace SEQIO;
 
   43 #define MAX_COMMENT_LINES 2000 
   46 inline const char *
name_only(
const char *fullpath) {
 
   47     const char *lslash = strrchr(fullpath, 
'/');
 
   48     return lslash ? lslash+1 : fullpath;
 
   66     while ((ch = *(s++))) {
 
   69                 ch = *(s++); 
if (!ch) { s--; 
break; };
 
   71                     case 'n':   *(d++) = 
'\n'; 
break;
 
   72                     case 't':   *(d++) = 
'\t'; 
break;
 
   73                     case '0':   *(d++) = 
'\0'; 
break;
 
   74                     default:    *(d++) = ch; 
break;
 
   87     FILE     *in    = fopen(fullfile, 
"rt");
 
   98             error = strchr(name, 
'*')
 
   99                 ? 
"Please use 'AUTO DETECT' or manually select an import format" 
  105         size_t  lineNumber    = 0;
 
  106         bool    include_error = 
false;
 
  110 #define GLOBAL_COMMAND(cmd) (!error && strcmp(s1, cmd) == 0) 
  111 #define MATCH_COMMAND(cmd)  (GLOBAL_COMMAND(cmd) && (m || !(error = not_in_match_error(cmd)))) 
  131                 if (strlen(s2) != 1 || s2[0]<
'a' || s2[0]>
'z') {
 
  132                     error = 
"Allowed variable names are a-z";
 
  135                     var_set[s2[0]-
'a'] = 
true;
 
  140                 if (s2[0]) reassign(m->
mtag, s2);
 
  141                 else error = 
"Empty TAG is not allowed";
 
  165                 if (error) include_error = 
true;
 
  174                 if (ifnotset || setglobal) {
 
  175                     if (s2[0]<
'a' || s2[0]>
'z') {
 
  176                         error = 
"Allowed variable names are a-z";
 
  180                         while (isblank(s2[off])) off++;
 
  183                             char        varname = s2[0];
 
  184                             const char *arg2    = s2+off;
 
  197                                 var_set[varname-
'a'] = 
true;
 
  212         if (!error && !included) { 
 
  214                 if      (!ifo->
system)     error = 
"Missing command SYSTEM (needed with NEW_FORMAT)";
 
  215                 else if (!ifo->
new_format) error = 
"Missing command NEW_FORMAT (needed with SYSTEM)";
 
  218                     error = 
"SEQUENCESTART/SEQUENCEAFTER cannot be used together with NEW_FORMAT";
 
  223                     error = 
"neither SEQUENCESTART nor SEQUENCEAFTER specified (need one of them)";
 
  230                                       include_error ? 
"included " : 
"",
 
  232                                       included ? 
"file" : 
"import format",
 
  240 #undef GLOBAL_COMMAND 
  258     for (
int i = 0; i<IFS_VARIABLES && !
error; i++) {
 
  259         bool ifnotset = ifo->variable_errors.get(i+
'a');
 
  261             bool isglobal = ifo->global_variables.get(i+
'a');
 
  262             if (!ifnotset && !isglobal) { 
 
  268                 error = 
GBS_global_string(
"Warning: useless IFNOTSET for unused variable '%c'", 
'a'+i);
 
  274     if (ifo->match) ifo->match = ifo->match->reverse(
NULp);
 
  311     new_format_lineno(0),
 
  316     read_this_sequence_line_too(0),
 
  351 static int cmp_ift(
const void *p0, 
const void *p1, 
void *) {
 
  352     return ARB_stricmp((
const char *)p0, (
const char *)p1);
 
  356     const char *name  = strrchr(file, 
'/');
 
  357     name              = name ? name+1 : file;
 
  358     return name[0]   == 
'.';
 
  362     for (
int i = files.size()-1; i >= 0; --i) {
 
  375         for (
unsigned i = 0; i<dirs.
size(); ++i) 
GBS_read_dir(files, dirs[i], 
"*.ift");
 
  385     int matched_count = 0;
 
  398                 test            = popen(com, 
"r");
 
  401             if (!test) error = 
"No input file specified -> cannot detect anything";
 
  406             if (size>=0) buffer[size] = 0;
 
  413     for (
int idx = 0; files[idx] && !
error; ++idx) {
 
  414         const char *filtername = files[idx];
 
  427                     if (matched == -1) matched = idx; 
 
  428                     if (first == -1) first     = idx; 
 
  430                     if (strcmp(filtername, prev_selected) == 0) { 
 
  438         delete ifo; ifo = 
NULp;
 
  441     const char *select = 
NULp;
 
  443         switch (matched_count) {
 
  445                 AW_advice(
"Not all formats can be auto-detected.\n" 
  446                           "Some need to be selected manually.",
 
  448                           "No format auto-detected",
 
  451                 select = 
"unknown.ift";
 
  455                 AW_advice(
"Several import filters matched during auto-detection.\n" 
  456                           "Click 'AUTO DETECT' again to select next matching import-filter.",
 
  458                           "Several formats detected",
 
  470                 select = files[matched];  
 
  475         select = prev_selected;
 
  485     if (current_file_idx<0) current_file_idx = 0;
 
  488     while (result == 1 && filenames[current_file_idx]) {
 
  489         const char *origin_file_name = filenames[current_file_idx++];
 
  491         const char *sorigin   = strrchr(origin_file_name, 
'/');
 
  492         if (!sorigin) sorigin = origin_file_name;
 
  496         char     *mid_file_name  = 
NULp;
 
  497         char     *dest_file_name = 
NULp;
 
  499         if (ifo2 && ifo2->
system) {
 
  501                 const char *sorigin_nameonly            = strrchr(sorigin, 
'/');
 
  502                 if (!sorigin_nameonly) sorigin_nameonly = sorigin;
 
  518                 if (!error) origin_file_name = mid_file_name;
 
  525         if (!error && ifo->
system) {
 
  527                 const char *sorigin_nameonly            = strrchr(sorigin, 
'/');
 
  528                 if (!sorigin_nameonly) sorigin_nameonly = sorigin;
 
  546                 if (!error) origin_file_name = dest_file_name;
 
  554             in = fopen(origin_file_name, 
"r");
 
  569         if (dest_file_name) {
 
  571             free(dest_file_name);
 
  588     static char *in_queue  = 
NULp; 
 
  589     static int   b2offset  = 0;
 
  617             sprintf(ifo->
b1, 
"%s", sequenceend);
 
  618             if (in) { fclose(in); in = 
NULp; }
 
  621         int len = strlen(p)-1;
 
  623             if (p[len] == 
'\n' || p[len] == 13) p[len--] = 0;
 
  634         strncpy(ifo->
b2+b2offset, in_queue, BUFSIZE - 4- b2offset);
 
  635         b2offset += strlen(ifo->
b2+b2offset);
 
  642             if (in) { fclose(in); in = 
NULp; }
 
  645         int len = strlen(p)-1;
 
  647             if (p[len] == 
'\n' || p[len] == 13) p[len--] = 0;
 
  658         for (i=0; i<=
tab; i++) 
if (ifo->
b1[i] != 
' ') 
break;
 
  664         strncpy(ifo->
b2+b2offset, SEPARATOR, BUFSIZE - 4- b2offset);
 
  665         b2offset += strlen(ifo->
b2+b2offset);
 
  668         if (b2offset>0) 
while (*p==
' ') p++;    
 
  670         strncpy(ifo->
b2+b2offset, p, BUFSIZE - 4- b2offset);
 
  671         b2offset += strlen(ifo->
b2+b2offset);
 
  680     const int len_str = strlen(str);
 
  682         while (str[0] == 
' ' || str[0] == 
'\t' || str[0] == 
'|') str++;
 
  684         while (i >= 0 && (str[i] == 
' ' || str[i] == 
'\t' || str[i] == 
'|' || str[i] == 13)) {
 
  693             write_entry(gb_main, gbd, key, copy, tag, append, type);
 
  717     const int len_tag_incl_brackets = tag ? strlen(tag)+2 : 0;
 
  718     if (!gbk || !append) {
 
  730             if (strcmp(key, 
"name") == 0) {
 
  744     const int  len = len_str + strlen(strin);
 
  745     char      *buf = ARB_calloc<char>(len+2+len_tag_incl_brackets+1);
 
  748         char *regexp = ARB_alloc<char>(len_tag_incl_brackets+3);
 
  749         sprintf(regexp, 
"*[%s]*", tag);
 
  752             sprintf(buf, 
"%s [%s] %s", strin, tag, str); 
 
  758         sprintf(buf, 
"%s %s", strin, str);
 
  768     string::const_iterator norm_start = source.begin();
 
  769     string::const_iterator p          = norm_start;
 
  770     error_occurred                    = 
false;
 
  772     while (p != source.end()) {
 
  779                 const string *value = variables.
get(*p);
 
  794                     error_occurred = 
true;
 
  817     if (!p) 
return "Cannot find start of file: Wrong format or empty file";
 
  820     const  int start_counter = counter;
 
  829         const int  rel_counter = counter-start_counter;
 
  834             if (rel_counter % 10 == 0) {
 
  835                 sprintf(text, 
"Reading species %i", rel_counter);
 
  839             sprintf(text, 
"spec%i", counter);
 
  844             const char *f = strrchr(filenames[current_file_idx-1], 
'/');
 
  845             if (!f) f = filenames[current_file_idx-1];
 
  850         static bool  never_warn = 
false;
 
  855             if (
line == max_line) {
 
  857                                                    " * possible reasons: wrong input format or very long comment/data\n" 
  858                                                    " * please examine imported data if you decide to continue\n",
 
  859                                                    filenames[current_file_idx] ? filenames[current_file_idx] : 
"<unknown>",
 
  862                 switch (
aw_question(
"import_long_lines", msg, 
"Continue Reading,Continue Reading (Never ask again),Abort")) {
 
  877             if (strlen(p) > ifo->
tab) {
 
  879                     const char *what_error = 
NULp;
 
  881                         char *dup = p+ifo->
tab;
 
  882                         while (*dup == 
' ' || *dup == 
'\t') dup++;
 
  895                             if (error) what_error = 
"SRT";
 
  901                         if (!error && match->aci) {
 
  911                             if (error) what_error = 
"ACI";
 
  914                         if (!error && (match->append || match->write)) {
 
  920                                 string expanded_field = 
expandSetVariables(variables, 
string(match->append ? match->append : match->write), err_flag, ifo);
 
  923                                 if (error) what_error = match->append ? 
"APPEND" : 
"WRITE";
 
  926                             if (!error && match->mtag) {
 
  928                                 string expanded_tag = 
expandSetVariables(variables, 
string(match->mtag), err_flag, ifo);
 
  931                                 if (error) what_error = 
"TAG";
 
  935                                 write_entry(gb_import_main, gb_species, field, s, tag, 
bool(match->append), match->type);
 
  941                         if (!error && match->setvar) variables.
set(match->setvar[0], s);
 
  946                         error = 
GBS_global_string(
"'%s'\nin %s of MATCH (defined at #%s)", error, what_error, match->defined_at);
 
  960         return GB_export_errorf(
"No Start of Sequence found (%i lines read)", max_line);
 
  967                 for (
int linecnt = 0; ; linecnt++) {
 
  983                 freeset(sequence, h);
 
  999                 sprintf(buf, 
"ARB_%lX", 
id);
 
 1006         if (ruleset.
isSet()) {
 
 1027     else if (!mask[0])                 error = 
"No file selected to import"; 
 
 1040         error = 
"no import filter selected";
 
 1052                                               "Only one level of form nesting (NEW_FORMAT) allowed",
 
 1072     bool     is_genom_db             = 
false;
 
 1073     bool     delete_db_type_if_error = 
false; 
 
 1083         if (read_genom_db!=is_genom_db) {
 
 1085                 error = 
"You can only import whole genom sequences into a genom database.";
 
 1088                 error = 
"You can't import whole genom sequences into a non-genom ARB database.";
 
 1113             if (is_genom_db && strcmp(ali_type, 
"dna")!=0) {
 
 1114                 error = 
"You must set the alignment type to dna when importing genom sequences.";
 
 1117                 if (!
GBT_create_new_alignment(gb_import_main, ali_name, 2000, 0, ali_protection, ali_type, 
"while importing data")) {
 
 1124         bool ask_generate_names = 
true;
 
 1136                     if (fts[0]) error = 
"field transfer sets do not work with genome flatfile importer";
 
 1140                     int successfull_imports = 0;
 
 1141                     int failed_imports      = 0;
 
 1144                     for (count = 0; fnames[count]; ++count) ; 
 
 1155                     for (
long curr = 0; !error && fnames[curr]; ++curr) {
 
 1160                             const char *lslash = strrchr(fnames[curr], 
'/');
 
 1165                         fprintf(stderr, 
"import of '%s'\n", fnames[curr]);
 
 1169                         if (!error_this_file) {
 
 1171                             successfull_imports++;
 
 1172                             delete_db_type_if_error = 
false;
 
 1175                             error_this_file = 
GBS_global_string(
"'%s' not imported\nReason: %s", fnames[curr], error_this_file);
 
 1184                     if (!successfull_imports) {
 
 1185                         error = 
"Nothing has been imported";
 
 1188                         GB_warningf(
"%i of %i files were imported with success", successfull_imports, (successfull_imports+failed_imports));
 
 1198                 error = load_format(awr); 
 
 1226                     error = 
read_data(ali_name, ali_protection, ruleset);
 
 1228                         error = 
GBS_global_string(
"Error: %s\nwhile reading file %s", error, filenames[current_file_idx-1]);
 
 1232                             ask_generate_names = 
false;
 
 1235                             ask_generate_names = 
true;
 
 1241                 if (in) { fclose(in); in = 
NULp; }
 
 1244                 current_file_idx = 0;
 
 1252             if (delete_db_type_if_error) {
 
 1261             arb_progress progress(
"Checking and Scanning database", 
long(2+ask_generate_names)); 
 
 1262             progress.
subtitle(
"Pass 1: Check entries");
 
 1270             progress.
subtitle(
"Pass 2: Check sequence lengths");
 
 1276             if (ask_generate_names && !keep_found_IDs) {
 
 1278                                 "It's recommended to generate unique species identifiers now.\n",
 
 1279                                 "Generate unique species IDs,Use found IDs") == 0)
 
 1281                     progress.
subtitle(
"Pass 3: Generate unique species IDs");
 
 1284                         bool isDuplicatesWarning;
 
 1286                         if (error && isDuplicatesWarning) {
 
 1312         after_import_cb(awr);
 
 1326             for (
const import_format *iform = ifo; iform; iform = (iform == ifo) ? ifo2 : 
NULp) {
 
 1327                 for (
const import_match *matcher = iform->
match; matcher; matcher = matcher->next) {
 
 1337         if (gb_main_4_nameserver) {
 
 1342             fields.put(
ARB_strdup(
"<no target database>"));
 
 1348     string name_, type_;
 
 1350     AliNameAndType(
const char *ali_name, 
const char *ali_type) : name_(ali_name), type_(ali_type) {}
 
 1352     const char *
name()
 const { 
return name_.c_str(); }
 
 1353     const char *
type()
 const { 
return type_.c_str(); }
 
 1360     bool           switching_to_GENOM_ALIGNMENT = strcmp(ali_name, 
GENOM_ALIGNMENT) == 0;
 
 1363     if (gbmain) last_valid_gbmain = gbmain;
 
 1368     if (switching_to_GENOM_ALIGNMENT) {
 
 1375         free(curr_ali_name);
 
 1376         free(curr_ali_type);
 
 1382     if (last_valid_gbmain) { 
 
 1385         int     protection_to_use = 4;         
 
 1388             GBDATA *gb_write_security = 
GB_entry(gb_ali, 
"alignment_write_security");
 
 1389             if (gb_write_security) {
 
 1390                 protection_to_use = 
GB_read_int(gb_write_security);
 
 1439         aw_message(
"Only works together with 'Import selected format'");
 
 1447     const char *description = 
NULp;
 
 1449     if (ift && !ift[0]) {
 
 1461             if      (!ifo || !ift[0])   description = 
"<no format selected>";
 
 1462             else if (!ifo->
description) description = 
"<no description>";
 
 1480     return gb_imported_main;
 
 1523     static AW_window_simple *aws = 
NULp;
 
 1529         AWT_announce_db_to_browser(importer->
peekImportDB(), 
"New database (import)");
 
 1547         if (def_importname) {
 
 1554         aws = 
new AW_window_simple;
 
 1556         aws->init(awr, 
"ARB_IMPORT", 
"ARB IMPORT");
 
 1557         aws->load_xfig(
"awt/import_db.fig");
 
 1561         aws->create_button(
"CLOSE", 
"CLOSE", 
"C");
 
 1565         aws->create_button(
"HELP", 
"HELP", 
"H");
 
 1572         aws->create_autosize_button(
"AUTO_DETECT", 
"AUTO DETECT", 
"A");
 
 1579         aws->insert_option        (
"dna",     
"d", 
"dna");
 
 1580         aws->insert_default_option(
"rna",     
"r", 
"rna");
 
 1581         aws->insert_option        (
"protein", 
"p", 
"ami");
 
 1582         aws->update_option_menu();
 
 1586         aws->insert_option(
"0", 
"0", 0);
 
 1587         aws->insert_option(
"1", 
"1", 1);
 
 1588         aws->insert_option(
"2", 
"2", 2);
 
 1589         aws->insert_option(
"3", 
"3", 3);
 
 1590         aws->insert_default_option(
"4", 
"4", 4);
 
 1591         aws->insert_option(
"5", 
"5", 5);
 
 1592         aws->insert_option(
"6", 
"6", 6);
 
 1593         aws->update_option_menu();
 
 1598         aws->insert_toggle(
"Import genome data in EMBL, GenBank or DDBJ format", 
"e", 
IMP_GENOME_FLATFILE);
 
 1601         aws->update_toggle_field();
 
 1603         aws->at(
"autoconf");
 
 1616         aws->create_button(
"GO", 
"GO", 
"G", 
"+");
 
 1620         aws->create_button(
"TEST", 
"Test", 
"T");
 
 1635 static void after_import_test_cb(
AW_root*) {}
 
 1637 void TEST_import_filters_loadable() {
 
 1639     ArbImporter testImporter(makeRootCallback(after_import_test_cb));
 
 1647     for (
int i = 0; impFilt[i]; ++i) {
 
 1648         const char *name = strrchr(impFilt[i], 
'/')+1;
 
 1649         TEST_ANNOTATE(name);
 
 1652         if (strcmp(name, 
"fasta_wgap.ift") == 0) {
 
 1654                               "Imports sequences in FASTA format (does not remove gaps)\n" 
 1655                               "Expected header: '>id fullname|...'");
 
 1660 #endif // UNIT_TESTS 
void import_and_continueOnSuccess(AW_window *aww)
GB_ERROR GB_begin_transaction(GBDATA *gbd)
GB_ERROR GBK_system(const char *system_command)
GBDATA * GBT_create_new_alignment(GBDATA *gb_main, const char *name, long len, long aligned, long security, const char *type, const char *why_created)
static AliNameAndType last_ali("ali_new","rna")
GB_ERROR GB_commit_transaction(GBDATA *gbd)
static GB_ERROR tab(GBL_command_arguments *args, bool pretab)
GB_CSTR GB_path_in_arbprop(const char *relative_path)
static void removeHiddenFiles(StrArray &files)
long GB_read_int(GBDATA *gbd)
#define AWAR_IMPORT_FORMATNAME
void XFER_select_RuleSet(AW_window *aww, const char *awar_selected_fts, const AvailableFieldScanner *fieldScanner)
static void genom_flag_changed(AW_root *awr)
char * GBS_string_eval_in_env(const char *insource, const char *icommand, const GBL_call_env &callEnv)
GB_ERROR GB_write_string(GBDATA *gbd, const char *s)
#define AWAR_IMPORT_FORMATDIR
long GBT_mark_all(GBDATA *gb_main, int flag)
#define MATCH_COMMAND(cmd)
char * read_line(int tab, char *sequencestart, char *sequenceend)
GB_ERROR import_data(AW_root *awr, const char *mask, bool keep_found_IDs)
void GB_unlink_or_warn(const char *path, GB_ERROR *error)
static GB_ERROR read_import_format(const char *fullfile, import_format *ifo, bool *var_set, bool included)
GB_ERROR GBT_check_alignment_name(const char *alignment_name)
void AWTI_set_importDB_pointer(GBDATA *&dbPtr)
GBDATA * GBT_get_alignment(GBDATA *gb_main, const char *aliname)
GB_ERROR not_in_match_error(const char *cmd)
int ARB_stricmp(const char *s1, const char *s2)
static ArbImporter * importer
bool read_string_pair(FILE *in, char *&s1, char *&s2, size_t &lineNr)
GB_ERROR GB_IO_error(const char *action, const char *filename)
char * ARB_strdup(const char *str)
void detectAvailableFields(StrArray &fields, FieldsToScan whatToScan)
GB_ERROR GB_export_IO_error(const char *action, const char *filename)
const char * type() const 
const char * GBS_global_string(const char *templat,...)
GB_ERROR AWTC_pars_names(GBDATA *gb_main, bool *isWarningPtr)
void set_db_4_nameserver(GBDATA *gb_main)
void AWTI_cleanup_importer()
void AW_advice(const char *message, AW_Advice_Type type, const char *title, const char *corresponding_help)
Show a message box with an advice for the user. 
char * GBS_string_eval(const char *insource, const char *icommand)
void AW_POPDOWN(AW_window *window)
char * GBS_string_2_key(const char *str)
void cat(const char *from)
__ATTR__USERESULT GB_ERROR configure_macro_recording(AW_root *aw_root, const char *client_id, GBDATA *gb_main)
#define AWTI_IMPORT_CHECK_BUFFER_SIZE
char buffer[MESSAGE_BUFFERSIZE]
AW_awar * add_callback(const RootCallback &cb)
GB_ERROR GB_delete(GBDATA *&source)
bool is_hidden_file(const char *file)
#define AWAR_IMPORT_ALI_TYPE
const char * read_char_pntr() const 
GB_ERROR GB_export_error(const char *error)
GB_ERROR GB_await_error()
GBDATA * AWTI_acquire_imported_DB_and_cleanup_importer()
#define GLOBAL_COMMAND(cmd)
static AW_root * SINGLETON
GBDATA * GB_create_container(GBDATA *father, const char *key)
WindowCallback makeHelpCallback(const char *helpfile)
char * GB_create_tempfile(const char *name)
static void show_comment(const char *comment)
void GB_warningf(const char *templat,...)
#define MAX_COMMENT_LINES
bool isSet() const 
test if SmartPtr is not NULp 
GBDATA * GB_create(GBDATA *father, const char *key, GB_TYPES type)
static ImportFieldScanner fieldScanner
static void create_import_awars(AW_root *awr, const char *def_importname)
static int cmp_ift(const void *p0, const void *p1, void *)
const std::string * get(char c) const 
static void write_entry(GBDATA *gb_main, GBDATA *gbd, const char *key, const char *str, const char *tag, int append, GB_TYPES type)
static string expandSetVariables(const SetVariables &variables, const string &source, bool &error_occurred, const import_format *ifo)
char * GBT_create_unique_species_name(GBDATA *gb_main, const char *default_name)
static void error(const char *msg)
GB_ERROR GB_abort_transaction(GBDATA *gbd)
void AW_create_fileselection_awars(AW_root *awr, const char *awar_base, const char *directories, const char *filter, const char *file_name)
GB_CSTR GB_path_in_ARBHOME(const char *relative_path)
#define AWAR_IMPORT_FORMAT_DESC
static void import_window_close_cb(AW_window *aww, bool *doExit)
AliNameAndType(const char *ali_name, const char *ali_type)
GB_ERROR GI_importGenomeFile(ImportSession &session, const char *file_name, const char *ali_name)
#define AWAR_IMPORT_AUTOCONF
GB_ERROR read_format(const char *file)
static GB_ERROR no_files_found_error(const char *mask)
#define SRT_AUTOCORRECT_ALINAME
const import_format * peek_format() const 
bool contains_wildcards(const char *mask)
char * read_string() const 
GB_CSTR GB_path_in_ARBLIB(const char *relative_path)
GB_ERROR get_error() const 
AW_awar * awar(const char *awar)
void GBS_read_dir(StrArray &names, const char *dir, const char *mask)
const char * XFER_getFullFTS(const char *name)
#define AWAR_IMPORT_FORMATBASE
static void detect_input_format_cb(AW_window *aww)
static char * encode_escaped_chars(char *com)
GB_ERROR GB_write_float(GBDATA *gbd, float f)
GB_ERROR GB_write_int(GBDATA *gbd, long i)
const char * GBT_readOrCreate_char_pntr(GBDATA *gb_container, const char *fieldpath, const char *default_value)
bool wants_import_genome(AW_root *awr)
void scanFields(StrArray &fields, FieldsToScan whatToScan) const OVERRIDE
static void import_and_continue_cb(AW_window *aww)
bool got_macro_ability(AW_root *aw_root)
void species_field_selection_list_rescan(GBDATA *gb_main, RescanMode mode)
char * GB_unique_filename(const char *name_prefix, const char *suffix)
int aw_question(const char *unique_id, const char *question, const char *buttons, bool sameSizeButtons, const char *helpfile)
void appendTo(char *&content, char sep, char *&toAppend)
GB_ERROR GB_export_errorf(const char *templat,...)
static void copy(double **i, double **j)
AW_awar * awar_int(const char *var_name, long default_value=0, AW_default default_file=AW_ROOT_DEFAULT)
void set(char c, const char *s)
TYPE * ARB_calloc(size_t nelem)
char * ARB_strndup(const char *start, int len)
#define awti_assert(cond)
const char * name_only(const char *fullpath)
void subtitle(const char *stitle)
ItemSelector & SPECIES_get_selector()
void gene_field_selection_list_rescan(GBDATA *gb_main, RescanMode mode)
const char * name() const 
uint32_t GBS_checksum(const char *seq, int ignore_case, const char *exclude)
float GB_atof(const char *str)
#define TEST_EXPECT_NO_ERROR(call)
void aw_message(const char *msg)
void detect_format(AW_root *root)
void AWTI_activate_import_test_window(AW_window *awp)
bool is_dynamic(const char *field)
#define AWAR_IMPORT_FILENAME
void AW_create_fileselection(AW_window *aws, const char *awar_prefix, const char *at_prefix, const char *pwd, DirDisplay disp_dirs, bool allow_wildcards)
NOT4PERL GBDATA * GBT_create_sequence_data(GBDATA *species, const char *ali_name, const char *key, GB_TYPES type, int security_write)
GB_ERROR write_string(const char *aw_string)
void GBT_split_string(ConstStrArray &dest, const char *namelist, const char *separator, SplitMode mode)
const char * get_data() const 
NOT4PERL char * GB_command_interpreter_in_env(const char *str, const char *commands, const GBL_call_env &callEnv)
ARB_ERROR getError() const 
void AWTI_open_import_window(AW_root *awr, const char *def_importname, bool do_exit, GBDATA *gb_main, const RootCallback &after_import_cb)
static void update_format_description(const char *ift)
GB_ERROR read_data(char *ali_name, int security_write, FieldTransfer::RuleSetPtr ruleset)
char * AW_extract_directory(const char *path)
GB_transaction ta(gb_var)
GB_CSTR GB_read_char_pntr(GBDATA *gbd)
AW_awar * awar_string(const char *var_name, const char *default_value="", AW_default default_file=AW_ROOT_DEFAULT)
void XFER_refresh_available_fields(AW_root *awr, const AvailableFieldScanner *fieldScanner, FieldsToScan whatToScan)
bool GBS_string_matches(const char *str, const char *expr, GB_CASE case_sens)
GB_ERROR GBT_check_data(GBDATA *Main, const char *alignment_name)
GBDATA * GB_search(GBDATA *gbd, const char *fieldpath, GB_TYPES create)
bool GEN_is_genome_db(GBDATA *gb_main, int default_value)
#define AWAR_IMPORT_FILEBASE
char * fgets_smartLF(char *s, int size, FILE *stream)
#define AWAR_IMPORT_FORMATFILTER
#define AWAR_IMPORT_GENOM_DB
#define TEST_EXPECT_EQUAL(expr, want)
GB_ERROR AW_select_nameserver(GBDATA *gb_main, GBDATA *gb_other_main)
GB_ERROR write_int(long aw_int)
GBDATA * GB_entry(GBDATA *father, const char *key)
void inc_and_check_user_abort(GB_ERROR &error)
void collectKeysRegisteredInDatabase(StrArray &fields, GBDATA *gb_main, ItemSelector &sel, bool skipContainers, bool skipHidden)
void aw_message_if(GB_ERROR error)
void AWTI_import_set_ali_and_type(AW_root *awr, const char *ali_name, const char *ali_type, GBDATA *gbmain)
char * GBS_global_string_copy(const char *templat,...)
bool GB_is_privatefile(const char *path, bool read_private)
#define AWAR_IMPORT_ALI_PROTECTION
GBDATA * GBT_get_species_data(GBDATA *gb_main)
GB_write_int const char s