lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nwelln...@apache.org
Subject [lucy-commits] [2/2] git commit: refs/heads/clownfish-public - Make some Clownfish classes and methods public
Date Sat, 11 May 2013 15:29:48 GMT
Make some Clownfish classes and methods public


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/7e7545ef
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/7e7545ef
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/7e7545ef

Branch: refs/heads/clownfish-public
Commit: 7e7545efd64148e9799362671974fb4b16d8f9d9
Parents: bec7902
Author: Nick Wellnhofer <wellnhofer@aevum.de>
Authored: Sat May 11 13:54:38 2013 +0200
Committer: Nick Wellnhofer <wellnhofer@aevum.de>
Committed: Sat May 11 17:28:47 2013 +0200

----------------------------------------------------------------------
 core/Clownfish/CharBuf.cfh |   88 +++++++++++++++++++-------------------
 core/Clownfish/Err.cfh     |    2 +-
 core/Clownfish/Hash.cfh    |   28 ++++++------
 core/Clownfish/Num.cfh     |   38 ++++++++--------
 core/Clownfish/VArray.cfh  |   34 +++++++-------
 core/Clownfish/VTable.cfh  |    8 ++--
 6 files changed, 99 insertions(+), 99 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/7e7545ef/core/Clownfish/CharBuf.cfh
----------------------------------------------------------------------
diff --git a/core/Clownfish/CharBuf.cfh b/core/Clownfish/CharBuf.cfh
index f9d9ab5..87ca739 100644
--- a/core/Clownfish/CharBuf.cfh
+++ b/core/Clownfish/CharBuf.cfh
@@ -20,14 +20,14 @@ parcel Lucy;
  * Growable buffer holding Unicode characters.
  */
 
-class Clownfish::CharBuf cnick CB
+public class Clownfish::CharBuf cnick CB
     inherits Clownfish::Obj {
 
     char    *ptr;
     size_t   size;
     size_t   cap;  /* allocated bytes, including terminating null */
 
-    inert incremented CharBuf*
+    public inert incremented CharBuf*
     new(size_t size);
 
     inert CharBuf*
@@ -36,13 +36,13 @@ class Clownfish::CharBuf cnick CB
     /** Return a new CharBuf which holds a copy of the passed-in string.
      * Check for UTF-8 validity.
      */
-    inert incremented CharBuf*
+    public inert incremented CharBuf*
     new_from_utf8(const char *utf8, size_t size);
 
     /** Return a new CharBuf which holds a copy of the passed-in string.  No
      * validity checking is performed.
      */
-    inert incremented CharBuf*
+    public inert incremented CharBuf*
     new_from_trusted_utf8(const char *utf8, size_t size);
 
     /** Return a pointer to a new CharBuf which assumes ownership of the
@@ -63,7 +63,7 @@ class Clownfish::CharBuf cnick CB
      * Note: a user-supplied <code>pattern</code> string is a security hole
      * and must not be allowed.
      */
-    inert incremented CharBuf*
+    public inert incremented CharBuf*
     newf(const char *pattern, ...);
 
     /** Perform lexical comparison of two CharBufs, with level of indirection
@@ -82,18 +82,18 @@ class Clownfish::CharBuf cnick CB
     public void
     Mimic(CharBuf *self, Obj *other);
 
-    void
+    public void
     Mimic_Str(CharBuf *self, const char *ptr, size_t size);
 
     /** Concatenate the passed-in string onto the end of the CharBuf.
      */
-    void
+    public void
     Cat_Str(CharBuf *self, const char *ptr, size_t size);
 
     /** Concatenate the contents of <code>other</code> onto the end of the
      * caller.
      */
-    void
+    public void
     Cat(CharBuf *self, const CharBuf *other);
 
     /** Concatenate formatted arguments.  Similar to the printf family, but
@@ -108,23 +108,23 @@ class Clownfish::CharBuf cnick CB
      * Note that all Clownfish Objects, including CharBufs, are printed via
      * %o (which invokes Obj_To_String()).
      */
-    void
+    public void
     VCatF(CharBuf *self, const char *pattern, va_list args);
 
     /** Invokes CB_VCatF to concatenate formatted arguments.  Note that this
      * is only a function and not a method.
      */
-    inert void
+    public inert void
     catf(CharBuf *self, const char *pattern, ...);
 
     /** Replaces the contents of the CharBuf using formatted arguments.
      */
-    inert void
+    public inert void
     setf(CharBuf *self, const char *pattern, ...);
 
     /** Concatenate one Unicode character onto the end of the CharBuf.
      */
-    void
+    public void
     Cat_Char(CharBuf *self, uint32_t code_point);
 
     /** Replace all instances of one character for the other.  For now, both
@@ -138,7 +138,7 @@ class Clownfish::CharBuf cnick CB
 
     /** Extract a 64-bit integer from a variable-base stringified version.
      */
-    int64_t
+    public int64_t
     BaseX_To_I64(CharBuf *self, uint32_t base);
 
     public double
@@ -150,46 +150,46 @@ class Clownfish::CharBuf cnick CB
      *
      * @return a pointer to the raw buffer.
      */
-    char*
+    public char*
     Grow(CharBuf *self, size_t size);
 
     /** Test whether the CharBuf starts with the content of another.
      */
-    bool
+    public bool
     Starts_With(CharBuf *self, const CharBuf *prefix);
 
     /** Test whether the CharBuf starts with the passed-in string.
      */
-    bool
+    public bool
     Starts_With_Str(CharBuf *self, const char *prefix, size_t size);
 
     /** Test whether the CharBuf ends with the content of another.
      */
-    bool
+    public bool
     Ends_With(CharBuf *self, const CharBuf *postfix);
 
     /** Test whether the CharBuf ends with the passed-in string.
      */
-    bool
+    public bool
     Ends_With_Str(CharBuf *self, const char *postfix, size_t size);
 
     /** Return the location of the substring within the CharBuf (measured in
      * code points), or -1 if the substring does not match.
      */
-    int64_t
+    public int64_t
     Find(CharBuf *self, const CharBuf *substring);
 
-    int64_t
+    public int64_t
     Find_Str(CharBuf *self, const char *ptr, size_t size);
 
     /** Test whether the CharBuf matches the passed-in string.
      */
-    bool
+    public bool
     Equals_Str(CharBuf *self, const char *ptr, size_t size);
 
     /** Return the number of Unicode code points in the object's string.
      */
-    size_t
+    public size_t
     Length(CharBuf *self);
 
     /** Set the CharBuf's <code>size</code> attribute.
@@ -199,7 +199,7 @@ class Clownfish::CharBuf cnick CB
 
     /** Get the CharBuf's <code>size</code> attribute.
      */
-    size_t
+    public size_t
     Get_Size(CharBuf *self);
 
     /** Return the internal backing array for the CharBuf if its internal
@@ -243,35 +243,35 @@ class Clownfish::CharBuf cnick CB
 
     /** Remove Unicode whitespace characters from both top and tail.
      */
-    uint32_t
+    public uint32_t
     Trim(CharBuf *self);
 
     /** Remove leading Unicode whitespace.
      */
-    uint32_t
+    public uint32_t
     Trim_Top(CharBuf *self);
 
     /** Remove trailing Unicode whitespace.
      */
-    uint32_t
+    public uint32_t
     Trim_Tail(CharBuf *self);
 
     /** Remove characters (measured in code points) from the top of the
      * CharBuf.  Returns the number nipped.
      */
-    size_t
+    public size_t
     Nip(CharBuf *self, size_t count);
 
     /** Remove one character from the top of the CharBuf.  Returns the code
      * point, or 0 if the string was empty.
      */
-    int32_t
+    public int32_t
     Nip_One(CharBuf *self);
 
     /** Remove characters (measured in code points) from the end of the
      * CharBuf.  Returns the number chopped.
      */
-    size_t
+    public size_t
     Chop(CharBuf *self, size_t count);
 
     /** Truncate the CharBuf so that it contains no more than
@@ -280,7 +280,7 @@ class Clownfish::CharBuf cnick CB
      * @param count Maximum new length, in Unicode code points.
      * @return The number of code points left in the string after truncation.
      */
-    size_t
+    public size_t
     Truncate(CharBuf *self, size_t count);
 
     /** Return the Unicode code point at the specified number of code points
@@ -288,14 +288,14 @@ class Clownfish::CharBuf cnick CB
      * better to throw an exception, but that's not practical with UTF-8 and
      * no cached length.)
      */
-    uint32_t
+    public uint32_t
     Code_Point_At(CharBuf *self, size_t tick);
 
     /** Return the Unicode code point at the specified number of code points
      * counted backwards from the end of the string.  Return 0 if outside the
      * string.
      */
-    uint32_t
+    public uint32_t
     Code_Point_From(CharBuf *self, size_t tick);
 
     /** Return a newly allocated CharBuf containing a copy of the indicated
@@ -303,48 +303,48 @@ class Clownfish::CharBuf cnick CB
      * @param offset Offset from the top, in code points.
      * @param len The desired length of the substring, in code points.
      */
-    incremented CharBuf*
+    public incremented CharBuf*
     SubString(CharBuf *self, size_t offset, size_t len);
 
     /** Concatenate the supplied text onto the end of the CharBuf.  Don't
      * check for UTF-8 validity.
      */
-    void
+    public void
     Cat_Trusted_Str(CharBuf *self, const char *ptr, size_t size);
 }
 
-class Clownfish::ViewCharBuf cnick ViewCB
+public class Clownfish::ViewCharBuf cnick ViewCB
     inherits Clownfish::CharBuf {
 
-    inert incremented ViewCharBuf*
+    public inert incremented ViewCharBuf*
     new_from_utf8(const char *utf8, size_t size);
 
-    inert incremented ViewCharBuf*
+    public inert incremented ViewCharBuf*
     new_from_trusted_utf8(const char *utf8, size_t size);
 
     inert ViewCharBuf*
     init(ViewCharBuf *self, const char *utf8, size_t size);
 
-    void
+    public void
     Assign(ViewCharBuf *self, const CharBuf *other);
 
-    void
+    public void
     Assign_Str(ViewCharBuf *self, const char *utf8, size_t size);
 
-    void
+    public void
     Assign_Trusted_Str(ViewCharBuf *self, const char *utf8, size_t size);
 
-    uint32_t
+    public uint32_t
     Trim_Top(ViewCharBuf *self);
 
-    size_t
+    public size_t
     Nip(ViewCharBuf *self, size_t count);
 
-    int32_t
+    public int32_t
     Nip_One(ViewCharBuf *self);
 
     /** Throws an error. */
-    char*
+    public char*
     Grow(ViewCharBuf *self, size_t size);
 
     public void

http://git-wip-us.apache.org/repos/asf/lucy/blob/7e7545ef/core/Clownfish/Err.cfh
----------------------------------------------------------------------
diff --git a/core/Clownfish/Err.cfh b/core/Clownfish/Err.cfh
index 558c710..55ef8be 100644
--- a/core/Clownfish/Err.cfh
+++ b/core/Clownfish/Err.cfh
@@ -44,7 +44,7 @@ public class Clownfish::Err inherits Clownfish::Obj {
     inert void
     init_class();
 
-    inert incremented Err*
+    public inert incremented Err*
     new(decremented CharBuf *mess);
 
     inert Err*

http://git-wip-us.apache.org/repos/asf/lucy/blob/7e7545ef/core/Clownfish/Hash.cfh
----------------------------------------------------------------------
diff --git a/core/Clownfish/Hash.cfh b/core/Clownfish/Hash.cfh
index 787184f..5c17c43 100644
--- a/core/Clownfish/Hash.cfh
+++ b/core/Clownfish/Hash.cfh
@@ -24,7 +24,7 @@ parcel Lucy;
  * this behavior can be changed by overridding Make_Key(), e.g. to implement
  * efficient hash sets.
  */
-class Clownfish::Hash inherits Clownfish::Obj {
+public class Clownfish::Hash inherits Clownfish::Obj {
 
     void          *entries;
     uint32_t       capacity;
@@ -35,7 +35,7 @@ class Clownfish::Hash inherits Clownfish::Obj {
     inert void
     init_class();
 
-    inert incremented Hash*
+    public inert incremented Hash*
     new(uint32_t capacity = 0);
 
     /**
@@ -47,16 +47,16 @@ class Clownfish::Hash inherits Clownfish::Obj {
 
     /** Empty the hash of all key-value pairs.
      */
-    void
+    public void
     Clear(Hash *self);
 
     /** Store a key-value pair.  If <code>key</code> is not already present,
      * Make_Key() will be called to manufacture the internally used key.
      */
-    void
+    public void
     Store(Hash *self, Obj *key, decremented Obj *value);
 
-    void
+    public void
     Store_Str(Hash *self, const char *str, size_t len,
               decremented Obj *value);
 
@@ -64,10 +64,10 @@ class Clownfish::Hash inherits Clownfish::Obj {
      *
      * @return the value, or NULL if <code>key</code> is not present.
      */
-    nullable Obj*
+    public nullable Obj*
     Fetch(Hash *self, const Obj *key);
 
-    nullable Obj*
+    public nullable Obj*
     Fetch_Str(Hash *self, const char *key, size_t key_len);
 
     /** Attempt to delete a key-value pair from the hash.
@@ -75,17 +75,17 @@ class Clownfish::Hash inherits Clownfish::Obj {
      * @return the value if <code>key</code> exists and thus deletion
      * succeeds; otherwise NULL.
      */
-    incremented nullable Obj*
+    public incremented nullable Obj*
     Delete(Hash *self, const Obj *key);
 
-    incremented nullable Obj*
+    public incremented nullable Obj*
     Delete_Str(Hash *self, const char *key, size_t key_ley);
 
     /** Prepare to iterate over all the key-value pairs in the hash.
      *
      * @return the number of pairs which will be iterated over.
      */
-    uint32_t
+    public uint32_t
     Iterate(Hash *self);
 
     /** Retrieve the next key-value pair from the hash, setting the supplied
@@ -94,23 +94,23 @@ class Clownfish::Hash inherits Clownfish::Obj {
      * @return true while iterating, false when the iterator has been
      * exhausted.
      */
-    bool
+    public bool
     Next(Hash *self, Obj **key, Obj **value);
 
     /** Search for a key which Equals the key supplied, and return the key
      * rather than its value.
      */
-    nullable Obj*
+    public nullable Obj*
     Find_Key(Hash *self, const Obj *key, int32_t hash_sum);
 
     /** Return an VArray of pointers to the hash's keys.
      */
-    incremented VArray*
+    public incremented VArray*
     Keys(Hash *self);
 
     /** Return an VArray of pointers to the hash's values.
      */
-    incremented VArray*
+    public incremented VArray*
     Values(Hash *self);
 
     /** Create a key to be stored within the hash entry.  Implementations must

http://git-wip-us.apache.org/repos/asf/lucy/blob/7e7545ef/core/Clownfish/Num.cfh
----------------------------------------------------------------------
diff --git a/core/Clownfish/Num.cfh b/core/Clownfish/Num.cfh
index 0ff37be..c2f9c93 100644
--- a/core/Clownfish/Num.cfh
+++ b/core/Clownfish/Num.cfh
@@ -58,7 +58,7 @@ abstract class Clownfish::IntNum inherits Clownfish::Num {
 
 /** Single precision floating point number.
  */
-class Clownfish::Float32 inherits Clownfish::FloatNum {
+public class Clownfish::Float32 inherits Clownfish::FloatNum {
 
     float value;
 
@@ -68,13 +68,13 @@ class Clownfish::Float32 inherits Clownfish::FloatNum {
     inert Float32*
     init(Float32* self, float value);
 
-    inert Float32*
+    public inert Float32*
     new(float value);
 
-    void
+    public void
     Set_Value(Float32 *self, float value);
 
-    float
+    public float
     Get_Value(Float32 *self);
 
     public int64_t
@@ -101,7 +101,7 @@ class Clownfish::Float32 inherits Clownfish::FloatNum {
 
 /** Double precision floating point number.
  */
-class Clownfish::Float64 inherits Clownfish::FloatNum {
+public class Clownfish::Float64 inherits Clownfish::FloatNum {
 
     double value;
 
@@ -111,13 +111,13 @@ class Clownfish::Float64 inherits Clownfish::FloatNum {
     inert Float64*
     init(Float64* self, double value);
 
-    inert Float64*
+    public inert Float64*
     new(double value);
 
-    void
+    public void
     Set_Value(Float64 *self, double value);
 
-    double
+    public double
     Get_Value(Float64 *self);
 
     public int64_t
@@ -144,7 +144,7 @@ class Clownfish::Float64 inherits Clownfish::FloatNum {
 
 /** 32-bit signed integer.
  */
-class Clownfish::Integer32 cnick Int32
+public class Clownfish::Integer32 cnick Int32
     inherits Clownfish::IntNum {
 
     int32_t value;
@@ -155,13 +155,13 @@ class Clownfish::Integer32 cnick Int32
     inert Integer32*
     init(Integer32* self, int32_t value);
 
-    inert Integer32*
+    public inert Integer32*
     new(int32_t value);
 
-    void
+    public void
     Set_Value(Integer32 *self, int32_t value);
 
-    int32_t
+    public int32_t
     Get_Value(Integer32 *self);
 
     public int64_t
@@ -189,7 +189,7 @@ class Clownfish::Integer32 cnick Int32
 /**
  * 64-bit signed integer.
  */
-class Clownfish::Integer64 cnick Int64
+public class Clownfish::Integer64 cnick Int64
     inherits Clownfish::IntNum {
 
     int64_t value;
@@ -200,13 +200,13 @@ class Clownfish::Integer64 cnick Int64
     inert Integer64*
     init(Integer64* self, int64_t value);
 
-    inert Integer64*
+    public inert Integer64*
     new(int64_t value);
 
-    void
+    public void
     Set_Value(Integer64 *self, int64_t value);
 
-    int64_t
+    public int64_t
     Get_Value(Integer64 *self);
 
     public int64_t
@@ -241,7 +241,7 @@ class Clownfish::Integer64 cnick Int64
  * There are only two singleton instances of this class: CFISH_TRUE and
  * CFISH_FALSE.
  */
-class Clownfish::BoolNum cnick Bool inherits Clownfish::IntNum {
+public class Clownfish::BoolNum cnick Bool inherits Clownfish::IntNum {
     bool value;
     CharBuf *string;
 
@@ -254,13 +254,13 @@ class Clownfish::BoolNum cnick Bool inherits Clownfish::IntNum {
     /** Return either CFISH_TRUE or CFISH_FALSE depending on the supplied
      * value.
      */
-    inert BoolNum*
+    public inert BoolNum*
     singleton(bool value);
 
     public void
     Destroy(BoolNum *self);
 
-    bool
+    public bool
     Get_Value(BoolNum *self);
 
     public int64_t

http://git-wip-us.apache.org/repos/asf/lucy/blob/7e7545ef/core/Clownfish/VArray.cfh
----------------------------------------------------------------------
diff --git a/core/Clownfish/VArray.cfh b/core/Clownfish/VArray.cfh
index e6f8741..7610add 100644
--- a/core/Clownfish/VArray.cfh
+++ b/core/Clownfish/VArray.cfh
@@ -29,13 +29,13 @@ __END_C__
 
 /** Variable-sized array.
  */
-class Clownfish::VArray cnick VA inherits Clownfish::Obj {
+public class Clownfish::VArray cnick VA inherits Clownfish::Obj {
 
     Obj      **elems;
     uint32_t   size;
     uint32_t   cap;
 
-    inert incremented VArray*
+    public inert incremented VArray*
     new(uint32_t capacity);
 
     /**
@@ -47,63 +47,63 @@ class Clownfish::VArray cnick VA inherits Clownfish::Obj {
 
     /** Push an item onto the end of a VArray.
      */
-    void
+    public void
     Push(VArray *self, decremented Obj *element = NULL);
 
     /** Push all the elements of another VArray onto the end of this one.
      */
-    void
+    public void
     Push_VArray(VArray *self, VArray *other);
 
     /** Pop an item off of the end of a VArray.
      */
-    incremented nullable Obj*
+    public incremented nullable Obj*
     Pop(VArray *self);
 
     /** Unshift an item onto the front of a VArray.
      */
-    void
+    public void
     Unshift(VArray *self, decremented Obj *element = NULL);
 
     /** Shift an item off of the front of a VArray.
      */
-    incremented nullable Obj*
+    public incremented nullable Obj*
     Shift(VArray *self);
 
     /** Ensure that the VArray has room for at least <code>capacity</code>
      * elements.
      */
-    void
+    public void
     Grow(VArray *self, uint32_t capacity);
 
     /** Fetch the element at <code>tick</tick>.
      */
-    nullable Obj*
+    public nullable Obj*
     Fetch(VArray *self, uint32_t tick);
 
     /** Store an element at index <code>tick</code>, possibly displacing an
      * existing element.
      */
-    void
+    public void
     Store(VArray *self, uint32_t tick, decremented Obj *elem = NULL);
 
     /** Replace an element in the VArray with NULL and return it.
      *
      * @return whatever was stored at <code>tick</code>.
      */
-    incremented nullable Obj*
+    public incremented nullable Obj*
     Delete(VArray *self, uint32_t tick);
 
     /** Remove <code>length</code> elements from the array, starting at
      * <code>offset</code>. Move elements over to fill in the gap.
      */
-    void
+    public void
     Excise(VArray *self, uint32_t offset, uint32_t length);
 
     /** Clone the VArray but merely increment the refcounts of its elements
      * rather than clone them.
      */
-    incremented VArray*
+    public incremented VArray*
     Shallow_Copy(VArray *self);
 
     /** Dupe the VArray, cloning each internal element.
@@ -118,7 +118,7 @@ class Clownfish::VArray cnick VA inherits Clownfish::Obj {
      * sorts NULL elements towards the end.
      * @param context Argument supplied to the comparison routine.
      */
-    void
+    public void
     Sort(VArray *self, Lucy_Sort_Compare_t compare = NULL,
          void *context = NULL);
 
@@ -126,12 +126,12 @@ class Clownfish::VArray cnick VA inherits Clownfish::Obj {
      * current size, grow the object to accommodate NULL elements; if smaller
      * than the current size, decrement and discard truncated elements.
      */
-    void
+    public void
     Resize(VArray *self, uint32_t size);
 
     /** Empty the VArray.
      */
-    void
+    public void
     Clear(VArray *self);
 
     /** Accessor for <code>size</code> member.
@@ -141,7 +141,7 @@ class Clownfish::VArray cnick VA inherits Clownfish::Obj {
 
     /** Accessor for <code>capacity</code> member.
      */
-    uint32_t
+    public uint32_t
     Get_Capacity(VArray *self);
 
     /** Return all elements for which <code>test</code> returns true.

http://git-wip-us.apache.org/repos/asf/lucy/blob/7e7545ef/core/Clownfish/VTable.cfh
----------------------------------------------------------------------
diff --git a/core/Clownfish/VTable.cfh b/core/Clownfish/VTable.cfh
index 0351082..f87b191 100644
--- a/core/Clownfish/VTable.cfh
+++ b/core/Clownfish/VTable.cfh
@@ -23,7 +23,7 @@ parcel Lucy;
  * behavior of VTables.)
  */
 
-class Clownfish::VTable inherits Clownfish::Obj {
+public class Clownfish::VTable inherits Clownfish::Obj {
 
     VTable            *parent;
     CharBuf           *name;
@@ -98,7 +98,7 @@ class Clownfish::VTable inherits Clownfish::Obj {
      * assign its vtable and give it an initial refcount of 1.  The caller is
      * responsible for initialization.
      */
-    Obj*
+    public Obj*
     Make_Obj(VTable *self);
 
     /** Take a raw memory allocation which is presumed to be of adequate size,
@@ -118,10 +118,10 @@ class Clownfish::VTable inherits Clownfish::Obj {
     Obj*
     Foster_Obj(VTable *self, void *host_obj);
 
-    CharBuf*
+    public CharBuf*
     Get_Name(VTable *self);
 
-    VTable*
+    public VTable*
     Get_Parent(VTable *self);
 
     size_t


Mime
View raw message