phobos 0.149

This commit is contained in:
Brad Roberts 2007-09-10 05:11:52 +00:00
parent 110cfd9da7
commit d6ac036aff
24 changed files with 163 additions and 42 deletions

View file

@ -2,7 +2,7 @@
* Encodes/decodes MIME base64 data.
*
* Macros:
* WIKI=StdBase64
* WIKI=Phobos/StdBase64
* References:
* <a href="http://en.wikipedia.org/wiki/Base64">Wikipedia Base64</a>$(BR)
* <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045</a>$(BR)

112
std/c/fenv.d Normal file
View file

@ -0,0 +1,112 @@
/**
* C's &lt;fenv.h&gt;
* Authors: Walter Bright, Digital Mars, www.digitalmars.com
* License: Public Domain
* Macros:
* WIKI=Phobos/StdCFenv
*/
module std.c.fenv;
extern (C):
/// Entire floating point environment
struct fenv_t
{
version (Windows)
{
ushort status;
ushort control;
ushort round;
ushort reserved[2];
}
else version (linux)
{
ushort __control_word;
ushort __unused1;
ushort __status_word;
ushort __unused2;
ushort __tags;
ushort __unused3;
uint __eip;
ushort __cs_selector;
ushort __opcode;
uint __data_offset;
ushort __data_selector;
ushort __unused5;
}
else
{
static assert(0);
}
}
alias int fexcept_t; /// Floating point status flags
/// The various floating point exceptions
enum
{
FE_INVALID = 1,
FE_DENORMAL = 2,
FE_DIVBYZERO = 4,
FE_OVERFLOW = 8,
FE_UNDERFLOW = 0x10,
FE_INEXACT = 0x20,
FE_ALL_EXCEPT = 0x3F, /// Mask of all the exceptions
}
/// Rounding modes
enum
{
FE_TONEAREST = 0,
FE_UPWARD = 0x800,
FE_DOWNWARD = 0x400,
FE_TOWARDZERO = 0xC00,
}
version (Windows)
{
extern fenv_t _FE_DFL_ENV;
/// Default floating point environment
fenv_t* FE_DFL_ENV = &_FE_DFL_ENV;
}
else version (linux
{
/// Default floating point environment
fenv_t* FE_DFL_ENV = cast(fenv_t*)(-1);
}
else
{
static assert(0);
}
/// Floating point precision
enum
{
FE_FLTPREC = 0,
FE_DBLPREC = 0x200,
FE_LDBLPREC = 0x300,
}
int fetestexcept(int excepts);
int feraiseexcept(int excepts);
int feclearexcept(int excepts);
//int fegetexcept(fexcept_t *flagp,int excepts);
//int fesetexcept(fexcept_t *flagp,int excepts);
int fegetround();
int fesetround(int round);
int fegetprec();
int fesetprec(int prec);
int fegetenv(fenv_t *envp);
int fesetenv(fenv_t *envp);
//void feprocentry(fenv_t *envp);
//void feprocexit(const fenv_t *envp);
int fegetexceptflag(fexcept_t *flagp,int excepts);
int fesetexceptflag(fexcept_t *flagp,int excepts);
int feholdexcept(fenv_t *envp);
int feupdateenv(fenv_t *envp);

View file

@ -1,7 +1,7 @@
/**
* Macros:
* WIKI = StdCompiler
* WIKI = Phobos/StdCompiler
*/
/**

View file

@ -29,7 +29,7 @@
* $(LI inline asm statements are not counted)
* )
* Macros:
* WIKI = StdCover
* WIKI = Phobos/StdCover
*/
module std.cover;

View file

@ -4,7 +4,7 @@
* around a central type, d_time, from which other formats are converted to and
* from.
* Macros:
* WIKI = StdDate
* WIKI = Phobos/StdDate
*/
// Copyright (c) 1999-2005 by Digital Mars

View file

@ -1,7 +1,7 @@
/****
* Demangle D mangled names.
* Macros:
* WIKI = StdDemangle
* WIKI = Phobos/StdDemangle
*/
/* Author:

View file

@ -1,6 +1,6 @@
/**
* Macros:
* WIKI = StdFile
* WIKI = Phobos/StdFile
*/
/*

View file

@ -3,7 +3,7 @@
* It's comparable to C99's vsprintf().
*
* Macros:
* WIKI = StdFormat
* WIKI = Phobos/StdFormat
*/
/*
@ -38,8 +38,6 @@ private import std.utf;
private import std.c.stdlib;
private import std.string;
alias bool bit;
version (Windows)
{
version (DigitalMars)

View file

@ -2,7 +2,7 @@
/**
* Macros:
* WIKI = StdMath
* WIKI = Phobos/StdMath
*
* TABLE_SV = <table border=1 cellpadding=4 cellspacing=0>
* <caption>Special Values</caption>

View file

@ -19,7 +19,7 @@
* $(LINK2 http://en.wikipedia.org/wiki/Md5, Wikipedia on MD5)
*
* Macros:
* WIKI = StdMd5
* WIKI = Phobos/StdMd5
*/
/++++++++++++++++++++++++++++++++
@ -55,7 +55,7 @@ void MDFile(char[] filename)
else
{
context.start();
while ((len = fread(buffer, 1, buffer.size, file)) != 0)
while ((len = fread(buffer, 1, buffer.sizeof, file)) != 0)
context.update(buffer[0 .. len]);
context.finish(digest);
fclose(file);

View file

@ -4,7 +4,7 @@
* Boilerplate:
* $(std_boilerplate.html)
* Macros:
* WIKI = StdOutbuffer
* WIKI = Phobos/StdOutbuffer
* Copyright:
* Copyright (c) 2001-2005 by Digital Mars
* All Rights Reserved

View file

@ -1,7 +1,7 @@
/**
* Macros:
* WIKI = StdPath
* WIKI = Phobos/StdPath
* Copyright:
* Placed into public domain.
* www.digitalmars.com

View file

@ -1,6 +1,6 @@
/**
* Macros:
* WIKI = StdRandom
* WIKI = Phobos/StdRandom
*/
// random.d

View file

@ -1,6 +1,6 @@
/**
* Macros:
* WIKI = StdStream
* WIKI = Phobos/StdStream
*/
/*

View file

@ -11,7 +11,7 @@
* are done, the returned string is a copy.
*
* Macros:
* WIKI = StdString
* WIKI = Phobos/StdString
* Copyright:
* Public Domain
*/

View file

@ -33,7 +33,7 @@
* $(LINK2 http://www.ietf.org/rfc/rfc3986.txt, RFC 3986)<br>
* $(LINK2 http://en.wikipedia.org/wiki/Uniform_resource_identifier, Wikipedia)
* Macros:
* WIKI = StdUri
* WIKI = Phobos/StdUri
*/
module std.uri;

View file

@ -37,7 +37,7 @@
* $(LINK http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8)<br>
* $(LINK http://anubis.dkuug.dk/JTC1/SC2/WG2/docs/n1335)
* Macros:
* WIKI = StdUtf
* WIKI = Phobos/StdUtf
*/
module std.utf;

View file

@ -3,7 +3,7 @@
/**
* Support UTF-8 on Windows 95, 98 and ME systems.
* Macros:
* WIKI = StdWindowsCharset
* WIKI = Phobos/StdWindowsCharset
*/
module std.windows.charset;

View file

@ -12,7 +12,7 @@
* )
*
* Macros:
* WIKI = StdZip
* WIKI = Phobos/StdZip
*/
module std.zip;

View file

@ -5,7 +5,7 @@
* $(LINK2 http://en.wikipedia.org/wiki/Zlib, Wikipedia)
*
* Macros:
* WIKI = StdZlib
* WIKI = Phobos/StdZlib
*/