Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Changeset 3368

Show
Ignore:
Timestamp:
03/16/08 08:18:53 (9 months ago)
Author:
larsivi
Message:

Merged in latest trunk.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/lmartin/ftp/dsss.conf

    r3019 r3368  
    3333 
    3434[tango/sys] 
    35 exclude = tango/sys/linux/* tango/sys/darwin/* tango/sys/win32/* 
     35exclude = tango/sys/linux/* tango/sys/darwin/* tango/sys/win32/* tango/sys/freebsd/* 
    3636exclude += tango/sys/TimeConverter.d 
    3737 
     
    4242version (darwin) { 
    4343    [tango/sys/darwin] 
     44} 
     45 
     46version (freebsd) { 
     47    [tango/sys/freebsd] 
    4448} 
    4549 
     
    5559 
    5660[tango/text/locale] 
    57 version (!linux) { 
    58     exclude += tango/text/locale/Linux.d 
     61version (!Posix) { 
     62    exclude += tango/text/locale/Posix.d 
    5963} 
    6064version (!Windows) { 
  • branches/lmartin/ftp/example/dsss.conf

    r3128 r3368  
    11[concurrency/fiber_test.d] 
     2buildflags += -unittest 
    23[conduits/composite.d] 
    34[conduits/createzip.d] 
    4 buildflags += -L-lz 
     5version (Windows) { 
     6    buildflags += -L"zlib;libbz2" 
     7
     8version (Posix) { 
     9    buildflags += -L-lz 
     10
    511[conduits/filebubbler.d] 
    612[conduits/filecat.d] 
     
    1420[conduits/paths.d] 
    1521[conduits/randomio.d] 
     22[conduits/shuffle.d] 
    1623[conduits/unifile.d] 
    1724[console/hello.d] 
     
    3643[text/properties.d] 
    3744[text/token.d] 
     45[text/xmldom.d] 
     46buildflags += -Jtext 
     47[text/xmlpull.d] 
     48buildflags += -Jtext 
     49[text/xmlsax.d] 
     50buildflags += -Jtext 
     51[text/xmlpath.d] 
    3852[vfs/vfszip.d] 
    39 buildflags += -L-lz 
     53version (Windows) { 
     54    buildflags += -L"zlib;libbz2" 
     55
     56version (Posix) { 
     57    buildflags += -L-lz 
     58
  • branches/lmartin/ftp/example/jake-all.bat

    r2465 r3368  
    7070@jake text\localetime.d -I.. -op 
    7171@jake text\token.d -I.. -op 
     72@jake text\xmlpull.d -I.. -op 
     73@jake text\xmldom.d -I.. -op 
     74@jake text\xmlsax.d -I.. -op 
    7275 
    7376@rem FINI 
  • branches/lmartin/ftp/example/vfs/vfszip.d

    r3127 r3368  
    11module vfszip; 
    22 
    3 import tango.io.vfs.ZipArchive
     3import tango.io.vfs.ZipFolder
    44import tango.io.Stdout; 
    55 
     
    2323        zipname = "tmp.zip"; 
    2424 
    25     auto archive = new ZipArchive(zipname); 
     25    auto archive = new ZipFolder(zipname); 
    2626    auto info = archive.self; 
    2727 
  • branches/lmartin/ftp/install/dmd-posix/installer.sh

    r2866 r3368  
    7272    export PATH="$DMDDIR/bin:$PATH" 
    7373    mkdir -p $DMDDIR/bin || die 1 "Failed to create the DMD install directory" 
    74     cd $DMDDIR || die 1 "Failed to cd to the DMD install directory" 
     74    cd $DMDDIR/bin || die 1 "Failed to cd to the DMD install directory" 
    7575    tail -n+$LINES $FULLNAME | tar Oxf - dmd.tar.gz | gunzip -c | tar xf - || die 1 "Failed to extract DMD" 
    7676else 
  • branches/lmartin/ftp/install/dmd-posix/mkinstaller.sh

    r3056 r3368  
    6868mkdir -p lib 
    6969cp ../lib/libtango-user-dmd.a lib || die 1 "Failed to copy in the tango .a file" 
     70cp ../lib/dmdinclude lib || die 1 "Failed to copy in the dmdinclude file" 
    7071 
    7172find include/d -name .svn | xargs rm -rf 
  • branches/lmartin/ftp/install/windows/build_tango.d

    r3032 r3368  
     1module build_tango; 
     2 
    13import tango.io.FileConduit; 
    24import tango.io.FileScan; 
     
    4143bool filter( FilePath file ) 
    4244{ 
    43     return containsPattern( file.folder, "posix"  ) || 
    44            containsPattern( file.folder, "linux"  ) || 
    45            containsPattern( file.folder, "darwin" ) || 
    46            containsPattern( file.name,   "Posix"  ); 
     45    return containsPattern( file.folder, "posix"   ) || 
     46           containsPattern( file.folder, "linux"   ) || 
     47           containsPattern( file.folder, "darwin"  ) || 
     48           containsPattern( file.name,   "Posix"   ) || 
     49           containsPattern( file.folder, "freebsd" ); 
    4750} 
    4851 
     
    5154{ 
    5255    size_t pos = 0; 
    53     char[] name = file.folder; 
     56    char[] folder = file.dup.native.folder; 
     57    char[] name = folder; 
    5458    foreach( elem; name ) 
    5559    { 
     
    6064        break; 
    6165    } 
    62     return file.folder[pos .. $].dup.replace( '\\', '-' ) ~ file.name ~ ".obj"; 
     66    return folder[pos .. $].dup.replace( '\\', '-' ) ~ file.name ~ ".obj"; 
    6367} 
    6468 
  • branches/lmartin/ftp/lib/build-gdc-mac.sh

    r3082 r3368  
    3333# build Universal Binary versions of the Tango libraries 
    3434 
     35export MAKETOOL=make 
     36 
    3537HOME=`pwd` make -s clean -fgdc-posix.mak 
    3638 
  • branches/lmartin/ftp/lib/build-gdc-x.sh

    r2827 r3368  
    1 #!/bin/bash 
     1#!/usr/bin/env bash 
    22 
    33die() { 
  • branches/lmartin/ftp/lib/build-gdc.sh

    r3129 r3368  
    1 #!/bin/bash 
     1#!/usr/bin/env bash 
    22cd "`dirname $0`" 
    33 
    4 GDC_VER="`gdc --version | grep 'gdc' | sed 's/^.*gdc \([0-9]*\.[0-9]*\).*$/\1/'`" 
     4# Allow gdc and gdmd to be overriden 
     5if [ "$GDC" = "" ] 
     6then 
     7    export GDC=${GDC_PREFIX}gdc${GDC_POSTFIX} 
     8fi 
     9if [ "$GDMD" = "" ] 
     10then 
     11    export GDMD=${GDC_PREFIX}gdmd${GDC_POSTFIX} 
     12fi 
     13 
     14GDC_VER="`$GDC --version | grep 'gdc' | sed 's/^.*gdc \([0-9]*\.[0-9]*\).*$/\1/'`" 
    515GDC_MAJOR="`echo $GDC_VER | sed 's/\..*//'`" 
    616GDC_MINOR="`echo $GDC_VER | sed 's/.*\.//'`" 
     
    2939rm compiler/gdc/object.di 
    3040 
     41# Check make we have 
     42MAKE=`which gmake` 
     43if [ ! -e "$MAKE" ] 
     44then 
     45    MAKE=`which make` 
     46    if [ ! `$MAKE --version | grep 'GNU Make'` ] 
     47    then 
     48        echo 'No supported build tool found.' 
     49        exit 1 
     50    fi 
     51fi 
     52 
     53export MAKETOOL=$MAKE 
     54 
    3155OLDHOME=$HOME 
    3256export HOME=`pwd` 
    33 make clean -fgdc-posix.mak || exit 1 
    34 make lib doc install -fgdc-posix.mak ADD_CFLAGS="$ADD_CFLAGS" || exit 1 
    35 make clean -fgdc-posix.mak || exit 1 
     57$MAKE clean -fgdc-posix.mak DC="$GDMD" || exit 1 
     58$MAKE lib doc install -fgdc-posix.mak DC="$GDMD" ADD_CFLAGS="$ADD_CFLAGS" || exit 1 
     59$MAKE clean -fgdc-posix.mak DC="$GDMD" || exit 1 
    3660chmod 644 ../tango/core/*.di || exit 1 
    3761 
  • branches/lmartin/ftp/lib/build-tango.sh

    r3126 r3368  
    1 #!/bin/bash +x 
     1#!/usr/bin/env bash 
    22 
    33# A simple script to build libtango.a/libgtango 
     
    1919Options: 
    2020  --help: Will print this help text 
     21  --warn: Will enable warnings 
    2122  <identifier> is one of {dmd, gdc, mac} and will build libtango.a, 
    2223                libgtango.a or universal Mac binaries respectively 
     
    3031UNAME=`uname` 
    3132INLINE="-inline" 
     33WARN="" 
    3234 
    3335# Compiler specific includes 
     
    6264    fi 
    6365 
     66    if [ "`echo $FILE | grep freebsd`" ] 
     67    then 
     68        if [ ! "$UNAME" == "FreeBSD" ] 
     69        then 
     70            return 1 
     71        else 
     72            return 0 
     73        fi 
     74    fi 
     75 
    6476    if [ "`echo $FILE | grep linux`" ] 
    6577    then 
     
    8193    if filter $OBJNAME 
    8294    then 
    83         $DC -c $INLINE -release -O -version=Posix -version=Tango -of$OBJNAME $FILENAME 
     95        $DC $WARN -c $INLINE -release -O -version=Posix -version=Tango -of$OBJNAME $FILENAME 
    8496        ar -r lib/$LIB $OBJNAME 2>&1 | grep -v "ranlib: .* has no symbols" 
    8597        rm $OBJNAME 
     
    125137fi 
    126138 
    127 if [ "$1" = "--help" ] 
    128 then 
    129     usage 
    130 elif [ "$1" = "dmd" ] 
    131 then 
    132     build dmd libtango-user-dmd.a libtango-base-dmd.a 
    133 elif [ "$1" = "gdc" ] 
    134 then 
    135     build gdmd libgtango.a libgphobos.a 
    136 elif [ "$1" = "mac" ] 
    137 then 
    138     # build Universal Binary version of the Tango library 
    139     build powerpc-apple-darwin8-gdmd libgtango.a.ppc libgphobos.a.ppc 
    140     build i686-apple-darwin8-gdmd libgtango.a.i386 libgphobos.a.i386 
    141     lipo -create -output libgtango.a libgtango.a.ppc libgtango.a.i386 
    142 else 
    143     usage 
    144 fi 
     139while [ "$#" != "0" ] 
     140do 
     141    case "$1" in 
     142        --help) 
     143            usage 
     144            ;; 
     145        --warn) 
     146            WARN="-w" 
     147            ;; 
     148        dmd) 
     149            build dmd libtango-user-dmd.a libtango-base-dmd.a 
     150            ;; 
     151        gdc) 
     152            build gdmd libgtango.a libgphobos.a 
     153            ;; 
     154        mac) 
     155            # build Universal Binary version of the Tango library 
     156            build powerpc-apple-darwin8-gdmd libgtango.a.ppc libgphobos.a.ppc 
     157            build i686-apple-darwin8-gdmd libgtango.a.i386 libgphobos.a.i386 
     158            lipo -create -output libgtango.a libgtango.a.ppc libgtango.a.i386 
     159            ;; 
     160        *) 
     161            usage 
     162            ;; 
     163    esac 
     164    shift 
     165done 
  • branches/lmartin/ftp/lib/common/tango/core/Exception.d

    r2913 r3368  
    1313{ 
    1414    alias void  function( char[] file, size_t line, char[] msg = null ) assertHandlerType; 
    15     alias TracedExceptionInfo function( void* ptr = null ) traceHandlerType; 
    1615 
    1716    assertHandlerType   assertHandler   = null; 
    18     traceHandlerType    traceHandler    = null; 
    19 } 
    20  
    21  
    22 interface TracedExceptionInfo 
    23 { 
    24     int opApply( int delegate( inout char[] ) ); 
    2517} 
    2618 
     
    3022- Exception 
    3123  - OutOfMemoryException 
    32  
    33   - TracedException 
    34     - SwitchException 
    35     - AssertException 
    36     - ArrayBoundsException 
    37     - FinalizeException 
    38  
    39     - PlatformException 
    40       - ProcessException 
    41       - ThreadException 
    42         - FiberException 
    43       - SyncException 
    44       - IOException 
    45         - SocketException 
    46           - SocketAcceptException 
    47         - AddressException 
    48         - HostException 
    49         - VfsException 
    50         - ClusterException 
    51  
    52     - NoSuchElementException 
    53       - CorruptedIteratorException 
    54  
    55     - IllegalArgumentException 
    56       - IllegalElementException 
    57  
    58     - TextException 
    59       - RegexException 
    60       - LocaleException 
    61       - UnicodeException 
    62  
    63     - PayloadException 
     24  - SwitchException 
     25  - AssertException 
     26  - ArrayBoundsException 
     27  - FinalizeException 
     28 
     29  - PlatformException 
     30    - ProcessException 
     31    - ThreadException 
     32      - FiberException 
     33    - SyncException 
     34    - IOException 
     35      - SocketException 
     36        - SocketAcceptException 
     37      - AddressException 
     38      - HostException 
     39      - VfsException 
     40      - ClusterException 
     41 
     42  - NoSuchElementException 
     43    - CorruptedIteratorException 
     44 
     45  - IllegalArgumentException 
     46    - IllegalElementException 
     47 
     48  - TextException 
     49    - RegexException 
     50    - LocaleException 
     51    - UnicodeException 
     52 
     53  - PayloadException 
    6454*/ 
    6555//////////////////////////////////////////////////////////////////////////////// 
     
    8474 
    8575/** 
    86  * Stores a stack trace when thrown. 
    87  */ 
    88 class TracedException : Exception 
    89 
    90     this( char[] msg ) 
    91     { 
    92         super( msg ); 
    93         m_info = traceContext(); 
    94     } 
    95  
    96     this( char[] msg, Exception e ) 
    97     { 
    98         super( msg, e ); 
    99         m_info = traceContext(); 
     76 * Base class for operating system or library exceptions. 
     77 */ 
     78class PlatformException : Exception 
     79
     80    this( char[] msg ) 
     81    { 
     82        super( msg ); 
     83    } 
     84
     85 
     86/** 
     87 * Thrown on an assert error. 
     88 */ 
     89class AssertException : Exception 
     90
     91    this( char[] file, size_t line ) 
     92    { 
     93        super( "Assertion failure", file, line ); 
    10094    } 
    10195 
     
    10397    { 
    10498        super( msg, file, line ); 
    105         m_info = traceContext(); 
    106     } 
    107  
    108     char[] toString() 
    109     { 
    110         if( m_info is null ) 
    111             return super.toString(); 
    112         char[] buf = super.toString(); 
    113         buf ~= "\n----------------"; 
    114         foreach( line; m_info ) 
    115             buf ~= "\n" ~ line; 
    116         return buf; 
    117     } 
    118  
    119     int opApply( int delegate( inout char[] buf ) dg ) 
    120     { 
    121         if( m_info is null ) 
    122             return 0; 
    123         return m_info.opApply( dg ); 
    124     } 
    125  
    126 private: 
    127     TracedExceptionInfo m_info; 
    128 
    129  
    130  
    131 /** 
    132  * Base class for operating system or library exceptions. 
    133  */ 
    134 class PlatformException : TracedException 
    135 
    136     this( char[] msg ) 
    137     { 
    138         super( msg ); 
    139     } 
    140 
    141  
    142 /** 
    143  * Thrown on an assert error. 
    144  */ 
    145 class AssertException : TracedException 
     99    } 
     100
     101 
     102 
     103/** 
     104 * Thrown on an array bounds error. 
     105 */ 
     106class ArrayBoundsException : Exception 
    146107{ 
    147108    this( char[] file, size_t line ) 
    148109    { 
    149         super( "Assertion failure", file, line ); 
    150     } 
    151  
    152     this( char[] msg, char[] file, size_t line ) 
    153     { 
    154         super( msg, file, line ); 
    155     } 
    156 } 
    157  
    158  
    159 /** 
    160  * Thrown on an array bounds error. 
    161  */ 
    162 class ArrayBoundsException : TracedException 
    163 { 
    164     this( char[] file, size_t line ) 
    165     { 
    166110        super( "Array index out of bounds", file, line ); 
    167111    } 
     
    172116 * Thrown on finalize error. 
    173117 */ 
    174 class FinalizeException : TracedException 
     118class FinalizeException : Exception 
    175119{ 
    176120    ClassInfo   info; 
     
    192136 * Thrown on a switch error. 
    193137 */ 
    194 class SwitchException : TracedException 
     138class SwitchException : Exception 
    195139{ 
    196140    this( char[] file, size_t line ) 
     
    204148 * Represents a text processing error. 
    205149 */ 
    206 class TextException : TracedException 
     150class TextException : Exception 
    207151{ 
    208152    this( char[] msg ) 
     
    277221 
    278222/** 
    279  * The basic exception thrown by the tango.io.vfs package.  
     223 * The basic exception thrown by the tango.io.vfs package. 
    280224 */ 
    281225private class VfsException : IOException 
     
    288232 
    289233/** 
    290  * The basic exception thrown by the tango.io.cluster package.  
     234 * The basic exception thrown by the tango.io.cluster package. 
    291235 */ 
    292236private class ClusterException : IOException 
     
    387331 * guid. 
    388332 */ 
    389 class RegistryException : TracedException 
     333class RegistryException : Exception 
    390334{ 
    391335    this( char[] msg ) 
     
    399343 * Thrown when an illegal argument is encountered. 
    400344 */ 
    401 class IllegalArgumentException : TracedException 
     345class IllegalArgumentException : Exception 
    402346{ 
    403347    this( char[] msg ) 
     
    427371 * Thrown on past-the-end errors by iterators and containers. 
    428372 */ 
    429 class NoSuchElementException : TracedException 
     373class NoSuchElementException : Exception 
    430374{ 
    431375    this( char[] msg ) 
     
    462406{ 
    463407    assertHandler = h; 
    464 } 
    465  
    466  
    467 /** 
    468  * Overrides the default trace hander with a user-supplied version. 
    469  * 
    470  * Params: 
    471  *  h = The new trace handler.  Set to null to use the default handler. 
    472  */ 
    473 void setTraceHandler( traceHandlerType h ) 
    474 { 
    475     traceHandler = h; 
    476408} 
    477409 
     
    517449 
    518450 
    519 /** 
    520  * This function will be called when a TracedException is constructed.  The 
    521  * user-supplied trace handler will be called if one has been supplied, 
    522  * otherwise no trace will be generated. 
    523  * 
    524  * Params: 
    525  *  ptr = A pointer to the location from which to generate the trace, or null 
    526  *        if the trace should be generated from within the trace handler 
    527  *        itself. 
    528  * 
    529  * Returns: 
    530  *  An object describing the current calling context or null if no handler is 
    531  *  supplied. 
    532  */ 
    533 TracedExceptionInfo traceContext( void* ptr = null ) 
    534 { 
    535     if( traceHandler is null ) 
    536         return null; 
    537     return traceHandler( ptr ); 
    538 } 
    539  
    540451//////////////////////////////////////////////////////////////////////////////// 
    541452/