Beispiel #1
0
void ajDebug(const char* fmt, ...)
{
    va_list args;
    static ajint debugset = 0;
    static ajint depth    = 0;
    AjPStr bufstr         = NULL;
    
    if(depth)
    {				   /* recursive call, get out quick */
	if(messDebugFile)
	{
	    va_start(args, fmt);
	    ajFmtVPrintF(messDebugFile, fmt, args);
	    va_end(args);
	}

	return;
    }

    depth++;

    if(!debugset && acdDebugSet)
    {
	messDebug = acdDebug;

	if(messDebug)
	{
	    ajFmtPrintS(&messDebugName, "%s.dbg", ajStrGetPtr(acdProgram));
	    messDebugFile = ajFileNewOutNameS(messDebugName);

	    if(!messDebugFile)
		ajFatal("Cannot open debug file %S",messDebugName);

	    if(ajNamGetValueC("debugbuffer", &bufstr))
	    {
		ajStrToBool(bufstr, &acdDebugBuffer);
	    }

	    if(!acdDebugBuffer)
		ajFileSetUnbuffer(messDebugFile);

	    ajFmtPrintF(messDebugFile, "Debug file %F buffered:%B\n",
			 messDebugFile, acdDebugBuffer);
	    ajStrDel(&bufstr);
	}

	debugset = 1;
    }

    if(messDebug)
    {
	va_start(args, fmt);
	ajFmtVPrintF(messDebugFile, fmt, args);
	va_end(args);
    }

    depth--;

    return;
}
Beispiel #2
0
axis2_svc_client_t* ajSoapAxis2GetClient(const axutil_env_t *env,
                                         const axis2_char_t *address)
{
    AjPStr home = NULL;

    axis2_endpoint_ref_t* endpoint_ref = NULL;
    axis2_options_t* options           = NULL;
    axis2_svc_client_t* svc_client     = NULL;

    options      = axis2_options_create(env);

    endpoint_ref = axis2_endpoint_ref_create(env, address);

    axis2_options_set_soap_version(options, env, AXIOM_SOAP11);
    axis2_options_set_to(options, env, endpoint_ref);

    /* Set up axis2c location.
    ** This is either from:
    ** EMBOSS_AXIS2C_HOME: Used by mEMBOSS as axis2c files are
    **               provided by the setup and there could
    **               be confusion with an existing axis2c
    **               installation otherwise.
    ** axis2C_HOME: The location specified during the
    **              EMBOSS configuration.
    **
    ** The client uses this information to pick up the
    ** libraries, modules and axis2.xml file
    */

    if(!ajNamGetValueC("AXIS2C_HOME",&home))
        home = ajStrNewC(axis2C_HOME);

    /* Create service client */
    svc_client = axis2_svc_client_create(env, ajStrGetPtr(home));

    if (!svc_client)
    {
	ajErr("Error creating webservice client: %s",
	      AXIS2_ERROR_GET_MESSAGE(env->error));
	return NULL;
    }

    axis2_svc_client_set_options(svc_client, env, options);
    axis2_svc_client_engage_module(svc_client, env, AXIS2_MODULE_ADDRESSING);

    ajStrDel(&home);

    return svc_client;
}
Beispiel #3
0
AjBool ajTimeSetLocal(AjPTime thys, const time_t timer)
{
    struct tm *result;
    AjPStr timestr = NULL;

    if(ajNamGetValueC("timetoday", &timestr))
    {
	if(ajTimeSetS(thys, timestr))
	{
	    ajStrDel(&timestr);

	    return ajTrue;
	}

	ajStrDel(&timestr);
    }

#if defined(__ppc__) || defined(WIN32)
    result = localtime(&timer);
    if(!result)
	return ajFalse;

    thys->time.tm_sec = result->tm_sec;
    thys->time.tm_min = result->tm_min;
    thys->time.tm_mday = result->tm_mday;
    thys->time.tm_wday = result->tm_wday;
    thys->time.tm_hour = result->tm_hour;
    thys->time.tm_mon  = result->tm_mon;
    thys->time.tm_year = result->tm_year;
#else /* !(__ppc__ || WIN32) */
    result = (struct tm *)localtime_r(&timer,&thys->time);

    if(!result)
	return ajFalse;
#endif /* __ppc__ || WIN32 */

    return ajTrue;
}
Beispiel #4
0
int main(int argc, char **argv)
{
    AjPFile outfile = NULL;
    AjBool full = AJFALSE;
    AjPStr tmpstr = NULL;

    embInit("embossversion", argc, argv);

    full = ajAcdGetBoolean("full");
    outfile = ajAcdGetOutfile("outfile");

    if (!full) {
	ajFmtPrintF(outfile,"%s\n", VERSION);
    }
    else {
	tmpstr = ajStrNewRes(128);

        ajStrAssignS(&tmpstr, ajNamValuePackage());
	if (!ajStrGetLen(tmpstr))
	    ajStrAssignC(&tmpstr, "(unknown)");
	ajFmtPrintF(outfile, "PackageName: %S\n", tmpstr);

        ajStrAssignS(&tmpstr, ajNamValueVersion());
	if (!ajStrGetLen(tmpstr))
	    ajStrAssignC(&tmpstr, "(unknown)");
	ajFmtPrintF(outfile, "LibraryVersion: %S\n", tmpstr);

        ajStrAssignS(&tmpstr, ajNamValueSystem());
	if (!ajStrGetLen(tmpstr))
	    ajStrAssignC(&tmpstr, "(unknown)");
	ajFmtPrintF(outfile, "System: %S\n", tmpstr);

        ajStrAssignS(&tmpstr, ajNamValueInstalldir());
	if (!ajStrGetLen(tmpstr))
	    ajStrAssignC(&tmpstr, "(unknown)");
	ajFmtPrintF(outfile, "InstallDirectory: %S\n", tmpstr);

        ajStrAssignS(&tmpstr, ajNamValueRootdir());
	if (!ajStrGetLen(tmpstr))
	    ajStrAssignC(&tmpstr, "(unknown)");
	ajFmtPrintF(outfile, "RootDirectory: %S\n", tmpstr);
	    
        ajStrAssignS(&tmpstr, ajNamValueBasedir());
	if (!ajStrGetLen(tmpstr))
	    ajStrAssignC(&tmpstr, "(unknown)");
	ajFmtPrintF(outfile, "BaseDirectory: %S\n", tmpstr);
	    
	if (!ajNamGetValueC("acdroot", &tmpstr))
	    ajStrAssignC(&tmpstr, "(default)");
	ajFmtPrintF(outfile, "Emboss_AcdRoot: %S\n", tmpstr);
	    
	if (!ajNamGetValueC("data", &tmpstr))
	    ajStrAssignC(&tmpstr, "(default)");
	ajFmtPrintF(outfile, "Emboss_Data: %S\n", tmpstr);
	    
	if (!ajNamGetValueC("filter", &tmpstr))
	    ajStrAssignC(&tmpstr, "(default)");
	ajFmtPrintF(outfile, "Emboss_Filter: %S\n", tmpstr);
	    
	if (!ajNamGetValueC("format", &tmpstr))
	    ajStrAssignC(&tmpstr, "(default)");
	ajFmtPrintF(outfile, "Emboss_Format: %S\n", tmpstr);
	    
	if (!ajNamGetValueC("graphics", &tmpstr))
	    ajStrAssignC(&tmpstr, "(default)");
	ajFmtPrintF(outfile, "Emboss_Graphics: %S\n", tmpstr);
	    
	if (!ajNamGetValueC("httpversion", &tmpstr))
	    ajStrAssignC(&tmpstr, "(default)");
	ajFmtPrintF(outfile, "Emboss_HttpVersion: %S\n", tmpstr);
	    
	if (!ajNamGetValueC("language", &tmpstr))
	    ajStrAssignC(&tmpstr, "(default)");
	ajFmtPrintF(outfile, "Emboss_Language: %S\n", tmpstr);
	    
	if (!ajNamGetValueC("options", &tmpstr))
	    ajStrAssignC(&tmpstr, "(default)");
	ajFmtPrintF(outfile, "Emboss_Options: %S\n", tmpstr);
	    
	if (!ajNamGetValueC("outdirectory", &tmpstr))
	    ajStrAssignC(&tmpstr, "(default)");
	ajFmtPrintF(outfile, "Emboss_OutDirectory: %S\n", tmpstr);
	    
	if (!ajNamGetValueC("outfeatformat", &tmpstr))
	    ajStrAssignC(&tmpstr, "(default)");
	ajFmtPrintF(outfile, "Emboss_OutFeatFormat: %S\n", tmpstr);
	    
	if (!ajNamGetValueC("outformat", &tmpstr))
	    ajStrAssignC(&tmpstr, "(default)");
	ajFmtPrintF(outfile, "Emboss_OutFormat: %S\n", tmpstr);
	    
	if (!ajNamGetValueC("proxy", &tmpstr))
	    ajStrAssignC(&tmpstr, "(default)");
	ajFmtPrintF(outfile, "Emboss_Proxy: %S\n", tmpstr);
	    
	if (!ajNamGetValueC("stdout", &tmpstr))
	    ajStrAssignC(&tmpstr, "(default)");
	ajFmtPrintF(outfile, "Emboss_Stdout: %S\n", tmpstr);
	    
	if (!ajNamGetValueC("warnrange", &tmpstr))
	    ajStrAssignC(&tmpstr, "(default)");
	ajFmtPrintF(outfile, "Emboss_WarnRange: %S\n", tmpstr);
	    
    }

    ajFileClose(&outfile);

    embExit();

    return 0;
}