Making fields in std and extra : private #4386
This commit is contained in:
parent
dadb6f0cd9
commit
0ada7c7ffe
113 changed files with 1499 additions and 445 deletions
|
@ -50,6 +50,7 @@ use std::borrow;
|
||||||
|
|
||||||
/// As sync::condvar, a mechanism for unlock-and-descheduling and signaling.
|
/// As sync::condvar, a mechanism for unlock-and-descheduling and signaling.
|
||||||
pub struct Condvar<'self> {
|
pub struct Condvar<'self> {
|
||||||
|
// all were already priv
|
||||||
priv is_mutex: bool,
|
priv is_mutex: bool,
|
||||||
priv failed: &'self mut bool,
|
priv failed: &'self mut bool,
|
||||||
priv cond: &'self sync::Condvar<'self>
|
priv cond: &'self sync::Condvar<'self>
|
||||||
|
@ -108,6 +109,7 @@ impl<'self> Condvar<'self> {
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/// An atomically reference counted wrapper for shared immutable state.
|
/// An atomically reference counted wrapper for shared immutable state.
|
||||||
|
// all were already priv
|
||||||
pub struct Arc<T> { priv x: UnsafeArc<T> }
|
pub struct Arc<T> { priv x: UnsafeArc<T> }
|
||||||
|
|
||||||
|
|
||||||
|
@ -162,6 +164,7 @@ struct MutexArcInner<T> { priv lock: Mutex, priv failed: bool, priv data: T }
|
||||||
|
|
||||||
/// An Arc with mutable data protected by a blocking mutex.
|
/// An Arc with mutable data protected by a blocking mutex.
|
||||||
#[no_freeze]
|
#[no_freeze]
|
||||||
|
//All were already priv
|
||||||
pub struct MutexArc<T> { priv x: UnsafeArc<MutexArcInner<T>> }
|
pub struct MutexArc<T> { priv x: UnsafeArc<MutexArcInner<T>> }
|
||||||
|
|
||||||
|
|
||||||
|
@ -344,6 +347,7 @@ struct RWArcInner<T> { priv lock: RWLock, priv failed: bool, priv data: T }
|
||||||
*/
|
*/
|
||||||
#[no_freeze]
|
#[no_freeze]
|
||||||
pub struct RWArc<T> {
|
pub struct RWArc<T> {
|
||||||
|
// all were already priv
|
||||||
priv x: UnsafeArc<RWArcInner<T>>,
|
priv x: UnsafeArc<RWArcInner<T>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -521,15 +525,18 @@ fn borrow_rwlock<T:Freeze + Send>(state: *mut RWArcInner<T>) -> *RWLock {
|
||||||
|
|
||||||
/// The "write permission" token used for RWArc.write_downgrade().
|
/// The "write permission" token used for RWArc.write_downgrade().
|
||||||
pub struct RWWriteMode<'self, T> {
|
pub struct RWWriteMode<'self, T> {
|
||||||
data: &'self mut T,
|
|
||||||
token: sync::RWLockWriteMode<'self>,
|
/// reedlepee added priv in all the feilds below
|
||||||
poison: PoisonOnFail,
|
priv data: &'self mut T,
|
||||||
|
priv token: sync::RWLockWriteMode<'self>,
|
||||||
|
priv poison: PoisonOnFail,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The "read permission" token used for RWArc.write_downgrade().
|
/// The "read permission" token used for RWArc.write_downgrade().
|
||||||
pub struct RWReadMode<'self, T> {
|
pub struct RWReadMode<'self, T> {
|
||||||
data: &'self T,
|
/// reedlepee added priv in all the feilds below
|
||||||
token: sync::RWLockReadMode<'self>,
|
priv data: &'self T,
|
||||||
|
priv token: sync::RWLockReadMode<'self>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'self, T:Freeze + Send> RWWriteMode<'self, T> {
|
impl<'self, T:Freeze + Send> RWWriteMode<'self, T> {
|
||||||
|
|
|
@ -62,6 +62,7 @@ pub struct Arena {
|
||||||
// The head is separated out from the list as a unbenchmarked
|
// The head is separated out from the list as a unbenchmarked
|
||||||
// microoptimization, to avoid needing to case on the list to
|
// microoptimization, to avoid needing to case on the list to
|
||||||
// access the head.
|
// access the head.
|
||||||
|
/// no change by reedlepee all were already priv
|
||||||
priv head: Chunk,
|
priv head: Chunk,
|
||||||
priv pod_head: Chunk,
|
priv pod_head: Chunk,
|
||||||
priv chunks: @mut MutList<Chunk>,
|
priv chunks: @mut MutList<Chunk>,
|
||||||
|
|
|
@ -21,12 +21,13 @@ pub enum CharacterSet {
|
||||||
|
|
||||||
/// Contains configuration parameters for `to_base64`.
|
/// Contains configuration parameters for `to_base64`.
|
||||||
pub struct Config {
|
pub struct Config {
|
||||||
|
/// all were made priv by reedlepee
|
||||||
/// Character set to use
|
/// Character set to use
|
||||||
char_set: CharacterSet,
|
priv char_set: CharacterSet,
|
||||||
/// True to pad output with `=` characters
|
/// True to pad output with `=` characters
|
||||||
pad: bool,
|
priv pad: bool,
|
||||||
/// `Some(len)` to wrap lines at `len`, `None` to disable line wrapping
|
/// `Some(len)` to wrap lines at `len`, `None` to disable line wrapping
|
||||||
line_length: Option<uint>
|
priv line_length: Option<uint>
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Configuration for RFC 4648 standard base64 encoding
|
/// Configuration for RFC 4648 standard base64 encoding
|
||||||
|
|
|
@ -225,10 +225,11 @@ enum Op {Union, Intersect, Assign, Difference}
|
||||||
/// The bitvector type
|
/// The bitvector type
|
||||||
#[deriving(Clone)]
|
#[deriving(Clone)]
|
||||||
pub struct Bitv {
|
pub struct Bitv {
|
||||||
|
/// all were made priv by reedlepee
|
||||||
/// Internal representation of the bit vector (small or large)
|
/// Internal representation of the bit vector (small or large)
|
||||||
rep: BitvVariant,
|
priv rep: BitvVariant,
|
||||||
/// The number of valid bits in the internal representation
|
/// The number of valid bits in the internal representation
|
||||||
nbits: uint
|
priv nbits: uint
|
||||||
}
|
}
|
||||||
|
|
||||||
fn die() -> ! {
|
fn die() -> ! {
|
||||||
|
@ -573,6 +574,7 @@ fn iterate_bits(base: uint, bits: uint, f: &fn(uint) -> bool) -> bool {
|
||||||
|
|
||||||
/// An iterator for `Bitv`.
|
/// An iterator for `Bitv`.
|
||||||
pub struct BitvIterator<'self> {
|
pub struct BitvIterator<'self> {
|
||||||
|
/// all were already priv
|
||||||
priv bitv: &'self Bitv,
|
priv bitv: &'self Bitv,
|
||||||
priv next_idx: uint,
|
priv next_idx: uint,
|
||||||
priv end_idx: uint,
|
priv end_idx: uint,
|
||||||
|
@ -634,6 +636,7 @@ impl<'self> RandomAccessIterator<bool> for BitvIterator<'self> {
|
||||||
/// as a `uint`.
|
/// as a `uint`.
|
||||||
#[deriving(Clone)]
|
#[deriving(Clone)]
|
||||||
pub struct BitvSet {
|
pub struct BitvSet {
|
||||||
|
// all were already priv!!
|
||||||
priv size: uint,
|
priv size: uint,
|
||||||
|
|
||||||
// In theory this is a `Bitv` instead of always a `BigBitv`, but knowing that
|
// In theory this is a `Bitv` instead of always a `BigBitv`, but knowing that
|
||||||
|
@ -900,6 +903,7 @@ impl BitvSet {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct BitvSetIterator<'self> {
|
pub struct BitvSetIterator<'self> {
|
||||||
|
// all were already priv
|
||||||
priv set: &'self BitvSet,
|
priv set: &'self BitvSet,
|
||||||
priv next_idx: uint
|
priv next_idx: uint
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,6 +44,7 @@ use std::util;
|
||||||
* The type representing a foreign chunk of memory
|
* The type representing a foreign chunk of memory
|
||||||
*/
|
*/
|
||||||
pub struct CVec<T> {
|
pub struct CVec<T> {
|
||||||
|
/// No change all were allready priv!!
|
||||||
priv base: *mut T,
|
priv base: *mut T,
|
||||||
priv len: uint,
|
priv len: uint,
|
||||||
priv rsrc: @DtorRes,
|
priv rsrc: @DtorRes,
|
||||||
|
|
|
@ -23,6 +23,7 @@ use std::comm;
|
||||||
|
|
||||||
/// An extension of `pipes::stream` that allows both sending and receiving.
|
/// An extension of `pipes::stream` that allows both sending and receiving.
|
||||||
pub struct DuplexStream<T, U> {
|
pub struct DuplexStream<T, U> {
|
||||||
|
// all were already priv
|
||||||
priv chan: Chan<T>,
|
priv chan: Chan<T>,
|
||||||
priv port: Port<U>,
|
priv port: Port<U>,
|
||||||
}
|
}
|
||||||
|
@ -91,8 +92,10 @@ pub fn DuplexStream<T:Send,U:Send>()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An extension of `pipes::stream` that provides synchronous message sending.
|
/// An extension of `pipes::stream` that provides synchronous message sending.
|
||||||
|
// all were already priv
|
||||||
pub struct SyncChan<T> { priv duplex_stream: DuplexStream<T, ()> }
|
pub struct SyncChan<T> { priv duplex_stream: DuplexStream<T, ()> }
|
||||||
/// An extension of `pipes::stream` that acknowledges each message received.
|
/// An extension of `pipes::stream` that acknowledges each message received.
|
||||||
|
// all were already priv
|
||||||
pub struct SyncPort<T> { priv duplex_stream: DuplexStream<(), T> }
|
pub struct SyncPort<T> { priv duplex_stream: DuplexStream<(), T> }
|
||||||
|
|
||||||
impl<T: Send> GenericChan<T> for SyncChan<T> {
|
impl<T: Send> GenericChan<T> for SyncChan<T> {
|
||||||
|
|
|
@ -284,6 +284,7 @@ macro_rules! impl_fixed_buffer( ($name:ident, $size:expr) => (
|
||||||
|
|
||||||
/// A fixed size buffer of 64 bytes useful for cryptographic operations.
|
/// A fixed size buffer of 64 bytes useful for cryptographic operations.
|
||||||
pub struct FixedBuffer64 {
|
pub struct FixedBuffer64 {
|
||||||
|
// already priv
|
||||||
priv buffer: [u8, ..64],
|
priv buffer: [u8, ..64],
|
||||||
priv buffer_idx: uint,
|
priv buffer_idx: uint,
|
||||||
}
|
}
|
||||||
|
@ -302,6 +303,7 @@ impl_fixed_buffer!(FixedBuffer64, 64)
|
||||||
|
|
||||||
/// A fixed size buffer of 128 bytes useful for cryptographic operations.
|
/// A fixed size buffer of 128 bytes useful for cryptographic operations.
|
||||||
pub struct FixedBuffer128 {
|
pub struct FixedBuffer128 {
|
||||||
|
// already priv
|
||||||
priv buffer: [u8, ..128],
|
priv buffer: [u8, ..128],
|
||||||
priv buffer_idx: uint,
|
priv buffer_idx: uint,
|
||||||
}
|
}
|
||||||
|
|
|
@ -159,6 +159,7 @@ static C4: [u32, ..16] = [
|
||||||
|
|
||||||
/// The MD5 Digest algorithm
|
/// The MD5 Digest algorithm
|
||||||
pub struct Md5 {
|
pub struct Md5 {
|
||||||
|
// already priv
|
||||||
priv length_bytes: u64,
|
priv length_bytes: u64,
|
||||||
priv buffer: FixedBuffer64,
|
priv buffer: FixedBuffer64,
|
||||||
priv state: Md5State,
|
priv state: Md5State,
|
||||||
|
|
|
@ -43,6 +43,7 @@ static K3: u32 = 0xCA62C1D6u32;
|
||||||
|
|
||||||
/// Structure representing the state of a Sha1 computation
|
/// Structure representing the state of a Sha1 computation
|
||||||
pub struct Sha1 {
|
pub struct Sha1 {
|
||||||
|
// already priv
|
||||||
priv h: [u32, ..DIGEST_BUF_LEN],
|
priv h: [u32, ..DIGEST_BUF_LEN],
|
||||||
priv length_bits: u64,
|
priv length_bits: u64,
|
||||||
priv buffer: FixedBuffer64,
|
priv buffer: FixedBuffer64,
|
||||||
|
|
|
@ -234,6 +234,7 @@ impl Engine512 {
|
||||||
|
|
||||||
/// The SHA-512 hash algorithm
|
/// The SHA-512 hash algorithm
|
||||||
pub struct Sha512 {
|
pub struct Sha512 {
|
||||||
|
// already priv
|
||||||
priv engine: Engine512
|
priv engine: Engine512
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -287,6 +288,7 @@ static H512: [u64, ..8] = [
|
||||||
|
|
||||||
/// The SHA-384 hash algorithm
|
/// The SHA-384 hash algorithm
|
||||||
pub struct Sha384 {
|
pub struct Sha384 {
|
||||||
|
// already priv
|
||||||
priv engine: Engine512
|
priv engine: Engine512
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -338,6 +340,7 @@ static H384: [u64, ..8] = [
|
||||||
|
|
||||||
/// The SHA-512 hash algorithm with digest truncated to 256 bits
|
/// The SHA-512 hash algorithm with digest truncated to 256 bits
|
||||||
pub struct Sha512Trunc256 {
|
pub struct Sha512Trunc256 {
|
||||||
|
// already priv
|
||||||
priv engine: Engine512
|
priv engine: Engine512
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -387,6 +390,7 @@ static H512_TRUNC_256: [u64, ..8] = [
|
||||||
|
|
||||||
/// The SHA-512 hash algorithm with digest truncated to 224 bits
|
/// The SHA-512 hash algorithm with digest truncated to 224 bits
|
||||||
pub struct Sha512Trunc224 {
|
pub struct Sha512Trunc224 {
|
||||||
|
// already priv
|
||||||
priv engine: Engine512
|
priv engine: Engine512
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -643,6 +647,7 @@ impl Engine256 {
|
||||||
|
|
||||||
/// The SHA-256 hash algorithm
|
/// The SHA-256 hash algorithm
|
||||||
pub struct Sha256 {
|
pub struct Sha256 {
|
||||||
|
// already priv
|
||||||
priv engine: Engine256
|
priv engine: Engine256
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -696,6 +701,7 @@ static H256: [u32, ..8] = [
|
||||||
|
|
||||||
/// The SHA-224 hash algorithm
|
/// The SHA-224 hash algorithm
|
||||||
pub struct Sha224 {
|
pub struct Sha224 {
|
||||||
|
// already priv
|
||||||
priv engine: Engine256
|
priv engine: Engine256
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,7 @@ use container::Deque;
|
||||||
|
|
||||||
/// A doubly-linked list.
|
/// A doubly-linked list.
|
||||||
pub struct DList<T> {
|
pub struct DList<T> {
|
||||||
|
// all were already priv
|
||||||
priv length: uint,
|
priv length: uint,
|
||||||
priv list_head: Link<T>,
|
priv list_head: Link<T>,
|
||||||
priv list_tail: Rawlink<Node<T>>,
|
priv list_tail: Rawlink<Node<T>>,
|
||||||
|
@ -49,6 +50,7 @@ struct Node<T> {
|
||||||
/// Double-ended DList iterator
|
/// Double-ended DList iterator
|
||||||
#[deriving(Clone)]
|
#[deriving(Clone)]
|
||||||
pub struct DListIterator<'self, T> {
|
pub struct DListIterator<'self, T> {
|
||||||
|
// all were already priv
|
||||||
priv head: &'self Link<T>,
|
priv head: &'self Link<T>,
|
||||||
priv tail: Rawlink<Node<T>>,
|
priv tail: Rawlink<Node<T>>,
|
||||||
priv nelem: uint,
|
priv nelem: uint,
|
||||||
|
@ -56,6 +58,7 @@ pub struct DListIterator<'self, T> {
|
||||||
|
|
||||||
/// Double-ended mutable DList iterator
|
/// Double-ended mutable DList iterator
|
||||||
pub struct MutDListIterator<'self, T> {
|
pub struct MutDListIterator<'self, T> {
|
||||||
|
// all were already priv
|
||||||
priv list: &'self mut DList<T>,
|
priv list: &'self mut DList<T>,
|
||||||
priv head: Rawlink<Node<T>>,
|
priv head: Rawlink<Node<T>>,
|
||||||
priv tail: Rawlink<Node<T>>,
|
priv tail: Rawlink<Node<T>>,
|
||||||
|
@ -65,6 +68,7 @@ pub struct MutDListIterator<'self, T> {
|
||||||
/// DList consuming iterator
|
/// DList consuming iterator
|
||||||
#[deriving(Clone)]
|
#[deriving(Clone)]
|
||||||
pub struct MoveIterator<T> {
|
pub struct MoveIterator<T> {
|
||||||
|
// all were already priv
|
||||||
priv list: DList<T>
|
priv list: DList<T>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,7 @@ struct EbmlState {
|
||||||
|
|
||||||
#[deriving(Clone)]
|
#[deriving(Clone)]
|
||||||
pub struct Doc {
|
pub struct Doc {
|
||||||
|
// all these should be public
|
||||||
data: @~[u8],
|
data: @~[u8],
|
||||||
start: uint,
|
start: uint,
|
||||||
end: uint,
|
end: uint,
|
||||||
|
@ -50,7 +51,9 @@ impl Doc {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct TaggedDoc {
|
pub struct TaggedDoc {
|
||||||
tag: uint,
|
// was made privv by reedlepee
|
||||||
|
priv tag: uint,
|
||||||
|
// should be public
|
||||||
doc: Doc,
|
doc: Doc,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -284,6 +287,7 @@ pub mod reader {
|
||||||
pub fn doc_as_i64(d: Doc) -> i64 { doc_as_u64(d) as i64 }
|
pub fn doc_as_i64(d: Doc) -> i64 { doc_as_u64(d) as i64 }
|
||||||
|
|
||||||
pub struct Decoder {
|
pub struct Decoder {
|
||||||
|
// all were already priv
|
||||||
priv parent: Doc,
|
priv parent: Doc,
|
||||||
priv pos: uint,
|
priv pos: uint,
|
||||||
}
|
}
|
||||||
|
@ -618,7 +622,9 @@ pub mod writer {
|
||||||
|
|
||||||
// ebml writing
|
// ebml writing
|
||||||
pub struct Encoder {
|
pub struct Encoder {
|
||||||
|
/// should be public!!
|
||||||
writer: @io::Writer,
|
writer: @io::Writer,
|
||||||
|
/// this was already privv!!
|
||||||
priv size_positions: ~[uint],
|
priv size_positions: ~[uint],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
pub struct EnumSet<E> {
|
pub struct EnumSet<E> {
|
||||||
// We must maintain the invariant that no bits are set
|
// We must maintain the invariant that no bits are set
|
||||||
// for which no variant exists
|
// for which no variant exists
|
||||||
|
// all were already priv
|
||||||
priv bits: uint
|
priv bits: uint
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,6 +101,7 @@ impl<E:CLike> BitAnd<EnumSet<E>, EnumSet<E>> for EnumSet<E> {
|
||||||
|
|
||||||
/// An iterator over an EnumSet
|
/// An iterator over an EnumSet
|
||||||
pub struct EnumSetIterator<E> {
|
pub struct EnumSetIterator<E> {
|
||||||
|
// all were already priv
|
||||||
priv index: uint,
|
priv index: uint,
|
||||||
priv bits: uint,
|
priv bits: uint,
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,9 +109,10 @@ file is `stdin`.
|
||||||
*/
|
*/
|
||||||
#[deriving(Clone)]
|
#[deriving(Clone)]
|
||||||
pub struct FileInputState {
|
pub struct FileInputState {
|
||||||
current_path: Option<Path>,
|
// all were priv made by reedlepee
|
||||||
line_num: uint,
|
priv current_path: Option<Path>,
|
||||||
line_num_file: uint
|
priv line_num: uint,
|
||||||
|
priv line_num_file: uint
|
||||||
}
|
}
|
||||||
|
|
||||||
impl FileInputState {
|
impl FileInputState {
|
||||||
|
@ -155,7 +156,8 @@ struct FileInput_ {
|
||||||
// "self.fi" -> "self." and renaming FileInput_. Documentation above
|
// "self.fi" -> "self." and renaming FileInput_. Documentation above
|
||||||
// will likely have to be updated to use `let mut in = ...`.
|
// will likely have to be updated to use `let mut in = ...`.
|
||||||
pub struct FileInput {
|
pub struct FileInput {
|
||||||
fi: @mut FileInput_
|
/// all were made priv by reedlepee
|
||||||
|
priv fi: @mut FileInput_
|
||||||
}
|
}
|
||||||
|
|
||||||
impl FileInput {
|
impl FileInput {
|
||||||
|
|
|
@ -32,6 +32,7 @@ use std::util::replace;
|
||||||
|
|
||||||
/// A type encapsulating the result of a computation which may not be complete
|
/// A type encapsulating the result of a computation which may not be complete
|
||||||
pub struct Future<A> {
|
pub struct Future<A> {
|
||||||
|
// all were already privv!!
|
||||||
priv state: FutureState<A>,
|
priv state: FutureState<A>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -112,14 +112,16 @@ pub enum Occur {
|
||||||
/// A description of a possible option.
|
/// A description of a possible option.
|
||||||
#[deriving(Clone, Eq)]
|
#[deriving(Clone, Eq)]
|
||||||
pub struct Opt {
|
pub struct Opt {
|
||||||
|
|
||||||
|
/// reedlepee added priv infront of them!!
|
||||||
/// Name of the option
|
/// Name of the option
|
||||||
name: Name,
|
name: Name,
|
||||||
/// Wheter it has an argument
|
/// Wheter it has an argument... should be public!!
|
||||||
hasarg: HasArg,
|
hasarg: HasArg,
|
||||||
/// How often it can occur
|
/// How often it can occur... should be private !!
|
||||||
occur: Occur,
|
occur: Occur,
|
||||||
/// Which options it aliases
|
/// Which options it aliases
|
||||||
aliases: ~[Opt],
|
priv aliases: ~[Opt],
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Describes wether an option is given at all or has a value.
|
/// Describes wether an option is given at all or has a value.
|
||||||
|
@ -133,11 +135,14 @@ enum Optval {
|
||||||
/// of matches and a vector of free strings.
|
/// of matches and a vector of free strings.
|
||||||
#[deriving(Clone, Eq)]
|
#[deriving(Clone, Eq)]
|
||||||
pub struct Matches {
|
pub struct Matches {
|
||||||
|
|
||||||
|
/// reedlepee added priv infront of all
|
||||||
/// Options that matched
|
/// Options that matched
|
||||||
opts: ~[Opt],
|
priv opts: ~[Opt],
|
||||||
/// Values of the Options that matched
|
/// Values of the Options that matched
|
||||||
vals: ~[~[Optval]],
|
priv vals: ~[~[Optval]],
|
||||||
/// Free string fragments
|
/// Free string fragments
|
||||||
|
// public
|
||||||
free: ~[~str]
|
free: ~[~str]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,7 @@ use sort;
|
||||||
* pattern - see the `glob` function for more details.
|
* pattern - see the `glob` function for more details.
|
||||||
*/
|
*/
|
||||||
pub struct GlobIterator {
|
pub struct GlobIterator {
|
||||||
|
/// no change by reedlepee all were priv already!!
|
||||||
priv root: Path,
|
priv root: Path,
|
||||||
priv dir_patterns: ~[Pattern],
|
priv dir_patterns: ~[Pattern],
|
||||||
priv options: MatchOptions,
|
priv options: MatchOptions,
|
||||||
|
@ -156,6 +157,7 @@ fn list_dir_sorted(path: &Path) -> ~[Path] {
|
||||||
*/
|
*/
|
||||||
#[deriving(Clone, Eq, TotalEq, Ord, TotalOrd, IterBytes, Default)]
|
#[deriving(Clone, Eq, TotalEq, Ord, TotalOrd, IterBytes, Default)]
|
||||||
pub struct Pattern {
|
pub struct Pattern {
|
||||||
|
// already priv
|
||||||
priv tokens: ~[PatternToken]
|
priv tokens: ~[PatternToken]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -474,19 +476,20 @@ fn chars_eq(a: char, b: char, case_sensitive: bool) -> bool {
|
||||||
*/
|
*/
|
||||||
#[deriving(Clone, Eq, TotalEq, Ord, TotalOrd, IterBytes, Default)]
|
#[deriving(Clone, Eq, TotalEq, Ord, TotalOrd, IterBytes, Default)]
|
||||||
pub struct MatchOptions {
|
pub struct MatchOptions {
|
||||||
|
/// all were made priv by reedlepee
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether or not patterns should be matched in a case-sensitive manner. This
|
* Whether or not patterns should be matched in a case-sensitive manner. This
|
||||||
* currently only considers upper/lower case relationships between ASCII characters,
|
* currently only considers upper/lower case relationships between ASCII characters,
|
||||||
* but in future this might be extended to work with Unicode.
|
* but in future this might be extended to work with Unicode.
|
||||||
*/
|
*/
|
||||||
case_sensitive: bool,
|
priv case_sensitive: bool,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If this is true then path-component separator characters (e.g. `/` on Posix)
|
* If this is true then path-component separator characters (e.g. `/` on Posix)
|
||||||
* must be matched by a literal `/`, rather than by `*` or `?` or `[...]`
|
* must be matched by a literal `/`, rather than by `*` or `?` or `[...]`
|
||||||
*/
|
*/
|
||||||
require_literal_separator: bool,
|
priv require_literal_separator: bool,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If this is true then paths that contain components that start with a `.` will
|
* If this is true then paths that contain components that start with a `.` will
|
||||||
|
@ -494,7 +497,7 @@ pub struct MatchOptions {
|
||||||
* will not match. This is useful because such files are conventionally considered
|
* will not match. This is useful because such files are conventionally considered
|
||||||
* hidden on Unix systems and it might be desirable to skip them when listing files.
|
* hidden on Unix systems and it might be desirable to skip them when listing files.
|
||||||
*/
|
*/
|
||||||
require_literal_leading_dot: bool
|
priv require_literal_leading_dot: bool
|
||||||
}
|
}
|
||||||
|
|
||||||
impl MatchOptions {
|
impl MatchOptions {
|
||||||
|
|
|
@ -16,10 +16,11 @@ use std::cast;
|
||||||
|
|
||||||
/// An implementation of the io::Reader interface which reads a buffer of bytes
|
/// An implementation of the io::Reader interface which reads a buffer of bytes
|
||||||
pub struct BufReader {
|
pub struct BufReader {
|
||||||
|
// all were made priv by reedlepee
|
||||||
/// The buffer of bytes to read
|
/// The buffer of bytes to read
|
||||||
buf: ~[u8],
|
priv buf: ~[u8],
|
||||||
/// The current position in the buffer of bytes
|
/// The current position in the buffer of bytes
|
||||||
pos: @mut uint
|
priv pos: @mut uint
|
||||||
}
|
}
|
||||||
|
|
||||||
impl BufReader {
|
impl BufReader {
|
||||||
|
|
|
@ -48,12 +48,13 @@ pub type Object = TreeMap<~str, Json>;
|
||||||
/// If an error occurs while parsing some JSON, this is the structure which is
|
/// If an error occurs while parsing some JSON, this is the structure which is
|
||||||
/// returned
|
/// returned
|
||||||
pub struct Error {
|
pub struct Error {
|
||||||
|
// all were made privv by reedlepee
|
||||||
/// The line number at which the error occurred
|
/// The line number at which the error occurred
|
||||||
line: uint,
|
priv line: uint,
|
||||||
/// The column number at which the error occurred
|
/// The column number at which the error occurred
|
||||||
col: uint,
|
priv col: uint,
|
||||||
/// A message describing the type of the error
|
/// A message describing the type of the error
|
||||||
msg: @~str,
|
priv msg: @~str,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn escape_str(s: &str) -> ~str {
|
fn escape_str(s: &str) -> ~str {
|
||||||
|
@ -86,6 +87,7 @@ fn spaces(n: uint) -> ~str {
|
||||||
|
|
||||||
/// A structure for implementing serialization to JSON.
|
/// A structure for implementing serialization to JSON.
|
||||||
pub struct Encoder {
|
pub struct Encoder {
|
||||||
|
// all were already priv
|
||||||
priv wr: @io::Writer,
|
priv wr: @io::Writer,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -243,6 +245,7 @@ impl serialize::Encoder for Encoder {
|
||||||
/// Another encoder for JSON, but prints out human-readable JSON instead of
|
/// Another encoder for JSON, but prints out human-readable JSON instead of
|
||||||
/// compact data
|
/// compact data
|
||||||
pub struct PrettyEncoder {
|
pub struct PrettyEncoder {
|
||||||
|
// all were already priv
|
||||||
priv wr: @io::Writer,
|
priv wr: @io::Writer,
|
||||||
priv indent: uint,
|
priv indent: uint,
|
||||||
}
|
}
|
||||||
|
@ -479,6 +482,7 @@ impl Json{
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct Parser<T> {
|
pub struct Parser<T> {
|
||||||
|
// all were already priv
|
||||||
priv rdr: ~T,
|
priv rdr: ~T,
|
||||||
priv ch: char,
|
priv ch: char,
|
||||||
priv line: uint,
|
priv line: uint,
|
||||||
|
@ -868,6 +872,7 @@ pub fn from_str(s: &str) -> Result<Json, Error> {
|
||||||
|
|
||||||
/// A structure to decode JSON to values in rust.
|
/// A structure to decode JSON to values in rust.
|
||||||
pub struct Decoder {
|
pub struct Decoder {
|
||||||
|
// all were already priv
|
||||||
priv stack: ~[Json],
|
priv stack: ~[Json],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -86,6 +86,7 @@ A `BigUint`-typed value `BigUint { data: @[a, b, c] }` represents a number
|
||||||
*/
|
*/
|
||||||
#[deriving(Clone)]
|
#[deriving(Clone)]
|
||||||
pub struct BigUint {
|
pub struct BigUint {
|
||||||
|
// already priv
|
||||||
priv data: ~[BigDigit]
|
priv data: ~[BigDigit]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -893,6 +894,7 @@ impl Neg<Sign> for Sign {
|
||||||
/// A big signed integer type.
|
/// A big signed integer type.
|
||||||
#[deriving(Clone)]
|
#[deriving(Clone)]
|
||||||
pub struct BigInt {
|
pub struct BigInt {
|
||||||
|
// already priv
|
||||||
priv sign: Sign,
|
priv sign: Sign,
|
||||||
priv data: BigUint
|
priv data: BigUint
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,10 +24,11 @@ use std::num::{Zero,One,ToStrRadix};
|
||||||
/// A complex number in Cartesian form.
|
/// A complex number in Cartesian form.
|
||||||
#[deriving(Eq,Clone)]
|
#[deriving(Eq,Clone)]
|
||||||
pub struct Cmplx<T> {
|
pub struct Cmplx<T> {
|
||||||
|
// all made real by reedlepee
|
||||||
/// Real portion of the complex number
|
/// Real portion of the complex number
|
||||||
re: T,
|
priv re: T,
|
||||||
/// Imaginary portion of the complex number
|
/// Imaginary portion of the complex number
|
||||||
im: T
|
priv im: T
|
||||||
}
|
}
|
||||||
|
|
||||||
pub type Complex32 = Cmplx<f32>;
|
pub type Complex32 = Cmplx<f32>;
|
||||||
|
|
|
@ -20,8 +20,9 @@ use super::bigint::BigInt;
|
||||||
#[deriving(Clone)]
|
#[deriving(Clone)]
|
||||||
#[allow(missing_doc)]
|
#[allow(missing_doc)]
|
||||||
pub struct Ratio<T> {
|
pub struct Ratio<T> {
|
||||||
numer: T,
|
// made priv by reedlepee
|
||||||
denom: T
|
priv numer: T,
|
||||||
|
priv denom: T
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Alias for a `Ratio` of machine-sized integers.
|
/// Alias for a `Ratio` of machine-sized integers.
|
||||||
|
|
|
@ -20,6 +20,7 @@ use std::vec;
|
||||||
/// A priority queue implemented with a binary heap
|
/// A priority queue implemented with a binary heap
|
||||||
#[deriving(Clone)]
|
#[deriving(Clone)]
|
||||||
pub struct PriorityQueue<T> {
|
pub struct PriorityQueue<T> {
|
||||||
|
// all were already priv
|
||||||
priv data: ~[T],
|
priv data: ~[T],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -178,6 +179,7 @@ impl<T:Ord> PriorityQueue<T> {
|
||||||
|
|
||||||
/// PriorityQueue iterator
|
/// PriorityQueue iterator
|
||||||
pub struct PriorityQueueIterator <'self, T> {
|
pub struct PriorityQueueIterator <'self, T> {
|
||||||
|
// all were already priv
|
||||||
priv iter: vec::VecIterator<'self, T>,
|
priv iter: vec::VecIterator<'self, T>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@ static MINIMUM_CAPACITY: uint = 2u;
|
||||||
/// RingBuf is a circular buffer that implements Deque.
|
/// RingBuf is a circular buffer that implements Deque.
|
||||||
#[deriving(Clone)]
|
#[deriving(Clone)]
|
||||||
pub struct RingBuf<T> {
|
pub struct RingBuf<T> {
|
||||||
|
// all were already priv
|
||||||
priv nelts: uint,
|
priv nelts: uint,
|
||||||
priv lo: uint,
|
priv lo: uint,
|
||||||
priv elts: ~[Option<T>]
|
priv elts: ~[Option<T>]
|
||||||
|
@ -248,6 +249,7 @@ macro_rules! iterator_rev {
|
||||||
|
|
||||||
/// RingBuf iterator
|
/// RingBuf iterator
|
||||||
pub struct RingBufIterator<'self, T> {
|
pub struct RingBufIterator<'self, T> {
|
||||||
|
// all were already priv
|
||||||
priv lo: uint,
|
priv lo: uint,
|
||||||
priv index: uint,
|
priv index: uint,
|
||||||
priv rindex: uint,
|
priv rindex: uint,
|
||||||
|
@ -275,6 +277,7 @@ impl<'self, T> RandomAccessIterator<&'self T> for RingBufIterator<'self, T> {
|
||||||
|
|
||||||
/// RingBuf mutable iterator
|
/// RingBuf mutable iterator
|
||||||
pub struct RingBufMutIterator<'self, T> {
|
pub struct RingBufMutIterator<'self, T> {
|
||||||
|
// all were already priv
|
||||||
priv lo: uint,
|
priv lo: uint,
|
||||||
priv index: uint,
|
priv index: uint,
|
||||||
priv rindex: uint,
|
priv rindex: uint,
|
||||||
|
|
|
@ -70,18 +70,19 @@ impl ToStr for Identifier {
|
||||||
/// Represents a version number conforming to the semantic versioning scheme.
|
/// Represents a version number conforming to the semantic versioning scheme.
|
||||||
#[deriving(Clone, Eq)]
|
#[deriving(Clone, Eq)]
|
||||||
pub struct Version {
|
pub struct Version {
|
||||||
|
/// reedlepee added priv in all
|
||||||
/// The major version, to be incremented on incompatible changes.
|
/// The major version, to be incremented on incompatible changes.
|
||||||
major: uint,
|
priv major: uint,
|
||||||
/// The minor version, to be incremented when functionality is added in a
|
/// The minor version, to be incremented when functionality is added in a
|
||||||
/// backwards-compatible manner.
|
/// backwards-compatible manner.
|
||||||
minor: uint,
|
priv minor: uint,
|
||||||
/// The patch version, to be incremented when backwards-compatible bug
|
/// The patch version, to be incremented when backwards-compatible bug
|
||||||
/// fixes are made.
|
/// fixes are made.
|
||||||
patch: uint,
|
priv patch: uint,
|
||||||
/// The pre-release version identifier, if one exists.
|
/// The pre-release version identifier, if one exists.
|
||||||
pre: ~[Identifier],
|
priv pre: ~[Identifier],
|
||||||
/// The build metadata, ignored when determining version precedence.
|
/// The build metadata, ignored when determining version precedence.
|
||||||
build: ~[Identifier],
|
priv build: ~[Identifier],
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ToStr for Version {
|
impl ToStr for Version {
|
||||||
|
|
|
@ -22,6 +22,7 @@ use std::vec;
|
||||||
|
|
||||||
#[allow(missing_doc)]
|
#[allow(missing_doc)]
|
||||||
pub struct SmallIntMap<T> {
|
pub struct SmallIntMap<T> {
|
||||||
|
/// all were already priv!!
|
||||||
priv v: ~[Option<T>],
|
priv v: ~[Option<T>],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -233,6 +234,7 @@ macro_rules! double_ended_iterator {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct SmallIntMapIterator<'self, T> {
|
pub struct SmallIntMapIterator<'self, T> {
|
||||||
|
/// all were already priv!!
|
||||||
priv front: uint,
|
priv front: uint,
|
||||||
priv back: uint,
|
priv back: uint,
|
||||||
priv iter: VecIterator<'self, Option<T>>
|
priv iter: VecIterator<'self, Option<T>>
|
||||||
|
@ -243,6 +245,7 @@ double_ended_iterator!(impl SmallIntMapIterator -> (uint, &'self T), get_ref)
|
||||||
pub type SmallIntMapRevIterator<'self, T> = Invert<SmallIntMapIterator<'self, T>>;
|
pub type SmallIntMapRevIterator<'self, T> = Invert<SmallIntMapIterator<'self, T>>;
|
||||||
|
|
||||||
pub struct SmallIntMapMutIterator<'self, T> {
|
pub struct SmallIntMapMutIterator<'self, T> {
|
||||||
|
/// all were already priv!!
|
||||||
priv front: uint,
|
priv front: uint,
|
||||||
priv back: uint,
|
priv back: uint,
|
||||||
priv iter: VecMutIterator<'self, Option<T>>
|
priv iter: VecMutIterator<'self, Option<T>>
|
||||||
|
|
|
@ -105,18 +105,24 @@ pub trait Stats {
|
||||||
#[deriving(Clone, Eq)]
|
#[deriving(Clone, Eq)]
|
||||||
#[allow(missing_doc)]
|
#[allow(missing_doc)]
|
||||||
pub struct Summary {
|
pub struct Summary {
|
||||||
sum: f64,
|
/// all were made privv by reedlepee
|
||||||
|
priv sum: f64,
|
||||||
|
// public
|
||||||
min: f64,
|
min: f64,
|
||||||
|
// public
|
||||||
max: f64,
|
max: f64,
|
||||||
mean: f64,
|
priv mean: f64,
|
||||||
|
// public
|
||||||
median: f64,
|
median: f64,
|
||||||
var: f64,
|
priv var: f64,
|
||||||
std_dev: f64,
|
priv std_dev: f64,
|
||||||
std_dev_pct: f64,
|
priv std_dev_pct: f64,
|
||||||
|
// public
|
||||||
median_abs_dev: f64,
|
median_abs_dev: f64,
|
||||||
|
// public
|
||||||
median_abs_dev_pct: f64,
|
median_abs_dev_pct: f64,
|
||||||
quartiles: (f64,f64,f64),
|
priv quartiles: (f64,f64,f64),
|
||||||
iqr: f64,
|
priv iqr: f64,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Summary {
|
impl Summary {
|
||||||
|
|
|
@ -167,6 +167,9 @@ enum ReacquireOrderLock<'self> {
|
||||||
|
|
||||||
/// A mechanism for atomic-unlock-and-deschedule blocking and signalling.
|
/// A mechanism for atomic-unlock-and-deschedule blocking and signalling.
|
||||||
pub struct Condvar<'self> {
|
pub struct Condvar<'self> {
|
||||||
|
|
||||||
|
// reedlepee didnot change anything they were already priv!!!
|
||||||
|
|
||||||
// The 'Sem' object associated with this condvar. This is the one that's
|
// The 'Sem' object associated with this condvar. This is the one that's
|
||||||
// atomically-unlocked-and-descheduled upon and reacquired during wakeup.
|
// atomically-unlocked-and-descheduled upon and reacquired during wakeup.
|
||||||
priv sem: &'self Sem<~[WaitQueue]>,
|
priv sem: &'self Sem<~[WaitQueue]>,
|
||||||
|
@ -376,8 +379,9 @@ impl Semaphore {
|
||||||
* A task which fails while holding a mutex will unlock the mutex as it
|
* A task which fails while holding a mutex will unlock the mutex as it
|
||||||
* unwinds.
|
* unwinds.
|
||||||
*/
|
*/
|
||||||
pub struct Mutex { priv sem: Sem<~[WaitQueue]> }
|
|
||||||
|
|
||||||
|
// reedlepee did not change !!
|
||||||
|
pub struct Mutex { priv sem: Sem<~[WaitQueue]> }
|
||||||
impl Clone for Mutex {
|
impl Clone for Mutex {
|
||||||
/// Create a new handle to the mutex.
|
/// Create a new handle to the mutex.
|
||||||
fn clone(&self) -> Mutex { Mutex { sem: Sem((*self.sem).clone()) } }
|
fn clone(&self) -> Mutex { Mutex { sem: Sem((*self.sem).clone()) } }
|
||||||
|
@ -444,6 +448,7 @@ struct RWLockInner {
|
||||||
* unwinds.
|
* unwinds.
|
||||||
*/
|
*/
|
||||||
pub struct RWLock {
|
pub struct RWLock {
|
||||||
|
// reedlepee did not change they were already priv!!
|
||||||
priv order_lock: Semaphore,
|
priv order_lock: Semaphore,
|
||||||
priv access_lock: Sem<~[WaitQueue]>,
|
priv access_lock: Sem<~[WaitQueue]>,
|
||||||
priv state: UnsafeArc<RWLockInner>,
|
priv state: UnsafeArc<RWLockInner>,
|
||||||
|
@ -663,9 +668,12 @@ impl RWLock {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The "write permission" token used for rwlock.write_downgrade().
|
/// The "write permission" token used for rwlock.write_downgrade().
|
||||||
|
|
||||||
|
// already priv
|
||||||
pub struct RWLockWriteMode<'self> { priv lock: &'self RWLock, priv token: NonCopyable }
|
pub struct RWLockWriteMode<'self> { priv lock: &'self RWLock, priv token: NonCopyable }
|
||||||
|
|
||||||
/// The "read permission" token used for rwlock.write_downgrade().
|
/// The "read permission" token used for rwlock.write_downgrade().
|
||||||
|
// already priv
|
||||||
pub struct RWLockReadMode<'self> { priv lock: &'self RWLock,
|
pub struct RWLockReadMode<'self> { priv lock: &'self RWLock,
|
||||||
priv token: NonCopyable }
|
priv token: NonCopyable }
|
||||||
|
|
||||||
|
|
|
@ -28,8 +28,9 @@ enum Msg<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct TaskPool<T> {
|
pub struct TaskPool<T> {
|
||||||
channels: ~[Chan<Msg<T>>],
|
/// all were made priv by reedlepee
|
||||||
next_index: uint,
|
priv channels: ~[Chan<Msg<T>>],
|
||||||
|
priv next_index: uint,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[unsafe_destructor]
|
#[unsafe_destructor]
|
||||||
|
|
|
@ -18,6 +18,7 @@ use std::rand;
|
||||||
/// A wrapper for a path to temporary directory implementing automatic
|
/// A wrapper for a path to temporary directory implementing automatic
|
||||||
/// scope-pased deletion.
|
/// scope-pased deletion.
|
||||||
pub struct TempDir {
|
pub struct TempDir {
|
||||||
|
// all were already priv!!
|
||||||
priv path: Option<Path>
|
priv path: Option<Path>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -95,14 +95,19 @@ fn cap_for_attr(attr: attr::Attr) -> &'static str {
|
||||||
|
|
||||||
#[cfg(not(target_os = "win32"))]
|
#[cfg(not(target_os = "win32"))]
|
||||||
pub struct Terminal {
|
pub struct Terminal {
|
||||||
num_colors: u16,
|
|
||||||
|
// this was made priv by reedlepee
|
||||||
|
priv num_colors: u16,
|
||||||
|
// These were already priv
|
||||||
priv out: @io::Writer,
|
priv out: @io::Writer,
|
||||||
priv ti: ~TermInfo
|
priv ti: ~TermInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(target_os = "win32")]
|
#[cfg(target_os = "win32")]
|
||||||
pub struct Terminal {
|
pub struct Terminal {
|
||||||
num_colors: u16,
|
// this was made priv by reedlepee
|
||||||
|
priv num_colors: u16,
|
||||||
|
// These were already priv
|
||||||
priv out: @io::Writer,
|
priv out: @io::Writer,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,10 +47,11 @@ pub enum Param {
|
||||||
|
|
||||||
/// Container for static and dynamic variable arrays
|
/// Container for static and dynamic variable arrays
|
||||||
pub struct Variables {
|
pub struct Variables {
|
||||||
|
// made priv by redlpee
|
||||||
/// Static variables A-Z
|
/// Static variables A-Z
|
||||||
sta: [Param, ..26],
|
priv sta: [Param, ..26],
|
||||||
/// Dynamic variables a-z
|
/// Dynamic variables a-z
|
||||||
dyn: [Param, ..26]
|
priv dyn: [Param, ..26]
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Variables {
|
impl Variables {
|
||||||
|
|
|
@ -14,10 +14,11 @@ use std::hashmap::HashMap;
|
||||||
|
|
||||||
/// A parsed terminfo entry.
|
/// A parsed terminfo entry.
|
||||||
pub struct TermInfo {
|
pub struct TermInfo {
|
||||||
|
// made priv by redlpee
|
||||||
/// Names for the terminal
|
/// Names for the terminal
|
||||||
names: ~[~str],
|
priv names: ~[~str],
|
||||||
/// Map of capability name to boolean value
|
/// Map of capability name to boolean value
|
||||||
bools: HashMap<~str, bool>,
|
priv bools: HashMap<~str, bool>,
|
||||||
/// Map of capability name to numeric value
|
/// Map of capability name to numeric value
|
||||||
numbers: HashMap<~str, u16>,
|
numbers: HashMap<~str, u16>,
|
||||||
/// Map of capability name to raw (unexpanded) string
|
/// Map of capability name to raw (unexpanded) string
|
||||||
|
|
|
@ -102,9 +102,11 @@ impl TestFn {
|
||||||
|
|
||||||
// Structure passed to BenchFns
|
// Structure passed to BenchFns
|
||||||
pub struct BenchHarness {
|
pub struct BenchHarness {
|
||||||
iterations: u64,
|
// all changed to priv by reedlepee
|
||||||
ns_start: u64,
|
priv iterations: u64,
|
||||||
ns_end: u64,
|
priv ns_start: u64,
|
||||||
|
priv ns_end: u64,
|
||||||
|
// should be public
|
||||||
bytes: u64
|
bytes: u64
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,23 +114,27 @@ pub struct BenchHarness {
|
||||||
// these.
|
// these.
|
||||||
#[deriving(Clone)]
|
#[deriving(Clone)]
|
||||||
pub struct TestDesc {
|
pub struct TestDesc {
|
||||||
|
// all changed to priv by reedlepee
|
||||||
name: TestName,
|
name: TestName,
|
||||||
ignore: bool,
|
ignore: bool,
|
||||||
should_fail: bool
|
should_fail: bool
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct TestDescAndFn {
|
pub struct TestDescAndFn {
|
||||||
|
// all changed to priv by reedlepee
|
||||||
desc: TestDesc,
|
desc: TestDesc,
|
||||||
testfn: TestFn,
|
testfn: TestFn,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[deriving(Clone, Encodable, Decodable, Eq)]
|
#[deriving(Clone, Encodable, Decodable, Eq)]
|
||||||
pub struct Metric {
|
pub struct Metric {
|
||||||
value: f64,
|
// all changed to priv by reedlepee
|
||||||
noise: f64
|
priv value: f64,
|
||||||
|
priv noise: f64
|
||||||
}
|
}
|
||||||
|
|
||||||
#[deriving(Eq)]
|
#[deriving(Eq)]
|
||||||
|
/// not adding priv infront of this struct b/c its a tuple struct!! - reedlepee
|
||||||
pub struct MetricMap(TreeMap<~str,Metric>);
|
pub struct MetricMap(TreeMap<~str,Metric>);
|
||||||
|
|
||||||
impl Clone for MetricMap {
|
impl Clone for MetricMap {
|
||||||
|
@ -186,6 +192,7 @@ pub fn test_main_static(args: &[~str], tests: &[TestDescAndFn]) {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct TestOpts {
|
pub struct TestOpts {
|
||||||
|
/// priv added in all by reedlepee!!
|
||||||
filter: Option<~str>,
|
filter: Option<~str>,
|
||||||
run_ignored: bool,
|
run_ignored: bool,
|
||||||
run_tests: bool,
|
run_tests: bool,
|
||||||
|
@ -322,8 +329,9 @@ pub fn opt_shard(maybestr: Option<~str>) -> Option<(uint,uint)> {
|
||||||
|
|
||||||
#[deriving(Clone, Eq)]
|
#[deriving(Clone, Eq)]
|
||||||
pub struct BenchSamples {
|
pub struct BenchSamples {
|
||||||
ns_iter_summ: stats::Summary,
|
/// priv added in all by reedlepee
|
||||||
mb_s: uint
|
priv ns_iter_summ: stats::Summary,
|
||||||
|
priv mb_s: uint
|
||||||
}
|
}
|
||||||
|
|
||||||
#[deriving(Clone, Eq)]
|
#[deriving(Clone, Eq)]
|
||||||
|
|
|
@ -31,9 +31,11 @@ pub mod rustrt {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A record specifying a time value in seconds and nanoseconds.
|
/// A record specifying a time value in seconds and nanoseconds.
|
||||||
#[deriving(Clone, DeepClone, Eq, Encodable, Decodable)]
|
|
||||||
pub struct Timespec { sec: i64, nsec: i32 }
|
|
||||||
|
|
||||||
|
/// all were made priv reedlepee
|
||||||
|
|
||||||
|
#[deriving(Clone, DeepClone, Eq, Encodable, Decodable)]
|
||||||
|
pub struct Timespec { priv sec: i64, priv nsec: i32 }
|
||||||
/*
|
/*
|
||||||
* Timespec assumes that pre-epoch Timespecs have negative sec and positive
|
* Timespec assumes that pre-epoch Timespecs have negative sec and positive
|
||||||
* nsec fields. Darwin's and Linux's struct timespec functions handle pre-
|
* nsec fields. Darwin's and Linux's struct timespec functions handle pre-
|
||||||
|
@ -105,18 +107,19 @@ pub fn tzset() {
|
||||||
|
|
||||||
#[deriving(Clone, DeepClone, Eq, Encodable, Decodable)]
|
#[deriving(Clone, DeepClone, Eq, Encodable, Decodable)]
|
||||||
pub struct Tm {
|
pub struct Tm {
|
||||||
tm_sec: i32, // seconds after the minute ~[0-60]
|
/// all were made priv by reedlepee
|
||||||
tm_min: i32, // minutes after the hour ~[0-59]
|
priv tm_sec: i32, // seconds after the minute ~[0-60]
|
||||||
tm_hour: i32, // hours after midnight ~[0-23]
|
priv tm_min: i32, // minutes after the hour ~[0-59]
|
||||||
tm_mday: i32, // days of the month ~[1-31]
|
priv tm_hour: i32, // hours after midnight ~[0-23]
|
||||||
tm_mon: i32, // months since January ~[0-11]
|
priv tm_mday: i32, // days of the month ~[1-31]
|
||||||
tm_year: i32, // years since 1900
|
priv tm_mon: i32, // months since January ~[0-11]
|
||||||
tm_wday: i32, // days since Sunday ~[0-6]
|
priv tm_year: i32, // years since 1900
|
||||||
tm_yday: i32, // days since January 1 ~[0-365]
|
priv tm_wday: i32, // days since Sunday ~[0-6]
|
||||||
tm_isdst: i32, // Daylight Savings Time flag
|
priv tm_yday: i32, // days since January 1 ~[0-365]
|
||||||
tm_gmtoff: i32, // offset from UTC in seconds
|
priv tm_isdst: i32, // Daylight Savings Time flag
|
||||||
tm_zone: ~str, // timezone abbreviation
|
priv tm_gmtoff: i32, // offset from UTC in seconds
|
||||||
tm_nsec: i32, // nanoseconds
|
priv tm_zone: ~str, // timezone abbreviation
|
||||||
|
priv tm_nsec: i32, // nanoseconds
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn empty_tm() -> Tm {
|
pub fn empty_tm() -> Tm {
|
||||||
|
|
|
@ -36,6 +36,7 @@ use std::cmp::Ordering;
|
||||||
#[allow(missing_doc)]
|
#[allow(missing_doc)]
|
||||||
#[deriving(Clone)]
|
#[deriving(Clone)]
|
||||||
pub struct TreeMap<K, V> {
|
pub struct TreeMap<K, V> {
|
||||||
|
/// all were already priv!!
|
||||||
priv root: Option<~TreeNode<K, V>>,
|
priv root: Option<~TreeNode<K, V>>,
|
||||||
priv length: uint
|
priv length: uint
|
||||||
}
|
}
|
||||||
|
@ -229,6 +230,7 @@ impl<K: TotalOrd, V> TreeMap<K, V> {
|
||||||
|
|
||||||
/// Lazy forward iterator over a map
|
/// Lazy forward iterator over a map
|
||||||
pub struct TreeMapIterator<'self, K, V> {
|
pub struct TreeMapIterator<'self, K, V> {
|
||||||
|
// all were already priv
|
||||||
priv stack: ~[&'self ~TreeNode<K, V>],
|
priv stack: ~[&'self ~TreeNode<K, V>],
|
||||||
priv node: &'self Option<~TreeNode<K, V>>,
|
priv node: &'self Option<~TreeNode<K, V>>,
|
||||||
priv remaining_min: uint,
|
priv remaining_min: uint,
|
||||||
|
@ -275,6 +277,7 @@ impl<'self, K, V> Iterator<(&'self K, &'self V)> for TreeMapIterator<'self, K, V
|
||||||
|
|
||||||
/// Lazy backward iterator over a map
|
/// Lazy backward iterator over a map
|
||||||
pub struct TreeMapRevIterator<'self, K, V> {
|
pub struct TreeMapRevIterator<'self, K, V> {
|
||||||
|
// all were already priv
|
||||||
priv iter: TreeMapIterator<'self, K, V>,
|
priv iter: TreeMapIterator<'self, K, V>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -333,6 +336,7 @@ fn iter_traverse_complete<'a, K, V>(it: &mut TreeMapIterator<'a, K, V>) {
|
||||||
|
|
||||||
/// Lazy forward iterator over a map that consumes the map while iterating
|
/// Lazy forward iterator over a map that consumes the map while iterating
|
||||||
pub struct TreeMapMoveIterator<K, V> {
|
pub struct TreeMapMoveIterator<K, V> {
|
||||||
|
// all were laready priv!!
|
||||||
priv stack: ~[TreeNode<K, V>],
|
priv stack: ~[TreeNode<K, V>],
|
||||||
priv remaining: uint
|
priv remaining: uint
|
||||||
}
|
}
|
||||||
|
@ -401,6 +405,7 @@ impl<'self, T> Iterator<&'self T> for TreeSetRevIterator<'self, T> {
|
||||||
/// only requirement is that the type of the elements contained ascribes to the
|
/// only requirement is that the type of the elements contained ascribes to the
|
||||||
/// `TotalOrd` trait.
|
/// `TotalOrd` trait.
|
||||||
pub struct TreeSet<T> {
|
pub struct TreeSet<T> {
|
||||||
|
//all were already priv
|
||||||
priv map: TreeMap<T, ()>
|
priv map: TreeMap<T, ()>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -553,34 +558,40 @@ impl<T: TotalOrd> TreeSet<T> {
|
||||||
|
|
||||||
/// Lazy forward iterator over a set
|
/// Lazy forward iterator over a set
|
||||||
pub struct TreeSetIterator<'self, T> {
|
pub struct TreeSetIterator<'self, T> {
|
||||||
|
// all were already priv
|
||||||
priv iter: TreeMapIterator<'self, T, ()>
|
priv iter: TreeMapIterator<'self, T, ()>
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Lazy backward iterator over a set
|
/// Lazy backward iterator over a set
|
||||||
pub struct TreeSetRevIterator<'self, T> {
|
pub struct TreeSetRevIterator<'self, T> {
|
||||||
|
// all were already priv
|
||||||
priv iter: TreeMapRevIterator<'self, T, ()>
|
priv iter: TreeMapRevIterator<'self, T, ()>
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Lazy iterator producing elements in the set difference (in-order)
|
/// Lazy iterator producing elements in the set difference (in-order)
|
||||||
pub struct Difference<'self, T> {
|
pub struct Difference<'self, T> {
|
||||||
|
// all were already priv
|
||||||
priv a: Peekable<&'self T, TreeSetIterator<'self, T>>,
|
priv a: Peekable<&'self T, TreeSetIterator<'self, T>>,
|
||||||
priv b: Peekable<&'self T, TreeSetIterator<'self, T>>,
|
priv b: Peekable<&'self T, TreeSetIterator<'self, T>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Lazy iterator producing elements in the set symmetric difference (in-order)
|
/// Lazy iterator producing elements in the set symmetric difference (in-order)
|
||||||
pub struct SymDifference<'self, T> {
|
pub struct SymDifference<'self, T> {
|
||||||
|
// all were already priv
|
||||||
priv a: Peekable<&'self T, TreeSetIterator<'self, T>>,
|
priv a: Peekable<&'self T, TreeSetIterator<'self, T>>,
|
||||||
priv b: Peekable<&'self T, TreeSetIterator<'self, T>>,
|
priv b: Peekable<&'self T, TreeSetIterator<'self, T>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Lazy iterator producing elements in the set intersection (in-order)
|
/// Lazy iterator producing elements in the set intersection (in-order)
|
||||||
pub struct Intersection<'self, T> {
|
pub struct Intersection<'self, T> {
|
||||||
|
// all were already priv
|
||||||
priv a: Peekable<&'self T, TreeSetIterator<'self, T>>,
|
priv a: Peekable<&'self T, TreeSetIterator<'self, T>>,
|
||||||
priv b: Peekable<&'self T, TreeSetIterator<'self, T>>,
|
priv b: Peekable<&'self T, TreeSetIterator<'self, T>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Lazy iterator producing elements in the set intersection (in-order)
|
/// Lazy iterator producing elements in the set intersection (in-order)
|
||||||
pub struct Union<'self, T> {
|
pub struct Union<'self, T> {
|
||||||
|
// all were already priv
|
||||||
priv a: Peekable<&'self T, TreeSetIterator<'self, T>>,
|
priv a: Peekable<&'self T, TreeSetIterator<'self, T>>,
|
||||||
priv b: Peekable<&'self T, TreeSetIterator<'self, T>>,
|
priv b: Peekable<&'self T, TreeSetIterator<'self, T>>,
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,19 +22,21 @@ use std::uint;
|
||||||
|
|
||||||
#[deriving(Clone, Eq)]
|
#[deriving(Clone, Eq)]
|
||||||
pub struct Url {
|
pub struct Url {
|
||||||
scheme: ~str,
|
// all were made privv bt reedlepee
|
||||||
user: Option<UserInfo>,
|
priv scheme: ~str,
|
||||||
host: ~str,
|
priv user: Option<UserInfo>,
|
||||||
port: Option<~str>,
|
priv host: ~str,
|
||||||
path: ~str,
|
priv port: Option<~str>,
|
||||||
query: Query,
|
priv path: ~str,
|
||||||
fragment: Option<~str>
|
priv query: Query,
|
||||||
|
priv fragment: Option<~str>
|
||||||
}
|
}
|
||||||
|
|
||||||
#[deriving(Clone, Eq)]
|
#[deriving(Clone, Eq)]
|
||||||
pub struct UserInfo {
|
pub struct UserInfo {
|
||||||
user: ~str,
|
// all were made privv bt reedlepee
|
||||||
pass: Option<~str>
|
priv user: ~str,
|
||||||
|
priv pass: Option<~str>
|
||||||
}
|
}
|
||||||
|
|
||||||
pub type Query = ~[(~str, ~str)];
|
pub type Query = ~[(~str, ~str)];
|
||||||
|
|
|
@ -102,6 +102,7 @@ pub enum UuidVariant {
|
||||||
/// A Universally Unique Identifier (UUID)
|
/// A Universally Unique Identifier (UUID)
|
||||||
pub struct Uuid {
|
pub struct Uuid {
|
||||||
/// The 128-bit number stored in 16 bytes
|
/// The 128-bit number stored in 16 bytes
|
||||||
|
/// should be public
|
||||||
bytes: UuidBytes
|
bytes: UuidBytes
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -128,8 +128,9 @@ impl WorkMap {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct Database {
|
pub struct Database {
|
||||||
db_filename: Path,
|
/// all were made by reedlepee
|
||||||
db_cache: TreeMap<~str, ~str>,
|
priv db_filename: Path,
|
||||||
|
priv db_cache: TreeMap<~str, ~str>,
|
||||||
db_dirty: bool
|
db_dirty: bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -209,7 +210,8 @@ impl Drop for Database {
|
||||||
|
|
||||||
pub struct Logger {
|
pub struct Logger {
|
||||||
// FIXME #4432: Fill in
|
// FIXME #4432: Fill in
|
||||||
a: ()
|
/// alll were made priv reeldepee
|
||||||
|
priv a: ()
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Logger {
|
impl Logger {
|
||||||
|
@ -227,27 +229,30 @@ pub type FreshnessMap = TreeMap<~str,extern fn(&str,&str)->bool>;
|
||||||
|
|
||||||
#[deriving(Clone)]
|
#[deriving(Clone)]
|
||||||
pub struct Context {
|
pub struct Context {
|
||||||
|
//// all were made priv by reedlepee
|
||||||
db: RWArc<Database>,
|
db: RWArc<Database>,
|
||||||
logger: RWArc<Logger>,
|
priv logger: RWArc<Logger>,
|
||||||
cfg: Arc<json::Object>,
|
priv cfg: Arc<json::Object>,
|
||||||
/// Map from kinds (source, exe, url, etc.) to a freshness function.
|
/// Map from kinds (source, exe, url, etc.) to a freshness function.
|
||||||
/// The freshness function takes a name (e.g. file path) and value
|
/// The freshness function takes a name (e.g. file path) and value
|
||||||
/// (e.g. hash of file contents) and determines whether it's up-to-date.
|
/// (e.g. hash of file contents) and determines whether it's up-to-date.
|
||||||
/// For example, in the file case, this would read the file off disk,
|
/// For example, in the file case, this would read the file off disk,
|
||||||
/// hash it, and return the result of comparing the given hash and the
|
/// hash it, and return the result of comparing the given hash and the
|
||||||
/// read hash for equality.
|
/// read hash for equality.
|
||||||
freshness: Arc<FreshnessMap>
|
priv freshness: Arc<FreshnessMap>
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct Prep<'self> {
|
pub struct Prep<'self> {
|
||||||
ctxt: &'self Context,
|
//// all were made priv by reedlepee
|
||||||
fn_name: &'self str,
|
priv ctxt: &'self Context,
|
||||||
declared_inputs: WorkMap,
|
priv fn_name: &'self str,
|
||||||
|
priv declared_inputs: WorkMap,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct Exec {
|
pub struct Exec {
|
||||||
discovered_inputs: WorkMap,
|
//// all were made priv by reedlepee
|
||||||
discovered_outputs: WorkMap
|
priv discovered_inputs: WorkMap,
|
||||||
|
priv discovered_outputs: WorkMap
|
||||||
}
|
}
|
||||||
|
|
||||||
enum Work<'self, T> {
|
enum Work<'self, T> {
|
||||||
|
|
|
@ -92,6 +92,7 @@ condition! {
|
||||||
/// This structure wraps a `*libc::c_char`, and will automatically free the
|
/// This structure wraps a `*libc::c_char`, and will automatically free the
|
||||||
/// memory it is pointing to when it goes out of scope.
|
/// memory it is pointing to when it goes out of scope.
|
||||||
pub struct CString {
|
pub struct CString {
|
||||||
|
// already priv
|
||||||
priv buf: *libc::c_char,
|
priv buf: *libc::c_char,
|
||||||
priv owns_buffer_: bool,
|
priv owns_buffer_: bool,
|
||||||
}
|
}
|
||||||
|
@ -332,6 +333,7 @@ fn check_for_null(v: &[u8], buf: *mut libc::c_char) {
|
||||||
///
|
///
|
||||||
/// Use with the `std::iterator` module.
|
/// Use with the `std::iterator` module.
|
||||||
pub struct CStringIterator<'self> {
|
pub struct CStringIterator<'self> {
|
||||||
|
// already priv
|
||||||
priv ptr: *libc::c_char,
|
priv ptr: *libc::c_char,
|
||||||
priv lifetime: &'self libc::c_char, // FIXME: #5922
|
priv lifetime: &'self libc::c_char, // FIXME: #5922
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,7 @@ Similar to a mutable option type, but friendlier.
|
||||||
#[deriving(Clone, DeepClone, Eq)]
|
#[deriving(Clone, DeepClone, Eq)]
|
||||||
#[allow(missing_doc)]
|
#[allow(missing_doc)]
|
||||||
pub struct Cell<T> {
|
pub struct Cell<T> {
|
||||||
|
// already priv
|
||||||
priv value: Option<T>
|
priv value: Option<T>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -72,6 +72,7 @@ use unstable::raw::Closure;
|
||||||
|
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
pub struct Handler<T, U> {
|
pub struct Handler<T, U> {
|
||||||
|
//already priv
|
||||||
priv handle: Closure,
|
priv handle: Closure,
|
||||||
priv prev: Option<@Handler<T, U>>,
|
priv prev: Option<@Handler<T, U>>,
|
||||||
}
|
}
|
||||||
|
@ -83,6 +84,7 @@ pub struct Handler<T, U> {
|
||||||
/// This struct should never be created directly, but rather only through the
|
/// This struct should never be created directly, but rather only through the
|
||||||
/// `condition!` macro provided to all libraries using libstd.
|
/// `condition!` macro provided to all libraries using libstd.
|
||||||
pub struct Condition<T, U> {
|
pub struct Condition<T, U> {
|
||||||
|
// all made priv by reedlepee
|
||||||
/// Name of the condition handler
|
/// Name of the condition handler
|
||||||
name: &'static str,
|
name: &'static str,
|
||||||
/// TLS key used to insert/remove values in TLS.
|
/// TLS key used to insert/remove values in TLS.
|
||||||
|
|
|
@ -477,6 +477,7 @@ pub mod rt;
|
||||||
/// should be formatted. A mutable version of this is passed to all formatting
|
/// should be formatted. A mutable version of this is passed to all formatting
|
||||||
/// traits.
|
/// traits.
|
||||||
pub struct Formatter<'self> {
|
pub struct Formatter<'self> {
|
||||||
|
// made by reedlepee
|
||||||
/// Flags for formatting (packed version of rt::Flag)
|
/// Flags for formatting (packed version of rt::Flag)
|
||||||
flags: uint,
|
flags: uint,
|
||||||
/// Character used as 'fill' whenever there is alignment
|
/// Character used as 'fill' whenever there is alignment
|
||||||
|
@ -491,6 +492,7 @@ pub struct Formatter<'self> {
|
||||||
/// Output buffer.
|
/// Output buffer.
|
||||||
buf: &'self mut io::Writer,
|
buf: &'self mut io::Writer,
|
||||||
|
|
||||||
|
// already priv
|
||||||
priv curarg: vec::VecIterator<'self, Argument<'self>>,
|
priv curarg: vec::VecIterator<'self, Argument<'self>>,
|
||||||
priv args: &'self [Argument<'self>],
|
priv args: &'self [Argument<'self>],
|
||||||
}
|
}
|
||||||
|
@ -500,6 +502,7 @@ pub struct Formatter<'self> {
|
||||||
/// compile time it is ensured that the function and the value have the correct
|
/// compile time it is ensured that the function and the value have the correct
|
||||||
/// types, and then this struct is used to canonicalize arguments to one type.
|
/// types, and then this struct is used to canonicalize arguments to one type.
|
||||||
pub struct Argument<'self> {
|
pub struct Argument<'self> {
|
||||||
|
// already priv
|
||||||
priv formatter: extern "Rust" fn(&util::Void, &mut Formatter),
|
priv formatter: extern "Rust" fn(&util::Void, &mut Formatter),
|
||||||
priv value: &'self util::Void,
|
priv value: &'self util::Void,
|
||||||
}
|
}
|
||||||
|
@ -526,6 +529,7 @@ impl<'self> Arguments<'self> {
|
||||||
/// string at compile-time so usage of the `write` and `format` functions can
|
/// string at compile-time so usage of the `write` and `format` functions can
|
||||||
/// be safely performed.
|
/// be safely performed.
|
||||||
pub struct Arguments<'self> {
|
pub struct Arguments<'self> {
|
||||||
|
// already priv
|
||||||
priv fmt: &'self [rt::Piece<'self>],
|
priv fmt: &'self [rt::Piece<'self>],
|
||||||
priv args: &'self [Argument<'self>],
|
priv args: &'self [Argument<'self>],
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,17 +38,20 @@ pub enum Piece<'self> {
|
||||||
/// Representation of an argument specification.
|
/// Representation of an argument specification.
|
||||||
#[deriving(Eq)]
|
#[deriving(Eq)]
|
||||||
pub struct Argument<'self> {
|
pub struct Argument<'self> {
|
||||||
|
// made by reedlepee
|
||||||
/// Where to find this argument
|
/// Where to find this argument
|
||||||
position: Position<'self>,
|
position: Position<'self>,
|
||||||
/// How to format the argument
|
/// How to format the argument
|
||||||
format: FormatSpec<'self>,
|
format: FormatSpec<'self>,
|
||||||
/// If not `None`, what method to invoke on the argument
|
/// If not `None`, what method to invoke on the argument
|
||||||
|
// should be public
|
||||||
method: Option<~Method<'self>>
|
method: Option<~Method<'self>>
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Specification for the formatting of an argument in the format string.
|
/// Specification for the formatting of an argument in the format string.
|
||||||
#[deriving(Eq)]
|
#[deriving(Eq)]
|
||||||
pub struct FormatSpec<'self> {
|
pub struct FormatSpec<'self> {
|
||||||
|
// made by reedlepee
|
||||||
/// Optionally specified character to fill alignment with
|
/// Optionally specified character to fill alignment with
|
||||||
fill: Option<char>,
|
fill: Option<char>,
|
||||||
/// Optionally specified alignment
|
/// Optionally specified alignment
|
||||||
|
@ -125,6 +128,7 @@ pub enum Method<'self> {
|
||||||
/// Structure representing one "arm" of the `plural` function.
|
/// Structure representing one "arm" of the `plural` function.
|
||||||
#[deriving(Eq)]
|
#[deriving(Eq)]
|
||||||
pub struct PluralArm<'self> {
|
pub struct PluralArm<'self> {
|
||||||
|
// made by reedlepee
|
||||||
/// A selector can either be specified by a keyword or with an integer
|
/// A selector can either be specified by a keyword or with an integer
|
||||||
/// literal.
|
/// literal.
|
||||||
selector: Either<PluralKeyword, uint>,
|
selector: Either<PluralKeyword, uint>,
|
||||||
|
@ -145,6 +149,7 @@ pub enum PluralKeyword {
|
||||||
/// Structure representing one "arm" of the `select` function.
|
/// Structure representing one "arm" of the `select` function.
|
||||||
#[deriving(Eq)]
|
#[deriving(Eq)]
|
||||||
pub struct SelectArm<'self> {
|
pub struct SelectArm<'self> {
|
||||||
|
// made by reedlepee
|
||||||
/// String selector which guards this arm
|
/// String selector which guards this arm
|
||||||
selector: &'self str,
|
selector: &'self str,
|
||||||
/// Array of pieces which are the format of this arm
|
/// Array of pieces which are the format of this arm
|
||||||
|
@ -158,6 +163,7 @@ pub struct SelectArm<'self> {
|
||||||
/// This is a recursive-descent parser for the sake of simplicity, and if
|
/// This is a recursive-descent parser for the sake of simplicity, and if
|
||||||
/// necessary there's probably lots of room for improvement performance-wise.
|
/// necessary there's probably lots of room for improvement performance-wise.
|
||||||
pub struct Parser<'self> {
|
pub struct Parser<'self> {
|
||||||
|
// already priv
|
||||||
priv input: &'self str,
|
priv input: &'self str,
|
||||||
priv cur: str::CharOffsetIterator<'self>,
|
priv cur: str::CharOffsetIterator<'self>,
|
||||||
priv depth: uint,
|
priv depth: uint,
|
||||||
|
|
|
@ -29,12 +29,14 @@ pub enum Piece<'self> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct Argument<'self> {
|
pub struct Argument<'self> {
|
||||||
|
/// should be public
|
||||||
position: Position,
|
position: Position,
|
||||||
format: FormatSpec,
|
format: FormatSpec,
|
||||||
method: Option<&'self Method<'self>>
|
method: Option<&'self Method<'self>>
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct FormatSpec {
|
pub struct FormatSpec {
|
||||||
|
/// made by redlepee
|
||||||
fill: char,
|
fill: char,
|
||||||
align: parse::Alignment,
|
align: parse::Alignment,
|
||||||
flags: uint,
|
flags: uint,
|
||||||
|
@ -56,11 +58,13 @@ pub enum Method<'self> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct PluralArm<'self> {
|
pub struct PluralArm<'self> {
|
||||||
|
/// made by redlepee
|
||||||
selector: Either<parse::PluralKeyword, uint>,
|
selector: Either<parse::PluralKeyword, uint>,
|
||||||
result: &'self [Piece<'self>],
|
result: &'self [Piece<'self>],
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct SelectArm<'self> {
|
pub struct SelectArm<'self> {
|
||||||
|
/// made by redlepee
|
||||||
selector: &'self str,
|
selector: &'self str,
|
||||||
result: &'self [Piece<'self>],
|
result: &'self [Piece<'self>],
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,6 +48,7 @@ struct Bucket<K,V> {
|
||||||
/// `IterBytes` traits as `Hash` is automatically implemented for types that
|
/// `IterBytes` traits as `Hash` is automatically implemented for types that
|
||||||
/// implement `IterBytes`.
|
/// implement `IterBytes`.
|
||||||
pub struct HashMap<K,V> {
|
pub struct HashMap<K,V> {
|
||||||
|
// already priv
|
||||||
priv k0: u64,
|
priv k0: u64,
|
||||||
priv k1: u64,
|
priv k1: u64,
|
||||||
priv resize_at: uint,
|
priv resize_at: uint,
|
||||||
|
@ -517,27 +518,32 @@ impl<K:Hash + Eq + Clone,V:Clone> Clone for HashMap<K,V> {
|
||||||
/// HashMap iterator
|
/// HashMap iterator
|
||||||
#[deriving(Clone)]
|
#[deriving(Clone)]
|
||||||
pub struct HashMapIterator<'self, K, V> {
|
pub struct HashMapIterator<'self, K, V> {
|
||||||
|
// already priv
|
||||||
priv iter: vec::VecIterator<'self, Option<Bucket<K, V>>>,
|
priv iter: vec::VecIterator<'self, Option<Bucket<K, V>>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// HashMap mutable values iterator
|
/// HashMap mutable values iterator
|
||||||
pub struct HashMapMutIterator<'self, K, V> {
|
pub struct HashMapMutIterator<'self, K, V> {
|
||||||
|
// already priv
|
||||||
priv iter: vec::VecMutIterator<'self, Option<Bucket<K, V>>>,
|
priv iter: vec::VecMutIterator<'self, Option<Bucket<K, V>>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// HashMap move iterator
|
/// HashMap move iterator
|
||||||
pub struct HashMapMoveIterator<K, V> {
|
pub struct HashMapMoveIterator<K, V> {
|
||||||
|
// already priv
|
||||||
priv iter: vec::MoveRevIterator<Option<Bucket<K, V>>>,
|
priv iter: vec::MoveRevIterator<Option<Bucket<K, V>>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// HashSet iterator
|
/// HashSet iterator
|
||||||
#[deriving(Clone)]
|
#[deriving(Clone)]
|
||||||
pub struct HashSetIterator<'self, K> {
|
pub struct HashSetIterator<'self, K> {
|
||||||
|
// already priv
|
||||||
priv iter: vec::VecIterator<'self, Option<Bucket<K, ()>>>,
|
priv iter: vec::VecIterator<'self, Option<Bucket<K, ()>>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// HashSet move iterator
|
/// HashSet move iterator
|
||||||
pub struct HashSetMoveIterator<K> {
|
pub struct HashSetMoveIterator<K> {
|
||||||
|
// already priv
|
||||||
priv iter: vec::MoveRevIterator<Option<Bucket<K, ()>>>,
|
priv iter: vec::MoveRevIterator<Option<Bucket<K, ()>>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -631,6 +637,7 @@ impl<K: Eq + Hash, V> Default for HashMap<K, V> {
|
||||||
/// HashMap where the value is (). As with the `HashMap` type, a `HashSet`
|
/// HashMap where the value is (). As with the `HashMap` type, a `HashSet`
|
||||||
/// requires that the elements implement the `Eq` and `Hash` traits.
|
/// requires that the elements implement the `Eq` and `Hash` traits.
|
||||||
pub struct HashSet<T> {
|
pub struct HashSet<T> {
|
||||||
|
// already priv
|
||||||
priv map: HashMap<T, ()>
|
priv map: HashMap<T, ()>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1009,7 +1009,8 @@ impl<R:Reader,C> Reader for Wrapper<R, C> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct FILERes {
|
pub struct FILERes {
|
||||||
f: *libc::FILE,
|
// all by reedlepee
|
||||||
|
priv f: *libc::FILE,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl FILERes {
|
impl FILERes {
|
||||||
|
@ -1080,6 +1081,7 @@ pub fn file_reader(path: &Path) -> Result<@Reader, ~str> {
|
||||||
|
|
||||||
// Byte readers
|
// Byte readers
|
||||||
pub struct BytesReader {
|
pub struct BytesReader {
|
||||||
|
// all by reedlepee
|
||||||
// FIXME(#5723) see other FIXME below
|
// FIXME(#5723) see other FIXME below
|
||||||
// FIXME(#7268) this should also be parameterized over <'self>
|
// FIXME(#7268) this should also be parameterized over <'self>
|
||||||
bytes: &'static [u8],
|
bytes: &'static [u8],
|
||||||
|
@ -1282,7 +1284,8 @@ impl Writer for fd_t {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct FdRes {
|
pub struct FdRes {
|
||||||
fd: fd_t,
|
// all by reedlepee
|
||||||
|
priv fd: fd_t,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl FdRes {
|
impl FdRes {
|
||||||
|
@ -1674,6 +1677,7 @@ pub fn println(s: &str) {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct BytesWriter {
|
pub struct BytesWriter {
|
||||||
|
// all by reedlepee
|
||||||
bytes: @mut ~[u8],
|
bytes: @mut ~[u8],
|
||||||
pos: @mut uint,
|
pos: @mut uint,
|
||||||
}
|
}
|
||||||
|
@ -1792,7 +1796,8 @@ pub mod fsync {
|
||||||
|
|
||||||
// Artifacts that need to fsync on destruction
|
// Artifacts that need to fsync on destruction
|
||||||
pub struct Res<t> {
|
pub struct Res<t> {
|
||||||
arg: Arg<t>,
|
// all by reedlepee
|
||||||
|
priv arg: Arg<t>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl <t> Res<t> {
|
impl <t> Res<t> {
|
||||||
|
@ -1815,9 +1820,10 @@ pub mod fsync {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct Arg<t> {
|
pub struct Arg<t> {
|
||||||
val: t,
|
// all by reedlepee
|
||||||
opt_level: Option<Level>,
|
priv val: t,
|
||||||
fsync_fn: extern "Rust" fn(f: &t, Level) -> int,
|
priv opt_level: Option<Level>,
|
||||||
|
priv fsync_fn: extern "Rust" fn(f: &t, Level) -> int,
|
||||||
}
|
}
|
||||||
|
|
||||||
// fsync file after executing blk
|
// fsync file after executing blk
|
||||||
|
|
|
@ -765,6 +765,8 @@ impl<A, B, T: ExactSize<A>, U: ExactSize<B>> ExactSize<(A, B)> for Zip<T, U> {}
|
||||||
/// An double-ended iterator with the direction inverted
|
/// An double-ended iterator with the direction inverted
|
||||||
#[deriving(Clone)]
|
#[deriving(Clone)]
|
||||||
pub struct Invert<T> {
|
pub struct Invert<T> {
|
||||||
|
// already priv
|
||||||
|
// already priv
|
||||||
priv iter: T
|
priv iter: T
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -792,6 +794,7 @@ impl<A, T: DoubleEndedIterator<A> + RandomAccessIterator<A>> RandomAccessIterato
|
||||||
|
|
||||||
/// A mutable reference to an iterator
|
/// A mutable reference to an iterator
|
||||||
pub struct ByRef<'self, T> {
|
pub struct ByRef<'self, T> {
|
||||||
|
// already priv
|
||||||
priv iter: &'self mut T
|
priv iter: &'self mut T
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -927,6 +930,7 @@ impl<A, T: Clone + Iterator<A>> ClonableIterator for T {
|
||||||
/// An iterator that repeats endlessly
|
/// An iterator that repeats endlessly
|
||||||
#[deriving(Clone)]
|
#[deriving(Clone)]
|
||||||
pub struct Cycle<T> {
|
pub struct Cycle<T> {
|
||||||
|
// already priv
|
||||||
priv orig: T,
|
priv orig: T,
|
||||||
priv iter: T,
|
priv iter: T,
|
||||||
}
|
}
|
||||||
|
@ -978,6 +982,7 @@ impl<A, T: Clone + RandomAccessIterator<A>> RandomAccessIterator<A> for Cycle<T>
|
||||||
/// An iterator which strings two iterators together
|
/// An iterator which strings two iterators together
|
||||||
#[deriving(Clone)]
|
#[deriving(Clone)]
|
||||||
pub struct Chain<T, U> {
|
pub struct Chain<T, U> {
|
||||||
|
// already priv
|
||||||
priv a: T,
|
priv a: T,
|
||||||
priv b: U,
|
priv b: U,
|
||||||
priv flag: bool
|
priv flag: bool
|
||||||
|
@ -1047,6 +1052,7 @@ for Chain<T, U> {
|
||||||
/// An iterator which iterates two other iterators simultaneously
|
/// An iterator which iterates two other iterators simultaneously
|
||||||
#[deriving(Clone)]
|
#[deriving(Clone)]
|
||||||
pub struct Zip<T, U> {
|
pub struct Zip<T, U> {
|
||||||
|
// already priv
|
||||||
priv a: T,
|
priv a: T,
|
||||||
priv b: U
|
priv b: U
|
||||||
}
|
}
|
||||||
|
@ -1125,6 +1131,7 @@ RandomAccessIterator<(A, B)> for Zip<T, U> {
|
||||||
|
|
||||||
/// An iterator which maps the values of `iter` with `f`
|
/// An iterator which maps the values of `iter` with `f`
|
||||||
pub struct Map<'self, A, B, T> {
|
pub struct Map<'self, A, B, T> {
|
||||||
|
// already priv
|
||||||
priv iter: T,
|
priv iter: T,
|
||||||
priv f: &'self fn(A) -> B
|
priv f: &'self fn(A) -> B
|
||||||
}
|
}
|
||||||
|
@ -1174,6 +1181,7 @@ impl<'self, A, B, T: RandomAccessIterator<A>> RandomAccessIterator<B> for Map<'s
|
||||||
|
|
||||||
/// An iterator which filters the elements of `iter` with `predicate`
|
/// An iterator which filters the elements of `iter` with `predicate`
|
||||||
pub struct Filter<'self, A, T> {
|
pub struct Filter<'self, A, T> {
|
||||||
|
// already priv
|
||||||
priv iter: T,
|
priv iter: T,
|
||||||
priv predicate: &'self fn(&A) -> bool
|
priv predicate: &'self fn(&A) -> bool
|
||||||
}
|
}
|
||||||
|
@ -1218,6 +1226,7 @@ impl<'self, A, T: DoubleEndedIterator<A>> DoubleEndedIterator<A> for Filter<'sel
|
||||||
|
|
||||||
/// An iterator which uses `f` to both filter and map elements from `iter`
|
/// An iterator which uses `f` to both filter and map elements from `iter`
|
||||||
pub struct FilterMap<'self, A, B, T> {
|
pub struct FilterMap<'self, A, B, T> {
|
||||||
|
// already priv
|
||||||
priv iter: T,
|
priv iter: T,
|
||||||
priv f: &'self fn(A) -> Option<B>
|
priv f: &'self fn(A) -> Option<B>
|
||||||
}
|
}
|
||||||
|
@ -1262,6 +1271,7 @@ for FilterMap<'self, A, B, T> {
|
||||||
/// An iterator which yields the current count and the element during iteration
|
/// An iterator which yields the current count and the element during iteration
|
||||||
#[deriving(Clone)]
|
#[deriving(Clone)]
|
||||||
pub struct Enumerate<T> {
|
pub struct Enumerate<T> {
|
||||||
|
// already priv
|
||||||
priv iter: T,
|
priv iter: T,
|
||||||
priv count: uint
|
priv count: uint
|
||||||
}
|
}
|
||||||
|
@ -1316,6 +1326,7 @@ impl<A, T: RandomAccessIterator<A>> RandomAccessIterator<(uint, A)> for Enumerat
|
||||||
|
|
||||||
/// An iterator with a `peek()` that returns an optional reference to the next element.
|
/// An iterator with a `peek()` that returns an optional reference to the next element.
|
||||||
pub struct Peekable<A, T> {
|
pub struct Peekable<A, T> {
|
||||||
|
// already priv
|
||||||
priv iter: T,
|
priv iter: T,
|
||||||
priv peeked: Option<A>,
|
priv peeked: Option<A>,
|
||||||
}
|
}
|
||||||
|
@ -1360,6 +1371,7 @@ impl<'self, A, T: Iterator<A>> Peekable<A, T> {
|
||||||
|
|
||||||
/// An iterator which rejects elements while `predicate` is true
|
/// An iterator which rejects elements while `predicate` is true
|
||||||
pub struct SkipWhile<'self, A, T> {
|
pub struct SkipWhile<'self, A, T> {
|
||||||
|
// already priv
|
||||||
priv iter: T,
|
priv iter: T,
|
||||||
priv flag: bool,
|
priv flag: bool,
|
||||||
priv predicate: &'self fn(&A) -> bool
|
priv predicate: &'self fn(&A) -> bool
|
||||||
|
@ -1398,6 +1410,7 @@ impl<'self, A, T: Iterator<A>> Iterator<A> for SkipWhile<'self, A, T> {
|
||||||
|
|
||||||
/// An iterator which only accepts elements while `predicate` is true
|
/// An iterator which only accepts elements while `predicate` is true
|
||||||
pub struct TakeWhile<'self, A, T> {
|
pub struct TakeWhile<'self, A, T> {
|
||||||
|
// already priv
|
||||||
priv iter: T,
|
priv iter: T,
|
||||||
priv flag: bool,
|
priv flag: bool,
|
||||||
priv predicate: &'self fn(&A) -> bool
|
priv predicate: &'self fn(&A) -> bool
|
||||||
|
@ -1433,6 +1446,7 @@ impl<'self, A, T: Iterator<A>> Iterator<A> for TakeWhile<'self, A, T> {
|
||||||
/// An iterator which skips over `n` elements of `iter`.
|
/// An iterator which skips over `n` elements of `iter`.
|
||||||
#[deriving(Clone)]
|
#[deriving(Clone)]
|
||||||
pub struct Skip<T> {
|
pub struct Skip<T> {
|
||||||
|
// already priv
|
||||||
priv iter: T,
|
priv iter: T,
|
||||||
priv n: uint
|
priv n: uint
|
||||||
}
|
}
|
||||||
|
@ -1497,6 +1511,7 @@ impl<A, T: RandomAccessIterator<A>> RandomAccessIterator<A> for Skip<T> {
|
||||||
/// An iterator which only iterates over the first `n` iterations of `iter`.
|
/// An iterator which only iterates over the first `n` iterations of `iter`.
|
||||||
#[deriving(Clone)]
|
#[deriving(Clone)]
|
||||||
pub struct Take<T> {
|
pub struct Take<T> {
|
||||||
|
// already priv
|
||||||
priv iter: T,
|
priv iter: T,
|
||||||
priv n: uint
|
priv n: uint
|
||||||
}
|
}
|
||||||
|
@ -1546,11 +1561,13 @@ impl<A, T: RandomAccessIterator<A>> RandomAccessIterator<A> for Take<T> {
|
||||||
|
|
||||||
/// An iterator to maintain state while iterating another iterator
|
/// An iterator to maintain state while iterating another iterator
|
||||||
pub struct Scan<'self, A, B, T, St> {
|
pub struct Scan<'self, A, B, T, St> {
|
||||||
|
// already priv
|
||||||
priv iter: T,
|
priv iter: T,
|
||||||
priv f: &'self fn(&mut St, A) -> Option<B>,
|
priv f: &'self fn(&mut St, A) -> Option<B>,
|
||||||
|
|
||||||
/// The current internal state to be passed to the closure next.
|
/// The current internal state to be passed to the closure next.
|
||||||
state: St
|
// priv by reedlepee
|
||||||
|
priv state: St
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'self, A, B, T: Iterator<A>, St> Iterator<B> for Scan<'self, A, B, T, St> {
|
impl<'self, A, B, T: Iterator<A>, St> Iterator<B> for Scan<'self, A, B, T, St> {
|
||||||
|
@ -1570,6 +1587,7 @@ impl<'self, A, B, T: Iterator<A>, St> Iterator<B> for Scan<'self, A, B, T, St> {
|
||||||
/// and yields the elements of the produced iterators
|
/// and yields the elements of the produced iterators
|
||||||
///
|
///
|
||||||
pub struct FlatMap<'self, A, T, U> {
|
pub struct FlatMap<'self, A, T, U> {
|
||||||
|
// already priv
|
||||||
priv iter: T,
|
priv iter: T,
|
||||||
priv f: &'self fn(A) -> U,
|
priv f: &'self fn(A) -> U,
|
||||||
priv frontiter: Option<U>,
|
priv frontiter: Option<U>,
|
||||||
|
@ -1629,6 +1647,7 @@ impl<'self,
|
||||||
/// yields `None` once.
|
/// yields `None` once.
|
||||||
#[deriving(Clone, DeepClone)]
|
#[deriving(Clone, DeepClone)]
|
||||||
pub struct Fuse<T> {
|
pub struct Fuse<T> {
|
||||||
|
// already priv
|
||||||
priv iter: T,
|
priv iter: T,
|
||||||
priv done: bool
|
priv done: bool
|
||||||
}
|
}
|
||||||
|
@ -1701,6 +1720,7 @@ impl<T> Fuse<T> {
|
||||||
/// An iterator that calls a function with a reference to each
|
/// An iterator that calls a function with a reference to each
|
||||||
/// element before yielding it.
|
/// element before yielding it.
|
||||||
pub struct Inspect<'self, A, T> {
|
pub struct Inspect<'self, A, T> {
|
||||||
|
// already priv
|
||||||
priv iter: T,
|
priv iter: T,
|
||||||
priv f: &'self fn(&A)
|
priv f: &'self fn(&A)
|
||||||
}
|
}
|
||||||
|
@ -1754,8 +1774,10 @@ for Inspect<'self, A, T> {
|
||||||
|
|
||||||
/// An iterator which just modifies the contained state throughout iteration.
|
/// An iterator which just modifies the contained state throughout iteration.
|
||||||
pub struct Unfold<'self, A, St> {
|
pub struct Unfold<'self, A, St> {
|
||||||
|
// already priv
|
||||||
priv f: &'self fn(&mut St) -> Option<A>,
|
priv f: &'self fn(&mut St) -> Option<A>,
|
||||||
/// Internal state that will be yielded on the next iteration
|
/// Internal state that will be yielded on the next iteration
|
||||||
|
/// priv reedlepee
|
||||||
state: St
|
state: St
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1789,10 +1811,11 @@ impl<'self, A, St> Iterator<A> for Unfold<'self, A, St> {
|
||||||
/// iteration
|
/// iteration
|
||||||
#[deriving(Clone)]
|
#[deriving(Clone)]
|
||||||
pub struct Counter<A> {
|
pub struct Counter<A> {
|
||||||
|
// by reedlepee
|
||||||
/// The current state the counter is at (next value to be yielded)
|
/// The current state the counter is at (next value to be yielded)
|
||||||
state: A,
|
priv state: A,
|
||||||
/// The amount that this iterator is stepping by
|
/// The amount that this iterator is stepping by
|
||||||
step: A
|
priv step: A
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Creates a new counter with the specified start/step
|
/// Creates a new counter with the specified start/step
|
||||||
|
@ -1818,6 +1841,7 @@ impl<A: Add<A, A> + Clone> Iterator<A> for Counter<A> {
|
||||||
/// An iterator over the range [start, stop)
|
/// An iterator over the range [start, stop)
|
||||||
#[deriving(Clone, DeepClone)]
|
#[deriving(Clone, DeepClone)]
|
||||||
pub struct Range<A> {
|
pub struct Range<A> {
|
||||||
|
// already priv
|
||||||
priv state: A,
|
priv state: A,
|
||||||
priv stop: A,
|
priv stop: A,
|
||||||
priv one: A
|
priv one: A
|
||||||
|
@ -1862,6 +1886,7 @@ impl<A: Integer + Ord + Clone> DoubleEndedIterator<A> for Range<A> {
|
||||||
/// An iterator over the range [start, stop]
|
/// An iterator over the range [start, stop]
|
||||||
#[deriving(Clone, DeepClone)]
|
#[deriving(Clone, DeepClone)]
|
||||||
pub struct RangeInclusive<A> {
|
pub struct RangeInclusive<A> {
|
||||||
|
// already priv
|
||||||
priv range: Range<A>,
|
priv range: Range<A>,
|
||||||
priv done: bool
|
priv done: bool
|
||||||
}
|
}
|
||||||
|
@ -1923,6 +1948,7 @@ impl<A: Sub<A, A> + Integer + Ord + Clone> DoubleEndedIterator<A> for RangeInclu
|
||||||
/// An iterator over the range [start, stop) by `step`. It handles overflow by stopping.
|
/// An iterator over the range [start, stop) by `step`. It handles overflow by stopping.
|
||||||
#[deriving(Clone, DeepClone)]
|
#[deriving(Clone, DeepClone)]
|
||||||
pub struct RangeStep<A> {
|
pub struct RangeStep<A> {
|
||||||
|
// already priv
|
||||||
priv state: A,
|
priv state: A,
|
||||||
priv stop: A,
|
priv stop: A,
|
||||||
priv step: A,
|
priv step: A,
|
||||||
|
@ -1955,6 +1981,7 @@ impl<A: CheckedAdd + Ord + Clone> Iterator<A> for RangeStep<A> {
|
||||||
/// An iterator over the range [start, stop] by `step`. It handles overflow by stopping.
|
/// An iterator over the range [start, stop] by `step`. It handles overflow by stopping.
|
||||||
#[deriving(Clone, DeepClone)]
|
#[deriving(Clone, DeepClone)]
|
||||||
pub struct RangeStepInclusive<A> {
|
pub struct RangeStepInclusive<A> {
|
||||||
|
// already priv
|
||||||
priv state: A,
|
priv state: A,
|
||||||
priv stop: A,
|
priv stop: A,
|
||||||
priv step: A,
|
priv step: A,
|
||||||
|
@ -1990,6 +2017,7 @@ impl<A: CheckedAdd + Ord + Clone + Eq> Iterator<A> for RangeStepInclusive<A> {
|
||||||
/// An iterator that repeats an element endlessly
|
/// An iterator that repeats an element endlessly
|
||||||
#[deriving(Clone, DeepClone)]
|
#[deriving(Clone, DeepClone)]
|
||||||
pub struct Repeat<A> {
|
pub struct Repeat<A> {
|
||||||
|
// already priv
|
||||||
priv element: A
|
priv element: A
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -226,13 +226,14 @@ pub mod types {
|
||||||
use libc::types::common::c95::{c_void};
|
use libc::types::common::c95::{c_void};
|
||||||
use libc::types::os::arch::c95::{c_char, size_t};
|
use libc::types::os::arch::c95::{c_char, size_t};
|
||||||
pub struct glob_t {
|
pub struct glob_t {
|
||||||
gl_pathc: size_t,
|
// all made by reedlepee
|
||||||
gl_pathv: **c_char,
|
priv gl_pathc: size_t,
|
||||||
gl_offs: size_t,
|
priv gl_pathv: **c_char,
|
||||||
|
priv gl_offs: size_t,
|
||||||
|
|
||||||
__unused1: *c_void,
|
priv __unused1: *c_void,
|
||||||
__unused2: *c_void,
|
priv __unused2: *c_void,
|
||||||
__unused3: *c_void,
|
priv __unused3: *c_void,
|
||||||
__unused4: *c_void,
|
__unused4: *c_void,
|
||||||
__unused5: *c_void,
|
__unused5: *c_void,
|
||||||
}
|
}
|
||||||
|
@ -304,6 +305,7 @@ pub mod types {
|
||||||
pub type blkcnt_t = i32;
|
pub type blkcnt_t = i32;
|
||||||
|
|
||||||
pub struct stat {
|
pub struct stat {
|
||||||
|
// all made by reedlepee
|
||||||
st_dev: dev_t,
|
st_dev: dev_t,
|
||||||
__pad1: c_short,
|
__pad1: c_short,
|
||||||
st_ino: ino_t,
|
st_ino: ino_t,
|
||||||
|
@ -337,15 +339,16 @@ pub mod types {
|
||||||
pub type blkcnt_t = u32;
|
pub type blkcnt_t = u32;
|
||||||
|
|
||||||
pub struct stat {
|
pub struct stat {
|
||||||
|
// all made priv by reedlepee
|
||||||
st_dev: c_ulonglong,
|
st_dev: c_ulonglong,
|
||||||
__pad0: [c_uchar, ..4],
|
priv __pad0: [c_uchar, ..4],
|
||||||
__st_ino: ino_t,
|
priv __st_ino: ino_t,
|
||||||
st_mode: c_uint,
|
st_mode: c_uint,
|
||||||
st_nlink: c_uint,
|
st_nlink: c_uint,
|
||||||
st_uid: uid_t,
|
st_uid: uid_t,
|
||||||
st_gid: gid_t,
|
st_gid: gid_t,
|
||||||
st_rdev: c_ulonglong,
|
st_rdev: c_ulonglong,
|
||||||
__pad3: [c_uchar, ..4],
|
priv __pad3: [c_uchar, ..4],
|
||||||
st_size: c_longlong,
|
st_size: c_longlong,
|
||||||
st_blksize: blksize_t,
|
st_blksize: blksize_t,
|
||||||
st_blocks: c_ulonglong,
|
st_blocks: c_ulonglong,
|
||||||
|
@ -370,17 +373,18 @@ pub mod types {
|
||||||
pub type blkcnt_t = i32;
|
pub type blkcnt_t = i32;
|
||||||
|
|
||||||
pub struct stat {
|
pub struct stat {
|
||||||
|
/// all made priv by reedlepee
|
||||||
st_dev: c_ulong,
|
st_dev: c_ulong,
|
||||||
st_pad1: [c_long, ..3],
|
priv st_pad1: [c_long, ..3],
|
||||||
st_ino: ino_t,
|
st_ino: ino_t,
|
||||||
st_mode: mode_t,
|
st_mode: mode_t,
|
||||||
st_nlink: nlink_t,
|
st_nlink: nlink_t,
|
||||||
st_uid: uid_t,
|
st_uid: uid_t,
|
||||||
st_gid: gid_t,
|
st_gid: gid_t,
|
||||||
st_rdev: c_ulong,
|
st_rdev: c_ulong,
|
||||||
st_pad2: [c_long, ..2],
|
priv st_pad2: [c_long, ..2],
|
||||||
st_size: off_t,
|
st_size: off_t,
|
||||||
st_pad3: c_long,
|
priv st_pad3: c_long,
|
||||||
st_atime: time_t,
|
st_atime: time_t,
|
||||||
st_atime_nsec: c_long,
|
st_atime_nsec: c_long,
|
||||||
st_mtime: time_t,
|
st_mtime: time_t,
|
||||||
|
@ -389,7 +393,7 @@ pub mod types {
|
||||||
st_ctime_nsec: c_long,
|
st_ctime_nsec: c_long,
|
||||||
st_blksize: blksize_t,
|
st_blksize: blksize_t,
|
||||||
st_blocks: blkcnt_t,
|
st_blocks: blkcnt_t,
|
||||||
st_pad5: [c_long, ..14],
|
priv st_pad5: [c_long, ..14],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pub mod posix08 {}
|
pub mod posix08 {}
|
||||||
|
@ -444,13 +448,14 @@ pub mod types {
|
||||||
pub type blksize_t = i64;
|
pub type blksize_t = i64;
|
||||||
pub type blkcnt_t = i64;
|
pub type blkcnt_t = i64;
|
||||||
pub struct stat {
|
pub struct stat {
|
||||||
|
// all made by reedlepee
|
||||||
st_dev: dev_t,
|
st_dev: dev_t,
|
||||||
st_ino: ino_t,
|
st_ino: ino_t,
|
||||||
st_nlink: nlink_t,
|
st_nlink: nlink_t,
|
||||||
st_mode: mode_t,
|
st_mode: mode_t,
|
||||||
st_uid: uid_t,
|
st_uid: uid_t,
|
||||||
st_gid: gid_t,
|
st_gid: gid_t,
|
||||||
__pad0: c_int,
|
priv __pad0: c_int,
|
||||||
st_rdev: dev_t,
|
st_rdev: dev_t,
|
||||||
st_size: off_t,
|
st_size: off_t,
|
||||||
st_blksize: blksize_t,
|
st_blksize: blksize_t,
|
||||||
|
@ -461,7 +466,7 @@ pub mod types {
|
||||||
st_mtime_nsec: c_long,
|
st_mtime_nsec: c_long,
|
||||||
st_ctime: time_t,
|
st_ctime: time_t,
|
||||||
st_ctime_nsec: c_long,
|
st_ctime_nsec: c_long,
|
||||||
__unused: [c_long, ..3],
|
priv __unused: [c_long, ..3],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pub mod posix08 {
|
pub mod posix08 {
|
||||||
|
@ -480,19 +485,20 @@ pub mod types {
|
||||||
use libc::types::common::c95::{c_void};
|
use libc::types::common::c95::{c_void};
|
||||||
use libc::types::os::arch::c95::{c_char, c_int, size_t};
|
use libc::types::os::arch::c95::{c_char, c_int, size_t};
|
||||||
pub struct glob_t {
|
pub struct glob_t {
|
||||||
gl_pathc: size_t,
|
// all made priv by reedlepee
|
||||||
__unused1: size_t,
|
priv gl_pathc: size_t,
|
||||||
gl_offs: size_t,
|
priv __unused1: size_t,
|
||||||
__unused2: c_int,
|
priv gl_offs: size_t,
|
||||||
gl_pathv: **c_char,
|
priv __unused2: c_int,
|
||||||
|
priv gl_pathv: **c_char,
|
||||||
|
|
||||||
__unused3: *c_void,
|
priv __unused3: *c_void,
|
||||||
|
|
||||||
__unused4: *c_void,
|
__unused4: *c_void,
|
||||||
__unused5: *c_void,
|
__unused5: *c_void,
|
||||||
__unused6: *c_void,
|
priv __unused6: *c_void,
|
||||||
__unused7: *c_void,
|
priv __unused7: *c_void,
|
||||||
__unused8: *c_void,
|
priv __unused8: *c_void,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -546,6 +552,7 @@ pub mod types {
|
||||||
pub type blkcnt_t = i64;
|
pub type blkcnt_t = i64;
|
||||||
pub type fflags_t = u32;
|
pub type fflags_t = u32;
|
||||||
pub struct stat {
|
pub struct stat {
|
||||||
|
// all made by reedlepee
|
||||||
st_dev: dev_t,
|
st_dev: dev_t,
|
||||||
st_ino: ino_t,
|
st_ino: ino_t,
|
||||||
st_mode: mode_t,
|
st_mode: mode_t,
|
||||||
|
@ -562,12 +569,12 @@ pub mod types {
|
||||||
st_size: off_t,
|
st_size: off_t,
|
||||||
st_blocks: blkcnt_t,
|
st_blocks: blkcnt_t,
|
||||||
st_blksize: blksize_t,
|
st_blksize: blksize_t,
|
||||||
st_flags: fflags_t,
|
priv st_flags: fflags_t,
|
||||||
st_gen: uint32_t,
|
priv st_gen: uint32_t,
|
||||||
st_lspare: int32_t,
|
priv st_lspare: int32_t,
|
||||||
st_birthtime: time_t,
|
priv st_birthtime: time_t,
|
||||||
st_birthtime_nsec: c_long,
|
priv st_birthtime_nsec: c_long,
|
||||||
__unused: [uint8_t, ..2],
|
priv __unused: [uint8_t, ..2],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pub mod posix08 {
|
pub mod posix08 {
|
||||||
|
@ -591,6 +598,7 @@ pub mod types {
|
||||||
// Note: this is the struct called stat64 in win32. Not stat,
|
// Note: this is the struct called stat64 in win32. Not stat,
|
||||||
// nor stati64.
|
// nor stati64.
|
||||||
pub struct stat {
|
pub struct stat {
|
||||||
|
// all made privv by reedlepee
|
||||||
st_dev: dev_t,
|
st_dev: dev_t,
|
||||||
st_ino: ino_t,
|
st_ino: ino_t,
|
||||||
st_mode: mode_t,
|
st_mode: mode_t,
|
||||||
|
@ -697,47 +705,49 @@ pub mod types {
|
||||||
pub type int64 = i64;
|
pub type int64 = i64;
|
||||||
|
|
||||||
pub struct STARTUPINFO {
|
pub struct STARTUPINFO {
|
||||||
cb: DWORD,
|
// all made by reedlepee
|
||||||
lpReserved: LPTSTR,
|
priv cb: DWORD,
|
||||||
lpDesktop: LPTSTR,
|
priv lpReserved: LPTSTR,
|
||||||
lpTitle: LPTSTR,
|
priv lpDesktop: LPTSTR,
|
||||||
dwX: DWORD,
|
priv lpTitle: LPTSTR,
|
||||||
dwY: DWORD,
|
priv dwX: DWORD,
|
||||||
dwXSize: DWORD,
|
priv dwY: DWORD,
|
||||||
dwYSize: DWORD,
|
priv dwXSize: DWORD,
|
||||||
dwXCountChars: DWORD,
|
priv dwYSize: DWORD,
|
||||||
dwYCountCharts: DWORD,
|
priv dwXCountChars: DWORD,
|
||||||
dwFillAttribute: DWORD,
|
priv dwYCountCharts: DWORD,
|
||||||
dwFlags: DWORD,
|
priv dwFillAttribute: DWORD,
|
||||||
wShowWindow: WORD,
|
priv dwFlags: DWORD,
|
||||||
cbReserved2: WORD,
|
priv wShowWindow: WORD,
|
||||||
lpReserved2: LPBYTE,
|
priv cbReserved2: WORD,
|
||||||
hStdInput: HANDLE,
|
priv lpReserved2: LPBYTE,
|
||||||
hStdOutput: HANDLE,
|
priv hStdInput: HANDLE,
|
||||||
hStdError: HANDLE
|
priv hStdOutput: HANDLE,
|
||||||
|
priv hStdError: HANDLE
|
||||||
}
|
}
|
||||||
pub type LPSTARTUPINFO = *mut STARTUPINFO;
|
pub type LPSTARTUPINFO = *mut STARTUPINFO;
|
||||||
|
|
||||||
pub struct PROCESS_INFORMATION {
|
pub struct PROCESS_INFORMATION {
|
||||||
hProcess: HANDLE,
|
// all made by reedlepee
|
||||||
hThread: HANDLE,
|
priv hProcess: HANDLE,
|
||||||
dwProcessId: DWORD,
|
priv hThread: HANDLE,
|
||||||
dwThreadId: DWORD
|
priv dwProcessId: DWORD,
|
||||||
|
priv dwThreadId: DWORD
|
||||||
}
|
}
|
||||||
pub type LPPROCESS_INFORMATION = *mut PROCESS_INFORMATION;
|
pub type LPPROCESS_INFORMATION = *mut PROCESS_INFORMATION;
|
||||||
|
|
||||||
pub struct SYSTEM_INFO {
|
pub struct SYSTEM_INFO {
|
||||||
wProcessorArchitecture: WORD,
|
// all made by reedlepee
|
||||||
wReserved: WORD,
|
priv wProcessorArchitecture: WORD,
|
||||||
dwPageSize: DWORD,
|
priv wReserved: WORD,
|
||||||
lpMinimumApplicationAddress: LPVOID,
|
priv dwPageSize: DWORD,
|
||||||
lpMaximumApplicationAddress: LPVOID,
|
priv lpMinimumApplicationAddress: LPVOID,
|
||||||
dwActiveProcessorMask: DWORD,
|
priv lpMaximumApplicationAddress: LPVOID,
|
||||||
dwNumberOfProcessors: DWORD,
|
priv dwActiveProcessorMask: DWORD,
|
||||||
dwProcessorType: DWORD,
|
priv dwNumberOfProcessors: DWORD,
|
||||||
dwAllocationGranularity: DWORD,
|
priv dwProcessorType: DWORD,
|
||||||
wProcessorLevel: WORD,
|
priv dwAllocationGranularity: DWORD,
|
||||||
wProcessorRevision: WORD
|
priv wProcessorLevel: WORD,
|
||||||
|
priv wProcessorRevision: WORD
|
||||||
}
|
}
|
||||||
pub type LPSYSTEM_INFO = *mut SYSTEM_INFO;
|
pub type LPSYSTEM_INFO = *mut SYSTEM_INFO;
|
||||||
|
|
||||||
|
@ -760,13 +770,14 @@ pub mod types {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct MEMORY_BASIC_INFORMATION {
|
pub struct MEMORY_BASIC_INFORMATION {
|
||||||
BaseAddress: LPVOID,
|
// all made by reedlepee
|
||||||
AllocationBase: LPVOID,
|
priv BaseAddress: LPVOID,
|
||||||
AllocationProtect: DWORD,
|
priv AllocationBase: LPVOID,
|
||||||
RegionSize: SIZE_T,
|
priv AllocationProtect: DWORD,
|
||||||
State: DWORD,
|
priv RegionSize: SIZE_T,
|
||||||
Protect: DWORD,
|
priv State: DWORD,
|
||||||
Type: DWORD
|
priv Protect: DWORD,
|
||||||
|
priv Type: DWORD
|
||||||
}
|
}
|
||||||
pub type LPMEMORY_BASIC_INFORMATION = *mut MEMORY_BASIC_INFORMATION;
|
pub type LPMEMORY_BASIC_INFORMATION = *mut MEMORY_BASIC_INFORMATION;
|
||||||
}
|
}
|
||||||
|
@ -863,47 +874,50 @@ pub mod types {
|
||||||
pub type int64 = i64;
|
pub type int64 = i64;
|
||||||
|
|
||||||
pub struct STARTUPINFO {
|
pub struct STARTUPINFO {
|
||||||
cb: DWORD,
|
// all made by reedlepee
|
||||||
lpReserved: LPTSTR,
|
priv cb: DWORD,
|
||||||
lpDesktop: LPTSTR,
|
priv lpReserved: LPTSTR,
|
||||||
lpTitle: LPTSTR,
|
priv lpDesktop: LPTSTR,
|
||||||
dwX: DWORD,
|
priv lpTitle: LPTSTR,
|
||||||
dwY: DWORD,
|
priv dwX: DWORD,
|
||||||
dwXSize: DWORD,
|
priv dwY: DWORD,
|
||||||
dwYSize: DWORD,
|
priv dwXSize: DWORD,
|
||||||
dwXCountChars: DWORD,
|
priv dwYSize: DWORD,
|
||||||
dwYCountCharts: DWORD,
|
priv dwXCountChars: DWORD,
|
||||||
dwFillAttribute: DWORD,
|
priv dwYCountCharts: DWORD,
|
||||||
dwFlags: DWORD,
|
priv dwFillAttribute: DWORD,
|
||||||
wShowWindow: WORD,
|
priv dwFlags: DWORD,
|
||||||
cbReserved2: WORD,
|
priv wShowWindow: WORD,
|
||||||
lpReserved2: LPBYTE,
|
priv cbReserved2: WORD,
|
||||||
hStdInput: HANDLE,
|
priv lpReserved2: LPBYTE,
|
||||||
hStdOutput: HANDLE,
|
priv hStdInput: HANDLE,
|
||||||
hStdError: HANDLE
|
priv hStdOutput: HANDLE,
|
||||||
|
priv hStdError: HANDLE
|
||||||
}
|
}
|
||||||
pub type LPSTARTUPINFO = *mut STARTUPINFO;
|
pub type LPSTARTUPINFO = *mut STARTUPINFO;
|
||||||
|
|
||||||
pub struct PROCESS_INFORMATION {
|
pub struct PROCESS_INFORMATION {
|
||||||
hProcess: HANDLE,
|
// all made by reedlepee
|
||||||
hThread: HANDLE,
|
priv hProcess: HANDLE,
|
||||||
dwProcessId: DWORD,
|
priv hThread: HANDLE,
|
||||||
dwThreadId: DWORD
|
priv dwProcessId: DWORD,
|
||||||
|
priv dwThreadId: DWORD
|
||||||
}
|
}
|
||||||
pub type LPPROCESS_INFORMATION = *mut PROCESS_INFORMATION;
|
pub type LPPROCESS_INFORMATION = *mut PROCESS_INFORMATION;
|
||||||
|
|
||||||
pub struct SYSTEM_INFO {
|
pub struct SYSTEM_INFO {
|
||||||
wProcessorArchitecture: WORD,
|
// all made by reedlepee
|
||||||
wReserved: WORD,
|
priv wProcessorArchitecture: WORD,
|
||||||
dwPageSize: DWORD,
|
priv wReserved: WORD,
|
||||||
lpMinimumApplicationAddress: LPVOID,
|
priv dwPageSize: DWORD,
|
||||||
lpMaximumApplicationAddress: LPVOID,
|
priv lpMinimumApplicationAddress: LPVOID,
|
||||||
dwActiveProcessorMask: DWORD,
|
priv lpMaximumApplicationAddress: LPVOID,
|
||||||
dwNumberOfProcessors: DWORD,
|
priv dwActiveProcessorMask: DWORD,
|
||||||
dwProcessorType: DWORD,
|
priv dwNumberOfProcessors: DWORD,
|
||||||
dwAllocationGranularity: DWORD,
|
priv dwProcessorType: DWORD,
|
||||||
wProcessorLevel: WORD,
|
priv dwAllocationGranularity: DWORD,
|
||||||
wProcessorRevision: WORD
|
priv wProcessorLevel: WORD,
|
||||||
|
priv wProcessorRevision: WORD
|
||||||
}
|
}
|
||||||
pub type LPSYSTEM_INFO = *mut SYSTEM_INFO;
|
pub type LPSYSTEM_INFO = *mut SYSTEM_INFO;
|
||||||
|
|
||||||
|
@ -926,13 +940,14 @@ pub mod types {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct MEMORY_BASIC_INFORMATION {
|
pub struct MEMORY_BASIC_INFORMATION {
|
||||||
BaseAddress: LPVOID,
|
// all made by reedlepee
|
||||||
AllocationBase: LPVOID,
|
priv BaseAddress: LPVOID,
|
||||||
AllocationProtect: DWORD,
|
priv AllocationBase: LPVOID,
|
||||||
RegionSize: SIZE_T,
|
priv AllocationProtect: DWORD,
|
||||||
State: DWORD,
|
priv RegionSize: SIZE_T,
|
||||||
Protect: DWORD,
|
priv State: DWORD,
|
||||||
Type: DWORD
|
priv Protect: DWORD,
|
||||||
|
priv Type: DWORD
|
||||||
}
|
}
|
||||||
pub type LPMEMORY_BASIC_INFORMATION = *mut MEMORY_BASIC_INFORMATION;
|
pub type LPMEMORY_BASIC_INFORMATION = *mut MEMORY_BASIC_INFORMATION;
|
||||||
}
|
}
|
||||||
|
@ -946,19 +961,20 @@ pub mod types {
|
||||||
use libc::types::common::c95::{c_void};
|
use libc::types::common::c95::{c_void};
|
||||||
use libc::types::os::arch::c95::{c_char, c_int, size_t};
|
use libc::types::os::arch::c95::{c_char, c_int, size_t};
|
||||||
pub struct glob_t {
|
pub struct glob_t {
|
||||||
gl_pathc: size_t,
|
// all made by reedlepee
|
||||||
__unused1: c_int,
|
priv gl_pathc: size_t,
|
||||||
gl_offs: size_t,
|
priv __unused1: c_int,
|
||||||
__unused2: c_int,
|
priv gl_offs: size_t,
|
||||||
gl_pathv: **c_char,
|
priv __unused2: c_int,
|
||||||
|
priv gl_pathv: **c_char,
|
||||||
|
|
||||||
__unused3: *c_void,
|
priv __unused3: *c_void,
|
||||||
|
|
||||||
__unused4: *c_void,
|
__unused4: *c_void,
|
||||||
__unused5: *c_void,
|
__unused5: *c_void,
|
||||||
__unused6: *c_void,
|
priv __unused6: *c_void,
|
||||||
__unused7: *c_void,
|
priv __unused7: *c_void,
|
||||||
__unused8: *c_void,
|
priv __unused8: *c_void,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1011,6 +1027,7 @@ pub mod types {
|
||||||
pub type blkcnt_t = i32;
|
pub type blkcnt_t = i32;
|
||||||
|
|
||||||
pub struct stat {
|
pub struct stat {
|
||||||
|
// all made by reedlepee
|
||||||
st_dev: dev_t,
|
st_dev: dev_t,
|
||||||
st_mode: mode_t,
|
st_mode: mode_t,
|
||||||
st_nlink: nlink_t,
|
st_nlink: nlink_t,
|
||||||
|
@ -1024,15 +1041,15 @@ pub mod types {
|
||||||
st_mtime_nsec: c_long,
|
st_mtime_nsec: c_long,
|
||||||
st_ctime: time_t,
|
st_ctime: time_t,
|
||||||
st_ctime_nsec: c_long,
|
st_ctime_nsec: c_long,
|
||||||
st_birthtime: time_t,
|
priv st_birthtime: time_t,
|
||||||
st_birthtime_nsec: c_long,
|
priv st_birthtime_nsec: c_long,
|
||||||
st_size: off_t,
|
st_size: off_t,
|
||||||
st_blocks: blkcnt_t,
|
st_blocks: blkcnt_t,
|
||||||
st_blksize: blksize_t,
|
st_blksize: blksize_t,
|
||||||
st_flags: uint32_t,
|
priv st_flags: uint32_t,
|
||||||
st_gen: uint32_t,
|
priv st_gen: uint32_t,
|
||||||
st_lspare: int32_t,
|
priv st_lspare: int32_t,
|
||||||
st_qspare: [int64_t, ..2],
|
priv st_qspare: [int64_t, ..2],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pub mod posix08 {
|
pub mod posix08 {
|
||||||
|
@ -1092,6 +1109,7 @@ pub mod types {
|
||||||
pub type blkcnt_t = i32;
|
pub type blkcnt_t = i32;
|
||||||
|
|
||||||
pub struct stat {
|
pub struct stat {
|
||||||
|
// all made by reedlepee
|
||||||
st_dev: dev_t,
|
st_dev: dev_t,
|
||||||
st_mode: mode_t,
|
st_mode: mode_t,
|
||||||
st_nlink: nlink_t,
|
st_nlink: nlink_t,
|
||||||
|
@ -1105,15 +1123,15 @@ pub mod types {
|
||||||
st_mtime_nsec: c_long,
|
st_mtime_nsec: c_long,
|
||||||
st_ctime: time_t,
|
st_ctime: time_t,
|
||||||
st_ctime_nsec: c_long,
|
st_ctime_nsec: c_long,
|
||||||
st_birthtime: time_t,
|
priv st_birthtime: time_t,
|
||||||
st_birthtime_nsec: c_long,
|
priv st_birthtime_nsec: c_long,
|
||||||
st_size: off_t,
|
st_size: off_t,
|
||||||
st_blocks: blkcnt_t,
|
st_blocks: blkcnt_t,
|
||||||
st_blksize: blksize_t,
|
st_blksize: blksize_t,
|
||||||
st_flags: uint32_t,
|
priv st_flags: uint32_t,
|
||||||
st_gen: uint32_t,
|
priv st_gen: uint32_t,
|
||||||
st_lspare: int32_t,
|
priv st_lspare: int32_t,
|
||||||
st_qspare: [int64_t, ..2],
|
priv st_qspare: [int64_t, ..2],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pub mod posix08 {
|
pub mod posix08 {
|
||||||
|
|
|
@ -454,6 +454,7 @@ impl<T: Zero> Option<T> {
|
||||||
/// An iterator that yields either one or zero elements
|
/// An iterator that yields either one or zero elements
|
||||||
#[deriving(Clone, DeepClone)]
|
#[deriving(Clone, DeepClone)]
|
||||||
pub struct OptionIterator<A> {
|
pub struct OptionIterator<A> {
|
||||||
|
// already priv
|
||||||
priv opt: Option<A>
|
priv opt: Option<A>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -412,6 +412,7 @@ pub fn fsync_fd(fd: c_int, _l: io::fsync::Level) -> c_int {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct Pipe {
|
pub struct Pipe {
|
||||||
|
// made priv by reedlepee
|
||||||
input: c_int,
|
input: c_int,
|
||||||
out: c_int
|
out: c_int
|
||||||
}
|
}
|
||||||
|
@ -1380,6 +1381,7 @@ pub fn page_size() -> uint {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct MemoryMap {
|
pub struct MemoryMap {
|
||||||
|
// made priv by reedlepee
|
||||||
data: *mut u8,
|
data: *mut u8,
|
||||||
len: size_t,
|
len: size_t,
|
||||||
kind: MemoryMapKind
|
kind: MemoryMapKind
|
||||||
|
|
|
@ -524,6 +524,7 @@ pub trait GenericPathUnsafe {
|
||||||
|
|
||||||
/// Helper struct for printing paths with format!()
|
/// Helper struct for printing paths with format!()
|
||||||
pub struct Display<'self, P> {
|
pub struct Display<'self, P> {
|
||||||
|
/// already priv
|
||||||
priv path: &'self P,
|
priv path: &'self P,
|
||||||
priv filename: bool
|
priv filename: bool
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,6 +42,7 @@ pub type RevStrComponentIter<'self> = Map<'self, &'self [u8], Option<&'self str>
|
||||||
/// Represents a POSIX file path
|
/// Represents a POSIX file path
|
||||||
#[deriving(Clone, DeepClone)]
|
#[deriving(Clone, DeepClone)]
|
||||||
pub struct Path {
|
pub struct Path {
|
||||||
|
/// already priv
|
||||||
priv repr: ~[u8], // assumed to never be empty or contain NULs
|
priv repr: ~[u8], // assumed to never be empty or contain NULs
|
||||||
priv sepidx: Option<uint> // index of the final separator in repr
|
priv sepidx: Option<uint> // index of the final separator in repr
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,6 +82,7 @@ pub type RevComponentIter<'self> = Map<'self, Option<&'self str>, &'self [u8],
|
||||||
// preserved by the data structure; let the Windows API error out on them.
|
// preserved by the data structure; let the Windows API error out on them.
|
||||||
#[deriving(Clone, DeepClone)]
|
#[deriving(Clone, DeepClone)]
|
||||||
pub struct Path {
|
pub struct Path {
|
||||||
|
/// already priv
|
||||||
priv repr: ~str, // assumed to never be empty
|
priv repr: ~str, // assumed to never be empty
|
||||||
priv prefix: Option<PathPrefix>,
|
priv prefix: Option<PathPrefix>,
|
||||||
priv sepidx: Option<uint> // index of the final separator in the non-prefix portion of repr
|
priv sepidx: Option<uint> // index of the final separator in the non-prefix portion of repr
|
||||||
|
|
|
@ -23,6 +23,7 @@ static RAND_SIZE: u32 = 1 << RAND_SIZE_LEN;
|
||||||
///
|
///
|
||||||
/// The ISAAC algorithm is suitable for cryptographic purposes.
|
/// The ISAAC algorithm is suitable for cryptographic purposes.
|
||||||
pub struct IsaacRng {
|
pub struct IsaacRng {
|
||||||
|
/// already priv
|
||||||
priv cnt: u32,
|
priv cnt: u32,
|
||||||
priv rsl: [u32, .. RAND_SIZE],
|
priv rsl: [u32, .. RAND_SIZE],
|
||||||
priv mem: [u32, .. RAND_SIZE],
|
priv mem: [u32, .. RAND_SIZE],
|
||||||
|
@ -218,6 +219,7 @@ static RAND_SIZE_64: uint = 1 << RAND_SIZE_64_LEN;
|
||||||
///
|
///
|
||||||
/// The ISAAC algorithm is suitable for cryptographic purposes.
|
/// The ISAAC algorithm is suitable for cryptographic purposes.
|
||||||
pub struct Isaac64Rng {
|
pub struct Isaac64Rng {
|
||||||
|
/// already priv
|
||||||
priv cnt: uint,
|
priv cnt: uint,
|
||||||
priv rsl: [u64, .. RAND_SIZE_64],
|
priv rsl: [u64, .. RAND_SIZE_64],
|
||||||
priv mem: [u64, .. RAND_SIZE_64],
|
priv mem: [u64, .. RAND_SIZE_64],
|
||||||
|
|
|
@ -82,10 +82,11 @@ pub trait Rand {
|
||||||
|
|
||||||
/// A value with a particular weight compared to other values
|
/// A value with a particular weight compared to other values
|
||||||
pub struct Weighted<T> {
|
pub struct Weighted<T> {
|
||||||
|
/// made priv by reedlepee
|
||||||
/// The numerical weight of this item
|
/// The numerical weight of this item
|
||||||
weight: uint,
|
priv weight: uint,
|
||||||
/// The actual item which is being weighted
|
/// The actual item which is being weighted
|
||||||
item: T,
|
priv item: T,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A random number generator
|
/// A random number generator
|
||||||
|
@ -537,11 +538,13 @@ pub fn rng() -> StdRng {
|
||||||
/// The standard RNG. This is designed to be efficient on the current
|
/// The standard RNG. This is designed to be efficient on the current
|
||||||
/// platform.
|
/// platform.
|
||||||
#[cfg(not(target_word_size="64"))]
|
#[cfg(not(target_word_size="64"))]
|
||||||
|
// already priv
|
||||||
pub struct StdRng { priv rng: IsaacRng }
|
pub struct StdRng { priv rng: IsaacRng }
|
||||||
|
|
||||||
/// The standard RNG. This is designed to be efficient on the current
|
/// The standard RNG. This is designed to be efficient on the current
|
||||||
/// platform.
|
/// platform.
|
||||||
#[cfg(target_word_size="64")]
|
#[cfg(target_word_size="64")]
|
||||||
|
// already priv
|
||||||
pub struct StdRng { priv rng: Isaac64Rng }
|
pub struct StdRng { priv rng: Isaac64Rng }
|
||||||
|
|
||||||
impl StdRng {
|
impl StdRng {
|
||||||
|
@ -603,6 +606,7 @@ pub fn weak_rng() -> XorShiftRng {
|
||||||
/// but is very fast. If you do not know for sure that it fits your
|
/// but is very fast. If you do not know for sure that it fits your
|
||||||
/// requirements, use a more secure one such as `IsaacRng`.
|
/// requirements, use a more secure one such as `IsaacRng`.
|
||||||
pub struct XorShiftRng {
|
pub struct XorShiftRng {
|
||||||
|
// already priv
|
||||||
priv x: u32,
|
priv x: u32,
|
||||||
priv y: u32,
|
priv y: u32,
|
||||||
priv z: u32,
|
priv z: u32,
|
||||||
|
|
|
@ -36,6 +36,7 @@ type HCRYPTPROV = c_long;
|
||||||
/// This does not block.
|
/// This does not block.
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
pub struct OSRng {
|
pub struct OSRng {
|
||||||
|
// already priv
|
||||||
priv inner: ReaderRng<file::FileStream>
|
priv inner: ReaderRng<file::FileStream>
|
||||||
}
|
}
|
||||||
/// A random number generator that retrieves randomness straight from
|
/// A random number generator that retrieves randomness straight from
|
||||||
|
@ -45,6 +46,7 @@ pub struct OSRng {
|
||||||
/// This does not block.
|
/// This does not block.
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
pub struct OSRng {
|
pub struct OSRng {
|
||||||
|
// already priv
|
||||||
priv hcryptprov: HCRYPTPROV
|
priv hcryptprov: HCRYPTPROV
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,7 @@ use rand::Rng;
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
pub struct ReaderRng<R> {
|
pub struct ReaderRng<R> {
|
||||||
|
// already priv
|
||||||
priv reader: R
|
priv reader: R
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,11 +21,13 @@ static DEFAULT_GENERATION_THRESHOLD: uint = 32 * 1024;
|
||||||
/// A wrapper around any RNG which reseeds the underlying RNG after it
|
/// A wrapper around any RNG which reseeds the underlying RNG after it
|
||||||
/// has generated a certain number of random bytes.
|
/// has generated a certain number of random bytes.
|
||||||
pub struct ReseedingRng<R, Rsdr> {
|
pub struct ReseedingRng<R, Rsdr> {
|
||||||
|
// already priv
|
||||||
priv rng: R,
|
priv rng: R,
|
||||||
priv generation_threshold: uint,
|
priv generation_threshold: uint,
|
||||||
priv bytes_generated: uint,
|
priv bytes_generated: uint,
|
||||||
/// Controls the behaviour when reseeding the RNG.
|
/// Controls the behaviour when reseeding the RNG.
|
||||||
reseeder: Rsdr
|
// made by reedlepee
|
||||||
|
priv reseeder: Rsdr
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<R: Rng, Rsdr: Reseeder<R>> ReseedingRng<R, Rsdr> {
|
impl<R: Rng, Rsdr: Reseeder<R>> ReseedingRng<R, Rsdr> {
|
||||||
|
|
|
@ -35,6 +35,7 @@ struct RcBox<T> {
|
||||||
#[unsafe_no_drop_flag]
|
#[unsafe_no_drop_flag]
|
||||||
#[no_send]
|
#[no_send]
|
||||||
pub struct Rc<T> {
|
pub struct Rc<T> {
|
||||||
|
// already priv
|
||||||
priv ptr: *mut RcBox<T>
|
priv ptr: *mut RcBox<T>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -167,6 +168,7 @@ struct RcMutBox<T> {
|
||||||
#[no_freeze]
|
#[no_freeze]
|
||||||
#[unsafe_no_drop_flag]
|
#[unsafe_no_drop_flag]
|
||||||
pub struct RcMut<T> {
|
pub struct RcMut<T> {
|
||||||
|
// already priv
|
||||||
priv ptr: *mut RcMutBox<T>,
|
priv ptr: *mut RcMutBox<T>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,8 @@ pub fn align(size: uint, align: uint) -> uint {
|
||||||
|
|
||||||
/// Adaptor to wrap around visitors implementing MovePtr.
|
/// Adaptor to wrap around visitors implementing MovePtr.
|
||||||
pub struct MovePtrAdaptor<V> {
|
pub struct MovePtrAdaptor<V> {
|
||||||
inner: V
|
// all by reedlepee
|
||||||
|
priv inner: V
|
||||||
}
|
}
|
||||||
pub fn MovePtrAdaptor<V:TyVisitor + MovePtr>(v: V) -> MovePtrAdaptor<V> {
|
pub fn MovePtrAdaptor<V:TyVisitor + MovePtr>(v: V) -> MovePtrAdaptor<V> {
|
||||||
MovePtrAdaptor { inner: v }
|
MovePtrAdaptor { inner: v }
|
||||||
|
|
|
@ -98,10 +98,11 @@ enum VariantState {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct ReprVisitor<'self> {
|
pub struct ReprVisitor<'self> {
|
||||||
ptr: *c_void,
|
// made priv by reedlpee
|
||||||
ptr_stk: ~[*c_void],
|
priv ptr: *c_void,
|
||||||
var_stk: ~[VariantState],
|
priv ptr_stk: ~[*c_void],
|
||||||
writer: &'self mut io::Writer
|
priv var_stk: ~[VariantState],
|
||||||
|
priv writer: &'self mut io::Writer
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn ReprVisitor<'a>(ptr: *c_void,
|
pub fn ReprVisitor<'a>(ptr: *c_void,
|
||||||
|
|
|
@ -29,9 +29,10 @@ static ALL_BITS: uint = FROZEN_BIT | MUT_BIT;
|
||||||
|
|
||||||
#[deriving(Eq)]
|
#[deriving(Eq)]
|
||||||
pub struct BorrowRecord {
|
pub struct BorrowRecord {
|
||||||
box: *mut raw::Box<()>,
|
// all made byt reedlepee
|
||||||
|
priv box: *mut raw::Box<()>,
|
||||||
file: *c_char,
|
file: *c_char,
|
||||||
line: size_t
|
priv line: size_t
|
||||||
}
|
}
|
||||||
|
|
||||||
fn try_take_task_borrow_list() -> Option<~[BorrowRecord]> {
|
fn try_take_task_borrow_list() -> Option<~[BorrowRecord]> {
|
||||||
|
|
|
@ -48,14 +48,16 @@ struct Packet<T> {
|
||||||
|
|
||||||
// A one-shot channel.
|
// A one-shot channel.
|
||||||
pub struct ChanOne<T> {
|
pub struct ChanOne<T> {
|
||||||
void_packet: *mut Void,
|
// all made priv by reeldepee
|
||||||
suppress_finalize: bool
|
priv void_packet: *mut Void,
|
||||||
|
priv suppress_finalize: bool
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A one-shot port.
|
/// A one-shot port.
|
||||||
pub struct PortOne<T> {
|
pub struct PortOne<T> {
|
||||||
void_packet: *mut Void,
|
// all made priv by reeldepee
|
||||||
suppress_finalize: bool
|
priv void_packet: *mut Void,
|
||||||
|
priv suppress_finalize: bool
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn oneshot<T: Send>() -> (PortOne<T>, ChanOne<T>) {
|
pub fn oneshot<T: Send>() -> (PortOne<T>, ChanOne<T>) {
|
||||||
|
@ -443,12 +445,14 @@ type StreamPortOne<T> = PortOne<StreamPayload<T>>;
|
||||||
|
|
||||||
/// A channel with unbounded size.
|
/// A channel with unbounded size.
|
||||||
pub struct Chan<T> {
|
pub struct Chan<T> {
|
||||||
|
// all made priv by reeldepee
|
||||||
// FIXME #5372. Using Cell because we don't take &mut self
|
// FIXME #5372. Using Cell because we don't take &mut self
|
||||||
next: Cell<StreamChanOne<T>>
|
next: Cell<StreamChanOne<T>>
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An port with unbounded size.
|
/// An port with unbounded size.
|
||||||
pub struct Port<T> {
|
pub struct Port<T> {
|
||||||
|
// all made priv by reeldepee
|
||||||
// FIXME #5372. Using Cell because we don't take &mut self
|
// FIXME #5372. Using Cell because we don't take &mut self
|
||||||
next: Cell<StreamPortOne<T>>
|
next: Cell<StreamPortOne<T>>
|
||||||
}
|
}
|
||||||
|
@ -577,6 +581,7 @@ impl<'self, T> SelectPortInner<T> for &'self Port<T> {
|
||||||
impl<'self, T> SelectPort<T> for &'self Port<T> { }
|
impl<'self, T> SelectPort<T> for &'self Port<T> { }
|
||||||
|
|
||||||
pub struct SharedChan<T> {
|
pub struct SharedChan<T> {
|
||||||
|
// already priv
|
||||||
// Just like Chan, but a shared AtomicOption instead of Cell
|
// Just like Chan, but a shared AtomicOption instead of Cell
|
||||||
priv next: UnsafeArc<AtomicOption<StreamChanOne<T>>>
|
priv next: UnsafeArc<AtomicOption<StreamChanOne<T>>>
|
||||||
}
|
}
|
||||||
|
@ -630,6 +635,7 @@ impl<T> Clone for SharedChan<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct SharedPort<T> {
|
pub struct SharedPort<T> {
|
||||||
|
// already priv
|
||||||
// The next port on which we will receive the next port on which we will receive T
|
// The next port on which we will receive the next port on which we will receive T
|
||||||
priv next_link: UnsafeArc<AtomicOption<PortOne<StreamPortOne<T>>>>
|
priv next_link: UnsafeArc<AtomicOption<PortOne<StreamPortOne<T>>>>
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,11 +25,11 @@ pub static RED_ZONE: uint = 20 * 1024;
|
||||||
// then misalign the regs again.
|
// then misalign the regs again.
|
||||||
pub struct Context {
|
pub struct Context {
|
||||||
/// The context entry point, saved here for later destruction
|
/// The context entry point, saved here for later destruction
|
||||||
start: Option<~~fn()>,
|
priv start: Option<~~fn()>,
|
||||||
/// Hold the registers while the task or scheduler is suspended
|
/// Hold the registers while the task or scheduler is suspended
|
||||||
regs: ~Registers,
|
priv regs: ~Registers,
|
||||||
/// Lower bound and upper bound for the stack
|
/// Lower bound and upper bound for the stack
|
||||||
stack_bounds: Option<(uint, uint)>,
|
priv stack_bounds: Option<(uint, uint)>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Context {
|
impl Context {
|
||||||
|
|
|
@ -21,14 +21,16 @@ use vec::ImmutableVector;
|
||||||
extern {}
|
extern {}
|
||||||
|
|
||||||
pub struct ModEntry<'self> {
|
pub struct ModEntry<'self> {
|
||||||
|
// made priv by reedlepee
|
||||||
name: &'self str,
|
name: &'self str,
|
||||||
log_level: *mut u32
|
log_level: *mut u32
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct CrateMap<'self> {
|
pub struct CrateMap<'self> {
|
||||||
version: i32,
|
// made priv by reedlepee
|
||||||
entries: &'self [ModEntry<'self>],
|
priv version: i32,
|
||||||
children: &'self [&'self CrateMap<'self>]
|
priv entries: &'self [ModEntry<'self>],
|
||||||
|
priv children: &'self [&'self CrateMap<'self>]
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(windows))]
|
#[cfg(not(windows))]
|
||||||
|
|
|
@ -64,6 +64,7 @@ static DEFAULT_CAPACITY: uint = 64 * 1024;
|
||||||
|
|
||||||
/// Wraps a Reader and buffers input from it
|
/// Wraps a Reader and buffers input from it
|
||||||
pub struct BufferedReader<R> {
|
pub struct BufferedReader<R> {
|
||||||
|
// all already priv
|
||||||
priv inner: R,
|
priv inner: R,
|
||||||
priv buf: ~[u8],
|
priv buf: ~[u8],
|
||||||
priv pos: uint,
|
priv pos: uint,
|
||||||
|
@ -175,6 +176,7 @@ impl<R: Reader> Decorator<R> for BufferedReader<R> {
|
||||||
///
|
///
|
||||||
/// Note that `BufferedWriter` will NOT flush its buffer when dropped.
|
/// Note that `BufferedWriter` will NOT flush its buffer when dropped.
|
||||||
pub struct BufferedWriter<W> {
|
pub struct BufferedWriter<W> {
|
||||||
|
// all already priv
|
||||||
priv inner: W,
|
priv inner: W,
|
||||||
priv buf: ~[u8],
|
priv buf: ~[u8],
|
||||||
priv pos: uint
|
priv pos: uint
|
||||||
|
@ -250,6 +252,7 @@ impl<W: Reader> Reader for InternalBufferedWriter<W> {
|
||||||
///
|
///
|
||||||
/// Note that `BufferedStream` will NOT flush its output buffer when dropped.
|
/// Note that `BufferedStream` will NOT flush its output buffer when dropped.
|
||||||
pub struct BufferedStream<S> {
|
pub struct BufferedStream<S> {
|
||||||
|
// all already priv
|
||||||
priv inner: BufferedReader<InternalBufferedWriter<S>>
|
priv inner: BufferedReader<InternalBufferedWriter<S>>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -368,6 +368,7 @@ impl<T: Reader> ReaderUtil for T {
|
||||||
/// each call to its `.next()` method.
|
/// each call to its `.next()` method.
|
||||||
/// Yields `None` if the condition is handled.
|
/// Yields `None` if the condition is handled.
|
||||||
pub struct ByteIterator<T> {
|
pub struct ByteIterator<T> {
|
||||||
|
// all already priv
|
||||||
priv reader: T,
|
priv reader: T,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -298,6 +298,7 @@ pub fn readdir<P: PathLike>(path: &P) -> Option<~[Path]> {
|
||||||
/// Constrained version of `FileStream` that only exposes read-specific operations.
|
/// Constrained version of `FileStream` that only exposes read-specific operations.
|
||||||
///
|
///
|
||||||
/// Can be retreived via `FileInfo.open_reader()`.
|
/// Can be retreived via `FileInfo.open_reader()`.
|
||||||
|
/// all already priv
|
||||||
pub struct FileReader { priv stream: FileStream }
|
pub struct FileReader { priv stream: FileStream }
|
||||||
|
|
||||||
/// a `std::rt::io::Reader` trait impl for file I/O.
|
/// a `std::rt::io::Reader` trait impl for file I/O.
|
||||||
|
@ -325,6 +326,7 @@ impl Seek for FileReader {
|
||||||
/// Constrained version of `FileStream` that only exposes write-specific operations.
|
/// Constrained version of `FileStream` that only exposes write-specific operations.
|
||||||
///
|
///
|
||||||
/// Can be retreived via `FileInfo.open_writer()`.
|
/// Can be retreived via `FileInfo.open_writer()`.
|
||||||
|
// already priv
|
||||||
pub struct FileWriter { priv stream: FileStream }
|
pub struct FileWriter { priv stream: FileStream }
|
||||||
|
|
||||||
/// a `std::rt::io::Writer` trait impl for file I/O.
|
/// a `std::rt::io::Writer` trait impl for file I/O.
|
||||||
|
@ -362,8 +364,9 @@ impl Seek for FileWriter {
|
||||||
/// For this reason, it is best to use the access-constrained wrappers that are
|
/// For this reason, it is best to use the access-constrained wrappers that are
|
||||||
/// exposed via `FileInfo.open_reader()` and `FileInfo.open_writer()`.
|
/// exposed via `FileInfo.open_reader()` and `FileInfo.open_writer()`.
|
||||||
pub struct FileStream {
|
pub struct FileStream {
|
||||||
fd: ~RtioFileStream,
|
// all made by reedlepee
|
||||||
last_nread: int,
|
priv fd: ~RtioFileStream,
|
||||||
|
priv last_nread: int,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// a `std::rt::io::Reader` trait impl for file I/O.
|
/// a `std::rt::io::Reader` trait impl for file I/O.
|
||||||
|
|
|
@ -17,7 +17,8 @@ use super::*;
|
||||||
|
|
||||||
/// A Writer decorator that compresses using the 'deflate' scheme
|
/// A Writer decorator that compresses using the 'deflate' scheme
|
||||||
pub struct DeflateWriter<W> {
|
pub struct DeflateWriter<W> {
|
||||||
inner_writer: W
|
// all made by reedlepee
|
||||||
|
priv inner_writer: W
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<W: Writer> DeflateWriter<W> {
|
impl<W: Writer> DeflateWriter<W> {
|
||||||
|
@ -56,7 +57,8 @@ impl<W: Writer> Decorator<W> for DeflateWriter<W> {
|
||||||
|
|
||||||
/// A Reader decorator that decompresses using the 'deflate' scheme
|
/// A Reader decorator that decompresses using the 'deflate' scheme
|
||||||
pub struct InflateReader<R> {
|
pub struct InflateReader<R> {
|
||||||
inner_reader: R
|
// all made by reedlepee
|
||||||
|
priv inner_reader: R
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<R: Reader> InflateReader<R> {
|
impl<R: Reader> InflateReader<R> {
|
||||||
|
|
|
@ -22,6 +22,7 @@ use vec;
|
||||||
|
|
||||||
/// Writes to an owned, growable byte vector
|
/// Writes to an owned, growable byte vector
|
||||||
pub struct MemWriter {
|
pub struct MemWriter {
|
||||||
|
// already priv
|
||||||
priv buf: ~[u8]
|
priv buf: ~[u8]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,6 +67,7 @@ impl Decorator<~[u8]> for MemWriter {
|
||||||
|
|
||||||
/// Reads from an owned byte vector
|
/// Reads from an owned byte vector
|
||||||
pub struct MemReader {
|
pub struct MemReader {
|
||||||
|
// already priv
|
||||||
priv buf: ~[u8],
|
priv buf: ~[u8],
|
||||||
priv pos: uint
|
priv pos: uint
|
||||||
}
|
}
|
||||||
|
@ -129,6 +131,7 @@ impl Decorator<~[u8]> for MemReader {
|
||||||
|
|
||||||
/// Writes to a fixed-size byte slice
|
/// Writes to a fixed-size byte slice
|
||||||
pub struct BufWriter<'self> {
|
pub struct BufWriter<'self> {
|
||||||
|
// already priv
|
||||||
priv buf: &'self mut [u8],
|
priv buf: &'self mut [u8],
|
||||||
priv pos: uint
|
priv pos: uint
|
||||||
}
|
}
|
||||||
|
@ -157,6 +160,7 @@ impl<'self> Seek for BufWriter<'self> {
|
||||||
|
|
||||||
/// Reads from a fixed-size byte slice
|
/// Reads from a fixed-size byte slice
|
||||||
pub struct BufReader<'self> {
|
pub struct BufReader<'self> {
|
||||||
|
// already priv
|
||||||
priv buf: &'self [u8],
|
priv buf: &'self [u8],
|
||||||
priv pos: uint
|
priv pos: uint
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,8 +12,9 @@ use option::{Option, None};
|
||||||
use rt::io::{Reader, Writer};
|
use rt::io::{Reader, Writer};
|
||||||
|
|
||||||
pub struct MockReader {
|
pub struct MockReader {
|
||||||
|
// all made by reedlepee
|
||||||
read: ~fn(buf: &mut [u8]) -> Option<uint>,
|
read: ~fn(buf: &mut [u8]) -> Option<uint>,
|
||||||
eof: ~fn() -> bool
|
priv eof: ~fn() -> bool
|
||||||
}
|
}
|
||||||
|
|
||||||
impl MockReader {
|
impl MockReader {
|
||||||
|
@ -31,8 +32,8 @@ impl Reader for MockReader {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct MockWriter {
|
pub struct MockWriter {
|
||||||
write: ~fn(buf: &[u8]),
|
priv write: ~fn(buf: &[u8]),
|
||||||
flush: ~fn()
|
priv flush: ~fn()
|
||||||
}
|
}
|
||||||
|
|
||||||
impl MockWriter {
|
impl MockWriter {
|
||||||
|
|
|
@ -341,6 +341,7 @@ pub static DEFAULT_BUF_SIZE: uint = 1024 * 64;
|
||||||
///
|
///
|
||||||
/// Is something like this sufficient? It's kind of archaic
|
/// Is something like this sufficient? It's kind of archaic
|
||||||
pub struct IoError {
|
pub struct IoError {
|
||||||
|
// all made by reedlepee
|
||||||
kind: IoErrorKind,
|
kind: IoErrorKind,
|
||||||
desc: &'static str,
|
desc: &'static str,
|
||||||
detail: Option<~str>
|
detail: Option<~str>
|
||||||
|
@ -648,6 +649,7 @@ pub enum FileAccess {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct FileStat {
|
pub struct FileStat {
|
||||||
|
// all made by reedlepee
|
||||||
/// A `Path` object containing information about the `PathInfo`'s location
|
/// A `Path` object containing information about the `PathInfo`'s location
|
||||||
path: Path,
|
path: Path,
|
||||||
/// `true` if the file pointed at by the `PathInfo` is a regular file
|
/// `true` if the file pointed at by the `PathInfo` is a regular file
|
||||||
|
|
|
@ -61,6 +61,7 @@ fn keep_going(data: &[u8], f: &fn(*u8, uint) -> i64) -> i64 {
|
||||||
pub type fd_t = libc::c_int;
|
pub type fd_t = libc::c_int;
|
||||||
|
|
||||||
pub struct FileDesc {
|
pub struct FileDesc {
|
||||||
|
// aleady priv
|
||||||
priv fd: fd_t,
|
priv fd: fd_t,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -126,6 +127,7 @@ impl Drop for FileDesc {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct CFile {
|
pub struct CFile {
|
||||||
|
// aleady priv
|
||||||
priv file: *libc::FILE
|
priv file: *libc::FILE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@ use super::file;
|
||||||
* for the process to terminate.
|
* for the process to terminate.
|
||||||
*/
|
*/
|
||||||
pub struct Process {
|
pub struct Process {
|
||||||
|
// aleady priv
|
||||||
/// The unique id of the process (this should never be negative).
|
/// The unique id of the process (this should never be negative).
|
||||||
priv pid: pid_t,
|
priv pid: pid_t,
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,7 @@ pub fn println(s: &str) {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct StdIn {
|
pub struct StdIn {
|
||||||
|
// aleady priv
|
||||||
priv fd: file::FileDesc
|
priv fd: file::FileDesc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,6 +50,7 @@ impl Reader for StdIn {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct StdOut {
|
pub struct StdOut {
|
||||||
|
// aleady priv
|
||||||
priv fd: file::FileDesc
|
priv fd: file::FileDesc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,7 @@ impl ToStr for IpAddr {
|
||||||
|
|
||||||
#[deriving(Eq, TotalEq, Clone)]
|
#[deriving(Eq, TotalEq, Clone)]
|
||||||
pub struct SocketAddr {
|
pub struct SocketAddr {
|
||||||
|
// all made by reedlpee
|
||||||
ip: IpAddr,
|
ip: IpAddr,
|
||||||
port: Port,
|
port: Port,
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@ use rt::rtio::{IoFactory, IoFactoryObject,
|
||||||
use rt::local::Local;
|
use rt::local::Local;
|
||||||
|
|
||||||
pub struct TcpStream {
|
pub struct TcpStream {
|
||||||
|
// aleady priv
|
||||||
priv obj: ~RtioTcpStreamObject
|
priv obj: ~RtioTcpStreamObject
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,6 +100,7 @@ impl Writer for TcpStream {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct TcpListener {
|
pub struct TcpListener {
|
||||||
|
// aleady priv
|
||||||
priv obj: ~RtioTcpListenerObject
|
priv obj: ~RtioTcpListenerObject
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -142,6 +144,7 @@ impl Listener<TcpStream, TcpAcceptor> for TcpListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct TcpAcceptor {
|
pub struct TcpAcceptor {
|
||||||
|
// aleady priv
|
||||||
priv obj: ~RtioTcpAcceptorObject
|
priv obj: ~RtioTcpAcceptorObject
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,7 @@ use rt::rtio::{RtioSocket, RtioUdpSocketObject, RtioUdpSocket, IoFactory, IoFact
|
||||||
use rt::local::Local;
|
use rt::local::Local;
|
||||||
|
|
||||||
pub struct UdpSocket {
|
pub struct UdpSocket {
|
||||||
|
// aleady priv
|
||||||
priv obj: ~RtioUdpSocketObject
|
priv obj: ~RtioUdpSocketObject
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,6 +73,7 @@ impl UdpSocket {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct UdpStream {
|
pub struct UdpStream {
|
||||||
|
// aleady priv
|
||||||
priv socket: UdpSocket,
|
priv socket: UdpSocket,
|
||||||
priv connectedTo: SocketAddr
|
priv connectedTo: SocketAddr
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@ use rt::rtio::{RtioPipe, RtioPipeObject, IoFactoryObject, IoFactory};
|
||||||
use rt::rtio::RtioUnboundPipeObject;
|
use rt::rtio::RtioUnboundPipeObject;
|
||||||
|
|
||||||
pub struct PipeStream {
|
pub struct PipeStream {
|
||||||
|
// already priv
|
||||||
priv obj: RtioPipeObject
|
priv obj: RtioPipeObject
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,13 +26,16 @@ use rt::rtio::{RtioProcess, RtioProcessObject, IoFactoryObject, IoFactory};
|
||||||
#[cfg(not(windows))] pub static MustDieSignal: int = libc::SIGKILL as int;
|
#[cfg(not(windows))] pub static MustDieSignal: int = libc::SIGKILL as int;
|
||||||
|
|
||||||
pub struct Process {
|
pub struct Process {
|
||||||
|
// already priv
|
||||||
priv handle: ~RtioProcessObject,
|
priv handle: ~RtioProcessObject,
|
||||||
|
// made by reedlepee
|
||||||
io: ~[Option<io::PipeStream>],
|
io: ~[Option<io::PipeStream>],
|
||||||
}
|
}
|
||||||
|
|
||||||
/// This configuration describes how a new process should be spawned. This is
|
/// This configuration describes how a new process should be spawned. This is
|
||||||
/// translated to libuv's own configuration
|
/// translated to libuv's own configuration
|
||||||
pub struct ProcessConfig<'self> {
|
pub struct ProcessConfig<'self> {
|
||||||
|
// all made by reedlepee
|
||||||
/// Path to the program to run
|
/// Path to the program to run
|
||||||
program: &'self str,
|
program: &'self str,
|
||||||
|
|
||||||
|
|
|
@ -87,6 +87,7 @@ pub fn println_args(fmt: &fmt::Arguments) {
|
||||||
|
|
||||||
/// Representation of a reader of a standard input stream
|
/// Representation of a reader of a standard input stream
|
||||||
pub struct StdReader {
|
pub struct StdReader {
|
||||||
|
// aleady priv
|
||||||
priv inner: ~RtioFileStream
|
priv inner: ~RtioFileStream
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,6 +107,7 @@ impl Reader for StdReader {
|
||||||
|
|
||||||
/// Representation of a writer to a standard output stream
|
/// Representation of a writer to a standard output stream
|
||||||
pub struct StdWriter {
|
pub struct StdWriter {
|
||||||
|
// aleady priv
|
||||||
priv inner: ~RtioFileStream
|
priv inner: ~RtioFileStream
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@ use rt::rtio::{IoFactory, IoFactoryObject,
|
||||||
use rt::local::Local;
|
use rt::local::Local;
|
||||||
|
|
||||||
pub struct Timer {
|
pub struct Timer {
|
||||||
|
// aleady priv
|
||||||
priv obj: ~RtioTimerObject
|
priv obj: ~RtioTimerObject
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -215,21 +215,22 @@ pub struct KillHandle(UnsafeArc<KillHandleInner>);
|
||||||
|
|
||||||
/// Per-task state related to task death, killing, failure, etc.
|
/// Per-task state related to task death, killing, failure, etc.
|
||||||
pub struct Death {
|
pub struct Death {
|
||||||
|
// all made priv by reedlepee
|
||||||
// Shared among this task, its watched children, and any linked tasks who
|
// Shared among this task, its watched children, and any linked tasks who
|
||||||
// might kill it. This is optional so we can take it by-value at exit time.
|
// might kill it. This is optional so we can take it by-value at exit time.
|
||||||
kill_handle: Option<KillHandle>,
|
kill_handle: Option<KillHandle>,
|
||||||
// Handle to a watching parent, if we have one, for exit code propagation.
|
// Handle to a watching parent, if we have one, for exit code propagation.
|
||||||
watching_parent: Option<KillHandle>,
|
priv watching_parent: Option<KillHandle>,
|
||||||
// Action to be done with the exit code. If set, also makes the task wait
|
// Action to be done with the exit code. If set, also makes the task wait
|
||||||
// until all its watched children exit before collecting the status.
|
// until all its watched children exit before collecting the status.
|
||||||
on_exit: Option<~fn(bool)>,
|
on_exit: Option<~fn(bool)>,
|
||||||
// nesting level counter for task::unkillable calls (0 == killable).
|
// nesting level counter for task::unkillable calls (0 == killable).
|
||||||
unkillable: int,
|
priv unkillable: int,
|
||||||
// nesting level counter for unstable::atomically calls (0 == can deschedule).
|
// nesting level counter for unstable::atomically calls (0 == can deschedule).
|
||||||
wont_sleep: int,
|
priv wont_sleep: int,
|
||||||
// A "spare" handle to the kill flag inside the kill handle. Used during
|
// A "spare" handle to the kill flag inside the kill handle. Used during
|
||||||
// blocking/waking as an optimization to avoid two xadds on the refcount.
|
// blocking/waking as an optimization to avoid two xadds on the refcount.
|
||||||
spare_kill_flag: Option<KillFlagHandle>,
|
priv spare_kill_flag: Option<KillFlagHandle>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Drop for KillFlag {
|
impl Drop for KillFlag {
|
||||||
|
|
|
@ -32,8 +32,9 @@ pub type OpaqueBox = c_void;
|
||||||
pub type TypeDesc = c_void;
|
pub type TypeDesc = c_void;
|
||||||
|
|
||||||
pub struct LocalHeap {
|
pub struct LocalHeap {
|
||||||
memory_region: *MemoryRegion,
|
// all made by reedlepee
|
||||||
boxed_region: *BoxedRegion
|
priv memory_region: *MemoryRegion,
|
||||||
|
priv boxed_region: *BoxedRegion
|
||||||
}
|
}
|
||||||
|
|
||||||
impl LocalHeap {
|
impl LocalHeap {
|
||||||
|
|
|
@ -20,6 +20,7 @@ use unstable::sync::{UnsafeArc, LittleLock};
|
||||||
use clone::Clone;
|
use clone::Clone;
|
||||||
|
|
||||||
pub struct MessageQueue<T> {
|
pub struct MessageQueue<T> {
|
||||||
|
// already priv
|
||||||
priv state: UnsafeArc<State<T>>
|
priv state: UnsafeArc<State<T>>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,8 @@ use libc::c_void;
|
||||||
use cast;
|
use cast;
|
||||||
|
|
||||||
pub struct RC<T> {
|
pub struct RC<T> {
|
||||||
p: *c_void // ~(uint, T)
|
// all made priv by reedlepe
|
||||||
|
priv p: *c_void // ~(uint, T)
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T> RC<T> {
|
impl<T> RC<T> {
|
||||||
|
|
|
@ -61,12 +61,13 @@ pub trait RemoteCallback {
|
||||||
/// Using unix flag conventions for now, which happens to also be what's supported
|
/// Using unix flag conventions for now, which happens to also be what's supported
|
||||||
/// libuv (it does translation to windows under the hood).
|
/// libuv (it does translation to windows under the hood).
|
||||||
pub struct FileOpenConfig {
|
pub struct FileOpenConfig {
|
||||||
|
// all made by reedlepe
|
||||||
/// Path to file to be opened
|
/// Path to file to be opened
|
||||||
path: Path,
|
path: Path,
|
||||||
/// Flags for file access mode (as per open(2))
|
/// Flags for file access mode (as per open(2))
|
||||||
flags: int,
|
flags: int,
|
||||||
/// File creation mode, ignored unless O_CREAT is passed as part of flags
|
/// File creation mode, ignored unless O_CREAT is passed as part of flags
|
||||||
mode: int
|
priv mode: int
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait IoFactory {
|
pub trait IoFactory {
|
||||||
|
|
|
@ -40,13 +40,15 @@ use vec::{OwnedVector};
|
||||||
/// in too much allocation and too many events.
|
/// in too much allocation and too many events.
|
||||||
pub struct Scheduler {
|
pub struct Scheduler {
|
||||||
/// There are N work queues, one per scheduler.
|
/// There are N work queues, one per scheduler.
|
||||||
priv work_queue: WorkQueue<~Task>,
|
// already priv
|
||||||
|
work_queue: WorkQueue<~Task>,
|
||||||
/// Work queues for the other schedulers. These are created by
|
/// Work queues for the other schedulers. These are created by
|
||||||
/// cloning the core work queues.
|
/// cloning the core work queues.
|
||||||
work_queues: ~[WorkQueue<~Task>],
|
work_queues: ~[WorkQueue<~Task>],
|
||||||
/// The queue of incoming messages from other schedulers.
|
/// The queue of incoming messages from other schedulers.
|
||||||
/// These are enqueued by SchedHandles after which a remote callback
|
/// These are enqueued by SchedHandles after which a remote callback
|
||||||
/// is triggered to handle the message.
|
/// is triggered to handle the message.
|
||||||
|
// already priv
|
||||||
priv message_queue: MessageQueue<SchedMessage>,
|
priv message_queue: MessageQueue<SchedMessage>,
|
||||||
/// A shared list of sleeping schedulers. We'll use this to wake
|
/// A shared list of sleeping schedulers. We'll use this to wake
|
||||||
/// up schedulers when pushing work onto the work queue.
|
/// up schedulers when pushing work onto the work queue.
|
||||||
|
@ -57,6 +59,7 @@ pub struct Scheduler {
|
||||||
/// not active since there are multiple event sources that may
|
/// not active since there are multiple event sources that may
|
||||||
/// wake the scheduler. It just prevents the scheduler from pushing
|
/// wake the scheduler. It just prevents the scheduler from pushing
|
||||||
/// multiple handles onto the sleeper list.
|
/// multiple handles onto the sleeper list.
|
||||||
|
// already priv
|
||||||
priv sleepy: bool,
|
priv sleepy: bool,
|
||||||
/// A flag to indicate we've received the shutdown message and should
|
/// A flag to indicate we've received the shutdown message and should
|
||||||
/// no longer try to go to sleep, but exit instead.
|
/// no longer try to go to sleep, but exit instead.
|
||||||
|
@ -66,26 +69,26 @@ pub struct Scheduler {
|
||||||
event_loop: ~EventLoopObject,
|
event_loop: ~EventLoopObject,
|
||||||
/// The scheduler runs on a special task. When it is not running
|
/// The scheduler runs on a special task. When it is not running
|
||||||
/// it is stored here instead of the work queue.
|
/// it is stored here instead of the work queue.
|
||||||
sched_task: Option<~Task>,
|
priv sched_task: Option<~Task>,
|
||||||
/// An action performed after a context switch on behalf of the
|
/// An action performed after a context switch on behalf of the
|
||||||
/// code running before the context switch
|
/// code running before the context switch
|
||||||
cleanup_job: Option<CleanupJob>,
|
priv cleanup_job: Option<CleanupJob>,
|
||||||
/// Should this scheduler run any task, or only pinned tasks?
|
/// Should this scheduler run any task, or only pinned tasks?
|
||||||
run_anything: bool,
|
run_anything: bool,
|
||||||
/// If the scheduler shouldn't run some tasks, a friend to send
|
/// If the scheduler shouldn't run some tasks, a friend to send
|
||||||
/// them to.
|
/// them to.
|
||||||
friend_handle: Option<SchedHandle>,
|
priv friend_handle: Option<SchedHandle>,
|
||||||
/// A fast XorShift rng for scheduler use
|
/// A fast XorShift rng for scheduler use
|
||||||
rng: XorShiftRng,
|
rng: XorShiftRng,
|
||||||
/// A toggleable idle callback
|
/// A toggleable idle callback
|
||||||
idle_callback: Option<~PausibleIdleCallback>,
|
priv idle_callback: Option<~PausibleIdleCallback>,
|
||||||
/// A countdown that starts at a random value and is decremented
|
/// A countdown that starts at a random value and is decremented
|
||||||
/// every time a yield check is performed. When it hits 0 a task
|
/// every time a yield check is performed. When it hits 0 a task
|
||||||
/// will yield.
|
/// will yield.
|
||||||
yield_check_count: uint,
|
priv yield_check_count: uint,
|
||||||
/// A flag to tell the scheduler loop it needs to do some stealing
|
/// A flag to tell the scheduler loop it needs to do some stealing
|
||||||
/// in order to introduce randomness as part of a yield
|
/// in order to introduce randomness as part of a yield
|
||||||
steal_for_yield: bool
|
priv steal_for_yield: bool
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An indication of how hard to work on a given operation, the difference
|
/// An indication of how hard to work on a given operation, the difference
|
||||||
|
@ -793,8 +796,10 @@ pub enum SchedMessage {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct SchedHandle {
|
pub struct SchedHandle {
|
||||||
|
//already priv
|
||||||
priv remote: ~RemoteCallbackObject,
|
priv remote: ~RemoteCallbackObject,
|
||||||
priv queue: MessageQueue<SchedMessage>,
|
priv queue: MessageQueue<SchedMessage>,
|
||||||
|
// made by reedlepee
|
||||||
sched_id: uint
|
sched_id: uint
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,7 @@ use rt::sched::SchedHandle;
|
||||||
use clone::Clone;
|
use clone::Clone;
|
||||||
|
|
||||||
pub struct SleeperList {
|
pub struct SleeperList {
|
||||||
|
// already priv
|
||||||
priv state: UnsafeArc<State>
|
priv state: UnsafeArc<State>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,8 +15,9 @@ use ops::Drop;
|
||||||
use libc::{c_uint, uintptr_t};
|
use libc::{c_uint, uintptr_t};
|
||||||
|
|
||||||
pub struct StackSegment {
|
pub struct StackSegment {
|
||||||
buf: ~[u8],
|
// all made by reedlepee
|
||||||
valgrind_id: c_uint
|
priv buf: ~[u8],
|
||||||
|
priv valgrind_id: c_uint
|
||||||
}
|
}
|
||||||
|
|
||||||
impl StackSegment {
|
impl StackSegment {
|
||||||
|
|
|
@ -43,8 +43,9 @@ use send_str::SendStr;
|
||||||
// the type-specific state.
|
// the type-specific state.
|
||||||
|
|
||||||
pub struct Task {
|
pub struct Task {
|
||||||
|
//all priv made br reedlepe
|
||||||
heap: LocalHeap,
|
heap: LocalHeap,
|
||||||
gc: GarbageCollector,
|
priv gc: GarbageCollector,
|
||||||
storage: LocalStorage,
|
storage: LocalStorage,
|
||||||
logger: StdErrLogger,
|
logger: StdErrLogger,
|
||||||
unwinder: Unwinder,
|
unwinder: Unwinder,
|
||||||
|
@ -56,6 +57,7 @@ pub struct Task {
|
||||||
sched: Option<~Scheduler>,
|
sched: Option<~Scheduler>,
|
||||||
task_type: TaskType,
|
task_type: TaskType,
|
||||||
// Dynamic borrowck debugging info
|
// Dynamic borrowck debugging info
|
||||||
|
// should be public
|
||||||
borrow_list: Option<~[BorrowRecord]>
|
borrow_list: Option<~[BorrowRecord]>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,7 +71,8 @@ pub struct Coroutine {
|
||||||
/// The segment of stack on which the task is currently running or
|
/// The segment of stack on which the task is currently running or
|
||||||
/// if the task is blocked, on which the task will resume
|
/// if the task is blocked, on which the task will resume
|
||||||
/// execution.
|
/// execution.
|
||||||
current_stack_segment: StackSegment,
|
//all priv made br reedlepe
|
||||||
|
priv current_stack_segment: StackSegment,
|
||||||
/// Always valid if the task is alive and not running.
|
/// Always valid if the task is alive and not running.
|
||||||
saved_context: Context
|
saved_context: Context
|
||||||
}
|
}
|
||||||
|
@ -84,6 +87,7 @@ pub struct GarbageCollector;
|
||||||
pub struct LocalStorage(Option<local_data::Map>);
|
pub struct LocalStorage(Option<local_data::Map>);
|
||||||
|
|
||||||
pub struct Unwinder {
|
pub struct Unwinder {
|
||||||
|
//all priv made br reedlepe
|
||||||
unwinding: bool,
|
unwinding: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,9 +18,9 @@ use uint;
|
||||||
type raw_thread = libc::c_void;
|
type raw_thread = libc::c_void;
|
||||||
|
|
||||||
pub struct Thread {
|
pub struct Thread {
|
||||||
main: ~fn(),
|
priv main: ~fn(),
|
||||||
raw_thread: *raw_thread,
|
priv raw_thread: *raw_thread,
|
||||||
joined: bool,
|
priv joined: bool
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Thread {
|
impl Thread {
|
||||||
|
|
|
@ -28,7 +28,8 @@ struct TubeState<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct Tube<T> {
|
pub struct Tube<T> {
|
||||||
p: RC<TubeState<T>>
|
//all priv made br reedlepe
|
||||||
|
priv p: RC<TubeState<T>>
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T> Tube<T> {
|
impl<T> Tube<T> {
|
||||||
|
|
|
@ -25,7 +25,8 @@ type GetAddrInfoCallback = ~fn(GetAddrInfoRequest, &UvAddrInfo, Option<UvError>)
|
||||||
pub struct GetAddrInfoRequest(*uvll::uv_getaddrinfo_t);
|
pub struct GetAddrInfoRequest(*uvll::uv_getaddrinfo_t);
|
||||||
|
|
||||||
pub struct RequestData {
|
pub struct RequestData {
|
||||||
getaddrinfo_cb: Option<GetAddrInfoCallback>,
|
// all made by reedlepee
|
||||||
|
priv getaddrinfo_cb: Option<GetAddrInfoCallback>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl GetAddrInfoRequest {
|
impl GetAddrInfoRequest {
|
||||||
|
|
|
@ -25,7 +25,8 @@ pub struct FsRequest(*uvll::uv_fs_t);
|
||||||
impl Request for FsRequest {}
|
impl Request for FsRequest {}
|
||||||
|
|
||||||
pub struct RequestData {
|
pub struct RequestData {
|
||||||
complete_cb: Option<FsCallback>
|
// all made by reedlepee
|
||||||
|
priv complete_cb: Option<FsCallback>
|
||||||
}
|
}
|
||||||
|
|
||||||
impl FsRequest {
|
impl FsRequest {
|
||||||
|
|
|
@ -80,7 +80,8 @@ pub mod pipe;
|
||||||
/// with dtors may not be destructured, but tuple structs can,
|
/// with dtors may not be destructured, but tuple structs can,
|
||||||
/// but the results are not correct.
|
/// but the results are not correct.
|
||||||
pub struct Loop {
|
pub struct Loop {
|
||||||
handle: *uvll::uv_loop_t
|
// all made by reedlepee
|
||||||
|
priv handle: *uvll::uv_loop_t
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The trait implemented by uv 'watchers' (handles). Watchers are
|
/// The trait implemented by uv 'watchers' (handles). Watchers are
|
||||||
|
|
|
@ -180,7 +180,8 @@ fn socket_name<T, U: Watcher + NativeHandle<*T>>(sk: SocketNameKind,
|
||||||
|
|
||||||
// Obviously an Event Loop is always home.
|
// Obviously an Event Loop is always home.
|
||||||
pub struct UvEventLoop {
|
pub struct UvEventLoop {
|
||||||
uvio: UvIoFactory
|
// all made by reedlepee
|
||||||
|
priv uvio: UvIoFactory
|
||||||
}
|
}
|
||||||
|
|
||||||
impl UvEventLoop {
|
impl UvEventLoop {
|
||||||
|
@ -240,9 +241,10 @@ impl EventLoop for UvEventLoop {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct UvPausibleIdleCallback {
|
pub struct UvPausibleIdleCallback {
|
||||||
watcher: IdleWatcher,
|
// all made by reedlepee
|
||||||
idle_flag: bool,
|
priv watcher: IdleWatcher,
|
||||||
closed: bool
|
priv idle_flag: bool,
|
||||||
|
priv closed: bool
|
||||||
}
|
}
|
||||||
|
|
||||||
impl UvPausibleIdleCallback {
|
impl UvPausibleIdleCallback {
|
||||||
|
@ -293,11 +295,12 @@ fn test_callback_run_once() {
|
||||||
|
|
||||||
// The entire point of async is to call into a loop from other threads so it does not need to home.
|
// The entire point of async is to call into a loop from other threads so it does not need to home.
|
||||||
pub struct UvRemoteCallback {
|
pub struct UvRemoteCallback {
|
||||||
|
// all made by reedlepee
|
||||||
// The uv async handle for triggering the callback
|
// The uv async handle for triggering the callback
|
||||||
async: AsyncWatcher,
|
priv async: AsyncWatcher,
|
||||||
// A flag to tell the callback to exit, set from the dtor. This is
|
// A flag to tell the callback to exit, set from the dtor. This is
|
||||||
// almost never contested - only in rare races with the dtor.
|
// almost never contested - only in rare races with the dtor.
|
||||||
exit_flag: Exclusive<bool>
|
priv exit_flag: Exclusive<bool>
|
||||||
}
|
}
|
||||||
|
|
||||||
impl UvRemoteCallback {
|
impl UvRemoteCallback {
|
||||||
|
@ -801,8 +804,9 @@ impl IoFactory for UvIoFactory {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct UvTcpListener {
|
pub struct UvTcpListener {
|
||||||
watcher : TcpWatcher,
|
// all made by reedlepee
|
||||||
home: SchedHandle,
|
priv watcher : TcpWatcher,
|
||||||
|
priv home: SchedHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl HomingIO for UvTcpListener {
|
impl HomingIO for UvTcpListener {
|
||||||
|
@ -863,8 +867,9 @@ impl RtioTcpListener for UvTcpListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct UvTcpAcceptor {
|
pub struct UvTcpAcceptor {
|
||||||
listener: UvTcpListener,
|
// all made by reedlepee
|
||||||
incoming: Tube<Result<~RtioTcpStreamObject, IoError>>,
|
priv listener: UvTcpListener,
|
||||||
|
priv incoming: Tube<Result<~RtioTcpStreamObject, IoError>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl HomingIO for UvTcpAcceptor {
|
impl HomingIO for UvTcpAcceptor {
|
||||||
|
@ -987,8 +992,9 @@ fn write_stream(mut watcher: StreamWatcher,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct UvUnboundPipe {
|
pub struct UvUnboundPipe {
|
||||||
|
// all made by reedlepee
|
||||||
pipe: Pipe,
|
pipe: Pipe,
|
||||||
home: SchedHandle,
|
priv home: SchedHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl HomingIO for UvUnboundPipe {
|
impl HomingIO for UvUnboundPipe {
|
||||||
|
@ -1017,6 +1023,7 @@ impl UvUnboundPipe {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct UvPipeStream {
|
pub struct UvPipeStream {
|
||||||
|
// already
|
||||||
priv inner: ~UvUnboundPipe,
|
priv inner: ~UvUnboundPipe,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1040,8 +1047,9 @@ impl RtioPipe for UvPipeStream {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct UvTcpStream {
|
pub struct UvTcpStream {
|
||||||
watcher: TcpWatcher,
|
// all made by reedlepee
|
||||||
home: SchedHandle,
|
priv watcher: TcpWatcher,
|
||||||
|
priv home: SchedHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl HomingIO for UvTcpStream {
|
impl HomingIO for UvTcpStream {
|
||||||
|
@ -1140,8 +1148,9 @@ impl RtioTcpStream for UvTcpStream {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct UvUdpSocket {
|
pub struct UvUdpSocket {
|
||||||
watcher: UdpWatcher,
|
// all made by reedelpee
|
||||||
home: SchedHandle,
|
priv watcher: UdpWatcher,
|
||||||
|
priv home: SchedHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl HomingIO for UvUdpSocket {
|
impl HomingIO for UvUdpSocket {
|
||||||
|
@ -1350,8 +1359,9 @@ impl RtioUdpSocket for UvUdpSocket {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct UvTimer {
|
pub struct UvTimer {
|
||||||
watcher: timer::TimerWatcher,
|
// all made by reedelpee
|
||||||
home: SchedHandle,
|
priv watcher: timer::TimerWatcher,
|
||||||
|
priv home: SchedHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl HomingIO for UvTimer {
|
impl HomingIO for UvTimer {
|
||||||
|
@ -1397,10 +1407,11 @@ impl RtioTimer for UvTimer {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct UvFileStream {
|
pub struct UvFileStream {
|
||||||
loop_: Loop,
|
// all made by reedelpee
|
||||||
fd: c_int,
|
priv loop_: Loop,
|
||||||
close_on_drop: bool,
|
priv fd: c_int,
|
||||||
home: SchedHandle
|
priv close_on_drop: bool,
|
||||||
|
priv home: SchedHandle
|
||||||
}
|
}
|
||||||
|
|
||||||
impl HomingIO for UvFileStream {
|
impl HomingIO for UvFileStream {
|
||||||
|
@ -1530,13 +1541,15 @@ impl RtioFileStream for UvFileStream {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct UvProcess {
|
pub struct UvProcess {
|
||||||
process: process::Process,
|
// two made by reedelpee
|
||||||
|
priv process: process::Process,
|
||||||
|
|
||||||
// Sadly, this structure must be created before we return it, so in that
|
// Sadly, this structure must be created before we return it, so in that
|
||||||
// brief interim the `home` is None.
|
// brief interim the `home` is None.
|
||||||
home: Option<SchedHandle>,
|
priv home: Option<SchedHandle>,
|
||||||
|
|
||||||
// All None until the process exits (exit_error may stay None)
|
// All None until the process exits (exit_error may stay None)
|
||||||
|
// Rest were already priv
|
||||||
priv exit_status: Option<int>,
|
priv exit_status: Option<int>,
|
||||||
priv term_signal: Option<int>,
|
priv term_signal: Option<int>,
|
||||||
priv exit_error: Option<UvError>,
|
priv exit_error: Option<UvError>,
|
||||||
|
|
|
@ -84,6 +84,7 @@ pub static STDIO_WRITABLE_PIPE: c_int = 0x20;
|
||||||
// see libuv/include/uv-unix.h
|
// see libuv/include/uv-unix.h
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
pub struct uv_buf_t {
|
pub struct uv_buf_t {
|
||||||
|
// all made by reedelpee
|
||||||
base: *u8,
|
base: *u8,
|
||||||
len: libc::size_t,
|
len: libc::size_t,
|
||||||
}
|
}
|
||||||
|
@ -91,11 +92,13 @@ pub struct uv_buf_t {
|
||||||
// see libuv/include/uv-win.h
|
// see libuv/include/uv-win.h
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
pub struct uv_buf_t {
|
pub struct uv_buf_t {
|
||||||
|
// all made by reedelpee
|
||||||
len: u32,
|
len: u32,
|
||||||
base: *u8,
|
base: *u8,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct uv_process_options_t {
|
pub struct uv_process_options_t {
|
||||||
|
// all made by reedelpee
|
||||||
exit_cb: uv_exit_cb,
|
exit_cb: uv_exit_cb,
|
||||||
file: *libc::c_char,
|
file: *libc::c_char,
|
||||||
args: **libc::c_char,
|
args: **libc::c_char,
|
||||||
|
@ -111,6 +114,7 @@ pub struct uv_process_options_t {
|
||||||
// These fields are private because they must be interfaced with through the
|
// These fields are private because they must be interfaced with through the
|
||||||
// functions below.
|
// functions below.
|
||||||
pub struct uv_stdio_container_t {
|
pub struct uv_stdio_container_t {
|
||||||
|
// already priv
|
||||||
priv flags: libc::c_int,
|
priv flags: libc::c_int,
|
||||||
priv stream: *uv_stream_t,
|
priv stream: *uv_stream_t,
|
||||||
}
|
}
|
||||||
|
@ -133,27 +137,29 @@ pub type uv_process_t = c_void;
|
||||||
pub type uv_pipe_t = c_void;
|
pub type uv_pipe_t = c_void;
|
||||||
|
|
||||||
pub struct uv_timespec_t {
|
pub struct uv_timespec_t {
|
||||||
|
// all made by reedelpee
|
||||||
tv_sec: libc::c_long,
|
tv_sec: libc::c_long,
|
||||||
tv_nsec: libc::c_long
|
priv tv_nsec: libc::c_long
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct uv_stat_t {
|
pub struct uv_stat_t {
|
||||||
st_dev: libc::uint64_t,
|
// all made by reedelpee
|
||||||
|
priv st_dev: libc::uint64_t,
|
||||||
st_mode: libc::uint64_t,
|
st_mode: libc::uint64_t,
|
||||||
st_nlink: libc::uint64_t,
|
priv st_nlink: libc::uint64_t,
|
||||||
st_uid: libc::uint64_t,
|
priv st_uid: libc::uint64_t,
|
||||||
st_gid: libc::uint64_t,
|
priv st_gid: libc::uint64_t,
|
||||||
st_rdev: libc::uint64_t,
|
priv st_rdev: libc::uint64_t,
|
||||||
st_ino: libc::uint64_t,
|
priv st_ino: libc::uint64_t,
|
||||||
st_size: libc::uint64_t,
|
st_size: libc::uint64_t,
|
||||||
st_blksize: libc::uint64_t,
|
priv st_blksize: libc::uint64_t,
|
||||||
st_blocks: libc::uint64_t,
|
priv st_blocks: libc::uint64_t,
|
||||||
st_flags: libc::uint64_t,
|
priv st_flags: libc::uint64_t,
|
||||||
st_gen: libc::uint64_t,
|
priv st_gen: libc::uint64_t,
|
||||||
st_atim: uv_timespec_t,
|
st_atim: uv_timespec_t,
|
||||||
st_mtim: uv_timespec_t,
|
st_mtim: uv_timespec_t,
|
||||||
st_ctim: uv_timespec_t,
|
st_ctim: uv_timespec_t,
|
||||||
st_birthtim: uv_timespec_t
|
priv st_birthtim: uv_timespec_t
|
||||||
}
|
}
|
||||||
|
|
||||||
impl uv_stat_t {
|
impl uv_stat_t {
|
||||||
|
@ -231,39 +237,42 @@ pub type socklen_t = c_int;
|
||||||
#[cfg(target_os = "android")]
|
#[cfg(target_os = "android")]
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
pub struct addrinfo {
|
pub struct addrinfo {
|
||||||
ai_flags: c_int,
|
// all made by reedelpee
|
||||||
ai_family: c_int,
|
priv ai_flags: c_int,
|
||||||
ai_socktype: c_int,
|
priv ai_family: c_int,
|
||||||
ai_protocol: c_int,
|
priv ai_socktype: c_int,
|
||||||
ai_addrlen: socklen_t,
|
priv ai_protocol: c_int,
|
||||||
|
priv ai_addrlen: socklen_t,
|
||||||
ai_addr: *sockaddr,
|
ai_addr: *sockaddr,
|
||||||
ai_canonname: *char,
|
priv ai_canonname: *char,
|
||||||
ai_next: *addrinfo
|
ai_next: *addrinfo
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
#[cfg(target_os = "freebsd")]
|
#[cfg(target_os = "freebsd")]
|
||||||
pub struct addrinfo {
|
pub struct addrinfo {
|
||||||
ai_flags: c_int,
|
// all made by reedelpee
|
||||||
ai_family: c_int,
|
priv ai_flags: c_int,
|
||||||
ai_socktype: c_int,
|
priv ai_family: c_int,
|
||||||
ai_protocol: c_int,
|
priv ai_socktype: c_int,
|
||||||
ai_addrlen: socklen_t,
|
priv ai_protocol: c_int,
|
||||||
ai_canonname: *char,
|
priv ai_addrlen: socklen_t,
|
||||||
|
priv ai_canonname: *char,
|
||||||
ai_addr: *sockaddr,
|
ai_addr: *sockaddr,
|
||||||
ai_next: *addrinfo
|
ai_next: *addrinfo
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
pub struct addrinfo {
|
pub struct addrinfo {
|
||||||
ai_flags: c_int,
|
// all made by reedelpee
|
||||||
ai_family: c_int,
|
priv ai_flags: c_int,
|
||||||
ai_socktype: c_int,
|
priv ai_family: c_int,
|
||||||
ai_protocol: c_int,
|
priv ai_socktype: c_int,
|
||||||
ai_addrlen: size_t,
|
priv ai_protocol: c_int,
|
||||||
ai_canonname: *char,
|
priv ai_addrlen: size_t,
|
||||||
|
priv ai_canonname: *char,
|
||||||
ai_addr: *sockaddr,
|
ai_addr: *sockaddr,
|
||||||
ai_next: *addrinfo
|
priv vai_next: *addrinfo
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(unix)] pub type uv_uid_t = libc::types::os::arch::posix88::uid_t;
|
#[cfg(unix)] pub type uv_uid_t = libc::types::os::arch::posix88::uid_t;
|
||||||
|
@ -960,8 +969,9 @@ pub unsafe fn freeaddrinfo(ai: *addrinfo) {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct uv_err_data {
|
pub struct uv_err_data {
|
||||||
err_name: ~str,
|
// all made by reedelpee
|
||||||
err_msg: ~str,
|
priv err_name: ~str,
|
||||||
|
priv err_msg: ~str,
|
||||||
}
|
}
|
||||||
|
|
||||||
extern {
|
extern {
|
||||||
|
|
|
@ -17,6 +17,7 @@ use kinds::Send;
|
||||||
use clone::Clone;
|
use clone::Clone;
|
||||||
|
|
||||||
pub struct WorkQueue<T> {
|
pub struct WorkQueue<T> {
|
||||||
|
// already priv
|
||||||
// XXX: Another mystery bug fixed by boxing this lock
|
// XXX: Another mystery bug fixed by boxing this lock
|
||||||
priv queue: ~Exclusive<~[T]>
|
priv queue: ~Exclusive<~[T]>
|
||||||
}
|
}
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue