Skip to content
Snippets Groups Projects
  1. Oct 06, 2017
  2. Apr 26, 2017
    • Kevin Harwell's avatar
      vector: defaults and indexes · cf3429b9
      Kevin Harwell authored
      Added an pre-defined integer vector declaration. This makes integer vectors
      easier to declare and pass around. Also, added the ability to default a vector
      up to a given size with a default value. Lastly, added functionality that
      returns the "nth" index of a matching value.
      
      Also, updated a unit test to test these changes.
      
      Change-Id: Iaf4b51b2540eda57cb43f67aa59cf1d96cdbcaa5
      cf3429b9
  3. Oct 27, 2016
    • Corey Farrell's avatar
      Remove ASTERISK_REGISTER_FILE. · a6e5bae3
      Corey Farrell authored
      ASTERISK_REGISTER_FILE no longer has any purpose so this commit removes
      all traces of it.
      
      Previously exported symbols removed:
      * __ast_register_file
      * __ast_unregister_file
      * ast_complete_source_filename
      
      This also removes the mtx_prof static variable that was declared when
      MTX_PROFILE was enabled.  This variable was only used in lock.c so it
      is now initialized in that file only.
      
      ASTERISK-26480 #close
      
      Change-Id: I1074af07d71f9e159c48ef36631aa432c86f9966
      a6e5bae3
  4. May 11, 2015
    • George Joseph's avatar
      vector: Add REMOVE, ADD_SORTED and RESET macros · 87d8b367
      George Joseph authored
      Based on feedback from Corey Farrell and Y Ateya, a few new
      macros have been added...
      
      AST_VECTOR_REMOVE which takes a parameter to indicate if
      order should be preserved.
      
      AST_VECTOR_ADD_SORTED which adds an element to
      a sorted vector.
      
      AST_VECTOR_RESET which cleans all elements from the vector
      leaving the storage intact.
      
      Change-Id: I41d32dbdf7137e0557134efeff9f9f1064b58d14
      87d8b367
  5. May 07, 2015
    • George Joseph's avatar
      vector: Additional enhancements and fixes · c886be5d
      George Joseph authored
      After using the new vector stuff for real I found...
      
      A bug in AST_VECTOR_INSERT_AT that could cause a seg fault.
      
      The callbacks needed to be closer to ao2_callback in behavior
      WRT to CMP_MATCH and CMP_STOP behavior and the ability to return
      a vector of matched entries.
      
      A pre-existing issue with APPEND and REPLACE was also fixed.
      
      I also added a new macro to test.h that acts like ast_test_validate
      but also accepts a return code variable and a cleanup label.  As well
      as printing the error, it sets the rc variable to AST_TEST_FAIL and
      does a goto to the specified label on error.  I had a local version
      of this in test_vector so I just moved it.
      
      ASTERISK-25045
      
      Change-Id: I05e5e47fd02f61964be13b7e8942bab5d61b29cc
      c886be5d
  6. May 05, 2015
    • George Joseph's avatar
      vector: Traversal, retrieval, insert and locking enhancements · 6d594129
      George Joseph authored
      Renamed AST_VECTOR_INSERT to AST_VECTOR_REPLACE because it really
      does replace not insert.  The few users of AST_VECTOR_INSERT were
      refactored.  Because these are macros, there should be no ABI
      compatibility issues.
      
      Added AST_VECTOR_INSERT_AT that actually inserts an element into the
      vector at a specific index pushing existing elements to the right.
      
      Added AST_VECTOR_GET_CMP that can retrieve from the vector based
      on a user-provided compare function.
      
      Added AST_VECTOR_CALLBACK function that will execute a function
      for each element in the vector.  Similar to ao2_callback and
      ao2_callback_data functions although the vector callback can take
      a variable number of arguments.  This should allow easy migration
      to a vector where a container might be too heavy.
      
      Added read/write locked vector and lock manipulation macros.
      
      Added unit tests.
      
      ASTERISK-25045 #close
      
      Change-Id: I2e07ecc709d2f5f91bcab8904e5e9340609b00e0
      6d594129
Loading