这篇教程C++ talloc_autofree_context函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中talloc_autofree_context函数的典型用法代码示例。如果您正苦于以下问题:C++ talloc_autofree_context函数的具体用法?C++ talloc_autofree_context怎么用?C++ talloc_autofree_context使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了talloc_autofree_context函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: torture_local_initNTSTATUS torture_local_init(void){ int i; struct torture_suite *suite = torture_suite_create( talloc_autofree_context(), "LOCAL"); torture_suite_add_simple_test(suite, "TALLOC", torture_local_talloc); torture_suite_add_simple_test(suite, "REPLACE", torture_local_replace); torture_suite_add_simple_test(suite, "CRYPTO-SHA1", torture_local_crypto_sha1); torture_suite_add_simple_test(suite, "CRYPTO-MD4", torture_local_crypto_md4); torture_suite_add_simple_test(suite, "CRYPTO-MD5", torture_local_crypto_md5); torture_suite_add_simple_test(suite, "CRYPTO-HMACMD5", torture_local_crypto_hmacmd5); torture_suite_add_simple_test(suite, "CRYPTO-HMACSHA1", torture_local_crypto_hmacsha1); for (i = 0; suite_generators[i]; i++) torture_suite_add_suite(suite, suite_generators[i](talloc_autofree_context())); suite->description = talloc_strdup(suite, "Local, Samba-specific tests"); torture_register_suite(suite); return NT_STATUS_OK;}
开发者ID:Marvin-Lee,项目名称:libwmiclient,代码行数:31,
示例2: torture_local_initNTSTATUS torture_local_init(void){ int i; struct torture_suite *suite = torture_suite_create( talloc_autofree_context(), "local"); torture_suite_add_simple_test(suite, "talloc", torture_local_talloc); torture_suite_add_simple_test(suite, "replace", torture_local_replace); torture_suite_add_simple_test(suite, "crypto.md4", torture_local_crypto_md4); torture_suite_add_simple_test(suite, "crypto.md5", torture_local_crypto_md5); torture_suite_add_simple_test(suite, "crypto.hmacmd5", torture_local_crypto_hmacmd5); for (i = 0; suite_generators[i]; i++) torture_suite_add_suite(suite, suite_generators[i](talloc_autofree_context())); suite->description = talloc_strdup(suite, "Local, Samba-specific tests"); torture_register_suite(suite); return NT_STATUS_OK;}
开发者ID:Arkhont,项目名称:samba,代码行数:27,
示例3: dsdb_schema_set_el_from_ldb_msg/** * Add an element to the schema (attribute or class) from an LDB message */WERROR dsdb_schema_set_el_from_ldb_msg(struct ldb_context *ldb, struct dsdb_schema *schema, struct ldb_message *msg) { static struct ldb_parse_tree *attr_tree, *class_tree; if (!attr_tree) { attr_tree = ldb_parse_tree(talloc_autofree_context(), "(objectClass=attributeSchema)"); if (!attr_tree) { return WERR_NOMEM; } } if (!class_tree) { class_tree = ldb_parse_tree(talloc_autofree_context(), "(objectClass=classSchema)"); if (!class_tree) { return WERR_NOMEM; } } if (ldb_match_msg(ldb, msg, attr_tree, NULL, LDB_SCOPE_BASE)) { return dsdb_attribute_from_ldb(ldb, schema, msg); } else if (ldb_match_msg(ldb, msg, class_tree, NULL, LDB_SCOPE_BASE)) { return dsdb_class_from_ldb(schema, msg); } /* Don't fail on things not classes or attributes */ return WERR_OK;}
开发者ID:0x24bin,项目名称:winexe-1,代码行数:30,
示例4: test_autofreestatic bool test_autofree(void){ void *p; printf("test: autofree [/nTALLOC AUTOFREE CONTEXT/n]/n"); p = talloc_autofree_context(); talloc_free(p); p = talloc_autofree_context(); talloc_free(p); printf("success: autofree/n"); return true;}
开发者ID:AllardJ,项目名称:Tomato,代码行数:14,
示例5: getenv/** * Return the path to a directory where temporary files should be * created. */const char *get_temp_directory(){ static const char *temp_directory = NULL; char *tmp; if (temp_directory != NULL) return temp_directory; temp_directory = getenv("PROOT_TMP_DIR"); if (temp_directory == NULL) { temp_directory = P_tmpdir; return temp_directory; } tmp = realpath(temp_directory, NULL); if (tmp == NULL) { note(NULL, WARNING, SYSTEM, "can't canonicalize %s, using %s instead of PROOT_TMP_DIR", temp_directory, P_tmpdir); temp_directory = P_tmpdir; return temp_directory; } temp_directory = talloc_strdup(talloc_autofree_context(), tmp); if (temp_directory == NULL) temp_directory = tmp; else free(tmp); return temp_directory;}
开发者ID:MatthewTighe,项目名称:GNURootDebian,代码行数:36,
示例6: talloc_autofree_context/** /details Initialize ldb_context to samdb, creates one for all emsmdbp contexts /param lp_ctx pointer to the loadparm context */static struct ldb_context *samdb_init(struct loadparm_context *lp_ctx){ TALLOC_CTX *mem_ctx; struct tevent_context *ev; const char *samdb_url; if (samdb_ctx) return samdb_ctx; mem_ctx = talloc_autofree_context(); ev = tevent_context_init(mem_ctx); if (!ev) { OC_PANIC(false, ("Fail to initialize tevent_context/n")); return NULL; } tevent_loop_allow_nesting(ev); /* Retrieve samdb url (local or external) */ samdb_url = lpcfg_parm_string(lp_ctx, NULL, "dcerpc_mapiproxy", "samdb_url"); if (!samdb_url) { samdb_ctx = samdb_connect(mem_ctx, ev, lp_ctx, system_session(lp_ctx), 0); } else { samdb_ctx = samdb_connect_url(mem_ctx, ev, lp_ctx, system_session(lp_ctx), LDB_FLG_RECONNECT, samdb_url); } return samdb_ctx;}
开发者ID:javierag,项目名称:openchange,代码行数:34,
示例7: torture_krb5_initNTSTATUS torture_krb5_init(void){ struct torture_suite *suite = torture_suite_create(talloc_autofree_context(), "krb5"); struct torture_suite *kdc_suite = torture_suite_create(suite, "kdc"); suite->description = talloc_strdup(suite, "Kerberos tests"); kdc_suite->description = talloc_strdup(kdc_suite, "Kerberos KDC tests"); torture_suite_add_simple_test(kdc_suite, "as-req-cmdline", torture_krb5_as_req_cmdline); torture_suite_add_simple_test(kdc_suite, "as-req-pac-request", torture_krb5_as_req_pac_request); torture_suite_add_simple_test(kdc_suite, "as-req-break-pw", torture_krb5_as_req_break_pw); torture_suite_add_simple_test(kdc_suite, "as-req-clock-skew", torture_krb5_as_req_clock_skew); torture_suite_add_suite(kdc_suite, torture_krb5_canon(kdc_suite)); torture_suite_add_suite(suite, kdc_suite); torture_register_suite(suite); return NT_STATUS_OK;}
开发者ID:DanilKorotenko,项目名称:samba,代码行数:25,
示例8: talloc_asprintfstatic Suite *openchangedb_create_suite(SFun setup, SFun teardown){ char *suite_name = talloc_asprintf(talloc_autofree_context(), "Openchangedb Logger backend"); Suite *s = suite_create(suite_name); TCase *tc = tcase_create("Openchangedb Logger interface"); tcase_add_checked_fixture(tc, setup, teardown); tcase_add_test(tc, test_call_get_SpecialFolderID); tcase_add_test(tc, test_call_get_SystemFolderID); tcase_add_test(tc, test_call_get_PublicFolderID); tcase_add_test(tc, test_call_get_distinguishedName); tcase_add_test(tc, test_call_get_MailboxGuid); tcase_add_test(tc, test_call_get_MailboxReplica); tcase_add_test(tc, test_call_get_PublicFolderReplica); tcase_add_test(tc, test_call_get_mapistoreURI); tcase_add_test(tc, test_call_set_mapistoreURI); tcase_add_test(tc, test_call_get_parent_fid); tcase_add_test(tc, test_call_get_fid); tcase_add_test(tc, test_call_get_MAPIStoreURIs); tcase_add_test(tc, test_call_get_ReceiveFolder); tcase_add_test(tc, test_call_replica_mapping_guid_to_replid); tcase_add_test(tc, test_call_replica_mapping_replid_to_guid); suite_add_tcase(s, tc); return s;}
开发者ID:blaxter,项目名称:openchange,代码行数:28,
示例9: torture_suite_createstruct torture_suite *torture_wbclient(void){ struct torture_suite *suite = torture_suite_create(talloc_autofree_context(), "wbclient"); torture_suite_add_simple_test(suite, "wbcPing", test_wbc_ping); torture_suite_add_simple_test(suite, "wbcPingDc", test_wbc_pingdc); torture_suite_add_simple_test(suite, "wbcLibraryDetails", test_wbc_library_details); torture_suite_add_simple_test(suite, "wbcInterfaceDetails", test_wbc_interface_details); torture_suite_add_simple_test(suite, "wbcSidTypeString", test_wbc_sidtypestring); torture_suite_add_simple_test(suite, "wbcSidToString", test_wbc_sidtostring); torture_suite_add_simple_test(suite, "wbcGuidToString", test_wbc_guidtostring); torture_suite_add_simple_test(suite, "wbcDomainInfo", test_wbc_domain_info); torture_suite_add_simple_test(suite, "wbcListUsers", test_wbc_users); torture_suite_add_simple_test(suite, "wbcListGroups", test_wbc_groups); torture_suite_add_simple_test(suite, "wbcListTrusts", test_wbc_trusts); torture_suite_add_simple_test(suite, "wbcLookupDomainController", test_wbc_lookupdc); torture_suite_add_simple_test(suite, "wbcLookupDomainControllerEx", test_wbc_lookupdcex); torture_suite_add_simple_test(suite, "wbcResolveWinsByName", test_wbc_resolve_winsbyname); torture_suite_add_simple_test(suite, "wbcResolveWinsByIP", test_wbc_resolve_winsbyip); torture_suite_add_simple_test(suite, "wbcLookupRids", test_wbc_lookup_rids); torture_suite_add_simple_test(suite, "wbcGetSidAliases", test_wbc_get_sidaliases); torture_suite_add_simple_test(suite, "wbcAuthenticateUser", test_wbc_authenticate_user); torture_suite_add_simple_test(suite, "wbcLogonUser", test_wbc_logon_user); torture_suite_add_simple_test(suite, "wbcChangeUserPassword", test_wbc_change_password); torture_suite_add_simple_test(suite, "wbcGetGroups", test_wbc_getgroups); return suite;}
开发者ID:Arkhont,项目名称:samba,代码行数:34,
示例10: torture_smb2_initNTSTATUS torture_smb2_init(void){ struct torture_suite *suite = torture_suite_create(talloc_autofree_context(), "SMB2"); torture_suite_add_simple_test(suite, "CONNECT", torture_smb2_connect); torture_suite_add_simple_test(suite, "SCAN", torture_smb2_scan); torture_suite_add_simple_test(suite, "SCANGETINFO", torture_smb2_getinfo_scan); torture_suite_add_simple_test(suite, "SCANSETINFO", torture_smb2_setinfo_scan); torture_suite_add_simple_test(suite, "SCANFIND", torture_smb2_find_scan); torture_suite_add_simple_test(suite, "GETINFO", torture_smb2_getinfo); torture_suite_add_simple_test(suite, "SETINFO", torture_smb2_setinfo); torture_suite_add_simple_test(suite, "FIND", torture_smb2_find); torture_suite_add_suite(suite, torture_smb2_lock_init()); torture_suite_add_suite(suite, torture_smb2_read_init()); torture_suite_add_suite(suite, torture_smb2_create_init()); torture_suite_add_simple_test(suite, "NOTIFY", torture_smb2_notify); torture_suite_add_suite(suite, torture_smb2_durable_open_init()); torture_suite_add_1smb2_test(suite, "OPLOCK-BATCH1", torture_smb2_oplock_batch1); torture_suite_add_suite(suite, torture_smb2_lease_init()); suite->description = talloc_strdup(suite, "SMB2-specific tests"); torture_register_suite(suite); return NT_STATUS_OK;}
开发者ID:gojdic,项目名称:samba,代码行数:25,
示例11: parse_targetstatic bool parse_target(struct loadparm_context *lp_ctx, const char *target){ char *host = NULL, *share = NULL; struct dcerpc_binding *binding_struct; NTSTATUS status; /* see if its a RPC transport specifier */ if (!smbcli_parse_unc(target, NULL, &host, &share)) { status = dcerpc_parse_binding(talloc_autofree_context(), target, &binding_struct); if (NT_STATUS_IS_ERR(status)) { d_printf("Invalid option: %s is not a valid torture target (share or binding string)/n/n", target); return false; } lp_set_cmdline(lp_ctx, "torture:host", binding_struct->host); if (lp_parm_string(lp_ctx, NULL, "torture", "share") == NULL) lp_set_cmdline(lp_ctx, "torture:share", "IPC$"); lp_set_cmdline(lp_ctx, "torture:binding", target); } else { lp_set_cmdline(lp_ctx, "torture:host", host); lp_set_cmdline(lp_ctx, "torture:share", share); lp_set_cmdline(lp_ctx, "torture:binding", host); } return true;}
开发者ID:0x24bin,项目名称:winexe-1,代码行数:25,
示例12: dsdb_make_schema_globalvoid dsdb_make_schema_global(struct ldb_context *ldb, struct dsdb_schema *schema){ if (!schema) { return; } if (global_schema) { talloc_unlink(talloc_autofree_context(), global_schema); } /* we want the schema to be around permanently */ talloc_reparent(ldb, talloc_autofree_context(), schema); global_schema = schema; /* This calls the talloc_reference() of the global schema back onto the ldb */ dsdb_set_global_schema(ldb);}
开发者ID:sprymak,项目名称:samba,代码行数:17,
示例13: talloc_autofree_contextvoidglsl_type::init_talloc_type_ctx(void){ if (glsl_type::mem_ctx == NULL) { glsl_type::mem_ctx = talloc_autofree_context(); assert(glsl_type::mem_ctx != NULL); }}
开发者ID:1065672644894730302,项目名称:Chromium,代码行数:8,
示例14: test_autofreestatic bool test_autofree(void){#if _SAMBA_BUILD_ < 4 /* autofree test would kill smbtorture */ void *p; printf("test: autofree/n# TALLOC AUTOFREE CONTEXT/n"); p = talloc_autofree_context(); talloc_free(p); p = talloc_autofree_context(); talloc_free(p); printf("success: autofree/n");#endif return true;}
开发者ID:urisimchoni,项目名称:samba,代码行数:17,
示例15: torture_raw_initNTSTATUS torture_raw_init(void){ struct torture_suite *suite = torture_suite_create( talloc_autofree_context(), "raw"); /* RAW smb tests */ torture_suite_add_simple_test(suite, "bench-oplock", torture_bench_oplock); torture_suite_add_simple_test(suite, "ping-pong", torture_ping_pong); torture_suite_add_simple_test(suite, "bench-lock", torture_bench_lock); torture_suite_add_simple_test(suite, "bench-open", torture_bench_open); torture_suite_add_simple_test(suite, "bench-lookup", torture_bench_lookup); torture_suite_add_simple_test(suite, "bench-tcon", torture_bench_treeconnect); torture_suite_add_simple_test(suite, "offline", torture_test_offline); torture_suite_add_1smb_test(suite, "qfsinfo", torture_raw_qfsinfo); torture_suite_add_1smb_test(suite, "qfileinfo", torture_raw_qfileinfo); torture_suite_add_1smb_test(suite, "qfileinfo.ipc", torture_raw_qfileinfo_pipe); torture_suite_add_suite(suite, torture_raw_sfileinfo(suite)); torture_suite_add_suite(suite, torture_raw_search(suite)); torture_suite_add_1smb_test(suite, "close", torture_raw_close); torture_suite_add_suite(suite, torture_raw_open(suite)); torture_suite_add_1smb_test(suite, "mkdir", torture_raw_mkdir); torture_suite_add_suite(suite, torture_raw_oplock(suite)); torture_suite_add_1smb_test(suite, "hold-oplock", torture_hold_oplock); torture_suite_add_2smb_test(suite, "notify", torture_raw_notify); torture_suite_add_1smb_test(suite, "mux", torture_raw_mux); torture_suite_add_1smb_test(suite, "ioctl", torture_raw_ioctl); torture_suite_add_1smb_test(suite, "chkpath", torture_raw_chkpath); torture_suite_add_suite(suite, torture_raw_unlink(suite)); torture_suite_add_suite(suite, torture_raw_read(suite)); torture_suite_add_suite(suite, torture_raw_write(suite)); torture_suite_add_suite(suite, torture_raw_lock(suite)); torture_suite_add_1smb_test(suite, "context", torture_raw_context); torture_suite_add_suite(suite, torture_raw_rename(suite)); torture_suite_add_1smb_test(suite, "seek", torture_raw_seek); torture_suite_add_1smb_test(suite, "eas", torture_raw_eas); torture_suite_add_suite(suite, torture_raw_streams(suite)); torture_suite_add_suite(suite, torture_raw_acls(suite)); torture_suite_add_1smb_test(suite, "composite", torture_raw_composite); torture_suite_add_simple_test(suite, "samba3hide", torture_samba3_hide); torture_suite_add_simple_test(suite, "samba3closeerr", torture_samba3_closeerr); torture_suite_add_simple_test(suite, "samba3rootdirfid", torture_samba3_rootdirfid); torture_suite_add_simple_test(suite, "samba3checkfsp", torture_samba3_checkfsp); torture_suite_add_simple_test(suite, "samba3oplocklogoff", torture_samba3_oplock_logoff); torture_suite_add_simple_test(suite, "samba3badpath", torture_samba3_badpath); torture_suite_add_simple_test(suite, "samba3caseinsensitive", torture_samba3_caseinsensitive); torture_suite_add_simple_test(suite, "samba3posixtimedlock", torture_samba3_posixtimedlock); torture_suite_add_simple_test(suite, "scan-eamax", torture_max_eas); suite->description = talloc_strdup(suite, "Tests for the raw SMB interface"); torture_register_suite(suite); return NT_STATUS_OK;}
开发者ID:Alexandr-Galko,项目名称:samba,代码行数:58,
示例16: dsdb_make_schema_globalvoid dsdb_make_schema_global(struct ldb_context *ldb){ struct dsdb_schema *schema = dsdb_get_schema(ldb); if (!schema) { return; } if (global_schema) { talloc_unlink(talloc_autofree_context(), global_schema); } /* we want the schema to be around permanently */ talloc_reparent(talloc_parent(schema), talloc_autofree_context(), schema); global_schema = schema; dsdb_set_global_schema(ldb);}
开发者ID:0x24bin,项目名称:winexe-1,代码行数:18,
示例17: event_context_initstruct event_context *smbd_event_context(void){ if (!smbd_event_ctx) { smbd_event_ctx = event_context_init(talloc_autofree_context()); } if (!smbd_event_ctx) { smb_panic("Could not init smbd event context"); } return smbd_event_ctx;}
开发者ID:berte,项目名称:mediaplayer,代码行数:10,
示例18: torture_suite_create/* test name registration to a server*/struct torture_suite *torture_nbt_register(void){ struct torture_suite *suite; suite = torture_suite_create(talloc_autofree_context(), "REGISTER"); torture_suite_add_simple_test(suite, "register_own", nbt_register_own); torture_suite_add_simple_test(suite, "refresh_own", nbt_refresh_own); return suite;}
开发者ID:Marvin-Lee,项目名称:libwmiclient,代码行数:13,
示例19: tc_IDSET_parse_setup} END_TEST// ^ unit tests ---------------------------------------------------------------// v suite definition ---------------------------------------------------------static void tc_IDSET_parse_setup(void){ mem_ctx = talloc_new(talloc_autofree_context());}
开发者ID:ThHirsch,项目名称:openchange,代码行数:10,
示例20: logon_table_setup} END_TEST// ^ Unit test ----------------------------------------------------------------// v Suite definition ---------------------------------------------------------static void logon_table_setup(void){ g_mem_ctx = talloc_new(talloc_autofree_context());}
开发者ID:zentyal,项目名称:openchange,代码行数:11,
示例21: sys_lease_register/* register a lease backend*/_PUBLIC_ NTSTATUS sys_lease_register(const struct sys_lease_ops *backend){ struct sys_lease_ops *b; b = talloc_realloc(talloc_autofree_context(), backends, struct sys_lease_ops, num_backends+1); NT_STATUS_HAVE_NO_MEMORY(b); backends = b; backends[num_backends] = *backend; num_backends++; return NT_STATUS_OK;}
开发者ID:Alexandr-Galko,项目名称:samba,代码行数:14,
示例22: torture_bind_dns_initNTSTATUS torture_bind_dns_init(void){ struct torture_suite *suite; TALLOC_CTX *mem_ctx = talloc_autofree_context(); /* register DNS related test cases */ suite = dlz_bind9_suite(mem_ctx); if (!suite) return NT_STATUS_NO_MEMORY; torture_register_suite(suite); return NT_STATUS_OK;}
开发者ID:rchicoli,项目名称:samba,代码行数:12,
示例23: memcache_initstruct memcache *smbd_memcache(void){ if (!smbd_memcache_ctx) { smbd_memcache_ctx = memcache_init(talloc_autofree_context(), lp_max_stat_cache_size()*1024); } if (!smbd_memcache_ctx) { smb_panic("Could not init smbd memcache"); } return smbd_memcache_ctx;}
开发者ID:berte,项目名称:mediaplayer,代码行数:12,
示例24: com_register_running_classNTSTATUS com_register_running_class(struct GUID *clsid, const char *progid, struct IUnknown *p){ struct com_class *l = talloc_zero(running_classes?running_classes:talloc_autofree_context(), struct com_class); l->clsid = *clsid; l->progid = talloc_strdup(l, progid); l->class_object = p; DLIST_ADD(running_classes, l); return NT_STATUS_OK;}
开发者ID:AIdrifter,项目名称:samba,代码行数:12,
示例25: torture_winbind_initNTSTATUS torture_winbind_init(void){ struct torture_suite *suite = torture_suite_create(talloc_autofree_context(), "WINBIND"); torture_suite_add_suite(suite, torture_winbind_struct_init()); suite->description = talloc_strdup(suite, "WINBIND tests"); torture_register_suite(suite); return NT_STATUS_OK;}
开发者ID:gojdic,项目名称:samba,代码行数:12,
示例26: torture_internal_dns_init/** * DNS torture module initialization */NTSTATUS torture_internal_dns_init(void){ struct torture_suite *suite; TALLOC_CTX *mem_ctx = talloc_autofree_context(); /* register internal DNS torture test cases */ suite = internal_dns_suite(mem_ctx); if (!suite) return NT_STATUS_NO_MEMORY; torture_register_suite(suite); return NT_STATUS_OK;}
开发者ID:AIdrifter,项目名称:samba,代码行数:15,
注:本文中的talloc_autofree_context函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ talloc_destroy函数代码示例 C++ talloc_asprintf_append函数代码示例 |