• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ perl_destruct函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中perl_destruct函数的典型用法代码示例。如果您正苦于以下问题:C++ perl_destruct函数的具体用法?C++ perl_destruct怎么用?C++ perl_destruct使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了perl_destruct函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: perl_scripts_deinit

/* Destroy all perl scripts and deinitialize perl interpreter */
void perl_scripts_deinit(void)
{
	if (my_perl == NULL)
		return;

	/* unload all scripts */
        while (perl_scripts != NULL)
		perl_script_unload(perl_scripts->data);

        signal_emit("perl scripts deinit", 0);

        perl_signals_stop();
	perl_sources_stop();
	perl_common_stop();

	/* Unload all perl libraries loaded with dynaloader */
	perl_eval_pv("foreach my $lib (@DynaLoader::dl_modules) { if ($lib =~ /^Irssi\\b/) { $lib .= '::deinit();'; eval $lib; } }", TRUE);

	/* We could unload all libraries .. but this crashes with some
	   libraries, probably because we don't call some deinit function..
	   Anyway, this would free some memory with /SCRIPT RESET, but it
	   leaks memory anyway. */
	/*perl_eval_pv("eval { foreach my $lib (@DynaLoader::dl_librefs) { DynaLoader::dl_unload_file($lib); } }", TRUE);*/

	/* perl interpreter */
	perl_destruct(my_perl);
	perl_free(my_perl);
	my_perl = NULL;
}
开发者ID:svn2github,项目名称:irssi,代码行数:30,代码来源:perl-core.c


示例2: perl_parse_buf

/* ---- special pearl parser ----- */
int perl_parse_buf (char *inBuf) {
	
	STRLEN n_a;
	char *embedding[] = { "", "-e", "" };

	
	if (!my_perl) {
		my_perl = perl_alloc();
		perl_construct( my_perl );
		perl_parse(my_perl, xs_init, 3, embedding, NULL);
		/* PL_exit_flags |= PERL_EXIT_DESTRUCT_END; */
		perl_run(my_perl);
	}

/* 	sv_setpv(text,inBuf); */
/* 	eval_sv(text,G_SCALAR); */

	perlBuf = eval_pv(inBuf, TRUE);
	
	if (0) {
		perl_destruct(my_perl);
		perl_free(my_perl);
	}

	return 0;
	
}
开发者ID:eriser,项目名称:rtcmix-android,代码行数:28,代码来源:parse_with_perl.c


示例3: rlm_perl_destruct

static void rlm_perl_destruct(PerlInterpreter *perl)
{
	dTHXa(perl);

	PERL_SET_CONTEXT(perl);

	PL_perl_destruct_level = 2;

	PL_origenviron = environ;


	{
		dTHXa(perl);
	}
	/*
	 * FIXME: This shouldn't happen
	 *
	 */
	while (PL_scopestack_ix > 1) {
		LEAVE;
	}

	perl_destruct(perl);
	perl_free(perl);
}
开发者ID:geaaru,项目名称:freeradius-server,代码行数:25,代码来源:rlm_perl.c


示例4: main

int main(int argc, char **argv, char **env)
{
  //if (argc < 2) {
  //  fprintf(stderr, "you must specify at least one argument\n");
  //  exit(0);
  //}
  pthread_t threads[NUM_THREADS];
  pthread_mutex_init(&mutex_perl, NULL);
  PERL_SYS_INIT3(&argc,&argv,&env);
  char *my_argv[] = { "", PERL_SCRIPT };
  my_perl = perl_alloc();
  PERL_SET_CONTEXT(my_perl);
  perl_construct(my_perl);
  perl_parse(my_perl, NULL, 2, my_argv, (char **)NULL);
  PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
  perl_run(my_perl);
  int t;
  for (t=0; t<NUM_THREADS; t++) {
    printf("creating thread %d\n", t);
    (void)pthread_create(&threads[t], NULL, thread_context, (void *)t);
  }
  for (t=0;t<NUM_THREADS;t++) {
    (void)pthread_join(threads[t], NULL);
    printf("joined thread %d\n", t);
  }
  perl_destruct(my_perl);
  perl_free(my_perl);
  pthread_exit(NULL);
  pthread_mutex_destroy(&mutex_perl);
  PERL_SYS_TERM();
}
开发者ID:taryk,项目名称:sandbox,代码行数:31,代码来源:embperl_single_context.c


示例5: ngx_http_perl_exit

static void
ngx_http_perl_exit(ngx_cycle_t *cycle)
{
#if (NGX_HAVE_PERL_MULTIPLICITY)

    /*
     * the master exit hook is run before global pool cleanup,
     * therefore just set flag here
     */

    ngx_perl_term = 1;

#else

    if (nginx_stash) {
        ngx_log_debug0(NGX_LOG_DEBUG_HTTP, cycle->log, 0, "perl term");

        (void) perl_destruct(perl);

        perl_free(perl);

        PERL_SYS_TERM();
    }

#endif
}
开发者ID:peter-leonov,项目名称:nginx,代码行数:26,代码来源:ngx_http_perl_module.c


示例6: h3

void h3(void *arg) {
    int argc = 3;
    char *argv[] = { "", "-e", "use Data::Dumper;"
        "sub dump_perl { print STDERR Data::Dumper::Dumper([shift]); }", 
            NULL };
    char *env[] = { NULL };
    void *original_context = PERL_GET_CONTEXT;
    SV *sv;

    PERL_SYS_INIT3(&argc,&argv,&env);
    my_perl = perl_alloc();

    sv = newRV_inc(newSViv(5));

    PERL_SET_CONTEXT(my_perl);
    perl_construct(my_perl);
    
    perl_parse(my_perl, mine_xs_init, argc, argv, NULL);

    call_dump_perl(sv);
    
    perl_destruct(my_perl);
    perl_free(my_perl);

    PERL_SET_CONTEXT(original_context);
}
开发者ID:krunt,项目名称:projects,代码行数:26,代码来源:8.c


示例7: irssi_perl_stop

static void irssi_perl_stop(void)
{
	g_hash_table_foreach(first_signals, (GHFunc) signal_destroy_hash, NULL);
	g_hash_table_destroy(first_signals);
	g_hash_table_foreach(last_signals, (GHFunc) signal_destroy_hash, NULL);
	g_hash_table_destroy(last_signals);
	first_signals = last_signals = NULL;

	if (signal_grabbed) {
		signal_grabbed = FALSE;
		signal_remove("signal", (SIGNAL_FUNC) sig_signal);
	}

	if (siglast_grabbed) {
		siglast_grabbed = FALSE;
		signal_remove("last signal", (SIGNAL_FUNC) sig_lastsignal);
	}

	while (perl_timeouts != NULL)
		perl_timeout_destroy(perl_timeouts->data);

	perl_destruct(irssi_perl_interp);
	perl_free(irssi_perl_interp);
	irssi_perl_interp = NULL;
}
开发者ID:svn2github,项目名称:irssi,代码行数:25,代码来源:irssi-perl.c


示例8: perl_destruct

void Embperl::Reinit() {
	in_use = true;
	PL_perl_destruct_level = 1;
	perl_destruct(my_perl);
	DoInit();
	in_use = false;
}
开发者ID:jbwilliams1,项目名称:EQTrilogy-Old,代码行数:7,代码来源:embperl.cpp


示例9: perl_destruct

int
ClsPerlHost::PerlDestroy(PerlInterpreter *my_perl)
{
	int ret = perl_destruct(my_perl);		// Destructor for Perl.
////	perl_free(my_perl);			// Free the memory allocated for Perl.
	return(ret);
}
开发者ID:rurban,项目名称:perl,代码行数:7,代码来源:interface.cpp


示例10: destroy_perl

static void destroy_perl(PerlInterpreter ** to_destroy)
{
	Perl_safe_eval(*to_destroy, HACK_CLEAN_CODE);
	perl_destruct(*to_destroy);
	perl_free(*to_destroy);
	*to_destroy = NULL;
}
开发者ID:AricGod,项目名称:FreeSWITCH,代码行数:7,代码来源:mod_perl.c


示例11: weechat_perl_unload

void
weechat_perl_unload (struct t_plugin_script *script)
{
    int *rc;
    void *interpreter;
    char *filename;

    if ((weechat_perl_plugin->debug >= 2) || !perl_quiet)
    {
        weechat_printf (NULL,
                        weechat_gettext ("%s: unloading script \"%s\""),
                        PERL_PLUGIN_NAME, script->name);
    }

#ifdef MULTIPLICITY
    PERL_SET_CONTEXT (script->interpreter);
#endif /* MULTIPLICITY */

    if (script->shutdown_func && script->shutdown_func[0])
    {
        rc = (int *)weechat_perl_exec (script,
                                       WEECHAT_SCRIPT_EXEC_INT,
                                       script->shutdown_func,
                                       NULL, NULL);
        if (rc)
            free (rc);
    }

    filename = strdup (script->filename);
    interpreter = script->interpreter;

    if (perl_current_script == script)
    {
        perl_current_script = (perl_current_script->prev_script) ?
            perl_current_script->prev_script : perl_current_script->next_script;
    }

    plugin_script_remove (weechat_perl_plugin, &perl_scripts, &last_perl_script,
                          script);

#ifdef MULTIPLICITY
    if (interpreter)
    {
        perl_destruct (interpreter);
        perl_free (interpreter);
    }
    if (perl_current_script)
    {
        PERL_SET_CONTEXT (perl_current_script->interpreter);
    }
#else
    if (interpreter)
        free (interpreter);
#endif /* MULTIPLICITY */

    (void) weechat_hook_signal_send ("perl_script_unloaded",
                                     WEECHAT_HOOK_SIGNAL_STRING, filename);
    if (filename)
        free (filename);
}
开发者ID:aadiarbakerli,项目名称:weechat,代码行数:60,代码来源:weechat-perl.c


示例12: perlstartstop

/* Stopping has one big memory leak right now, so it's not used. */
void	perlstartstop (int startnotstop) 
{
	if (startnotstop && !isperlrunning) {
		char *embedding[3];
		embedding[0] = malloc_strdup(empty_string);
		embedding[1] = malloc_strdup("-e");
		embedding[2] = malloc_strdup("$SIG{__DIE__}=$SIG{__WARN__}=\\&EPIC::yell;");

		++isperlrunning;
		my_perl = perl_alloc();
		perl_construct( my_perl );
		perl_parse(my_perl, xs_init, 3, embedding, NULL);
		if (SvTRUE(ERRSV)) 
			yell("perl_parse: %s", SvPV_nolen(ERRSV));
		perl_run(my_perl);
		if (SvTRUE(ERRSV)) 
			yell("perl_run: %s", SvPV_nolen(ERRSV));
	} else if (!startnotstop && isperlrunning && !perlcalldepth) {
		perl_destruct(my_perl);
		if (SvTRUE(ERRSV)) 
			yell("perl_destruct: %s", SvPV_nolen(ERRSV));
		perl_free(my_perl);
		if (SvTRUE(ERRSV)) 
			yell("perl_free: %s", SvPV_nolen(ERRSV));
		isperlrunning=0;
	}
}
开发者ID:NathanHowell,项目名称:epic,代码行数:28,代码来源:perl.c


示例13: script_free

int script_free()
{
	perl_destruct(my_perl);
	perl_free(my_perl);

	return 0;
}
开发者ID:OZv,项目名称:fastwiki,代码行数:7,代码来源:fastwiki-stardict-perl.cpp


示例14: unload_perl__

int unload_perl__( void )
{
  int i;

#ifdef MULTI_THREAD
  if( NULL == th)
	th = xsb_get_main_thread();
#endif

  PL_perl_destruct_level = 1;
  perl_destruct( my_perl );
  perl_free( my_perl );

  /*-------------------------------------------------------------------------
   free all the space allocated for perl match functions
  -------------------------------------------------------------------------*/
  for ( i=0; i<preBulkMatchNumber; i++ ) 
    free(bulkMatchList[i]);
  if (bulkMatchList != NULL ) free(bulkMatchList);
  if (matchPattern != NULL ) free(matchPattern);
  if (substituteString != NULL ) free(substituteString);
  free(subMatchSpec);

  perlObjectStatus = UNLOADED;

  return SUCCESS;
}  
开发者ID:De-Lac,项目名称:Dynamic-Verification-of-Service-Based-Systems,代码行数:27,代码来源:xsbpattern.c


示例15: main

main (int argc, char **argv, char **env)
{
	STRLEN n_a;
	char *embedding[] = { "", "-e", "0" };
   
	my_perl = perl_alloc();
	perl_construct( my_perl );
   
	perl_parse(my_perl, NULL, 3, embedding, NULL);
	perl_run(my_perl);
   
	/** Treat $a as an integer **/
	perl_eval_pv("$a = 3; $a **= 2", TRUE);
	printf("a = %d\n", SvIV(perl_get_sv("a", FALSE)));
   
	/** Treat $a as a float **/
	perl_eval_pv("$a = 3.14; $a **= 2", TRUE);
	printf("a = %f\n", SvNV(perl_get_sv("a", FALSE)));
   
	/** Treat $a as a string **/
	perl_eval_pv("$a = 'rekcaH lreP rehtonA tsuJ'; $a = reverse($a);", TRUE);
	printf("a = %s\n", SvPV(perl_get_sv("a", FALSE), n_a));
   
	perl_destruct(my_perl);
	perl_free(my_perl);
}
开发者ID:sumkincpp,项目名称:CodeTest,代码行数:26,代码来源:embed.c


示例16: clear_perl

void clear_perl(void *nothing) {
    dTHX;
    /* warn ("destroying perl engine %x", my_perl); */
    perl_destruct(my_perl);
    perl_free(my_perl);
    PERL_SET_CONTEXT(NULL);
}
开发者ID:dtikhonov,项目名称:p5-Language-Prolog-Yaswi,代码行数:7,代码来源:engines.c


示例17: pl_perl_shutdown_perl

/* cleanup time! */
static void pl_perl_shutdown_perl(void) {
	if (my_perl != NULL) {
		perl_destruct(my_perl);
		perl_free(my_perl);
		my_perl = NULL;
	}
}
开发者ID:GitOrganization,项目名称:Ice-Source-Client,代码行数:8,代码来源:pm_perl.c


示例18: PurlDestroy

static void
PurlDestroy()
{
  perl_destruct(my_perl);
  perl_free(my_perl);

  PERL_SYS_TERM();
}
开发者ID:ian-kent,项目名称:purl,代码行数:8,代码来源:purl.c


示例19: stop_perl_interpreter

static void
stop_perl_interpreter (PerlInterpreter *interp)
{
  log_debug ("stop_perl_interpreter");
  PERL_SET_CONTEXT(interp);
  perl_destruct(interp);
  perl_free (interp);
}
开发者ID:China-ls,项目名称:virtuoso-opensource,代码行数:8,代码来源:hosting_perl.c


示例20: C2PERLPerlDestroy

int C2PERLPerlDestroy()
///////////////////////////////////////////////////////////////////////////
{
    perl_destruct(my_perl);
    perl_free(my_perl);
    g_init=0;
    return(0);
}
开发者ID:alisw,项目名称:xalienfs,代码行数:8,代码来源:C2PERL.c



注:本文中的perl_destruct函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ perl_parse函数代码示例发布时间:2022-05-30
下一篇:
C++ perl_alloc函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap