Exemple #1
0
int LYTestMailcapCommand( char *testcommand, char *params )
{
  int eax;
  int result;
  char TmpFileName[256];
  HTChunk *expanded = 0;
  if ( LYMailcapUsesPctS( testcommand ) & 255 )
  {
    if ( LYOpenTemp( TmpFileName, ".html", "w" ) == 0 )
    {
      ExitWithError( gettext( "Can't open temporary file!" ) );
    }
    LYCloseTemp( TmpFileName );
  }
  else
    TmpFileName[0] = 0;
  expanded = HTChunkCreate( 1024 );
  result = BuildCommand( expanded, testcommand, TmpFileName, params );
  if ( result )
  {
    result = 1;
    if ( WWW_TraceFlag == 0 || ( WWW_TraceMask & 8 ) == 0 )
    {
      HTChunkFree( expanded );
      LYRemoveTemp( TmpFileName );
      return result;
    }
    fprintf( TraceFP( ), "PassesTest: Deferring test command: %s\n", &expanded->data );
  }
  else
  {
    if ( WWW_TraceFlag && ( WWW_TraceMask & 8 ) )
    {
      fprintf( TraceFP( ), "PassesTest: Executing test command: %s\n", &expanded->data );
    }
    result = LYSystem( &expanded->data );
    if ( result )
    {
      result = -1;
      if ( WWW_TraceFlag == 0 || ( WWW_TraceMask & 8 ) == 0 )
      {
        HTChunkFree( expanded );
        LYRemoveTemp( TmpFileName );
        return result;
      }
      fprintf( TraceFP( ), "PassesTest: Test failed!\n" );
    }
    else
    {
      if ( WWW_TraceFlag == 0 || ( WWW_TraceMask & 8 ) == 0 )
      {
        HTChunkFree( expanded );
        LYRemoveTemp( TmpFileName );
        return result;
      }
      fprintf( TraceFP( ), "PassesTest: Test passed!\n" );
    }
  }
}
Exemple #2
0
char *LYMakeMailcapCommand( char *command, char *params, char *filename )
{
  HTChunk *expanded = 0;
  char *result = 0;
  expanded = HTChunkCreate( 1024 );
  BuildCommand( expanded, command, filename, params );
  HTSACopy( &result, &expanded->data );
  HTChunkFree( expanded );
  return result;
}
Exemple #3
0
PUBLIC HTStream * CSUserLists (HTRequest *	request,
                               void *	param,
                               HTFormat	input_format,
                               HTFormat	output_format,
                               HTStream *	output_stream)
{
    HTStream * me;
    if ((me = (HTStream *) HT_CALLOC(1, sizeof(HTStream))) == NULL)
        HT_OUTOFMEM("CSUserLists");
    me->isa = &CSUserListClass;
    me->request = request;
    me->target = output_stream;
    me->buffer = HTChunkCreate(512);
    /*    me->URLs = HTList_new(); */
    if (!UserList)
        UserList = HTList_new();
    me->EOLstate = EOL_BEGIN;
    /*
        if (HTRequest_context(request))
            *((HTList **)HTRequest_context(request)) = me->URLs;
    */
    return me;
}