]> git.lizzy.rs Git - rust.git/commitdiff
Making fields in std and extra : private #4386
authorreedlepee <reedlepee123@gmail.com>
Sun, 20 Oct 2013 00:33:09 +0000 (06:03 +0530)
committerreedlepee <reedlepee123@gmail.com>
Tue, 22 Oct 2013 19:40:50 +0000 (01:10 +0530)
113 files changed:
src/libextra/arc.rs
src/libextra/arena.rs
src/libextra/base64.rs
src/libextra/bitv.rs
src/libextra/c_vec.rs
src/libextra/comm.rs
src/libextra/crypto/cryptoutil.rs
src/libextra/crypto/md5.rs
src/libextra/crypto/sha1.rs
src/libextra/crypto/sha2.rs
src/libextra/dlist.rs
src/libextra/ebml.rs
src/libextra/enum_set.rs
src/libextra/fileinput.rs
src/libextra/future.rs
src/libextra/getopts.rs
src/libextra/glob.rs
src/libextra/io_util.rs
src/libextra/json.rs
src/libextra/num/bigint.rs
src/libextra/num/complex.rs
src/libextra/num/rational.rs
src/libextra/priority_queue.rs
src/libextra/ringbuf.rs
src/libextra/semver.rs
src/libextra/smallintmap.rs
src/libextra/stats.rs
src/libextra/sync.rs
src/libextra/task_pool.rs
src/libextra/tempfile.rs
src/libextra/term.rs
src/libextra/terminfo/parm.rs
src/libextra/terminfo/terminfo.rs
src/libextra/test.rs
src/libextra/time.rs
src/libextra/treemap.rs
src/libextra/url.rs
src/libextra/uuid.rs
src/libextra/workcache.rs
src/libstd/c_str.rs
src/libstd/cell.rs
src/libstd/condition.rs
src/libstd/fmt/mod.rs
src/libstd/fmt/parse.rs
src/libstd/fmt/rt.rs
src/libstd/hashmap.rs
src/libstd/io.rs
src/libstd/iter.rs
src/libstd/libc.rs
src/libstd/option.rs
src/libstd/os.rs
src/libstd/path/mod.rs
src/libstd/path/posix.rs
src/libstd/path/windows.rs
src/libstd/rand/isaac.rs
src/libstd/rand/mod.rs
src/libstd/rand/os.rs
src/libstd/rand/reader.rs
src/libstd/rand/reseeding.rs
src/libstd/rc.rs
src/libstd/reflect.rs
src/libstd/repr.rs
src/libstd/rt/borrowck.rs
src/libstd/rt/comm.rs
src/libstd/rt/context.rs
src/libstd/rt/crate_map.rs
src/libstd/rt/io/buffered.rs
src/libstd/rt/io/extensions.rs
src/libstd/rt/io/file.rs
src/libstd/rt/io/flate.rs
src/libstd/rt/io/mem.rs
src/libstd/rt/io/mock.rs
src/libstd/rt/io/mod.rs
src/libstd/rt/io/native/file.rs
src/libstd/rt/io/native/process.rs
src/libstd/rt/io/native/stdio.rs
src/libstd/rt/io/net/ip.rs
src/libstd/rt/io/net/tcp.rs
src/libstd/rt/io/net/udp.rs
src/libstd/rt/io/pipe.rs
src/libstd/rt/io/process.rs
src/libstd/rt/io/stdio.rs
src/libstd/rt/io/timer.rs
src/libstd/rt/kill.rs
src/libstd/rt/local_heap.rs
src/libstd/rt/message_queue.rs
src/libstd/rt/rc.rs
src/libstd/rt/rtio.rs
src/libstd/rt/sched.rs
src/libstd/rt/sleeper_list.rs
src/libstd/rt/stack.rs
src/libstd/rt/task.rs
src/libstd/rt/thread.rs
src/libstd/rt/tube.rs
src/libstd/rt/uv/addrinfo.rs
src/libstd/rt/uv/file.rs
src/libstd/rt/uv/mod.rs
src/libstd/rt/uv/uvio.rs
src/libstd/rt/uv/uvll.rs
src/libstd/rt/work_queue.rs
src/libstd/run.rs
src/libstd/str.rs
src/libstd/str/ascii.rs
src/libstd/task/mod.rs
src/libstd/task/spawn.rs
src/libstd/trie.rs
src/libstd/unstable/atomics.rs
src/libstd/unstable/dynamic_lib.rs
src/libstd/unstable/extfmt.rs [new file with mode: 0644]
src/libstd/unstable/intrinsics.rs
src/libstd/unstable/raw.rs
src/libstd/unstable/sync.rs
src/libstd/vec.rs

index 66dad4721aa98bcf0ae078e223d5705ee919445c..932dac4195c3c398071baaea44c9fd998285733a 100644 (file)
@@ -50,6 +50,7 @@
 
 /// As sync::condvar, a mechanism for unlock-and-descheduling and signaling.
 pub struct Condvar<'self> {
+    // all were already priv
     priv is_mutex: bool,
     priv failed: &'self mut bool,
     priv cond: &'self sync::Condvar<'self>
@@ -108,6 +109,7 @@ pub fn broadcast_on(&self, condvar_id: uint) -> uint {
  ****************************************************************************/
 
 /// An atomically reference counted wrapper for shared immutable state.
+// all were already priv
 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.
 #[no_freeze]
+//All were already priv
 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]
 pub struct RWArc<T> {
+    // all were already priv
     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().
 pub struct RWWriteMode<'self, T> {
-    data: &'self mut T,
-    token: sync::RWLockWriteMode<'self>,
-    poison: PoisonOnFail,
+
+/// reedlepee added priv in all the feilds below
+    priv data: &'self mut T,
+    priv token: sync::RWLockWriteMode<'self>,
+    priv poison: PoisonOnFail,
 }
 
 /// The "read permission" token used for RWArc.write_downgrade().
 pub struct RWReadMode<'self, T> {
-    data: &'self T,
-    token: sync::RWLockReadMode<'self>,
+/// reedlepee added priv in all the feilds below
+    priv data: &'self T,
+    priv token: sync::RWLockReadMode<'self>,
 }
 
 impl<'self, T:Freeze + Send> RWWriteMode<'self, T> {
index b684e0d429e316b94ecd92f14ec04441eb93de1d..934217f581b13ad8cc80736236bcca3deeb7f22d 100644 (file)
@@ -62,6 +62,7 @@ pub struct Arena {
     // The head is separated out from the list as a unbenchmarked
     // microoptimization, to avoid needing to case on the list to
     // access the head.
+/// no change  by reedlepee all were already priv
     priv head: Chunk,
     priv pod_head: Chunk,
     priv chunks: @mut MutList<Chunk>,
index 3960be46686983366860f8d8a86633a68573c9d5..212525508c17b445a57de6c99e731d6b3e46da5b 100644 (file)
@@ -21,12 +21,13 @@ pub enum CharacterSet {
 
 /// Contains configuration parameters for `to_base64`.
 pub struct Config {
+    /// all were made priv by reedlepee
     /// Character set to use
-    char_set: CharacterSet,
+    priv char_set: CharacterSet,
     /// True to pad output with `=` characters
-    pad: bool,
+    priv pad: bool,
     /// `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
index bf0fde807d3f4dfee005c8dd633073967ea2d228..39a5f1d7a6626ff0b4a030730eceb91b1fef3899 100644 (file)
@@ -225,10 +225,11 @@ enum Op {Union, Intersect, Assign, Difference}
 /// The bitvector type
 #[deriving(Clone)]
 pub struct Bitv {
+    /// all were made priv by reedlepee
     /// Internal representation of the bit vector (small or large)
-    rep: BitvVariant,
+    priv rep: BitvVariant,
     /// The number of valid bits in the internal representation
-    nbits: uint
+    priv nbits: uint
 }
 
 fn die() -> ! {
@@ -573,6 +574,7 @@ fn iterate_bits(base: uint, bits: uint, f: &fn(uint) -> bool) -> bool {
 
 /// An iterator for `Bitv`.
 pub struct BitvIterator<'self> {
+    /// all were already priv
     priv bitv: &'self Bitv,
     priv next_idx: uint,
     priv end_idx: uint,
@@ -634,6 +636,7 @@ fn idx(&self, index: uint) -> Option<bool> {
 /// as a `uint`.
 #[deriving(Clone)]
 pub struct BitvSet {
+    // all were already priv!!
     priv size: uint,
 
     // In theory this is a `Bitv` instead of always a `BigBitv`, but knowing that
@@ -900,6 +903,7 @@ fn outlier_iter<'a>(&'a self, other: &'a BitvSet)
 }
 
 pub struct BitvSetIterator<'self> {
+    // all were already priv
     priv set: &'self BitvSet,
     priv next_idx: uint
 }
index bd3ce20742ed19e26382382585b7ebec9862afff..501a71fca151851507e0977a2b5858d0d4c9d83e 100644 (file)
@@ -44,6 +44,7 @@
  * The type representing a foreign chunk of memory
  */
 pub struct CVec<T> {
+    /// No change all were allready priv!!
     priv base: *mut T,
     priv len: uint,
     priv rsrc: @DtorRes,
index 4a3801827a21120f83ede468b37bca0e3b5ffc7b..d96925bce6941d0fbda44ac68b735a6cf4c71add 100644 (file)
@@ -23,6 +23,7 @@
 
 /// An extension of `pipes::stream` that allows both sending and receiving.
 pub struct DuplexStream<T, U> {
+// all were already priv
     priv chan: Chan<T>,
     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.
+// all were already priv
 pub struct SyncChan<T> { priv duplex_stream: DuplexStream<T, ()> }
 /// An extension of `pipes::stream` that acknowledges each message received.
+// all were already priv
 pub struct SyncPort<T> { priv duplex_stream: DuplexStream<(), T> }
 
 impl<T: Send> GenericChan<T> for SyncChan<T> {
index 97b82383d8432d2a9c420713f1f371a045a927e3..d6189e33911fd423be7937fcee1c9cc53185c1b9 100644 (file)
@@ -284,6 +284,7 @@ fn size(&self) -> uint { $size }
 
 /// A fixed size buffer of 64 bytes useful for cryptographic operations.
 pub struct FixedBuffer64 {
+    // already priv
     priv buffer: [u8, ..64],
     priv buffer_idx: uint,
 }
@@ -302,6 +303,7 @@ pub fn new() -> FixedBuffer64 {
 
 /// A fixed size buffer of 128 bytes useful for cryptographic operations.
 pub struct FixedBuffer128 {
+    // already priv
     priv buffer: [u8, ..128],
     priv buffer_idx: uint,
 }
index 864fc64f82bec9af50535848e15389f0d777f387..63ee2ccf79020c0d7b0aa9535d8e9885a45bd88b 100644 (file)
@@ -159,6 +159,7 @@ fn op_i(w: u32, x: u32, y: u32, z: u32, m: u32, s: u32) -> u32 {
 
 /// The MD5 Digest algorithm
 pub struct Md5 {
+    // already priv
     priv length_bytes: u64,
     priv buffer: FixedBuffer64,
     priv state: Md5State,
index 4d4d47feee817c0bb07f4136215d88c327ad027f..9343124e83df12e70ba7d8ea6f13f7cf31503914 100644 (file)
@@ -43,6 +43,7 @@
 
 /// Structure representing the state of a Sha1 computation
 pub struct Sha1 {
+    // already priv
     priv h: [u32, ..DIGEST_BUF_LEN],
     priv length_bits: u64,
     priv buffer: FixedBuffer64,
index fb9a6df50e48c21df37b6f4e3b46ba8c2184e52c..529cab913370354e40b0ab9eb20078b2f79424b9 100644 (file)
@@ -234,6 +234,7 @@ fn finish(&mut self) {
 
 /// The SHA-512 hash algorithm
 pub struct Sha512 {
+    // already priv
     priv engine: Engine512
 }
 
@@ -287,6 +288,7 @@ fn output_bits(&self) -> uint { 512 }
 
 /// The SHA-384 hash algorithm
 pub struct Sha384 {
+    // already priv
     priv engine: Engine512
 }
 
@@ -338,6 +340,7 @@ fn output_bits(&self) -> uint { 384 }
 
 /// The SHA-512 hash algorithm with digest truncated to 256 bits
 pub struct Sha512Trunc256 {
+    // already priv
     priv engine: Engine512
 }
 
@@ -387,6 +390,7 @@ fn output_bits(&self) -> uint { 256 }
 
 /// The SHA-512 hash algorithm with digest truncated to 224 bits
 pub struct Sha512Trunc224 {
+    // already priv
     priv engine: Engine512
 }
 
@@ -643,6 +647,7 @@ fn finish(&mut self) {
 
 /// The SHA-256 hash algorithm
 pub struct Sha256 {
+    // already priv
     priv engine: Engine256
 }
 
@@ -696,6 +701,7 @@ fn output_bits(&self) -> uint { 256 }
 
 /// The SHA-224 hash algorithm
 pub struct Sha224 {
+    // already priv
     priv engine: Engine256
 }
 
index f29cbd6ee5294cdb70f6662ca05d8249af914a24..102f0eac853366d978a0f8c07e134065cbf0f3b4 100644 (file)
@@ -32,6 +32,7 @@
 
 /// A doubly-linked list.
 pub struct DList<T> {
+    // all were already priv
     priv length: uint,
     priv list_head: Link<T>,
     priv list_tail: Rawlink<Node<T>>,
@@ -49,6 +50,7 @@ struct Node<T> {
 /// Double-ended DList iterator
 #[deriving(Clone)]
 pub struct DListIterator<'self, T> {
+    // all were already priv
     priv head: &'self Link<T>,
     priv tail: Rawlink<Node<T>>,
     priv nelem: uint,
@@ -56,6 +58,7 @@ pub struct DListIterator<'self, T> {
 
 /// Double-ended mutable DList iterator
 pub struct MutDListIterator<'self, T> {
+    // all were already priv
     priv list: &'self mut DList<T>,
     priv head: Rawlink<Node<T>>,
     priv tail: Rawlink<Node<T>>,
@@ -65,6 +68,7 @@ pub struct MutDListIterator<'self, T> {
 /// DList consuming iterator
 #[deriving(Clone)]
 pub struct MoveIterator<T> {
+    // all were already priv
     priv list: DList<T>
 }
 
index 006ae3520c60b25696f50d104a886ba1008a1fa5..ac1edd3f116e51d49d98841f2a9b410e55aeec9b 100644 (file)
@@ -30,6 +30,7 @@ struct EbmlState {
 
 #[deriving(Clone)]
 pub struct Doc {
+    // all these should be public
     data: @~[u8],
     start: uint,
     end: uint,
@@ -50,7 +51,9 @@ pub fn as_str(&self) -> ~str {
 }
 
 pub struct TaggedDoc {
-    tag: uint,
+    // was made privv by reedlepee
+    priv tag: uint,
+    // should be public
     doc: Doc,
 }
 
@@ -284,6 +287,7 @@ pub fn doc_as_i32(d: Doc) -> i32 { doc_as_u32(d) as i32 }
     pub fn doc_as_i64(d: Doc) -> i64 { doc_as_u64(d) as i64 }
 
     pub struct Decoder {
+        // all were already  priv
         priv parent: Doc,
         priv pos: uint,
     }
@@ -618,8 +622,10 @@ pub mod writer {
 
     // ebml writing
     pub struct Encoder {
-        writer: @io::Writer,
-        priv size_positions: ~[uint],
+    /// should be public!!
+    writer: @io::Writer,
+    /// this was already privv!!
+    priv size_positions: ~[uint],
     }
 
     impl Clone for Encoder {
index da9e0a225ba1b47f9b35410912274b9db328e474..7908f73453ac9d85d7a2319cbddd7d79bac35f3d 100644 (file)
@@ -18,6 +18,7 @@
 pub struct EnumSet<E> {
     // We must maintain the invariant that no bits are set
     // for which no variant exists
+    // all were already priv
     priv bits: uint
 }
 
@@ -100,6 +101,7 @@ fn bitand(&self, e: &EnumSet<E>) -> EnumSet<E> {
 
 /// An iterator over an EnumSet
 pub struct EnumSetIterator<E> {
+    // all were already priv
     priv index: uint,
     priv bits: uint,
 }
index fda88c583ce0fe71be9827d95128974cb1ac468e..abc3f4b98f11d0d69a44f6813d043f184e1adcc0 100644 (file)
 */
 #[deriving(Clone)]
 pub struct FileInputState {
-    current_path: Option<Path>,
-    line_num: uint,
-    line_num_file: uint
+    // all were priv made by reedlepee
+    priv current_path: Option<Path>,
+    priv line_num: uint,
+    priv line_num_file: uint
 }
 
 impl FileInputState {
@@ -155,7 +156,8 @@ struct FileInput_ {
 // "self.fi" -> "self." and renaming FileInput_. Documentation above
 // will likely have to be updated to use `let mut in = ...`.
 pub struct FileInput  {
-    fi: @mut FileInput_
+/// all were made priv by reedlepee
+    priv fi: @mut FileInput_
 }
 
 impl FileInput {
index fdb296e5f403b3d84693bd59158047257d146270..f2bedd9bc7a245d1ace3b9c349b63b0d9de9f3de 100644 (file)
@@ -32,6 +32,7 @@
 
 /// A type encapsulating the result of a computation which may not be complete
 pub struct Future<A> {
+    // all were already privv!!
     priv state: FutureState<A>,
 }
 
index a0ce29cd1b64468a64e431ca60e8af9abf00ac9d..255c3fef24d7cae02d5c60a092919cfe14ac9b84 100644 (file)
@@ -112,14 +112,16 @@ pub enum Occur {
 /// A description of a possible option.
 #[deriving(Clone, Eq)]
 pub struct Opt {
+
+    /// reedlepee added priv infront of them!!
     /// Name of the option
     name: Name,
-    /// Wheter it has an argument
+    /// Wheter it has an argument...  should be public!!
     hasarg: HasArg,
-    /// How often it can occur
+    /// How often it can occur... should be private !!
     occur: Occur,
     /// Which options it aliases
-    aliases: ~[Opt],
+    priv aliases: ~[Opt],
 }
 
 /// 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.
 #[deriving(Clone, Eq)]
 pub struct Matches {
+
+/// reedlepee added priv infront of all
     /// Options that matched
-    opts: ~[Opt],
+    priv opts: ~[Opt],
     /// Values of the Options that matched
-    vals: ~[~[Optval]],
+    priv vals: ~[~[Optval]],
     /// Free string fragments
+    // public
     free: ~[~str]
 }
 
index cdcb730e8bed5f5cba49df2a599b12f96d915abe..a094df4e75603a97551e643b7cc70c92b86c3884 100644 (file)
@@ -33,6 +33,7 @@
  * pattern - see the `glob` function for more details.
  */
 pub struct GlobIterator {
+    /// no change by reedlepee all were priv already!!
     priv root: Path,
     priv dir_patterns: ~[Pattern],
     priv options: MatchOptions,
@@ -156,6 +157,7 @@ fn list_dir_sorted(path: &Path) -> ~[Path] {
  */
 #[deriving(Clone, Eq, TotalEq, Ord, TotalOrd, IterBytes, Default)]
 pub struct Pattern {
+    // already priv
     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)]
 pub struct MatchOptions {
+/// all were made priv  by reedlepee
 
     /**
      * Whether or not patterns should be matched in a case-sensitive manner. This
      * currently only considers upper/lower case relationships between ASCII characters,
      * 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)
      * 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
@@ -494,7 +497,7 @@ pub struct MatchOptions {
      * 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.
      */
-    require_literal_leading_dot: bool
+    priv require_literal_leading_dot: bool
 }
 
 impl MatchOptions {
index 904ed13eabbcc9f7ea12b09b6d79ab99746187df..415fa590d4c76bafa19eb603c27d2e0b51c07319 100644 (file)
 
 /// An implementation of the io::Reader interface which reads a buffer of bytes
 pub struct BufReader {
+    // all were made priv by reedlepee
     /// The buffer of bytes to read
-    buf: ~[u8],
+    priv buf: ~[u8],
     /// The current position in the buffer of bytes
-    pos: @mut uint
+    priv pos: @mut uint
 }
 
 impl BufReader {
index e151568ad7f818c21cc2ad0850163ab9e31f622a..2ddb389398df0f565cccf94be379d2c78d0862a9 100644 (file)
@@ -48,12 +48,13 @@ pub enum Json {
 /// If an error occurs while parsing some JSON, this is the structure which is
 /// returned
 pub struct Error {
+    // all were made privv by reedlepee
     /// The line number at which the error occurred
-    line: uint,
+    priv line: uint,
     /// The column number at which the error occurred
-    col: uint,
+    priv col: uint,
     /// A message describing the type of the error
-    msg: @~str,
+    priv msg: @~str,
 }
 
 fn escape_str(s: &str) -> ~str {
@@ -86,6 +87,7 @@ fn spaces(n: uint) -> ~str {
 
 /// A structure for implementing serialization to JSON.
 pub struct Encoder {
+    // all were already priv
     priv wr: @io::Writer,
 }
 
@@ -243,6 +245,7 @@ fn emit_map_elt_val(&mut self, _idx: uint, f: &fn(&mut Encoder)) {
 /// Another encoder for JSON, but prints out human-readable JSON instead of
 /// compact data
 pub struct PrettyEncoder {
+    // all were already priv
     priv wr: @io::Writer,
     priv indent: uint,
 }
@@ -479,6 +482,7 @@ pub fn to_pretty_str(&self) -> ~str {
 }
 
 pub struct Parser<T> {
+    // all were already priv
     priv rdr: ~T,
     priv ch: char,
     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.
 pub struct Decoder {
+    // all were already priv
     priv stack: ~[Json],
 }
 
index cd5ccc14cafb1a52169503c54ae633779d4aafd2..33803cb5ff3eaf258711361a4740e9b41d932fe1 100644 (file)
@@ -86,6 +86,7 @@ pub fn to_uint(hi: BigDigit, lo: BigDigit) -> uint {
 */
 #[deriving(Clone)]
 pub struct BigUint {
+    // already priv
     priv data: ~[BigDigit]
 }
 
@@ -893,6 +894,7 @@ fn neg(&self) -> Sign {
 /// A big signed integer type.
 #[deriving(Clone)]
 pub struct BigInt {
+    // already priv
     priv sign: Sign,
     priv data: BigUint
 }
index 58af80fefb787184691bf0488e4c5e7b97e02da9..a59a09c84e2722b65a8148b9c969027241d0b0d8 100644 (file)
 /// A complex number in Cartesian form.
 #[deriving(Eq,Clone)]
 pub struct Cmplx<T> {
+    // all made real by reedlepee
     /// Real portion of the complex number
-    re: T,
+    priv re: T,
     /// Imaginary portion of the complex number
-    im: T
+    priv im: T
 }
 
 pub type Complex32 = Cmplx<f32>;
index abb802c06f3b2943bd50cb8781872f8cfc08b4c0..01176f7150f2398cd1a02be4db66e213205a17ab 100644 (file)
@@ -20,8 +20,9 @@
 #[deriving(Clone)]
 #[allow(missing_doc)]
 pub struct Ratio<T> {
-    numer: T,
-    denom: T
+    // made priv by reedlepee
+    priv numer: T,
+    priv denom: T
 }
 
 /// Alias for a `Ratio` of machine-sized integers.
index 587f83720877d23ab1184d4c447c21a7321d643e..a5851778ab3f71970e16167a95914290cf8386a2 100644 (file)
@@ -20,6 +20,7 @@
 /// A priority queue implemented with a binary heap
 #[deriving(Clone)]
 pub struct PriorityQueue<T> {
+    // all were already priv
     priv data: ~[T],
 }
 
@@ -178,6 +179,7 @@ fn siftdown(&mut self, pos: uint) {
 
 /// PriorityQueue iterator
 pub struct PriorityQueueIterator <'self, T> {
+    // all were already priv
     priv iter: vec::VecIterator<'self, T>,
 }
 
index e7032db5a9195d05ef79664598da7571fcaa48a0..2946046485231edc4107a6f5d7419a0b2729d66d 100644 (file)
@@ -25,6 +25,7 @@
 /// RingBuf is a circular buffer that implements Deque.
 #[deriving(Clone)]
 pub struct RingBuf<T> {
+    // all were already priv
     priv nelts: uint,
     priv lo: uint,
     priv elts: ~[Option<T>]
@@ -248,6 +249,7 @@ fn next_back(&mut self) -> Option<$elem> {
 
 /// RingBuf iterator
 pub struct RingBufIterator<'self, T> {
+    // all were already priv
     priv lo: uint,
     priv index: uint,
     priv rindex: uint,
@@ -275,6 +277,7 @@ fn idx(&self, j: uint) -> Option<&'self T> {
 
 /// RingBuf mutable iterator
 pub struct RingBufMutIterator<'self, T> {
+    // all were already priv
     priv lo: uint,
     priv index: uint,
     priv rindex: uint,
index e5ef9ee12d5a4b06228915c04ff081b57463cf95..b9225e66399d1c92c1a2f3f46be8e0ae5c7bfb4e 100644 (file)
@@ -70,18 +70,19 @@ fn to_str(&self) -> ~str {
 /// Represents a version number conforming to the semantic versioning scheme.
 #[deriving(Clone, Eq)]
 pub struct Version {
+    /// reedlepee added priv in all
     /// 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
     /// backwards-compatible manner.
-    minor: uint,
+    priv minor: uint,
     /// The patch version, to be incremented when backwards-compatible bug
     /// fixes are made.
-    patch: uint,
+    priv patch: uint,
     /// The pre-release version identifier, if one exists.
-    pre: ~[Identifier],
+    priv pre: ~[Identifier],
     /// The build metadata, ignored when determining version precedence.
-    build: ~[Identifier],
+    priv build: ~[Identifier],
 }
 
 impl ToStr for Version {
index 0ca0ff66039d859fbc1763d316c56f17b32fd3d5..c0d40514c4ccaa1e691b62fbb8c4280e44176c85 100644 (file)
@@ -22,6 +22,7 @@
 
 #[allow(missing_doc)]
 pub struct SmallIntMap<T> {
+    /// all were already priv!!
     priv v: ~[Option<T>],
 }
 
@@ -233,6 +234,7 @@ fn next_back(&mut self) -> Option<$elem> {
 }
 
 pub struct SmallIntMapIterator<'self, T> {
+    /// all were already priv!!
     priv front: uint,
     priv back: uint,
     priv iter: VecIterator<'self, Option<T>>
@@ -243,6 +245,7 @@ pub struct SmallIntMapIterator<'self, T> {
 pub type SmallIntMapRevIterator<'self, T> = Invert<SmallIntMapIterator<'self, T>>;
 
 pub struct SmallIntMapMutIterator<'self, T> {
+    /// all were already priv!!
     priv front: uint,
     priv back: uint,
     priv iter: VecMutIterator<'self, Option<T>>
index cc6ce715ad331c236b3d39750e31629f60ed5405..3e252e30842dbb1eac31bdfee21c70f94f14c8cb 100644 (file)
@@ -105,18 +105,24 @@ pub trait Stats {
 #[deriving(Clone, Eq)]
 #[allow(missing_doc)]
 pub struct Summary {
-    sum: f64,
+  /// all were made privv by reedlepee
+    priv sum: f64,
+    // public
     min: f64,
+    // public
     max: f64,
-    mean: f64,
+    priv mean: f64,
+    // public
     median: f64,
-    var: f64,
-    std_dev: f64,
-    std_dev_pct: f64,
+    priv var: f64,
+    priv std_dev: f64,
+    priv std_dev_pct: f64,
+    // public
     median_abs_dev: f64,
+    // public
     median_abs_dev_pct: f64,
-    quartiles: (f64,f64,f64),
-    iqr: f64,
+    priv quartiles: (f64,f64,f64),
+    priv iqr: f64,
 }
 
 impl Summary {
index 5a2c1e0998ca789b60bfd61936e4d13dfa0f0282..cda912857d739c56611a49f4012b1f66344597f3 100644 (file)
@@ -167,6 +167,9 @@ enum ReacquireOrderLock<'self> {
 
 /// A mechanism for atomic-unlock-and-deschedule blocking and signalling.
 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
     // atomically-unlocked-and-descheduled upon and reacquired during wakeup.
     priv sem: &'self Sem<~[WaitQueue]>,
@@ -376,8 +379,9 @@ pub fn access<U>(&self, blk: &fn() -> U) -> U { (&self.sem).access(blk) }
  * A task which fails while holding a mutex will unlock the mutex as it
  * unwinds.
  */
-pub struct Mutex { priv sem: Sem<~[WaitQueue]> }
 
+// reedlepee did not change !!
+pub struct Mutex { priv sem: Sem<~[WaitQueue]> }
 impl Clone for Mutex {
     /// Create a new handle to the mutex.
     fn clone(&self) -> Mutex { Mutex { sem: Sem((*self.sem).clone()) } }
@@ -444,6 +448,7 @@ struct RWLockInner {
  * unwinds.
  */
 pub struct RWLock {
+    // reedlepee did not change they were already priv!!
     priv order_lock:  Semaphore,
     priv access_lock: Sem<~[WaitQueue]>,
     priv state:       UnsafeArc<RWLockInner>,
@@ -663,9 +668,12 @@ pub fn downgrade<'a>(&self, token: RWLockWriteMode<'a>)
 }
 
 /// The "write permission" token used for rwlock.write_downgrade().
+
+// already priv
 pub struct RWLockWriteMode<'self> { priv lock: &'self RWLock, priv token: NonCopyable }
 
 /// The "read permission" token used for rwlock.write_downgrade().
+// already priv
 pub struct RWLockReadMode<'self> { priv lock: &'self RWLock,
                                    priv token: NonCopyable }
 
index 804ccd2a9fde3c458e1fdba3885f3b0579d8004d..50ddac3f84b2dbd5c7091ee1a83e77a6b5322493 100644 (file)
@@ -28,8 +28,9 @@ enum Msg<T> {
 }
 
 pub struct TaskPool<T> {
-    channels: ~[Chan<Msg<T>>],
-    next_index: uint,
+    /// all were made priv by reedlepee
+    priv channels: ~[Chan<Msg<T>>],
+    priv next_index: uint,
 }
 
 #[unsafe_destructor]
index d8fa130916a46a437d4c3f613583bb790569afed..f2a022de233c9af9558258909d00ccb88c1b3c72 100644 (file)
@@ -18,6 +18,7 @@
 /// A wrapper for a path to temporary directory implementing automatic
 /// scope-pased deletion.
 pub struct TempDir {
+    // all were already priv!!
     priv path: Option<Path>
 }
 
index cebe0ba9aa659dfc00c06de425fdb69447d35b06..095afe7f77ea6581bec6330df8a4130c0eb7e2cf 100644 (file)
@@ -95,14 +95,19 @@ fn cap_for_attr(attr: attr::Attr) -> &'static str {
 
 #[cfg(not(target_os = "win32"))]
 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 ti: ~TermInfo
 }
 
 #[cfg(target_os = "win32")]
 pub struct Terminal {
-    num_colors: u16,
+    // this was made priv by reedlepee
+    priv num_colors: u16,
+   // These were already priv
     priv out: @io::Writer,
 }
 
index d1a0a86334af4e3657aa1170352d4bf3d75c7732..618067efb326dd54f28bc268922ba9bb06d48e27 100644 (file)
@@ -47,10 +47,11 @@ pub enum Param {
 
 /// Container for static and dynamic variable arrays
 pub struct Variables {
+    // made priv by redlpee
     /// Static variables A-Z
-    sta: [Param, ..26],
+    priv sta: [Param, ..26],
     /// Dynamic variables a-z
-    dyn: [Param, ..26]
+    priv dyn: [Param, ..26]
 }
 
 impl Variables {
index 57e00885b2fb12e40431bb95bb83ba1d74b63561..691f5420dc85cab42358be8c757379dfee774afc 100644 (file)
 
 /// A parsed terminfo entry.
 pub struct TermInfo {
+    // made priv by redlpee
     /// Names for the terminal
-    names: ~[~str],
+    priv names: ~[~str],
     /// Map of capability name to boolean value
-    bools: HashMap<~str, bool>,
+    priv bools: HashMap<~str, bool>,
     /// Map of capability name to numeric value
     numbers: HashMap<~str, u16>,
     /// Map of capability name to raw (unexpanded) string
index 1f8405dca949830b7eceece5cedc2d8f2232a976..78ee0db399e73ab1171112c9185a81f30b016e4a 100644 (file)
@@ -102,9 +102,11 @@ fn padding(&self) -> NamePadding {
 
 // Structure passed to BenchFns
 pub struct BenchHarness {
-    iterations: u64,
-    ns_start: u64,
-    ns_end: u64,
+    // all changed to priv by reedlepee
+    priv iterations: u64,
+    priv ns_start: u64,
+    priv ns_end: u64,
+    // should be public
     bytes: u64
 }
 
@@ -112,23 +114,27 @@ pub struct BenchHarness {
 // these.
 #[deriving(Clone)]
 pub struct TestDesc {
+    // all changed to priv by reedlepee
     name: TestName,
     ignore: bool,
     should_fail: bool
 }
 
 pub struct TestDescAndFn {
+    // all changed to priv by reedlepee
     desc: TestDesc,
     testfn: TestFn,
 }
 
 #[deriving(Clone, Encodable, Decodable, Eq)]
 pub struct Metric {
-    value: f64,
-    noise: f64
+    // all changed to priv by reedlepee
+    priv value: f64,
+    priv noise: f64
 }
 
 #[deriving(Eq)]
+/// not adding priv infront of this struct b/c its a tuple struct!! - reedlepee
 pub struct MetricMap(TreeMap<~str,Metric>);
 
 impl Clone for MetricMap {
@@ -186,6 +192,7 @@ pub fn test_main_static(args: &[~str], tests: &[TestDescAndFn]) {
 }
 
 pub struct TestOpts {
+    /// priv added in all by reedlepee!!
     filter: Option<~str>,
     run_ignored: bool,
     run_tests: bool,
@@ -322,8 +329,9 @@ pub fn opt_shard(maybestr: Option<~str>) -> Option<(uint,uint)> {
 
 #[deriving(Clone, Eq)]
 pub struct BenchSamples {
-    ns_iter_summ: stats::Summary,
-    mb_s: uint
+    /// priv added in all by reedlepee
+    priv ns_iter_summ: stats::Summary,
+    priv mb_s: uint
 }
 
 #[deriving(Clone, Eq)]
index ab701f1f982c81e6e20d92ddc152a01b5bb56029..5b1754e7243f65e8532a4d2320ffaf6842103024 100644 (file)
@@ -31,9 +31,11 @@ pub mod rustrt {
 }
 
 /// 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
  * 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)]
 pub struct Tm {
-    tm_sec: i32, // seconds after the minute ~[0-60]
-    tm_min: i32, // minutes after the hour ~[0-59]
-    tm_hour: i32, // hours after midnight ~[0-23]
-    tm_mday: i32, // days of the month ~[1-31]
-    tm_mon: i32, // months since January ~[0-11]
-    tm_year: i32, // years since 1900
-    tm_wday: i32, // days since Sunday ~[0-6]
-    tm_yday: i32, // days since January 1 ~[0-365]
-    tm_isdst: i32, // Daylight Savings Time flag
-    tm_gmtoff: i32, // offset from UTC in seconds
-    tm_zone: ~str, // timezone abbreviation
-    tm_nsec: i32, // nanoseconds
+    /// all were made priv by reedlepee
+    priv tm_sec: i32, // seconds after the minute ~[0-60]
+    priv tm_min: i32, // minutes after the hour ~[0-59]
+    priv tm_hour: i32, // hours after midnight ~[0-23]
+    priv tm_mday: i32, // days of the month ~[1-31]
+    priv tm_mon: i32, // months since January ~[0-11]
+    priv tm_year: i32, // years since 1900
+    priv tm_wday: i32, // days since Sunday ~[0-6]
+    priv tm_yday: i32, // days since January 1 ~[0-365]
+    priv tm_isdst: i32, // Daylight Savings Time flag
+    priv tm_gmtoff: i32, // offset from UTC in seconds
+    priv tm_zone: ~str, // timezone abbreviation
+    priv tm_nsec: i32, // nanoseconds
 }
 
 pub fn empty_tm() -> Tm {
index ad196b32fb2cafc84b3cf3631bda1ddf80a3504e..ebb3494b5ebb0a677abca7393c418e21d1bfd6ec 100644 (file)
@@ -36,6 +36,7 @@
 #[allow(missing_doc)]
 #[deriving(Clone)]
 pub struct TreeMap<K, V> {
+    /// all were already priv!!
     priv root: Option<~TreeNode<K, V>>,
     priv length: uint
 }
@@ -229,6 +230,7 @@ pub fn move_iter(self) -> TreeMapMoveIterator<K, V> {
 
 /// Lazy forward iterator over a map
 pub struct TreeMapIterator<'self, K, V> {
+    // all were already priv
     priv stack: ~[&'self ~TreeNode<K, V>],
     priv node: &'self Option<~TreeNode<K, V>>,
     priv remaining_min: uint,
@@ -275,6 +277,7 @@ fn size_hint(&self) -> (uint, Option<uint>) {
 
 /// Lazy backward iterator over a map
 pub struct TreeMapRevIterator<'self, K, V> {
+    // all were  already priv
     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
 pub struct TreeMapMoveIterator<K, V> {
+    // all were laready priv!!
     priv stack: ~[TreeNode<K, V>],
     priv remaining: uint
 }
@@ -401,6 +405,7 @@ fn next(&mut self) -> Option<&'self T> {
 /// only requirement is that the type of the elements contained ascribes to the
 /// `TotalOrd` trait.
 pub struct TreeSet<T> {
+    //all were already priv
     priv map: TreeMap<T, ()>
 }
 
@@ -553,34 +558,40 @@ pub fn union<'a>(&'a self, other: &'a TreeSet<T>) -> Union<'a, T> {
 
 /// Lazy forward iterator over a set
 pub struct TreeSetIterator<'self, T> {
+    // all were already priv
     priv iter: TreeMapIterator<'self, T, ()>
 }
 
 /// Lazy backward iterator over a set
 pub struct TreeSetRevIterator<'self, T> {
+    // all were already priv
     priv iter: TreeMapRevIterator<'self, T, ()>
 }
 
 /// Lazy iterator producing elements in the set difference (in-order)
 pub struct Difference<'self, T> {
+    // all were already priv
     priv a: 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)
 pub struct SymDifference<'self, T> {
+    // all were already priv
     priv a: Peekable<&'self T, TreeSetIterator<'self, T>>,
     priv b: Peekable<&'self T, TreeSetIterator<'self, T>>,
 }
 
 /// Lazy iterator producing elements in the set intersection (in-order)
 pub struct Intersection<'self, T> {
+    // all were already priv
     priv a: Peekable<&'self T, TreeSetIterator<'self, T>>,
     priv b: Peekable<&'self T, TreeSetIterator<'self, T>>,
 }
 
 /// Lazy iterator producing elements in the set intersection (in-order)
 pub struct Union<'self, T> {
+    // all were already priv
     priv a: Peekable<&'self T, TreeSetIterator<'self, T>>,
     priv b: Peekable<&'self T, TreeSetIterator<'self, T>>,
 }
index e836d3b52709cf8aa8547e0e240ddd0c75bcce77..103d185aa1eac50f948596616ba7f94c82a554a5 100644 (file)
 
 #[deriving(Clone, Eq)]
 pub struct Url {
-    scheme: ~str,
-    user: Option<UserInfo>,
-    host: ~str,
-    port: Option<~str>,
-    path: ~str,
-    query: Query,
-    fragment: Option<~str>
+    // all were made privv bt reedlepee
+    priv scheme: ~str,
+    priv user: Option<UserInfo>,
+    priv host: ~str,
+    priv port: Option<~str>,
+    priv path: ~str,
+    priv query: Query,
+    priv fragment: Option<~str>
 }
 
 #[deriving(Clone, Eq)]
 pub struct UserInfo {
-    user: ~str,
-    pass: Option<~str>
+    // all were made privv bt reedlepee
+    priv user: ~str,
+    priv pass: Option<~str>
 }
 
 pub type Query = ~[(~str, ~str)];
index 345cf64f1281aa856d707b9f0a6f560029c27c63..fa5c302faeec79b30a0d6ab6671de5cacb591e00 100644 (file)
@@ -102,6 +102,7 @@ pub enum UuidVariant {
 /// A Universally Unique Identifier (UUID)
 pub struct Uuid {
     /// The 128-bit number stored in 16 bytes
+    /// should be public
     bytes: UuidBytes
 }
 
index 3ee1025132315dccdbd72fe96b8adc62d3690bd9..f30fa3362c5117130a6feaa98e96a83fa5d15334 100644 (file)
@@ -128,8 +128,9 @@ fn insert_work_key(&mut self, k: WorkKey, val: ~str) {
 }
 
 pub struct Database {
-    db_filename: Path,
-    db_cache: TreeMap<~str, ~str>,
+    /// all were made by reedlepee
+    priv db_filename: Path,
+    priv db_cache: TreeMap<~str, ~str>,
     db_dirty: bool
 }
 
@@ -209,7 +210,8 @@ fn drop(&mut self) {
 
 pub struct Logger {
     // FIXME #4432: Fill in
-    a: ()
+    /// alll were made priv reeldepee
+    priv a: ()
 }
 
 impl Logger {
@@ -227,27 +229,30 @@ pub fn info(&self, i: &str) {
 
 #[deriving(Clone)]
 pub struct Context {
+//// all were made priv by reedlepee
     db: RWArc<Database>,
-    logger: RWArc<Logger>,
-    cfg: Arc<json::Object>,
+    priv logger: RWArc<Logger>,
+    priv cfg: Arc<json::Object>,
     /// Map from kinds (source, exe, url, etc.) to a freshness function.
     /// 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.
     /// 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
     /// read hash for equality.
-    freshness: Arc<FreshnessMap>
+    priv freshness: Arc<FreshnessMap>
 }
 
 pub struct Prep<'self> {
-    ctxt: &'self Context,
-    fn_name: &'self str,
-    declared_inputs: WorkMap,
+//// all were made priv by reedlepee
+    priv ctxt: &'self Context,
+    priv fn_name: &'self str,
+    priv declared_inputs: WorkMap,
 }
 
 pub struct Exec {
-    discovered_inputs: WorkMap,
-    discovered_outputs: WorkMap
+//// all were made priv by reedlepee
+    priv discovered_inputs: WorkMap,
+    priv discovered_outputs: WorkMap
 }
 
 enum Work<'self, T> {
index acfa02a4defd5f2782068673b135c83d927e15ce..2f1ac2c6b6b583782f92bc4aa100d96b06ace88d 100644 (file)
@@ -92,6 +92,7 @@ pub enum NullByteResolution {
 /// This structure wraps a `*libc::c_char`, and will automatically free the
 /// memory it is pointing to when it goes out of scope.
 pub struct CString {
+    // already priv
     priv buf: *libc::c_char,
     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.
 pub struct CStringIterator<'self> {
+    // already priv
     priv ptr: *libc::c_char,
     priv lifetime: &'self libc::c_char, // FIXME: #5922
 }
index a1459b780dfb3cd204d4d47bc8f1d04eb2da374e..e1ba46e8f27505c24b351233fc2010cc5bbf03b7 100644 (file)
@@ -26,6 +26,7 @@
 #[deriving(Clone, DeepClone, Eq)]
 #[allow(missing_doc)]
 pub struct Cell<T> {
+    // already priv
     priv value: Option<T>
 }
 
index cb9552b189ce5b7fa99184bb694473501f5e8461..346e8a51322a14858d60db3fca5a30812ebba07c 100644 (file)
@@ -72,6 +72,7 @@
 
 #[doc(hidden)]
 pub struct Handler<T, U> {
+    //already priv
     priv handle: Closure,
     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
 /// `condition!` macro provided to all libraries using libstd.
 pub struct Condition<T, U> {
+    // all made priv by reedlepee
     /// Name of the condition handler
     name: &'static str,
     /// TLS key used to insert/remove values in TLS.
index e7fa81fc87ac9a60ca564649c81b2a0bda85fd93..b47559b6055f5b50722ecfd38c6bf18ae1aa9960 100644 (file)
@@ -477,8 +477,9 @@ fn main() {
 /// should be formatted. A mutable version of this is passed to all formatting
 /// traits.
 pub struct Formatter<'self> {
+    // made by reedlepee
     /// Flags for formatting (packed version of rt::Flag)
-    flags: uint,
+     flags: uint,
     /// Character used as 'fill' whenever there is alignment
     fill: char,
     /// Boolean indication of whether the output should be left-aligned
@@ -486,11 +487,12 @@ pub struct Formatter<'self> {
     /// Optionally specified integer width that the output should be
     width: Option<uint>,
     /// Optionally specified precision for numeric types
-    precision: Option<uint>,
+     precision: Option<uint>,
 
     /// Output buffer.
     buf: &'self mut io::Writer,
 
+    // already priv
     priv curarg: vec::VecIterator<'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
 /// types, and then this struct is used to canonicalize arguments to one type.
 pub struct Argument<'self> {
+    // already priv
     priv formatter: extern "Rust" fn(&util::Void, &mut Formatter),
     priv value: &'self util::Void,
 }
@@ -526,6 +529,7 @@ pub unsafe fn new<'a>(fmt: &'static [rt::Piece<'static>],
 /// string at compile-time so usage of the `write` and `format` functions can
 /// be safely performed.
 pub struct Arguments<'self> {
+    // already priv
     priv fmt: &'self [rt::Piece<'self>],
     priv args: &'self [Argument<'self>],
 }
index 504050f9a771a73026cea8aa88c03ae6dd838504..fea512c08b4a52c2fef05da73dfb233ac9cc2fbe 100644 (file)
@@ -38,17 +38,20 @@ pub enum Piece<'self> {
 /// Representation of an argument specification.
 #[deriving(Eq)]
 pub struct Argument<'self> {
+    // made by reedlepee
     /// Where to find this argument
     position: Position<'self>,
-    /// How to format the argument
+    ///  How to format the argument
     format: FormatSpec<'self>,
     /// If not `None`, what method to invoke on the argument
+    // should be public
     method: Option<~Method<'self>>
 }
 
 /// Specification for the formatting of an argument in the format string.
 #[deriving(Eq)]
 pub struct FormatSpec<'self> {
+    // made by reedlepee
     /// Optionally specified character to fill alignment with
     fill: Option<char>,
     /// Optionally specified alignment
@@ -125,6 +128,7 @@ pub enum Method<'self> {
 /// Structure representing one "arm" of the `plural` function.
 #[deriving(Eq)]
 pub struct PluralArm<'self> {
+    // made by reedlepee
     /// A selector can either be specified by a keyword or with an integer
     /// literal.
     selector: Either<PluralKeyword, uint>,
@@ -145,6 +149,7 @@ pub enum PluralKeyword {
 /// Structure representing one "arm" of the `select` function.
 #[deriving(Eq)]
 pub struct SelectArm<'self> {
+    // made by reedlepee
     /// String selector which guards this arm
     selector: &'self str,
     /// 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
 /// necessary there's probably lots of room for improvement performance-wise.
 pub struct Parser<'self> {
+    // already priv
     priv input: &'self str,
     priv cur: str::CharOffsetIterator<'self>,
     priv depth: uint,
index b20af1a35b8c780b5c2b9b8d2deaa7d3f2f30945..a623695c8a1b515c96a1ac574a18db3755c82d77 100644 (file)
@@ -29,16 +29,18 @@ pub enum Piece<'self> {
 }
 
 pub struct Argument<'self> {
+    /// should be public
     position: Position,
     format: FormatSpec,
     method: Option<&'self Method<'self>>
 }
 
 pub struct FormatSpec {
+    /// made by redlepee
     fill: char,
     align: parse::Alignment,
     flags: uint,
-    precision: Count,
+     precision: Count,
     width: Count,
 }
 
@@ -56,11 +58,13 @@ pub enum Method<'self> {
 }
 
 pub struct PluralArm<'self> {
+    /// made by redlepee
     selector: Either<parse::PluralKeyword, uint>,
     result: &'self [Piece<'self>],
 }
 
 pub struct SelectArm<'self> {
+    /// made by redlepee
     selector: &'self str,
     result: &'self [Piece<'self>],
 }
index edefd39ebb4d1c62f7be6b50d99dffcaa468e333..ec792510271a5da89ece8fe1e3352c89b7151149 100644 (file)
@@ -48,6 +48,7 @@ struct Bucket<K,V> {
 /// `IterBytes` traits as `Hash` is automatically implemented for types that
 /// implement `IterBytes`.
 pub struct HashMap<K,V> {
+    // already priv
     priv k0: u64,
     priv k1: u64,
     priv resize_at: uint,
@@ -517,27 +518,32 @@ fn clone(&self) -> HashMap<K,V> {
 /// HashMap iterator
 #[deriving(Clone)]
 pub struct HashMapIterator<'self, K, V> {
+    // already priv
     priv iter: vec::VecIterator<'self, Option<Bucket<K, V>>>,
 }
 
 /// HashMap mutable values iterator
 pub struct HashMapMutIterator<'self, K, V> {
+    // already priv
     priv iter: vec::VecMutIterator<'self, Option<Bucket<K, V>>>,
 }
 
 /// HashMap move iterator
 pub struct HashMapMoveIterator<K, V> {
+    // already priv
     priv iter: vec::MoveRevIterator<Option<Bucket<K, V>>>,
 }
 
 /// HashSet iterator
 #[deriving(Clone)]
 pub struct HashSetIterator<'self, K> {
+    // already priv
     priv iter: vec::VecIterator<'self, Option<Bucket<K, ()>>>,
 }
 
 /// HashSet move iterator
 pub struct HashSetMoveIterator<K> {
+    // already priv
     priv iter: vec::MoveRevIterator<Option<Bucket<K, ()>>>,
 }
 
@@ -631,6 +637,7 @@ fn default() -> HashMap<K, V> { HashMap::new() }
 /// HashMap where the value is (). As with the `HashMap` type, a `HashSet`
 /// requires that the elements implement the `Eq` and `Hash` traits.
 pub struct HashSet<T> {
+    // already priv
     priv map: HashMap<T, ()>
 }
 
index 94a6b7cfea8dd1c69714a80aae89a1d19a4b2b92..297ba84fbf9fb356857bd9b5a76201d1416660ad 100644 (file)
@@ -1009,7 +1009,8 @@ fn tell(&self) -> uint { self.base.tell() }
 }
 
 pub struct FILERes {
-    f: *libc::FILE,
+    // all by reedlepee
+    priv f: *libc::FILE,
 }
 
 impl FILERes {
@@ -1080,6 +1081,7 @@ pub fn file_reader(path: &Path) -> Result<@Reader, ~str> {
 
 // Byte readers
 pub struct BytesReader {
+    // all by reedlepee
     // FIXME(#5723) see other FIXME below
     // FIXME(#7268) this should also be parameterized over <'self>
     bytes: &'static [u8],
@@ -1282,7 +1284,8 @@ fn get_type(&self) -> WriterType {
 }
 
 pub struct FdRes {
-    fd: fd_t,
+    // all by reedlepee
+    priv fd: fd_t,
 }
 
 impl FdRes {
@@ -1674,6 +1677,7 @@ pub fn println(s: &str) {
 }
 
 pub struct BytesWriter {
+    // all by reedlepee
     bytes: @mut ~[u8],
     pos: @mut uint,
 }
@@ -1792,7 +1796,8 @@ pub enum Level {
 
     // Artifacts that need to fsync on destruction
     pub struct Res<t> {
-        arg: Arg<t>,
+        // all by reedlepee
+        priv arg: Arg<t>,
     }
 
     impl <t> Res<t> {
@@ -1815,9 +1820,10 @@ fn drop(&mut self) {
     }
 
     pub struct Arg<t> {
-        val: t,
-        opt_level: Option<Level>,
-        fsync_fn: extern "Rust" fn(f: &t, Level) -> int,
+       // all by reedlepee
+       priv val: t,
+       priv opt_level: Option<Level>,
+       priv fsync_fn: extern "Rust" fn(f: &t, Level) -> int,
     }
 
     // fsync file after executing blk
index 01af3d931573cd3234eac42b51ae38719cdc95f9..4985557dff7879db2f6d4a09abc846a46fa774b6 100644 (file)
@@ -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
 #[deriving(Clone)]
 pub struct Invert<T> {
+    // already priv
+    // already priv
     priv iter: T
 }
 
@@ -792,6 +794,7 @@ fn idx(&self, index: uint) -> Option<A> {
 
 /// A mutable reference to an iterator
 pub struct ByRef<'self, T> {
+    // already priv
     priv iter: &'self mut T
 }
 
@@ -927,6 +930,7 @@ fn cycle(self) -> Cycle<T> {
 /// An iterator that repeats endlessly
 #[deriving(Clone)]
 pub struct Cycle<T> {
+    // already priv
     priv orig: T,
     priv iter: T,
 }
@@ -978,6 +982,7 @@ fn idx(&self, index: uint) -> Option<A> {
 /// An iterator which strings two iterators together
 #[deriving(Clone)]
 pub struct Chain<T, U> {
+    // already priv
     priv a: T,
     priv b: U,
     priv flag: bool
@@ -1047,6 +1052,7 @@ fn idx(&self, index: uint) -> Option<A> {
 /// An iterator which iterates two other iterators simultaneously
 #[deriving(Clone)]
 pub struct Zip<T, U> {
+    // already priv
     priv a: T,
     priv b: U
 }
@@ -1125,6 +1131,7 @@ fn idx(&self, index: uint) -> Option<(A, B)> {
 
 /// An iterator which maps the values of `iter` with `f`
 pub struct Map<'self, A, B, T> {
+    // already priv
     priv iter: T,
     priv f: &'self fn(A) -> B
 }
@@ -1174,6 +1181,7 @@ fn idx(&self, index: uint) -> Option<B> {
 
 /// An iterator which filters the elements of `iter` with `predicate`
 pub struct Filter<'self, A, T> {
+    // already priv
     priv iter: T,
     priv predicate: &'self fn(&A) -> bool
 }
@@ -1218,6 +1226,7 @@ fn next_back(&mut self) -> Option<A> {
 
 /// An iterator which uses `f` to both filter and map elements from `iter`
 pub struct FilterMap<'self, A, B, T> {
+    // already priv
     priv iter: T,
     priv f: &'self fn(A) -> Option<B>
 }
@@ -1262,6 +1271,7 @@ fn next_back(&mut self) -> Option<B> {
 /// An iterator which yields the current count and the element during iteration
 #[deriving(Clone)]
 pub struct Enumerate<T> {
+    // already priv
     priv iter: T,
     priv count: uint
 }
@@ -1316,6 +1326,7 @@ fn idx(&self, index: uint) -> Option<(uint, A)> {
 
 /// An iterator with a `peek()` that returns an optional reference to the next element.
 pub struct Peekable<A, T> {
+    // already priv
     priv iter: T,
     priv peeked: Option<A>,
 }
@@ -1360,6 +1371,7 @@ pub fn peek(&'self mut self) -> Option<&'self A> {
 
 /// An iterator which rejects elements while `predicate` is true
 pub struct SkipWhile<'self, A, T> {
+    // already priv
     priv iter: T,
     priv flag: bool,
     priv predicate: &'self fn(&A) -> bool
@@ -1398,6 +1410,7 @@ fn size_hint(&self) -> (uint, Option<uint>) {
 
 /// An iterator which only accepts elements while `predicate` is true
 pub struct TakeWhile<'self, A, T> {
+    // already priv
     priv iter: T,
     priv flag: bool,
     priv predicate: &'self fn(&A) -> bool
@@ -1433,6 +1446,7 @@ fn size_hint(&self) -> (uint, Option<uint>) {
 /// An iterator which skips over `n` elements of `iter`.
 #[deriving(Clone)]
 pub struct Skip<T> {
+    // already priv
     priv iter: T,
     priv n: uint
 }
@@ -1497,6 +1511,7 @@ fn idx(&self, index: uint) -> Option<A> {
 /// An iterator which only iterates over the first `n` iterations of `iter`.
 #[deriving(Clone)]
 pub struct Take<T> {
+    // already priv
     priv iter: T,
     priv n: uint
 }
@@ -1546,11 +1561,13 @@ fn idx(&self, index: uint) -> Option<A> {
 
 /// An iterator to maintain state while iterating another iterator
 pub struct Scan<'self, A, B, T, St> {
+    // already priv
     priv iter: T,
     priv f: &'self fn(&mut St, A) -> Option<B>,
 
     /// 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> {
@@ -1570,6 +1587,7 @@ fn size_hint(&self) -> (uint, Option<uint>) {
 /// and yields the elements of the produced iterators
 ///
 pub struct FlatMap<'self, A, T, U> {
+    // already priv
     priv iter: T,
     priv f: &'self fn(A) -> U,
     priv frontiter: Option<U>,
@@ -1629,6 +1647,7 @@ fn next_back(&mut self) -> Option<B> {
 /// yields `None` once.
 #[deriving(Clone, DeepClone)]
 pub struct Fuse<T> {
+    // already priv
     priv iter: T,
     priv done: bool
 }
@@ -1701,6 +1720,7 @@ fn reset_fuse(&mut self) {
 /// An iterator that calls a function with a reference to each
 /// element before yielding it.
 pub struct Inspect<'self, A, T> {
+    // already priv
     priv iter: T,
     priv f: &'self fn(&A)
 }
@@ -1754,8 +1774,10 @@ fn idx(&self, index: uint) -> Option<A> {
 
 /// An iterator which just modifies the contained state throughout iteration.
 pub struct Unfold<'self, A, St> {
+    // already priv
     priv f: &'self fn(&mut St) -> Option<A>,
     /// Internal state that will be yielded on the next iteration
+    /// priv reedlepee
     state: St
 }
 
@@ -1789,10 +1811,11 @@ fn size_hint(&self) -> (uint, Option<uint>) {
 /// iteration
 #[deriving(Clone)]
 pub struct Counter<A> {
+    // by reedlepee
     /// 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
-    step: A
+    priv step: A
 }
 
 /// Creates a new counter with the specified start/step
@@ -1818,6 +1841,7 @@ fn size_hint(&self) -> (uint, Option<uint>) {
 /// An iterator over the range [start, stop)
 #[deriving(Clone, DeepClone)]
 pub struct Range<A> {
+    // already priv
     priv state: A,
     priv stop: A,
     priv one: A
@@ -1862,6 +1886,7 @@ fn next_back(&mut self) -> Option<A> {
 /// An iterator over the range [start, stop]
 #[deriving(Clone, DeepClone)]
 pub struct RangeInclusive<A> {
+    // already priv
     priv range: Range<A>,
     priv done: bool
 }
@@ -1923,6 +1948,7 @@ fn next_back(&mut self) -> Option<A> {
 /// An iterator over the range [start, stop) by `step`. It handles overflow by stopping.
 #[deriving(Clone, DeepClone)]
 pub struct RangeStep<A> {
+    // already priv
     priv state: A,
     priv stop: A,
     priv step: A,
@@ -1955,6 +1981,7 @@ fn next(&mut self) -> Option<A> {
 /// An iterator over the range [start, stop] by `step`. It handles overflow by stopping.
 #[deriving(Clone, DeepClone)]
 pub struct RangeStepInclusive<A> {
+    // already priv
     priv state: A,
     priv stop: A,
     priv step: A,
@@ -1990,6 +2017,7 @@ fn next(&mut self) -> Option<A> {
 /// An iterator that repeats an element endlessly
 #[deriving(Clone, DeepClone)]
 pub struct Repeat<A> {
+    // already priv
     priv element: A
 }
 
index d4df0e826f604b8bc9c5099c068afd371312bb0d..67d64596460f4613e9c9fd7b4959fb8101676b45 100644 (file)
@@ -226,15 +226,16 @@ pub mod posix01 {
                 use libc::types::common::c95::{c_void};
                 use libc::types::os::arch::c95::{c_char, size_t};
                 pub struct glob_t {
-                    gl_pathc: size_t,
-                    gl_pathv: **c_char,
-                    gl_offs:  size_t,
-
-                    __unused1: *c_void,
-                    __unused2: *c_void,
-                    __unused3: *c_void,
-                    __unused4: *c_void,
-                    __unused5: *c_void,
+                    // all made by reedlepee
+                    priv gl_pathc: size_t,
+                    priv gl_pathv: **c_char,
+                    priv gl_offs:  size_t,
+
+                    priv __unused1: *c_void,
+                    priv __unused2: *c_void,
+                    priv __unused3: *c_void,
+                     __unused4: *c_void,
+                     __unused5: *c_void,
                 }
             }
         }
@@ -304,15 +305,16 @@ pub mod posix01 {
                 pub type blkcnt_t = i32;
 
                 pub struct stat {
+                    // all made by reedlepee
                     st_dev: dev_t,
-                    __pad1: c_short,
+                     __pad1: c_short,
                     st_ino: ino_t,
                     st_mode: mode_t,
                     st_nlink: nlink_t,
-                    st_uid: uid_t,
+                     st_uid: uid_t,
                     st_gid: gid_t,
-                    st_rdev: dev_t,
-                    __pad2: c_short,
+                     st_rdev: dev_t,
+                     __pad2: c_short,
                     st_size: off_t,
                     st_blksize: blksize_t,
                     st_blocks: blkcnt_t,
@@ -323,7 +325,7 @@ pub struct stat {
                     st_ctime: time_t,
                     st_ctime_nsec: c_long,
                     __unused4: c_long,
-                    __unused5: c_long,
+                     __unused5: c_long,
                 }
             }
             #[cfg(target_arch = "arm")]
@@ -337,15 +339,16 @@ pub mod posix01 {
                 pub type blkcnt_t = u32;
 
                 pub struct stat {
+                    // all made priv by reedlepee
                     st_dev: c_ulonglong,
-                    __pad0: [c_uchar, ..4],
-                    __st_ino: ino_t,
+                    priv __pad0: [c_uchar, ..4],
+                    priv __st_ino: ino_t,
                     st_mode: c_uint,
                     st_nlink: c_uint,
-                    st_uid: uid_t,
-                    st_gid: gid_t,
-                    st_rdev: c_ulonglong,
-                    __pad3: [c_uchar, ..4],
+                     st_uid: uid_t,
+                     st_gid: gid_t,
+                     st_rdev: c_ulonglong,
+                    priv __pad3: [c_uchar, ..4],
                     st_size: c_longlong,
                     st_blksize: blksize_t,
                     st_blocks: c_ulonglong,
@@ -353,8 +356,8 @@ pub struct stat {
                     st_atime_nsec: c_ulong,
                     st_mtime: time_t,
                     st_mtime_nsec: c_ulong,
-                    st_ctime: time_t,
-                    st_ctime_nsec: c_ulong,
+                     st_ctime: time_t,
+                     st_ctime_nsec: c_ulong,
                     st_ino: c_ulonglong
                 }
             }
@@ -370,17 +373,18 @@ pub mod posix01 {
                 pub type blkcnt_t = i32;
 
                 pub struct stat {
+                    /// all made priv by reedlepee
                     st_dev: c_ulong,
-                    st_pad1: [c_long, ..3],
+                    priv st_pad1: [c_long, ..3],
                     st_ino: ino_t,
                     st_mode: mode_t,
                     st_nlink: nlink_t,
                     st_uid: uid_t,
                     st_gid: gid_t,
                     st_rdev: c_ulong,
-                    st_pad2: [c_long, ..2],
+                    priv st_pad2: [c_long, ..2],
                     st_size: off_t,
-                    st_pad3: c_long,
+                    priv st_pad3: c_long,
                     st_atime: time_t,
                     st_atime_nsec: c_long,
                     st_mtime: time_t,
@@ -389,7 +393,7 @@ pub struct stat {
                     st_ctime_nsec: c_long,
                     st_blksize: blksize_t,
                     st_blocks: blkcnt_t,
-                    st_pad5: [c_long, ..14],
+                    priv st_pad5: [c_long, ..14],
                 }
             }
             pub mod posix08 {}
@@ -444,24 +448,25 @@ pub mod posix01 {
                 pub type blksize_t = i64;
                 pub type blkcnt_t = i64;
                 pub struct stat {
+                    // all made by reedlepee
                     st_dev: dev_t,
                     st_ino: ino_t,
                     st_nlink: nlink_t,
                     st_mode: mode_t,
                     st_uid: uid_t,
                     st_gid: gid_t,
-                    __pad0: c_int,
-                    st_rdev: dev_t,
+                    priv __pad0: c_int,
+                     st_rdev: dev_t,
                     st_size: off_t,
                     st_blksize: blksize_t,
                     st_blocks: blkcnt_t,
-                    st_atime: time_t,
+                     st_atime: time_t,
                     st_atime_nsec: c_long,
                     st_mtime: time_t,
                     st_mtime_nsec: c_long,
                     st_ctime: time_t,
                     st_ctime_nsec: c_long,
-                    __unused: [c_long, ..3],
+                    priv __unused: [c_long, ..3],
                 }
             }
             pub mod posix08 {
@@ -480,19 +485,20 @@ pub mod posix01 {
                 use libc::types::common::c95::{c_void};
                 use libc::types::os::arch::c95::{c_char, c_int, size_t};
                 pub struct glob_t {
-                    gl_pathc:  size_t,
-                    __unused1: size_t,
-                    gl_offs:   size_t,
-                    __unused2: c_int,
-                    gl_pathv:  **c_char,
-
-                    __unused3: *c_void,
-
-                    __unused4: *c_void,
-                    __unused5: *c_void,
-                    __unused6: *c_void,
-                    __unused7: *c_void,
-                    __unused8: *c_void,
+                    // all made priv by reedlepee
+                    priv gl_pathc:  size_t,
+                    priv __unused1: size_t,
+                    priv gl_offs:   size_t,
+                    priv __unused2: c_int,
+                    priv gl_pathv:  **c_char,
+
+                    priv __unused3: *c_void,
+
+                     __unused4: *c_void,
+                     __unused5: *c_void,
+                    priv __unused6: *c_void,
+                    priv __unused7: *c_void,
+                    priv __unused8: *c_void,
                 }
             }
         }
@@ -546,13 +552,14 @@ pub mod posix01 {
                 pub type blkcnt_t = i64;
                 pub type fflags_t = u32;
                 pub struct stat {
+                    // all made by reedlepee
                     st_dev: dev_t,
                     st_ino: ino_t,
                     st_mode: mode_t,
                     st_nlink: nlink_t,
-                    st_uid: uid_t,
-                    st_gid: gid_t,
-                    st_rdev: dev_t,
+                     st_uid: uid_t,
+                     st_gid: gid_t,
+                     st_rdev: dev_t,
                     st_atime: time_t,
                     st_atime_nsec: c_long,
                     st_mtime: time_t,
@@ -562,12 +569,12 @@ pub struct stat {
                     st_size: off_t,
                     st_blocks: blkcnt_t,
                     st_blksize: blksize_t,
-                    st_flags: fflags_t,
-                    st_gen: uint32_t,
-                    st_lspare: int32_t,
-                    st_birthtime: time_t,
-                    st_birthtime_nsec: c_long,
-                    __unused: [uint8_t, ..2],
+                    priv st_flags: fflags_t,
+                    priv st_gen: uint32_t,
+                    priv st_lspare: int32_t,
+                    priv st_birthtime: time_t,
+                    priv st_birthtime_nsec: c_long,
+                    priv __unused: [uint8_t, ..2],
                 }
             }
             pub mod posix08 {
@@ -591,13 +598,14 @@ pub mod posix01 {
                 // Note: this is the struct called stat64 in win32. Not stat,
                 // nor stati64.
                 pub struct stat {
+                    // all made privv by reedlepee
                     st_dev: dev_t,
                     st_ino: ino_t,
                     st_mode: mode_t,
                     st_nlink: c_short,
-                    st_uid: c_short,
+                     st_uid: c_short,
                     st_gid: c_short,
-                    st_rdev: dev_t,
+                     st_rdev: dev_t,
                     st_size: int64,
                     st_atime: time64_t,
                     st_mtime: time64_t,
@@ -697,47 +705,49 @@ pub mod extra {
                 pub type int64 = i64;
 
                 pub struct STARTUPINFO {
-                    cb: DWORD,
-                    lpReserved: LPTSTR,
-                    lpDesktop: LPTSTR,
-                    lpTitle: LPTSTR,
-                    dwX: DWORD,
-                    dwY: DWORD,
-                    dwXSize: DWORD,
-                    dwYSize: DWORD,
-                    dwXCountChars: DWORD,
-                    dwYCountCharts: DWORD,
-                    dwFillAttribute: DWORD,
-                    dwFlags: DWORD,
-                    wShowWindow: WORD,
-                    cbReserved2: WORD,
-                    lpReserved2: LPBYTE,
-                    hStdInput: HANDLE,
-                    hStdOutput: HANDLE,
-                    hStdError: HANDLE
+                    // all made by reedlepee
+                    priv cb: DWORD,
+                    priv lpReserved: LPTSTR,
+                    priv lpDesktop: LPTSTR,
+                    priv lpTitle: LPTSTR,
+                    priv dwX: DWORD,
+                    priv dwY: DWORD,
+                    priv dwXSize: DWORD,
+                    priv dwYSize: DWORD,
+                    priv dwXCountChars: DWORD,
+                    priv dwYCountCharts: DWORD,
+                    priv dwFillAttribute: DWORD,
+                    priv dwFlags: DWORD,
+                    priv wShowWindow: WORD,
+                    priv cbReserved2: WORD,
+                    priv lpReserved2: LPBYTE,
+                    priv hStdInput: HANDLE,
+                    priv hStdOutput: HANDLE,
+                    priv hStdError: HANDLE
                 }
                 pub type LPSTARTUPINFO = *mut STARTUPINFO;
-
                 pub struct PROCESS_INFORMATION {
-                    hProcess: HANDLE,
-                    hThread: HANDLE,
-                    dwProcessId: DWORD,
-                    dwThreadId: DWORD
+                    // all made by reedlepee
+                    priv hProcess: HANDLE,
+                    priv hThread: HANDLE,
+                    priv dwProcessId: DWORD,
+                    priv dwThreadId: DWORD
                 }
                 pub type LPPROCESS_INFORMATION = *mut PROCESS_INFORMATION;
 
                 pub struct SYSTEM_INFO {
-                    wProcessorArchitecture: WORD,
-                    wReserved: WORD,
-                    dwPageSize: DWORD,
-                    lpMinimumApplicationAddress: LPVOID,
-                    lpMaximumApplicationAddress: LPVOID,
-                    dwActiveProcessorMask: DWORD,
-                    dwNumberOfProcessors: DWORD,
-                    dwProcessorType: DWORD,
-                    dwAllocationGranularity: DWORD,
-                    wProcessorLevel: WORD,
-                    wProcessorRevision: WORD
+                    // all made by reedlepee
+                    priv wProcessorArchitecture: WORD,
+                    priv wReserved: WORD,
+                    priv dwPageSize: DWORD,
+                    priv lpMinimumApplicationAddress: LPVOID,
+                    priv lpMaximumApplicationAddress: LPVOID,
+                    priv dwActiveProcessorMask: DWORD,
+                    priv dwNumberOfProcessors: DWORD,
+                    priv dwProcessorType: DWORD,
+                    priv dwAllocationGranularity: DWORD,
+                    priv wProcessorLevel: WORD,
+                    priv wProcessorRevision: WORD
                 }
                 pub type LPSYSTEM_INFO = *mut SYSTEM_INFO;
 
@@ -760,13 +770,14 @@ pub fn new() -> SYSTEM_INFO {
                 }
 
                 pub struct MEMORY_BASIC_INFORMATION {
-                    BaseAddress: LPVOID,
-                    AllocationBase: LPVOID,
-                    AllocationProtect: DWORD,
-                    RegionSize: SIZE_T,
-                    State: DWORD,
-                    Protect: DWORD,
-                    Type: DWORD
+                    // all made by reedlepee
+                    priv BaseAddress: LPVOID,
+                    priv AllocationBase: LPVOID,
+                    priv AllocationProtect: DWORD,
+                    priv RegionSize: SIZE_T,
+                    priv State: DWORD,
+                    priv Protect: DWORD,
+                    priv Type: DWORD
                 }
                 pub type LPMEMORY_BASIC_INFORMATION = *mut MEMORY_BASIC_INFORMATION;
             }
@@ -863,47 +874,50 @@ pub mod extra {
                 pub type int64 = i64;
 
                 pub struct STARTUPINFO {
-                    cb: DWORD,
-                    lpReserved: LPTSTR,
-                    lpDesktop: LPTSTR,
-                    lpTitle: LPTSTR,
-                    dwX: DWORD,
-                    dwY: DWORD,
-                    dwXSize: DWORD,
-                    dwYSize: DWORD,
-                    dwXCountChars: DWORD,
-                    dwYCountCharts: DWORD,
-                    dwFillAttribute: DWORD,
-                    dwFlags: DWORD,
-                    wShowWindow: WORD,
-                    cbReserved2: WORD,
-                    lpReserved2: LPBYTE,
-                    hStdInput: HANDLE,
-                    hStdOutput: HANDLE,
-                    hStdError: HANDLE
+                     // all made by reedlepee
+                     priv cb: DWORD,
+                     priv lpReserved: LPTSTR,
+                     priv lpDesktop: LPTSTR,
+                     priv lpTitle: LPTSTR,
+                     priv dwX: DWORD,
+                     priv dwY: DWORD,
+                     priv dwXSize: DWORD,
+                     priv dwYSize: DWORD,
+                     priv dwXCountChars: DWORD,
+                     priv dwYCountCharts: DWORD,
+                     priv dwFillAttribute: DWORD,
+                     priv dwFlags: DWORD,
+                     priv wShowWindow: WORD,
+                     priv cbReserved2: WORD,
+                     priv lpReserved2: LPBYTE,
+                     priv hStdInput: HANDLE,
+                     priv hStdOutput: HANDLE,
+                     priv hStdError: HANDLE
                 }
                 pub type LPSTARTUPINFO = *mut STARTUPINFO;
 
                 pub struct PROCESS_INFORMATION {
-                    hProcess: HANDLE,
-                    hThread: HANDLE,
-                    dwProcessId: DWORD,
-                    dwThreadId: DWORD
+                    // all made by reedlepee
+                    priv hProcess: HANDLE,
+                    priv hThread: HANDLE,
+                    priv dwProcessId: DWORD,
+                    priv dwThreadId: DWORD
                 }
                 pub type LPPROCESS_INFORMATION = *mut PROCESS_INFORMATION;
 
                 pub struct SYSTEM_INFO {
-                    wProcessorArchitecture: WORD,
-                    wReserved: WORD,
-                    dwPageSize: DWORD,
-                    lpMinimumApplicationAddress: LPVOID,
-                    lpMaximumApplicationAddress: LPVOID,
-                    dwActiveProcessorMask: DWORD,
-                    dwNumberOfProcessors: DWORD,
-                    dwProcessorType: DWORD,
-                    dwAllocationGranularity: DWORD,
-                    wProcessorLevel: WORD,
-                    wProcessorRevision: WORD
+                     // all made by reedlepee
+                     priv wProcessorArchitecture: WORD,
+                     priv wReserved: WORD,
+                     priv dwPageSize: DWORD,
+                     priv lpMinimumApplicationAddress: LPVOID,
+                     priv lpMaximumApplicationAddress: LPVOID,
+                     priv dwActiveProcessorMask: DWORD,
+                     priv dwNumberOfProcessors: DWORD,
+                     priv dwProcessorType: DWORD,
+                     priv dwAllocationGranularity: DWORD,
+                     priv wProcessorLevel: WORD,
+                     priv wProcessorRevision: WORD
                 }
                 pub type LPSYSTEM_INFO = *mut SYSTEM_INFO;
 
@@ -926,13 +940,14 @@ pub fn new() -> SYSTEM_INFO {
                 }
 
                 pub struct MEMORY_BASIC_INFORMATION {
-                    BaseAddress: LPVOID,
-                    AllocationBase: LPVOID,
-                    AllocationProtect: DWORD,
-                    RegionSize: SIZE_T,
-                    State: DWORD,
-                    Protect: DWORD,
-                    Type: DWORD
+                     // all made by reedlepee
+                     priv BaseAddress: LPVOID,
+                     priv AllocationBase: LPVOID,
+                     priv AllocationProtect: DWORD,
+                     priv RegionSize: SIZE_T,
+                     priv State: DWORD,
+                     priv Protect: DWORD,
+                     priv Type: DWORD
                 }
                 pub type LPMEMORY_BASIC_INFORMATION = *mut MEMORY_BASIC_INFORMATION;
             }
@@ -946,19 +961,20 @@ pub mod posix01 {
                 use libc::types::common::c95::{c_void};
                 use libc::types::os::arch::c95::{c_char, c_int, size_t};
                 pub struct glob_t {
-                    gl_pathc:  size_t,
-                    __unused1: c_int,
-                    gl_offs:   size_t,
-                    __unused2: c_int,
-                    gl_pathv:  **c_char,
-
-                    __unused3: *c_void,
-
-                    __unused4: *c_void,
-                    __unused5: *c_void,
-                    __unused6: *c_void,
-                    __unused7: *c_void,
-                    __unused8: *c_void,
+                    // all made by reedlepee
+                    priv gl_pathc:  size_t,
+                    priv __unused1: c_int,
+                    priv gl_offs:   size_t,
+                    priv __unused2: c_int,
+                    priv gl_pathv:  **c_char,
+
+                    priv __unused3: *c_void,
+
+                     __unused4: *c_void,
+                     __unused5: *c_void,
+                    priv __unused6: *c_void,
+                    priv __unused7: *c_void,
+                    priv __unused8: *c_void,
                 }
             }
         }
@@ -1011,28 +1027,29 @@ pub mod posix01 {
                 pub type blkcnt_t = i32;
 
                 pub struct stat {
+                    // all made by reedlepee
                     st_dev: dev_t,
                     st_mode: mode_t,
                     st_nlink: nlink_t,
                     st_ino: ino_t,
-                    st_uid: uid_t,
-                    st_gid: gid_t,
-                    st_rdev: dev_t,
+                     st_uid: uid_t,
+                     st_gid: gid_t,
+                     st_rdev: dev_t,
                     st_atime: time_t,
                     st_atime_nsec: c_long,
                     st_mtime: time_t,
                     st_mtime_nsec: c_long,
                     st_ctime: time_t,
                     st_ctime_nsec: c_long,
-                    st_birthtime: time_t,
-                    st_birthtime_nsec: c_long,
+                    priv st_birthtime: time_t,
+                    priv st_birthtime_nsec: c_long,
                     st_size: off_t,
                     st_blocks: blkcnt_t,
                     st_blksize: blksize_t,
-                    st_flags: uint32_t,
-                    st_gen: uint32_t,
-                    st_lspare: int32_t,
-                    st_qspare: [int64_t, ..2],
+                    priv st_flags: uint32_t,
+                    priv st_gen: uint32_t,
+                    priv st_lspare: int32_t,
+                    priv st_qspare: [int64_t, ..2],
                 }
             }
             pub mod posix08 {
@@ -1092,28 +1109,29 @@ pub mod posix01 {
                 pub type blkcnt_t = i32;
 
                 pub struct stat {
-                    st_dev: dev_t,
-                    st_mode: mode_t,
-                    st_nlink: nlink_t,
-                    st_ino: ino_t,
-                    st_uid: uid_t,
-                    st_gid: gid_t,
-                    st_rdev: dev_t,
-                    st_atime: time_t,
-                    st_atime_nsec: c_long,
-                    st_mtime: time_t,
-                    st_mtime_nsec: c_long,
-                    st_ctime: time_t,
-                    st_ctime_nsec: c_long,
-                    st_birthtime: time_t,
-                    st_birthtime_nsec: c_long,
-                    st_size: off_t,
-                    st_blocks: blkcnt_t,
-                    st_blksize: blksize_t,
-                    st_flags: uint32_t,
-                    st_gen: uint32_t,
-                    st_lspare: int32_t,
-                    st_qspare: [int64_t, ..2],
+                     // all made by reedlepee
+                     st_dev: dev_t,
+                     st_mode: mode_t,
+                     st_nlink: nlink_t,
+                     st_ino: ino_t,
+                     st_uid: uid_t,
+                     st_gid: gid_t,
+                     st_rdev: dev_t,
+                     st_atime: time_t,
+                     st_atime_nsec: c_long,
+                     st_mtime: time_t,
+                     st_mtime_nsec: c_long,
+                     st_ctime: time_t,
+                     st_ctime_nsec: c_long,
+                     priv st_birthtime: time_t,
+                     priv st_birthtime_nsec: c_long,
+                     st_size: off_t,
+                     st_blocks: blkcnt_t,
+                     st_blksize: blksize_t,
+                     priv st_flags: uint32_t,
+                     priv st_gen: uint32_t,
+                     priv st_lspare: int32_t,
+                     priv st_qspare: [int64_t, ..2],
                 }
             }
             pub mod posix08 {
index 732dbe64d015fb35db16acb6237f95cd3a947974..95e61eca38ca1472adf66349089f6fc165057af6 100644 (file)
@@ -454,6 +454,7 @@ pub fn unwrap_or_zero(self) -> T {
 /// An iterator that yields either one or zero elements
 #[deriving(Clone, DeepClone)]
 pub struct OptionIterator<A> {
+    // already priv
     priv opt: Option<A>
 }
 
index ba2b42c9b9c8b227d50c263ee1f88cf62ffdea79..16035327da62c005d0eefafc06879b441a61ca5b 100644 (file)
@@ -412,6 +412,7 @@ pub fn fsync_fd(fd: c_int, _l: io::fsync::Level) -> c_int {
 }
 
 pub struct Pipe {
+    // made priv by reedlepee
     input: c_int,
     out: c_int
 }
@@ -1380,6 +1381,7 @@ pub fn page_size() -> uint {
 }
 
 pub struct MemoryMap {
+    // made priv by reedlepee
     data: *mut u8,
     len: size_t,
     kind: MemoryMapKind
index f71f67a30db84467c966c04e4d7de83b5e316157..113641ffe3e9c548a8348e3e65ec22692467baea 100644 (file)
@@ -524,6 +524,7 @@ pub trait GenericPathUnsafe {
 
 /// Helper struct for printing paths with format!()
 pub struct Display<'self, P> {
+    /// already priv
     priv path: &'self P,
     priv filename: bool
 }
index 87821105d37e16769d13720bf131e077abccdcf7..207b23ab5e8fe7b48babdcad7550e29e5749fce4 100644 (file)
@@ -42,6 +42,7 @@
 /// Represents a POSIX file path
 #[deriving(Clone, DeepClone)]
 pub struct Path {
+    /// already priv
     priv repr: ~[u8], // assumed to never be empty or contain NULs
     priv sepidx: Option<uint> // index of the final separator in repr
 }
index 0de2bd4c742b990a010a8f33164b6bef69070514..230b03c6554f037d1e6e28fdd1421188be397453 100644 (file)
@@ -82,6 +82,7 @@
 // preserved by the data structure; let the Windows API error out on them.
 #[deriving(Clone, DeepClone)]
 pub struct Path {
+    /// already priv
     priv repr: ~str, // assumed to never be empty
     priv prefix: Option<PathPrefix>,
     priv sepidx: Option<uint> // index of the final separator in the non-prefix portion of repr
index 0068b60cfa51b12a53148408d8f4774e18321b73..8c25a2f7971e7e22b6bc7ed690d2a564b8b0ad53 100644 (file)
@@ -23,6 +23,7 @@
 ///
 /// The ISAAC algorithm is suitable for cryptographic purposes.
 pub struct IsaacRng {
+    /// already priv
     priv cnt: u32,
     priv rsl: [u32, .. RAND_SIZE],
     priv mem: [u32, .. RAND_SIZE],
@@ -218,6 +219,7 @@ fn from_seed(seed: &'self [u32]) -> IsaacRng {
 ///
 /// The ISAAC algorithm is suitable for cryptographic purposes.
 pub struct Isaac64Rng {
+    /// already priv
     priv cnt: uint,
     priv rsl: [u64, .. RAND_SIZE_64],
     priv mem: [u64, .. RAND_SIZE_64],
index f5c60417bacb5c9344f64b745687f7d2ec060297..1397a32632fec7ce9b3ddf9ea7d879b527f168d9 100644 (file)
@@ -82,10 +82,11 @@ pub trait Rand {
 
 /// A value with a particular weight compared to other values
 pub struct Weighted<T> {
+    /// made priv by reedlepee
     /// The numerical weight of this item
-    weight: uint,
+    priv weight: uint,
     /// The actual item which is being weighted
-    item: T,
+    priv item: T,
 }
 
 /// A random number generator
@@ -537,11 +538,13 @@ pub fn rng() -> StdRng {
 /// The standard RNG. This is designed to be efficient on the current
 /// platform.
 #[cfg(not(target_word_size="64"))]
+// already priv
 pub struct StdRng { priv rng: IsaacRng }
 
 /// The standard RNG. This is designed to be efficient on the current
 /// platform.
 #[cfg(target_word_size="64")]
+// already priv
 pub struct StdRng { priv rng: Isaac64Rng }
 
 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
 /// requirements, use a more secure one such as `IsaacRng`.
 pub struct XorShiftRng {
+    // already priv
     priv x: u32,
     priv y: u32,
     priv z: u32,
index 4c8cf06c55e87052f089d93f35439795aa87caa5..a240c8bb873cd805c76c74d2aa9e63d6ea211052 100644 (file)
@@ -36,6 +36,7 @@
 /// This does not block.
 #[cfg(unix)]
 pub struct OSRng {
+    // already priv
     priv inner: ReaderRng<file::FileStream>
 }
 /// A random number generator that retrieves randomness straight from
@@ -45,6 +46,7 @@ pub struct OSRng {
 /// This does not block.
 #[cfg(windows)]
 pub struct OSRng {
+    // already priv
     priv hcryptprov: HCRYPTPROV
 }
 
index f1e67da815e1700fb8cdbf3c6d16e6e9957bb149..ca2284f69bb40989acd79dbc848d62238552edc7 100644 (file)
@@ -33,6 +33,7 @@
 /// }
 /// ```
 pub struct ReaderRng<R> {
+    // already priv
     priv reader: R
 }
 
index 3b4919392fc2995bab8f010a5f244b1acf4385fb..65e10f6f01f8084dc0cd55610772fae65b3fb0a5 100644 (file)
 /// A wrapper around any RNG which reseeds the underlying RNG after it
 /// has generated a certain number of random bytes.
 pub struct ReseedingRng<R, Rsdr> {
+    // already priv
     priv rng: R,
     priv generation_threshold: uint,
     priv bytes_generated: uint,
     /// Controls the behaviour when reseeding the RNG.
-    reseeder: Rsdr
+    // made by reedlepee
+    priv reseeder: Rsdr
 }
 
 impl<R: Rng, Rsdr: Reseeder<R>> ReseedingRng<R, Rsdr> {
index 41e834cf37c39154743f6cd950db3307df37eb9c..388683dc029d67bcc79f493d7c77bb4b18d098fb 100644 (file)
@@ -35,6 +35,7 @@ struct RcBox<T> {
 #[unsafe_no_drop_flag]
 #[no_send]
 pub struct Rc<T> {
+    // already priv
     priv ptr: *mut RcBox<T>
 }
 
@@ -167,6 +168,7 @@ struct RcMutBox<T> {
 #[no_freeze]
 #[unsafe_no_drop_flag]
 pub struct RcMut<T> {
+    // already priv
     priv ptr: *mut RcMutBox<T>,
 }
 
index 1cd7672771678a7cae63cde8122a21ee301f6730..9e13d20e9710ddd4957a2c8aa39e5366d2fe4b45 100644 (file)
@@ -41,7 +41,8 @@ pub fn align(size: uint, align: uint) -> uint {
 
 /// Adaptor to wrap around visitors implementing MovePtr.
 pub struct MovePtrAdaptor<V> {
-    inner: V
+    // all by reedlepee
+    priv inner: V
 }
 pub fn MovePtrAdaptor<V:TyVisitor + MovePtr>(v: V) -> MovePtrAdaptor<V> {
     MovePtrAdaptor { inner: v }
index 4feb1ca19104b1ddf68c0535c443eaa28dff1681..0a8d2374218b7b55072a806f32103411de7ed5b3 100644 (file)
@@ -98,10 +98,11 @@ enum VariantState {
 }
 
 pub struct ReprVisitor<'self> {
-    ptr: *c_void,
-    ptr_stk: ~[*c_void],
-    var_stk: ~[VariantState],
-    writer: &'self mut io::Writer
+    // made priv by reedlpee
+    priv ptr: *c_void,
+    priv ptr_stk: ~[*c_void],
+    priv var_stk: ~[VariantState],
+    priv writer: &'self mut io::Writer
 }
 
 pub fn ReprVisitor<'a>(ptr: *c_void,
index 3c2000c522c4d654561d4ea78f982973277b5a06..182515e12bee19f93c67ba1c697afdd8c5d3ce02 100644 (file)
 
 #[deriving(Eq)]
 pub struct BorrowRecord {
-    box: *mut raw::Box<()>,
+    // all made byt reedlepee
+    priv box: *mut raw::Box<()>,
     file: *c_char,
-    line: size_t
+    priv line: size_t
 }
 
 fn try_take_task_borrow_list() -> Option<~[BorrowRecord]> {
index 4eae8bdc9a8224f9dfbcaa6038da3b9117803375..b74ae01fa30121b41d6c6f3f35855d359d19dab9 100644 (file)
@@ -48,14 +48,16 @@ struct Packet<T> {
 
 // A one-shot channel.
 pub struct ChanOne<T> {
-    void_packet: *mut Void,
-    suppress_finalize: bool
+    //  all made priv by reeldepee
+    priv void_packet: *mut Void,
+    priv suppress_finalize: bool
 }
 
 /// A one-shot port.
 pub struct PortOne<T> {
-    void_packet: *mut Void,
-    suppress_finalize: bool
+    //  all made priv by reeldepee
+    priv void_packet: *mut Void,
+    priv suppress_finalize: bool
 }
 
 pub fn oneshot<T: Send>() -> (PortOne<T>, ChanOne<T>) {
@@ -443,12 +445,14 @@ struct StreamPayload<T> {
 
 /// A channel with unbounded size.
 pub struct Chan<T> {
+    //  all made priv by reeldepee
     // FIXME #5372. Using Cell because we don't take &mut self
     next: Cell<StreamChanOne<T>>
 }
 
 /// An port with unbounded size.
 pub struct Port<T> {
+    //  all made priv by reeldepee
     // FIXME #5372. Using Cell because we don't take &mut self
     next: Cell<StreamPortOne<T>>
 }
@@ -577,6 +581,7 @@ fn recv_ready(self) -> Option<T> {
 impl<'self, T> SelectPort<T> for &'self Port<T> { }
 
 pub struct SharedChan<T> {
+    // already priv
     // Just like Chan, but a shared AtomicOption instead of Cell
     priv next: UnsafeArc<AtomicOption<StreamChanOne<T>>>
 }
@@ -630,6 +635,7 @@ fn clone(&self) -> SharedChan<T> {
 }
 
 pub struct SharedPort<T> {
+    // already priv
     // 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>>>>
 }
index 7f7545ca230ff5edcb6dbf5d297e04abc200e7d6..9508c757c9dd74ea45dd7dc00ca06ecb91d50896 100644 (file)
 // then misalign the regs again.
 pub struct Context {
     /// 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
-    regs: ~Registers,
+    priv regs: ~Registers,
     /// Lower bound and upper bound for the stack
-    stack_bounds: Option<(uint, uint)>,
+    priv stack_bounds: Option<(uint, uint)>,
 }
 
 impl Context {
index d33e1af90f8d0adaf4e9d3dfecec07a281701352..54a1c2406d0b0e9521a4fd86b21d357dd2cbe5c9 100644 (file)
 extern {}
 
 pub struct ModEntry<'self> {
+    // made priv by reedlepee
     name: &'self str,
     log_level: *mut u32
 }
 
 pub struct CrateMap<'self> {
-    version: i32,
-    entries: &'self [ModEntry<'self>],
-    children: &'self [&'self CrateMap<'self>]
+    // made priv by reedlepee
+     priv version: i32,
+     priv entries: &'self [ModEntry<'self>],
+     priv children: &'self [&'self CrateMap<'self>]
 }
 
 #[cfg(not(windows))]
index 9dcb35c806f7cb8512df97b2c467596e0666131d..a33892736b09e4fd79982eb0a16885d7500b8fb2 100644 (file)
@@ -64,6 +64,7 @@
 
 /// Wraps a Reader and buffers input from it
 pub struct BufferedReader<R> {
+    // all already priv
     priv inner: R,
     priv buf: ~[u8],
     priv pos: uint,
@@ -175,6 +176,7 @@ fn inner_mut_ref<'a>(&'a mut self) -> &'a mut R {
 ///
 /// Note that `BufferedWriter` will NOT flush its buffer when dropped.
 pub struct BufferedWriter<W> {
+    // all already priv
     priv inner: W,
     priv buf: ~[u8],
     priv pos: uint
@@ -250,6 +252,7 @@ fn eof(&mut self) -> bool {
 ///
 /// Note that `BufferedStream` will NOT flush its output buffer when dropped.
 pub struct BufferedStream<S> {
+    // all already priv
     priv inner: BufferedReader<InternalBufferedWriter<S>>
 }
 
index 99634b532b082c6962d27f05cc09cf3dfa237ddd..5a3524195c74b0a94f06a275db2d6bb37a957f8e 100644 (file)
@@ -368,6 +368,7 @@ fn bytes(self) -> ByteIterator<T> {
 /// each call to its `.next()` method.
 /// Yields `None` if the condition is handled.
 pub struct ByteIterator<T> {
+    // all already priv
     priv reader: T,
 }
 
index a5d593d2454da691f47e3f26633a3568a955d874..9d633ec1c65aa6aa00fd42eaaa85e10df54df947 100644 (file)
@@ -298,6 +298,7 @@ pub fn readdir<P: PathLike>(path: &P) -> Option<~[Path]> {
 /// Constrained version of `FileStream` that only exposes read-specific operations.
 ///
 /// Can be retreived via `FileInfo.open_reader()`.
+/// all already priv
 pub struct FileReader { priv stream: FileStream }
 
 /// a `std::rt::io::Reader` trait impl for file I/O.
@@ -325,6 +326,7 @@ fn seek(&mut self, pos: i64, style: SeekStyle) {
 /// Constrained version of `FileStream` that only exposes write-specific operations.
 ///
 /// Can be retreived via `FileInfo.open_writer()`.
+// already priv
 pub struct FileWriter { priv stream: FileStream }
 
 /// a `std::rt::io::Writer` trait impl for file I/O.
@@ -362,8 +364,9 @@ fn seek(&mut self, pos: i64, style: SeekStyle) {
 /// For this reason, it is best to use the access-constrained wrappers that are
 /// exposed via `FileInfo.open_reader()` and `FileInfo.open_writer()`.
 pub struct FileStream {
-    fd: ~RtioFileStream,
-    last_nread: int,
+    // all made by reedlepee
+    priv fd: ~RtioFileStream,
+    priv last_nread: int,
 }
 
 /// a `std::rt::io::Reader` trait impl for file I/O.
index 7c72ce6ba891ea13e107f5711d41eb351589d6d9..9c49f2afb1ed57311fde5eaf80fdfc56b1d5bb8e 100644 (file)
@@ -17,7 +17,8 @@
 
 /// A Writer decorator that compresses using the 'deflate' scheme
 pub struct DeflateWriter<W> {
-    inner_writer: W
+    // all made by reedlepee
+    priv inner_writer: W
 }
 
 impl<W: Writer> DeflateWriter<W> {
@@ -56,7 +57,8 @@ fn inner_mut_ref<'a>(&'a mut self) -> &'a mut W {
 
 /// A Reader decorator that decompresses using the 'deflate' scheme
 pub struct InflateReader<R> {
-    inner_reader: R
+    // all made by reedlepee
+    priv inner_reader: R
 }
 
 impl<R: Reader> InflateReader<R> {
index 5f6b4398c22f72be83aac931ab8fba5191b05e64..85bd46ebaf4341a9ec77d95c426d2298d2a150b0 100644 (file)
@@ -22,6 +22,7 @@
 
 /// Writes to an owned, growable byte vector
 pub struct MemWriter {
+    // already priv
     priv buf: ~[u8]
 }
 
@@ -66,6 +67,7 @@ fn inner_mut_ref<'a>(&'a mut self) -> &'a mut ~[u8] {
 
 /// Reads from an owned byte vector
 pub struct MemReader {
+    // already priv
     priv buf: ~[u8],
     priv pos: uint
 }
@@ -129,6 +131,7 @@ fn inner_mut_ref<'a>(&'a mut self) -> &'a mut ~[u8] {
 
 /// Writes to a fixed-size byte slice
 pub struct BufWriter<'self> {
+    // already priv
     priv buf: &'self mut [u8],
     priv pos: uint
 }
@@ -157,6 +160,7 @@ fn seek(&mut self, _pos: i64, _style: SeekStyle) { fail!() }
 
 /// Reads from a fixed-size byte slice
 pub struct BufReader<'self> {
+    // already priv
     priv buf: &'self [u8],
     priv pos: uint
 }
index c46e1372c6414653190507e476ebcaa8cf5781a0..30775ec90ba02f4e7c3a1057f086d341686329a9 100644 (file)
@@ -12,8 +12,9 @@
 use rt::io::{Reader, Writer};
 
 pub struct MockReader {
+    // all made by reedlepee
     read: ~fn(buf: &mut [u8]) -> Option<uint>,
-    eof: ~fn() -> bool
+    priv eof: ~fn() -> bool
 }
 
 impl MockReader {
@@ -31,8 +32,8 @@ fn eof(&mut self) -> bool { (self.eof)() }
 }
 
 pub struct MockWriter {
-    write: ~fn(buf: &[u8]),
-    flush: ~fn()
+    priv write: ~fn(buf: &[u8]),
+    priv flush: ~fn()
 }
 
 impl MockWriter {
index c0971b5d3cd5d3f7d50c09782a19835a16fd40dc..d9951741ab25577ee5861b130c5325a22def5e1a 100644 (file)
@@ -341,6 +341,7 @@ pub mod unix { }
 ///
 /// Is something like this sufficient? It's kind of archaic
 pub struct IoError {
+    // all made by reedlepee
     kind: IoErrorKind,
     desc: &'static str,
     detail: Option<~str>
@@ -648,6 +649,7 @@ pub enum FileAccess {
 }
 
 pub struct FileStat {
+    // all made by reedlepee
     /// A `Path` object containing information about the `PathInfo`'s location
     path: Path,
     /// `true` if the file pointed at by the `PathInfo` is a regular file
index d682098118172fa2f09ca4368f38138519fe0f4b..cce2e851452b3f49838a464bcf25c32499b57997 100644 (file)
@@ -61,6 +61,7 @@ fn keep_going(data: &[u8], f: &fn(*u8, uint) -> i64) -> i64 {
 pub type fd_t = libc::c_int;
 
 pub struct FileDesc {
+    // aleady priv
     priv fd: fd_t,
 }
 
@@ -126,6 +127,7 @@ fn drop(&mut self) {
 }
 
 pub struct CFile {
+    // aleady priv
     priv file: *libc::FILE
 }
 
index 91fff6d92630b802a26d0c5f1d1ec88eb7324810..73ce330cd49c756ced49ba952a8b1267d6758b22 100644 (file)
@@ -25,6 +25,7 @@
  * for the process to terminate.
  */
 pub struct Process {
+    // aleady priv
     /// The unique id of the process (this should never be negative).
     priv pid: pid_t,
 
index 5661725d77baa40f6d8247a2c015a3d9c800d500..41c25e0841ab4d987250650232a499be1547c546 100644 (file)
@@ -31,6 +31,7 @@ pub fn println(s: &str) {
 }
 
 pub struct StdIn {
+    // aleady priv
     priv fd: file::FileDesc
 }
 
@@ -49,6 +50,7 @@ fn eof(&mut self) -> bool { self.fd.eof() }
 }
 
 pub struct StdOut {
+    // aleady priv
     priv fd: file::FileDesc
 }
 
index f72d2e1f19bdb7304859cbe0b21bd56f69e02a65..945014867e2c435bf1a0a83fa1385ce6381493da 100644 (file)
@@ -48,6 +48,7 @@ fn to_str(&self) -> ~str {
 
 #[deriving(Eq, TotalEq, Clone)]
 pub struct SocketAddr {
+    // all made by reedlpee
     ip: IpAddr,
     port: Port,
 }
index f29e17cfc2f3d127152f16b9d66be1874e690fd0..0ed5861e2961d3b5231f9100cfed7b97fad898a8 100644 (file)
@@ -21,6 +21,7 @@
 use rt::local::Local;
 
 pub struct TcpStream {
+    // aleady priv
     priv obj: ~RtioTcpStreamObject
 }
 
@@ -99,6 +100,7 @@ fn flush(&mut self) { /* no-op */ }
 }
 
 pub struct TcpListener {
+    // aleady priv
     priv obj: ~RtioTcpListenerObject
 }
 
@@ -142,6 +144,7 @@ fn listen(self) -> Option<TcpAcceptor> {
 }
 
 pub struct TcpAcceptor {
+    // aleady priv
     priv obj: ~RtioTcpAcceptorObject
 }
 
index 27faae0838b15d2383e8564bb3b3c6d04c6c9a02..5c63dd5352e6a45a18e47c74481f7713a5de829b 100644 (file)
@@ -17,6 +17,7 @@
 use rt::local::Local;
 
 pub struct UdpSocket {
+    // aleady priv
     priv obj: ~RtioUdpSocketObject
 }
 
@@ -72,6 +73,7 @@ pub fn socket_name(&mut self) -> Option<SocketAddr> {
 }
 
 pub struct UdpStream {
+    // aleady priv
     priv socket: UdpSocket,
     priv connectedTo: SocketAddr
 }
index d2cd531ed266fd99c631e6e216844f958c016b4e..a89419fa41f1f43477de4cea1f9a311c14a9fef4 100644 (file)
@@ -21,6 +21,7 @@
 use rt::rtio::RtioUnboundPipeObject;
 
 pub struct PipeStream {
+    // already priv
     priv obj: RtioPipeObject
 }
 
index 5f2453852ee7fe9a82704d64ecde3ae9efbf1274..e6029e0ff9c19dfc4082d68a7a9590f86bbe5a64 100644 (file)
 #[cfg(not(windows))] pub static MustDieSignal: int = libc::SIGKILL as int;
 
 pub struct Process {
+    // already priv
     priv handle: ~RtioProcessObject,
+    // made by reedlepee
     io: ~[Option<io::PipeStream>],
 }
 
 /// This configuration describes how a new process should be spawned. This is
 /// translated to libuv's own configuration
 pub struct ProcessConfig<'self> {
+    // all made by reedlepee
     /// Path to the program to run
     program: &'self str,
 
index e6dd9a480998ebf39391187ae6bd62ae64268404..9f540dd0a8123e213aef6b3067c053b1d287645b 100644 (file)
@@ -87,6 +87,7 @@ pub fn println_args(fmt: &fmt::Arguments) {
 
 /// Representation of a reader of a standard input stream
 pub struct StdReader {
+    // aleady priv
     priv inner: ~RtioFileStream
 }
 
@@ -106,6 +107,7 @@ fn eof(&mut self) -> bool { false }
 
 /// Representation of a writer to a standard output stream
 pub struct StdWriter {
+    // aleady priv
     priv inner: ~RtioFileStream
 }
 
index b41d7541a60746f7735727dad77ee384e6022298..cb35fdf5883f49ed0517076776c1ed7db5a93280 100644 (file)
@@ -16,6 +16,7 @@
 use rt::local::Local;
 
 pub struct Timer {
+    // aleady priv
     priv obj: ~RtioTimerObject
 }
 
index 8029e3f643175507277a6c50780a1cde87c80bbb..603e6627ee4666830bbcc3655c420551f43dc4b9 100644 (file)
@@ -215,21 +215,22 @@ struct KillHandleInner {
 
 /// Per-task state related to task death, killing, failure, etc.
 pub struct Death {
+    // all made priv by reedlepee
     // 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.
-    kill_handle:     Option<KillHandle>,
+     kill_handle:     Option<KillHandle>,
     // 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
     // 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).
-    unkillable:      int,
+     priv unkillable:      int,
     // 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
     // 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 {
index 262da9f3b8e5e27d6a7e830ab016d311ff227402..0f28880871d52e9783cf1ef8df01a2286bc5f264 100644 (file)
@@ -32,8 +32,9 @@ struct BoxedRegion {
 pub type TypeDesc = c_void;
 
 pub struct LocalHeap {
-    memory_region: *MemoryRegion,
-    boxed_region: *BoxedRegion
+    // all made by reedlepee
+    priv memory_region: *MemoryRegion,
+    priv boxed_region: *BoxedRegion
 }
 
 impl LocalHeap {
index 99b5156b319553b1ece12c24ccfa8a8a1e91ecd8..1864ebdad33622aa1b8e26888fbdda4ac8388dfa 100644 (file)
@@ -20,6 +20,7 @@
 use clone::Clone;
 
 pub struct MessageQueue<T> {
+    // already priv
     priv state: UnsafeArc<State<T>>
 }
 
index 2ba00c3a2fbaced49417a4d7e37a1237d3b658ca..3e641196cb4abc2ecb8b0b9c246ac29c9c192c60 100644 (file)
@@ -24,7 +24,8 @@
 use cast;
 
 pub struct RC<T> {
-    p: *c_void // ~(uint, T)
+    // all made priv by reedlepe
+    priv p: *c_void // ~(uint, T)
 }
 
 impl<T> RC<T> {
index ca521c792dc732e9e25cf9db564cf5c72a922143..485239d307f5f424f2b43c9d0e9e612e01408e55 100644 (file)
@@ -61,12 +61,13 @@ pub trait RemoteCallback {
 /// Using unix flag conventions for now, which happens to also be what's supported
 /// libuv (it does translation to windows under the hood).
 pub struct FileOpenConfig {
+    // all made by reedlepe
     /// Path to file to be opened
     path: Path,
     /// Flags for file access mode (as per open(2))
     flags: int,
     /// File creation mode, ignored unless O_CREAT is passed as part of flags
-    mode: int
+    priv mode: int
 }
 
 pub trait IoFactory {
index 336d2518e437c82941c8e90cf28819cdd421b70e..82c56d7d9a30a60343fdc15e776b662b4cdea4dc 100644 (file)
 /// in too much allocation and too many events.
 pub struct 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
     /// cloning the core work queues.
     work_queues: ~[WorkQueue<~Task>],
     /// The queue of incoming messages from other schedulers.
     /// These are enqueued by SchedHandles after which a remote callback
     /// is triggered to handle the message.
+    // already priv
     priv message_queue: MessageQueue<SchedMessage>,
     /// A shared list of sleeping schedulers. We'll use this to wake
     /// 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
     /// wake the scheduler. It just prevents the scheduler from pushing
     /// multiple handles onto the sleeper list.
+    // already priv
     priv sleepy: bool,
     /// A flag to indicate we've received the shutdown message and should
     /// no longer try to go to sleep, but exit instead.
@@ -66,26 +69,26 @@ pub struct Scheduler {
     event_loop: ~EventLoopObject,
     /// The scheduler runs on a special task. When it is not running
     /// 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
     /// 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?
     run_anything: bool,
     /// If the scheduler shouldn't run some tasks, a friend to send
     /// them to.
-    friend_handle: Option<SchedHandle>,
+    priv friend_handle: Option<SchedHandle>,
     /// A fast XorShift rng for scheduler use
     rng: XorShiftRng,
     /// A toggleable idle callback
-    idle_callback: Option<~PausibleIdleCallback>,
+    priv idle_callback: Option<~PausibleIdleCallback>,
     /// A countdown that starts at a random value and is decremented
     /// every time a yield check is performed. When it hits 0 a task
     /// will yield.
-    yield_check_count: uint,
+    priv yield_check_count: uint,
     /// A flag to tell the scheduler loop it needs to do some stealing
     /// 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
@@ -793,8 +796,10 @@ pub enum SchedMessage {
 }
 
 pub struct SchedHandle {
+    //already priv
     priv remote: ~RemoteCallbackObject,
     priv queue: MessageQueue<SchedMessage>,
+    // made by reedlepee
     sched_id: uint
 }
 
index f4fdf15cda62e2f11ea71eabf16401e127e99530..5135ed76005a073376be53bc1fbce86da677ec43 100644 (file)
@@ -20,6 +20,7 @@
 use clone::Clone;
 
 pub struct SleeperList {
+    // already priv
     priv state: UnsafeArc<State>
 }
 
index fddee5882b9acf6c8dcdf8da54574ce52fde7c03..7bffc93c69346a1181ba2ec002898dfdb47e4fe8 100644 (file)
@@ -15,8 +15,9 @@
 use libc::{c_uint, uintptr_t};
 
 pub struct StackSegment {
-    buf: ~[u8],
-    valgrind_id: c_uint
+    // all made by reedlepee
+    priv buf: ~[u8],
+    priv valgrind_id: c_uint
 }
 
 impl StackSegment {
index a6f9e11e40e9e2ed68b8f75eaad48226f4c47db6..6e0b96c221e6d0a58e01115db32e4bc6796fef4b 100644 (file)
 // the type-specific state.
 
 pub struct Task {
-    heap: LocalHeap,
-    gc: GarbageCollector,
-    storage: LocalStorage,
-    logger: StdErrLogger,
-    unwinder: Unwinder,
-    taskgroup: Option<Taskgroup>,
-    death: Death,
-    destroyed: bool,
-    name: Option<SendStr>,
-    coroutine: Option<Coroutine>,
-    sched: Option<~Scheduler>,
-    task_type: TaskType,
+     //all priv made br reedlepe
+     heap: LocalHeap,
+     priv gc: GarbageCollector,
+     storage: LocalStorage,
+     logger: StdErrLogger,
+     unwinder: Unwinder,
+     taskgroup: Option<Taskgroup>,
+     death: Death,
+     destroyed: bool,
+     name: Option<SendStr>,
+     coroutine: Option<Coroutine>,
+     sched: Option<~Scheduler>,
+     task_type: TaskType,
     // Dynamic borrowck debugging info
-    borrow_list: Option<~[BorrowRecord]>
+     // should be public
+     borrow_list: Option<~[BorrowRecord]>
 }
 
 pub enum TaskType {
@@ -69,7 +71,8 @@ pub struct Coroutine {
     /// The segment of stack on which the task is currently running or
     /// if the task is blocked, on which the task will resume
     /// 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.
     saved_context: Context
 }
@@ -84,6 +87,7 @@ pub enum SchedHome {
 pub struct LocalStorage(Option<local_data::Map>);
 
 pub struct Unwinder {
+    //all priv made br reedlepe
     unwinding: bool,
 }
 
index e774b81da3501d3e29b1dd3578b04be7fba65d53..949d73ecc4fcfaf63b58045be2fcb7c2245dc589 100644 (file)
@@ -18,9 +18,9 @@
 type raw_thread = libc::c_void;
 
 pub struct Thread {
-    main: ~fn(),
-    raw_thread: *raw_thread,
-    joined: bool,
+    priv main: ~fn(),
+    priv raw_thread: *raw_thread,
+    priv joined: bool
 }
 
 impl Thread {
index b8e535e4c7dfd3ac202427402039dcf6f58e39e2..869f23baf325c3614041a4d2d9dc84fd71364b0d 100644 (file)
@@ -28,7 +28,8 @@ struct TubeState<T> {
 }
 
 pub struct Tube<T> {
-    p: RC<TubeState<T>>
+    //all priv made br reedlepe
+    priv p: RC<TubeState<T>>
 }
 
 impl<T> Tube<T> {
index 83a7e64b1397f6b944667d1029a1a9e282dd5b1a..8fa8fbdc4a10d7f474925197dba46042b0a04345 100644 (file)
@@ -25,7 +25,8 @@
 pub struct GetAddrInfoRequest(*uvll::uv_getaddrinfo_t);
 
 pub struct RequestData {
-    getaddrinfo_cb: Option<GetAddrInfoCallback>,
+    // all made by reedlepee
+    priv getaddrinfo_cb: Option<GetAddrInfoCallback>,
 }
 
 impl GetAddrInfoRequest {
index 3a6d858df791cbfa2abd9a87162e30988ba12f2b..5e20f5fad88cf874302787c1ebd57571ea141ebc 100644 (file)
@@ -25,7 +25,8 @@
 impl Request for FsRequest {}
 
 pub struct RequestData {
-    complete_cb: Option<FsCallback>
+    // all made by reedlepee
+    priv complete_cb: Option<FsCallback>
 }
 
 impl FsRequest {
index 67926b35a6219b0f7cd4ebeee7366dae05b38253..4c547276a50c594f9ca3eed475867da40644ea68 100644 (file)
@@ -80,7 +80,8 @@
 /// with dtors may not be destructured, but tuple structs can,
 /// but the results are not correct.
 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
index d5893d6d014145d1663b201248d139d991cd4b44..5e441a5414b4aafcae45051a96d76c531314ed07 100644 (file)
@@ -180,7 +180,8 @@ fn socket_name<T, U: Watcher + NativeHandle<*T>>(sk: SocketNameKind,
 
 // Obviously an Event Loop is always home.
 pub struct UvEventLoop {
-    uvio: UvIoFactory
+    // all made by reedlepee
+    priv uvio: UvIoFactory
 }
 
 impl UvEventLoop {
@@ -240,9 +241,10 @@ fn io<'a>(&'a mut self) -> Option<&'a mut IoFactoryObject> {
 }
 
 pub struct UvPausibleIdleCallback {
-    watcher: IdleWatcher,
-    idle_flag: bool,
-    closed: bool
+    // all made by reedlepee
+    priv watcher: IdleWatcher,
+    priv idle_flag: bool,
+    priv closed: bool
 }
 
 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.
 pub struct UvRemoteCallback {
+    // all made by reedlepee
     // 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
     // almost never contested - only in rare races with the dtor.
-    exit_flag: Exclusive<bool>
+    priv exit_flag: Exclusive<bool>
 }
 
 impl UvRemoteCallback {
@@ -801,8 +804,9 @@ fn spawn(&mut self, config: ProcessConfig)
 }
 
 pub struct UvTcpListener {
-    watcher : TcpWatcher,
-    home: SchedHandle,
+    // all made by reedlepee
+    priv watcher : TcpWatcher,
+    priv home: SchedHandle,
 }
 
 impl HomingIO for UvTcpListener {
@@ -863,8 +867,9 @@ fn listen(self) -> Result<~RtioTcpAcceptorObject, IoError> {
 }
 
 pub struct UvTcpAcceptor {
-    listener: UvTcpListener,
-    incoming: Tube<Result<~RtioTcpStreamObject, IoError>>,
+    // all made by reedlepee
+    priv listener: UvTcpListener,
+    priv incoming: Tube<Result<~RtioTcpStreamObject, IoError>>,
 }
 
 impl HomingIO for UvTcpAcceptor {
@@ -987,8 +992,9 @@ fn write_stream(mut watcher: StreamWatcher,
 }
 
 pub struct UvUnboundPipe {
+    // all made by reedlepee
     pipe: Pipe,
-    home: SchedHandle,
+    priv home: SchedHandle,
 }
 
 impl HomingIO for UvUnboundPipe {
@@ -1017,6 +1023,7 @@ pub unsafe fn bind(~self) -> UvPipeStream {
 }
 
 pub struct UvPipeStream {
+    // already
     priv inner: ~UvUnboundPipe,
 }
 
@@ -1040,8 +1047,9 @@ fn write(&mut self, buf: &[u8]) -> Result<(), IoError> {
 }
 
 pub struct UvTcpStream {
-    watcher: TcpWatcher,
-    home: SchedHandle,
+    // all made by reedlepee
+    priv watcher: TcpWatcher,
+    priv home: SchedHandle,
 }
 
 impl HomingIO for UvTcpStream {
@@ -1140,8 +1148,9 @@ fn letdie(&mut self) -> Result<(), IoError> {
 }
 
 pub struct UvUdpSocket {
-    watcher: UdpWatcher,
-    home: SchedHandle,
+    // all made by reedelpee
+    priv watcher: UdpWatcher,
+    priv home: SchedHandle,
 }
 
 impl HomingIO for UvUdpSocket {
@@ -1350,8 +1359,9 @@ fn ignore_broadcasts(&mut self) -> Result<(), IoError> {
 }
 
 pub struct UvTimer {
-    watcher: timer::TimerWatcher,
-    home: SchedHandle,
+    // all made by reedelpee
+    priv watcher: timer::TimerWatcher,
+    priv home: SchedHandle,
 }
 
 impl HomingIO for UvTimer {
@@ -1397,10 +1407,11 @@ fn sleep(&mut self, msecs: u64) {
 }
 
 pub struct UvFileStream {
-    loop_: Loop,
-    fd: c_int,
-    close_on_drop: bool,
-    home: SchedHandle
+    // all made by reedelpee
+    priv loop_: Loop,
+    priv fd: c_int,
+    priv close_on_drop: bool,
+    priv home: SchedHandle
 }
 
 impl HomingIO for UvFileStream {
@@ -1530,13 +1541,15 @@ fn flush(&mut self) -> Result<(), IoError> {
 }
 
 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
     // brief interim the `home` is None.
-    home: Option<SchedHandle>,
+    priv home: Option<SchedHandle>,
 
     // All None until the process exits (exit_error may stay None)
+   // Rest were already priv
     priv exit_status: Option<int>,
     priv term_signal: Option<int>,
     priv exit_error: Option<UvError>,
index a80d5cbc1fb439a3562af209078b0979858eccd8..98d4fd332772a1ab47d05be34d163a46d7e488ba 100644 (file)
@@ -84,6 +84,7 @@ pub mod errors {
 // see libuv/include/uv-unix.h
 #[cfg(unix)]
 pub struct uv_buf_t {
+    // all made by reedelpee
     base: *u8,
     len: libc::size_t,
 }
@@ -91,26 +92,29 @@ pub struct uv_buf_t {
 // see libuv/include/uv-win.h
 #[cfg(windows)]
 pub struct uv_buf_t {
+    // all made by reedelpee
     len: u32,
     base: *u8,
 }
 
 pub struct uv_process_options_t {
-    exit_cb: uv_exit_cb,
-    file: *libc::c_char,
-    args: **libc::c_char,
-    env: **libc::c_char,
-    cwd: *libc::c_char,
-    flags: libc::c_uint,
-    stdio_count: libc::c_int,
-    stdio: *uv_stdio_container_t,
-    uid: uv_uid_t,
-    gid: uv_gid_t,
+     // all made by reedelpee
+     exit_cb: uv_exit_cb,
+     file: *libc::c_char,
+     args: **libc::c_char,
+     env: **libc::c_char,
+     cwd: *libc::c_char,
+     flags: libc::c_uint,
+     stdio_count: libc::c_int,
+     stdio: *uv_stdio_container_t,
+     uid: uv_uid_t,
+     gid: uv_gid_t,
 }
 
 // These fields are private because they must be interfaced with through the
 // functions below.
 pub struct uv_stdio_container_t {
+    // already priv
     priv flags: libc::c_int,
     priv stream: *uv_stream_t,
 }
@@ -133,27 +137,29 @@ pub struct uv_stdio_container_t {
 pub type uv_pipe_t = c_void;
 
 pub struct uv_timespec_t {
+    // all made by reedelpee
     tv_sec: libc::c_long,
-    tv_nsec: libc::c_long
+    priv tv_nsec: libc::c_long
 }
 
 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_nlink: libc::uint64_t,
-    st_uid: libc::uint64_t,
-    st_gid: libc::uint64_t,
-    st_rdev: libc::uint64_t,
-    st_ino: libc::uint64_t,
+    priv st_nlink: libc::uint64_t,
+    priv st_uid: libc::uint64_t,
+    priv st_gid: libc::uint64_t,
+    priv st_rdev: libc::uint64_t,
+    priv st_ino: libc::uint64_t,
     st_size: libc::uint64_t,
-    st_blksize: libc::uint64_t,
-    st_blocks: libc::uint64_t,
-    st_flags: libc::uint64_t,
-    st_gen: libc::uint64_t,
+    priv st_blksize: libc::uint64_t,
+    priv st_blocks: libc::uint64_t,
+    priv st_flags: libc::uint64_t,
+    priv st_gen: libc::uint64_t,
     st_atim: uv_timespec_t,
     st_mtim: uv_timespec_t,
     st_ctim: uv_timespec_t,
-    st_birthtim: uv_timespec_t
+    priv st_birthtim: uv_timespec_t
 }
 
 impl uv_stat_t {
@@ -231,39 +237,42 @@ pub fn is_dir(&self) -> bool {
 #[cfg(target_os = "android")]
 #[cfg(target_os = "linux")]
 pub struct addrinfo {
-    ai_flags: c_int,
-    ai_family: c_int,
-    ai_socktype: c_int,
-    ai_protocol: c_int,
-    ai_addrlen: socklen_t,
-    ai_addr: *sockaddr,
-    ai_canonname: *char,
-    ai_next: *addrinfo
+     // all made by reedelpee
+     priv ai_flags: c_int,
+     priv ai_family: c_int,
+     priv ai_socktype: c_int,
+     priv ai_protocol: c_int,
+     priv ai_addrlen: socklen_t,
+     ai_addr: *sockaddr,
+     priv ai_canonname: *char,
+     ai_next: *addrinfo
 }
 
 #[cfg(target_os = "macos")]
 #[cfg(target_os = "freebsd")]
 pub struct addrinfo {
-    ai_flags: c_int,
-    ai_family: c_int,
-    ai_socktype: c_int,
-    ai_protocol: c_int,
-    ai_addrlen: socklen_t,
-    ai_canonname: *char,
+     // all made by reedelpee
+    priv ai_flags: c_int,
+    priv ai_family: c_int,
+    priv ai_socktype: c_int,
+    priv ai_protocol: c_int,
+    priv ai_addrlen: socklen_t,
+    priv ai_canonname: *char,
     ai_addr: *sockaddr,
     ai_next: *addrinfo
 }
 
 #[cfg(windows)]
 pub struct addrinfo {
-    ai_flags: c_int,
-    ai_family: c_int,
-    ai_socktype: c_int,
-    ai_protocol: c_int,
-    ai_addrlen: size_t,
-    ai_canonname: *char,
+     // all made by reedelpee
+    priv ai_flags: c_int,
+    priv ai_family: c_int,
+    priv ai_socktype: c_int,
+    priv ai_protocol: c_int,
+    priv ai_addrlen: size_t,
+    priv ai_canonname: *char,
     ai_addr: *sockaddr,
-    ai_next: *addrinfo
+    priv vai_next: *addrinfo
 }
 
 #[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 {
-    err_name: ~str,
-    err_msg: ~str,
+     // all made by reedelpee
+    priv err_name: ~str,
+    priv err_msg: ~str,
 }
 
 extern {
index 24792f3904e51645f2e23cea49bea8a3a7d9bfa5..7700855d7b74326a27a8955790f842b12659f72b 100644 (file)
@@ -17,6 +17,7 @@
 use clone::Clone;
 
 pub struct WorkQueue<T> {
+    // already priv
     // XXX: Another mystery bug fixed by boxing this lock
     priv queue: ~Exclusive<~[T]>
 }
index a406058631823779049167d46456dc662da23080..ccb8de8185714dc9f342908ae656488be6310e9d 100644 (file)
  * for the process to terminate.
  */
 pub struct Process {
+    // already priv
     priv inner: process::Process,
 }
 
 /// Options that can be given when starting a Process.
 pub struct ProcessOptions<'self> {
-
+    // All were made priv by reedlepee
     /**
      * If this is None then the new process will have the same initial
      * environment as the parent process.
@@ -99,7 +100,7 @@ pub fn new<'a>() -> ProcessOptions<'a> {
 
 /// The output of a finished process.
 pub struct ProcessOutput {
-
+    /// made priv by reedlepee
     /// The status (exit code) of the process.
     status: int,
 
index a6b0924e6c181005c371a58d81cb3b4721590459..bba3ad6a94ef99408281e1c817b1f115ceb7e883 100644 (file)
@@ -355,6 +355,7 @@ fn only_ascii(&self) -> bool {
 /// Use with the `std::iterator` module.
 #[deriving(Clone)]
 pub struct CharIterator<'self> {
+    // already priv
     /// The slice remaining to be iterated
     priv string: &'self str,
 }
@@ -400,6 +401,7 @@ fn next_back(&mut self) -> Option<char> {
 /// Use with the `std::iterator` module.
 #[deriving(Clone)]
 pub struct CharOffsetIterator<'self> {
+    // already priv
     /// The original string to be iterated
     priv string: &'self str,
     priv iter: CharIterator<'self>,
@@ -458,6 +460,7 @@ fn next_back(&mut self) -> Option<(uint, char)> {
 /// An iterator over the substrings of a string, separated by `sep`.
 #[deriving(Clone)]
 pub struct CharSplitIterator<'self, Sep> {
+    // already priv
     /// The slice remaining to be iterated
     priv string: &'self str,
     priv sep: Sep,
@@ -475,6 +478,7 @@ pub struct CharSplitIterator<'self, Sep> {
 /// splitting at most `count` times.
 #[deriving(Clone)]
 pub struct CharSplitNIterator<'self, Sep> {
+    // already priv
     priv iter: CharSplitIterator<'self, Sep>,
     /// The number of splits remaining
     priv count: uint,
@@ -591,6 +595,7 @@ fn next(&mut self) -> Option<&'self str> {
 /// substring within a larger string
 #[deriving(Clone)]
 pub struct MatchesIndexIterator<'self> {
+    // already priv
     priv haystack: &'self str,
     priv needle: &'self str,
     priv position: uint,
@@ -600,6 +605,7 @@ pub struct MatchesIndexIterator<'self> {
 /// search string
 #[deriving(Clone)]
 pub struct StrSplitIterator<'self> {
+    // already priv
     priv it: MatchesIndexIterator<'self>,
     priv last_end: uint,
     priv finished: bool
@@ -997,9 +1003,9 @@ pub fn utf8_char_width(b: u8) -> uint {
 /// the utf8 bytes of a string.
 pub struct CharRange {
     /// Current `char`
-       /// This field should be public making it private causes error while compiling!!
+    /// This field should be public making it private causes error while compiling!!
     ch: char,
-
+    // made by reedlepee
     /// Index of the first byte of the next `char`
     next: uint
 }
index ec2d7566177564e86894e67988693767ea242626..35a33f017014177494e29b6f3f452efe54234e3a 100644 (file)
@@ -23,6 +23,7 @@
 
 /// Datatype to hold one ascii character. It wraps a `u8`, with the highest bit always zero.
 #[deriving(Clone, Eq, Ord, TotalOrd, TotalEq)]
+//already priv
 pub struct Ascii { priv chr: u8 }
 
 impl Ascii {
index 970a62b676fcc5c63e8d0f3b1e545ce765aa40ba..55a881f48fadb074e7fcb1d7c9da12c7706eee49 100644 (file)
@@ -108,7 +108,8 @@ pub enum SchedMode {
  *
  */
 pub struct SchedOpts {
-    mode: SchedMode,
+     // all made by reedelpee
+    priv mode: SchedMode,
 }
 
 /**
@@ -144,14 +145,15 @@ pub struct SchedOpts {
  *           scheduler other tasks will be impeded or even blocked indefinitely.
  */
 pub struct TaskOpts {
-    linked: bool,
-    supervised: bool,
-    watched: bool,
-    indestructible: bool,
-    notify_chan: Option<Chan<TaskResult>>,
-    name: Option<SendStr>,
-    sched: SchedOpts,
-    stack_size: Option<uint>
+     // all made by reedelpee
+     priv linked: bool,
+     priv supervised: bool,
+     priv watched: bool,
+     priv indestructible: bool,
+     priv notify_chan: Option<Chan<TaskResult>>,
+     name: Option<SendStr>,
+     sched: SchedOpts,
+     stack_size: Option<uint>
 }
 
 /**
@@ -169,10 +171,11 @@ pub struct TaskOpts {
 
 // FIXME (#3724): Replace the 'consumed' bit with move mode on self
 pub struct TaskBuilder {
+    //all made priv by reedlepee
     opts: TaskOpts,
-    gen_body: Option<~fn(v: ~fn()) -> ~fn()>,
-    can_not_copy: Option<util::NonCopyable>,
-    consumed: bool,
+    priv gen_body: Option<~fn(v: ~fn()) -> ~fn()>,
+    priv can_not_copy: Option<util::NonCopyable>,
+    priv consumed: bool,
 }
 
 /**
index 7cf0f04c7e9f6882438d66e6fbd389c71278d69b..36bf261bb52f6e0586681c81a744d939daf82af4 100644 (file)
@@ -307,11 +307,12 @@ fn iterate(ancestors:       &mut AncestorList,
 
 // One of these per task.
 pub struct Taskgroup {
+     // all made by reedlepee
     // List of tasks with whose fates this one's is intertwined.
-    tasks:      TaskGroupArc, // 'none' means the group has failed.
+    priv tasks:      TaskGroupArc, // 'none' means the group has failed.
     // Lists of tasks who will kill us if they fail, but whom we won't kill.
-    ancestors:  AncestorList,
-    notifier:   Option<AutoNotify>,
+    priv ancestors:  AncestorList,
+    priv notifier:   Option<AutoNotify>,
 }
 
 impl Drop for Taskgroup {
index c561fb6cc8a457d1759982e02a6076f56087b8a2..57aec6a7314d25d52a86f9a6ba6940052e0b7253 100644 (file)
@@ -28,6 +28,7 @@ enum Child<T> {
 
 #[allow(missing_doc)]
 pub struct TrieMap<T> {
+    // already priv
     priv root: TrieNode<T>,
     priv length: uint
 }
@@ -222,6 +223,7 @@ fn extend<Iter: Iterator<(uint, T)>>(&mut self, iter: &mut Iter) {
 
 #[allow(missing_doc)]
 pub struct TrieSet {
+    // already priv
     priv map: TrieMap<()>
 }
 
@@ -443,6 +445,7 @@ fn remove<T>(count: &mut uint, child: &mut Child<T>, key: uint,
 
 /// Forward iterator over a map
 pub struct TrieMapIterator<'self, T> {
+    // already priv
     priv stack: ~[vec::VecIterator<'self, Child<T>>],
     priv remaining_min: uint,
     priv remaining_max: uint
@@ -483,6 +486,7 @@ fn size_hint(&self) -> (uint, Option<uint>) {
 
 /// Forward iterator over a set
 pub struct TrieSetIterator<'self> {
+    // already priv
     priv iter: TrieMapIterator<'self, ()>
 }
 
index e8835462a80e28afd804c9612c355f9d1ac6fce7..e64f17ecf30883d437301509a003baec9255cd51 100644 (file)
@@ -28,6 +28,7 @@
  * A simple atomic flag, that can be set and cleared. The most basic atomic type.
  */
 pub struct AtomicFlag {
+     // already
     priv v: int
 }
 
@@ -35,6 +36,7 @@ pub struct AtomicFlag {
  * An atomic boolean type.
  */
 pub struct AtomicBool {
+     // already
     priv v: uint
 }
 
@@ -42,6 +44,7 @@ pub struct AtomicBool {
  * A signed atomic integer type, supporting basic atomic arithmetic operations
  */
 pub struct AtomicInt {
+     // already
     priv v: int
 }
 
@@ -49,6 +52,7 @@ pub struct AtomicInt {
  * An unsigned atomic integer type, supporting basic atomic arithmetic operations
  */
 pub struct AtomicUint {
+     // already
     priv v: uint
 }
 
@@ -56,6 +60,7 @@ pub struct AtomicUint {
  * An unsafe atomic pointer. Only supports basic atomic operations
  */
 pub struct AtomicPtr<T> {
+     // already
     priv p: *mut T
 }
 
@@ -64,6 +69,7 @@ pub struct AtomicPtr<T> {
  */
 #[unsafe_no_drop_flag]
 pub struct AtomicOption<T> {
+     // already
     priv p: *mut c_void
 }
 
index d3d768bc0c6fba6ecb070fdee0a64580fe83f9bb..18ee693ebb64cc197088be2419ec7932b0a7b33d 100644 (file)
@@ -23,6 +23,7 @@
 use option::*;
 use result::*;
 
+// already
 pub struct DynamicLibrary { priv handle: *libc::c_void }
 
 impl Drop for DynamicLibrary {
diff --git a/src/libstd/unstable/extfmt.rs b/src/libstd/unstable/extfmt.rs
new file mode 100644 (file)
index 0000000..0719ad4
--- /dev/null
@@ -0,0 +1,705 @@
+// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+//! Support for fmt! expressions.
+//!
+//! The syntax is close to that of Posix format strings:
+//!
+//! ~~~~~~
+//! Format := '%' Parameter? Flag* Width? Precision? Type
+//! Parameter := [0-9]+ '$'
+//! Flag := [ 0#+-]
+//! Width := Parameter | [0-9]+
+//! Precision := '.' [0-9]+
+//! Type := [bcdfiostuxX?]
+//! ~~~~~~
+//!
+//! * Parameter is the 1-based argument to apply the format to. Currently not
+//! implemented.
+//! * Flag 0 causes leading zeros to be used for padding when converting
+//! numbers.
+//! * Flag # causes the conversion to be done in an *alternative* manner.
+//! Currently not implemented.
+//! * Flag + causes signed numbers to always be prepended with a sign
+//! character.
+//! * Flag - left justifies the result
+//! * Width specifies the minimum field width of the result. By default
+//! leading spaces are added.
+//! * Precision specifies the minimum number of digits for integral types
+//! and the minimum number
+//! of decimal places for float.
+//!
+//! The types currently supported are:
+//!
+//! * b - bool
+//! * c - char
+//! * d - int
+//! * f - float
+//! * i - int (same as d)
+//! * o - uint as octal
+//! * t - uint as binary
+//! * u - uint
+//! * x - uint as lower-case hexadecimal
+//! * X - uint as upper-case hexadecimal
+//! * s - str (any flavor)
+//! * ? - arbitrary type (does not use the to_str trait)
+
+/*
+Syntax Extension: fmt
+
+Format a string
+
+The 'fmt' extension is modeled on the posix printf system.
+
+A posix conversion ostensibly looks like this
+
+> %~[parameter]~[flags]~[width]~[.precision]~[length]type
+
+Given the different numeric type bestiary we have, we omit the 'length'
+parameter and support slightly different conversions for 'type'
+
+> %~[parameter]~[flags]~[width]~[.precision]type
+
+we also only support translating-to-rust a tiny subset of the possible
+combinations at the moment.
+
+Example:
+
+debug!("hello, %s!", "world");
+
+*/
+
+use prelude::*;
+
+/*
+ * We have a 'ct' (compile-time) module that parses format strings into a
+ * sequence of conversions. From those conversions AST fragments are built
+ * that call into properly-typed functions in the 'rt' (run-time) module.
+ * Each of those run-time conversion functions accepts another conversion
+ * description that specifies how to format its output.
+ *
+ * The building of the AST is currently done in a module inside the compiler,
+ * but should migrate over here as the plugin interface is defined.
+ */
+
+// Functions used by the fmt extension at compile time
+#[doc(hidden)]
+pub mod ct {
+    use char;
+    use container::Container;
+    use prelude::*;
+    use str;
+
+    #[deriving(Eq)]
+    pub enum Signedness { Signed, Unsigned, }
+
+    #[deriving(Eq)]
+    pub enum Caseness { CaseUpper, CaseLower, }
+
+    #[deriving(Eq)]
+    pub enum Ty {
+        TyBool,
+        TyStr,
+        TyChar,
+        TyInt(Signedness),
+        TyBits,
+        TyHex(Caseness),
+        TyOctal,
+        TyFloat,
+        TyPointer,
+        TyPoly,
+    }
+
+    #[deriving(Eq)]
+    pub enum Flag {
+        FlagLeftJustify,
+        FlagLeftZeroPad,
+        FlagSpaceForSign,
+        FlagSignAlways,
+        FlagAlternate,
+    }
+
+    #[deriving(Eq)]
+    pub enum Count {
+        CountIs(uint),
+        CountIsParam(uint),
+        CountIsNextParam,
+        CountImplied,
+    }
+
+    #[deriving(Eq)]
+    struct Parsed<T> {
+        val: T,
+        next: uint
+    }
+
+    impl<T> Parsed<T> {
+        pub fn new(val: T, next: uint) -> Parsed<T> {
+            Parsed {val: val, next: next}
+        }
+    }
+
+    // A formatted conversion from an expression to a string
+    #[deriving(Eq)]
+    pub struct Conv {
+        // all ade by reedlepee
+        param: Option<uint>,
+        flags: ~[Flag],
+        width: Count,
+        precision: Count,
+        ty: Ty
+    }
+
+    // A fragment of the output sequence
+    #[deriving(Eq)]
+    pub enum Piece {
+        PieceString(~str),
+        PieceConv(Conv),
+    }
+
+    pub type ErrorFn<'self> = &'self fn(&str) -> !;
+
+    pub fn parse_fmt_string<'a>(s: &str, err: ErrorFn<'a>) -> ~[Piece] {
+        fn push_slice(ps: &mut ~[Piece], s: &str, from: uint, to: uint) {
+            if to > from {
+                ps.push(PieceString(s.slice(from, to).to_owned()));
+            }
+        }
+
+        let lim = s.len();
+        let mut h = 0;
+        let mut i = 0;
+        let mut pieces = ~[];
+
+        while i < lim {
+            if s[i] == '%' as u8 {
+                i += 1;
+
+                if i >= lim {
+                    err("unterminated conversion at end of string");
+                } else if s[i] == '%' as u8 {
+                    push_slice(&mut pieces, s, h, i);
+                    i += 1;
+                } else {
+                    push_slice(&mut pieces, s, h, i - 1);
+                    let Parsed {
+                        val,
+                        next
+                    } = parse_conversion(s, i, lim, |s| err(s));
+                    pieces.push(val);
+                    i = next;
+                }
+
+                h = i;
+            } else {
+                i += str::utf8_char_width(s[i]);
+            }
+        }
+
+        push_slice(&mut pieces, s, h, i);
+        pieces
+    }
+
+    pub fn peek_num(s: &str, i: uint, lim: uint) -> Option<Parsed<uint>> {
+        let mut i = i;
+        let mut accum = 0;
+        let mut found = false;
+
+        while i < lim {
+            match char::to_digit(s[i] as char, 10) {
+                Some(x) => {
+                    found = true;
+                    accum *= 10;
+                    accum += x;
+                    i += 1;
+                }
+                None => break
+            }
+        }
+
+        if found {
+            Some(Parsed::new(accum, i))
+        } else {
+            None
+        }
+    }
+
+    pub fn parse_conversion<'a>(s: &str, i: uint, lim: uint, err: ErrorFn<'a>)
+                                -> Parsed<Piece> {
+        let param = parse_parameter(s, i, lim);
+        // avoid copying ~[Flag] by destructuring
+        let Parsed {val: flags_val, next: flags_next} = parse_flags(s,
+            param.next, lim);
+        let width = parse_count(s, flags_next, lim);
+        let prec = parse_precision(s, width.next, lim);
+        let ty = parse_type(s, prec.next, lim, err);
+
+        Parsed::new(PieceConv(Conv {
+            param: param.val,
+            flags: flags_val,
+            width: width.val,
+            precision: prec.val,
+            ty: ty.val}), ty.next)
+    }
+
+    pub fn parse_parameter(s: &str, i: uint, lim: uint) ->
+        Parsed<Option<uint>> {
+        if i >= lim { return Parsed::new(None, i); }
+
+        match peek_num(s, i, lim) {
+            Some(num) if num.next < lim && s[num.next] == '$' as u8 =>
+                Parsed::new(Some(num.val), num.next + 1),
+            _ => Parsed::new(None, i)
+        }
+    }
+
+    pub fn parse_flags(s: &str, i: uint, lim: uint) -> Parsed<~[Flag]> {
+        let mut i = i;
+        let mut flags = ~[];
+
+        while i < lim {
+            let f = match s[i] as char {
+                '-' => FlagLeftJustify,
+                '0' => FlagLeftZeroPad,
+                ' ' => FlagSpaceForSign,
+                '+' => FlagSignAlways,
+                '#' => FlagAlternate,
+                _ => break
+            };
+
+            flags.push(f);
+            i += 1;
+        }
+
+        Parsed::new(flags, i)
+    }
+
+    pub fn parse_count(s: &str, i: uint, lim: uint) -> Parsed<Count> {
+        if i >= lim {
+            Parsed::new(CountImplied, i)
+        } else if s[i] == '*' as u8 {
+            let param = parse_parameter(s, i + 1, lim);
+            let j = param.next;
+
+            match param.val {
+                None => Parsed::new(CountIsNextParam, j),
+                Some(n) => Parsed::new(CountIsParam(n), j)
+            }
+        } else {
+            match peek_num(s, i, lim) {
+                None => Parsed::new(CountImplied, i),
+                Some(num) => Parsed::new(CountIs(num.val), num.next)
+            }
+        }
+    }
+
+    pub fn parse_precision(s: &str, i: uint, lim: uint) -> Parsed<Count> {
+        if i < lim && s[i] == '.' as u8 {
+            let count = parse_count(s, i + 1, lim);
+
+            // If there were no digits specified, i.e. the precision
+            // was ".", then the precision is 0
+            match count.val {
+                CountImplied => Parsed::new(CountIs(0), count.next),
+                _ => count
+            }
+        } else {
+            Parsed::new(CountImplied, i)
+        }
+    }
+
+    pub fn parse_type<'a>(s: &str, i: uint, lim: uint, err: ErrorFn<'a>)
+                          -> Parsed<Ty> {
+        if i >= lim { err("missing type in conversion"); }
+
+        // FIXME (#2249): Do we really want two signed types here?
+        // How important is it to be printf compatible?
+        let t = match s[i] as char {
+            'b' => TyBool,
+            's' => TyStr,
+            'c' => TyChar,
+            'd' | 'i' => TyInt(Signed),
+            'u' => TyInt(Unsigned),
+            'x' => TyHex(CaseLower),
+            'X' => TyHex(CaseUpper),
+            't' => TyBits,
+            'o' => TyOctal,
+            'f' => TyFloat,
+            'p' => TyPointer,
+            '?' => TyPoly,
+            _ => err(format!("unknown type in conversion: {}", s.char_at(i)))
+        };
+
+        Parsed::new(t, i + 1)
+    }
+
+    #[cfg(test)]
+    fn die(s: &str) -> ! { fail2!(s.to_owned()) }
+
+    #[test]
+    fn test_parse_count() {
+        fn test(s: &str, count: Count, next: uint) -> bool {
+            parse_count(s, 0, s.len()) == Parsed::new(count, next)
+        }
+
+        assert!(test("", CountImplied, 0));
+        assert!(test("*", CountIsNextParam, 1));
+        assert!(test("*1", CountIsNextParam, 1));
+        assert!(test("*1$", CountIsParam(1), 3));
+        assert!(test("123", CountIs(123), 3));
+    }
+
+    #[test]
+    fn test_parse_flags() {
+        fn pack(fs: &[Flag]) -> uint {
+            fs.iter().fold(0, |p, &f| p | (1 << f as uint))
+        }
+
+        fn test(s: &str, flags: &[Flag], next: uint) {
+            let f = parse_flags(s, 0, s.len());
+            assert_eq!(pack(f.val), pack(flags));
+            assert_eq!(f.next, next);
+        }
+
+        test("", [], 0);
+        test("!#-+ 0", [], 0);
+        test("#-+", [FlagAlternate, FlagLeftJustify, FlagSignAlways], 3);
+        test(" 0", [FlagSpaceForSign, FlagLeftZeroPad], 2);
+    }
+
+    #[test]
+    fn test_parse_fmt_string() {
+        assert!(parse_fmt_string("foo %s bar", die) == ~[
+            PieceString(~"foo "),
+            PieceConv(Conv {
+                param: None,
+                flags: ~[],
+                width: CountImplied,
+                precision: CountImplied,
+                ty: TyStr,
+            }),
+            PieceString(~" bar")]);
+
+        assert!(parse_fmt_string("%s", die) == ~[
+            PieceConv(Conv {
+                param: None,
+                flags: ~[],
+                width: CountImplied,
+                precision: CountImplied,
+                ty: TyStr,
+            })]);
+
+        assert!(parse_fmt_string("%%%%", die) == ~[
+            PieceString(~"%"), PieceString(~"%")]);
+    }
+
+    #[test]
+    fn test_parse_parameter() {
+        fn test(s: &str, param: Option<uint>, next: uint) -> bool {
+            parse_parameter(s, 0, s.len()) == Parsed::new(param, next)
+        }
+
+        assert!(test("", None, 0));
+        assert!(test("foo", None, 0));
+        assert!(test("123", None, 0));
+        assert!(test("123$", Some(123), 4));
+    }
+
+    #[test]
+    fn test_parse_precision() {
+        fn test(s: &str, count: Count, next: uint) -> bool {
+            parse_precision(s, 0, s.len()) == Parsed::new(count, next)
+        }
+
+        assert!(test("", CountImplied, 0));
+        assert!(test(".", CountIs(0), 1));
+        assert!(test(".*", CountIsNextParam, 2));
+        assert!(test(".*1", CountIsNextParam, 2));
+        assert!(test(".*1$", CountIsParam(1), 4));
+        assert!(test(".123", CountIs(123), 4));
+    }
+
+    #[test]
+    fn test_parse_type() {
+        fn test(s: &str, ty: Ty) -> bool {
+            parse_type(s, 0, s.len(), die) == Parsed::new(ty, 1)
+        }
+
+        assert!(test("b", TyBool));
+        assert!(test("c", TyChar));
+        assert!(test("d", TyInt(Signed)));
+        assert!(test("f", TyFloat));
+        assert!(test("i", TyInt(Signed)));
+        assert!(test("o", TyOctal));
+        assert!(test("s", TyStr));
+        assert!(test("t", TyBits));
+        assert!(test("x", TyHex(CaseLower)));
+        assert!(test("X", TyHex(CaseUpper)));
+        assert!(test("p", TyPointer));
+        assert!(test("?", TyPoly));
+    }
+
+    #[test]
+    #[should_fail]
+    fn test_parse_type_missing() {
+        parse_type("", 0, 0, die);
+    }
+
+    #[test]
+    #[should_fail]
+    fn test_parse_type_unknown() {
+        parse_type("!", 0, 1, die);
+    }
+
+    #[test]
+    fn test_peek_num() {
+        let s1 = "";
+        assert!(peek_num(s1, 0, s1.len()).is_none());
+
+        let s2 = "foo";
+        assert!(peek_num(s2, 0, s2.len()).is_none());
+
+        let s3 = "123";
+        assert_eq!(peek_num(s3, 0, s3.len()), Some(Parsed::new(123, 3)));
+
+        let s4 = "123foo";
+        assert_eq!(peek_num(s4, 0, s4.len()), Some(Parsed::new(123, 3)));
+    }
+}
+
+// Functions used by the fmt extension at runtime. For now there are a lot of
+// decisions made a runtime. If it proves worthwhile then some of these
+// conditions can be evaluated at compile-time. For now though it's cleaner to
+// implement it this way, I think.
+#[doc(hidden)]
+#[allow(non_uppercase_statics)]
+pub mod rt {
+    use f64;
+    use str;
+    use sys;
+    use num;
+    use vec;
+    use option::{Some, None, Option};
+
+    pub static flag_none : u32 = 0u32;
+    pub static flag_left_justify   : u32 = 0b00000000000001u32;
+    pub static flag_left_zero_pad  : u32 = 0b00000000000010u32;
+    pub static flag_space_for_sign : u32 = 0b00000000000100u32;
+    pub static flag_sign_always    : u32 = 0b00000000001000u32;
+    pub static flag_alternate      : u32 = 0b00000000010000u32;
+
+    pub enum Count { CountIs(uint), CountImplied, }
+
+    pub enum Ty { TyDefault, TyBits, TyHexUpper, TyHexLower, TyOctal, }
+
+    pub struct Conv {
+        // all ade by reedlepee
+        flags: u32,
+        width: Count,
+        precision: Count,
+        ty: Ty,
+    }
+
+    pub fn conv_int(cv: Conv, i: int, buf: &mut ~str) {
+        let radix = 10;
+        let prec = get_int_precision(cv);
+        let s : ~str = uint_to_str_prec(num::abs(i) as uint, radix, prec);
+
+        let head = if i >= 0 {
+            if have_flag(cv.flags, flag_sign_always) {
+                Some('+')
+            } else if have_flag(cv.flags, flag_space_for_sign) {
+                Some(' ')
+            } else {
+                None
+            }
+        } else { Some('-') };
+        pad(cv, s, head, PadSigned, buf);
+    }
+    pub fn conv_uint(cv: Conv, u: uint, buf: &mut ~str) {
+        let prec = get_int_precision(cv);
+        let rs =
+            match cv.ty {
+              TyDefault => uint_to_str_prec(u, 10, prec),
+              TyHexLower => uint_to_str_prec(u, 16, prec),
+
+              // FIXME: #4318 Instead of to_ascii and to_str_ascii, could use
+              // to_ascii_move and to_str_move to not do a unnecessary copy.
+              TyHexUpper => {
+                let s = uint_to_str_prec(u, 16, prec);
+                s.to_ascii().to_upper().to_str_ascii()
+              }
+              TyBits => uint_to_str_prec(u, 2, prec),
+              TyOctal => uint_to_str_prec(u, 8, prec)
+            };
+        pad(cv, rs, None, PadUnsigned, buf);
+    }
+    pub fn conv_bool(cv: Conv, b: bool, buf: &mut ~str) {
+        let s = if b { "true" } else { "false" };
+        // run the boolean conversion through the string conversion logic,
+        // giving it the same rules for precision, etc.
+        conv_str(cv, s, buf);
+    }
+    pub fn conv_char(cv: Conv, c: char, buf: &mut ~str) {
+        pad(cv, "", Some(c), PadNozero, buf);
+    }
+    pub fn conv_str(cv: Conv, s: &str, buf: &mut ~str) {
+        // For strings, precision is the maximum characters
+        // displayed
+        let unpadded = match cv.precision {
+            CountImplied => s,
+            CountIs(max) => {
+                if (max as uint) < s.char_len() {
+                    s.slice(0, max as uint)
+                } else {
+                    s
+                }
+            }
+        };
+        pad(cv, unpadded, None, PadNozero, buf);
+    }
+    pub fn conv_float(cv: Conv, f: f64, buf: &mut ~str) {
+        let (to_str, digits) = match cv.precision {
+              CountIs(c) => (f64::to_str_exact, c as uint),
+              CountImplied => (f64::to_str_digits, 6u)
+        };
+        let s = to_str(f, digits);
+        let head = if 0.0 <= f {
+            if have_flag(cv.flags, flag_sign_always) {
+                Some('+')
+            } else if have_flag(cv.flags, flag_space_for_sign) {
+                Some(' ')
+            } else {
+                None
+            }
+        } else { None };
+        pad(cv, s, head, PadFloat, buf);
+    }
+    pub fn conv_pointer<T>(cv: Conv, ptr: *T, buf: &mut ~str) {
+        let s = ~"0x" + uint_to_str_prec(ptr as uint, 16, 1u);
+        pad(cv, s, None, PadNozero, buf);
+    }
+    pub fn conv_poly<T>(cv: Conv, v: &T, buf: &mut ~str) {
+        let s = sys::log_str(v);
+        conv_str(cv, s, buf);
+    }
+
+    // Convert a uint to string with a minimum number of digits.  If precision
+    // is 0 and num is 0 then the result is the empty string. Could move this
+    // to uint: but it doesn't seem all that useful.
+    pub fn uint_to_str_prec(num: uint, radix: uint, prec: uint) -> ~str {
+        return if prec == 0u && num == 0u {
+                ~""
+            } else {
+                let s = num.to_str_radix(radix);
+                let len = s.char_len();
+                if len < prec {
+                    let diff = prec - len;
+                    let pad = str::from_chars(vec::from_elem(diff, '0'));
+                    pad + s
+                } else { s }
+            };
+    }
+    pub fn get_int_precision(cv: Conv) -> uint {
+        return match cv.precision {
+              CountIs(c) => c as uint,
+              CountImplied => 1u
+            };
+    }
+
+    #[deriving(Eq)]
+    pub enum PadMode { PadSigned, PadUnsigned, PadNozero, PadFloat }
+
+    pub fn pad(cv: Conv, s: &str, head: Option<char>, mode: PadMode,
+               buf: &mut ~str) {
+        let headsize = match head { Some(_) => 1, _ => 0 };
+        let uwidth : uint = match cv.width {
+            CountImplied => {
+                for &c in head.iter() {
+                    buf.push_char(c);
+                }
+                return buf.push_str(s);
+            }
+            CountIs(width) => { width as uint }
+        };
+        let strlen = s.char_len() + headsize;
+        if uwidth <= strlen {
+            for &c in head.iter() {
+                buf.push_char(c);
+            }
+            return buf.push_str(s);
+        }
+        let mut padchar = ' ';
+        let diff = uwidth - strlen;
+        if have_flag(cv.flags, flag_left_justify) {
+            for &c in head.iter() {
+                buf.push_char(c);
+            }
+            buf.push_str(s);
+            do diff.times {
+                buf.push_char(padchar);
+            }
+            return;
+        }
+        let (might_zero_pad, signed) = match mode {
+          PadNozero   => (false, true),
+          PadSigned   => (true, true),
+          PadFloat    => (true, true),
+          PadUnsigned => (true, false)
+        };
+        fn have_precision(cv: Conv) -> bool {
+            return match cv.precision { CountImplied => false, _ => true };
+        }
+        let zero_padding = {
+            if might_zero_pad && have_flag(cv.flags, flag_left_zero_pad) &&
+                (!have_precision(cv) || mode == PadFloat) {
+                padchar = '0';
+                true
+            } else {
+                false
+            }
+        };
+        let padstr = str::from_chars(vec::from_elem(diff, padchar));
+        // This is completely heinous. If we have a signed value then
+        // potentially rip apart the intermediate result and insert some
+        // zeros. It may make sense to convert zero padding to a precision
+        // instead.
+
+        if signed && zero_padding {
+            for &head in head.iter() {
+                if head == '+' || head == '-' || head == ' ' {
+                    buf.push_char(head);
+                    buf.push_str(padstr);
+                    buf.push_str(s);
+                    return;
+                }
+            }
+        }
+        buf.push_str(padstr);
+        for &c in head.iter() {
+            buf.push_char(c);
+        }
+        buf.push_str(s);
+    }
+    #[inline]
+    pub fn have_flag(flags: u32, f: u32) -> bool {
+        flags & f != 0
+    }
+}
+
+// Bulk of the tests are in src/test/run-pass/syntax-extension-fmt.rs
+#[cfg(test)]
+mod test {
+    #[test]
+    fn fmt_slice() {
+        let s = "abc";
+        let _s = format!("{}", s);
+    }
+}
index 68fdfd7301321b2b564394b6db191f83f4783abd..9c216470f17aac44aeadc1bffa8d2001b433cefd 100644 (file)
 #[lang="ty_desc"]
 #[cfg(not(test))]
 pub struct TyDesc {
+    // all ade by reedlepee
     // sizeof(T)
-    size: uint,
+     size: uint,
 
     // alignof(T)
     align: uint,
 
     // Called on a copy of a value of type `T` *after* memcpy
-    take_glue: GlueFn,
+    priv take_glue: GlueFn,
 
     // Called when a value of type `T` is no longer needed
     drop_glue: GlueFn,
 
     // Called by drop glue when a value of type `T` can be freed
-    free_glue: GlueFn,
+    priv free_glue: GlueFn,
 
     // Called by reflection visitor to visit a value of type `T`
-    visit_glue: GlueFn,
+    priv visit_glue: GlueFn,
 
     // If T represents a box pointer (`@U` or `~U`), then
     // `borrow_offset` is the amount that the pointer must be adjusted
     // to find the payload.  This is always derivable from the type
     // `U`, but in the case of `@Trait` or `~Trait` objects, the type
     // `U` is unknown.
-    borrow_offset: uint,
+    priv borrow_offset: uint,
 
     // Name corresponding to the type
     name: &'static str
index ac0e83df7ef56839bdfdcbb55cb621ac5d9fbc1a..ae9095e1b5fe481bf5d51974e8dde567670d2a0d 100644 (file)
 
 /// The representation of a Rust managed box
 pub struct Box<T> {
+    // all ade by reedlepee
     ref_count: uint,
     type_desc: *TyDesc,
-    prev: *Box<T>,
+    priv prev: *Box<T>,
     next: *Box<T>,
     data: T
 }
 
 /// The representation of a Rust vector
 pub struct Vec<T> {
+    // all ade by reedlepee
     fill: uint,
     alloc: uint,
     data: T
@@ -32,12 +34,14 @@ pub struct Vec<T> {
 
 /// The representation of a Rust slice
 pub struct Slice<T> {
+    // all ade by reedlepee
     data: *T,
     len: uint
 }
 
 /// The representation of a Rust closure
 pub struct Closure {
+    // all ade by reedlepee
     code: *(),
     env: *(),
 }
index 4c6ad469d8cbeaccd1ecd18773821c31e2b64586..f6363c45021f662ca189bd17410d12da263b2a91 100644 (file)
@@ -28,6 +28,7 @@
 /// Enforces no shared-memory safety.
 //#[unsafe_no_drop_flag] FIXME: #9758
 pub struct UnsafeArc<T> {
+    // all ade by reedlepee
     data: *mut ArcData<T>,
 }
 
@@ -304,7 +305,8 @@ pub unsafe fn atomically<U>(f: &fn() -> U) -> U {
 type rust_little_lock = *libc::c_void;
 
 pub struct LittleLock {
-    l: rust_little_lock,
+    // all ade by reedlepee
+    priv l: rust_little_lock,
 }
 
 impl Drop for LittleLock {
@@ -353,7 +355,8 @@ struct ExData<T> {
  * need to block or deschedule while accessing shared state, use extra::sync::RWArc.
  */
 pub struct Exclusive<T> {
-    x: UnsafeArc<ExData<T>>
+    // all ade by reedlepee
+    priv x: UnsafeArc<ExData<T>>
 }
 
 impl<T:Send> Clone for Exclusive<T> {
index b10d0ded5b47757345b2b3b6bca964dd0cb27aa9..7ceb8d201ab724521d0b0004003db588255fc70e 100644 (file)
@@ -216,6 +216,7 @@ pub fn build<A>(size: Option<uint>, builder: &fn(push: &fn(v: A))) -> ~[A] {
 /// An iterator over the slices of a vector separated by elements that
 /// match a predicate function.
 pub struct SplitIterator<'self, T> {
+    // already priv
     priv v: &'self [T],
     priv n: uint,
     priv pred: &'self fn(t: &T) -> bool,
@@ -265,6 +266,7 @@ fn size_hint(&self) -> (uint, Option<uint>) {
 /// An iterator over the slices of a vector separated by elements that
 /// match a predicate function, from back to front.
 pub struct RSplitIterator<'self, T> {
+    // already priv
     priv v: &'self [T],
     priv n: uint,
     priv pred: &'self fn(t: &T) -> bool,
@@ -403,6 +405,7 @@ pub fn unzip<T, U, V: Iterator<(T, U)>>(mut iter: V) -> (~[T], ~[U]) {
 /// The last generated swap is always (0, 1), and it returns the
 /// sequence to its initial order.
 pub struct ElementSwaps {
+    // already priv
     priv sdir: ~[SizeDirection],
     /// If true, emit the last swap that returns the sequence to initial state
     priv emit_reset: bool,
@@ -478,6 +481,7 @@ fn new_pos(i: uint, s: Direction) -> uint {
 ///
 /// Generates even and odd permutations alternatingly.
 pub struct Permutations<T> {
+    // already priv
     priv swaps: ElementSwaps,
     priv v: ~[T],
 }
@@ -500,6 +504,7 @@ fn next(&mut self) -> Option<~[T]> {
 /// a vector.
 #[deriving(Clone)]
 pub struct WindowIter<'self, T> {
+    // already priv
     priv v: &'self [T],
     priv size: uint
 }
@@ -534,6 +539,7 @@ fn size_hint(&self) -> (uint, Option<uint>) {
 /// the last slice of the iteration will be the remainder.
 #[deriving(Clone)]
 pub struct ChunkIter<'self, T> {
+    // already priv
     priv v: &'self [T],
     priv size: uint
 }
@@ -2393,6 +2399,7 @@ fn idx(&self, index: uint) -> Option<&'self T> {
 //iterator!{struct VecIterator -> *T, &'self T}
 /// An iterator for iterating over a vector.
 pub struct VecIterator<'self, T> {
+    // already priv
     priv ptr: *T,
     priv end: *T,
     priv lifetime: Option<&'self ()> // FIXME: #5922
@@ -2411,6 +2418,7 @@ fn clone(&self) -> VecIterator<'self, T> { *self }
 //iterator!{struct VecMutIterator -> *mut T, &'self mut T}
 /// An iterator for mutating the elements of a vector.
 pub struct VecMutIterator<'self, T> {
+    // already priv
     priv ptr: *mut T,
     priv end: *mut T,
     priv lifetime: Option<&'self mut ()> // FIXME: #5922
@@ -2422,6 +2430,7 @@ pub struct VecMutIterator<'self, T> {
 /// An iterator that moves out of a vector.
 #[deriving(Clone)]
 pub struct MoveIterator<T> {
+    // already priv
     priv v: ~[T],
     priv idx: uint,
 }
@@ -2456,6 +2465,7 @@ fn size_hint(&self) -> (uint, Option<uint>) {
 /// An iterator that moves out of a vector in reverse order.
 #[deriving(Clone)]
 pub struct MoveRevIterator<T> {
+    // already priv
     priv v: ~[T]
 }