GDB (API)
Defines | Functions
/home/stan/gdb/src/gdb/common/vec.h File Reference
#include <stddef.h>
#include "gdb_string.h"
#include "gdb_assert.h"

Go to the source code of this file.

Defines

#define VEC_length(T, V)   (VEC_OP(T,length)(V))
#define VEC_empty(T, V)   (VEC_length (T,V) == 0)
#define VEC_last(T, V)   (VEC_OP(T,last)(V VEC_ASSERT_INFO))
#define VEC_index(T, V, I)   (VEC_OP(T,index)(V,I VEC_ASSERT_INFO))
#define VEC_iterate(T, V, I, P)   (VEC_OP(T,iterate)(V,I,&(P)))
#define VEC_alloc(T, N)   (VEC_OP(T,alloc)(N))
#define VEC_free(T, V)   (VEC_OP(T,free)(&V))
#define VEC_cleanup(T)   (VEC_OP(T,cleanup))
#define VEC_embedded_size(T, N)   (VEC_OP(T,embedded_size)(N))
#define VEC_embedded_init(T, O, N)   (VEC_OP(T,embedded_init)(VEC_BASE(O),N))
#define VEC_copy(T, V)   (VEC_OP(T,copy)(V))
#define VEC_merge(T, V1, V2)   (VEC_OP(T,merge)(V1, V2))
#define VEC_space(T, V, R)   (VEC_OP(T,space)(V,R VEC_ASSERT_INFO))
#define VEC_reserve(T, V, R)   (VEC_OP(T,reserve)(&(V),R VEC_ASSERT_INFO))
#define VEC_quick_push(T, V, O)   (VEC_OP(T,quick_push)(V,O VEC_ASSERT_INFO))
#define VEC_safe_push(T, V, O)   (VEC_OP(T,safe_push)(&(V),O VEC_ASSERT_INFO))
#define VEC_pop(T, V)   (VEC_OP(T,pop)(V VEC_ASSERT_INFO))
#define VEC_truncate(T, V, I)   (VEC_OP(T,truncate)(V,I VEC_ASSERT_INFO))
#define VEC_safe_grow(T, V, I)   (VEC_OP(T,safe_grow)(&(V),I VEC_ASSERT_INFO))
#define VEC_replace(T, V, I, O)   (VEC_OP(T,replace)(V,I,O VEC_ASSERT_INFO))
#define VEC_quick_insert(T, V, I, O)   (VEC_OP(T,quick_insert)(V,I,O VEC_ASSERT_INFO))
#define VEC_safe_insert(T, V, I, O)   (VEC_OP(T,safe_insert)(&(V),I,O VEC_ASSERT_INFO))
#define VEC_ordered_remove(T, V, I)   (VEC_OP(T,ordered_remove)(V,I VEC_ASSERT_INFO))
#define VEC_unordered_remove(T, V, I)   (VEC_OP(T,unordered_remove)(V,I VEC_ASSERT_INFO))
#define VEC_block_remove(T, V, I, L)   (VEC_OP(T,block_remove)(V,I,L VEC_ASSERT_INFO))
#define VEC_address(T, V)   (VEC_OP(T,address)(V))
#define VEC_lower_bound(T, V, O, LT)   (VEC_OP(T,lower_bound)(V,O,LT VEC_ASSERT_INFO))
#define vec_free_(V)   xfree (V)
#define VEC_ASSERT_INFO   ,__FILE__,__LINE__
#define VEC_ASSERT_DECL   ,const char *file_,unsigned line_
#define VEC_ASSERT_PASS   ,file_,line_
#define vec_assert(expr, op)
#define VEC(T)   VEC_##T
#define VEC_OP(T, OP)   VEC_##T##_##OP
#define VEC_T(T)
#define DEF_VEC_I(T)
#define DEF_VEC_P(T)
#define DEF_VEC_O(T)
#define DEF_VEC_ALLOC_FUNC_I(T)
#define DEF_VEC_FUNC_P(T)
#define DEF_VEC_ALLOC_FUNC_P(T)
#define DEF_VEC_FUNC_O(T)
#define DEF_VEC_ALLOC_FUNC_O(T)

Functions

void * vec_p_reserve (void *, int)
void * vec_o_reserve (void *, int, size_t, size_t)

Define Documentation

#define DEF_VEC_ALLOC_FUNC_I (   T)

Definition at line 445 of file vec.h.

#define DEF_VEC_ALLOC_FUNC_O (   T)

Definition at line 1002 of file vec.h.

#define DEF_VEC_ALLOC_FUNC_P (   T)

Definition at line 732 of file vec.h.

#define DEF_VEC_FUNC_O (   T)

Definition at line 832 of file vec.h.

#define DEF_VEC_FUNC_P (   T)

Definition at line 549 of file vec.h.

#define DEF_VEC_I (   T)
Value:
static inline void VEC_OP (T,must_be_integral_type) (void)                \
{                                                                         \
  (void)~(T)0;                                                            \
}                                                                         \
									  \
VEC_T(T);                                                                 \
DEF_VEC_FUNC_P(T)                                                         \
DEF_VEC_ALLOC_FUNC_I(T)                                                   \
struct vec_swallow_trailing_semi

Definition at line 415 of file vec.h.

#define DEF_VEC_O (   T)
Value:
VEC_T(T);                                                                 \
DEF_VEC_FUNC_O(T)                                                         \
DEF_VEC_ALLOC_FUNC_O(T)                                                   \
struct vec_swallow_trailing_semi

Definition at line 439 of file vec.h.

#define DEF_VEC_P (   T)
Value:
static inline void VEC_OP (T,must_be_pointer_type) (void)                 \
{                                                                         \
  (void)((T)1 == (void *)1);                                              \
}                                                                         \
									  \
VEC_T(T);                                                                 \
DEF_VEC_FUNC_P(T)                                                         \
DEF_VEC_ALLOC_FUNC_P(T)                                                   \
struct vec_swallow_trailing_semi

Definition at line 427 of file vec.h.

#define VEC (   T)    VEC_##T

Definition at line 403 of file vec.h.

#define VEC_address (   T,
 
)    (VEC_OP(T,address)(V))

Definition at line 374 of file vec.h.

#define VEC_alloc (   T,
 
)    (VEC_OP(T,alloc)(N))

Definition at line 178 of file vec.h.

#define vec_assert (   expr,
  op 
)
Value:
((void)((expr) ? 0 : (gdb_assert_fail (op, file_, line_, \
                                         ASSERT_FUNCTION), 0)))

Definition at line 399 of file vec.h.

#define VEC_ASSERT_DECL   ,const char *file_,unsigned line_

Definition at line 397 of file vec.h.

#define VEC_ASSERT_INFO   ,__FILE__,__LINE__

Definition at line 396 of file vec.h.

#define VEC_ASSERT_PASS   ,file_,line_

Definition at line 398 of file vec.h.

#define VEC_block_remove (   T,
  V,
  I,
  L 
)    (VEC_OP(T,block_remove)(V,I,L VEC_ASSERT_INFO))

Definition at line 365 of file vec.h.

#define VEC_cleanup (   T)    (VEC_OP(T,cleanup))

Definition at line 192 of file vec.h.

#define VEC_copy (   T,
 
)    (VEC_OP(T,copy)(V))

Definition at line 211 of file vec.h.

#define VEC_embedded_init (   T,
  O,
 
)    (VEC_OP(T,embedded_init)(VEC_BASE(O),N))

Definition at line 203 of file vec.h.

#define VEC_embedded_size (   T,
 
)    (VEC_OP(T,embedded_size)(N))

Definition at line 202 of file vec.h.

#define VEC_empty (   T,
 
)    (VEC_length (T,V) == 0)

Definition at line 137 of file vec.h.

#define VEC_free (   T,
 
)    (VEC_OP(T,free)(&V))

Definition at line 185 of file vec.h.

#define vec_free_ (   V)    xfree (V)

Definition at line 394 of file vec.h.

#define VEC_index (   T,
  V,
  I 
)    (VEC_OP(T,index)(V,I VEC_ASSERT_INFO))

Definition at line 156 of file vec.h.

#define VEC_iterate (   T,
  V,
  I,
 
)    (VEC_OP(T,iterate)(V,I,&(P)))

Definition at line 170 of file vec.h.

#define VEC_last (   T,
 
)    (VEC_OP(T,last)(V VEC_ASSERT_INFO))

Definition at line 147 of file vec.h.

#define VEC_length (   T,
 
)    (VEC_OP(T,length)(V))

Definition at line 129 of file vec.h.

#define VEC_lower_bound (   T,
  V,
  O,
  LT 
)    (VEC_OP(T,lower_bound)(V,O,LT VEC_ASSERT_INFO))

Definition at line 388 of file vec.h.

#define VEC_merge (   T,
  V1,
  V2 
)    (VEC_OP(T,merge)(V1, V2))

Definition at line 218 of file vec.h.

#define VEC_OP (   T,
  OP 
)    VEC_##T##_##OP

Definition at line 404 of file vec.h.

#define VEC_ordered_remove (   T,
  V,
  I 
)    (VEC_OP(T,ordered_remove)(V,I VEC_ASSERT_INFO))

Definition at line 344 of file vec.h.

#define VEC_pop (   T,
 
)    (VEC_OP(T,pop)(V VEC_ASSERT_INFO))

Definition at line 275 of file vec.h.

#define VEC_quick_insert (   T,
  V,
  I,
 
)    (VEC_OP(T,quick_insert)(V,I,O VEC_ASSERT_INFO))

Definition at line 319 of file vec.h.

#define VEC_quick_push (   T,
  V,
 
)    (VEC_OP(T,quick_push)(V,O VEC_ASSERT_INFO))

Definition at line 254 of file vec.h.

#define VEC_replace (   T,
  V,
  I,
 
)    (VEC_OP(T,replace)(V,I,O VEC_ASSERT_INFO))

Definition at line 307 of file vec.h.

#define VEC_reserve (   T,
  V,
  R 
)    (VEC_OP(T,reserve)(&(V),R VEC_ASSERT_INFO))

Definition at line 242 of file vec.h.

#define VEC_safe_grow (   T,
  V,
  I 
)    (VEC_OP(T,safe_grow)(&(V),I VEC_ASSERT_INFO))

Definition at line 293 of file vec.h.

#define VEC_safe_insert (   T,
  V,
  I,
 
)    (VEC_OP(T,safe_insert)(&(V),I,O VEC_ASSERT_INFO))

Definition at line 332 of file vec.h.

#define VEC_safe_push (   T,
  V,
 
)    (VEC_OP(T,safe_push)(&(V),O VEC_ASSERT_INFO))

Definition at line 265 of file vec.h.

#define VEC_space (   T,
  V,
  R 
)    (VEC_OP(T,space)(V,R VEC_ASSERT_INFO))

Definition at line 230 of file vec.h.

#define VEC_T (   T)
Value:
typedef struct VEC(T)                                                     \
{                                                                         \
  unsigned num;                                                           \
  unsigned alloc;                                                         \
  T vec[1];                                                               \
} VEC(T)

Definition at line 406 of file vec.h.

#define VEC_truncate (   T,
  V,
  I 
)    (VEC_OP(T,truncate)(V,I VEC_ASSERT_INFO))

Definition at line 283 of file vec.h.

#define VEC_unordered_remove (   T,
  V,
  I 
)    (VEC_OP(T,unordered_remove)(V,I VEC_ASSERT_INFO))

Definition at line 356 of file vec.h.


Function Documentation

void* vec_o_reserve ( void *  ,
int  ,
size_t  ,
size_t   
)

Definition at line 96 of file vec.c.

void* vec_p_reserve ( void *  ,
int   
)

Definition at line 85 of file vec.c.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines