lib/talloc/talloc.h

ソースコードを見る。

型定義

typedef void TALLOC_CTX

関数

void * _talloc (const void *context, size_t size)
void _talloc_set_destructor (const void *ptr, int(*destructor)(void *))
int talloc_increase_ref_count (const void *ptr)
size_t talloc_reference_count (const void *ptr)
void * _talloc_reference (const void *context, const void *ptr)
int talloc_unlink (const void *context, void *ptr)
const char * talloc_set_name (const void *ptr, const char *fmt,...) PRINTF_ATTRIBUTE(2
const char *void talloc_set_name_const (const void *ptr, const char *name)
void * talloc_named (const void *context, size_t size, const char *fmt,...) PRINTF_ATTRIBUTE(3
void *void * talloc_named_const (const void *context, size_t size, const char *name)
const char * talloc_get_name (const void *ptr)
void * talloc_check_name (const void *ptr, const char *name)
void * talloc_parent (const void *ptr)
const char * talloc_parent_name (const void *ptr)
void * talloc_init (const char *fmt,...) PRINTF_ATTRIBUTE(1
void *int talloc_free (void *ptr)
void talloc_free_children (void *ptr)
void * _talloc_realloc (const void *context, void *ptr, size_t size, const char *name)
void * _talloc_steal (const void *new_ctx, const void *ptr)
void * _talloc_move (const void *new_ctx, const void *pptr)
size_t talloc_total_size (const void *ptr)
size_t talloc_total_blocks (const void *ptr)
void talloc_report_depth_cb (const void *ptr, int depth, int max_depth, void(*callback)(const void *ptr, int depth, int max_depth, int is_ref, void *private_data), void *private_data)
void talloc_report_depth_file (const void *ptr, int depth, int max_depth, FILE *f)
void talloc_report_full (const void *ptr, FILE *f)
void talloc_report (const void *ptr, FILE *f)
void talloc_enable_null_tracking (void)
void talloc_disable_null_tracking (void)
void talloc_enable_leak_report (void)
void talloc_enable_leak_report_full (void)
void * _talloc_zero (const void *ctx, size_t size, const char *name)
void * _talloc_memdup (const void *t, const void *p, size_t size, const char *name)
char * talloc_strdup (const void *t, const char *p)
char * talloc_strndup (const void *t, const char *p, size_t n)
char * talloc_append_string (const void *t, char *orig, const char *append)
char * talloc_vasprintf (const void *t, const char *fmt, va_list ap) PRINTF_ATTRIBUTE(2
char *char * talloc_vasprintf_append (char *s, const char *fmt, va_list ap) PRINTF_ATTRIBUTE(2
char *char *char * talloc_asprintf (const void *t, const char *fmt,...) PRINTF_ATTRIBUTE(2
char *char *char *char * talloc_asprintf_append (char *s, const char *fmt,...) PRINTF_ATTRIBUTE(2
char *char *char *char *void * _talloc_array (const void *ctx, size_t el_size, unsigned count, const char *name)
void * _talloc_zero_array (const void *ctx, size_t el_size, unsigned count, const char *name)
void * _talloc_realloc_array (const void *ctx, void *ptr, size_t el_size, unsigned count, const char *name)
void * talloc_realloc_fn (const void *context, void *ptr, size_t size)
void * talloc_autofree_context (void)
size_t talloc_get_size (const void *ctx)
void * talloc_find_parent_byname (const void *ctx, const char *name)
void talloc_show_parents (const void *context, FILE *file)
int talloc_is_parent (const void *context, const void *ptr)


型定義

typedef void TALLOC_CTX

talloc.h30 行で定義されています。


関数

void* _talloc ( const void *  context,
size_t  size 
)

talloc.c717 行で定義されています。

参照先 __talloc().

参照元 lsa_lookup_names()lsa_lookup_sids()py_to_ACL()py_to_PRINTER_INFO_2()to_dependentfiles().

00718 {
00719         return __talloc(context, size);
00720 }

void _talloc_set_destructor ( const void *  ptr,
int(*)(void *)  destructor 
)

talloc.c245 行で定義されています。

参照先 talloc_chunk::destructortalloc_chunk_from_ptr().

00246 {
00247         struct talloc_chunk *tc = talloc_chunk_from_ptr(ptr);
00248         tc->destructor = destructor;
00249 }

int talloc_increase_ref_count ( const void *  ptr  ) 

talloc.c254 行で定義されています。

参照先 null_context.

参照元 test_misc()test_realloc().

00255 {
00256         if (unlikely(!talloc_reference(null_context, ptr))) {
00257                 return -1;
00258         }
00259         return 0;
00260 }

size_t talloc_reference_count ( const void *  ptr  ) 

talloc.c897 行で定義されています。

参照先 talloc_reference_handle::nexttalloc_chunk::refstalloc_chunk_from_ptr().

参照元 msg_pool_usage_helper()talloc_report_depth_FILE_helper().

00898 {
00899         struct talloc_chunk *tc = talloc_chunk_from_ptr(ptr);
00900         struct talloc_reference_handle *h;
00901         size_t ret = 0;
00902 
00903         for (h=tc->refs;h;h=h->next) {
00904                 ret++;
00905         }
00906         return ret;
00907 }

void* _talloc_reference ( const void *  context,
const void *  ptr 
)

talloc.c310 行で定義されています。

参照先 _talloc_named_const()handletalloc_chunk::refstalloc_chunk_from_ptr()talloc_reference_destructor().

00311 {
00312         struct talloc_chunk *tc;
00313         struct talloc_reference_handle *handle;
00314         if (unlikely(ptr == NULL)) return NULL;
00315 
00316         tc = talloc_chunk_from_ptr(ptr);
00317         handle = (struct talloc_reference_handle *)_talloc_named_const(context,
00318                                                    sizeof(struct talloc_reference_handle),
00319                                                    TALLOC_MAGIC_REFERENCE);
00320         if (unlikely(handle == NULL)) return NULL;
00321 
00322         /* note that we hang the destructor off the handle, not the
00323            main context as that allows the caller to still setup their
00324            own destructor on the context if they want to */
00325         talloc_set_destructor(handle, talloc_reference_destructor);
00326         handle->ptr = discard_const_p(void, ptr);
00327         _TLIST_ADD(tc->refs, handle);
00328         return handle->ptr;
00329 }

int talloc_unlink ( const void *  context,
void *  ptr 
)

talloc.c510 行で定義されています。

参照先 _talloc_free()null_contexttalloc_chunk::refstalloc_chunk_from_ptr()talloc_parent_chunk()talloc_unreference().

参照元 test_lifeless()test_misc()test_unlink1()test_unref_reparent().

00511 {
00512         struct talloc_chunk *tc_p, *new_p;
00513         void *new_parent;
00514 
00515         if (ptr == NULL) {
00516                 return -1;
00517         }
00518 
00519         if (context == NULL) {
00520                 context = null_context;
00521         }
00522 
00523         if (talloc_unreference(context, ptr) == 0) {
00524                 return 0;
00525         }
00526 
00527         if (context == NULL) {
00528                 if (talloc_parent_chunk(ptr) != NULL) {
00529                         return -1;
00530                 }
00531         } else {
00532                 if (talloc_chunk_from_ptr(context) != talloc_parent_chunk(ptr)) {
00533                         return -1;
00534                 }
00535         }
00536         
00537         tc_p = talloc_chunk_from_ptr(ptr);
00538 
00539         if (tc_p->refs == NULL) {
00540                 return _talloc_free(ptr);
00541         }
00542 
00543         new_p = talloc_parent_chunk(tc_p->refs);
00544         if (new_p) {
00545                 new_parent = TC_PTR_FROM_CHUNK(new_p);
00546         } else {
00547                 new_parent = NULL;
00548         }
00549 
00550         if (talloc_unreference(new_parent, ptr) != 0) {
00551                 return -1;
00552         }
00553 
00554         talloc_steal(new_parent, ptr);
00555 
00556         return 0;
00557 }

const char* talloc_set_name ( const void *  ptr,
const char *  fmt,
  ... 
)

const char* void talloc_set_name_const ( const void *  ptr,
const char *  name 
)

talloc.c725 行で定義されています。

参照先 _talloc_set_name_const().

参照元 test_misc().

00726 {
00727         _talloc_set_name_const(ptr, name);
00728 }

void* talloc_named ( const void *  context,
size_t  size,
const char *  fmt,
  ... 
)

void* void* talloc_named_const ( const void *  context,
size_t  size,
const char *  name 
)

talloc.c735 行で定義されています。

参照先 _talloc_named_const().

参照元 _talloc_array_zeronull()_talloc_memdup_zeronull()_talloc_zero_zeronull()idmap_backends_sids_to_unixids()idmap_backends_unixids_to_sids()idmap_init_cache()idmap_set_mapping()idmap_sids_to_unixids()idmap_unixids_to_sids()talloc_zeronull()test_misc()test_ref1()test_ref2()test_ref3()test_ref4()test_unlink1()test_unref_reparent().

00736 {
00737         return _talloc_named_const(context, size, name);
00738 }

const char* talloc_get_name ( const void *  ptr  ) 

talloc.c617 行で定義されています。

参照先 talloc_chunk::nametalloc_chunk_from_ptr().

参照元 msg_pool_usage_helper()talloc_check_name()talloc_check_name_abort()talloc_report_depth_FILE_helper()talloc_show_parents()test_misc()test_talloc_ptrtype().

00618 {
00619         struct talloc_chunk *tc = talloc_chunk_from_ptr(ptr);
00620         if (unlikely(tc->name == TALLOC_MAGIC_REFERENCE)) {
00621                 return ".reference";
00622         }
00623         if (likely(tc->name)) {
00624                 return tc->name;
00625         }
00626         return "UNNAMED";
00627 }

void* talloc_check_name ( const void *  ptr,
const char *  name 
)

talloc.c634 行で定義されています。

参照先 talloc_get_name().

参照元 talloc_check_name_abort().

00635 {
00636         const char *pname;
00637         if (unlikely(ptr == NULL)) return NULL;
00638         pname = talloc_get_name(ptr);
00639         if (likely(pname == name || strcmp(pname, name) == 0)) {
00640                 return discard_const_p(void, ptr);
00641         }
00642         return NULL;
00643 }

void* talloc_parent ( const void *  ptr  ) 

talloc.c179 行で定義されています。

参照先 talloc_parent_chunk().

参照元 append_parent_acl().

00180 {
00181         struct talloc_chunk *tc = talloc_parent_chunk(ptr);
00182         return tc? TC_PTR_FROM_CHUNK(tc) : NULL;
00183 }

const char* talloc_parent_name ( const void *  ptr  ) 

talloc.c188 行で定義されています。

参照先 talloc_chunk::nametalloc_parent_chunk().

00189 {
00190         struct talloc_chunk *tc = talloc_parent_chunk(ptr);
00191         return tc? tc->name : NULL;
00192 }

void* talloc_init ( const char *  fmt,
  ... 
)

void* int talloc_free ( void *  ptr  ) 

talloc.c748 行で定義されています。

参照先 _talloc_free().

参照元 _lsa_enum_accounts()api_wkssvc_NetrAddAlternateComputerName()api_WKSSVC_NETRENUMERATECOMPUTERNAMES()api_WKSSVC_NETRGETJOINABLEOUS()api_WKSSVC_NETRGETJOINABLEOUS2()api_WKSSVC_NETRGETJOININFORMATION()api_WKSSVC_NETRJOINDOMAIN()api_wkssvc_NetrJoinDomain2()api_WKSSVC_NETRLOGONDOMAINNAMEADD()api_WKSSVC_NETRLOGONDOMAINNAMEDEL()api_WKSSVC_NETRMESSAGEBUFFERSEND()api_wkssvc_NetrRemoveAlternateComputerName()api_WKSSVC_NETRRENAMEMACHINEINDOMAIN()api_wkssvc_NetrRenameMachineInDomain2()api_WKSSVC_NETRSETPRIMARYCOMPUTERNAME()api_WKSSVC_NETRUNJOINDOMAIN()api_wkssvc_NetrUnjoinDomain2()api_WKSSVC_NETRUSEADD()api_WKSSVC_NETRUSEDEL()api_WKSSVC_NETRUSEENUM()api_WKSSVC_NETRUSEGETINFO()api_WKSSVC_NETRVALIDATENAME()api_WKSSVC_NETRVALIDATENAME2()api_WKSSVC_NETRWKSTATRANSPORTADD()api_WKSSVC_NETRWKSTATRANSPORTDEL()api_WKSSVC_NETRWKSTAUSERGETINFO()api_WKSSVC_NETRWKSTAUSERSETINFO()api_WKSSVC_NETRWORKSTATIONSTATISTICSGET()api_wkssvc_NetWkstaEnumUsers()api_wkssvc_NetWkstaGetInfo()api_wkssvc_NetWkstaSetInfo()api_wkssvc_NetWkstaTransportEnum()cli_do_rpc_ndr()fetch_group_mem_info()GUID_string2()idmap_ad_initialize()idmap_ad_sids_to_unixids()idmap_backends_sids_to_unixids()idmap_cache_del()idmap_cache_map_id()idmap_cache_map_sid()idmap_cache_set()idmap_cache_set_negative_id()idmap_cache_set_negative_sid()idmap_cache_shutdown()idmap_init()idmap_ldap_allocate_id()idmap_ldap_close()idmap_ldap_db_init()idmap_ldap_get_hwm()idmap_ldap_set_hwm()idmap_ldap_set_mapping()idmap_ldap_sids_to_unixids()idmap_ldap_unixids_to_sids()idmap_nss_sids_to_unixids()idmap_rid_initialize()idmap_rid_sids_to_unixids()idmap_rid_unixids_to_sids()idmap_set_mapping()idmap_sids_to_unixids()idmap_tdb_alloc_init()idmap_tdb_db_init()idmap_tdb_dump_data()idmap_tdb_id_to_sid()idmap_tdb_open_db()idmap_tdb_remove_mapping()idmap_tdb_set_mapping()idmap_tdb_sid_to_id()idmap_tdb_upgrade()idmap_unixids_to_sids()inotify_handler()inotify_setup()ndr_push_free()ndr_push_string()net_idmap_restore()net_idmap_secret()net_sam_provision()notify_add()notify_handler()notify_init()notify_load()notify_remove()notify_save()notify_send()rids_to_names()talloc_attrs()test_autofree()test_free_parent_deny_child()test_lifeless()test_loop()test_misc()test_move()test_realloc()test_realloc_child()test_realloc_fn()test_ref1()test_ref2()test_ref3()test_ref4()test_speed()test_steal()test_talloc_ptrtype()test_type()test_unlink1()test_unref_reparent()verify_idpool()winbindd_dual_sids2xids().

00749 {
00750         return _talloc_free(ptr);
00751 }

void talloc_free_children ( void *  ptr  ) 

talloc.c682 行で定義されています。

参照先 _talloc_free()talloc_chunk::childnull_contexttalloc_chunk::refstalloc_chunk_from_ptr()talloc_parent_chunk().

参照元 ads_process_results()free_pipe_context()print_notify_send_messages()print_notify_send_messages_to_printer().

00683 {
00684         struct talloc_chunk *tc;
00685 
00686         if (unlikely(ptr == NULL)) {
00687                 return;
00688         }
00689 
00690         tc = talloc_chunk_from_ptr(ptr);
00691 
00692         while (tc->child) {
00693                 /* we need to work out who will own an abandoned child
00694                    if it cannot be freed. In priority order, the first
00695                    choice is owner of any remaining reference to this
00696                    pointer, the second choice is our parent, and the
00697                    final choice is the null context. */
00698                 void *child = TC_PTR_FROM_CHUNK(tc->child);
00699                 const void *new_parent = null_context;
00700                 if (unlikely(tc->child->refs)) {
00701                         struct talloc_chunk *p = talloc_parent_chunk(tc->child->refs);
00702                         if (p) new_parent = TC_PTR_FROM_CHUNK(p);
00703                 }
00704                 if (unlikely(_talloc_free(child) == -1)) {
00705                         if (new_parent == null_context) {
00706                                 struct talloc_chunk *p = talloc_parent_chunk(ptr);
00707                                 if (p) new_parent = TC_PTR_FROM_CHUNK(p);
00708                         }
00709                         talloc_steal(new_parent, child);
00710                 }
00711         }
00712 }

void* _talloc_realloc ( const void *  context,
void *  ptr,
size_t  size,
const char *  name 
)

talloc.c759 行で定義されています。

参照先 _talloc_free()_talloc_named_const()_talloc_set_name_const()talloc_chunk::childtalloc_chunk::flagstalloc_chunk::nexttalloc_chunk::parenttalloc_chunk::prevtalloc_chunk::refstalloc_chunk::sizetalloc_chunk_from_ptr().

参照元 _talloc_realloc_array()talloc_realloc_fn().

00760 {
00761         struct talloc_chunk *tc;
00762         void *new_ptr;
00763 
00764         /* size zero is equivalent to free() */
00765         if (unlikely(size == 0)) {
00766                 _talloc_free(ptr);
00767                 return NULL;
00768         }
00769 
00770         if (unlikely(size >= MAX_TALLOC_SIZE)) {
00771                 return NULL;
00772         }
00773 
00774         /* realloc(NULL) is equivalent to malloc() */
00775         if (ptr == NULL) {
00776                 return _talloc_named_const(context, size, name);
00777         }
00778 
00779         tc = talloc_chunk_from_ptr(ptr);
00780 
00781         /* don't allow realloc on referenced pointers */
00782         if (unlikely(tc->refs)) {
00783                 return NULL;
00784         }
00785 
00786         /* by resetting magic we catch users of the old memory */
00787         tc->flags |= TALLOC_FLAG_FREE;
00788 
00789 #if ALWAYS_REALLOC
00790         new_ptr = malloc(size + TC_HDR_SIZE);
00791         if (new_ptr) {
00792                 memcpy(new_ptr, tc, tc->size + TC_HDR_SIZE);
00793                 free(tc);
00794         }
00795 #else
00796         new_ptr = realloc(tc, size + TC_HDR_SIZE);
00797 #endif
00798         if (unlikely(!new_ptr)) {       
00799                 tc->flags &= ~TALLOC_FLAG_FREE; 
00800                 return NULL; 
00801         }
00802 
00803         tc = (struct talloc_chunk *)new_ptr;
00804         tc->flags &= ~TALLOC_FLAG_FREE; 
00805         if (tc->parent) {
00806                 tc->parent->child = tc;
00807         }
00808         if (tc->child) {
00809                 tc->child->parent = tc;
00810         }
00811 
00812         if (tc->prev) {
00813                 tc->prev->next = tc;
00814         }
00815         if (tc->next) {
00816                 tc->next->prev = tc;
00817         }
00818 
00819         tc->size = size;
00820         _talloc_set_name_const(TC_PTR_FROM_CHUNK(tc), name);
00821 
00822         return TC_PTR_FROM_CHUNK(tc);
00823 }

void* _talloc_steal ( const void *  new_ctx,
const void *  ptr 
)

talloc.c423 行で定義されています。

参照先 talloc_chunk::childtalloc_chunk::nextnull_contexttalloc_chunk::parenttalloc_chunk::prevtalloc_chunk_from_ptr().

参照元 _talloc_move().

00424 {
00425         struct talloc_chunk *tc, *new_tc;
00426 
00427         if (unlikely(!ptr)) {
00428                 return NULL;
00429         }
00430 
00431         if (unlikely(new_ctx == NULL)) {
00432                 new_ctx = null_context;
00433         }
00434 
00435         tc = talloc_chunk_from_ptr(ptr);
00436 
00437         if (unlikely(new_ctx == NULL)) {
00438                 if (tc->parent) {
00439                         _TLIST_REMOVE(tc->parent->child, tc);
00440                         if (tc->parent->child) {
00441                                 tc->parent->child->parent = tc->parent;
00442                         }
00443                 } else {
00444                         if (tc->prev) tc->prev->next = tc->next;
00445                         if (tc->next) tc->next->prev = tc->prev;
00446                 }
00447                 
00448                 tc->parent = tc->next = tc->prev = NULL;
00449                 return discard_const_p(void, ptr);
00450         }
00451 
00452         new_tc = talloc_chunk_from_ptr(new_ctx);
00453 
00454         if (unlikely(tc == new_tc || tc->parent == new_tc)) {
00455                 return discard_const_p(void, ptr);
00456         }
00457 
00458         if (tc->parent) {
00459                 _TLIST_REMOVE(tc->parent->child, tc);
00460                 if (tc->parent->child) {
00461                         tc->parent->child->parent = tc->parent;
00462                 }
00463         } else {
00464                 if (tc->prev) tc->prev->next = tc->next;
00465                 if (tc->next) tc->next->prev = tc->prev;
00466         }
00467 
00468         tc->parent = new_tc;
00469         if (new_tc->child) new_tc->child->parent = NULL;
00470         _TLIST_ADD(new_tc->child, tc);
00471 
00472         return discard_const_p(void, ptr);
00473 }

void* _talloc_move ( const void *  new_ctx,
const void *  pptr 
)

talloc.c829 行で定義されています。

参照先 _talloc_steal().

00830 {
00831         const void **pptr = discard_const_p(const void *,_pptr);
00832         void *ret = _talloc_steal(new_ctx, *pptr);
00833         (*pptr) = NULL;
00834         return ret;
00835 }

size_t talloc_total_size ( const void *  ptr  ) 

talloc.c840 行で定義されています。

参照先 ctalloc_chunk::childtalloc_chunk::flagsnull_contexttalloc_chunk::sizetalloc_chunk_from_ptr()talloc_total_size()total.

参照元 free_pipe_context()msg_pool_usage_helper()talloc_report_depth_FILE_helper()talloc_report_null()talloc_report_null_full()talloc_total_size().

00841 {
00842         size_t total = 0;
00843         struct talloc_chunk *c, *tc;
00844 
00845         if (ptr == NULL) {
00846                 ptr = null_context;
00847         }
00848         if (ptr == NULL) {
00849                 return 0;
00850         }
00851 
00852         tc = talloc_chunk_from_ptr(ptr);
00853 
00854         if (tc->flags & TALLOC_FLAG_LOOP) {
00855                 return 0;
00856         }
00857 
00858         tc->flags |= TALLOC_FLAG_LOOP;
00859 
00860         total = tc->size;
00861         for (c=tc->child;c;c=c->next) {
00862                 total += talloc_total_size(TC_PTR_FROM_CHUNK(c));
00863         }
00864 
00865         tc->flags &= ~TALLOC_FLAG_LOOP;
00866 
00867         return total;
00868 }

size_t talloc_total_blocks ( const void *  ptr  ) 

talloc.c873 行で定義されています。

参照先 ctalloc_chunk::childtalloc_chunk::flagstalloc_chunk_from_ptr()talloc_total_blocks()total.

参照元 msg_pool_usage_helper()talloc_report_depth_FILE_helper()talloc_total_blocks().

00874 {
00875         size_t total = 0;
00876         struct talloc_chunk *c, *tc = talloc_chunk_from_ptr(ptr);
00877 
00878         if (tc->flags & TALLOC_FLAG_LOOP) {
00879                 return 0;
00880         }
00881 
00882         tc->flags |= TALLOC_FLAG_LOOP;
00883 
00884         total++;
00885         for (c=tc->child;c;c=c->next) {
00886                 total += talloc_total_blocks(TC_PTR_FROM_CHUNK(c));
00887         }
00888 
00889         tc->flags &= ~TALLOC_FLAG_LOOP;
00890 
00891         return total;
00892 }

void talloc_report_depth_cb ( const void *  ptr,
int  depth,
int  max_depth,
void(*)(const void *ptr, int depth, int max_depth, int is_ref, void *private_data)  callback,
void *  private_data 
)

talloc.c912 行で定義されています。

参照先 ccallback()talloc_chunk::childtalloc_chunk::flagsnull_contexttalloc_reference_handle::ptrtalloc_chunk_from_ptr()talloc_report_depth_cb().

参照元 msg_pool_usage()talloc_report_depth_cb()talloc_report_depth_file().

00918 {
00919         struct talloc_chunk *c, *tc;
00920 
00921         if (ptr == NULL) {
00922                 ptr = null_context;
00923         }
00924         if (ptr == NULL) return;
00925 
00926         tc = talloc_chunk_from_ptr(ptr);
00927 
00928         if (tc->flags & TALLOC_FLAG_LOOP) {
00929                 return;
00930         }
00931 
00932         callback(ptr, depth, max_depth, 0, private_data);
00933 
00934         if (max_depth >= 0 && depth >= max_depth) {
00935                 return;
00936         }
00937 
00938         tc->flags |= TALLOC_FLAG_LOOP;
00939         for (c=tc->child;c;c=c->next) {
00940                 if (c->name == TALLOC_MAGIC_REFERENCE) {
00941                         struct talloc_reference_handle *h = (struct talloc_reference_handle *)TC_PTR_FROM_CHUNK(c);
00942                         callback(h->ptr, depth + 1, max_depth, 1, private_data);
00943                 } else {
00944                         talloc_report_depth_cb(TC_PTR_FROM_CHUNK(c), depth + 1, max_depth, callback, private_data);
00945                 }
00946         }
00947         tc->flags &= ~TALLOC_FLAG_LOOP;
00948 }

void talloc_report_depth_file ( const void *  ptr,
int  depth,
int  max_depth,
FILE *  f 
)

talloc.c996 行で定義されています。

参照先 talloc_report_depth_cb()talloc_report_depth_FILE_helper().

参照元 talloc_report()talloc_report_full().

00997 {
00998         talloc_report_depth_cb(ptr, depth, max_depth, talloc_report_depth_FILE_helper, f);
00999         fflush(f);
01000 }

void talloc_report_full ( const void *  ptr,
FILE *  f 
)

talloc.c1005 行で定義されています。

参照先 talloc_report_depth_file().

参照元 rpc_registry_dump()talloc_report_null_full()test_lifeless()test_loop()test_misc()test_ref1()test_ref2()test_ref3()test_ref4()test_steal()test_unlink1().

01006 {
01007         talloc_report_depth_file(ptr, 0, -1, f);
01008 }

void talloc_report ( const void *  ptr,
FILE *  f 
)

talloc.c1013 行で定義されています。

参照先 talloc_report_depth_file().

参照元 talloc_report_null()test_misc().

01014 {
01015         talloc_report_depth_file(ptr, 0, 1, f);
01016 }

void talloc_enable_null_tracking ( void   ) 

talloc.c1041 行で定義されています。

参照先 _talloc_named_const()null_context.

参照元 main()talloc_enable_leak_report()talloc_enable_leak_report_full()talloc_init().

01042 {
01043         if (null_context == NULL) {
01044                 null_context = _talloc_named_const(NULL, 0, "null_context");
01045         }
01046 }

void talloc_disable_null_tracking ( void   ) 

talloc.c1051 行で定義されています。

参照先 _talloc_free()null_context.

参照元 gfree_all()main().

01052 {
01053         _talloc_free(null_context);
01054         null_context = NULL;
01055 }

void talloc_enable_leak_report ( void   ) 

talloc.c1060 行で定義されています。

参照先 talloc_enable_null_tracking()talloc_report_null().

参照元 main()net_ads_dns_gethostbyname()net_ads_dns_register()test_misc().

01061 {
01062         talloc_enable_null_tracking();
01063         atexit(talloc_report_null);
01064 }

void talloc_enable_leak_report_full ( void   ) 

talloc.c1069 行で定義されています。

参照先 talloc_enable_null_tracking()talloc_report_null_full().

参照元 test_misc().

01070 {
01071         talloc_enable_null_tracking();
01072         atexit(talloc_report_null_full);
01073 }

void* _talloc_zero ( const void *  ctx,
size_t  size,
const char *  name 
)

talloc.c1078 行で定義されています。

参照先 _talloc_named_const().

参照元 _talloc_zero_array()_talloc_zero_array_zeronull().

01079 {
01080         void *p = _talloc_named_const(ctx, size, name);
01081 
01082         if (p) {
01083                 memset(p, '\0', size);
01084         }
01085 
01086         return p;
01087 }

void* _talloc_memdup ( const void *  t,
const void *  p,
size_t  size,
const char *  name 
)

talloc.c1092 行で定義されています。

参照先 _talloc_named_const().

01093 {
01094         void *newp = _talloc_named_const(t, size, name);
01095 
01096         if (likely(newp)) {
01097                 memcpy(newp, p, size);
01098         }
01099 
01100         return newp;
01101 }

char* talloc_strdup ( const void *  t,
const char *  p 
)

talloc.c1106 行で定義されています。

参照先 _talloc_set_name_const().

参照元 add_ccache_to_list()add_new_printer_key()add_string_to_array()ads_check_posix_schema_mapping()ads_dns_parse_query()ads_dns_parse_rr()ads_dns_parse_rr_ns()ads_dns_parse_rr_srv()ads_gpo_explode_filesyspath()ads_gpo_get_sysvol_gpt_version()ads_gpo_prepare_local_store()ads_modlist_add()ads_parse_gplink()ads_parse_gpo()ads_schema_path()ads_site_dn()ads_site_dn_for_machine()append_attr()atalk_build_paths()audit_policy_str()cac_LsaGetSidsFromNames()cac_MakeDomainInfo()cac_RegEnumKeys()cac_RegEnumValues()cac_RegQueryKeyInfo()cac_SamEnumAliases()cac_SamEnumGroups()cac_SamGetNamesFromRids()cac_SamGetRidsFromNames()cac_Shutdown()cac_SvcGetDisplayName()cli_get_ea_list()cli_get_server_name()clone_afs_ace()cmd_spoolss_addprinterdriver()copy_serverinfo()create_local_private_krb5_conf_for_domain()create_open_service_handle()create_token_from_username()create_vk_record()create_wks_info_100()dns_negotiate_sec_ctx()dom_sid_string()elog_open()fam_watch()fetch_database_to_ldif()fetch_group_mem_info()fill_displayentry()fill_sam_account()find_forced_group()generate_krb5_ccache()get_attr_list()get_credentials()get_share_list()get_share_mode_lock()getpwsid_queryuser_recv()gpo_sync_func()idmap_init()idmap_ldap_alloc_init()idmap_ldap_db_init()idmap_ldap_set_mapping()idmap_rid_initialize()idmap_tdb_open_db()init_service_op_table()inotify_watch()LabelList()ldapsam_create_dom_group()ldapsam_create_user()ldapsam_get_seq_num()ldapsam_lookup_rids()ldapsam_search_grouptype()ldapsam_search_users()log_nt_token()lookup_as_domain()lookup_builtin_rid()lookup_global_sam_rid()lookup_groupmem()lookup_name()lookup_name_smbconf()lookup_rids()lookup_sid()lookup_sids()lookup_useraliases()lookup_wellknown_name()lookup_wellknown_sid()lp_string()lsa_lookup_names()make_pipe_rec_key()make_server_info_info3()make_server_info_pw()make_server_info_sam()ndr_pull_charset()ndr_pull_string()net_ads_join()net_idmap_secret()net_rpc_lookup_name()net_sam_provision()net_set_machine_spn()net_set_machine_upn()net_set_os_attributes()net_sh_process()net_usershare_add()new_afs_ace()notify_filter_string()notify_fsp()nss_init()nss_template_get_info()ntlmssp_client_challenge()ntlmssp_set_domain()ntlmssp_set_username()ntlmssp_set_workstation()parent_dirname_talloc()parse_domain_user_talloc()parse_gpt_ini()parse_share_modes()pathtree_birth_child()pdb_default_add_groupmem()pdb_default_del_groupmem()pdb_default_delete_dom_group()pdb_init_ldapsam()pdb_init_ldapsam_common()pdb_init_ldapsam_compat()pdb_set_acct_desc()pdb_set_comment()pdb_set_dir_drive()pdb_set_domain()pdb_set_fullname()pdb_set_homedir()pdb_set_logon_script()pdb_set_munged_dial()pdb_set_nt_username()pdb_set_plaintext_pw_only()pdb_set_profile_path()pdb_set_username()pdb_set_workstations()procid_str()pull_domain_controller_info_from_getdcname_reply()query_user_list()read_init_file()regfio_write_key()regkey_open_internal()regsubkey_ctr_addkey()regval_convert_multi_sz()rename_share_filename()rids_to_names()rpc_share_add_internals()rpc_trustdom_list()rpc_trustdom_vampire()rpccli_lsa_enum_account_rights()rpccli_lsa_enum_privilege()rpccli_lsa_enum_trust_dom()rpccli_lsa_lookup_sids()rpccli_samr_enum_dom_users()rpccli_samr_lookup_rids()rpcstr_pull_unistr2_talloc()sam_account_ok()sam_query_user()sam_query_user_list()sam_trusted_domains()server_cryptkey()sid_to_name()smb_register_idmap()smb_register_idmap_alloc()smbcli_parse_unc()smbldap_init()str_list_make_internal()talloc_attrs()talloc_string_sub()talloc_sub_advanced()talloc_sub_basic()talloc_sub_specified()tcopy_passwd()test_free_parent_deny_child()test_lifeless()test_loop()test_misc()test_move()test_realloc_child()test_speed()timestring()trust_pw_change_and_store_it()trusted_domains()vfs_init_custom()wb_lookup_rids()winbind_lookup_rids()winbind_lookup_sid()winbind_pw_check()winbindd_add_memory_creds_internal()winbindd_dual_getsidaliases()winbindd_dual_list_trusted_domains()winbindd_dual_pam_auth()winbindd_getgroups()winbindd_lookupname_async()winbindd_raw_kerberos_login()winbindd_show_sequence().

01107 {
01108         char *ret;
01109         if (!p) {
01110                 return NULL;
01111         }
01112         ret = (char *)talloc_memdup(t, p, strlen(p) + 1);
01113         if (likely(ret)) {
01114                 _talloc_set_name_const(ret, ret);
01115         }
01116         return ret;
01117 }

char* talloc_strndup ( const void *  t,
const char *  p,
size_t  n 
)

talloc.c1146 行で定義されています。

参照先 __talloc()_talloc_set_name_const()len.

参照元 LabelList()lookup_name()net_usershare_add()notify_add()secrets_trusted_domains()test_misc().

01147 {
01148         size_t len;
01149         char *ret;
01150 
01151         for (len=0; len<n && p[len]; len++) ;
01152 
01153         ret = (char *)__talloc(t, len + 1);
01154         if (!ret) { return NULL; }
01155         memcpy(ret, p, len);
01156         ret[len] = 0;
01157         _talloc_set_name_const(ret, ret);
01158         return ret;
01159 }

char* talloc_append_string ( const void *  t,
char *  orig,
const char *  append 
)

talloc.c1122 行で定義されています。

01123 {
01124         char *ret;
01125         size_t olen = strlen(orig);
01126         size_t alenz;
01127 
01128         if (!append)
01129                 return orig;
01130 
01131         alenz = strlen(append) + 1;
01132 
01133         ret = talloc_realloc(t, orig, char, olen + alenz);
01134         if (!ret)
01135                 return NULL;
01136 
01137         /* append the string with the trailing \0 */
01138         memcpy(&ret[olen], append, alenz);
01139 
01140         return ret;
01141 }

char* talloc_vasprintf ( const void *  t,
const char *  fmt,
va_list  ap 
)

char* char* talloc_vasprintf_append ( char *  s,
const char *  fmt,
va_list  ap 
)

char* char* char* talloc_asprintf ( const void *  t,
const char *  fmt,
  ... 
)

char* char* char* char* talloc_asprintf_append ( char *  s,
const char *  fmt,
  ... 
)

char* char* char* char* void* _talloc_array ( const void *  ctx,
size_t  el_size,
unsigned  count,
const char *  name 
)

talloc.c1275 行で定義されています。

参照先 _talloc_named_const().

01276 {
01277         if (count >= MAX_TALLOC_SIZE/el_size) {
01278                 return NULL;
01279         }
01280         return _talloc_named_const(ctx, el_size * count, name);
01281 }

void* _talloc_zero_array ( const void *  ctx,
size_t  el_size,
unsigned  count,
const char *  name 
)

talloc.c1286 行で定義されています。

参照先 _talloc_zero().

01287 {
01288         if (count >= MAX_TALLOC_SIZE/el_size) {
01289                 return NULL;
01290         }
01291         return _talloc_zero(ctx, el_size * count, name);
01292 }

void* _talloc_realloc_array ( const void *  ctx,
void *  ptr,
size_t  el_size,
unsigned  count,
const char *  name 
)

talloc.c1297 行で定義されています。

参照先 _talloc_realloc().

01298 {
01299         if (count >= MAX_TALLOC_SIZE/el_size) {
01300                 return NULL;
01301         }
01302         return _talloc_realloc(ctx, ptr, el_size * count, name);
01303 }

void* talloc_realloc_fn ( const void *  context,
void *  ptr,
size_t  size 
)

talloc.c1310 行で定義されています。

参照先 _talloc_realloc().

参照元 test_realloc_fn().

01311 {
01312         return _talloc_realloc(context, ptr, size, NULL);
01313 }

void* talloc_autofree_context ( void   ) 

talloc.c1331 行で定義されています。

参照先 _talloc_named_const()autofree_contexttalloc_autofree()talloc_autofree_destructor().

参照元 test_autofree().

01332 {
01333         if (autofree_context == NULL) {
01334                 autofree_context = _talloc_named_const(NULL, 0, "autofree_context");
01335                 talloc_set_destructor(autofree_context, talloc_autofree_destructor);
01336                 atexit(talloc_autofree);
01337         }
01338         return autofree_context;
01339 }

size_t talloc_get_size ( const void *  ctx  ) 

talloc.c1341 行で定義されています。

参照先 talloc_chunk::sizetalloc_chunk_from_ptr().

参照元 test_talloc_ptrtype().

01342 {
01343         struct talloc_chunk *tc;
01344 
01345         if (context == NULL)
01346                 return 0;
01347 
01348         tc = talloc_chunk_from_ptr(context);
01349 
01350         return tc->size;
01351 }

void* talloc_find_parent_byname ( const void *  ctx,
const char *  name 
)

talloc.c1356 行で定義されています。

参照先 talloc_chunk::nametalloc_chunk::parenttalloc_chunk::prevtalloc_chunk_from_ptr().

01357 {
01358         struct talloc_chunk *tc;
01359 
01360         if (context == NULL) {
01361                 return NULL;
01362         }
01363 
01364         tc = talloc_chunk_from_ptr(context);
01365         while (tc) {
01366                 if (tc->name && strcmp(tc->name, name) == 0) {
01367                         return TC_PTR_FROM_CHUNK(tc);
01368                 }
01369                 while (tc && tc->prev) tc = tc->prev;
01370                 if (tc) {
01371                         tc = tc->parent;
01372                 }
01373         }
01374         return NULL;
01375 }

void talloc_show_parents ( const void *  context,
FILE *  file 
)

talloc.c1380 行で定義されています。

参照先 fprintf()talloc_chunk::parenttalloc_chunk::prevtalloc_chunk_from_ptr()talloc_get_name().

01381 {
01382         struct talloc_chunk *tc;
01383 
01384         if (context == NULL) {
01385                 fprintf(file, "talloc no parents for NULL\n");
01386                 return;
01387         }
01388 
01389         tc = talloc_chunk_from_ptr(context);
01390         fprintf(file, "talloc parents of '%s'\n", talloc_get_name(context));
01391         while (tc) {
01392                 fprintf(file, "\t'%s'\n", talloc_get_name(TC_PTR_FROM_CHUNK(tc)));
01393                 while (tc && tc->prev) tc = tc->prev;
01394                 if (tc) {
01395                         tc = tc->parent;
01396                 }
01397         }
01398         fflush(file);
01399 }

int talloc_is_parent ( const void *  context,
const void *  ptr 
)

talloc.c1404 行で定義されています。

参照先 talloc_chunk_from_ptr().

参照元 _talloc_free().

01405 {
01406         struct talloc_chunk *tc;
01407 
01408         if (context == NULL) {
01409                 return 0;
01410         }
01411 
01412         tc = talloc_chunk_from_ptr(context);
01413         while (tc) {
01414                 if (TC_PTR_FROM_CHUNK(tc) == ptr) return 1;
01415                 while (tc && tc->prev) tc = tc->prev;
01416                 if (tc) {
01417                         tc = tc->parent;
01418                 }
01419         }
01420         return 0;
01421 }


Sambaに対してSat Aug 29 21:23:39 2009に生成されました。  doxygen 1.4.7