Changes between Version 3 and Version 4 of DataStructures


Ignore:
Timestamp:
07/03/14 13:50:26 (12 years ago)
Author:
siegel
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DataStructures

    v3 v4  
    2020$seq $seq_empty($type type);
    2121
     22/* Returns the sequence formed by reading n consecutive elements
     23 * from memory.  The parameter ptr points to the first such element,
     24 * and type is the type of each element.
     25 */
     26$seq $seq_from_array($type type, void * ptr, int n);
     27
    2228/* Returns the type of an element that goes in this seq */
    23 $type $seq_element_type($seq v);
     29$type $seq_element_type($seq seq);
    2430
    2531/* Returns the seq that is like the given one but with one more
    2632 * element added.  A runtime exception is generated if the thing pointed
    27  * to by eltptr doesn't have the right type for v. */
    28 $seq $seq_add($seq v, void * eltptr);
     33 * to by eltptr doesn't have the right type for the seq. */
     34$seq $seq_add($seq seq, void * eltptr);
    2935
    3036/* Returns the seq that is like the given one but with the element
    3137 * at position index removed and the subsequent elements shifted down */
    32 $seq $seq_remove($seq v, int index);
     38$seq $seq_remove($seq seq, int index);
    3339
    3440/* Returns the seq that is like the given one but with the element
    3541 * at position index replaced with whatever object is pointed to by
    3642 * ptr. */
    37 $seq $seq_set($seq v, int index, void * ptr);
     43$seq $seq_set($seq seq, int index, void * ptr);
    3844
    3945/* Returns the length of the seq (i.e., the number of elements) */
    40 int $seq_length($seq v);
     46int $seq_length($seq seq);
    4147
    4248/* Returns the seq that is like the given one but with an element
    4349 * inserted at position i (and the subsequent elements shifted up).
    4450 * The parameter eltptr is a pointer to the element to insert. */
    45 $seq $seq_insert($seq v, int index, void * eltptr);
     51$seq $seq_insert($seq seq, int index, void * eltptr);
    4652
    4753/* Gets the element at position index and stores it in wherever
    4854 * ptr points to. */
    49 void $seq_get($seq v, int index, void * ptr);
     55void $seq_get($seq seq, int index, void * ptr);
    5056
    51 /* Returns the subsequence */
    52 $seq $seq_sub($seq v, int start, int stop);
     57/* Returns the subsequence consisting of elements at index i, for
     58 * start<=i<stop. */
     59$seq $seq_subseq($seq seq, int start, int stop);
    5360
    5461/* Returns the concatenation of the two sequences */
    5562$seq $seq_concat($seq s1, $seq s2);
    56 
    5763}}}
    5864
     
    7177
    7278/* Returns the type of an element that goes in this set */
    73 $type $set_element_type($set v);
     79$type $set_element_type($set set);
    7480
    7581/* Returns the set that is like the given one but with one more
    7682 * element added.  A runtime exception is generated if the thing pointed
    7783 * to by eltptr doesn't have the right type for s. */
    78 $set $set_add($set v, void * eltptr);
     84$set $set_add($set set, void * eltptr);
    7985
    8086/* Returns the set that is like the given one but with the specified element
    8187 * removed.  If the set does not contain the element the set returned
    8288 * will equal the given one. */
    83 $set $set_remove($set s, void * eltptr);
     89$set $set_remove($set set, void * eltptr);
    8490
    8591/* Does the set contain the specified element? */
    86 _Bool $set_contains($set s, void * eltptr);
     92_Bool $set_contains($set set, void * eltptr);
    8793
    8894$set $set_union($set s1, $set s2);
     
    97103
    98104// need a way to iterate over elements of a set.
     105// should set be ordered?
     106// used in $for loop ?
    99107
    100108}}}
     
    113121
    114122$map $map_removeKey($map map, void * keyPtr);
     123
     124// need a way to get the Keys, at least
    115125}}}
    116126