├── .gitignore ├── .travis.yml ├── BUGS.md ├── LICENSE.txt ├── README.md ├── build ├── Makefile ├── README.txt ├── bin │ ├── freebsd32 │ │ └── bob │ ├── freebsd64 │ │ └── bob │ ├── linux32 │ │ └── bob │ ├── linux64 │ │ └── bob │ └── win32 │ │ └── bob.exe ├── command.make ├── script │ └── bob.rb └── src │ ├── bob.d │ └── unittester.d ├── doc └── example │ ├── concurrency │ ├── ThreadFiberGCStress.d │ └── fiber_test.d │ ├── conduits │ ├── FileBucket.d │ ├── crc.d │ ├── createzip.d │ ├── filebubbler.d │ ├── filecat.d │ ├── filecopy.d │ ├── fileops.d │ ├── filepathname.d │ ├── filescan.d │ ├── filescanregex.d │ ├── lineio.d │ ├── mmap.d │ ├── pathchildren.d │ ├── paths.d │ ├── randomio.d │ ├── shuffle.d │ └── unifile.d │ ├── console │ ├── buffered.d │ ├── hello.d │ └── stdout.d │ ├── logging │ ├── chainsaw.d │ ├── logging.d │ └── multilog.d │ ├── networking │ ├── homepage.d │ ├── httpget.d │ ├── netcopy.d │ ├── selector.d │ ├── sockethello.d │ └── socketserver.d │ ├── synchronization │ ├── barrier.d │ ├── condition.d │ ├── mutex.d │ ├── readwritemutex.d │ └── semaphore.d │ ├── system │ ├── localtime.d │ ├── normpath.d │ ├── process.d │ └── stacktrace.d │ ├── text │ ├── formatalign.d │ ├── formatindex.d │ ├── formatspec.d │ ├── hamlet.xml │ ├── localetime.d │ ├── soap_mid.xml │ ├── token.d │ ├── xmldom.d │ ├── xmlpath.d │ ├── xmlpull.d │ └── xmlsax.d │ ├── vfs │ ├── vfscan.d │ ├── vfscanregex.d │ ├── vfshuffle.d │ └── vfszip.d │ └── xml │ ├── attrquery.d │ ├── filterquery.d │ ├── iterate.d │ ├── loadparse.d │ └── xpath.xml ├── dub.json ├── porting_guidelines ├── tango ├── core │ ├── Array.d │ ├── ArrayLiteral.d │ ├── BitArray.d │ ├── BitManip.d │ ├── ByteSwap.d │ ├── Compiler.d │ ├── Exception.d │ ├── Memory.d │ ├── Octal.d │ ├── Runtime.d │ ├── RuntimeTraits.d │ ├── Signal.d │ ├── Thread.d │ ├── ThreadPool.d │ ├── Time.d │ ├── Traits.d │ ├── Tuple.d │ ├── Vararg.d │ ├── Variant.d │ ├── Version.d │ ├── sync │ │ ├── Atomic.d │ │ ├── Barrier.d │ │ ├── Condition.d │ │ ├── Config.d │ │ ├── Mutex.d │ │ ├── ReadWriteMutex.d │ │ └── Semaphore.d │ ├── tools │ │ ├── Cpuid.d │ │ ├── Demangler.d │ │ ├── FrameInfo.d │ │ ├── LinuxStackTrace.d │ │ ├── StackTrace.d │ │ ├── TraceExceptions.d │ │ └── WinStackTrace.d │ └── util │ │ ├── console.d │ │ └── string.d ├── io │ ├── Console.d │ ├── FilePath.d │ ├── FileScan.d │ ├── FileSystem.d │ ├── Path.d │ ├── Stdout.d │ ├── UnicodeFile.d │ ├── device │ │ ├── Array.d │ │ ├── BitBucket.d │ │ ├── Conduit.d │ │ ├── Device.d │ │ ├── File.d │ │ ├── FileMap.d │ │ ├── SerialPort.d │ │ ├── TempFile.d │ │ └── ThreadPipe.d │ ├── model │ │ ├── IConduit.d │ │ └── IFile.d │ ├── selector │ │ ├── AbstractSelector.d │ │ ├── EpollSelector.d │ │ ├── PollSelector.d │ │ ├── SelectSelector.d │ │ ├── Selector.d │ │ ├── SelectorException.d │ │ └── model │ │ │ └── ISelector.d │ ├── stream │ │ ├── Buffered.d │ │ ├── Bzip.d │ │ ├── Data.d │ │ ├── DataFile.d │ │ ├── Delimiters.d │ │ ├── Digester.d │ │ ├── Endian.d │ │ ├── Format.d │ │ ├── Greedy.d │ │ ├── Iterator.d │ │ ├── Lines.d │ │ ├── Map.d │ │ ├── Patterns.d │ │ ├── Quotes.d │ │ ├── Snoop.d │ │ ├── Text.d │ │ ├── TextFile.d │ │ ├── Typed.d │ │ ├── Utf.d │ │ └── Zlib.d │ └── vfs │ │ ├── FileFolder.d │ │ ├── FtpFolder.d │ │ ├── LinkedFolder.d │ │ ├── VirtualFolder.d │ │ ├── ZipFolder.d │ │ └── model │ │ └── Vfs.d ├── math │ ├── Bessel.d │ ├── BigInt.d │ ├── Bracket.d │ ├── Elliptic.d │ ├── ErrorFunction.d │ ├── GammaFunction.d │ ├── IEEE.d │ ├── Math.d │ ├── Probability.d │ └── random │ │ ├── ExpSource.d │ │ ├── Kiss.d │ │ ├── NormalSource.d │ │ ├── Random.d │ │ ├── Twister.d │ │ ├── Ziggurat.d │ │ └── engines │ │ ├── ArraySource.d │ │ ├── CMWC.d │ │ ├── KISS.d │ │ ├── KissCmwc.d │ │ ├── Sync.d │ │ ├── Twister.d │ │ └── URandom.d ├── net │ ├── InternetAddress.d │ ├── Uri.d │ ├── device │ │ ├── Berkeley.d │ │ ├── Datagram.d │ │ ├── LocalSocket.d │ │ ├── Multicast.d │ │ ├── SSLSocket.d │ │ └── Socket.d │ ├── ftp │ │ ├── FtpClient.d │ │ └── Telnet.d │ ├── http │ │ ├── ChunkStream.d │ │ ├── HttpClient.d │ │ ├── HttpConst.d │ │ ├── HttpCookies.d │ │ ├── HttpGet.d │ │ ├── HttpHeaders.d │ │ ├── HttpParams.d │ │ ├── HttpPost.d │ │ ├── HttpStack.d │ │ ├── HttpTokens.d │ │ ├── HttpTriplet.d │ │ └── model │ │ │ └── HttpParamsView.d │ ├── model │ │ └── UriView.d │ └── util │ │ ├── MemCache.d │ │ ├── PKI.d │ │ └── c │ │ └── OpenSSL.d ├── stdc │ ├── complex.d │ ├── config.d │ ├── ctype.d │ ├── errno.d │ ├── fenv.d │ ├── inttypes.d │ ├── limits.d │ ├── locale.d │ ├── math.d │ ├── posix │ │ ├── arpa │ │ │ └── inet.d │ │ ├── config.d │ │ ├── dirent.d │ │ ├── dlfcn.d │ │ ├── fcntl.d │ │ ├── grp.d │ │ ├── inttypes.d │ │ ├── langinfo.d │ │ ├── net │ │ │ └── if_.d │ │ ├── netinet │ │ │ ├── in_.d │ │ │ └── tcp.d │ │ ├── poll.d │ │ ├── pthread.d │ │ ├── pwd.d │ │ ├── sched.d │ │ ├── semaphore.d │ │ ├── setjmp.d │ │ ├── signal.d │ │ ├── stdio.d │ │ ├── stdlib.d │ │ ├── sys │ │ │ ├── ipc.d │ │ │ ├── mman.d │ │ │ ├── select.d │ │ │ ├── shm.d │ │ │ ├── socket.d │ │ │ ├── stat.d │ │ │ ├── statvfs.d │ │ │ ├── time.d │ │ │ ├── types.d │ │ │ ├── uio.d │ │ │ ├── utsname.d │ │ │ └── wait.d │ │ ├── termios.d │ │ ├── time.d │ │ ├── ucontext.d │ │ ├── unistd.d │ │ └── utime.d │ ├── signal.d │ ├── stdarg.d │ ├── stddef.d │ ├── stdint.d │ ├── stdio.d │ ├── stdlib.d │ ├── string.d │ ├── stringz.d │ ├── tgmath.d │ ├── time.d │ └── wctype.d ├── sys │ ├── Common.d │ ├── Environment.d │ ├── HomeFolder.d │ ├── Pipe.d │ ├── Process.d │ ├── SharedLib.d │ ├── consts │ │ ├── errno.d │ │ ├── fcntl.d │ │ ├── socket.d │ │ ├── sysctl.d │ │ └── unistd.d │ ├── darwin │ │ ├── consts │ │ │ ├── errno.d │ │ │ ├── fcntl.d │ │ │ ├── machine.d │ │ │ ├── socket.d │ │ │ ├── sysctl.d │ │ │ └── unistd.d │ │ └── darwin.d │ ├── freebsd │ │ ├── consts │ │ │ ├── errno.d │ │ │ ├── fcntl.d │ │ │ ├── socket.d │ │ │ ├── sysctl.d │ │ │ └── unistd.d │ │ └── freebsd.d │ ├── linux │ │ ├── consts │ │ │ ├── errno.d │ │ │ ├── fcntl.d │ │ │ ├── socket.d │ │ │ ├── sysctl.d │ │ │ └── unistd.d │ │ ├── epoll.d │ │ ├── inotify.d │ │ ├── linux.d │ │ └── tipc.d │ ├── solaris │ │ ├── consts │ │ │ ├── errno.d │ │ │ ├── fcntl.d │ │ │ ├── socket.d │ │ │ ├── sysctl.d │ │ │ └── unistd.d │ │ └── solaris.d │ └── win32 │ │ ├── CodePage.d │ │ ├── IUnknown.d │ │ ├── Macros.d │ │ ├── Process.d │ │ ├── SpecialPath.d │ │ ├── Types.d │ │ ├── UserGdi.d │ │ ├── WsaSock.d │ │ └── consts │ │ ├── errno.d │ │ ├── fcntl.d │ │ ├── socket.d │ │ ├── sysctl.d │ │ └── unistd.d ├── text │ ├── Arguments.d │ ├── Ascii.d │ ├── Regex.d │ ├── Search.d │ ├── Text.d │ ├── Unicode.d │ ├── UnicodeData.d │ ├── Util.d │ ├── convert │ │ ├── DateTime.d │ │ ├── Float.d │ │ ├── Format.d │ │ ├── Integer.d │ │ ├── Layout.d │ │ ├── TimeStamp.d │ │ ├── UnicodeBom.d │ │ └── Utf.d │ ├── json │ │ ├── Json.d │ │ ├── JsonEscape.d │ │ └── JsonParser.d │ ├── locale │ │ ├── Collation.d │ │ ├── Convert.d │ │ ├── Core.d │ │ ├── Data.d │ │ ├── Locale.d │ │ ├── Parse.d │ │ ├── Posix.d │ │ └── Win32.d │ └── xml │ │ ├── DocEntity.d │ │ ├── DocPrinter.d │ │ ├── DocTester.d │ │ ├── Document.d │ │ ├── PullParser.d │ │ └── SaxParser.d ├── time │ ├── Clock.d │ ├── ISO8601.d │ ├── StopWatch.d │ ├── Time.d │ ├── WallClock.d │ └── chrono │ │ ├── Calendar.d │ │ ├── Gregorian.d │ │ ├── GregorianBased.d │ │ ├── Hebrew.d │ │ ├── Hijri.d │ │ ├── Japanese.d │ │ ├── Korean.d │ │ ├── Taiwan.d │ │ └── ThaiBuddhist.d └── util │ ├── Convert.d │ ├── MinMax.d │ ├── cipher │ ├── AES.d │ ├── Blowfish.d │ ├── ChaCha.d │ ├── Cipher.d │ ├── RC4.d │ ├── RC6.d │ ├── Salsa20.d │ ├── TEA.d │ └── XTEA.d │ ├── compress │ ├── Zip.d │ └── c │ │ ├── bzlib.d │ │ └── zlib.d │ ├── container │ ├── CircularList.d │ ├── Clink.d │ ├── Container.d │ ├── HashMap.d │ ├── HashSet.d │ ├── LinkedList.d │ ├── RedBlack.d │ ├── Slink.d │ ├── SortedMap.d │ ├── model │ │ └── IContainer.d │ └── more │ │ ├── BitSet.d │ │ ├── CacheMap.d │ │ ├── HashFile.d │ │ ├── Heap.d │ │ ├── Stack.d │ │ ├── StackMap.d │ │ └── Vector.d │ ├── digest │ ├── Crc32.d │ ├── Digest.d │ ├── Md2.d │ ├── Md4.d │ ├── Md5.d │ ├── MerkleDamgard.d │ ├── Ripemd128.d │ ├── Ripemd160.d │ ├── Ripemd256.d │ ├── Ripemd320.d │ ├── Sha0.d │ ├── Sha01.d │ ├── Sha1.d │ ├── Sha256.d │ ├── Sha512.d │ ├── Tiger.d │ └── Whirlpool.d │ ├── encode │ ├── Base16.d │ ├── Base32.d │ └── Base64.d │ ├── log │ ├── AppendConsole.d │ ├── AppendFile.d │ ├── AppendFiles.d │ ├── AppendMail.d │ ├── AppendSocket.d │ ├── AppendSyslog.d │ ├── Config.d │ ├── ConfigProps.d │ ├── LayoutChainsaw.d │ ├── LayoutDate.d │ ├── Log.d │ ├── Trace.d │ └── model │ │ └── ILogger.d │ └── uuid │ ├── NamespaceGenV3.d │ ├── NamespaceGenV5.d │ ├── RandomGen.d │ └── Uuid.d └── unported ├── build ├── bin │ ├── freebsd32 │ │ └── bob │ ├── freebsd64 │ │ └── bob │ ├── osx32 │ │ └── bob │ └── win32 │ │ └── jake.exe ├── script │ ├── bob.sh │ ├── dmdinclude │ ├── fetch-dmd.sh │ ├── tango-bundle.sh │ └── unittest.sh └── src │ └── jake.c ├── doc ├── TangoDocToXML.rb ├── bin │ ├── D.rules │ ├── dcode.d │ ├── dcode.exe │ ├── dimple.d │ ├── filebubbler.exe │ ├── keywords1.txt │ ├── keywords2.txt │ ├── keywords3.txt │ ├── keywords4.txt │ ├── style-old.css │ ├── style.css │ ├── template.post │ └── template.pre ├── dil │ ├── data │ │ ├── dilconf.d │ │ ├── html.css │ │ ├── html_map.d │ │ ├── kandil │ │ │ ├── css │ │ │ │ └── style.css │ │ │ ├── img │ │ │ │ ├── icon_alias.png │ │ │ │ ├── icon_alias.svg │ │ │ │ ├── icon_class.png │ │ │ │ ├── icon_class.svg │ │ │ │ ├── icon_enum.png │ │ │ │ ├── icon_enum.svg │ │ │ │ ├── icon_enummem.png │ │ │ │ ├── icon_enummem.svg │ │ │ │ ├── icon_function.png │ │ │ │ ├── icon_function.svg │ │ │ │ ├── icon_funnel.png │ │ │ │ ├── icon_funnel.svg │ │ │ │ ├── icon_interface.png │ │ │ │ ├── icon_interface.svg │ │ │ │ ├── icon_magnifier.png │ │ │ │ ├── icon_magnifier.svg │ │ │ │ ├── icon_module.png │ │ │ │ ├── icon_module.svg │ │ │ │ ├── icon_module_alt.png │ │ │ │ ├── icon_package.png │ │ │ │ ├── icon_package.svg │ │ │ │ ├── icon_package_alt.png │ │ │ │ ├── icon_struct.png │ │ │ │ ├── icon_struct.svg │ │ │ │ ├── icon_template.png │ │ │ │ ├── icon_template.svg │ │ │ │ ├── icon_tv_dot.png │ │ │ │ ├── icon_tv_dot.svg │ │ │ │ ├── icon_tv_minus.png │ │ │ │ ├── icon_tv_minus.svg │ │ │ │ ├── icon_tv_plus.png │ │ │ │ ├── icon_tv_plus.svg │ │ │ │ ├── icon_typedef.png │ │ │ │ ├── icon_typedef.svg │ │ │ │ ├── icon_union.png │ │ │ │ ├── icon_union.svg │ │ │ │ ├── icon_variable.png │ │ │ │ ├── icon_variable.svg │ │ │ │ └── loading.gif │ │ │ ├── js │ │ │ │ ├── jquery.js │ │ │ │ ├── navigation.js │ │ │ │ ├── quicksearch.js │ │ │ │ ├── symbols.js │ │ │ │ └── utilities.js │ │ │ └── kandil.ddoc │ │ ├── lang_de.d │ │ ├── lang_en.d │ │ ├── lang_fi.d │ │ ├── lang_tr.d │ │ ├── macros_dil.ddoc │ │ ├── pdf.css │ │ ├── predefined.ddoc │ │ ├── predefined_xml.ddoc │ │ ├── xml.css │ │ └── xml_map.d │ └── tango_doc.py ├── example │ ├── dsss.conf │ ├── external │ │ └── GlueFlectioned.d │ ├── jake-all.bat │ ├── linux.mak │ └── logging │ │ └── context.d ├── html │ └── candydoc │ │ ├── candy.ddoc │ │ ├── decant.css │ │ ├── docindex.cs │ │ ├── explorer.js │ │ ├── ie56hack.css │ │ ├── img │ │ ├── bg1.gif │ │ ├── candydoc.gif │ │ ├── outline │ │ │ ├── alias.gif │ │ │ ├── bg.gif │ │ │ ├── class.gif │ │ │ ├── enum.gif │ │ │ ├── func.gif │ │ │ ├── module.gif │ │ │ ├── package.gif │ │ │ ├── struct.gif │ │ │ ├── template.gif │ │ │ └── var.gif │ │ ├── package │ │ │ └── bg.gif │ │ └── tree │ │ │ ├── shim.gif │ │ │ ├── tb.gif │ │ │ ├── tbr.gif │ │ │ ├── tbrm.gif │ │ │ ├── tbrp.gif │ │ │ ├── tr.gif │ │ │ ├── trm.gif │ │ │ └── trp.gif │ │ ├── modules.ddoc │ │ ├── modules.def │ │ ├── modules.lsp │ │ ├── modules.rsp │ │ ├── modules.txt │ │ ├── style.css │ │ ├── tree.js │ │ └── util.js └── images │ ├── IO.png │ ├── LearnToTangoWithD.jpg │ ├── classdia.tango.io.File.png │ ├── classdia.tango.io.FileConduit.png │ ├── classdia.tango.io.FilePath.png │ ├── collection.png │ ├── methods.png │ ├── objdia.tango.console.png │ ├── tshirt-back.jpg │ └── tshirt-front.jpg ├── object.di └── tango ├── core ├── Atomic.d ├── WeakRef.d ├── rt │ ├── compiler │ │ ├── dmd │ │ │ ├── OBJDEFS.inc │ │ │ ├── OBJECTDEFS.inc │ │ │ ├── OBJECTDEFS_WIN.inc │ │ │ ├── cConst.c │ │ │ ├── complex.c │ │ │ ├── critical.c │ │ │ ├── darwin │ │ │ │ ├── Image.d │ │ │ │ ├── dyld.d │ │ │ │ ├── dynamic_lib_fixes.c │ │ │ │ ├── getsect.d │ │ │ │ └── loader.d │ │ │ ├── gcosx.c │ │ │ ├── ignore.d │ │ │ ├── invariant.d │ │ │ ├── mars.h │ │ │ ├── minit.asm │ │ │ ├── minit.obj │ │ │ ├── monitor.c │ │ │ ├── object_.d │ │ │ ├── posix.mak │ │ │ ├── posix │ │ │ │ ├── deh.d │ │ │ │ └── llmath.d │ │ │ ├── rt │ │ │ │ ├── aApply.d │ │ │ │ ├── aApplyR.d │ │ │ │ ├── aaA.d │ │ │ │ ├── adi.d │ │ │ │ ├── alloca.d │ │ │ │ ├── arraybyte.d │ │ │ │ ├── arraycast.d │ │ │ │ ├── arraycat.d │ │ │ │ ├── arraydouble.d │ │ │ │ ├── arrayfloat.d │ │ │ │ ├── arrayint.d │ │ │ │ ├── arrayreal.d │ │ │ │ ├── arrayshort.d │ │ │ │ ├── cInterface.d │ │ │ │ ├── cast_.d │ │ │ │ ├── cmath2.d │ │ │ │ ├── compiler.d │ │ │ │ ├── cover.d │ │ │ │ ├── dmain2.d │ │ │ │ ├── invariant_.d │ │ │ │ ├── lifetime.d │ │ │ │ ├── memory.d │ │ │ │ ├── memset.d │ │ │ │ ├── obj.d │ │ │ │ ├── qsort.d │ │ │ │ ├── qsort2.alt │ │ │ │ ├── switch_.d │ │ │ │ └── trace.d │ │ │ ├── std │ │ │ │ └── intrinsic.d │ │ │ ├── typeinfo │ │ │ │ ├── ti_AC.d │ │ │ │ ├── ti_Acdouble.d │ │ │ │ ├── ti_Acfloat.d │ │ │ │ ├── ti_Acreal.d │ │ │ │ ├── ti_Adouble.d │ │ │ │ ├── ti_Afloat.d │ │ │ │ ├── ti_Ag.d │ │ │ │ ├── ti_Aint.d │ │ │ │ ├── ti_Along.d │ │ │ │ ├── ti_Areal.d │ │ │ │ ├── ti_Ashort.d │ │ │ │ ├── ti_C.d │ │ │ │ ├── ti_byte.d │ │ │ │ ├── ti_cdouble.d │ │ │ │ ├── ti_cfloat.d │ │ │ │ ├── ti_char.d │ │ │ │ ├── ti_creal.d │ │ │ │ ├── ti_dchar.d │ │ │ │ ├── ti_delegate.d │ │ │ │ ├── ti_double.d │ │ │ │ ├── ti_float.d │ │ │ │ ├── ti_idouble.d │ │ │ │ ├── ti_ifloat.d │ │ │ │ ├── ti_int.d │ │ │ │ ├── ti_ireal.d │ │ │ │ ├── ti_long.d │ │ │ │ ├── ti_ptr.d │ │ │ │ ├── ti_real.d │ │ │ │ ├── ti_short.d │ │ │ │ ├── ti_ubyte.d │ │ │ │ ├── ti_uint.d │ │ │ │ ├── ti_ulong.d │ │ │ │ ├── ti_ushort.d │ │ │ │ ├── ti_void.d │ │ │ │ └── ti_wchar.d │ │ │ ├── win32.mak │ │ │ └── windows │ │ │ │ └── deh.c │ │ ├── gdc │ │ │ ├── OBJDEFS.inc │ │ │ ├── critical_.d │ │ │ ├── gcc │ │ │ │ ├── builtins.d │ │ │ │ ├── cbridge_stdio.c │ │ │ │ ├── deh.d │ │ │ │ ├── fpmath.d │ │ │ │ ├── support.d │ │ │ │ ├── unwind.d │ │ │ │ └── unwind_pe.d │ │ │ ├── invariant.d │ │ │ ├── monitor_.d │ │ │ ├── object_.d │ │ │ ├── rt │ │ │ │ ├── aApply.d │ │ │ │ ├── aApplyR.d │ │ │ │ ├── aaA.d │ │ │ │ ├── adi.d │ │ │ │ ├── arraybyte.d │ │ │ │ ├── arraycast.d │ │ │ │ ├── arraycat.d │ │ │ │ ├── arraydouble.d │ │ │ │ ├── arrayfloat.d │ │ │ │ ├── arrayint.d │ │ │ │ ├── arrayreal.d │ │ │ │ ├── arrayshort.d │ │ │ │ ├── cast_.d │ │ │ │ ├── cmain.d │ │ │ │ ├── dgccmain2.d │ │ │ │ ├── lifetime.d │ │ │ │ ├── memory.d │ │ │ │ ├── qsortg.d │ │ │ │ └── switch_.d │ │ │ ├── std │ │ │ │ └── intrinsic.d │ │ │ └── typeinfo │ │ │ │ ├── ti_AC.d │ │ │ │ ├── ti_Acdouble.d │ │ │ │ ├── ti_Acfloat.d │ │ │ │ ├── ti_Acreal.d │ │ │ │ ├── ti_Adouble.d │ │ │ │ ├── ti_Afloat.d │ │ │ │ ├── ti_Ag.d │ │ │ │ ├── ti_Aint.d │ │ │ │ ├── ti_Along.d │ │ │ │ ├── ti_Areal.d │ │ │ │ ├── ti_Ashort.d │ │ │ │ ├── ti_C.d │ │ │ │ ├── ti_byte.d │ │ │ │ ├── ti_cdouble.d │ │ │ │ ├── ti_cfloat.d │ │ │ │ ├── ti_char.d │ │ │ │ ├── ti_creal.d │ │ │ │ ├── ti_dchar.d │ │ │ │ ├── ti_delegate.d │ │ │ │ ├── ti_double.d │ │ │ │ ├── ti_float.d │ │ │ │ ├── ti_idouble.d │ │ │ │ ├── ti_ifloat.d │ │ │ │ ├── ti_int.d │ │ │ │ ├── ti_ireal.d │ │ │ │ ├── ti_long.d │ │ │ │ ├── ti_ptr.d │ │ │ │ ├── ti_real.d │ │ │ │ ├── ti_short.d │ │ │ │ ├── ti_ubyte.d │ │ │ │ ├── ti_uint.d │ │ │ │ ├── ti_ulong.d │ │ │ │ ├── ti_ushort.d │ │ │ │ ├── ti_void.d │ │ │ │ └── ti_wchar.d │ │ ├── ldc │ │ │ ├── OBJDEFS.inc │ │ │ ├── OBJECTDEFS.inc │ │ │ ├── cConst.c │ │ │ ├── critical.c │ │ │ ├── ldc.mak │ │ │ ├── mars.h │ │ │ ├── monitor.c │ │ │ ├── object_.d │ │ │ ├── rt │ │ │ │ ├── aApply.d │ │ │ │ ├── aApplyR.d │ │ │ │ ├── aaA.d │ │ │ │ ├── adi.d │ │ │ │ ├── arrayInit.d │ │ │ │ ├── cInterface.d │ │ │ │ ├── cast_.d │ │ │ │ ├── dmain2.d │ │ │ │ ├── eh.d │ │ │ │ ├── invariant_.d │ │ │ │ ├── lifetime.d │ │ │ │ ├── memory.d │ │ │ │ ├── qsort2.d │ │ │ │ └── switch_.d │ │ │ └── typeinfo │ │ │ │ ├── ti_AC.d │ │ │ │ ├── ti_Acdouble.d │ │ │ │ ├── ti_Acfloat.d │ │ │ │ ├── ti_Acreal.d │ │ │ │ ├── ti_Adouble.d │ │ │ │ ├── ti_Afloat.d │ │ │ │ ├── ti_Ag.d │ │ │ │ ├── ti_Aint.d │ │ │ │ ├── ti_Along.d │ │ │ │ ├── ti_Areal.d │ │ │ │ ├── ti_Ashort.d │ │ │ │ ├── ti_C.d │ │ │ │ ├── ti_byte.d │ │ │ │ ├── ti_cdouble.d │ │ │ │ ├── ti_cfloat.d │ │ │ │ ├── ti_char.d │ │ │ │ ├── ti_creal.d │ │ │ │ ├── ti_dchar.d │ │ │ │ ├── ti_delegate.d │ │ │ │ ├── ti_double.d │ │ │ │ ├── ti_float.d │ │ │ │ ├── ti_idouble.d │ │ │ │ ├── ti_ifloat.d │ │ │ │ ├── ti_int.d │ │ │ │ ├── ti_ireal.d │ │ │ │ ├── ti_long.d │ │ │ │ ├── ti_ptr.d │ │ │ │ ├── ti_real.d │ │ │ │ ├── ti_short.d │ │ │ │ ├── ti_ubyte.d │ │ │ │ ├── ti_uint.d │ │ │ │ ├── ti_ulong.d │ │ │ │ ├── ti_ushort.d │ │ │ │ ├── ti_void.d │ │ │ │ └── ti_wchar.d │ │ └── util │ │ │ ├── OBJDEFS.inc │ │ │ ├── ThreadASM.S │ │ │ ├── console.d │ │ │ ├── cpuid.d │ │ │ ├── ctype.d │ │ │ ├── deh.d │ │ │ ├── hash.d │ │ │ ├── string.d │ │ │ ├── utf.d │ │ │ └── wrap.c │ └── gc │ │ ├── basic │ │ ├── OBJDEFS.inc │ │ ├── gc.d │ │ ├── gcalloc.d │ │ ├── gcbits.d │ │ ├── gcstats.d │ │ ├── gcx.d │ │ ├── ldc.mak │ │ ├── posix.mak │ │ └── win32.mak │ │ ├── cdgc │ │ ├── bits.d │ │ ├── dynarray.d │ │ ├── gc.d │ │ ├── opts.d │ │ ├── os.d │ │ └── stats.d │ │ └── stub │ │ ├── gc.d │ │ ├── ldc.mak │ │ ├── posix.mak │ │ └── win32.mak └── vendor │ ├── gdc │ ├── c │ │ └── stdarg.di │ └── stdarg.di │ ├── ldc │ ├── bitmanip.d │ ├── cstdarg.di │ ├── intrinsics.di │ ├── llvmasm.di │ └── vararg.d │ └── std │ └── intrinsic.di └── math ├── BigInt.d └── internal ├── BignumNoAsm.d ├── BignumX86.d └── BiguintCore.d /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows 2 | /tango.lib 3 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: d 2 | d: 3 | - dmd 4 | - ldc 5 | 6 | env: 7 | - ARCH=x86_64 8 | 9 | script: 10 | - make -f build/Makefile static-lib DC=$DC ARCH=$ARCH BUILD_PATH=. 11 | -------------------------------------------------------------------------------- /BUGS.md: -------------------------------------------------------------------------------- 1 | This is a list of D compiler bugs that affect Tango, and a list of workarounds for them. When a workabout is not available, you generally can downgrade to a compiler that doesn't have the bug. 2 | 3 | [9259](http://d.puremagic.com/issues/show_bug.cgi?id=9259) - Affects the JSON package as of 2.061. Workabout: **None.** 4 | 5 | [9356](http://d.puremagic.com/issues/show_bug.cgi?id=9356) - Affects the Zip package as of 2.061. Workabout: Compile Tango without -inline. 6 | 7 | [8561](https://d.puremagic.com/issues/show_bug.cgi?id=8561) - Breaks Variant in some usages (mostly using Variant as a key in a hashmap) in 2.065. In 2.066 this may no longer be an issue, but requires investigation. See [Issue #77](https://github.com/SiegeLord/Tango-D2/issues/77)Workabout: **None.** 8 | -------------------------------------------------------------------------------- /build/README.txt: -------------------------------------------------------------------------------- 1 | Install directory in Tango SVN 2 | ============================= 3 | 4 | This directory is for internal use by the Tango project and contains 5 | scripts to build installers etc. 6 | -------------------------------------------------------------------------------- /build/bin/freebsd32/bob: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/build/bin/freebsd32/bob -------------------------------------------------------------------------------- /build/bin/freebsd64/bob: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/build/bin/freebsd64/bob -------------------------------------------------------------------------------- /build/bin/linux32/bob: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/build/bin/linux32/bob -------------------------------------------------------------------------------- /build/bin/linux64/bob: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/build/bin/linux64/bob -------------------------------------------------------------------------------- /build/bin/win32/bob.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/build/bin/win32/bob.exe -------------------------------------------------------------------------------- /doc/example/conduits/crc.d: -------------------------------------------------------------------------------- 1 | import tango.io.Stdout; 2 | import tango.io.device.File; 3 | import tango.util.digest.Crc32; 4 | import tango.util.digest.Digest; 5 | import tango.io.stream.Digester; 6 | 7 | char[] digestOfFile (Digest digest, const(char)[] path) 8 | { 9 | auto input = new DigestInput(new File(path), digest); 10 | input.slurp().close(); 11 | return digest.hexDigest(); 12 | } 13 | 14 | 15 | void main(char[][] args) 16 | { 17 | const(char)[] name = "crc.d"; 18 | if (args.length > 1) 19 | name = args[1]; 20 | 21 | Stdout.formatln("crc: {}", digestOfFile (new Crc32, name)); 22 | } 23 | 24 | -------------------------------------------------------------------------------- /doc/example/conduits/createzip.d: -------------------------------------------------------------------------------- 1 | module createzip; 2 | 3 | import tango.util.compress.Zip; 4 | import tango.io.vfs.FileFolder; 5 | 6 | /****************************************************************************** 7 | 8 | Simple example where the current folder is recursively scanned for .d files 9 | before they are zipped into tmp.zip. 10 | 11 | Written and put into the public domain by Piotr Modzelevski. 12 | 13 | ******************************************************************************/ 14 | 15 | void main() 16 | { 17 | const(char)[][] files; 18 | auto root = new FileFolder ("."); 19 | foreach (file; root.tree.catalog ("*.d")) 20 | files ~= file.toString(); 21 | 22 | createArchive("tmp.zip", Method.Deflate, files); 23 | } 24 | -------------------------------------------------------------------------------- /doc/example/conduits/filebubbler.d: -------------------------------------------------------------------------------- 1 | 2 | private import tango.io.Console, 3 | tango.io.model.IFile, 4 | tango.io.vfs.FileFolder; 5 | 6 | private import Path = tango.io.Path; 7 | 8 | /******************************************************************************* 9 | 10 | This example sweeps a named sub-directory tree for html files, 11 | and moves them to the current directory. The existing directory 12 | hierarchy is flattened into a naming scheme where a '.' is used 13 | to replace the traditional path-separator 14 | 15 | Used by the Tango project to help manage renderings of the source 16 | code. 17 | 18 | *******************************************************************************/ 19 | 20 | void main(char[][] args) 21 | { 22 | // sweep all html files in the specified subdir 23 | if (args.length !is 2) 24 | Cout ("usage is filebubbler subdir").newline; 25 | else 26 | foreach (file; (new FileFolder(args[1])).tree.catalog("*.html")) 27 | Path.rename (file.toString(), Path.replace (file.toString().dup, FileConst.PathSeparatorChar, '.')); 28 | } 29 | 30 | -------------------------------------------------------------------------------- /doc/example/conduits/filecat.d: -------------------------------------------------------------------------------- 1 | private import tango.io.Console, 2 | tango.io.device.File; 3 | 4 | /******************************************************************************* 5 | 6 | Concatenate a number of files onto a single destination 7 | 8 | *******************************************************************************/ 9 | 10 | void main(char[][] args) 11 | { 12 | if (args.length > 2) 13 | { 14 | // open the file for writing 15 | auto dst = new File (args[1], File.WriteCreate); 16 | 17 | // copy each file onto dst 18 | foreach (char[] arg; args[2..args.length]) 19 | dst.copy (new File(arg)); 20 | 21 | // flush output and close 22 | dst.close(); 23 | } 24 | else 25 | Cout ("usage: filecat target source1 ... sourceN").newline; 26 | } 27 | -------------------------------------------------------------------------------- /doc/example/conduits/filecopy.d: -------------------------------------------------------------------------------- 1 | 2 | private import tango.io.Console, 3 | tango.io.device.File; 4 | 5 | /******************************************************************************* 6 | 7 | open a file, and stream directly to console 8 | 9 | *******************************************************************************/ 10 | 11 | void main (char[][] args) 12 | { 13 | if (args.length is 2) 14 | { 15 | // open a file for reading 16 | auto fc = new File (args[1]); 17 | 18 | // stream directly to console 19 | Cout.stream.copy (fc); 20 | } 21 | else 22 | Cout ("usage is: filecopy filename").newline; 23 | } 24 | -------------------------------------------------------------------------------- /doc/example/conduits/fileops.d: -------------------------------------------------------------------------------- 1 | /***************************************************** 2 | 3 | Example that shows some simple file operations 4 | 5 | Put into public domain by Lars Ivar Igesund 6 | 7 | *****************************************************/ 8 | 9 | import tango.io.Stdout; 10 | 11 | import tango.io.FilePath; 12 | 13 | void main (char[][] args) 14 | { 15 | auto src = args[0] ~ ".d"; 16 | auto dst = new FilePath (args[0] ~ ".d.copy"); 17 | 18 | Stdout.formatln ("copy file {} to {}", src, dst); 19 | dst.copy (src); 20 | assert (dst.exists); 21 | 22 | Stdout.formatln ("removing file {}", dst); 23 | dst.remove(); 24 | 25 | assert (dst.exists is false); 26 | } 27 | -------------------------------------------------------------------------------- /doc/example/conduits/filepathname.d: -------------------------------------------------------------------------------- 1 | import tango.io.Console; 2 | 3 | import tango.io.FilePath; 4 | 5 | void main(){ 6 | Cout ((new FilePath(r"d:\path\foo.bat".dup)).name).newline; 7 | Cout ((new FilePath(r"d:\path.two\bar".dup)).name).newline; 8 | Cout ((new FilePath("/home/user.name/bar.".dup)).name).newline; 9 | Cout ((new FilePath(r"d:\path.two\bar".dup)).name).newline; 10 | Cout ((new FilePath("/home/user/.resource".dup)).name).newline; 11 | } 12 | -------------------------------------------------------------------------------- /doc/example/conduits/filescan.d: -------------------------------------------------------------------------------- 1 | private import tango.io.Stdout, 2 | tango.io.FileScan; 3 | 4 | /******************************************************************************* 5 | 6 | List ".d" files and enclosing folders visible via a directory given 7 | as a command-line argument. In this example we're also postponing a 8 | flush on Stdout until output is complete. Stdout is usually flushed 9 | on each invocation of newline or formatln, but here we're using '\n' 10 | to illustrate how to avoid flushing many individual lines 11 | 12 | *******************************************************************************/ 13 | 14 | void main(char[][] args) 15 | { 16 | const(char)[] root = args.length < 2 ? "." : args[1]; 17 | Stdout.formatln ("Scanning '{}'", root); 18 | 19 | auto scan = (new FileScan)(root, ".d"); 20 | 21 | Stdout.format ("\n{} Folders\n", scan.folders().length); 22 | foreach (folder; scan.folders()) 23 | Stdout.format ("{}\n", folder); 24 | 25 | Stdout.format ("\n{0} Files\n", scan.files().length); 26 | foreach (file; scan.files()) 27 | Stdout.format ("{}\n", file); 28 | 29 | Stdout.formatln ("\n{} Errors", scan.errors().length); 30 | foreach (error; scan.errors()) 31 | Stdout (error).newline; 32 | } 33 | -------------------------------------------------------------------------------- /doc/example/conduits/filescanregex.d: -------------------------------------------------------------------------------- 1 | /************************************************************** 2 | 3 | Example that use FileScan and Regex as a filter. 4 | 5 | Put into public domain by Lars Ivar Igesund 6 | 7 | **************************************************************/ 8 | 9 | import tango.io.Stdout, 10 | tango.io.FileScan, 11 | tango.text.Regex; 12 | 13 | void main(char[][] args) { 14 | uint total; 15 | 16 | if (args.length < 2) { 17 | Stdout("Please pass a directory to search").newline; 18 | return; 19 | } 20 | 21 | scope scan = new FileScan; 22 | scope regex = Regex(r"\.(d|obj)$"); 23 | 24 | scan(args[1], delegate bool (FilePath fp, bool isDir) { 25 | ++total; 26 | return isDir || regex.test(fp.toString()); 27 | }); 28 | 29 | 30 | foreach (file; scan.files()) 31 | Stdout(file).newline; 32 | 33 | Stdout.formatln("Found {} matches in {} entries", scan.files().length, total); 34 | 35 | Stdout.formatln ("\n{} Errors", scan.errors().length); 36 | foreach (error; scan.errors()) 37 | Stdout (error).newline; 38 | } 39 | 40 | -------------------------------------------------------------------------------- /doc/example/conduits/lineio.d: -------------------------------------------------------------------------------- 1 | 2 | private import tango.io.Console, 3 | tango.io.device.File; 4 | 5 | private import tango.io.stream.Lines; 6 | 7 | /******************************************************************************* 8 | 9 | Read a file line-by-line, sending each one to the console. This 10 | illustrates how to bind a conduit to a stream iterator (iterators 11 | also support the binding of a buffer). Note that stream iterators 12 | are templated for char, wchar and dchar types. 13 | 14 | *******************************************************************************/ 15 | 16 | void main (char[][] args) 17 | { 18 | if (args.length is 2) 19 | { 20 | // open a file for reading 21 | scope file = new File (args[1]); 22 | 23 | // process file one line at a time 24 | foreach (line; new Lines!(char)(file)) 25 | Cout (line).newline; 26 | } 27 | else 28 | Cout ("usage: lineio filename").newline; 29 | } -------------------------------------------------------------------------------- /doc/example/conduits/mmap.d: -------------------------------------------------------------------------------- 1 | 2 | private import tango.io.Console, 3 | tango.io.device.FileMap; 4 | 5 | /******************************************************************************* 6 | 7 | open a file, map it into memory, and copy to console 8 | 9 | *******************************************************************************/ 10 | 11 | void main (char[][] args) 12 | { 13 | if (args.length is 2) 14 | { 15 | // open a file for reading 16 | auto mmap = new MappedFile (args[1]); 17 | 18 | // copy content to console 19 | Cout (cast(char[]) mmap.map) (); 20 | } 21 | else 22 | Cout ("usage is: mmap filename").newline; 23 | } 24 | -------------------------------------------------------------------------------- /doc/example/conduits/pathchildren.d: -------------------------------------------------------------------------------- 1 | /***************************************************** 2 | 3 | Example that shows listing of children to a path. 4 | 5 | *****************************************************/ 6 | 7 | import tango.io.Stdout; 8 | 9 | import Path = tango.io.Path; 10 | 11 | void main(char[][] args) 12 | { 13 | if (args.length < 2) { 14 | Stdout("Please give a path as argument.").newline; 15 | return; 16 | } 17 | 18 | foreach(child; Path.children(args[1])) { 19 | if(child.folder) 20 | continue; 21 | 22 | Stdout.formatln("Child {} has path \"{}\" and size is {} bytes", 23 | child.name, 24 | child.path, 25 | child.bytes); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /doc/example/conduits/paths.d: -------------------------------------------------------------------------------- 1 | /***************************************************** 2 | 3 | How to create a path with all ancestors 4 | 5 | *****************************************************/ 6 | 7 | import tango.io.FilePath; 8 | 9 | void main (char[][] args) 10 | { 11 | auto path = new FilePath (r"d/tango/foo/bar/wumpus".dup); 12 | assert (path.create().exists && path.isFolder); 13 | } 14 | -------------------------------------------------------------------------------- /doc/example/conduits/randomio.d: -------------------------------------------------------------------------------- 1 | 2 | private import tango.io.device.File; 3 | private import tango.io.stream.Data; 4 | 5 | /******************************************************************************* 6 | 7 | Create a file for random access. Write some stuff to it, rewind to 8 | file start and read back. 9 | 10 | *******************************************************************************/ 11 | 12 | void main() 13 | { 14 | // open a file for reading 15 | auto file = new File ("random.bin", File.ReadWriteCreate); 16 | 17 | // construct (binary) reader & writer upon this conduit 18 | auto read = new DataInput (file); 19 | auto write = new DataOutput (file); 20 | 21 | int x=10, y=20; 22 | 23 | // write some data and flush output since IO is buffered 24 | write.int32(x); 25 | write.int32(y); 26 | write.flush(); 27 | 28 | // rewind to file start 29 | file.seek (0); 30 | 31 | // read data back again, but swap destinations 32 | y = read.int32(); 33 | x = read.int32(); 34 | 35 | assert (y is 10); 36 | assert (x is 20); 37 | 38 | file.close(); 39 | } 40 | -------------------------------------------------------------------------------- /doc/example/conduits/shuffle.d: -------------------------------------------------------------------------------- 1 | import tango.io.Stdout, 2 | tango.io.FilePath, 3 | tango.io.FileScan; 4 | 5 | import Array = tango.core.Array; 6 | 7 | int main (char[][] args) 8 | { 9 | if (args.length != 3) 10 | { 11 | Stdout.formatln ("usage: shuffle fromdir todir"); 12 | return 1; 13 | } 14 | 15 | // set destination path, and add trailing separator as necessary 16 | auto dst = new FilePath; 17 | dst.path = args[2]; 18 | 19 | // recursively search for all the mp3, wma and w4a files in specified directory 20 | auto songs = new FileScan; 21 | songs (args[1], (FilePath fp, bool isDir) 22 | {return isDir || fp.suffix == ".mp3" || fp.suffix == ".wma"|| fp.suffix == ".m4a";}); 23 | 24 | // shuffle the files 25 | Stdout.formatln ("{} music files", songs.files().length); 26 | Array.shuffle (songs.files()); 27 | 28 | // sequentially fill the target until done, or it quits with an 29 | // exception when the device is full 30 | foreach (song; songs.files()) 31 | dst.file(song.file).copy(song); 32 | 33 | Stdout.formatln ("Done"); 34 | return 0; 35 | } 36 | -------------------------------------------------------------------------------- /doc/example/conduits/unifile.d: -------------------------------------------------------------------------------- 1 | 2 | private import tango.io.Console, 3 | tango.io.UnicodeFile; 4 | 5 | /******************************************************************************* 6 | 7 | Open a unicode file of an unknown encoding, and converts to UTF-8 8 | for console display. UnicodeFile is templated for char/wchar/dchar 9 | target encodings 10 | 11 | *******************************************************************************/ 12 | 13 | void main (char[][] args) 14 | { 15 | if (args.length is 2) 16 | { 17 | // open a file for reading 18 | auto file = new UnicodeFile!(char) (args[1], Encoding.Unknown); 19 | 20 | // display on console 21 | Cout (file.read()).newline; 22 | } 23 | else 24 | Cout ("usage is: unifile filename").newline; 25 | } 26 | -------------------------------------------------------------------------------- /doc/example/console/buffered.d: -------------------------------------------------------------------------------- 1 | private import tango.stdc.stdio; 2 | 3 | private import tango.io.Console; 4 | 5 | /******************************************************************************* 6 | 7 | Demonstrates buffered output. Console output (and Stdout etc) is 8 | buffered, requiring a flush or newline to render on the console. 9 | 10 | *******************************************************************************/ 11 | 12 | void main (char[][] args) 13 | { 14 | Cout ("how now "); 15 | printf ("printf\n"); 16 | Cout ("brown cow").newline; 17 | } 18 | -------------------------------------------------------------------------------- /doc/example/console/hello.d: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Hello World using tango.io 4 | 5 | This illustrates bare console output, with no fancy formatting. 6 | 7 | Console I/O in Tango is UTF-8 across both linux and Win32. The 8 | conversion between various unicode representations is handled 9 | by higher level constructs, such as Stdout and Stderr 10 | 11 | Note that Cerr is tied to the console error output, and Cin is 12 | tied to the console input. 13 | 14 | *******************************************************************************/ 15 | 16 | import tango.io.Console; 17 | 18 | void main() 19 | { 20 | Cout ("hello, sweetheart \u263a").newline; 21 | } 22 | -------------------------------------------------------------------------------- /doc/example/console/stdout.d: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Illustrates the basic console formatting. This is different than 4 | the use of tango.io.Console, in that Stdout supports a variety of 5 | printf-style formatting, and has unicode-conversion support 6 | 7 | *******************************************************************************/ 8 | 9 | private import tango.io.Stdout; 10 | 11 | void main() 12 | { 13 | Stdout ("hello, sweetheart \u263a").newline; 14 | } 15 | -------------------------------------------------------------------------------- /doc/example/logging/chainsaw.d: -------------------------------------------------------------------------------- 1 | import tango.core.Thread; 2 | 3 | import tango.util.log.Log, 4 | tango.util.log.AppendSocket, 5 | tango.util.log.LayoutChainsaw; 6 | 7 | import tango.net.InternetAddress; 8 | 9 | 10 | /******************************************************************************* 11 | 12 | Hooks up to Chainsaw for remote log capture. Chainsaw should be 13 | configured to listen with an XMLSocketReciever 14 | 15 | *******************************************************************************/ 16 | 17 | void main() 18 | { 19 | // get a logger to represent this module 20 | auto logger = Log.lookup ("example.chainsaw"); 21 | 22 | // hook up an appender for XML output 23 | logger.add (new AppendSocket (new InternetAddress("127.0.0.1", 4448), new LayoutChainsaw)); 24 | 25 | while (true) 26 | { 27 | logger.info ("Hello Chainsaw!"); 28 | Thread.sleep (10_000_000); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /doc/example/logging/multilog.d: -------------------------------------------------------------------------------- 1 | import tango.util.log.Log; 2 | import tango.util.log.AppendFile; 3 | import tango.util.log.AppendFiles; 4 | import tango.util.log.AppendConsole; 5 | import tango.util.log.LayoutChainsaw; 6 | 7 | /******************************************************************************* 8 | 9 | Shows how to setup multiple appenders on logging tree 10 | 11 | *******************************************************************************/ 12 | 13 | void main () 14 | { 15 | // set default logging level at the root 16 | auto log = Log.root; 17 | log.level = Level.Trace; 18 | 19 | // 10 logs, all with 10 mbs each 20 | log.add (new AppendFiles ("rolling.log", 9, 1024*1024*10)); 21 | 22 | // a single file appender, with an XML layout 23 | log.add (new AppendFile ("single.log", new LayoutChainsaw)); 24 | 25 | // console appender 26 | log.add (new AppendConsole); 27 | 28 | // log to all 29 | log.trace ("three-way logging"); 30 | } 31 | 32 | -------------------------------------------------------------------------------- /doc/example/networking/homepage.d: -------------------------------------------------------------------------------- 1 | 2 | private import tango.io.Console; 3 | 4 | private import tango.net.http.HttpClient, 5 | tango.net.http.HttpHeaders; 6 | 7 | /******************************************************************************* 8 | 9 | Shows how to use HttpClient to retrieve content from the D website 10 | 11 | *******************************************************************************/ 12 | 13 | void main() 14 | { 15 | auto client = new HttpClient (HttpClient.Get, "http://www.digitalmars.com/d/intro.html"); 16 | 17 | // open the client and get the input stream 18 | auto input = client.open(); 19 | scope (exit) 20 | client.close(); 21 | 22 | // display returned content on console 23 | if (client.isResponseOK()) 24 | Cout.stream.copy (input); 25 | else 26 | Cout ("failed to return the D home page"); 27 | 28 | // flush the console 29 | Cout.newline; 30 | } 31 | -------------------------------------------------------------------------------- /doc/example/networking/httpget.d: -------------------------------------------------------------------------------- 1 | private import tango.io.Console; 2 | 3 | private import tango.net.http.HttpGet; 4 | 5 | /******************************************************************************* 6 | 7 | Read a page from a website, gathering the entire page before 8 | returning any content. This illustrates a high-level approach 9 | to retrieving web-content, whereas the homepage example shows 10 | a somewhat lower-level approach. 11 | 12 | Note that this expects a fully qualified URL (with scheme), 13 | such as "http://www.digitalmars.com/d/intro.html" 14 | 15 | *******************************************************************************/ 16 | 17 | void main (char[][] args) 18 | { 19 | const(char)[] url = (args.length is 2) ? args[1] : "http://www.digitalmars.com/d/intro.html"; 20 | 21 | // open a web-page for reading (see HttpPost for writing) 22 | auto page = new HttpGet (url); 23 | 24 | // retrieve and flush display content 25 | Cout (cast(char[]) page.read()) (); 26 | } 27 | 28 | -------------------------------------------------------------------------------- /doc/example/networking/sockethello.d: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Shows how to create a basic socket client, and how to converse with 4 | a remote server. The server must be running for this to succeed 5 | 6 | *******************************************************************************/ 7 | 8 | private import tango.io.Console; 9 | 10 | private import tango.net.device.Socket, 11 | tango.net.InternetAddress; 12 | 13 | void main() 14 | { 15 | // make a connection request to the server 16 | auto request = new Socket; 17 | request.connect (new InternetAddress ("localhost", 8080)); 18 | request.output.write ("hello\n"); 19 | 20 | // wait for response (there is an optional timeout supported) 21 | char[64] response; 22 | auto size = request.input.read (response); 23 | 24 | // close socket 25 | request.close(); 26 | 27 | // display server response 28 | Cout (response[0..size]).newline; 29 | } 30 | -------------------------------------------------------------------------------- /doc/example/system/stacktrace.d: -------------------------------------------------------------------------------- 1 | import tango.core.tools.TraceExceptions; 2 | 3 | void foo() 4 | { 5 | assert(false); 6 | } 7 | 8 | void main() 9 | { 10 | /* Doesn't work? */ 11 | foo(); 12 | } 13 | -------------------------------------------------------------------------------- /doc/example/text/formatalign.d: -------------------------------------------------------------------------------- 1 | /** 2 | 3 | Example showing how the alignment component in a format string argument works. 4 | 5 | Put into public domain by Lars Ivar Igesund 6 | 7 | */ 8 | 9 | import tango.io.Stdout; 10 | 11 | void main(){ 12 | const(char)[] myFName = "Johnny"; 13 | Stdout.formatln("First Name = |{0,15}|", myFName); 14 | Stdout.formatln("Last Name = |{0,15}|", "Foo de Bar"); 15 | 16 | Stdout.formatln("First Name = |{0,-15}|", myFName); 17 | Stdout.formatln("Last Name = |{0,-15}|", "Foo de Bar"); 18 | 19 | Stdout.formatln("First name = |{0,5}|", myFName); 20 | } 21 | -------------------------------------------------------------------------------- /doc/example/text/formatindex.d: -------------------------------------------------------------------------------- 1 | /** 2 | 3 | Example that shows how the format specifiers can be used to index into 4 | the argument list. 5 | 6 | Put into public domain by Lars Ivar Igesund. 7 | 8 | */ 9 | 10 | import tango.io.Stdout; 11 | 12 | void main(){ 13 | Stdout.formatln("Many {1} can now be {0} around to make {2} easier,\n and {1} can also be repeated.", 14 | "switched", "arguments", "localization"); 15 | } 16 | -------------------------------------------------------------------------------- /doc/example/text/formatspec.d: -------------------------------------------------------------------------------- 1 | /** 2 | 3 | Example showing how to use format specifier components in a format string's 4 | argument. 5 | 6 | Put into public domain by Lars Ivar Igesund 7 | 8 | */ 9 | 10 | import tango.io.Stdout; 11 | import tango.text.locale.Locale; 12 | 13 | void main(){ 14 | Stdout.layout = new Locale; 15 | double avogadros = 6.0221415e23; 16 | Stdout.formatln("I have {0:C} in cash.", 100); 17 | Stdout.formatln("Avogadro's number is {0:F}.", avogadros); 18 | Stdout.formatln("Avogadro's number (with alignment) is {0,34:F}.", avogadros); 19 | Stdout.formatln("Foo {:G}", 20); 20 | } 21 | -------------------------------------------------------------------------------- /doc/example/text/localetime.d: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Example to format a locale-based time. For a default locale of 4 | en-gb, this examples formats in the following manner: 5 | 6 | "Thu, 27 April 2006 18:20:47 +1" 7 | 8 | ******************************************************************************/ 9 | 10 | private import tango.io.Console; 11 | 12 | private import tango.time.Clock; 13 | 14 | private import tango.text.locale.Locale; 15 | 16 | void main () 17 | { 18 | auto layout = new Locale; 19 | 20 | Cout (layout ("{:ddd, dd MMMM yyyy HH:mm:ss z}", Clock.now)).newline; 21 | } 22 | -------------------------------------------------------------------------------- /doc/example/text/token.d: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Tokenize input from the console. There are a variety of handy 4 | tokenizers in the tango.text package ~ this illustrates usage 5 | of an iterator that recognizes quoted-strings within an input 6 | array, and splits elements on a provided set of delimiters 7 | 8 | *******************************************************************************/ 9 | 10 | import tango.io.Console; 11 | 12 | import Text = tango.text.Util; 13 | 14 | void main() 15 | { 16 | // flush the console output, since we have no newline present 17 | Cout ("Please enter some space-separated tokens: ") (); 18 | 19 | // create quote-aware iterator for handling space-delimited 20 | // tokens from the console input 21 | foreach (element; Text.quotes (Text.trim(Cin.get()), " \t")) 22 | Cout ("<") (element) ("> "); 23 | 24 | Cout.newline; 25 | } 26 | -------------------------------------------------------------------------------- /doc/example/text/xmldom.d: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright: Copyright (C) 2007-2008 Kris Bell. All rights reserved. 4 | 5 | License: BSD Style 6 | Authors: Kris 7 | 8 | *******************************************************************************/ 9 | 10 | import tango.io.Stdout; 11 | import tango.io.device.File; 12 | import tango.time.StopWatch; 13 | import tango.text.xml.Document; 14 | import tango.text.xml.DocPrinter; 15 | 16 | /******************************************************************************* 17 | 18 | *******************************************************************************/ 19 | 20 | void bench (int iterations) 21 | { 22 | StopWatch elapsed; 23 | 24 | auto doc = new Document!(char); 25 | auto content = cast (char[]) File.get ("hamlet.xml"); 26 | 27 | elapsed.start(); 28 | for (auto i=0; ++i < iterations;) 29 | doc.parse (content); 30 | 31 | Stdout.formatln ("{} MB/s", (content.length * iterations) / (elapsed.stop() * (1024 * 1024))); 32 | } 33 | 34 | /******************************************************************************* 35 | 36 | *******************************************************************************/ 37 | 38 | void main() 39 | { 40 | for (int i=10; i--;) 41 | bench (2000); 42 | } 43 | 44 | -------------------------------------------------------------------------------- /doc/example/text/xmlpull.d: -------------------------------------------------------------------------------- 1 | import tango.io.Stdout; 2 | import tango.io.device.File; 3 | import tango.time.StopWatch; 4 | import tango.text.xml.PullParser; 5 | 6 | void benchmark (int iterations) 7 | { 8 | StopWatch elapsed; 9 | 10 | auto content = cast (char[]) File.get ("hamlet.xml"); 11 | auto parser = new PullParser!(char) (content); 12 | 13 | uint j; 14 | elapsed.start(); 15 | for (auto i=0; ++i < iterations;) 16 | { 17 | while (parser.next) {++j;} 18 | parser.reset(); 19 | } 20 | Stdout.formatln ("{} MB/s, {} tokens", (content.length * iterations) / (elapsed.stop() * (1024 * 1024)), j); 21 | } 22 | 23 | 24 | void main() 25 | { 26 | // uncomment me, and try again ... 27 | // I tried it, made the code go 2x faster -SiegeLord Jan, 2012 28 | //char[] s = null; 29 | for (int i = 10; --i;) 30 | benchmark (2000); 31 | } 32 | 33 | -------------------------------------------------------------------------------- /doc/example/vfs/vfscan.d: -------------------------------------------------------------------------------- 1 | import tango.io.Stdout, 2 | tango.io.vfs.FileFolder; 3 | 4 | /******************************************************************************* 5 | 6 | List ".d" files and enclosing folders visible via a directory given 7 | as a command-line argument. In this example we're also postponing a 8 | flush on Stdout until output is complete. Stdout is usually flushed 9 | on each invocation of newline or formatln, but here we're using '\n' 10 | to illustrate how to avoid flushing many individual lines 11 | 12 | *******************************************************************************/ 13 | 14 | void main(char[][] args) 15 | { 16 | const(char)[] root = args.length < 2 ? "." : args[1]; 17 | Stdout.formatln ("Scanning '{}'", root); 18 | 19 | auto scan = new FileFolder (root); 20 | auto tree = scan.tree; 21 | auto catalog = tree.catalog ("*.d"); 22 | 23 | Stdout.format ("\n{} Folders\n", tree.folders); 24 | foreach (folder; tree) 25 | Stdout.format ("{}\n", folder); 26 | 27 | Stdout.format ("\n{0} Files\n", catalog.files); 28 | foreach (file; catalog) 29 | Stdout.format ("{}\n", file); 30 | } 31 | -------------------------------------------------------------------------------- /doc/example/vfs/vfscanregex.d: -------------------------------------------------------------------------------- 1 | /************************************************************** 2 | 3 | Example that use FileFolder and Regex as a filter. 4 | 5 | Put into public domain by Lars Ivar Igesund 6 | 7 | **************************************************************/ 8 | 9 | import tango.io.Stdout, 10 | tango.text.Regex; 11 | 12 | import tango.io.vfs.FileFolder; 13 | 14 | void main(char[][] args) 15 | { 16 | if (args.length < 2) 17 | { 18 | Stdout("Please pass a directory to search").newline; 19 | return; 20 | } 21 | 22 | scope regex = Regex(r"\.(d|obj)$"); 23 | scope scan = new FileFolder (args[1]); 24 | 25 | auto tree = scan.tree; 26 | auto catalog = tree.catalog (delegate bool(VfsInfo info){return regex.test(info.name);}); 27 | 28 | foreach (file; catalog) 29 | Stdout(file).newline; 30 | 31 | Stdout.formatln("Found {} matches in {} entries", catalog.files, tree.files); 32 | } 33 | 34 | -------------------------------------------------------------------------------- /doc/example/vfs/vfszip.d: -------------------------------------------------------------------------------- 1 | module vfszip; 2 | 3 | import tango.io.vfs.ZipFolder; 4 | import tango.io.Stdout; 5 | 6 | /****************************************************************************** 7 | 8 | VFS example that reads the file tmp.zip or one given as an argument. 9 | 10 | The example prints the file count in the zip, the content size, and then 11 | outputs the content itself. Only recommended for small zips with text files. 12 | 13 | Written and put into the public domain by Piotr Modzelewski. 14 | 15 | ******************************************************************************/ 16 | 17 | void main(char[][] args) 18 | { 19 | const(char)[] zipname; 20 | if (args.length == 2) 21 | zipname = args[1]; 22 | else 23 | zipname = "tmp.zip"; 24 | 25 | auto archive = new ZipFolder(zipname); 26 | auto info = archive.self; 27 | 28 | Stdout.formatln ("file count: {}", info.files); 29 | Stdout.formatln ("content size (of files): {}", info.bytes); 30 | 31 | foreach (file; archive.tree.catalog){ 32 | Stdout(file.name).newline; 33 | Stdout.stream.copy( file.input ); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /doc/example/xml/attrquery.d: -------------------------------------------------------------------------------- 1 | import tango.io.device.File; 2 | import tango.io.Stdout; 3 | import tango.text.xml.Document; 4 | 5 | /****************************************************************************** 6 | 7 | From http://www.dsource.org/projects/tango/wiki/TutXmlPath 8 | 9 | Free for any use, without warranty, by Sean Kerr 10 | 11 | ******************************************************************************/ 12 | 13 | void main () { 14 | // load our xml document 15 | auto xml = cast(char[])File.get("xpath.xml"); 16 | 17 | // create document 18 | auto doc = new Document!(char); 19 | doc.parse(xml); 20 | 21 | // get the root element 22 | auto root = doc.elements; 23 | 24 | // query the doc for all country elements with an id attribute (all of them) 25 | auto result = root.query().descendant("country").attribute("id"); 26 | 27 | foreach (e; result) { 28 | Stdout(e.value).newline; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /doc/example/xml/filterquery.d: -------------------------------------------------------------------------------- 1 | import tango.io.device.File; 2 | import tango.io.Stdout; 3 | import tango.text.Util; 4 | import tango.text.xml.Document; 5 | 6 | /****************************************************************************** 7 | 8 | From http://www.dsource.org/projects/tango/wiki/TutXmlPath 9 | 10 | Free for any use, without warranty, by Sean Kerr 11 | 12 | ******************************************************************************/ 13 | 14 | void main () { 15 | // create document 16 | auto doc = new Document!(char); 17 | 18 | // parse our xml 19 | doc.parse (cast(char[]) File.get("xpath.xml")); 20 | 21 | // get the root element 22 | auto root = doc.elements; 23 | 24 | // query the doc for all country elements with an id attribute that contains a 'B' 25 | auto result = root.query().descendant("country").filter((doc.Node node) { 26 | return contains!(char)(node.attributes.name(null, "id").value, 'B'); 27 | }); 28 | 29 | foreach (e; result) { 30 | Stdout.format("id = {}, name = {}", e.attributes.name(null, "id").value, e.value).newline; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /doc/example/xml/iterate.d: -------------------------------------------------------------------------------- 1 | import tango.io.device.File; 2 | import tango.io.Stdout; 3 | import tango.text.xml.Document; 4 | 5 | /****************************************************************************** 6 | 7 | From http://www.dsource.org/projects/tango/wiki/TutXmlPath 8 | 9 | Free for any use, without warranty, by Sean Kerr 10 | 11 | ******************************************************************************/ 12 | 13 | void main () { 14 | // load our xml document 15 | auto xml = cast(char[])File.get("xpath.xml"); 16 | 17 | // create document 18 | auto doc = new Document!(char); 19 | doc.parse(xml); 20 | 21 | // get the root element 22 | auto root = doc.elements; 23 | 24 | // query the doc for all country elements 25 | auto result = root.query().descendant("country"); 26 | 27 | foreach (e; result) { 28 | Stdout(e.value).newline; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /doc/example/xml/loadparse.d: -------------------------------------------------------------------------------- 1 | import tango.io.device.File; 2 | import tango.io.Stdout; 3 | import tango.text.xml.Document; 4 | 5 | /****************************************************************************** 6 | 7 | From http://www.dsource.org/projects/tango/wiki/TutXmlPath 8 | 9 | Free for any use, without warranty, by Sean Kerr 10 | 11 | ******************************************************************************/ 12 | 13 | void main () { 14 | // load our xml document 15 | auto xml = cast(char[])File.get("xpath.xml"); 16 | 17 | Stdout.format("The length of the XML document is {} bytes", xml.length).newline; 18 | 19 | // create document 20 | auto doc = new Document!(char); 21 | 22 | doc.parse(xml); 23 | } 24 | -------------------------------------------------------------------------------- /dub.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tango", 3 | "description": "A large general-purpose library. A port of the D1 Tango library.", 4 | "homepage": "https://github.com/SiegeLord/Tango-D2/", 5 | "license": "BSD 3-clause", 6 | "authors": [ 7 | "SiegeLord", 8 | "Igor Stepanov", 9 | "Kris Bell", 10 | "Sean Kelly", 11 | "Lars Ivar Igesund", 12 | "other original Tango authors" 13 | ], 14 | 15 | "sourcePaths": [ 16 | "tango/core", "tango/io", "tango/math", "tango/net", "tango/stdc", 17 | "tango/sys/consts", "tango/text", "tango/time", "tango/util" 18 | ], 19 | 20 | "sourceFiles": [ 21 | "tango/sys/Common.d", "tango/sys/Environment.d", 22 | "tango/sys/HomeFolder.d", "tango/sys/Pipe.d", 23 | "tango/sys/Process.d", "tango/sys/SharedLib.d" 24 | ], 25 | 26 | "sourcePaths-windows": ["tango/sys/win32"], 27 | "sourcePaths-linux": ["tango/sys/linux"], 28 | "sourcePaths-freebsd": ["tango/sys/freebsd"], 29 | "sourcePaths-solaris": ["tango/sys/solaris"], 30 | "sourcePaths-osx": ["tango/sys/darwin"], 31 | 32 | "excludedSourceFiles-windows": ["tango/stdc/posix/*"], 33 | 34 | "versions-freebsd" : ["freebsd"], 35 | 36 | "importPaths": ["."], 37 | 38 | "libs": ["bz2"], 39 | 40 | "configurations": [ 41 | { 42 | "name": "static", 43 | "targetType": "staticLibrary" 44 | }, 45 | { 46 | "name": "shared", 47 | "targetType": "dynamicLibrary" 48 | } 49 | ], 50 | 51 | "targetName": "tango", 52 | "targetPath": "." 53 | } 54 | -------------------------------------------------------------------------------- /tango/core/Compiler.d: -------------------------------------------------------------------------------- 1 | /** 2 | * Module to track the compiler version. 3 | * 4 | * Copyright: Copyright (C) 2013 Pavel Sountsov. All rights reserved. 5 | * License: BSD style: $(LICENSE) 6 | * Authors: Pavel Sountsov 7 | */ 8 | module tango.core.Compiler; 9 | 10 | version(SDC) 11 | { 12 | enum DMDFE_Version = 0; 13 | } 14 | else version(LDC) 15 | { 16 | /* Some sort of bug */ 17 | static if(__VERSION__ < 2000) 18 | enum DMDFE_Version = __VERSION__ + 2000; 19 | else 20 | enum DMDFE_Version = __VERSION__; 21 | } 22 | else 23 | { 24 | enum DMDFE_Version = __VERSION__; 25 | } 26 | -------------------------------------------------------------------------------- /tango/core/Octal.d: -------------------------------------------------------------------------------- 1 | /** 2 | * An minimal implementation of the deprecated octal literals 3 | * 4 | * Copyright: Copyright (C) 2011 Pavel Sountsov. All rights reserved. 5 | * License: BSD style: $(LICENSE) 6 | * Authors: Pavel Sountsov 7 | */ 8 | module tango.core.Octal; 9 | 10 | T toOctal(T)(T decimal) 11 | { 12 | T ret = 0; 13 | uint power = 0; 14 | int sign = 1; 15 | if(decimal < 0) 16 | { 17 | decimal = -decimal; 18 | sign = -1; 19 | } 20 | while(decimal > 0) 21 | { 22 | int digit = decimal % 10; 23 | assert(digit < 8, "Only digits [0..7] are allowed in octal literals"); 24 | ret += digit << power; 25 | 26 | decimal /= 10; 27 | power += 3; 28 | } 29 | 30 | return ret * sign; 31 | } 32 | 33 | template octal(int decimal) 34 | { 35 | enum octal = toOctal(decimal); 36 | } 37 | 38 | template octalU(uint decimal) 39 | { 40 | enum octal = toOctal(decimal); 41 | } 42 | 43 | template octalL(long decimal) 44 | { 45 | enum octal = toOctal(decimal); 46 | } 47 | 48 | template octalUL(ulong decimal) 49 | { 50 | enum octal = toOctal(decimal); 51 | } 52 | 53 | debug(UnitTest) 54 | { 55 | unittest 56 | { 57 | assert(octal!(764) == 500); 58 | assert(octal!(1) == 1); 59 | assert(octal!(0) == 0); 60 | assert(octal!(-10) == -8); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /tango/core/Runtime.d: -------------------------------------------------------------------------------- 1 | /** 2 | * The runtime module exposes information specific to the D runtime code. 3 | * 4 | * Copyright: Copyright (C) 2005-2006 Sean Kelly. All rights reserved. 5 | * License: BSD style: $(LICENSE) 6 | * Author: Sean Kelly 7 | */ 8 | module tango.core.Runtime; 9 | 10 | import druntime = core.runtime; 11 | 12 | private 13 | { 14 | extern(C) void consoleInteger (ulong i); 15 | extern(C) void consoleString (in char[] str); 16 | } 17 | 18 | struct Runtime 19 | { 20 | struct Console 21 | { 22 | alias stderr opCall; 23 | 24 | Console stderr (in char[] s) 25 | { 26 | consoleString (s); 27 | return this; 28 | } 29 | 30 | Console stderr (ulong i) 31 | { 32 | consoleInteger (i); 33 | return this; 34 | } 35 | } 36 | 37 | 38 | @property static Console console() 39 | { 40 | Console c; 41 | return c; 42 | } 43 | 44 | // Export the druntime Runtime functions 45 | druntime.Runtime _r; 46 | alias _r this; 47 | } 48 | 49 | // // Export the druntime functions 50 | alias druntime.runModuleUnitTests runModuleUnitTests; 51 | alias druntime.defaultTraceHandler defaultTraceHandler; 52 | -------------------------------------------------------------------------------- /tango/core/Time.d: -------------------------------------------------------------------------------- 1 | /** 2 | * A lightweight alternative to core.time that avoids all templates 3 | * 4 | * Copyright: Copyright (C) 2012 Pavel Sountsov. All rights reserved. 5 | * License: BSD style: $(LICENSE) 6 | * Authors: Pavel Sountsov 7 | */ 8 | module tango.core.Time; 9 | 10 | static import core.time; 11 | 12 | /** 13 | * Returns a Duration struct that represents secs seconds. 14 | */ 15 | core.time.Duration seconds(double secs) 16 | { 17 | struct DurationClone 18 | { 19 | long hnsecs; 20 | } 21 | 22 | return cast(core.time.Duration)(DurationClone(cast(long)(secs * 10_000_000))); 23 | } 24 | -------------------------------------------------------------------------------- /tango/core/Version.d: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | copyright: Copyright (c) 2007 Kris Bell. All rights reserved 4 | 5 | license: BSD style: $(LICENSE) 6 | 7 | version: Jan 2007: Initial release 8 | 9 | author: Kris 10 | 11 | Exposes the library version number 12 | 13 | *******************************************************************************/ 14 | 15 | module tango.core.Version; 16 | 17 | /// Tango's version. 18 | public enum Tango { 19 | Major = 1, /// Major version number. 20 | Minor = 0 /// Minor version number. 21 | } 22 | -------------------------------------------------------------------------------- /tango/core/tools/TraceExceptions.d: -------------------------------------------------------------------------------- 1 | /** 2 | * Stacktracing 3 | * 4 | * Inclusion of this module activates traced exceptions using the tango own tracers if possible 5 | * 6 | * Copyright: 2009 Fawzi 7 | * License: tango license, apache 2.0 8 | * Authors: Fawzi Mohamed 9 | */ 10 | module tango.core.tools.TraceExceptions; 11 | 12 | 13 | import tango.core.tools.StackTrace; 14 | 15 | extern (C) void rt_setTraceHandler( TraceHandler h ); 16 | 17 | shared static this(){ 18 | rt_setTraceHandler(&basicTracer); 19 | } 20 | -------------------------------------------------------------------------------- /tango/math/BigInt.d: -------------------------------------------------------------------------------- 1 | deprecated("tango.math.BigInt is deprecated. Please use std.bigint instead.") module tango.math.BigInt; 2 | 3 | version(NoPhobos) 4 | { 5 | 6 | } 7 | else 8 | { 9 | public import std.bigint; 10 | } 11 | -------------------------------------------------------------------------------- /tango/math/random/engines/ArraySource.d: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | copyright: Copyright (c) 2008. Fawzi Mohamed 3 | license: BSD style: $(LICENSE) 4 | version: Initial release: July 2008 5 | author: Fawzi Mohamed 6 | *******************************************************************************/ 7 | module tango.math.random.engines.ArraySource; 8 | 9 | /// very simple array based source (use with care, some methods in non uniform distributions 10 | /// expect a random source with correct statistics, and could loop forever with such a source) 11 | struct ArraySource{ 12 | uint[] a; 13 | size_t i; 14 | enum int canCheckpoint=false; // implement? 15 | enum int canSeed=false; 16 | 17 | static ArraySource opCall(uint[] a,size_t i=0) 18 | in { assert(a.length>0,"array needs at least one element"); } 19 | body { 20 | ArraySource res; 21 | res.a=a; 22 | res.i=i; 23 | return res; 24 | } 25 | uint next(){ 26 | assert(a.length>i,"error, array out of bounds"); 27 | uint el=a[i]; 28 | i=(i+1)%a.length; 29 | return el; 30 | } 31 | ubyte nextB(){ 32 | return cast(ubyte)(0xFF&next()); 33 | } 34 | ulong nextL(){ 35 | return ((cast(ulong)next())<<32)+cast(ulong)next(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /tango/stdc/config.d: -------------------------------------------------------------------------------- 1 | /** 2 | * D header file for C99. 3 | * 4 | * Copyright: Public Domain 5 | * License: Public Domain 6 | * Authors: Sean Kelly 7 | * Standards: ISO/IEC 9899:1999 (E) 8 | */ 9 | module tango.stdc.config; 10 | 11 | extern (C): 12 | 13 | version( Windows ) 14 | { 15 | alias int c_long; 16 | alias uint c_ulong; 17 | } 18 | else 19 | { 20 | static if( (void*).sizeof > int.sizeof ) 21 | { 22 | alias long c_long; 23 | alias ulong c_ulong; 24 | } 25 | else 26 | { 27 | alias int c_long; 28 | alias uint c_ulong; 29 | } 30 | } 31 | 32 | version( solaris ) 33 | { 34 | alias ulong upad64_t; 35 | } 36 | -------------------------------------------------------------------------------- /tango/stdc/ctype.d: -------------------------------------------------------------------------------- 1 | /** 2 | * D header file for C99. 3 | * 4 | * Copyright: Public Domain 5 | * License: Public Domain 6 | * Authors: Sean Kelly 7 | * Standards: ISO/IEC 9899:1999 (E) 8 | */ 9 | module tango.stdc.ctype; 10 | 11 | extern (C): 12 | 13 | int isalnum(int c); 14 | int isalpha(int c); 15 | int isblank(int c); 16 | int iscntrl(int c); 17 | int isdigit(int c); 18 | int isgraph(int c); 19 | int islower(int c); 20 | int isprint(int c); 21 | int ispunct(int c); 22 | int isspace(int c); 23 | int isupper(int c); 24 | int isxdigit(int c); 25 | int tolower(int c); 26 | int toupper(int c); 27 | -------------------------------------------------------------------------------- /tango/stdc/errno.d: -------------------------------------------------------------------------------- 1 | /** 2 | * D header file for C99. 3 | * 4 | * Copyright: Public Domain 5 | * License: Public Domain 6 | * Authors: Sean Kelly 7 | * Standards: ISO/IEC 9899:1999 (E) 8 | */ 9 | module tango.stdc.errno; 10 | public import tango.sys.consts.errno; 11 | 12 | private 13 | { 14 | extern (C) int getErrno(); 15 | extern (C) int setErrno(int); 16 | } 17 | 18 | @property int errno() { return getErrno(); } 19 | @property int errno( int val ) { return setErrno( val ); } 20 | 21 | -------------------------------------------------------------------------------- /tango/stdc/limits.d: -------------------------------------------------------------------------------- 1 | /** 2 | * D header file for C99. 3 | * 4 | * Copyright: Public Domain 5 | * License: Public Domain 6 | * Authors: Sean Kelly 7 | * Standards: ISO/IEC 9899:1999 (E) 8 | */ 9 | module tango.stdc.limits; 10 | 11 | private import tango.stdc.config; 12 | 13 | extern (C): 14 | 15 | const CHAR_BIT = 8; 16 | const SCHAR_MIN = byte.min; 17 | const SCHAR_MAX = byte.max; 18 | const UCHAR_MAX = ubyte.max; 19 | const CHAR_MIN = char.min; 20 | const CHAR_MAX = char.max; 21 | const MB_LEN_MAX = 16; 22 | const SHRT_MIN = short.min; 23 | const SHRT_MAX = short.max; 24 | const USHRT_MAX = ushort.max; 25 | const INT_MIN = int.min; 26 | const INT_MAX = int.max; 27 | const UINT_MAX = uint.max; 28 | const LONG_MIN = c_long.min; 29 | const LONG_MAX = c_long.max; 30 | const ULONG_MAX = c_ulong.max; 31 | const LLONG_MIN = long.min; 32 | const LLONG_MAX = long.max; 33 | const ULLONG_MAX = ulong.max; 34 | -------------------------------------------------------------------------------- /tango/stdc/locale.d: -------------------------------------------------------------------------------- 1 | /** 2 | * D header file for C99. 3 | * 4 | * Copyright: Public Domain 5 | * License: Public Domain 6 | * Authors: Sean Kelly 7 | * Standards: ISO/IEC 9899:1999 (E) 8 | */ 9 | module tango.stdc.locale; 10 | 11 | extern (C): 12 | 13 | struct lconv 14 | { 15 | char* decimal_point; 16 | char* thousands_sep; 17 | char* grouping; 18 | char* int_curr_symbol; 19 | char* currency_symbol; 20 | char* mon_decimal_point; 21 | char* mon_thousands_sep; 22 | char* mon_grouping; 23 | char* positive_sign; 24 | char* negative_sign; 25 | byte int_frac_digits; 26 | byte frac_digits; 27 | byte p_cs_precedes; 28 | byte p_sep_by_space; 29 | byte n_cs_precedes; 30 | byte n_sep_by_space; 31 | byte p_sign_posn; 32 | byte n_sign_posn; 33 | byte int_p_cs_precedes; 34 | byte int_p_sep_by_space; 35 | byte int_n_cs_precedes; 36 | byte int_n_sep_by_space; 37 | byte int_p_sign_posn; 38 | byte int_n_sign_posn; 39 | } 40 | 41 | const LC_CTYPE = 0; 42 | const LC_NUMERIC = 1; 43 | const LC_TIME = 2; 44 | const LC_COLLATE = 3; 45 | const LC_MONETARY = 4; 46 | const LC_MESSAGES = 5; 47 | const LC_ALL = 6; 48 | const LC_PAPER = 7; 49 | const LC_NAME = 8; 50 | const LC_ADDRESS = 9; 51 | const LC_TELEPHONE = 10; 52 | const LC_MEASUREMENT = 11; 53 | const LC_IDENTIFICATION = 12; 54 | 55 | char* setlocale(int category, in char* locale); 56 | lconv* localeconv(); 57 | -------------------------------------------------------------------------------- /tango/stdc/posix/config.d: -------------------------------------------------------------------------------- 1 | /** 2 | * D header file for POSIX. 3 | * 4 | * Copyright: Public Domain 5 | * License: Public Domain 6 | * Authors: Sean Kelly 7 | * Standards: The Open Group Base Specifications Issue 6, IEEE Std 1003.1, 2004 Edition 8 | */ 9 | module tango.stdc.posix.config; 10 | 11 | public import tango.stdc.config; 12 | 13 | extern (C): 14 | 15 | version( linux ) 16 | { 17 | version = OPTIONAL_LARGEFILE_SUPPORT; 18 | } 19 | else version( solaris ) 20 | { 21 | version = OPTIONAL_LARGEFILE_SUPPORT; 22 | } 23 | 24 | version( OPTIONAL_LARGEFILE_SUPPORT ) 25 | { 26 | version(SMALLFILE) 27 | enum :bool {__USE_LARGEFILE64 = false} 28 | else 29 | enum :bool {__USE_LARGEFILE64 = ((void*).sizeof==4)} 30 | } else { 31 | enum :bool {__USE_LARGEFILE64 = false} 32 | } 33 | -------------------------------------------------------------------------------- /tango/stdc/posix/inttypes.d: -------------------------------------------------------------------------------- 1 | /** 2 | * D header file for POSIX. 3 | * 4 | * Copyright: Public Domain 5 | * License: Public Domain 6 | * Authors: Sean Kelly 7 | * Standards: The Open Group Base Specifications Issue 6, IEEE Std 1003.1, 2004 Edition 8 | */ 9 | module tango.stdc.posix.inttypes; 10 | 11 | private import tango.stdc.posix.config; 12 | public import tango.stdc.inttypes; 13 | 14 | // 15 | // Required 16 | // 17 | /* 18 | intmax_t imaxabs(intmax_t); 19 | imaxdiv_t imaxdiv(intmax_t, intmax_t); 20 | intmax_t strtoimax(in char*, char**, int); 21 | uintmax_t strtoumax(in char *, char**, int); 22 | intmax_t wcstoimax(in wchar_t*, wchar_t**, int); 23 | uintmax_t wcstoumax(in wchar_t*, wchar_t**, int); 24 | */ 25 | intmax_t imaxabs(intmax_t); 26 | imaxdiv_t imaxdiv(intmax_t, intmax_t); 27 | intmax_t strtoimax(in char*, char**, int); 28 | uintmax_t strtoumax(in char *, char**, int); 29 | intmax_t wcstoimax(in wchar_t*, wchar_t**, int); 30 | uintmax_t wcstoumax(in wchar_t*, wchar_t**, int); 31 | -------------------------------------------------------------------------------- /tango/stdc/posix/netinet/tcp.d: -------------------------------------------------------------------------------- 1 | /** 2 | * D header file for POSIX. 3 | * 4 | * Copyright: Public Domain 5 | * License: Public Domain 6 | * Authors: Sean Kelly 7 | * Standards: The Open Group Base Specifications Issue 6, IEEE Std 1003.1, 2004 Edition 8 | */ 9 | module tango.stdc.posix.netinet.tcp; 10 | 11 | private import tango.stdc.posix.config; 12 | 13 | extern (C): 14 | 15 | // 16 | // Required 17 | // 18 | /* 19 | TCP_NODELAY 20 | */ 21 | 22 | version( linux ) 23 | { 24 | const TCP_NODELAY = 1; 25 | } 26 | else version(OSX) 27 | { 28 | const TCP_NODELAY = 1; 29 | } 30 | else version( FreeBSD ) 31 | { 32 | const TCP_NODELAY = 1; 33 | } 34 | else version( solaris ) 35 | { 36 | const TCP_NODELAY = 1; 37 | } 38 | -------------------------------------------------------------------------------- /tango/stdc/posix/utime.d: -------------------------------------------------------------------------------- 1 | /** 2 | * D header file for POSIX. 3 | * 4 | * Copyright: Public Domain 5 | * License: Public Domain 6 | * Authors: Sean Kelly 7 | * Standards: The Open Group Base Specifications Issue 6, IEEE Std 1003.1, 2004 Edition 8 | */ 9 | module tango.stdc.posix.utime; 10 | 11 | private import tango.stdc.posix.config; 12 | public import tango.stdc.posix.sys.types; // for time_t 13 | 14 | extern (C): 15 | 16 | // 17 | // Required 18 | // 19 | /* 20 | struct utimbuf 21 | { 22 | time_t actime; 23 | time_t modtime; 24 | } 25 | 26 | int utime(in char*, in utimbuf*); 27 | */ 28 | 29 | version( linux ) 30 | { 31 | struct utimbuf 32 | { 33 | time_t actime; 34 | time_t modtime; 35 | } 36 | 37 | int utime(in char*, in utimbuf*); 38 | } 39 | else version(OSX) 40 | { 41 | struct utimbuf 42 | { 43 | time_t actime; 44 | time_t modtime; 45 | } 46 | 47 | int utime(in char*, in utimbuf*); 48 | } 49 | else version( FreeBSD ) 50 | { 51 | struct utimbuf 52 | { 53 | time_t actime; 54 | time_t modtime; 55 | } 56 | 57 | int utime(in char*, in utimbuf*); 58 | } 59 | else version( solaris ) 60 | { 61 | struct utimbuf 62 | { 63 | time_t actime; /* access time */ 64 | time_t modtime; /* modification time */ 65 | } 66 | 67 | int utime(in char*, in utimbuf*); 68 | } 69 | -------------------------------------------------------------------------------- /tango/stdc/signal.d: -------------------------------------------------------------------------------- 1 | /** 2 | * D header file for C99. 3 | * 4 | * Copyright: Public Domain 5 | * License: Public Domain 6 | * Authors: Sean Kelly 7 | * Standards: ISO/IEC 9899:1999 (E) 8 | */ 9 | module tango.stdc.signal; 10 | 11 | extern (C): 12 | 13 | // this should be volatile 14 | alias int sig_atomic_t; 15 | 16 | private alias void function(int) sigfn_t; 17 | 18 | version( Posix ) 19 | { 20 | const SIG_ERR = cast(sigfn_t) -1; 21 | const SIG_DFL = cast(sigfn_t) 0; 22 | const SIG_IGN = cast(sigfn_t) 1; 23 | 24 | // standard C signals 25 | const SIGABRT = 6; // Abnormal termination 26 | const SIGFPE = 8; // Floating-point error 27 | const SIGILL = 4; // Illegal hardware instruction 28 | const SIGINT = 2; // Terminal interrupt character 29 | const SIGSEGV = 11; // Invalid memory reference 30 | const SIGTERM = 15; // Termination 31 | } 32 | else 33 | { 34 | const SIG_ERR = cast(sigfn_t) -1; 35 | const SIG_DFL = cast(sigfn_t) 0; 36 | const SIG_IGN = cast(sigfn_t) 1; 37 | 38 | // standard C signals 39 | const SIGABRT = 22; // Abnormal termination 40 | const SIGFPE = 8; // Floating-point error 41 | const SIGILL = 4; // Illegal hardware instruction 42 | const SIGINT = 2; // Terminal interrupt character 43 | const SIGSEGV = 11; // Invalid memory reference 44 | const SIGTERM = 15; // Termination 45 | } 46 | 47 | /// on posix SIGUSR1 and SIGUSR2 are used by the gc, and should not be used/handled/blocked 48 | sigfn_t signal(int sig, sigfn_t func); 49 | int raise(int sig); 50 | -------------------------------------------------------------------------------- /tango/stdc/stddef.d: -------------------------------------------------------------------------------- 1 | /** 2 | * D header file for C99. 3 | * 4 | * Copyright: Public Domain 5 | * License: Public Domain 6 | * Authors: Sean Kelly 7 | * Standards: ISO/IEC 9899:1999 (E) 8 | */ 9 | module tango.stdc.stddef; 10 | 11 | extern (C): 12 | 13 | //alias typeof(int.sizeof) size_t; 14 | //alias typeof(cast(void*)0 - cast(void*)0) ptrdiff_t; 15 | 16 | version( Win32 ) 17 | { 18 | alias wchar wint_t; 19 | alias wchar wchar_t; 20 | alias wchar wctype_t; 21 | alias wchar wctrans_t; 22 | 23 | const wchar WEOF = 0xFFFF; 24 | } 25 | else 26 | { 27 | alias dchar wint_t; 28 | alias dchar wchar_t; 29 | alias dchar wctype_t; 30 | alias dchar wctrans_t; 31 | 32 | const dchar WEOF = 0xFFFF; 33 | } 34 | -------------------------------------------------------------------------------- /tango/stdc/wctype.d: -------------------------------------------------------------------------------- 1 | /** 2 | * D header file for C99. 3 | * 4 | * Copyright: Public Domain 5 | * License: Public Domain 6 | * Authors: Sean Kelly 7 | * Standards: ISO/IEC 9899:1999 (E) 8 | */ 9 | module tango.stdc.wctype; 10 | 11 | private import tango.stdc.stddef; 12 | 13 | extern (C): 14 | 15 | int iswalnum(wint_t wc); 16 | int iswalpha(wint_t wc); 17 | int iswblank(wint_t wc); 18 | int iswcntrl(wint_t wc); 19 | int iswdigit(wint_t wc); 20 | int iswgraph(wint_t wc); 21 | int iswlower(wint_t wc); 22 | int iswprint(wint_t wc); 23 | int iswpunct(wint_t wc); 24 | int iswspace(wint_t wc); 25 | int iswupper(wint_t wc); 26 | int iswxdigit(wint_t wc); 27 | 28 | int iswctype(wint_t wc, wctype_t desc); 29 | wctype_t wctype(in char* property); 30 | wint_t towlower(wint_t wc); 31 | wint_t towupper(wint_t wc); 32 | wint_t towctrans(wint_t wc, wctrans_t desc); 33 | wctrans_t wctrans(in char* property); 34 | -------------------------------------------------------------------------------- /tango/sys/consts/errno.d: -------------------------------------------------------------------------------- 1 | module tango.sys.consts.errno; 2 | 3 | version (Windows) 4 | public import tango.sys.win32.consts.errno; 5 | else 6 | version (linux) 7 | public import tango.sys.linux.consts.errno; 8 | else 9 | version (FreeBSD) 10 | public import tango.sys.freebsd.consts.errno; 11 | else 12 | version(OSX) 13 | public import tango.sys.darwin.consts.errno; 14 | else 15 | version (solaris) 16 | public import tango.sys.solaris.consts.errno; 17 | -------------------------------------------------------------------------------- /tango/sys/consts/fcntl.d: -------------------------------------------------------------------------------- 1 | module tango.sys.consts.fcntl; 2 | 3 | version (Windows) 4 | public import tango.sys.win32.consts.fcntl; 5 | else 6 | version (linux) 7 | public import tango.sys.linux.consts.fcntl; 8 | else 9 | version (FreeBSD) 10 | public import tango.sys.freebsd.consts.fcntl; 11 | else 12 | version(OSX) 13 | public import tango.sys.darwin.consts.fcntl; 14 | else 15 | version (solaris) 16 | public import tango.sys.solaris.consts.fcntl; 17 | -------------------------------------------------------------------------------- /tango/sys/consts/socket.d: -------------------------------------------------------------------------------- 1 | module tango.sys.consts.socket; 2 | 3 | version (Windows) 4 | public import tango.sys.win32.consts.socket; 5 | else 6 | version (linux) 7 | public import tango.sys.linux.consts.socket; 8 | else 9 | version (FreeBSD) 10 | public import tango.sys.freebsd.consts.socket; 11 | else 12 | version(OSX) 13 | public import tango.sys.darwin.consts.socket; 14 | else 15 | version (solaris) 16 | public import tango.sys.solaris.consts.socket; 17 | -------------------------------------------------------------------------------- /tango/sys/consts/sysctl.d: -------------------------------------------------------------------------------- 1 | module tango.sys.consts.sysctl; 2 | 3 | version (Windows) 4 | public import tango.sys.win32.consts.sysctl; 5 | else 6 | version (linux) 7 | public import tango.sys.linux.consts.sysctl; 8 | else 9 | version (FreeBSD) 10 | public import tango.sys.freebsd.consts.sysctl; 11 | else 12 | version(OSX) 13 | public import tango.sys.darwin.consts.sysctl; 14 | else 15 | version (solaris) 16 | public import tango.sys.solaris.consts.sysctl; 17 | 18 | -------------------------------------------------------------------------------- /tango/sys/consts/unistd.d: -------------------------------------------------------------------------------- 1 | module tango.sys.consts.unistd; 2 | 3 | version (Windows) 4 | public import tango.sys.win32.consts.unistd; 5 | else 6 | version (linux) 7 | public import tango.sys.linux.consts.unistd; 8 | else 9 | version (FreeBSD) 10 | public import tango.sys.freebsd.consts.unistd; 11 | else 12 | version(OSX) 13 | public import tango.sys.darwin.consts.unistd; 14 | else 15 | version (solaris) 16 | public import tango.sys.solaris.consts.unistd; 17 | 18 | -------------------------------------------------------------------------------- /tango/sys/darwin/consts/fcntl.d: -------------------------------------------------------------------------------- 1 | module tango.sys.darwin.consts.fcntl; 2 | enum { F_GETLK = 7 } 3 | enum { F_SETLK = 8 } 4 | enum { F_SETLKW = 9 } 5 | enum { F_DUPFD = 0 } 6 | enum { F_GETFD = 1 } 7 | enum { F_SETFD = 2 } 8 | enum { F_GETFL = 3 } 9 | enum { F_SETFL = 4 } 10 | enum { F_GETOWN = 5 } 11 | enum { F_SETOWN = 6 } 12 | enum { FD_CLOEXEC = 1 } 13 | enum { F_RDLCK = 1 } 14 | enum { F_UNLCK = 2 } 15 | enum { F_WRLCK = 3 } 16 | enum { O_CREAT = 0x0200 } 17 | enum { O_EXCL = 0x0800 } 18 | enum { O_NOCTTY = 0x20000 } 19 | enum { O_TRUNC = 0x0400 } 20 | enum { O_NOFOLLOW = 0x0100 } 21 | enum { O_APPEND = 0x0008 } 22 | enum { O_NONBLOCK = 0x0004 } 23 | enum { O_SYNC = 0x0080 } 24 | enum { O_ACCMODE = 0x0003 } 25 | enum { O_RDONLY = 0x0000 } 26 | enum { O_WRONLY = 0x0001 } 27 | enum { O_RDWR = 0x0002 } 28 | -------------------------------------------------------------------------------- /tango/sys/darwin/darwin.d: -------------------------------------------------------------------------------- 1 | module tango.sys.darwin.darwin; 2 | 3 | version(OSX) { 4 | public import tango.stdc.time; 5 | public import tango.stdc.posix.dlfcn; 6 | public import tango.stdc.posix.fcntl; 7 | public import tango.stdc.posix.poll; 8 | public import tango.stdc.posix.pwd; 9 | public import tango.stdc.posix.time; 10 | public import tango.stdc.posix.unistd; 11 | public import tango.stdc.posix.sys.select; 12 | public import tango.stdc.posix.sys.stat; 13 | public import tango.stdc.posix.sys.types; 14 | } 15 | -------------------------------------------------------------------------------- /tango/sys/freebsd/consts/fcntl.d: -------------------------------------------------------------------------------- 1 | module tango.sys.freebsd.consts.fcntl; 2 | enum { F_GETLK = 11 } 3 | enum { F_SETLK = 12 } 4 | enum { F_SETLKW = 13 } 5 | enum { F_DUPFD = 0 } 6 | enum { F_GETFD = 1 } 7 | enum { F_SETFD = 2 } 8 | enum { F_GETFL = 3 } 9 | enum { F_SETFL = 4 } 10 | enum { F_GETOWN = 5 } 11 | enum { F_SETOWN = 6 } 12 | enum { FD_CLOEXEC = 1 } 13 | enum { F_RDLCK = 1 } 14 | enum { F_UNLCK = 2 } 15 | enum { F_WRLCK = 3 } 16 | enum { O_CREAT = 0x0200 } 17 | enum { O_EXCL = 0x0800 } 18 | enum { O_NOCTTY = 0x8000 } 19 | enum { O_TRUNC = 0x0400 } 20 | enum { O_NOFOLLOW = 0x0100 } 21 | enum { O_APPEND = 0x0008 } 22 | enum { O_NONBLOCK = 0x0004 } 23 | enum { O_SYNC = 0x0080 } 24 | // O_DSYNC not defined 25 | // O_RSYNC not defined 26 | enum { O_ACCMODE = 0x0003 } 27 | enum { O_RDONLY = 0x0000 } 28 | enum { O_WRONLY = 0x0001 } 29 | enum { O_RDWR = 0x0002 } 30 | -------------------------------------------------------------------------------- /tango/sys/freebsd/consts/unistd.d: -------------------------------------------------------------------------------- 1 | module tango.sys.freebsd.consts.unistd; 2 | /+ http://opengroup.org/onlinepubs/007908799/xsh/unistd.h.html +/ 3 | enum { 4 | STDIN_FILENO = 0, 5 | STDOUT_FILENO = 1, 6 | STDERR_FILENO = 2, 7 | F_OK = 0, 8 | R_OK = 0x04, 9 | W_OK = 0x02, 10 | X_OK = 0x01, 11 | F_ULOCK = 0, 12 | F_LOCK = 1, 13 | F_TLOCK = 2, 14 | F_TEST = 3, 15 | } 16 | -------------------------------------------------------------------------------- /tango/sys/freebsd/freebsd.d: -------------------------------------------------------------------------------- 1 | module tango.sys.freebsd.freebsd; 2 | 3 | version (FreeBSD) { 4 | public import tango.stdc.time; 5 | public import tango.stdc.posix.dlfcn; 6 | public import tango.stdc.posix.fcntl; 7 | public import tango.stdc.posix.poll; 8 | public import tango.stdc.posix.pwd; 9 | public import tango.stdc.posix.time; 10 | public import tango.stdc.posix.unistd; 11 | public import tango.stdc.posix.sys.select; 12 | public import tango.stdc.posix.sys.stat; 13 | public import tango.stdc.posix.sys.types; 14 | } 15 | -------------------------------------------------------------------------------- /tango/sys/linux/consts/fcntl.d: -------------------------------------------------------------------------------- 1 | module tango.sys.linux.consts.fcntl; 2 | import tango.stdc.posix.config; 3 | private import tango.core.Octal; 4 | 5 | static if( __USE_LARGEFILE64 ) 6 | { 7 | enum { F_GETLK = 12 } 8 | enum { F_SETLK = 13 } 9 | enum { F_SETLKW = 14 } 10 | } 11 | else 12 | { 13 | enum { F_GETLK = 5 } 14 | enum { F_SETLK = 6 } 15 | enum { F_SETLKW = 7 } 16 | } 17 | enum { F_DUPFD = 0 } 18 | enum { F_GETFD = 1 } 19 | enum { F_SETFD = 2 } 20 | enum { F_GETFL = 3 } 21 | enum { F_SETFL = 4 } 22 | enum { F_GETOWN = 9 } 23 | enum { F_SETOWN = 8 } 24 | enum { FD_CLOEXEC = 1 } 25 | enum { F_RDLCK = 0 } 26 | enum { F_UNLCK = 2 } 27 | enum { F_WRLCK = 1 } 28 | enum { O_CREAT = octal!(100) } 29 | enum { O_EXCL = octal!(200) } 30 | enum { O_NOCTTY = octal!(400) } 31 | enum { O_TRUNC = octal!(1000) } 32 | enum { O_NOFOLLOW = octal!(400000) } 33 | enum { O_APPEND = octal!(2000) } 34 | enum { O_NONBLOCK = octal!(4000) } 35 | enum { O_SYNC = octal!(10000) } 36 | enum { O_DSYNC = octal!(10000) } // optional synchronized io 37 | enum { O_RSYNC = octal!(10000) } // optional synchronized io 38 | enum { O_ACCMODE = octal!(3) } 39 | enum { O_RDONLY = octal!(0) } 40 | enum { O_WRONLY = octal!(1) } 41 | enum { O_RDWR = octal!(2) } 42 | -------------------------------------------------------------------------------- /tango/sys/linux/consts/sysctl.d: -------------------------------------------------------------------------------- 1 | module tango.sys.linux.consts.sysctl; 2 | -------------------------------------------------------------------------------- /tango/sys/linux/linux.d: -------------------------------------------------------------------------------- 1 | module tango.sys.linux.linux; 2 | 3 | 4 | version (linux) { 5 | public import tango.stdc.time; 6 | public import tango.stdc.posix.dlfcn; 7 | public import tango.stdc.posix.fcntl; 8 | public import tango.stdc.posix.poll; 9 | public import tango.stdc.posix.pwd; 10 | public import tango.stdc.posix.time; 11 | public import tango.stdc.posix.unistd; 12 | public import tango.stdc.posix.sys.select; 13 | public import tango.stdc.posix.sys.stat; 14 | public import tango.stdc.posix.sys.types; 15 | public import tango.sys.linux.epoll; 16 | } 17 | -------------------------------------------------------------------------------- /tango/sys/solaris/consts/fcntl.d: -------------------------------------------------------------------------------- 1 | module tango.sys.solaris.consts.fcntl; 2 | 3 | import tango.stdc.posix.config; 4 | 5 | static if( __USE_LARGEFILE64 ) 6 | { 7 | enum { F_GETLK = 33 } 8 | enum { F_SETLK = 34 } 9 | enum { F_SETLKW = 35 } 10 | } 11 | else 12 | { 13 | enum { F_GETLK = 14 } 14 | enum { F_SETLK = 6 } 15 | enum { F_SETLKW = 7 } 16 | } 17 | enum { F_DUPFD = 0 } 18 | enum { F_GETFD = 1 } 19 | enum { F_SETFD = 2 } 20 | enum { F_GETFL = 3 } 21 | enum { F_SETFL = 4 } 22 | enum { F_GETOWN = 23 } 23 | enum { F_SETOWN = 24 } 24 | enum { FD_CLOEXEC = 1 } 25 | enum { F_RDLCK = 01 } 26 | enum { F_UNLCK = 03 } 27 | enum { F_WRLCK = 02 } 28 | enum { O_CREAT = 0x100 } 29 | enum { O_EXCL = 0x400 } 30 | enum { O_NOCTTY = 0x800 } 31 | enum { O_TRUNC = 0x200 } 32 | enum { O_NOFOLLOW = 0x20000 } 33 | enum { O_APPEND = 0x08 } 34 | enum { O_NONBLOCK = 0x80 } 35 | enum { O_SYNC = 0x10 } 36 | enum { O_DSYNC = 0x40 } // optional synchronized io 37 | enum { O_RSYNC = 0x8000 } // optional synchronized io 38 | enum { O_ACCMODE = 3 } 39 | enum { O_RDONLY = 0 } 40 | enum { O_WRONLY = 1 } 41 | enum { O_RDWR = 2 } 42 | -------------------------------------------------------------------------------- /tango/sys/solaris/consts/sysctl.d: -------------------------------------------------------------------------------- 1 | module tango.sys.solaris.consts.sysctl; 2 | -------------------------------------------------------------------------------- /tango/sys/solaris/consts/unistd.d: -------------------------------------------------------------------------------- 1 | module tango.sys.solaris.consts.unistd; 2 | /+ http://opengroup.org/onlinepubs/007908799/xsh/unistd.h.html +/ 3 | enum { 4 | STDIN_FILENO = 0, 5 | STDOUT_FILENO = 1, 6 | STDERR_FILENO = 2, 7 | F_OK = 0, 8 | R_OK = 4, 9 | W_OK = 2, 10 | X_OK = 1, 11 | F_ULOCK = 0, 12 | F_LOCK = 1 , 13 | F_TLOCK = 2, 14 | F_TEST = 3 , 15 | } 16 | -------------------------------------------------------------------------------- /tango/sys/solaris/solaris.d: -------------------------------------------------------------------------------- 1 | module tango.sys.solaris.solaris; 2 | 3 | 4 | version (solaris) { 5 | public import tango.stdc.time; 6 | public import tango.stdc.posix.dlfcn; 7 | public import tango.stdc.posix.fcntl; 8 | public import tango.stdc.posix.poll; 9 | public import tango.stdc.posix.pwd; 10 | public import tango.stdc.posix.time; 11 | public import tango.stdc.posix.unistd; 12 | public import tango.stdc.posix.sys.select; 13 | public import tango.stdc.posix.sys.stat; 14 | public import tango.stdc.posix.sys.types; 15 | } 16 | -------------------------------------------------------------------------------- /tango/sys/win32/IUnknown.d: -------------------------------------------------------------------------------- 1 | /** 2 | * This module contains a definition for the IUnknown interface, used with COM. 3 | * 4 | * Copyright: Copyright (C) 2005-2006 Digital Mars, www.digitalmars.com. 5 | * All rights reserved. 6 | * License: BSD style: $(LICENSE) 7 | * Authors: Walter Bright, Sean Kelly 8 | */ 9 | module tango.sys.win32.IUnknown; 10 | 11 | 12 | private 13 | { 14 | import tango.sys.win32.Types; 15 | extern (C) extern IID IID_IUnknown; 16 | } 17 | 18 | 19 | interface IUnknown 20 | { 21 | HRESULT QueryInterface( REFIID iid, out IUnknown obj ); 22 | ULONG AddRef(); 23 | ULONG Release(); 24 | } 25 | 26 | 27 | /** 28 | * This implementation may be mixed into COM classes to avoid code duplication. 29 | */ 30 | template IUnknownImpl() 31 | { 32 | HRESULT QueryInterface( REFIID iid, out IUnknown obj ) 33 | { 34 | if ( iid == &IID_IUnknown ) 35 | { 36 | AddRef(); 37 | obj = this; 38 | return S_OK; 39 | } 40 | else 41 | { 42 | obj = null; 43 | return E_NOINTERFACE; 44 | } 45 | } 46 | 47 | ULONG AddRef() 48 | { 49 | return ++m_count; 50 | } 51 | 52 | ULONG Release() 53 | { 54 | if( --m_count == 0 ) 55 | { 56 | // free object 57 | return 0; 58 | } 59 | return m_count; 60 | } 61 | 62 | private: 63 | ULONG m_count = 1; 64 | } 65 | -------------------------------------------------------------------------------- /tango/sys/win32/WsaSock.d: -------------------------------------------------------------------------------- 1 | module tango.sys.win32.WsaSock; 2 | 3 | public import tango.sys.Common; 4 | 5 | struct Guid 6 | { 7 | uint g1; 8 | ushort g2, 9 | g3; 10 | ubyte[8] g4; 11 | } 12 | 13 | enum 14 | { 15 | WSADESCRIPTION_LEN = 256, 16 | WSASYS_STATUS_LEN = 128, 17 | WSAEWOULDBLOCK = 10035, 18 | WSAEINTR = 10004, 19 | } 20 | 21 | struct WSABUF 22 | { 23 | uint len; 24 | void* buf; 25 | } 26 | 27 | struct WSADATA 28 | { 29 | WORD wVersion; 30 | WORD wHighVersion; 31 | char[WSADESCRIPTION_LEN+1] szDescription; 32 | char[WSASYS_STATUS_LEN+1] szSystemStatus; 33 | ushort iMaxSockets; 34 | ushort iMaxUdpDg; 35 | char* lpVendorInfo; 36 | } 37 | 38 | enum 39 | { 40 | SIO_GET_EXTENSION_FUNCTION_POINTER = 0x40000000 | 0x80000000 | 0x08000000 | 6, 41 | SO_UPDATE_CONNECT_CONTEXT = 0x7010, 42 | SO_UPDATE_ACCEPT_CONTEXT = 0x700B 43 | } 44 | 45 | extern (Windows) 46 | { 47 | int WSACleanup(); 48 | int WSAGetLastError (); 49 | int WSAStartup(WORD wVersionRequested, WSADATA* lpWSAData); 50 | int WSAGetOverlappedResult (HANDLE, OVERLAPPED*, DWORD*, BOOL, DWORD*); 51 | int WSAIoctl (HANDLE s, DWORD op, LPVOID inBuf, DWORD cbIn, LPVOID outBuf, DWORD cbOut, DWORD* result, LPOVERLAPPED, void*); 52 | int WSARecv (HANDLE, WSABUF*, DWORD, DWORD*, DWORD*, OVERLAPPED*, void*); 53 | int WSASend (HANDLE, WSABUF*, DWORD, DWORD*, DWORD, OVERLAPPED*, void*); 54 | } 55 | 56 | -------------------------------------------------------------------------------- /tango/sys/win32/consts/fcntl.d: -------------------------------------------------------------------------------- 1 | module tango.sys.win32.consts.fcntl; 2 | -------------------------------------------------------------------------------- /tango/sys/win32/consts/sysctl.d: -------------------------------------------------------------------------------- 1 | module tango.sys.win32.consts.sysctl; 2 | -------------------------------------------------------------------------------- /tango/sys/win32/consts/unistd.d: -------------------------------------------------------------------------------- 1 | module tango.sys.win32.consts.unistd; 2 | -------------------------------------------------------------------------------- /tango/text/convert/Format.d: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | copyright: Copyright (c) 2007 Kris Bell. All rights reserved 4 | 5 | license: BSD style: $(LICENSE) 6 | 7 | version: Sep 2007: Initial release 8 | version: Nov 2007: Added stream wrappers 9 | 10 | author: Kris 11 | 12 | *******************************************************************************/ 13 | 14 | module tango.text.convert.Format; 15 | 16 | private import tango.text.convert.Layout; 17 | 18 | /****************************************************************************** 19 | 20 | Constructs a global utf8 instance of Layout 21 | 22 | ******************************************************************************/ 23 | 24 | public __gshared Layout!(char) Format; 25 | 26 | shared static this() 27 | { 28 | Format = Layout!(char).instance; 29 | } 30 | 31 | -------------------------------------------------------------------------------- /tango/time/chrono/Japanese.d: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | copyright: Copyright (c) 2005 John Chapman. All rights reserved 4 | 5 | license: BSD style: $(LICENSE) 6 | 7 | version: Mid 2005: Initial release 8 | Apr 2007: reshaped 9 | 10 | author: John Chapman, Kris 11 | 12 | ******************************************************************************/ 13 | 14 | module tango.time.chrono.Japanese; 15 | 16 | private import tango.time.chrono.GregorianBased; 17 | 18 | 19 | /** 20 | * $(ANCHOR _Japanese) 21 | * Represents the Japanese calendar. 22 | */ 23 | public class Japanese : GregorianBased 24 | { 25 | /** 26 | * $(I Property.) Overridden. Retrieves the identifier associated with the current calendar. 27 | * Returns: An integer representing the identifier of the current calendar. 28 | */ 29 | public override const uint id() { 30 | return JAPAN; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /tango/time/chrono/Korean.d: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | copyright: Copyright (c) 2005 John Chapman. All rights reserved 4 | 5 | license: BSD style: $(LICENSE) 6 | 7 | version: Mid 2005: Initial release 8 | Apr 2007: reshaped 9 | 10 | author: John Chapman, Kris 11 | 12 | ******************************************************************************/ 13 | 14 | module tango.time.chrono.Korean; 15 | 16 | private import tango.time.chrono.GregorianBased; 17 | 18 | 19 | /** 20 | * $(ANCHOR _Korean) 21 | * Represents the Korean calendar. 22 | */ 23 | public class Korean : GregorianBased { 24 | /** 25 | * $(I Property.) Overridden. Retrieves the identifier associated with the current calendar. 26 | * Returns: An integer representing the identifier of the current calendar. 27 | */ 28 | public override const uint id() { 29 | return KOREA; 30 | } 31 | 32 | } 33 | 34 | 35 | -------------------------------------------------------------------------------- /tango/time/chrono/Taiwan.d: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | copyright: Copyright (c) 2005 John Chapman. All rights reserved 4 | 5 | license: BSD style: $(LICENSE) 6 | 7 | version: Mid 2005: Initial release 8 | Apr 2007: reshaped 9 | 10 | author: John Chapman, Kris 11 | 12 | ******************************************************************************/ 13 | 14 | module tango.time.chrono.Taiwan; 15 | 16 | private import tango.time.chrono.GregorianBased; 17 | 18 | /** 19 | * $(ANCHOR _Taiwan) 20 | * Represents the Taiwan calendar. 21 | */ 22 | public class Taiwan : GregorianBased 23 | { 24 | /** 25 | * $(I Property.) Overridden. Retrieves the identifier associated with the current calendar. 26 | * Returns: An integer representing the identifier of the current calendar. 27 | */ 28 | public override const uint id() { 29 | return TAIWAN; 30 | } 31 | 32 | } 33 | 34 | -------------------------------------------------------------------------------- /tango/time/chrono/ThaiBuddhist.d: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | copyright: Copyright (c) 2005 John Chapman. All rights reserved 4 | 5 | license: BSD style: $(LICENSE) 6 | 7 | version: Mid 2005: Initial release 8 | Apr 2007: reshaped 9 | 10 | author: John Chapman, Kris 11 | 12 | ******************************************************************************/ 13 | 14 | module tango.time.chrono.ThaiBuddhist; 15 | 16 | private import tango.time.chrono.GregorianBased; 17 | 18 | 19 | /** 20 | * $(ANCHOR _ThaiBuddhist) 21 | * Represents the Thai Buddhist calendar. 22 | */ 23 | public class ThaiBuddhist : GregorianBased { 24 | /** 25 | * $(I Property.) Overridden. Retrieves the identifier associated with the current calendar. 26 | * Returns: An integer representing the identifier of the current calendar. 27 | */ 28 | public override const uint id() { 29 | return THAI; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /tango/util/MinMax.d: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | copyright: Copyright (c) 2010 Kris. All rights reserved. 4 | 5 | license: BSD style: $(LICENSE) 6 | 7 | version: Jan 2010: Initial release 8 | 9 | author: Kris 10 | 11 | *******************************************************************************/ 12 | 13 | module tango.util.MinMax; 14 | 15 | /******************************************************************************* 16 | 17 | Return the minimum of two arguments (of the same type) 18 | 19 | *******************************************************************************/ 20 | 21 | T min(T)(T a, T b) 22 | { 23 | return a < b ? a : b; 24 | } 25 | 26 | /******************************************************************************* 27 | 28 | Return the maximum of two arguments (of the same type) 29 | 30 | *******************************************************************************/ 31 | 32 | T max(T)(T a, T b) 33 | { 34 | return a > b ? a : b; 35 | } 36 | 37 | 38 | -------------------------------------------------------------------------------- /tango/util/log/AppendConsole.d: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | copyright: Copyright (c) 2004 Kris Bell. All rights reserved 4 | 5 | license: BSD style: $(LICENSE) 6 | 7 | version: Initial release: May 2004 8 | 9 | author: Kris 10 | 11 | *******************************************************************************/ 12 | 13 | module tango.util.log.AppendConsole; 14 | 15 | private import tango.io.Console; 16 | 17 | private import tango.util.log.Log; 18 | 19 | /******************************************************************************* 20 | 21 | Appender for sending formatted output to the console 22 | 23 | *******************************************************************************/ 24 | 25 | public class AppendConsole : AppendStream 26 | { 27 | /*********************************************************************** 28 | 29 | Create with the given layout 30 | 31 | ***********************************************************************/ 32 | 33 | this (Appender.Layout how = null) 34 | { 35 | super (Cerr.stream, true, how); 36 | } 37 | 38 | /*********************************************************************** 39 | 40 | Return the name of this class 41 | 42 | ***********************************************************************/ 43 | 44 | override const const(char[]) name () 45 | { 46 | return this.classinfo.name; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /tango/util/log/Config.d: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | copyright: Copyright (c) 2004 Kris Bell. All rights reserved 4 | 5 | license: BSD style: $(LICENSE) 6 | 7 | version: Initial release: May 2004 8 | 9 | author: Kris 10 | 11 | *******************************************************************************/ 12 | 13 | module tango.util.log.Config; 14 | 15 | public import tango.util.log.Log : Log; 16 | 17 | private import tango.util.log.LayoutDate, 18 | tango.util.log.AppendConsole; 19 | 20 | /******************************************************************************* 21 | 22 | Utility for initializing the basic behaviour of the default 23 | logging hierarchy. 24 | 25 | Adds a default console appender with a generic layout to the 26 | root node, and set the activity level to be everything enabled 27 | 28 | *******************************************************************************/ 29 | 30 | shared static this () 31 | { 32 | Log.root.add (new AppendConsole (new LayoutDate)); 33 | } 34 | 35 | -------------------------------------------------------------------------------- /tango/util/uuid/NamespaceGenV3.d: -------------------------------------------------------------------------------- 1 | /** Generate a UUID according to version 3 of RFC 4122. 2 | * 3 | * These UUIDs are generated in a consistent, repeatable fashion. If you 4 | * generate a version 3 UUID once, it will be the same as the next time you 5 | * generate it. 6 | * 7 | * To create a version 3 UUID, you need a namespace UUID, generated in some 8 | * reasonable fashion. This is hashed with a name that you provide to generate 9 | * the UUID. So while you can easily map names to UUIDs, the reverse mapping 10 | * will require a lookup of some sort. 11 | * 12 | * This module publicly imports Uuid, so you don't have to import both if you 13 | * are generating version 3 UUIDs. Also, this module is just provided for 14 | * convenience -- you can use the method Uuid.byName if you already have an 15 | * appropriate digest. 16 | * 17 | * Version 3 UUIDs use MD5 as the hash function. You may prefer to use version 18 | * 5 UUIDs instead, which use SHA-1. 19 | * 20 | * To use this module: 21 | * --- 22 | * import tango.util.uuid.NamespaceGenV3; 23 | * auto dnsNamespace = Uuid.parse("6ba7b810-9dad-11d1-80b4-00c04fd430c8"); 24 | * auto uuid = newUuid(namespace, "rainbow.flotilla.example.org"); 25 | * --- 26 | */ 27 | module tango.util.uuid.NamespaceGenV3; 28 | 29 | public import tango.util.uuid.Uuid; 30 | import tango.util.digest.Md5; 31 | 32 | /** Generates a UUID as described above. */ 33 | Uuid newUuid(Uuid namespace, char[] name) 34 | { 35 | return Uuid.byName(namespace, name, new Md5, cast(ubyte)3); 36 | } 37 | -------------------------------------------------------------------------------- /tango/util/uuid/NamespaceGenV5.d: -------------------------------------------------------------------------------- 1 | /** Generate a UUID according to version 5 of RFC 4122. 2 | * 3 | * These UUIDs are generated in a consistent, repeatable fashion. If you 4 | * generate a version 5 UUID once, it will be the same as the next time you 5 | * generate it. 6 | * 7 | * To create a version 5 UUID, you need a namespace UUID, generated in some 8 | * reasonable fashion. This is hashed with a name that you provide to generate 9 | * the UUID. So while you can easily map names to UUIDs, the reverse mapping 10 | * will require a lookup of some sort. 11 | * 12 | * This module publicly imports Uuid, so you don't have to import both if you 13 | * are generating version 5 UUIDs. Also, this module is just provided for 14 | * convenience -- you can use the method Uuid.byName if you already have an 15 | * appropriate digest. 16 | * 17 | * Version 5 UUIDs use SHA-1 as the hash function. You may prefer to use 18 | * version 3 UUIDs instead, which use MD5, if you require compatibility with 19 | * another application. 20 | * 21 | * To use this module: 22 | * --- 23 | * import tango.util.uuid.NamespaceGenV5; 24 | * auto dnsNamespace = Uuid.parse("6ba7b810-9dad-11d1-80b4-00c04fd430c8"); 25 | * auto uuid = newUuid(namespace, "rainbow.flotilla.example.org"); 26 | * --- 27 | */ 28 | module tango.util.uuid.NamespaceGenV5; 29 | 30 | public import tango.util.uuid.Uuid; 31 | import tango.util.digest.Sha1; 32 | 33 | /** Generates a UUID as described above. */ 34 | Uuid newUuid(Uuid namespace, char[] name) 35 | { 36 | return Uuid.byName(namespace, name, new Sha1, cast(ubyte)5); 37 | } 38 | -------------------------------------------------------------------------------- /tango/util/uuid/RandomGen.d: -------------------------------------------------------------------------------- 1 | /** Most people who want UUIDs will generate small numbers of them (maybe a 2 | * few hundred thousand) and not require a huge amount of uniqueness (just 3 | * for this one application). This module provides a convenient way to obtain 4 | * that behavior. 5 | * 6 | * To streamline your usage, this module publicly imports Uuid, so you can 7 | * import this module alone. 8 | * 9 | * To use this module, just: 10 | * --- 11 | * import tango.util.uuid.RandomGen; 12 | * 13 | * Uuid id = randUuid.next; 14 | * --- 15 | */ 16 | module tango.util.uuid.RandomGen; 17 | 18 | public import tango.util.uuid.Uuid; 19 | import tango.math.random.Twister; 20 | 21 | /** The default random UUID generator. You can set this if you need to generate 22 | * UUIDs in another manner and already have code pointing to this module. 23 | * 24 | * This uses a unique PRNG instance. If you want repeatable results, you 25 | * should inject your own UUID generator and reseed it as necessary: 26 | * --- 27 | * auto rand = getRand(); 28 | * randUuid = new RandomGen!(typeof(rand))(rand); 29 | * doStuff(); 30 | * rand.reseed(); 31 | * --- 32 | * 33 | * The default PRNG is the Mersenne twister. If you need speed, KISS is about 34 | * 30 times faster. I chose the Mersenne twister because it's reasonably fast 35 | * (I can generate 150,000 per second on my machine) and has a long period. 36 | * The KISS generator can produce 5 million per second on my machine. 37 | */ 38 | UuidGen randUuid; 39 | 40 | shared static this () 41 | { 42 | Twister rand; 43 | rand.seed(); 44 | randUuid = new RandomGen!(Twister)(rand); 45 | } 46 | 47 | -------------------------------------------------------------------------------- /unported/build/bin/freebsd32/bob: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/build/bin/freebsd32/bob -------------------------------------------------------------------------------- /unported/build/bin/freebsd64/bob: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/build/bin/freebsd64/bob -------------------------------------------------------------------------------- /unported/build/bin/osx32/bob: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/build/bin/osx32/bob -------------------------------------------------------------------------------- /unported/build/bin/win32/jake.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/build/bin/win32/jake.exe -------------------------------------------------------------------------------- /unported/build/script/fetch-dmd.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # read config info 4 | VERSION=`cat dmd.version.txt` 5 | OS=`cat dmd.osname.txt` 6 | 7 | # enter downloads folder 8 | if [ ! -e downloads ] 9 | then 10 | mkdir downloads 11 | fi 12 | 13 | pushd downloads 14 | 15 | # clear and download DMD 16 | rm -rf dmd 17 | if [ ! -e dmd.$VERSION.zip ] 18 | then 19 | curl http://ftp.digitalmars.com/dmd.$VERSION.zip -o dmd.$VERSION.zip 20 | fi 21 | unzip dmd.$VERSION.zip 22 | 23 | # copy files 24 | cp dmd/$OS/bin/dmd ../tango-bundle/bin/ 25 | cp dmd/$OS/bin/dumpobj ../tango-bundle/bin/ 26 | cp dmd/$OS/bin/obj2asm ../tango-bundle/bin/ 27 | cp dmd/$OS/bin/rdmd ../tango-bundle/bin/ 28 | cp dmd/$OS/bin/README.TXT ../tango-bundle/bin/ 29 | 30 | chmod +x ../tango-bundle/bin/dmd 31 | chmod +x ../tango-bundle/bin/dumpobj 32 | chmod +x ../tango-bundle/bin/obj2asm 33 | chmod +x ../tango-bundle/bin/rdmd 34 | 35 | popd 36 | -------------------------------------------------------------------------------- /unported/doc/bin/dcode.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/bin/dcode.exe -------------------------------------------------------------------------------- /unported/doc/bin/filebubbler.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/bin/filebubbler.exe -------------------------------------------------------------------------------- /unported/doc/bin/keywords1.txt: -------------------------------------------------------------------------------- 1 | while 2 | switch 3 | if 4 | foreach 5 | for 6 | goto 7 | return 8 | else 9 | do 10 | case 11 | continue 12 | break 13 | -------------------------------------------------------------------------------- /unported/doc/bin/keywords2.txt: -------------------------------------------------------------------------------- 1 | scope 2 | union 3 | typeof 4 | typeid 5 | typedef 6 | try 7 | true 8 | throw 9 | this 10 | super 11 | pragma 12 | out 13 | null 14 | new 15 | module 16 | mixin 17 | is 18 | invariant 19 | interface 20 | inout 21 | in 22 | import 23 | function 24 | finally 25 | false 26 | extern 27 | delete 28 | delegate 29 | default 30 | catch 31 | cast 32 | body 33 | assert 34 | asm 35 | alias 36 | -------------------------------------------------------------------------------- /unported/doc/bin/keywords3.txt: -------------------------------------------------------------------------------- 1 | TypeInfo 2 | SwitchError 3 | OutOfMemoryException 4 | Object 5 | ModuleInfo 6 | Interface 7 | Error 8 | ClassInfo 9 | ArrayBoundsError 10 | AssertError 11 | _d_throw 12 | _d_switch_ustring 13 | _d_switch_string 14 | _d_switch_dstring 15 | _d_OutOfMemory 16 | _d_obj_eq 17 | _d_obj_cmp 18 | _d_newclass 19 | _d_newbitarray 20 | _d_newarrayi 21 | _d_new 22 | _d_monitorrelease 23 | _d_monitor_prolog 24 | _d_monitor_handler 25 | _d_monitorexit 26 | _d_monitor_epilog 27 | _d_monitorenter 28 | _d_local_unwind 29 | _d_isbaseof2 30 | _d_isbaseof 31 | _d_invariant 32 | _d_interface_vtbl 33 | _d_interface_cast 34 | _d_framehandler 35 | _d_exception_filter 36 | _d_exception 37 | _d_dynamic_cast 38 | _d_delmemory 39 | _d_delinterface 40 | _d_delclass 41 | _d_delarray 42 | _d_criticalexit 43 | _d_criticalenter 44 | _d_create_exception_object 45 | _d_callfinalizer 46 | _d_arraysetlengthb 47 | _d_arraysetlength 48 | _d_arraysetbit2 49 | _d_arraysetbit 50 | _d_arraycopybit 51 | _d_arraycopy 52 | _d_arraycatn 53 | _d_arraycatb 54 | _d_arraycat 55 | _d_arraycast_frombit 56 | _d_arraycast 57 | _d_arrayappendcb 58 | _d_arrayappendc 59 | _d_arrayappendb 60 | _d_arrayappend 61 | -------------------------------------------------------------------------------- /unported/doc/bin/keywords4.txt: -------------------------------------------------------------------------------- 1 | wchar 2 | volatile 3 | void 4 | version 5 | ushort 6 | unittest 7 | ulong 8 | uint 9 | ucent 10 | ubyte 11 | template 12 | struct 13 | static 14 | synchronized 15 | size_t 16 | short 17 | real 18 | public 19 | protected 20 | private 21 | ptrdiff_t 22 | package 23 | override 24 | long 25 | int 26 | ireal 27 | ifloat 28 | idouble 29 | float 30 | final 31 | export 32 | enum 33 | double 34 | deprecated 35 | debug 36 | dchar 37 | creal 38 | const 39 | class 40 | char 41 | cfloat 42 | cent 43 | cdouble 44 | byte 45 | bool 46 | bit 47 | auto 48 | align 49 | abstract 50 | -------------------------------------------------------------------------------- /unported/doc/bin/style-old.css: -------------------------------------------------------------------------------- 1 | #dcode, #dcode pre { 2 | font-family: "lucida console", monospace, courier; 3 | font-size: 11px; 4 | background-color: #f1f0ef; 5 | border: none; 6 | padding: 0px; 7 | margin: 0px; 8 | width: 100%; 9 | height: 100%; 10 | color: #222; 11 | border-collapse: collapse; 12 | } 13 | 14 | #dcode #lnum { 15 | padding-left: 5px; 16 | padding-right: 5px; 17 | border-right: dotted grey 1px; 18 | text-align: right; 19 | } 20 | 21 | 22 | #dcode #code pre { 23 | padding-left: 10px; 24 | } 25 | 26 | #dcode span.nbr { 27 | color: #cc66cc; 28 | } 29 | 30 | #dcode span.str { 31 | color: #266; 32 | } 33 | 34 | #dcode span.com { 35 | color: #808080; 36 | } 37 | 38 | #dcode span.kw1 { 39 | color: #177; 40 | } 41 | 42 | #dcode span.kw2 { 43 | color: #000; 44 | font-weight: bold; 45 | } 46 | 47 | #dcode span.kw3 { 48 | color: #137; 49 | font-weight: bold; 50 | } 51 | 52 | #dcode span.kw4 { 53 | color: #137; 54 | } 55 | 56 | #dcode span.opr { 57 | color: #203090; 58 | } 59 | 60 | -------------------------------------------------------------------------------- /unported/doc/bin/style.css: -------------------------------------------------------------------------------- 1 | #dcode, #dcode pre { 2 | font-family: "lucida console", monospace, courier; 3 | font-size: 11px; 4 | background-color: #fafbfa; 5 | border: none; 6 | padding: 0px; 7 | margin: 0px; 8 | width: 100%; 9 | height: 100%; 10 | color: #222; 11 | border-collapse: collapse; 12 | } 13 | 14 | #dcode #lnum { 15 | padding-left: 5px; 16 | padding-right: 5px; 17 | border-right: dotted grey 1px; 18 | text-align: right; 19 | vertical-align: top; 20 | width: 1px; /* uhm... it will make the row thin, but not really 1px */ 21 | } 22 | 23 | 24 | #dcode #code pre { 25 | padding-left: 10px; 26 | } 27 | 28 | #dcode span.nbr { 29 | color: #000080; 30 | } 31 | 32 | #dcode span.str { 33 | color: #9090ff; 34 | } 35 | 36 | #dcode span.com { 37 | color: #000080; 38 | } 39 | 40 | #dcode span.kw1 { 41 | color: #0000ff; 42 | } 43 | 44 | #dcode span.kw2 { 45 | color: #800000; 46 | } 47 | 48 | #dcode span.kw3 { 49 | color: #800000; 50 | } 51 | 52 | #dcode span.kw4 { 53 | color: #0000ff; 54 | } 55 | 56 | #dcode span.opr { 57 | color: #a0a0a0; 58 | } 59 | 60 | -------------------------------------------------------------------------------- /unported/doc/bin/template.post: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /unported/doc/bin/template.pre: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | %file% 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /unported/doc/dil/data/kandil/img/icon_alias.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/dil/data/kandil/img/icon_alias.png -------------------------------------------------------------------------------- /unported/doc/dil/data/kandil/img/icon_alias.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 15 | 17 | 21 | 22 | 23 | a 33 | 42 | 43 | -------------------------------------------------------------------------------- /unported/doc/dil/data/kandil/img/icon_class.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/dil/data/kandil/img/icon_class.png -------------------------------------------------------------------------------- /unported/doc/dil/data/kandil/img/icon_class.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 15 | 17 | 21 | 22 | 23 | C 33 | 42 | 43 | -------------------------------------------------------------------------------- /unported/doc/dil/data/kandil/img/icon_enum.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/dil/data/kandil/img/icon_enum.png -------------------------------------------------------------------------------- /unported/doc/dil/data/kandil/img/icon_enum.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 15 | 17 | 21 | 22 | 23 | E 33 | 42 | 43 | -------------------------------------------------------------------------------- /unported/doc/dil/data/kandil/img/icon_enummem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/dil/data/kandil/img/icon_enummem.png -------------------------------------------------------------------------------- /unported/doc/dil/data/kandil/img/icon_function.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/dil/data/kandil/img/icon_function.png -------------------------------------------------------------------------------- /unported/doc/dil/data/kandil/img/icon_funnel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/dil/data/kandil/img/icon_funnel.png -------------------------------------------------------------------------------- /unported/doc/dil/data/kandil/img/icon_interface.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/dil/data/kandil/img/icon_interface.png -------------------------------------------------------------------------------- /unported/doc/dil/data/kandil/img/icon_interface.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 15 | 17 | 21 | 22 | 23 | I 33 | 42 | 43 | -------------------------------------------------------------------------------- /unported/doc/dil/data/kandil/img/icon_magnifier.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/dil/data/kandil/img/icon_magnifier.png -------------------------------------------------------------------------------- /unported/doc/dil/data/kandil/img/icon_module.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/dil/data/kandil/img/icon_module.png -------------------------------------------------------------------------------- /unported/doc/dil/data/kandil/img/icon_module_alt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/dil/data/kandil/img/icon_module_alt.png -------------------------------------------------------------------------------- /unported/doc/dil/data/kandil/img/icon_package.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/dil/data/kandil/img/icon_package.png -------------------------------------------------------------------------------- /unported/doc/dil/data/kandil/img/icon_package_alt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/dil/data/kandil/img/icon_package_alt.png -------------------------------------------------------------------------------- /unported/doc/dil/data/kandil/img/icon_struct.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/dil/data/kandil/img/icon_struct.png -------------------------------------------------------------------------------- /unported/doc/dil/data/kandil/img/icon_struct.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 15 | 17 | 21 | 22 | 23 | S 33 | 42 | 43 | -------------------------------------------------------------------------------- /unported/doc/dil/data/kandil/img/icon_template.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/dil/data/kandil/img/icon_template.png -------------------------------------------------------------------------------- /unported/doc/dil/data/kandil/img/icon_template.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 15 | 17 | 21 | 22 | 23 | T 33 | 42 | 43 | -------------------------------------------------------------------------------- /unported/doc/dil/data/kandil/img/icon_tv_dot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/dil/data/kandil/img/icon_tv_dot.png -------------------------------------------------------------------------------- /unported/doc/dil/data/kandil/img/icon_tv_dot.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 13 | 21 | 26 | 27 | -------------------------------------------------------------------------------- /unported/doc/dil/data/kandil/img/icon_tv_minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/dil/data/kandil/img/icon_tv_minus.png -------------------------------------------------------------------------------- /unported/doc/dil/data/kandil/img/icon_tv_minus.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 13 | 21 | 25 | 26 | -------------------------------------------------------------------------------- /unported/doc/dil/data/kandil/img/icon_tv_plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/dil/data/kandil/img/icon_tv_plus.png -------------------------------------------------------------------------------- /unported/doc/dil/data/kandil/img/icon_tv_plus.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 13 | 21 | 25 | 29 | 30 | -------------------------------------------------------------------------------- /unported/doc/dil/data/kandil/img/icon_typedef.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/dil/data/kandil/img/icon_typedef.png -------------------------------------------------------------------------------- /unported/doc/dil/data/kandil/img/icon_typedef.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 15 | 17 | 21 | 22 | 23 | t 33 | 42 | 43 | -------------------------------------------------------------------------------- /unported/doc/dil/data/kandil/img/icon_union.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/dil/data/kandil/img/icon_union.png -------------------------------------------------------------------------------- /unported/doc/dil/data/kandil/img/icon_union.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 15 | 17 | 21 | 22 | 23 | U 33 | 42 | 43 | -------------------------------------------------------------------------------- /unported/doc/dil/data/kandil/img/icon_variable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/dil/data/kandil/img/icon_variable.png -------------------------------------------------------------------------------- /unported/doc/dil/data/kandil/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/dil/data/kandil/img/loading.gif -------------------------------------------------------------------------------- /unported/doc/dil/data/macros_dil.ddoc: -------------------------------------------------------------------------------- 1 | COPYRIGHT = Copyright © 2007-$(YEAR), Aziz Köksal. All rights reserved. 2 | DIL_SYMBOL_ = $1 3 | Maturity =

Maturity: $1.

4 | BNF =
$0
-------------------------------------------------------------------------------- /unported/doc/example/dsss.conf: -------------------------------------------------------------------------------- 1 | [concurrency/fiber_test.d] 2 | buildflags += -unittest 3 | [concurrency/ThreadFiberGCStress.d] 4 | 5 | [conduits/composite.d] 6 | [conduits/createzip.d] 7 | version (Windows) { 8 | buildflags += -L"zlib;libbz2" 9 | } 10 | version (Posix) { 11 | buildflags += -L-lz 12 | } 13 | [conduits/filebubbler.d] 14 | [conduits/filecat.d] 15 | [conduits/filecopy.d] 16 | [conduits/fileops.d] 17 | [conduits/filepathname.d] 18 | [conduits/filescan.d] 19 | [conduits/filescanregex.d] 20 | [conduits/lineio.d] 21 | [conduits/mmap.d] 22 | [conduits/paths.d] 23 | [conduits/pathchildren.d] 24 | [conduits/randomio.d] 25 | [conduits/shuffle.d] 26 | [conduits/unifile.d] 27 | 28 | [console/hello.d] 29 | [console/stdout.d] 30 | 31 | [logging/chainsaw.d] 32 | [logging/logging.d] 33 | [logging/multilog.d] 34 | 35 | #[manual/chapterStorage.d] 36 | 37 | [networking/homepage.d] 38 | [networking/httpget.d] 39 | [networking/selector.d] 40 | [networking/sockethello.d] 41 | [networking/socketserver.d] 42 | 43 | #[system/arguments.d] 44 | [system/localtime.d] 45 | [system/normpath.d] 46 | [system/process.d] 47 | 48 | [text/formatalign.d] 49 | [text/formatindex.d] 50 | [text/formatspec.d] 51 | [text/localetime.d] 52 | [text/token.d] 53 | [text/xmldom.d] 54 | [text/xmlpull.d] 55 | [text/xmlsax.d] 56 | [text/xmlpath.d] 57 | 58 | [vfs/vfscan.d] 59 | [vfs/vfscanregex.d] 60 | [vfs/vfshuffle.d] 61 | [vfs/vfszip.d] 62 | version (Windows) { 63 | buildflags += -L"zlib;libbz2" 64 | } 65 | version (Posix) { 66 | buildflags += -L-lz 67 | } 68 | 69 | [xml/loadparse.d] 70 | [xml/iterate.d] 71 | [xml/attrquery.d] 72 | [xml/filterquery.d] 73 | -------------------------------------------------------------------------------- /unported/doc/example/external/GlueFlectioned.d: -------------------------------------------------------------------------------- 1 | import tango.core.Exception; 2 | import cn.kuehne.flectioned; 3 | 4 | 5 | TracedExceptionInfo traceHandler( void* ptr = null ) 6 | { 7 | class FlectionedTrace : 8 | TracedExceptionInfo 9 | { 10 | this( void* ptr = null ) 11 | { 12 | if( ptr ) 13 | m_trace = Trace.getTrace( cast(size_t) ptr ); 14 | else 15 | m_trace = Trace.getTrace(); 16 | } 17 | 18 | int opApply( int delegate( ref char[] ) dg ) 19 | { 20 | int ret = 0; 21 | foreach( t; m_trace ) 22 | { 23 | char[] buf = t.toString; 24 | ret = dg( buf ); 25 | if( ret != 0 ) 26 | break; 27 | } 28 | return ret; 29 | } 30 | 31 | private: 32 | Trace[] m_trace; 33 | } 34 | 35 | return new FlectionedTrace( ptr ); 36 | } 37 | 38 | 39 | static this() 40 | { 41 | setTraceHandler( &traceHandler ); 42 | } 43 | -------------------------------------------------------------------------------- /unported/doc/html/candydoc/decant.css: -------------------------------------------------------------------------------- 1 | #dcode, #dcode pre { 2 | font-family: "lucida console", monospace, courier; 3 | font-size: 11px; 4 | background-color: #fafbfa; 5 | border: none; 6 | padding: 0px; 7 | margin: 0px; 8 | width: 100%; 9 | height: 100%; 10 | color: #222; 11 | border-collapse: collapse; 12 | } 13 | 14 | #dcode #lnum { 15 | padding-left: 5px; 16 | padding-right: 5px; 17 | border-right: dotted grey 1px; 18 | text-align: right; 19 | vertical-align: top; 20 | width: 1px; /* uhm... it will make the row thin, but not really 1px */ 21 | } 22 | 23 | 24 | #dcode #code pre { 25 | padding-left: 10px; 26 | } 27 | 28 | #dcode span.nbr { 29 | color: #000080; 30 | } 31 | 32 | #dcode span.str { 33 | color: #8080a0; 34 | } 35 | 36 | #dcode span.com { 37 | color: #000080; 38 | } 39 | 40 | #dcode span.kw1 { 41 | color: #0000ff; 42 | } 43 | 44 | #dcode span.kw2 { 45 | color: #800000; 46 | } 47 | 48 | #dcode span.kw3 { 49 | color: #800000; 50 | } 51 | 52 | #dcode span.kw4 { 53 | color: #0000ff; 54 | } 55 | 56 | #dcode span.opr { 57 | color: #a0a0a0; 58 | } -------------------------------------------------------------------------------- /unported/doc/html/candydoc/ie56hack.css: -------------------------------------------------------------------------------- 1 | /* This file is a part of CanDyDOC fileset. 2 | File is written by Victor Nakoryakov and placed into the public domain. 3 | 4 | This file is CSS to work around IE6 and earlier bugs. It's included just 5 | in these browsers. */ 6 | 7 | 8 | /* Some magic to emulate unsupported "position: fixed" style. */ 9 | #tabarea 10 | { 11 | _position: absolute; 12 | _top: expression(eval(document.body.scrollTop+8)); 13 | } 14 | 15 | /* ditto */ 16 | #explorerclient 17 | { 18 | _position: absolute; 19 | _top: expression(eval(document.body.scrollTop+24)); 20 | _height: expression(eval(document.body.clientHeight-48)); 21 | } 22 | -------------------------------------------------------------------------------- /unported/doc/html/candydoc/img/bg1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/html/candydoc/img/bg1.gif -------------------------------------------------------------------------------- /unported/doc/html/candydoc/img/candydoc.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/html/candydoc/img/candydoc.gif -------------------------------------------------------------------------------- /unported/doc/html/candydoc/img/outline/alias.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/html/candydoc/img/outline/alias.gif -------------------------------------------------------------------------------- /unported/doc/html/candydoc/img/outline/bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/html/candydoc/img/outline/bg.gif -------------------------------------------------------------------------------- /unported/doc/html/candydoc/img/outline/class.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/html/candydoc/img/outline/class.gif -------------------------------------------------------------------------------- /unported/doc/html/candydoc/img/outline/enum.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/html/candydoc/img/outline/enum.gif -------------------------------------------------------------------------------- /unported/doc/html/candydoc/img/outline/func.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/html/candydoc/img/outline/func.gif -------------------------------------------------------------------------------- /unported/doc/html/candydoc/img/outline/module.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/html/candydoc/img/outline/module.gif -------------------------------------------------------------------------------- /unported/doc/html/candydoc/img/outline/package.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/html/candydoc/img/outline/package.gif -------------------------------------------------------------------------------- /unported/doc/html/candydoc/img/outline/struct.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/html/candydoc/img/outline/struct.gif -------------------------------------------------------------------------------- /unported/doc/html/candydoc/img/outline/template.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/html/candydoc/img/outline/template.gif -------------------------------------------------------------------------------- /unported/doc/html/candydoc/img/outline/var.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/html/candydoc/img/outline/var.gif -------------------------------------------------------------------------------- /unported/doc/html/candydoc/img/package/bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/html/candydoc/img/package/bg.gif -------------------------------------------------------------------------------- /unported/doc/html/candydoc/img/tree/shim.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/html/candydoc/img/tree/shim.gif -------------------------------------------------------------------------------- /unported/doc/html/candydoc/img/tree/tb.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/html/candydoc/img/tree/tb.gif -------------------------------------------------------------------------------- /unported/doc/html/candydoc/img/tree/tbr.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/html/candydoc/img/tree/tbr.gif -------------------------------------------------------------------------------- /unported/doc/html/candydoc/img/tree/tbrm.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/html/candydoc/img/tree/tbrm.gif -------------------------------------------------------------------------------- /unported/doc/html/candydoc/img/tree/tbrp.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/html/candydoc/img/tree/tbrp.gif -------------------------------------------------------------------------------- /unported/doc/html/candydoc/img/tree/tr.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/html/candydoc/img/tree/tr.gif -------------------------------------------------------------------------------- /unported/doc/html/candydoc/img/tree/trm.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/html/candydoc/img/tree/trm.gif -------------------------------------------------------------------------------- /unported/doc/html/candydoc/img/tree/trp.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/html/candydoc/img/tree/trp.gif -------------------------------------------------------------------------------- /unported/doc/html/candydoc/modules.ddoc: -------------------------------------------------------------------------------- 1 | MODULES = 2 | -------------------------------------------------------------------------------- /unported/doc/html/candydoc/modules.def: -------------------------------------------------------------------------------- 1 | EXETYPE DOS 2 | -------------------------------------------------------------------------------- /unported/doc/html/candydoc/modules.lsp: -------------------------------------------------------------------------------- 1 | -c -p256 2 | C:\d\tango\doc\html\candydoc\modules.lib 3 | -------------------------------------------------------------------------------- /unported/doc/html/candydoc/modules.rsp: -------------------------------------------------------------------------------- 1 | -c 2 | -Dddoc\html 3 | -op 4 | -I\d\tango\ 5 | -IC:\d\dmd\src\phobos\ 6 | -IC:\d\tango\doc\ 7 | -IC:\d\tango\tango\io\ 8 | -IC:\d\tango\tango\convert\ 9 | -IC:\d\tango\tango\io\model\ 10 | -IC:\d\tango\tango\io\protocol\model\ 11 | -IC:\d\tango\tango\os\ 12 | -IC:\d\tango\tango\stdc\ 13 | -IC:\d\tango\tango\io\support\ 14 | -IC:\d\tango\tango\core\ 15 | -IC:\d\tango\tango\io\filter\ 16 | -IC:\d\tango\tango\io\protocol\ 17 | -IC:\d\tango\tango\net\ 18 | -c 19 | doc\html\candydoc\modules.def 20 | tango\io\protocol\Writer.d 21 | tango\net\SocketConduit.d 22 | tango\net\ServerSocket.d 23 | tango\io\FileProxy.d 24 | tango\io\FilePath.d 25 | tango\io\support\BufferCodec.d 26 | tango\io\Buffer.d 27 | tango\convert\UnicodeBom.d 28 | tango\os\OS.d 29 | tango\convert\Unicode.d 30 | tango\io\GrowBuffer.d 31 | tango\convert\Atoi.d 32 | tango\io\protocol\EndianWriter.d 33 | tango\stdc\config.d 34 | tango\io\protocol\Reader.d 35 | -------------------------------------------------------------------------------- /unported/doc/html/candydoc/util.js: -------------------------------------------------------------------------------- 1 | /* This file is a part of CanDyDOC fileset. 2 | File is written by Victor Nakoryakov and placed into the public domain. 3 | 4 | This file is javascript with cross-browser utility functions. */ 5 | 6 | function getLeft(elem) 7 | { 8 | var ret = 0; 9 | while (elem.offsetParent) 10 | { 11 | ret += elem.offsetLeft; 12 | elem = elem.offsetParent; 13 | } 14 | 15 | return ret; 16 | } 17 | 18 | function getTop(elem) 19 | { 20 | var ret = 0; 21 | while (elem.offsetParent) 22 | { 23 | ret += elem.offsetTop; 24 | elem = elem.offsetParent; 25 | } 26 | 27 | return ret; 28 | } 29 | 30 | function getWindowHeight() 31 | { 32 | var ret = 0; 33 | if (typeof(window.innerHeight) == "number") 34 | ret = window.innerHeight; 35 | else if (document.documentElement && document.documentElement.clientHeight) 36 | ret = document.documentElement.clientHeight; 37 | else if (document.body && document.body.clientHeight) 38 | ret = document.body.clientHeight; 39 | 40 | return ret; 41 | } 42 | -------------------------------------------------------------------------------- /unported/doc/images/IO.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/images/IO.png -------------------------------------------------------------------------------- /unported/doc/images/LearnToTangoWithD.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/images/LearnToTangoWithD.jpg -------------------------------------------------------------------------------- /unported/doc/images/classdia.tango.io.File.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/images/classdia.tango.io.File.png -------------------------------------------------------------------------------- /unported/doc/images/classdia.tango.io.FileConduit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/images/classdia.tango.io.FileConduit.png -------------------------------------------------------------------------------- /unported/doc/images/classdia.tango.io.FilePath.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/images/classdia.tango.io.FilePath.png -------------------------------------------------------------------------------- /unported/doc/images/collection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/images/collection.png -------------------------------------------------------------------------------- /unported/doc/images/methods.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/images/methods.png -------------------------------------------------------------------------------- /unported/doc/images/objdia.tango.console.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/images/objdia.tango.console.png -------------------------------------------------------------------------------- /unported/doc/images/tshirt-back.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/images/tshirt-back.jpg -------------------------------------------------------------------------------- /unported/doc/images/tshirt-front.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/doc/images/tshirt-front.jpg -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/dmd/cConst.c: -------------------------------------------------------------------------------- 1 | // utility that expose some C consts to D 2 | 3 | #ifndef _WIN32 4 | #include 5 | 6 | // this is needed only by rt.cover 7 | int fcntl_O_RDONLY(){ 8 | return O_RDONLY; 9 | } 10 | #endif 11 | 12 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/dmd/darwin/dyld.d: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright: Copyright (c) 2010 Jacob Carlborg. All rights reserved. 3 | * Authors: Jacob Carlborg 4 | * Version: Initial created: Feb 20, 2010 5 | * License: BSD style: $(LICENSE) 6 | */ 7 | module rt.compiler.dmd.darwin.dyld; 8 | 9 | version (darwin): 10 | 11 | import rt.compiler.dmd.darwin.loader; 12 | 13 | extern (C): 14 | 15 | uint _dyld_image_count (); 16 | mach_header* _dyld_get_image_header (uint image_index); 17 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/dmd/darwin/dynamic_lib_fixes.c: -------------------------------------------------------------------------------- 1 | #ifdef __APPLE__ 2 | void* _Dmain __attribute__ ((weak)); 3 | char rt_init (); 4 | char rt_term (); 5 | 6 | __attribute__((constructor)) static void initializer () 7 | { 8 | rt_init(); 9 | } 10 | 11 | __attribute__((destructor)) static void finalizer () 12 | { 13 | rt_term(); 14 | } 15 | #endif 16 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/dmd/darwin/getsect.d: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright: Copyright (c) 2010 Jacob Carlborg. All rights reserved. 3 | * Authors: Jacob Carlborg 4 | * Version: Initial created: Mar 16, 2010 5 | * License: BSD style: $(LICENSE) 6 | */ 7 | module rt.compiler.dmd.darwin.getsect; 8 | 9 | version (darwin): 10 | 11 | import rt.compiler.dmd.darwin.loader; 12 | 13 | extern (C): 14 | 15 | section* getsectbynamefromheader (in mach_header* mhp, in char* segname, in char* sectname); 16 | section_64* getsectbynamefromheader_64 (mach_header_64* mhp, in char* segname, in char* sectname); 17 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/dmd/darwin/loader.d: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright: Copyright (c) 2010 Jacob Carlborg. All rights reserved. 3 | * Authors: Jacob Carlborg 4 | * Version: Initial created: Feb 20, 2010 5 | * License: BSD style: $(LICENSE) 6 | */ 7 | module rt.compiler.dmd.darwin.loader; 8 | 9 | version (darwin): 10 | 11 | struct mach_header 12 | { 13 | uint magic; 14 | int cputype; 15 | int cpusubtype; 16 | uint filetype; 17 | uint ncmds; 18 | uint sizeofcmds; 19 | uint flags; 20 | } 21 | 22 | struct mach_header_64 23 | { 24 | uint magic; 25 | int cputype; 26 | int cpusubtype; 27 | uint filetype; 28 | uint ncmds; 29 | uint sizeofcmds; 30 | uint flags; 31 | uint reserved; 32 | } 33 | 34 | enum : uint 35 | { 36 | MH_MAGIC = 0xfeedface, 37 | MH_CIGAM = 0xcefaedfe, 38 | MH_MAGIC_64 = 0xfeedfacf, 39 | MH_CIGAM_64 = 0xcffaedfe, 40 | } 41 | 42 | struct section 43 | { 44 | char[16] sectname; 45 | char[16] segname; 46 | uint addr; 47 | uint size; 48 | uint offset; 49 | uint align_; 50 | uint reloff; 51 | uint nreloc; 52 | uint flags; 53 | uint reserved1; 54 | uint reserved2; 55 | } 56 | 57 | struct section_64 58 | { 59 | char[16] sectname; 60 | char[16] segname; 61 | long addr; 62 | long size; 63 | uint offset; 64 | uint align_; 65 | uint reloff; 66 | uint nreloc; 67 | uint flags; 68 | uint reserved1; 69 | uint reserved2; 70 | uint reserved3; 71 | } 72 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/dmd/ignore.d: -------------------------------------------------------------------------------- 1 | // adding these eliminates runtime linking to sprintf, FP, I/O subsystems, etc (22+KB) 2 | 3 | extern(C) 4 | { 5 | void _assert(int x) {throw new Exception("asserted", __FILE__, __LINE__);} 6 | void _fltused() {throw new Exception("fltused");} 7 | } 8 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/dmd/invariant.d: -------------------------------------------------------------------------------- 1 | /* 2 | * Placed into the Public Domain 3 | * written by Walter Bright 4 | * www.digitalmars.com 5 | */ 6 | 7 | private { 8 | extern(C) int printf(char*,...); 9 | } 10 | void _d_invariant(Object o) 11 | { ClassInfo c; 12 | 13 | //printf("__d_invariant(%p)\n", o); 14 | 15 | // BUG: needs to be filename/line of caller, not library routine 16 | assert(o !is null); // just do null check, not invariant check 17 | c = o.classinfo; 18 | do 19 | { 20 | if (c.classInvariant !is null) 21 | { 22 | void delegate() inv; 23 | inv.ptr = cast(void*) o; 24 | inv.funcptr = cast(void function()) c.classInvariant; 25 | inv(); 26 | } 27 | c = c.base; 28 | } while (c); 29 | } 30 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/dmd/minit.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiegeLord/Tango-D2/ec9afd1ed3d516284e18c88b9f3a38d44d60d4aa/unported/tango/core/rt/compiler/dmd/minit.obj -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/dmd/rt/compiler.d: -------------------------------------------------------------------------------- 1 | 2 | /* Written by Walter Bright 3 | * www.digitalmars.com 4 | * Placed into Public Domain 5 | */ 6 | 7 | module rt.compiler.dmd.rt.compiler; 8 | 9 | // Identify the compiler used and its various features. 10 | 11 | const 12 | { 13 | // Vendor specific string naming the compiler 14 | char[] name = "Digital Mars D"; 15 | 16 | // Master list of D compiler vendors 17 | enum Vendor 18 | { 19 | DigitalMars = 1 20 | } 21 | 22 | // Which vendor we are 23 | Vendor vendor = Vendor.DigitalMars; 24 | 25 | 26 | // The vendor specific version number, as in 27 | // version_major.version_minor 28 | uint version_major = 0; 29 | uint version_minor = 0; 30 | 31 | 32 | // The version of the D Programming Language Specification 33 | // Supported by the compiler 34 | uint D_major = 0; 35 | uint D_minor = 0; 36 | } 37 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/dmd/rt/invariant_.d: -------------------------------------------------------------------------------- 1 | /* 2 | * Placed into the Public Domain 3 | * written by Walter Bright 4 | * www.digitalmars.com 5 | */ 6 | module rt.compiler.dmd.rt.invariant_; 7 | 8 | extern (C) void _d_invariant(Object o) 9 | { ClassInfo c; 10 | 11 | //printf("__d_invariant(%p)\n", o); 12 | 13 | // BUG: needs to be filename/line of caller, not library routine 14 | assert(o !is null); // just do null check, not invariant check 15 | 16 | c = o.classinfo; 17 | do 18 | { 19 | if (c.classInvariant !is null) 20 | { 21 | void delegate() inv; 22 | inv.ptr = cast(void*) o; 23 | inv.funcptr = cast(void function()) c.classInvariant; 24 | inv(); 25 | } 26 | c = c.base; 27 | } while (c); 28 | } 29 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/dmd/rt/obj.d: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2002 by Digital Mars 2 | // All Rights Reserved 3 | // written by Walter Bright 4 | // www.digitalmars.com 5 | 6 | module rt.compiler.dmd.rt.obj; 7 | 8 | extern (C): 9 | 10 | /******************************** 11 | * Compiler helper for operator == for class objects. 12 | */ 13 | 14 | int _d_obj_eq(Object o1, Object o2) 15 | { 16 | return o1 is o2 || (o1 && o1.opEquals(o2)); 17 | } 18 | 19 | 20 | /******************************** 21 | * Compiler helper for operator <, <=, >, >= for class objects. 22 | */ 23 | 24 | int _d_obj_cmp(Object o1, Object o2) 25 | { 26 | return o1.opCmp(o2); 27 | } 28 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/dmd/rt/qsort2.alt: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Placed into Public Domain 4 | * written by Walter Bright 5 | * www.digitalmars.com 6 | * 7 | * This is a public domain version of qsort.d. 8 | * All it does is call C's qsort(), but runs a little slower since 9 | * it needs to synchronize a global variable. 10 | */ 11 | 12 | /* 13 | * Modified by Sean Kelly for use with Tango. 14 | */ 15 | 16 | module rt.compiler.dmd.rt.qsort2; 17 | 18 | //debug=qsort; 19 | 20 | private import tango.stdc.stdlib:qsort; 21 | 22 | struct Array 23 | { 24 | size_t length; 25 | void* ptr; 26 | } 27 | 28 | private TypeInfo tiglobal; 29 | 30 | extern (C) int cmp(void* p1, void* p2) 31 | { 32 | return tiglobal.compare(p1, p2); 33 | } 34 | 35 | extern (C) long _adSort(Array a, TypeInfo ti) 36 | { 37 | synchronized 38 | { 39 | tiglobal = ti; 40 | qsort(a.ptr, a.length, cast(size_t)ti.tsize(), &cmp); 41 | } 42 | return *cast(long*)(&a); 43 | } 44 | 45 | 46 | 47 | unittest 48 | { 49 | debug(qsort) printf("array.sort.unittest()\n"); 50 | 51 | int a[] = new int[10]; 52 | 53 | a[0] = 23; 54 | a[1] = 1; 55 | a[2] = 64; 56 | a[3] = 5; 57 | a[4] = 6; 58 | a[5] = 5; 59 | a[6] = 17; 60 | a[7] = 3; 61 | a[8] = 0; 62 | a[9] = -1; 63 | 64 | a.sort; 65 | 66 | for (int i = 0; i < a.length - 1; i++) 67 | { 68 | //printf("i = %d", i); 69 | //printf(" %d %d\n", a[i], a[i + 1]); 70 | assert(a[i] <= a[i + 1]); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/dmd/typeinfo/ti_byte.d: -------------------------------------------------------------------------------- 1 | 2 | // byte 3 | 4 | module rt.compiler.dmd.typeinfo.ti_byte; 5 | 6 | class TypeInfo_g : TypeInfo 7 | { 8 | override char[] toString() { return "byte"; } 9 | 10 | override hash_t getHash(in void* p) 11 | { 12 | return cast(hash_t)(*cast(byte *)p); 13 | } 14 | 15 | override equals_t equals(in void* p1, in void* p2) 16 | { 17 | return *cast(byte *)p1 == *cast(byte *)p2; 18 | } 19 | 20 | override int compare(in void* p1, in void* p2) 21 | { 22 | return *cast(byte *)p1 - *cast(byte *)p2; 23 | } 24 | 25 | override size_t talign() 26 | { 27 | return byte.alignof; 28 | } 29 | 30 | override size_t tsize() 31 | { 32 | return byte.sizeof; 33 | } 34 | 35 | override void swap(void *p1, void *p2) 36 | { 37 | byte t; 38 | 39 | t = *cast(byte *)p1; 40 | *cast(byte *)p1 = *cast(byte *)p2; 41 | *cast(byte *)p2 = t; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/dmd/typeinfo/ti_char.d: -------------------------------------------------------------------------------- 1 | 2 | module rt.compiler.dmd.typeinfo.ti_char; 3 | 4 | class TypeInfo_a : TypeInfo 5 | { 6 | override char[] toString() { return "char"; } 7 | 8 | override hash_t getHash(in void* p) 9 | { 10 | return cast(hash_t)(*cast(char *)p); 11 | } 12 | 13 | override equals_t equals(in void* p1, in void* p2) 14 | { 15 | return *cast(char *)p1 == *cast(char *)p2; 16 | } 17 | 18 | override int compare(in void* p1, in void* p2) 19 | { 20 | return *cast(char *)p1 - *cast(char *)p2; 21 | } 22 | 23 | override size_t talign() 24 | { 25 | return char.alignof; 26 | } 27 | 28 | override size_t tsize() 29 | { 30 | return char.sizeof; 31 | } 32 | 33 | override void swap(void *p1, void *p2) 34 | { 35 | char t; 36 | 37 | t = *cast(char *)p1; 38 | *cast(char *)p1 = *cast(char *)p2; 39 | *cast(char *)p2 = t; 40 | } 41 | 42 | override void[] init() 43 | { static char c; 44 | 45 | return (cast(char *)&c)[0 .. 1]; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/dmd/typeinfo/ti_dchar.d: -------------------------------------------------------------------------------- 1 | 2 | // dchar 3 | 4 | module rt.compiler.dmd.typeinfo.ti_dchar; 5 | 6 | class TypeInfo_w : TypeInfo 7 | { 8 | override char[] toString() { return "dchar"; } 9 | 10 | override hash_t getHash(in void* p) 11 | { 12 | return cast(hash_t)*cast(dchar *)p; 13 | } 14 | 15 | override equals_t equals(in void* p1, in void* p2) 16 | { 17 | return *cast(dchar *)p1 == *cast(dchar *)p2; 18 | } 19 | 20 | override int compare(in void* p1, in void* p2) 21 | { 22 | return *cast(dchar *)p1 - *cast(dchar *)p2; 23 | } 24 | 25 | override size_t talign() 26 | { 27 | return dchar.alignof; 28 | } 29 | 30 | override size_t tsize() 31 | { 32 | return dchar.sizeof; 33 | } 34 | 35 | override void swap(void *p1, void *p2) 36 | { 37 | dchar t; 38 | 39 | t = *cast(dchar *)p1; 40 | *cast(dchar *)p1 = *cast(dchar *)p2; 41 | *cast(dchar *)p2 = t; 42 | } 43 | 44 | override void[] init() 45 | { static dchar c; 46 | 47 | return (cast(dchar *)&c)[0 .. 1]; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/dmd/typeinfo/ti_delegate.d: -------------------------------------------------------------------------------- 1 | 2 | // delegate 3 | 4 | module rt.compiler.dmd.typeinfo.ti_delegate; 5 | private import rt.compiler.util.hash; 6 | 7 | alias void delegate(int) dg; 8 | 9 | class TypeInfo_D : TypeInfo 10 | { 11 | override hash_t getHash(in void* p) 12 | { 13 | return rt_hash_block(cast(size_t *)p,2,0); 14 | } 15 | 16 | override equals_t equals(in void* p1, in void* p2) 17 | { 18 | return *cast(dg *)p1 == *cast(dg *)p2; 19 | } 20 | 21 | override size_t talign() 22 | { 23 | return dg.alignof; 24 | } 25 | 26 | override size_t tsize() 27 | { 28 | return dg.sizeof; 29 | } 30 | 31 | override void swap(void *p1, void *p2) 32 | { 33 | dg t; 34 | 35 | t = *cast(dg *)p1; 36 | *cast(dg *)p1 = *cast(dg *)p2; 37 | *cast(dg *)p2 = t; 38 | } 39 | 40 | override uint flags() 41 | { 42 | return 1; 43 | } 44 | 45 | version (X86_64) override int argTypes(out TypeInfo arg1, out TypeInfo arg2) 46 | { 47 | arg1 = typeid(void*); 48 | arg2 = typeid(void*); 49 | return 0; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/dmd/typeinfo/ti_idouble.d: -------------------------------------------------------------------------------- 1 | 2 | // idouble 3 | 4 | module rt.compiler.dmd.typeinfo.ti_idouble; 5 | 6 | private import rt.compiler.dmd.typeinfo.ti_double; 7 | 8 | class TypeInfo_p : TypeInfo_d 9 | { 10 | override char[] toString() { return "idouble"; } 11 | } 12 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/dmd/typeinfo/ti_ifloat.d: -------------------------------------------------------------------------------- 1 | 2 | // ifloat 3 | 4 | module rt.compiler.dmd.typeinfo.ti_ifloat; 5 | 6 | private import rt.compiler.dmd.typeinfo.ti_float; 7 | 8 | class TypeInfo_o : TypeInfo_f 9 | { 10 | override char[] toString() { return "ifloat"; } 11 | } 12 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/dmd/typeinfo/ti_int.d: -------------------------------------------------------------------------------- 1 | 2 | // int 3 | 4 | module rt.compiler.dmd.typeinfo.ti_int; 5 | 6 | class TypeInfo_i : TypeInfo 7 | { 8 | override char[] toString() { return "int"; } 9 | 10 | override hash_t getHash(in void* p) 11 | { 12 | return cast(hash_t)(*cast(uint *)p); 13 | } 14 | 15 | override equals_t equals(in void* p1, in void* p2) 16 | { 17 | return *cast(uint *)p1 == *cast(uint *)p2; 18 | } 19 | 20 | override int compare(in void* p1, in void* p2) 21 | { 22 | if (*cast(int*) p1 < *cast(int*) p2) 23 | return -1; 24 | else if (*cast(int*) p1 > *cast(int*) p2) 25 | return 1; 26 | return 0; 27 | } 28 | 29 | override size_t talign() 30 | { 31 | return int.alignof; 32 | } 33 | 34 | override size_t tsize() 35 | { 36 | return int.sizeof; 37 | } 38 | 39 | override void swap(void *p1, void *p2) 40 | { 41 | int t; 42 | 43 | t = *cast(int *)p1; 44 | *cast(int *)p1 = *cast(int *)p2; 45 | *cast(int *)p2 = t; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/dmd/typeinfo/ti_ireal.d: -------------------------------------------------------------------------------- 1 | 2 | // ireal 3 | 4 | module rt.compiler.dmd.typeinfo.ti_ireal; 5 | 6 | private import rt.compiler.dmd.typeinfo.ti_real; 7 | 8 | class TypeInfo_j : TypeInfo_e 9 | { 10 | override char[] toString() { return "ireal"; } 11 | } 12 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/dmd/typeinfo/ti_long.d: -------------------------------------------------------------------------------- 1 | 2 | // long 3 | 4 | module rt.compiler.dmd.typeinfo.ti_long; 5 | private import rt.compiler.util.hash; 6 | 7 | class TypeInfo_l : TypeInfo 8 | { 9 | override char[] toString() { return "long"; } 10 | 11 | override hash_t getHash(in void* p) 12 | { 13 | static if(hash_t.sizeof==8){ 14 | return cast(hash_t)(*cast(ulong *)p); 15 | } else { 16 | return rt_hash_combine(*cast(uint *)p,(cast(uint *)p)[1]); 17 | } 18 | } 19 | 20 | override equals_t equals(in void* p1, in void* p2) 21 | { 22 | return *cast(long *)p1 == *cast(long *)p2; 23 | } 24 | 25 | override int compare(in void* p1, in void* p2) 26 | { 27 | if (*cast(long *)p1 < *cast(long *)p2) 28 | return -1; 29 | else if (*cast(long *)p1 > *cast(long *)p2) 30 | return 1; 31 | return 0; 32 | } 33 | 34 | override size_t talign() 35 | { 36 | return long.alignof; 37 | } 38 | 39 | override size_t tsize() 40 | { 41 | return long.sizeof; 42 | } 43 | 44 | override void swap(void *p1, void *p2) 45 | { 46 | long t; 47 | 48 | t = *cast(long *)p1; 49 | *cast(long *)p1 = *cast(long *)p2; 50 | *cast(long *)p2 = t; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/dmd/typeinfo/ti_ptr.d: -------------------------------------------------------------------------------- 1 | 2 | // pointer 3 | 4 | module rt.compiler.dmd.typeinfo.ti_ptr; 5 | 6 | class TypeInfo_P : TypeInfo 7 | { 8 | override hash_t getHash(in void* p) 9 | { 10 | return cast(hash_t)(*cast(size_t *)p); 11 | } 12 | 13 | override equals_t equals(in void* p1, in void* p2) 14 | { 15 | return *cast(void* *)p1 == *cast(void* *)p2; 16 | } 17 | 18 | override int compare(in void* p1, in void* p2) 19 | { 20 | auto c = *cast(void* *)p1 - *cast(void* *)p2; 21 | if (c < 0) 22 | return -1; 23 | else if (c > 0) 24 | return 1; 25 | return 0; 26 | } 27 | 28 | override size_t talign() 29 | { 30 | return (void*).alignof; 31 | } 32 | 33 | override size_t tsize() 34 | { 35 | return (void*).sizeof; 36 | } 37 | 38 | override void swap(void *p1, void *p2) 39 | { 40 | void* t; 41 | 42 | t = *cast(void* *)p1; 43 | *cast(void* *)p1 = *cast(void* *)p2; 44 | *cast(void* *)p2 = t; 45 | } 46 | 47 | override uint flags() 48 | { 49 | return 1; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/dmd/typeinfo/ti_short.d: -------------------------------------------------------------------------------- 1 | 2 | // short 3 | 4 | module rt.compiler.dmd.typeinfo.ti_short; 5 | 6 | class TypeInfo_s : TypeInfo 7 | { 8 | override char[] toString() { return "short"; } 9 | 10 | override hash_t getHash(in void* p) 11 | { 12 | return cast(hash_t)(*cast(ushort *)p); 13 | } 14 | 15 | override equals_t equals(in void* p1, in void* p2) 16 | { 17 | return *cast(short *)p1 == *cast(short *)p2; 18 | } 19 | 20 | override int compare(in void* p1, in void* p2) 21 | { 22 | return *cast(short *)p1 - *cast(short *)p2; 23 | } 24 | 25 | override size_t talign() 26 | { 27 | return short.alignof; 28 | } 29 | 30 | override size_t tsize() 31 | { 32 | return short.sizeof; 33 | } 34 | 35 | override void swap(void *p1, void *p2) 36 | { 37 | short t; 38 | 39 | t = *cast(short *)p1; 40 | *cast(short *)p1 = *cast(short *)p2; 41 | *cast(short *)p2 = t; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/dmd/typeinfo/ti_ubyte.d: -------------------------------------------------------------------------------- 1 | 2 | // ubyte 3 | 4 | module rt.compiler.dmd.typeinfo.ti_ubyte; 5 | 6 | class TypeInfo_h : TypeInfo 7 | { 8 | override char[] toString() { return "ubyte"; } 9 | 10 | override hash_t getHash(in void* p) 11 | { 12 | return cast(hash_t)(*cast(ubyte *)p); 13 | } 14 | 15 | override equals_t equals(in void* p1, in void* p2) 16 | { 17 | return *cast(ubyte *)p1 == *cast(ubyte *)p2; 18 | } 19 | 20 | override int compare(in void* p1, in void* p2) 21 | { 22 | return *cast(ubyte *)p1 - *cast(ubyte *)p2; 23 | } 24 | 25 | override size_t talign() 26 | { 27 | return ubyte.alignof; 28 | } 29 | 30 | override size_t tsize() 31 | { 32 | return ubyte.sizeof; 33 | } 34 | 35 | override void swap(void *p1, void *p2) 36 | { 37 | ubyte t; 38 | 39 | t = *cast(ubyte *)p1; 40 | *cast(ubyte *)p1 = *cast(ubyte *)p2; 41 | *cast(ubyte *)p2 = t; 42 | } 43 | } 44 | 45 | class TypeInfo_b : TypeInfo_h 46 | { 47 | override char[] toString() { return "bool"; } 48 | } 49 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/dmd/typeinfo/ti_uint.d: -------------------------------------------------------------------------------- 1 | 2 | // uint 3 | 4 | module rt.compiler.dmd.typeinfo.ti_uint; 5 | 6 | class TypeInfo_k : TypeInfo 7 | { 8 | override char[] toString() { return "uint"; } 9 | 10 | override hash_t getHash(in void* p) 11 | { 12 | return *cast(uint *)p; 13 | } 14 | 15 | override equals_t equals(in void* p1, in void* p2) 16 | { 17 | return *cast(uint *)p1 == *cast(uint *)p2; 18 | } 19 | 20 | override int compare(in void* p1, in void* p2) 21 | { 22 | if (*cast(uint*) p1 < *cast(uint*) p2) 23 | return -1; 24 | else if (*cast(uint*) p1 > *cast(uint*) p2) 25 | return 1; 26 | return 0; 27 | } 28 | 29 | override size_t talign() 30 | { 31 | return uint.alignof; 32 | } 33 | 34 | override size_t tsize() 35 | { 36 | return uint.sizeof; 37 | } 38 | 39 | override void swap(void *p1, void *p2) 40 | { 41 | int t; 42 | 43 | t = *cast(uint *)p1; 44 | *cast(uint *)p1 = *cast(uint *)p2; 45 | *cast(uint *)p2 = t; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/dmd/typeinfo/ti_ulong.d: -------------------------------------------------------------------------------- 1 | 2 | // ulong 3 | 4 | module rt.compiler.dmd.typeinfo.ti_ulong; 5 | private import rt.compiler.util.hash; 6 | 7 | class TypeInfo_m : TypeInfo 8 | { 9 | override char[] toString() { return "ulong"; } 10 | 11 | override hash_t getHash(in void* p) 12 | { 13 | static if(hash_t.sizeof==8){ 14 | return cast(hash_t)(*cast(ulong *)p); 15 | } else { 16 | return rt_hash_combine(*cast(uint *)p,(cast(uint *)p)[1]); 17 | } 18 | } 19 | 20 | override equals_t equals(in void* p1, in void* p2) 21 | { 22 | return *cast(ulong *)p1 == *cast(ulong *)p2; 23 | } 24 | 25 | override int compare(in void* p1, in void* p2) 26 | { 27 | if (*cast(ulong *)p1 < *cast(ulong *)p2) 28 | return -1; 29 | else if (*cast(ulong *)p1 > *cast(ulong *)p2) 30 | return 1; 31 | return 0; 32 | } 33 | 34 | override size_t talign() 35 | { 36 | return ulong.alignof; 37 | } 38 | 39 | override size_t tsize() 40 | { 41 | return ulong.sizeof; 42 | } 43 | 44 | override void swap(void *p1, void *p2) 45 | { 46 | ulong t; 47 | 48 | t = *cast(ulong *)p1; 49 | *cast(ulong *)p1 = *cast(ulong *)p2; 50 | *cast(ulong *)p2 = t; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/dmd/typeinfo/ti_ushort.d: -------------------------------------------------------------------------------- 1 | 2 | // ushort 3 | 4 | module rt.compiler.dmd.typeinfo.ti_ushort; 5 | 6 | class TypeInfo_t : TypeInfo 7 | { 8 | override char[] toString() { return "ushort"; } 9 | 10 | override hash_t getHash(in void* p) 11 | { 12 | return *cast(ushort *)p; 13 | } 14 | 15 | override equals_t equals(in void* p1, in void* p2) 16 | { 17 | return *cast(ushort *)p1 == *cast(ushort *)p2; 18 | } 19 | 20 | override int compare(in void* p1, in void* p2) 21 | { 22 | return *cast(ushort *)p1 - *cast(ushort *)p2; 23 | } 24 | 25 | override size_t talign() 26 | { 27 | return ushort.alignof; 28 | } 29 | 30 | override size_t tsize() 31 | { 32 | return ushort.sizeof; 33 | } 34 | 35 | override void swap(void *p1, void *p2) 36 | { 37 | ushort t; 38 | 39 | t = *cast(ushort *)p1; 40 | *cast(ushort *)p1 = *cast(ushort *)p2; 41 | *cast(ushort *)p2 = t; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/dmd/typeinfo/ti_void.d: -------------------------------------------------------------------------------- 1 | 2 | // void 3 | 4 | module rt.compiler.dmd.typeinfo.ti_void; 5 | 6 | class TypeInfo_v : TypeInfo 7 | { 8 | override char[] toString() { return "void"; } 9 | 10 | override hash_t getHash(in void* p) 11 | { 12 | assert(0); 13 | } 14 | 15 | override equals_t equals(in void* p1, in void* p2) 16 | { 17 | return *cast(byte *)p1 == *cast(byte *)p2; 18 | } 19 | 20 | override int compare(in void* p1, in void* p2) 21 | { 22 | return *cast(byte *)p1 - *cast(byte *)p2; 23 | } 24 | 25 | override size_t talign() 26 | { 27 | return void.alignof; 28 | } 29 | 30 | override size_t tsize() 31 | { 32 | return void.sizeof; 33 | } 34 | 35 | override void swap(void *p1, void *p2) 36 | { 37 | byte t; 38 | 39 | t = *cast(byte *)p1; 40 | *cast(byte *)p1 = *cast(byte *)p2; 41 | *cast(byte *)p2 = t; 42 | } 43 | 44 | override uint flags() 45 | { 46 | return 1; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/dmd/typeinfo/ti_wchar.d: -------------------------------------------------------------------------------- 1 | 2 | module rt.compiler.dmd.typeinfo.ti_wchar; 3 | 4 | 5 | class TypeInfo_u : TypeInfo 6 | { 7 | override char[] toString() { return "wchar"; } 8 | 9 | override hash_t getHash(in void* p) 10 | { 11 | return cast(hash_t)(*cast(wchar *)p); 12 | } 13 | 14 | override equals_t equals(in void* p1, in void* p2) 15 | { 16 | return *cast(wchar *)p1 == *cast(wchar *)p2; 17 | } 18 | 19 | override int compare(in void* p1, in void* p2) 20 | { 21 | return *cast(wchar *)p1 - *cast(wchar *)p2; 22 | } 23 | 24 | override size_t talign() 25 | { 26 | return wchar.alignof; 27 | } 28 | 29 | override size_t tsize() 30 | { 31 | return wchar.sizeof; 32 | } 33 | 34 | override void swap(void *p1, void *p2) 35 | { 36 | wchar t; 37 | 38 | t = *cast(wchar *)p1; 39 | *cast(wchar *)p1 = *cast(wchar *)p2; 40 | *cast(wchar *)p2 = t; 41 | } 42 | 43 | override void[] init() 44 | { static wchar c; 45 | 46 | return (cast(wchar *)&c)[0 .. 1]; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/gdc/gcc/cbridge_stdio.c: -------------------------------------------------------------------------------- 1 | /* GDC -- D front-end for GCC 2 | Copyright (C) 2004 David Friedman 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | */ 18 | 19 | #include 20 | 21 | void * _d_gnu_cbridge_stdin; 22 | void * _d_gnu_cbridge_stdout; 23 | void * _d_gnu_cbridge_stderr; 24 | 25 | void _d_gnu_cbridge_init_stdio() 26 | { 27 | _d_gnu_cbridge_stdin = stdin; 28 | _d_gnu_cbridge_stdout = stdout; 29 | _d_gnu_cbridge_stderr = stderr; 30 | } 31 | 32 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/gdc/gcc/support.d: -------------------------------------------------------------------------------- 1 | /* GDC -- D front-end for GCC 2 | Copyright (C) 2004 David Friedman 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | */ 18 | 19 | module rt.compiler.gdc.gcc.support; 20 | 21 | /* Binary compatibility for an earlier bug. This will be removed 22 | in a later version. */ 23 | extern (C) { 24 | void _D9invariant12_d_invariantFC6ObjectZv(Object o); 25 | void _d_invariant(Object o) { 26 | _D9invariant12_d_invariantFC6ObjectZv(o); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/gdc/invariant.d: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Placed into the Public Domain 4 | * written by Walter Bright 5 | * www.digitalmars.com 6 | */ 7 | 8 | private { 9 | extern(C) int printf(char*,...); 10 | } 11 | void _d_invariant(Object o) 12 | { ClassInfo c; 13 | 14 | //printf("__d_invariant(%p)\n", o); 15 | 16 | // BUG: needs to be filename/line of caller, not library routine 17 | assert(o !is null); // just do null check, not invariant check 18 | 19 | c = o.classinfo; 20 | do 21 | { 22 | if (c.classInvariant !is null) 23 | { 24 | void delegate() inv; 25 | inv.ptr = cast(void*) o; 26 | inv.funcptr = cast(void function())c.classInvariant; 27 | inv(); 28 | } 29 | c = c.base; 30 | } while (c); 31 | } 32 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/gdc/rt/cmain.d: -------------------------------------------------------------------------------- 1 | module rt.compiler.gdc.rt.cmain; 2 | private extern (C) int _d_run_main(int argc, char **argv, void * p); 3 | int main(); 4 | 5 | version(NoCMain) 6 | { 7 | 8 | } 9 | else 10 | { 11 | extern (C) int main(int argc, char **argv) 12 | { 13 | return _d_run_main(argc, argv, & main); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/gdc/typeinfo/ti_byte.d: -------------------------------------------------------------------------------- 1 | 2 | // byte 3 | 4 | module rt.compiler.gdc.typeinfo.ti_byte; 5 | 6 | class TypeInfo_g : TypeInfo 7 | { 8 | override char[] toString() { return "byte"; } 9 | 10 | override hash_t getHash(in void* p) 11 | { 12 | return cast(hash_t)(*cast(byte *)p); 13 | } 14 | 15 | override equals_t equals(in void* p1, in void* p2) 16 | { 17 | return *cast(byte *)p1 == *cast(byte *)p2; 18 | } 19 | 20 | override int compare(in void* p1, in void* p2) 21 | { 22 | return *cast(byte *)p1 - *cast(byte *)p2; 23 | } 24 | 25 | override size_t talign() 26 | { 27 | return byte.alignof; 28 | } 29 | 30 | override size_t tsize() 31 | { 32 | return byte.sizeof; 33 | } 34 | 35 | override void swap(void *p1, void *p2) 36 | { 37 | byte t; 38 | 39 | t = *cast(byte *)p1; 40 | *cast(byte *)p1 = *cast(byte *)p2; 41 | *cast(byte *)p2 = t; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/gdc/typeinfo/ti_char.d: -------------------------------------------------------------------------------- 1 | 2 | module rt.compiler.gdc.typeinfo.ti_char; 3 | 4 | class TypeInfo_a : TypeInfo 5 | { 6 | override char[] toString() { return "char"; } 7 | 8 | override hash_t getHash(in void* p) 9 | { 10 | return cast(hash_t)(*cast(char *)p); 11 | } 12 | 13 | override equals_t equals(in void* p1, in void* p2) 14 | { 15 | return *cast(char *)p1 == *cast(char *)p2; 16 | } 17 | 18 | override int compare(in void* p1, in void* p2) 19 | { 20 | return *cast(char *)p1 - *cast(char *)p2; 21 | } 22 | 23 | override size_t talign() 24 | { 25 | return char.alignof; 26 | } 27 | 28 | override size_t tsize() 29 | { 30 | return char.sizeof; 31 | } 32 | 33 | override void swap(void *p1, void *p2) 34 | { 35 | char t; 36 | 37 | t = *cast(char *)p1; 38 | *cast(char *)p1 = *cast(char *)p2; 39 | *cast(char *)p2 = t; 40 | } 41 | 42 | override void[] init() 43 | { static char c; 44 | 45 | return (cast(char *)&c)[0 .. 1]; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/gdc/typeinfo/ti_dchar.d: -------------------------------------------------------------------------------- 1 | 2 | // dchar 3 | 4 | module rt.compiler.gdc.typeinfo.ti_dchar; 5 | 6 | class TypeInfo_w : TypeInfo 7 | { 8 | override char[] toString() { return "dchar"; } 9 | 10 | override hash_t getHash(in void* p) 11 | { 12 | return cast(hash_t)*cast(dchar *)p; 13 | } 14 | 15 | override equals_t equals(in void* p1, in void* p2) 16 | { 17 | return *cast(dchar *)p1 == *cast(dchar *)p2; 18 | } 19 | 20 | override int compare(in void* p1, in void* p2) 21 | { 22 | return *cast(dchar *)p1 - *cast(dchar *)p2; 23 | } 24 | 25 | override size_t talign() 26 | { 27 | return dchar.alignof; 28 | } 29 | 30 | override size_t tsize() 31 | { 32 | return dchar.sizeof; 33 | } 34 | 35 | override void swap(void *p1, void *p2) 36 | { 37 | dchar t; 38 | 39 | t = *cast(dchar *)p1; 40 | *cast(dchar *)p1 = *cast(dchar *)p2; 41 | *cast(dchar *)p2 = t; 42 | } 43 | 44 | override void[] init() 45 | { static dchar c; 46 | 47 | return (cast(dchar *)&c)[0 .. 1]; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/gdc/typeinfo/ti_delegate.d: -------------------------------------------------------------------------------- 1 | 2 | // delegate 3 | 4 | module rt.compiler.gdc.typeinfo.ti_delegate; 5 | private import rt.compiler.util.hash; 6 | 7 | alias void delegate(int) dg; 8 | 9 | class TypeInfo_D : TypeInfo 10 | { 11 | override hash_t getHash(in void* p) 12 | { 13 | return rt_hash_block(cast(size_t *)p,2,0); 14 | } 15 | 16 | override equals_t equals(in void* p1, in void* p2) 17 | { 18 | return *cast(dg *)p1 == *cast(dg *)p2; 19 | } 20 | 21 | override size_t talign() 22 | { 23 | return dg.alignof; 24 | } 25 | 26 | override size_t tsize() 27 | { 28 | return dg.sizeof; 29 | } 30 | 31 | override void swap(void *p1, void *p2) 32 | { 33 | dg t; 34 | 35 | t = *cast(dg *)p1; 36 | *cast(dg *)p1 = *cast(dg *)p2; 37 | *cast(dg *)p2 = t; 38 | } 39 | 40 | override uint flags() 41 | { 42 | return 1; 43 | } 44 | 45 | version (X86_64) override int argTypes(out TypeInfo arg1, out TypeInfo arg2) 46 | { 47 | arg1 = typeid(void*); 48 | arg2 = typeid(void*); 49 | return 0; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/gdc/typeinfo/ti_idouble.d: -------------------------------------------------------------------------------- 1 | 2 | // idouble 3 | 4 | module rt.compiler.gdc.typeinfo.ti_idouble; 5 | 6 | private import rt.compiler.gdc.typeinfo.ti_double; 7 | 8 | class TypeInfo_p : TypeInfo_d 9 | { 10 | override char[] toString() { return "idouble"; } 11 | } 12 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/gdc/typeinfo/ti_ifloat.d: -------------------------------------------------------------------------------- 1 | 2 | // ifloat 3 | 4 | module rt.compiler.gdc.typeinfo.ti_ifloat; 5 | 6 | private import rt.compiler.gdc.typeinfo.ti_float; 7 | 8 | class TypeInfo_o : TypeInfo_f 9 | { 10 | override char[] toString() { return "ifloat"; } 11 | } 12 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/gdc/typeinfo/ti_int.d: -------------------------------------------------------------------------------- 1 | 2 | // int 3 | 4 | module rt.compiler.gdc.typeinfo.ti_int; 5 | 6 | class TypeInfo_i : TypeInfo 7 | { 8 | override char[] toString() { return "int"; } 9 | 10 | override hash_t getHash(in void* p) 11 | { 12 | return cast(hash_t)(*cast(uint *)p); 13 | } 14 | 15 | override equals_t equals(in void* p1, in void* p2) 16 | { 17 | return *cast(uint *)p1 == *cast(uint *)p2; 18 | } 19 | 20 | override int compare(in void* p1, in void* p2) 21 | { 22 | if (*cast(int*) p1 < *cast(int*) p2) 23 | return -1; 24 | else if (*cast(int*) p1 > *cast(int*) p2) 25 | return 1; 26 | return 0; 27 | } 28 | 29 | override size_t talign() 30 | { 31 | return int.alignof; 32 | } 33 | 34 | override size_t tsize() 35 | { 36 | return int.sizeof; 37 | } 38 | 39 | override void swap(void *p1, void *p2) 40 | { 41 | int t; 42 | 43 | t = *cast(int *)p1; 44 | *cast(int *)p1 = *cast(int *)p2; 45 | *cast(int *)p2 = t; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/gdc/typeinfo/ti_ireal.d: -------------------------------------------------------------------------------- 1 | 2 | // ireal 3 | 4 | module rt.compiler.gdc.typeinfo.ti_ireal; 5 | 6 | private import rt.compiler.gdc.typeinfo.ti_real; 7 | 8 | class TypeInfo_j : TypeInfo_e 9 | { 10 | override char[] toString() { return "ireal"; } 11 | } 12 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/gdc/typeinfo/ti_long.d: -------------------------------------------------------------------------------- 1 | 2 | // long 3 | 4 | module rt.compiler.gdc.typeinfo.ti_long; 5 | private import rt.compiler.util.hash; 6 | 7 | class TypeInfo_l : TypeInfo 8 | { 9 | override char[] toString() { return "long"; } 10 | 11 | override hash_t getHash(in void* p) 12 | { 13 | static if(hash_t.sizeof==8){ 14 | return cast(hash_t)(*cast(ulong *)p); 15 | } else { 16 | return rt_hash_combine(*cast(uint *)p,(cast(uint *)p)[1]); 17 | } 18 | } 19 | 20 | override equals_t equals(in void* p1, in void* p2) 21 | { 22 | return *cast(long *)p1 == *cast(long *)p2; 23 | } 24 | 25 | override int compare(in void* p1, in void* p2) 26 | { 27 | if (*cast(long *)p1 < *cast(long *)p2) 28 | return -1; 29 | else if (*cast(long *)p1 > *cast(long *)p2) 30 | return 1; 31 | return 0; 32 | } 33 | 34 | override size_t talign() 35 | { 36 | return long.alignof; 37 | } 38 | 39 | override size_t tsize() 40 | { 41 | return long.sizeof; 42 | } 43 | 44 | override void swap(void *p1, void *p2) 45 | { 46 | long t; 47 | 48 | t = *cast(long *)p1; 49 | *cast(long *)p1 = *cast(long *)p2; 50 | *cast(long *)p2 = t; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/gdc/typeinfo/ti_ptr.d: -------------------------------------------------------------------------------- 1 | 2 | // pointer 3 | 4 | module rt.compiler.gdc.typeinfo.ti_ptr; 5 | 6 | class TypeInfo_P : TypeInfo 7 | { 8 | override hash_t getHash(in void* p) 9 | { 10 | return cast(hash_t)(*cast(size_t *)p); 11 | } 12 | 13 | override equals_t equals(in void* p1, in void* p2) 14 | { 15 | return *cast(void* *)p1 == *cast(void* *)p2; 16 | } 17 | 18 | override int compare(in void* p1, in void* p2) 19 | { 20 | auto c = *cast(void* *)p1 - *cast(void* *)p2; 21 | if (c < 0) 22 | return -1; 23 | else if (c > 0) 24 | return 1; 25 | return 0; 26 | } 27 | 28 | override size_t talign() 29 | { 30 | return (void*).alignof; 31 | } 32 | 33 | override size_t tsize() 34 | { 35 | return (void*).sizeof; 36 | } 37 | 38 | override void swap(void *p1, void *p2) 39 | { 40 | void* t; 41 | 42 | t = *cast(void* *)p1; 43 | *cast(void* *)p1 = *cast(void* *)p2; 44 | *cast(void* *)p2 = t; 45 | } 46 | 47 | override uint flags() 48 | { 49 | return 1; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/gdc/typeinfo/ti_short.d: -------------------------------------------------------------------------------- 1 | 2 | // short 3 | 4 | module rt.compiler.gdc.typeinfo.ti_short; 5 | 6 | class TypeInfo_s : TypeInfo 7 | { 8 | override char[] toString() { return "short"; } 9 | 10 | override hash_t getHash(in void* p) 11 | { 12 | return cast(hash_t)(*cast(ushort *)p); 13 | } 14 | 15 | override equals_t equals(in void* p1, in void* p2) 16 | { 17 | return *cast(short *)p1 == *cast(short *)p2; 18 | } 19 | 20 | override int compare(in void* p1, in void* p2) 21 | { 22 | return *cast(short *)p1 - *cast(short *)p2; 23 | } 24 | 25 | override size_t talign() 26 | { 27 | return short.alignof; 28 | } 29 | 30 | override size_t tsize() 31 | { 32 | return short.sizeof; 33 | } 34 | 35 | override void swap(void *p1, void *p2) 36 | { 37 | short t; 38 | 39 | t = *cast(short *)p1; 40 | *cast(short *)p1 = *cast(short *)p2; 41 | *cast(short *)p2 = t; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/gdc/typeinfo/ti_ubyte.d: -------------------------------------------------------------------------------- 1 | 2 | // ubyte 3 | 4 | module rt.compiler.gdc.typeinfo.ti_ubyte; 5 | 6 | class TypeInfo_h : TypeInfo 7 | { 8 | override char[] toString() { return "ubyte"; } 9 | 10 | override hash_t getHash(in void* p) 11 | { 12 | return cast(hash_t)(*cast(ubyte *)p); 13 | } 14 | 15 | override equals_t equals(in void* p1, in void* p2) 16 | { 17 | return *cast(ubyte *)p1 == *cast(ubyte *)p2; 18 | } 19 | 20 | override int compare(in void* p1, in void* p2) 21 | { 22 | return *cast(ubyte *)p1 - *cast(ubyte *)p2; 23 | } 24 | 25 | override size_t talign() 26 | { 27 | return ubyte.alignof; 28 | } 29 | 30 | override size_t tsize() 31 | { 32 | return ubyte.sizeof; 33 | } 34 | 35 | override void swap(void *p1, void *p2) 36 | { 37 | ubyte t; 38 | 39 | t = *cast(ubyte *)p1; 40 | *cast(ubyte *)p1 = *cast(ubyte *)p2; 41 | *cast(ubyte *)p2 = t; 42 | } 43 | } 44 | 45 | class TypeInfo_b : TypeInfo_h 46 | { 47 | override char[] toString() { return "bool"; } 48 | } 49 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/gdc/typeinfo/ti_uint.d: -------------------------------------------------------------------------------- 1 | 2 | // uint 3 | 4 | module rt.compiler.gdc.typeinfo.ti_uint; 5 | 6 | class TypeInfo_k : TypeInfo 7 | { 8 | override char[] toString() { return "uint"; } 9 | 10 | override hash_t getHash(in void* p) 11 | { 12 | return *cast(uint *)p; 13 | } 14 | 15 | override equals_t equals(in void* p1, in void* p2) 16 | { 17 | return *cast(uint *)p1 == *cast(uint *)p2; 18 | } 19 | 20 | override int compare(in void* p1, in void* p2) 21 | { 22 | if (*cast(uint*) p1 < *cast(uint*) p2) 23 | return -1; 24 | else if (*cast(uint*) p1 > *cast(uint*) p2) 25 | return 1; 26 | return 0; 27 | } 28 | 29 | override size_t talign() 30 | { 31 | return uint.alignof; 32 | } 33 | 34 | override size_t tsize() 35 | { 36 | return uint.sizeof; 37 | } 38 | 39 | override void swap(void *p1, void *p2) 40 | { 41 | int t; 42 | 43 | t = *cast(uint *)p1; 44 | *cast(uint *)p1 = *cast(uint *)p2; 45 | *cast(uint *)p2 = t; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/gdc/typeinfo/ti_ulong.d: -------------------------------------------------------------------------------- 1 | 2 | // ulong 3 | 4 | module rt.compiler.gdc.typeinfo.ti_ulong; 5 | private import rt.compiler.util.hash; 6 | 7 | class TypeInfo_m : TypeInfo 8 | { 9 | override char[] toString() { return "ulong"; } 10 | 11 | override hash_t getHash(in void* p) 12 | { 13 | static if(hash_t.sizeof==8){ 14 | return cast(hash_t)(*cast(ulong *)p); 15 | } else { 16 | return rt_hash_combine(*cast(uint *)p,(cast(uint *)p)[1]); 17 | } 18 | } 19 | 20 | override equals_t equals(in void* p1, in void* p2) 21 | { 22 | return *cast(ulong *)p1 == *cast(ulong *)p2; 23 | } 24 | 25 | override int compare(in void* p1, in void* p2) 26 | { 27 | if (*cast(ulong *)p1 < *cast(ulong *)p2) 28 | return -1; 29 | else if (*cast(ulong *)p1 > *cast(ulong *)p2) 30 | return 1; 31 | return 0; 32 | } 33 | 34 | override size_t talign() 35 | { 36 | return ulong.alignof; 37 | } 38 | 39 | override size_t tsize() 40 | { 41 | return ulong.sizeof; 42 | } 43 | 44 | override void swap(void *p1, void *p2) 45 | { 46 | ulong t; 47 | 48 | t = *cast(ulong *)p1; 49 | *cast(ulong *)p1 = *cast(ulong *)p2; 50 | *cast(ulong *)p2 = t; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/gdc/typeinfo/ti_ushort.d: -------------------------------------------------------------------------------- 1 | 2 | // ushort 3 | 4 | module rt.compiler.gdc.typeinfo.ti_ushort; 5 | 6 | class TypeInfo_t : TypeInfo 7 | { 8 | override char[] toString() { return "ushort"; } 9 | 10 | override hash_t getHash(in void* p) 11 | { 12 | return *cast(ushort *)p; 13 | } 14 | 15 | override equals_t equals(in void* p1, in void* p2) 16 | { 17 | return *cast(ushort *)p1 == *cast(ushort *)p2; 18 | } 19 | 20 | override int compare(in void* p1, in void* p2) 21 | { 22 | return *cast(ushort *)p1 - *cast(ushort *)p2; 23 | } 24 | 25 | override size_t talign() 26 | { 27 | return ushort.alignof; 28 | } 29 | 30 | override size_t tsize() 31 | { 32 | return ushort.sizeof; 33 | } 34 | 35 | override void swap(void *p1, void *p2) 36 | { 37 | ushort t; 38 | 39 | t = *cast(ushort *)p1; 40 | *cast(ushort *)p1 = *cast(ushort *)p2; 41 | *cast(ushort *)p2 = t; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/gdc/typeinfo/ti_void.d: -------------------------------------------------------------------------------- 1 | 2 | // void 3 | 4 | module rt.compiler.gdc.typeinfo.ti_void; 5 | 6 | class TypeInfo_v : TypeInfo 7 | { 8 | override char[] toString() { return "void"; } 9 | 10 | override hash_t getHash(in void* p) 11 | { 12 | assert(0); 13 | } 14 | 15 | override equals_t equals(in void* p1, in void* p2) 16 | { 17 | return *cast(byte *)p1 == *cast(byte *)p2; 18 | } 19 | 20 | override int compare(in void* p1, in void* p2) 21 | { 22 | return *cast(byte *)p1 - *cast(byte *)p2; 23 | } 24 | 25 | override size_t talign() 26 | { 27 | return void.alignof; 28 | } 29 | 30 | override size_t tsize() 31 | { 32 | return void.sizeof; 33 | } 34 | 35 | override void swap(void *p1, void *p2) 36 | { 37 | byte t; 38 | 39 | t = *cast(byte *)p1; 40 | *cast(byte *)p1 = *cast(byte *)p2; 41 | *cast(byte *)p2 = t; 42 | } 43 | 44 | override uint flags() 45 | { 46 | return 1; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/gdc/typeinfo/ti_wchar.d: -------------------------------------------------------------------------------- 1 | 2 | module rt.compiler.gdc.typeinfo.ti_wchar; 3 | 4 | 5 | class TypeInfo_u : TypeInfo 6 | { 7 | override char[] toString() { return "wchar"; } 8 | 9 | override hash_t getHash(in void* p) 10 | { 11 | return cast(hash_t)(*cast(wchar *)p); 12 | } 13 | 14 | override equals_t equals(in void* p1, in void* p2) 15 | { 16 | return *cast(wchar *)p1 == *cast(wchar *)p2; 17 | } 18 | 19 | override int compare(in void* p1, in void* p2) 20 | { 21 | return *cast(wchar *)p1 - *cast(wchar *)p2; 22 | } 23 | 24 | override size_t talign() 25 | { 26 | return wchar.alignof; 27 | } 28 | 29 | override size_t tsize() 30 | { 31 | return wchar.sizeof; 32 | } 33 | 34 | override void swap(void *p1, void *p2) 35 | { 36 | wchar t; 37 | 38 | t = *cast(wchar *)p1; 39 | *cast(wchar *)p1 = *cast(wchar *)p2; 40 | *cast(wchar *)p2 = t; 41 | } 42 | 43 | override void[] init() 44 | { static wchar c; 45 | 46 | return (cast(wchar *)&c)[0 .. 1]; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/ldc/OBJDEFS.inc: -------------------------------------------------------------------------------- 1 | COMPILER_MODULES_L= \ 2 | ldc.vararg \ 3 | ldc.bitmanip \ 4 | rt.adi \ 5 | rt.lifetime \ 6 | rt.switch_ \ 7 | rt.arrayInit \ 8 | rt.memory \ 9 | rt.aApplyR \ 10 | rt.aaA \ 11 | rt.aApply \ 12 | rt.cast_ \ 13 | rt.invariant_ \ 14 | rt.qsort2 \ 15 | rt.eh \ 16 | rt.dmain2 \ 17 | rt.cInterface \ 18 | object \ 19 | 20 | #end 21 | COMPILER_OO_L= \ 22 | critical.o \ 23 | monitor.o \ 24 | cConst.o 25 | 26 | COMPILER_DI_L= \ 27 | rt/cInterface.di \ 28 | ldc/bitmanip.di \ 29 | ldc/cstdarg.di \ 30 | ldc/intrinsics.di \ 31 | ldc/llvmasm.di \ 32 | ldc/vararg.di 33 | 34 | COMPILER_MODULES=$(COMPILER_MODULES_L) $(COMPILER_MODULES_S) 35 | COMPILER_OO=$(COMPILER_OO_L) $(COMPILER_OO_S) 36 | COMPILER_DI=$(COMPILER_DI_L) $(COMPILER_DI_S) 37 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/ldc/cConst.c: -------------------------------------------------------------------------------- 1 | // utility that expose some C consts to D 2 | 3 | #ifndef _WIN32 4 | #include 5 | 6 | // this is needed only by rt.cover 7 | int fcntl_O_RDONLY(){ 8 | return O_RDONLY; 9 | } 10 | #endif 11 | 12 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/ldc/rt/invariant_.d: -------------------------------------------------------------------------------- 1 | /* 2 | * Placed into the Public Domain 3 | * written by Walter Bright 4 | * www.digitalmars.com 5 | */ 6 | module rt.invariant_; 7 | 8 | extern(C) void _d_invariant(Object o) 9 | { ClassInfo c; 10 | 11 | //printf("__d_invariant(%p)\n", o); 12 | 13 | // BUG: needs to be filename/line of caller, not library routine 14 | assert(o !is null); // just do null check, not invariant check 15 | 16 | c = o.classinfo; 17 | do 18 | { 19 | if (c.classInvariant !is null) 20 | { 21 | void delegate() inv; 22 | inv.ptr = cast(void*) o; 23 | inv.funcptr = cast(void function()) c.classInvariant; 24 | inv(); 25 | } 26 | c = c.base; 27 | } while (c); 28 | } 29 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/ldc/rt/qsort2.d: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Placed into Public Domain 4 | * written by Walter Bright 5 | * www.digitalmars.com 6 | * 7 | * This is a public domain version of qsort.d. 8 | * All it does is call C's qsort(), but runs a little slower since 9 | * it needs to synchronize a global variable. 10 | */ 11 | 12 | /* 13 | * Modified by Sean Kelly for use with Tango. 14 | */ 15 | module rt.qsort2; 16 | 17 | //debug=qsort; 18 | 19 | private import tango.stdc.stdlib : qsort; 20 | 21 | private TypeInfo tiglobal; 22 | 23 | extern (C) int cmp(void* p1, void* p2) 24 | { 25 | return tiglobal.compare(p1, p2); 26 | } 27 | 28 | extern (C) void[] _adSort(void[] a, TypeInfo ti) 29 | { 30 | synchronized 31 | { 32 | tiglobal = ti; 33 | qsort(a.ptr, a.length, cast(size_t)ti.tsize(), &cmp); 34 | } 35 | return a; 36 | } 37 | 38 | 39 | 40 | unittest 41 | { 42 | debug(qsort) printf("array.sort.unittest()\n"); 43 | 44 | int a[] = new int[10]; 45 | 46 | a[0] = 23; 47 | a[1] = 1; 48 | a[2] = 64; 49 | a[3] = 5; 50 | a[4] = 6; 51 | a[5] = 5; 52 | a[6] = 17; 53 | a[7] = 3; 54 | a[8] = 0; 55 | a[9] = -1; 56 | 57 | a.sort; 58 | 59 | for (int i = 0; i < a.length - 1; i++) 60 | { 61 | //printf("i = %d", i); 62 | //printf(" %d %d\n", a[i], a[i + 1]); 63 | assert(a[i] <= a[i + 1]); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/ldc/typeinfo/ti_byte.d: -------------------------------------------------------------------------------- 1 | 2 | // byte 3 | 4 | module rt.compiler.ldc.typeinfo.ti_byte; 5 | 6 | class TypeInfo_g : TypeInfo 7 | { 8 | override char[] toString() { return "byte"; } 9 | 10 | override hash_t getHash(in void* p) 11 | { 12 | return cast(hash_t)(*cast(byte *)p); 13 | } 14 | 15 | override equals_t equals(in void* p1, in void* p2) 16 | { 17 | return *cast(byte *)p1 == *cast(byte *)p2; 18 | } 19 | 20 | override int compare(in void* p1, in void* p2) 21 | { 22 | return *cast(byte *)p1 - *cast(byte *)p2; 23 | } 24 | 25 | override size_t talign() 26 | { 27 | return byte.alignof; 28 | } 29 | 30 | override size_t tsize() 31 | { 32 | return byte.sizeof; 33 | } 34 | 35 | override void swap(void *p1, void *p2) 36 | { 37 | byte t; 38 | 39 | t = *cast(byte *)p1; 40 | *cast(byte *)p1 = *cast(byte *)p2; 41 | *cast(byte *)p2 = t; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/ldc/typeinfo/ti_char.d: -------------------------------------------------------------------------------- 1 | 2 | module rt.compiler.ldc.typeinfo.ti_char; 3 | 4 | class TypeInfo_a : TypeInfo 5 | { 6 | override char[] toString() { return "char"; } 7 | 8 | override hash_t getHash(in void* p) 9 | { 10 | return cast(hash_t)(*cast(char *)p); 11 | } 12 | 13 | override equals_t equals(in void* p1, in void* p2) 14 | { 15 | return *cast(char *)p1 == *cast(char *)p2; 16 | } 17 | 18 | override int compare(in void* p1, in void* p2) 19 | { 20 | return *cast(char *)p1 - *cast(char *)p2; 21 | } 22 | 23 | override size_t talign() 24 | { 25 | return char.alignof; 26 | } 27 | 28 | override size_t tsize() 29 | { 30 | return char.sizeof; 31 | } 32 | 33 | override void swap(void *p1, void *p2) 34 | { 35 | char t; 36 | 37 | t = *cast(char *)p1; 38 | *cast(char *)p1 = *cast(char *)p2; 39 | *cast(char *)p2 = t; 40 | } 41 | 42 | override void[] init() 43 | { static char c; 44 | 45 | return (cast(char *)&c)[0 .. 1]; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/ldc/typeinfo/ti_dchar.d: -------------------------------------------------------------------------------- 1 | 2 | // dchar 3 | 4 | module rt.compiler.ldc.typeinfo.ti_dchar; 5 | 6 | class TypeInfo_w : TypeInfo 7 | { 8 | override char[] toString() { return "dchar"; } 9 | 10 | override hash_t getHash(in void* p) 11 | { 12 | return cast(hash_t)*cast(dchar *)p; 13 | } 14 | 15 | override equals_t equals(in void* p1, in void* p2) 16 | { 17 | return *cast(dchar *)p1 == *cast(dchar *)p2; 18 | } 19 | 20 | override int compare(in void* p1, in void* p2) 21 | { 22 | return *cast(dchar *)p1 - *cast(dchar *)p2; 23 | } 24 | 25 | override size_t talign() 26 | { 27 | return dchar.alignof; 28 | } 29 | 30 | override size_t tsize() 31 | { 32 | return dchar.sizeof; 33 | } 34 | 35 | override void swap(void *p1, void *p2) 36 | { 37 | dchar t; 38 | 39 | t = *cast(dchar *)p1; 40 | *cast(dchar *)p1 = *cast(dchar *)p2; 41 | *cast(dchar *)p2 = t; 42 | } 43 | 44 | override void[] init() 45 | { static dchar c; 46 | 47 | return (cast(dchar *)&c)[0 .. 1]; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/ldc/typeinfo/ti_delegate.d: -------------------------------------------------------------------------------- 1 | 2 | // delegate 3 | 4 | module rt.compiler.ldc.typeinfo.ti_delegate; 5 | private import rt.compiler.util.hash; 6 | 7 | alias void delegate(int) dg; 8 | 9 | class TypeInfo_D : TypeInfo 10 | { 11 | override hash_t getHash(in void* p) 12 | { 13 | return rt_hash_block(cast(size_t *)p,2,0); 14 | } 15 | 16 | override equals_t equals(in void* p1, in void* p2) 17 | { 18 | return *cast(dg *)p1 == *cast(dg *)p2; 19 | } 20 | 21 | override size_t talign() 22 | { 23 | return dg.alignof; 24 | } 25 | 26 | override size_t tsize() 27 | { 28 | return dg.sizeof; 29 | } 30 | 31 | override void swap(void *p1, void *p2) 32 | { 33 | dg t; 34 | 35 | t = *cast(dg *)p1; 36 | *cast(dg *)p1 = *cast(dg *)p2; 37 | *cast(dg *)p2 = t; 38 | } 39 | 40 | override uint flags() 41 | { 42 | return 1; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/ldc/typeinfo/ti_idouble.d: -------------------------------------------------------------------------------- 1 | 2 | // idouble 3 | 4 | module rt.compiler.ldc.typeinfo.ti_idouble; 5 | 6 | private import rt.compiler.ldc.typeinfo.ti_double; 7 | 8 | class TypeInfo_p : TypeInfo_d 9 | { 10 | override char[] toString() { return "idouble"; } 11 | } 12 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/ldc/typeinfo/ti_ifloat.d: -------------------------------------------------------------------------------- 1 | 2 | // ifloat 3 | 4 | module rt.compiler.ldc.typeinfo.ti_ifloat; 5 | 6 | private import rt.compiler.ldc.typeinfo.ti_float; 7 | 8 | class TypeInfo_o : TypeInfo_f 9 | { 10 | override char[] toString() { return "ifloat"; } 11 | } 12 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/ldc/typeinfo/ti_int.d: -------------------------------------------------------------------------------- 1 | 2 | // int 3 | 4 | module rt.compiler.ldc.typeinfo.ti_int; 5 | 6 | class TypeInfo_i : TypeInfo 7 | { 8 | override char[] toString() { return "int"; } 9 | 10 | override hash_t getHash(in void* p) 11 | { 12 | return cast(hash_t)(*cast(uint *)p); 13 | } 14 | 15 | override equals_t equals(in void* p1, in void* p2) 16 | { 17 | return *cast(uint *)p1 == *cast(uint *)p2; 18 | } 19 | 20 | override int compare(in void* p1, in void* p2) 21 | { 22 | if (*cast(int*) p1 < *cast(int*) p2) 23 | return -1; 24 | else if (*cast(int*) p1 > *cast(int*) p2) 25 | return 1; 26 | return 0; 27 | } 28 | 29 | override size_t talign() 30 | { 31 | return int.alignof; 32 | } 33 | 34 | override size_t tsize() 35 | { 36 | return int.sizeof; 37 | } 38 | 39 | override void swap(void *p1, void *p2) 40 | { 41 | int t; 42 | 43 | t = *cast(int *)p1; 44 | *cast(int *)p1 = *cast(int *)p2; 45 | *cast(int *)p2 = t; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/ldc/typeinfo/ti_ireal.d: -------------------------------------------------------------------------------- 1 | 2 | // ireal 3 | 4 | module rt.compiler.ldc.typeinfo.ti_ireal; 5 | 6 | private import rt.compiler.ldc.typeinfo.ti_real; 7 | 8 | class TypeInfo_j : TypeInfo_e 9 | { 10 | override char[] toString() { return "ireal"; } 11 | } 12 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/ldc/typeinfo/ti_long.d: -------------------------------------------------------------------------------- 1 | 2 | // long 3 | 4 | module rt.compiler.ldc.typeinfo.ti_long; 5 | private import rt.compiler.util.hash; 6 | 7 | class TypeInfo_l : TypeInfo 8 | { 9 | override char[] toString() { return "long"; } 10 | 11 | override hash_t getHash(in void* p) 12 | { 13 | static if(hash_t.sizeof==8){ 14 | return cast(hash_t)(*cast(ulong *)p); 15 | } else { 16 | return rt_hash_combine(*cast(uint *)p,(cast(uint *)p)[1]); 17 | } 18 | } 19 | 20 | override equals_t equals(in void* p1, in void* p2) 21 | { 22 | return *cast(long *)p1 == *cast(long *)p2; 23 | } 24 | 25 | override int compare(in void* p1, in void* p2) 26 | { 27 | if (*cast(long *)p1 < *cast(long *)p2) 28 | return -1; 29 | else if (*cast(long *)p1 > *cast(long *)p2) 30 | return 1; 31 | return 0; 32 | } 33 | 34 | override size_t talign() 35 | { 36 | return long.alignof; 37 | } 38 | 39 | override size_t tsize() 40 | { 41 | return long.sizeof; 42 | } 43 | 44 | override void swap(void *p1, void *p2) 45 | { 46 | long t; 47 | 48 | t = *cast(long *)p1; 49 | *cast(long *)p1 = *cast(long *)p2; 50 | *cast(long *)p2 = t; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/ldc/typeinfo/ti_ptr.d: -------------------------------------------------------------------------------- 1 | 2 | // pointer 3 | 4 | module rt.compiler.ldc.typeinfo.ti_ptr; 5 | 6 | class TypeInfo_P : TypeInfo 7 | { 8 | override hash_t getHash(in void* p) 9 | { 10 | return cast(hash_t)(*cast(size_t *)p); 11 | } 12 | 13 | override equals_t equals(in void* p1, in void* p2) 14 | { 15 | return *cast(void* *)p1 == *cast(void* *)p2; 16 | } 17 | 18 | override int compare(in void* p1, in void* p2) 19 | { 20 | auto c = *cast(void* *)p1 - *cast(void* *)p2; 21 | if (c < 0) 22 | return -1; 23 | else if (c > 0) 24 | return 1; 25 | return 0; 26 | } 27 | 28 | override size_t talign() 29 | { 30 | return (void*).alignof; 31 | } 32 | 33 | override size_t tsize() 34 | { 35 | return (void*).sizeof; 36 | } 37 | 38 | override void swap(void *p1, void *p2) 39 | { 40 | void* t; 41 | 42 | t = *cast(void* *)p1; 43 | *cast(void* *)p1 = *cast(void* *)p2; 44 | *cast(void* *)p2 = t; 45 | } 46 | 47 | override uint flags() 48 | { 49 | return 1; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/ldc/typeinfo/ti_short.d: -------------------------------------------------------------------------------- 1 | 2 | // short 3 | 4 | module rt.compiler.ldc.typeinfo.ti_short; 5 | 6 | class TypeInfo_s : TypeInfo 7 | { 8 | override char[] toString() { return "short"; } 9 | 10 | override hash_t getHash(in void* p) 11 | { 12 | return cast(hash_t)(*cast(ushort *)p); 13 | } 14 | 15 | override equals_t equals(in void* p1, in void* p2) 16 | { 17 | return *cast(short *)p1 == *cast(short *)p2; 18 | } 19 | 20 | override int compare(in void* p1, in void* p2) 21 | { 22 | return *cast(short *)p1 - *cast(short *)p2; 23 | } 24 | 25 | override size_t talign() 26 | { 27 | return short.alignof; 28 | } 29 | 30 | override size_t tsize() 31 | { 32 | return short.sizeof; 33 | } 34 | 35 | override void swap(void *p1, void *p2) 36 | { 37 | short t; 38 | 39 | t = *cast(short *)p1; 40 | *cast(short *)p1 = *cast(short *)p2; 41 | *cast(short *)p2 = t; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/ldc/typeinfo/ti_ubyte.d: -------------------------------------------------------------------------------- 1 | 2 | // ubyte 3 | 4 | module rt.compiler.ldc.typeinfo.ti_ubyte; 5 | 6 | class TypeInfo_h : TypeInfo 7 | { 8 | override char[] toString() { return "ubyte"; } 9 | 10 | override hash_t getHash(in void* p) 11 | { 12 | return cast(hash_t)(*cast(ubyte *)p); 13 | } 14 | 15 | override equals_t equals(in void* p1, in void* p2) 16 | { 17 | return *cast(ubyte *)p1 == *cast(ubyte *)p2; 18 | } 19 | 20 | override int compare(in void* p1, in void* p2) 21 | { 22 | return *cast(ubyte *)p1 - *cast(ubyte *)p2; 23 | } 24 | 25 | override size_t talign() 26 | { 27 | return ubyte.alignof; 28 | } 29 | 30 | override size_t tsize() 31 | { 32 | return ubyte.sizeof; 33 | } 34 | 35 | override void swap(void *p1, void *p2) 36 | { 37 | ubyte t; 38 | 39 | t = *cast(ubyte *)p1; 40 | *cast(ubyte *)p1 = *cast(ubyte *)p2; 41 | *cast(ubyte *)p2 = t; 42 | } 43 | } 44 | 45 | class TypeInfo_b : TypeInfo_h 46 | { 47 | override char[] toString() { return "bool"; } 48 | } 49 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/ldc/typeinfo/ti_uint.d: -------------------------------------------------------------------------------- 1 | 2 | // uint 3 | 4 | module rt.compiler.ldc.typeinfo.ti_uint; 5 | 6 | class TypeInfo_k : TypeInfo 7 | { 8 | override char[] toString() { return "uint"; } 9 | 10 | override hash_t getHash(in void* p) 11 | { 12 | return *cast(uint *)p; 13 | } 14 | 15 | override equals_t equals(in void* p1, in void* p2) 16 | { 17 | return *cast(uint *)p1 == *cast(uint *)p2; 18 | } 19 | 20 | override int compare(in void* p1, in void* p2) 21 | { 22 | if (*cast(uint*) p1 < *cast(uint*) p2) 23 | return -1; 24 | else if (*cast(uint*) p1 > *cast(uint*) p2) 25 | return 1; 26 | return 0; 27 | } 28 | 29 | override size_t talign() 30 | { 31 | return uint.alignof; 32 | } 33 | 34 | override size_t tsize() 35 | { 36 | return uint.sizeof; 37 | } 38 | 39 | override void swap(void *p1, void *p2) 40 | { 41 | int t; 42 | 43 | t = *cast(uint *)p1; 44 | *cast(uint *)p1 = *cast(uint *)p2; 45 | *cast(uint *)p2 = t; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/ldc/typeinfo/ti_ulong.d: -------------------------------------------------------------------------------- 1 | 2 | // ulong 3 | 4 | module rt.compiler.ldc.typeinfo.ti_ulong; 5 | private import rt.compiler.util.hash; 6 | 7 | class TypeInfo_m : TypeInfo 8 | { 9 | override char[] toString() { return "ulong"; } 10 | 11 | override hash_t getHash(in void* p) 12 | { 13 | static if(hash_t.sizeof==8){ 14 | return cast(hash_t)(*cast(ulong *)p); 15 | } else { 16 | return rt_hash_combine(*cast(uint *)p,(cast(uint *)p)[1]); 17 | } 18 | } 19 | 20 | override equals_t equals(in void* p1, in void* p2) 21 | { 22 | return *cast(ulong *)p1 == *cast(ulong *)p2; 23 | } 24 | 25 | override int compare(in void* p1, in void* p2) 26 | { 27 | if (*cast(ulong *)p1 < *cast(ulong *)p2) 28 | return -1; 29 | else if (*cast(ulong *)p1 > *cast(ulong *)p2) 30 | return 1; 31 | return 0; 32 | } 33 | 34 | override size_t talign() 35 | { 36 | return ulong.alignof; 37 | } 38 | 39 | override size_t tsize() 40 | { 41 | return ulong.sizeof; 42 | } 43 | 44 | override void swap(void *p1, void *p2) 45 | { 46 | ulong t; 47 | 48 | t = *cast(ulong *)p1; 49 | *cast(ulong *)p1 = *cast(ulong *)p2; 50 | *cast(ulong *)p2 = t; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/ldc/typeinfo/ti_ushort.d: -------------------------------------------------------------------------------- 1 | 2 | // ushort 3 | 4 | module rt.compiler.ldc.typeinfo.ti_ushort; 5 | 6 | class TypeInfo_t : TypeInfo 7 | { 8 | override char[] toString() { return "ushort"; } 9 | 10 | override hash_t getHash(in void* p) 11 | { 12 | return *cast(ushort *)p; 13 | } 14 | 15 | override equals_t equals(in void* p1, in void* p2) 16 | { 17 | return *cast(ushort *)p1 == *cast(ushort *)p2; 18 | } 19 | 20 | override int compare(in void* p1, in void* p2) 21 | { 22 | return *cast(ushort *)p1 - *cast(ushort *)p2; 23 | } 24 | 25 | override size_t talign() 26 | { 27 | return ushort.alignof; 28 | } 29 | 30 | override size_t tsize() 31 | { 32 | return ushort.sizeof; 33 | } 34 | 35 | override void swap(void *p1, void *p2) 36 | { 37 | ushort t; 38 | 39 | t = *cast(ushort *)p1; 40 | *cast(ushort *)p1 = *cast(ushort *)p2; 41 | *cast(ushort *)p2 = t; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/ldc/typeinfo/ti_void.d: -------------------------------------------------------------------------------- 1 | 2 | // void 3 | 4 | module rt.compiler.ldc.typeinfo.ti_void; 5 | 6 | class TypeInfo_v : TypeInfo 7 | { 8 | override char[] toString() { return "void"; } 9 | 10 | override hash_t getHash(in void* p) 11 | { 12 | assert(0); 13 | } 14 | 15 | override equals_t equals(in void* p1, in void* p2) 16 | { 17 | return *cast(byte *)p1 == *cast(byte *)p2; 18 | } 19 | 20 | override int compare(in void* p1, in void* p2) 21 | { 22 | return *cast(byte *)p1 - *cast(byte *)p2; 23 | } 24 | 25 | override size_t talign() 26 | { 27 | return void.alignof; 28 | } 29 | 30 | override size_t tsize() 31 | { 32 | return void.sizeof; 33 | } 34 | 35 | override void swap(void *p1, void *p2) 36 | { 37 | byte t; 38 | 39 | t = *cast(byte *)p1; 40 | *cast(byte *)p1 = *cast(byte *)p2; 41 | *cast(byte *)p2 = t; 42 | } 43 | 44 | override uint flags() 45 | { 46 | return 1; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/ldc/typeinfo/ti_wchar.d: -------------------------------------------------------------------------------- 1 | 2 | module rt.compiler.ldc.typeinfo.ti_wchar; 3 | 4 | 5 | class TypeInfo_u : TypeInfo 6 | { 7 | override char[] toString() { return "wchar"; } 8 | 9 | override hash_t getHash(in void* p) 10 | { 11 | return cast(hash_t)(*cast(wchar *)p); 12 | } 13 | 14 | override equals_t equals(in void* p1, in void* p2) 15 | { 16 | return *cast(wchar *)p1 == *cast(wchar *)p2; 17 | } 18 | 19 | override int compare(in void* p1, in void* p2) 20 | { 21 | return *cast(wchar *)p1 - *cast(wchar *)p2; 22 | } 23 | 24 | override size_t talign() 25 | { 26 | return wchar.alignof; 27 | } 28 | 29 | override size_t tsize() 30 | { 31 | return wchar.sizeof; 32 | } 33 | 34 | override void swap(void *p1, void *p2) 35 | { 36 | wchar t; 37 | 38 | t = *cast(wchar *)p1; 39 | *cast(wchar *)p1 = *cast(wchar *)p2; 40 | *cast(wchar *)p2 = t; 41 | } 42 | 43 | override void[] init() 44 | { static wchar c; 45 | 46 | return (cast(wchar *)&c)[0 .. 1]; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/util/OBJDEFS.inc: -------------------------------------------------------------------------------- 1 | COMMON_OO= \ 2 | wrap.$(COBJ_EXT) 3 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/util/deh.d: -------------------------------------------------------------------------------- 1 | 2 | module rt.compiler.util.deh; 3 | 4 | private extern (C) void* gc_calloc(size_t sz, uint ba, PointerMap pm); 5 | 6 | extern (C) void* gc_calloc_noscan(size_t sz) 7 | { 8 | return gc_calloc(sz, 2 /* NO_SCAN */, PointerMap.init); 9 | } 10 | 11 | -------------------------------------------------------------------------------- /unported/tango/core/rt/compiler/util/wrap.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | 4 | int getErrno() 5 | { 6 | return errno; 7 | } 8 | 9 | 10 | int setErrno( int val ) 11 | { 12 | errno = val; 13 | return val; 14 | } 15 | -------------------------------------------------------------------------------- /unported/tango/core/rt/gc/basic/OBJDEFS.inc: -------------------------------------------------------------------------------- 1 | # files to compile for the gc 2 | GC_MODULES = rt.basicgc.gc rt.basicgc.gcalloc rt.basicgc.gcbits rt.basicgc.gcstats rt.basicgc.gcx 3 | 4 | vpath %d gc/basic 5 | 6 | -------------------------------------------------------------------------------- /unported/tango/core/rt/gc/basic/gcstats.d: -------------------------------------------------------------------------------- 1 | /** 2 | * This module contains garbage collector statistics functionality. 3 | * 4 | * Copyright: Copyright (C) 2005-2006 Digital Mars, www.digitalmars.com. 5 | * All rights reserved. 6 | * License: 7 | * This software is provided 'as-is', without any express or implied 8 | * warranty. In no event will the authors be held liable for any damages 9 | * arising from the use of this software. 10 | * 11 | * Permission is granted to anyone to use this software for any purpose, 12 | * including commercial applications, and to alter it and redistribute it 13 | * freely, in both source and binary form, subject to the following 14 | * restrictions: 15 | * 16 | * o The origin of this software must not be misrepresented; you must not 17 | * claim that you wrote the original software. If you use this software 18 | * in a product, an acknowledgment in the product documentation would be 19 | * appreciated but is not required. 20 | * o Altered source versions must be plainly marked as such, and must not 21 | * be misrepresented as being the original software. 22 | * o This notice may not be removed or altered from any source 23 | * distribution. 24 | * Authors: Walter Bright, Sean Kelly 25 | */ 26 | module rt.gc.basic.gcstats; 27 | 28 | /** 29 | * 30 | */ 31 | struct GCStats 32 | { 33 | size_t poolsize; // total size of pool 34 | size_t usedsize; // bytes allocated 35 | size_t freeblocks; // number of blocks marked FREE 36 | size_t freelistsize; // total of memory on free lists 37 | size_t pageblocks; // number of blocks marked PAGE 38 | } 39 | -------------------------------------------------------------------------------- /unported/tango/core/vendor/gdc/c/stdarg.di: -------------------------------------------------------------------------------- 1 | /** 2 | * These functions are built-in intrinsics to the compiler. 3 | * 4 | * Note that this module is only present in Tango because the module name is 5 | * hardcoded into GDC, see http://d.puremagic.com/issues/show_bug.cgi?id=1949 6 | * 7 | * Copyright: Public Domain 8 | * License: Public Domain 9 | * Authors: David Friedman 10 | */ 11 | module std.c.stdarg; 12 | 13 | version( GNU ) 14 | { 15 | private import gcc.builtins; 16 | alias __builtin_va_list va_list; 17 | alias __builtin_va_end va_end; 18 | alias __builtin_va_copy va_copy; 19 | } 20 | 21 | template va_start(T) 22 | { 23 | void va_start( out va_list ap, ref T parmn ) 24 | { 25 | 26 | } 27 | } 28 | 29 | template va_arg(T) 30 | { 31 | T va_arg( ref va_list ap ) 32 | { 33 | return T.init; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /unported/tango/core/vendor/gdc/stdarg.di: -------------------------------------------------------------------------------- 1 | /** 2 | * These functions are built-in intrinsics to the compiler. 3 | * 4 | * Note that this module is only present in Tango because the module name is 5 | * hardcoded into GDC, see http://d.puremagic.com/issues/show_bug.cgi?id=1949 6 | * To correctly use this functionality in Tango, import tango.core.Vararg. 7 | * 8 | * Copyright: Public Domain 9 | * License: Public Domain 10 | * Authors: David Friedman 11 | */ 12 | module std.stdarg; 13 | 14 | version( GNU ) 15 | { 16 | private import gcc.builtins; 17 | alias __builtin_va_list va_list; 18 | alias __builtin_va_end va_end; 19 | alias __builtin_va_copy va_copy; 20 | } 21 | 22 | template va_start(T) 23 | { 24 | void va_start( out va_list ap, ref T parmn ) 25 | { 26 | 27 | } 28 | } 29 | 30 | template va_arg(T) 31 | { 32 | T va_arg( ref va_list ap ) 33 | { 34 | return T.init; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /unported/tango/core/vendor/ldc/cstdarg.di: -------------------------------------------------------------------------------- 1 | /* 2 | * vararg support for extern(C) functions 3 | */ 4 | 5 | module ldc.cstdarg; 6 | 7 | // Check for the right compiler 8 | version(LDC) 9 | { 10 | // OK 11 | } 12 | else 13 | { 14 | static assert(false, "This module is only valid for LDC"); 15 | } 16 | 17 | alias void* va_list; 18 | 19 | pragma(va_start) 20 | void va_start(T)(va_list ap, ref T); 21 | 22 | pragma(va_arg) 23 | T va_arg(T)(va_list ap); 24 | 25 | pragma(va_end) 26 | void va_end(va_list args); 27 | 28 | pragma(va_copy) 29 | void va_copy(va_list dst, va_list src); 30 | -------------------------------------------------------------------------------- /unported/tango/core/vendor/ldc/llvmasm.di: -------------------------------------------------------------------------------- 1 | module ldc.llvmasm; 2 | 3 | struct __asmtuple_t(T...) 4 | { 5 | T v; 6 | } 7 | 8 | pragma(llvm_inline_asm) 9 | { 10 | void __asm( )(char[] asmcode, char[] constraints, ...); 11 | T __asm(T)(char[] asmcode, char[] constraints, ...); 12 | 13 | template __asmtuple(T...) 14 | { 15 | __asmtuple_t!(T) __asmtuple(char[] asmcode, char[] constraints, ...); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /unported/tango/core/vendor/ldc/vararg.d: -------------------------------------------------------------------------------- 1 | /* 2 | * This module holds the implementation of special vararg templates for D style var args. 3 | * 4 | * Provides the functions tango.core.Vararg expects to be present! 5 | */ 6 | 7 | module ldc.vararg; 8 | 9 | // Check for the right compiler 10 | version(LDC) 11 | { 12 | // OK 13 | } 14 | else 15 | { 16 | static assert(false, "This module is only valid for LDC"); 17 | } 18 | 19 | alias void* va_list; 20 | 21 | void va_start(T) ( out va_list ap, ref T parmn ) 22 | { 23 | // not needed ! 24 | } 25 | 26 | T va_arg(T)(ref va_list vp) 27 | { 28 | T* arg = cast(T*) vp; 29 | // ldc always aligns to size_t.sizeof in vararg lists 30 | vp = cast(va_list) ( cast(void*) vp + ( ( T.sizeof + size_t.sizeof - 1 ) & ~( size_t.sizeof - 1 ) ) ); 31 | return *arg; 32 | } 33 | 34 | void va_end( va_list ap ) 35 | { 36 | // not needed ! 37 | } 38 | 39 | void va_copy( out va_list dst, va_list src ) 40 | { 41 | // seems pretty useless ! 42 | dst = src; 43 | } 44 | --------------------------------------------------------------------------------