Changeset 6813

Show
Ignore:
Timestamp:
09/09/10 20:23:50 (17 months ago)
Author:
westram
Message:
  • merged from refactor [6796] [6804] [6806] [6808]
    • added header for planned library ARB_CORE
    • renamed inline.h into arb_str.h
    • header for global general purpose defines/inlines (arb_defs.h)
      • use ARRAY_ELEMS where applicable
    • removed duplicate of ARB_strscmp (GBS_strscmp). No longer needed cause ARBDB is now C++
Location:
trunk
Files:
1 removed
32 modified
3 copied

Legend:

Unmodified
Added
Removed
  • trunk/ALIV3/a3_ptree1.cxx

    r6488 r6813  
    1212#include "a3_ptree.hxx" 
    1313 
    14 #include <inline.h> 
     14#include <arb_str.h> 
    1515 
    1616#include <iostream> 
  • trunk/ALIV3/a3_ptree2.cxx

    r6488 r6813  
    1212#include "a3_ptree.hxx" 
    1313 
    14 #include <inline.h> 
     14#include <arb_str.h> 
    1515 
    1616#include <iostream> 
  • trunk/ALIV3/a3_seq.cxx

    r6488 r6813  
    1313 
    1414#include <arbdb.h> 
    15 #include <inline.h> 
     15#include <arb_str.h> 
    1616 
    1717#include <iostream> 
  • trunk/ARBDB/ad_prot.h

    r6812 r6813  
    201201char *GBS_fconvert_string(char *buffer); 
    202202char *GBS_replace_tabs_by_spaces(const char *text); 
    203 int GBS_strscmp(const char *s1, const char *s2); 
    204203const char *GBS_readable_size(unsigned long long size); 
    205204char *GBS_trim(const char *str); 
  • trunk/ARBDB/adlang1.cxx

    r6659 r6813  
    1919 
    2020#include <static_assert.h> 
     21#include <arb_defs.h> 
    2122 
    2223#define AWAR_TREE_REFRESH "tmp/focus/tree_refresh" // touch this awar to refresh the tree display 
     
    26922693}; 
    26932694 
    2694 void gbl_install_standard_commands(GBDATA *gb_main) 
    2695 { 
    2696     gb_install_command_table(gb_main, gbl_command_table, sizeof(gbl_command_table)/sizeof(gbl_command_table[0])); 
    2697 } 
     2695void gbl_install_standard_commands(GBDATA *gb_main) { 
     2696    gb_install_command_table(gb_main, gbl_command_table, ARRAY_ELEMS(gbl_command_table)); 
     2697} 
  • trunk/ARBDB/adstring.cxx

    r6812 r6813  
    19531953} 
    19541954 
    1955 int GBS_strscmp(const char *s1, const char *s2) { 
    1956     int    cmp = 0; 
    1957     size_t idx = 0; 
    1958     while (!cmp) { 
    1959         if (!s1[idx] || !s2[idx]) break; 
    1960         cmp = s1[idx] - s2[idx]; 
    1961         ++idx; 
    1962     } 
    1963     return cmp; 
    1964 } 
    1965  
    19661955const char *GBS_readable_size(unsigned long long size) { 
    19671956    // return human readable size information 
  • trunk/ARBDB/adtcp.cxx

    r6736 r6813  
    1414 
    1515#include <arbdbt.h> 
    16 #include <inline.h> 
     16#include <arb_str.h> 
    1717 
    1818#include "gb_local.h" 
  • trunk/ARBDB/adtools.cxx

    r6659 r6813  
    99// =============================================================== // 
    1010 
     11#include <arb_str.h> 
    1112#include <arbdbt.h> 
    1213 
     
    130131    } 
    131132    else { 
    132         if (GBS_strscmp(insert->datapath, key+1) == 0) { // datapath matches 
     133        if (ARB_strscmp(insert->datapath, key+1) == 0) { // datapath matches 
    133134            to_insert    = strdup(key+strlen(insert->datapath)); // cut off prefix 
    134135            to_insert[0] = key[0]; // copy type 
  • trunk/ARBDB/arb_assert.h

    r6743 r6813  
    9999 * (done because automatic backtrace on SIGSEGV lacks name of current function) 
    100100 */ 
     101 
     102#ifndef ARB_CORE_H 
     103#include <arb_core.h> 
     104#endif 
     105#ifndef AD_K_PROT_H 
     106#error "header dependencies broken (missing prototypes from ad_k_prot.h)" 
     107#endif 
    101108 
    102109#define ARB_SIGSEGV(backtrace) do {                             \ 
  • trunk/AWT/AWT_db_browser.cxx

    r6666 r6813  
    1414#include "awt.hxx" 
    1515 
    16 #include <inline.h> 
     16#include <arb_str.h> 
    1717#include <AP_Tree.hxx> 
    1818 
  • trunk/AWT/AWT_www.cxx

    r6588 r6813  
    1515#include <aw_awars.hxx> 
    1616#include <arbdbt.h> 
    17 #include <inline.h> 
     17#include <arb_str.h> 
     18#include <arb_defs.h> 
    1819#include <static_assert.h> 
    1920 
     
    5859 
    5960    const int DEFAULT_SELECT = 1; // SILVA 
    60     const int EXAMPLE_COUNT  = sizeof(example)/sizeof(*example); 
     61    const int EXAMPLE_COUNT  = ARRAY_ELEMS(example); 
    6162    COMPILE_ASSERT(EXAMPLE_COUNT <= WWW_COUNT); 
    6263 
  • trunk/AWTI/AWTI_export.cxx

    r6550 r6813  
    1818#include <aw_window.hxx> 
    1919#include <arbdbt.h> 
    20 #include <inline.h> 
     20#include <arb_str.h> 
    2121 
    2222#define AWAR_EXPORT_FILE           "tmp/export_db/file" 
  • trunk/EDIT4/ED4_protein_2nd_structure.cxx

    r6593 r6813  
    2222 
    2323#include "arbdbt.h" 
    24 #include <inline.h> 
    2524 
    2625#include <iostream> 
  • trunk/EDIT4/ED4_text_terminals.cxx

    r6513 r6813  
    2828#include <awt_attributes.hxx> 
    2929#include <st_window.hxx> 
    30 #include <inline.h> 
     30#include <arb_str.h> 
    3131 
    3232#include <iostream> 
  • trunk/MERGE/MG_gene_species.cxx

    r6597 r6813  
    2222#include <adGene.h> 
    2323#include <arbdbt.h> 
    24 #include <inline.h> 
     24#include <arb_str.h> 
    2525 
    2626using namespace std; 
  • trunk/MERGE/MG_species.cxx

    r6567 r6813  
    1818#include <aw_awars.hxx> 
    1919#include <arbdbt.h> 
    20 #include <inline.h> 
     20#include <arb_str.h> 
    2121 
    2222#define AWAR1 "tmp/merge1/" 
  • trunk/NTREE/NT_dbrepair.cxx

    r6385 r6813  
    1919#include <aw_color_groups.hxx> 
    2020 
    21 #include <inline.h> 
     21#include <arb_str.h> 
    2222 
    2323#include <map> 
  • trunk/PROBE/PT_io.cxx

    r6463 r6813  
    1414#include <arbdbt.h> 
    1515#include <BI_helix.hxx> 
    16 #include <inline.h> 
     16#include <arb_str.h> 
    1717 
    1818int compress_data(char *probestring) { 
  • trunk/PROBE/PT_new_design.cxx

    r6659 r6813  
    1515#include "probe_tree.hxx" 
    1616#include <arbdbt.h> 
    17 #include <inline.h> 
     17#include <arb_str.h> 
    1818 
    1919#ifdef P_ 
  • trunk/SL/AW_NAME/AW_rename.cxx

    r6811 r6813  
    1414#include <aw_awars.hxx> 
    1515#include <aw_window.hxx> 
    16 #include <inline.h> 
     16#include <cctype> 
    1717 
    1818#include <names_client.h> 
  • trunk/SL/DB_SCANNER/db_scanner.cxx

    r6422 r6813  
    1818#include <aw_select.hxx> 
    1919 
    20 #include <inline.h> 
     20#include <arb_str.h> 
    2121#include <arbdbt.h> 
    2222 
  • trunk/SL/FAST_ALIGNER/fast_aligner.cxx

    r6722 r6813  
    1818 
    1919#include <awtc_next_neighbours.hxx> 
    20  
    2120#include <awt_sel_boxes.hxx> 
    2221 
     
    2524 
    2625#include <arbdbt.h> 
     26 
     27#include <arb_defs.h> 
    2728 
    2829#include <cctype> 
     
    29692970} 
    29702971 
    2971 #define TEST_SPECIES_COUNT(test_ali_data) (sizeof(test_ali_data)/sizeof(*test_ali_data)) 
    2972 #define TEST_CREATE_DB(error, test_ali_data) test_create_DB(error, test_ali_data, TEST_SPECIES_COUNT(test_ali_data)) 
     2972#define TEST_SPECIES_COUNT(test_ali_data)   ARRAY_ELEMS(test_ali_data) 
     2973#define TEST_CREATE_DB(error,test_ali_data) test_create_DB(error, test_ali_data, TEST_SPECIES_COUNT(test_ali_data)) 
    29732974 
    29742975static const char *get_aligned_data_of(GBDATA *gb_main, const char *species_name) { 
  • trunk/SL/FILTER/AP_filter.cxx

    r6602 r6813  
    1111#include "AP_filter.hxx" 
    1212#include <arbdb.h> 
    13 #include <inline.h> 
     13#include <arb_str.h> 
    1414 
    1515 
  • trunk/SL/PRONUC/AP_pro_a_nucs.cxx

    r6510 r6813  
    1313#include <AP_codon_table.hxx> 
    1414#include <arbdbt.h> 
    15 #include <inline.h> 
     15#include <arb_str.h> 
    1616 
    1717#define pn_assert(cond) arb_assert(cond) 
  • trunk/SL/SEQUENCE/AP_seq_dna.cxx

    r6592 r6813  
    66#include <ARB_Tree.hxx> 
    77 
    8 #include <inline.h> 
     8#include <arb_str.h> 
    99 
    1010char *AP_sequence_parsimony::table; 
  • trunk/SL/SEQUENCE/AP_seq_protein.cxx

    r6591 r6813  
    66#include <ARB_Tree.hxx> 
    77 
    8 #include <inline.h> 
     8#include <arb_str.h> 
    99#include <climits> 
    1010 
  • trunk/SOURCE_TOOLS/generate_all_links.sh

    r6750 r6813  
    139139symlink_file ../TEMPLATES/SigHandler.h INCLUDE/SigHandler.h && 
    140140symlink_file ../TEMPLATES/arb_backtrace.h INCLUDE/arb_backtrace.h && 
     141symlink_file ../TEMPLATES/arb_core.h INCLUDE/arb_core.h && 
    141142symlink_file ../TEMPLATES/arb_debug.h INCLUDE/arb_debug.h && 
     143symlink_file ../TEMPLATES/arb_defs.h INCLUDE/arb_defs.h && 
    142144symlink_file ../TEMPLATES/arb_error.h INCLUDE/arb_error.h && 
     145symlink_file ../TEMPLATES/arb_str.h INCLUDE/arb_str.h && 
    143146symlink_file ../TEMPLATES/arb_version.h INCLUDE/arb_version.h && 
    144147symlink_file ../TEMPLATES/arbtools.h INCLUDE/arbtools.h && 
     
    148151symlink_file ../TEMPLATES/downcast.h INCLUDE/downcast.h && 
    149152symlink_file ../TEMPLATES/dupstr.h INCLUDE/dupstr.h && 
    150 symlink_file ../TEMPLATES/inline.h INCLUDE/inline.h && 
    151153symlink_file ../TEMPLATES/output.h INCLUDE/output.h && 
    152154symlink_file ../TEMPLATES/perf_timer.h INCLUDE/perf_timer.h && 
  • trunk/TEMPLATES/arb_error.h

    r6385 r6813  
    1212#ifndef ARB_ERROR_H 
    1313#define ARB_ERROR_H 
     14 
     15#ifndef ARB_CORE_H 
     16#include <arb_core.h> 
     17#endif 
    1418 
    1519// ARB_ERROR is a dropin replacement for GB_ERROR (C++ only) 
  • trunk/TEMPLATES/arb_str.h

    r6804 r6813  
    1313#define ARB_STR_H 
    1414 
     15#ifndef _CPP_CSTDDEF 
     16#include <cstddef> 
     17#endif 
     18#ifndef _CPP_CCTYPE 
    1519#include <cctype> 
    16  
    17 #ifndef __cplusplus 
    18 // this header only works with c++ 
    19 // those functions needed by ARBDB are duplicated in adstring.c (with GBS_-prefix) 
    20 #error inline.h may be used in C++ only 
    2120#endif 
    2221 
  • trunk/TOOLS/arb_probe.cxx

    r6750 r6813  
    1313#include <client.h> 
    1414#include <servercntrl.h> 
     15#include <arb_defs.h> 
    1516 
    1617struct apd_sequence { 
     
    451452} 
    452453 
    453 #define COUNT(array) sizeof(array)/sizeof(*array) 
    454  
    455454void TEST_SLOW_match_probe() { 
    456455    const char *arguments[] = { 
     
    462461        "BcSSSS00\1" "  BcSSSS00            0     0  0.0   2 0   .......UU-===============-UCAAGUCGA\1"; 
    463462 
    464     test_arb_probe(COUNT(arguments), arguments, expected); 
     463    test_arb_probe(ARRAY_ELEMS(arguments), arguments, expected); 
    465464} 
    466465 
     
    485484        "AUCAAGUCGAGCGAUGAA 18 B-     1   16    4 44.4 52.0    UUCAUCGCUCGACUUGAU |  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  1,  2,  3,\n"; 
    486485 
    487     test_arb_probe(COUNT(arguments), arguments, expected); 
     486    test_arb_probe(ARRAY_ELEMS(arguments), arguments, expected); 
    488487} 
    489488 
     
    500499    "ClfPerfr\1" "  ClfPerfr            0     0  0.0  17 0   AGAGUUUGA-==================-UUUCCUUCG\1"; 
    501500 
    502     test_arb_probe(COUNT(arguments), arguments, expected); 
     501    test_arb_probe(ARRAY_ELEMS(arguments), arguments, expected); 
    503502} 
    504503 
  • trunk/WINDOW/AW_button.cxx

    r6675 r6813  
    2020#include <arbdbt.h> 
    2121 
    22 #include <inline.h> 
     22#include <arb_str.h> 
    2323 
    2424#include <Xm/Frame.h> 
  • trunk/WINDOW/AW_device.cxx

    r6411 r6813  
    1212#include "aw_commn.hxx" 
    1313 
    14 #include <inline.h> 
     14#include <arb_str.h> 
    1515 
    1616void AW_clip::set_cliprect(AW_rectangle *rect, bool allow_oversize) { 
  • trunk/WINDOW/AW_xkey.cxx

    r6674 r6813  
    1414 
    1515#include <arbdbt.h> 
     16#include <arb_defs.h> 
    1617 
    1718#include <X11/Xlib.h> 
     
    9697}; 
    9798 
    98 #define ARRAY_ELEMS(array)            (sizeof(array)/sizeof(array[0])) 
    99 #define TERMINATED_ARRAY_ELEMS(array) (ARRAY_ELEMS(array)-1) 
    100  
    10199const int FIXEDMOD = TERMINATED_ARRAY_ELEMS(awxkeymap); 
    102100const int MODFREE  = TERMINATED_ARRAY_ELEMS(awxkeymap_modfree);