mirror of
https://github.com/dlang/phobos.git
synced 2025-05-04 00:54:05 +03:00
phobos 0.149
This commit is contained in:
parent
110cfd9da7
commit
d6ac036aff
24 changed files with 163 additions and 42 deletions
|
@ -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
112
std/c/fenv.d
Normal file
|
@ -0,0 +1,112 @@
|
|||
|
||||
/**
|
||||
* C's <fenv.h>
|
||||
* 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);
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
/**
|
||||
* Macros:
|
||||
* WIKI = StdCompiler
|
||||
* WIKI = Phobos/StdCompiler
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
* $(LI inline asm statements are not counted)
|
||||
* )
|
||||
* Macros:
|
||||
* WIKI = StdCover
|
||||
* WIKI = Phobos/StdCover
|
||||
*/
|
||||
|
||||
module std.cover;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/****
|
||||
* Demangle D mangled names.
|
||||
* Macros:
|
||||
* WIKI = StdDemangle
|
||||
* WIKI = Phobos/StdDemangle
|
||||
*/
|
||||
|
||||
/* Author:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
* Macros:
|
||||
* WIKI = StdFile
|
||||
* WIKI = Phobos/StdFile
|
||||
*/
|
||||
|
||||
/*
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
/**
|
||||
* Macros:
|
||||
* WIKI = StdMath
|
||||
* WIKI = Phobos/StdMath
|
||||
*
|
||||
* TABLE_SV = <table border=1 cellpadding=4 cellspacing=0>
|
||||
* <caption>Special Values</caption>
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
/**
|
||||
* Macros:
|
||||
* WIKI = StdPath
|
||||
* WIKI = Phobos/StdPath
|
||||
* Copyright:
|
||||
* Placed into public domain.
|
||||
* www.digitalmars.com
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
* Macros:
|
||||
* WIKI = StdRandom
|
||||
* WIKI = Phobos/StdRandom
|
||||
*/
|
||||
|
||||
// random.d
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
* Macros:
|
||||
* WIKI = StdStream
|
||||
* WIKI = Phobos/StdStream
|
||||
*/
|
||||
|
||||
/*
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
* are done, the returned string is a copy.
|
||||
*
|
||||
* Macros:
|
||||
* WIKI = StdString
|
||||
* WIKI = Phobos/StdString
|
||||
* Copyright:
|
||||
* Public Domain
|
||||
*/
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
/**
|
||||
* Support UTF-8 on Windows 95, 98 and ME systems.
|
||||
* Macros:
|
||||
* WIKI = StdWindowsCharset
|
||||
* WIKI = Phobos/StdWindowsCharset
|
||||
*/
|
||||
|
||||
module std.windows.charset;
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
* )
|
||||
*
|
||||
* Macros:
|
||||
* WIKI = StdZip
|
||||
* WIKI = Phobos/StdZip
|
||||
*/
|
||||
|
||||
module std.zip;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* $(LINK2 http://en.wikipedia.org/wiki/Zlib, Wikipedia)
|
||||
*
|
||||
* Macros:
|
||||
* WIKI = StdZlib
|
||||
* WIKI = Phobos/StdZlib
|
||||
*/
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue