All pastes #391832 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-03-12 13:05 UTC
rendered paste body
AZIENDA.C ##############

#include "soapH.h"
#include "azienda.nsmap"
#include "errorClass.h"

struct errorTrace *error; //red: ErrorTrace *error;

int main(int argc, char **argv)
{ int m, s; /* master and slave sockets */

  struct soap soap;
  soap_init(&soap);

  initErrorStruct(&error); //red: initErrorStruct(error);

  if (argc < 2)
...
...

###################################



ERROR.H ##################################
#include <stdlib.h>

struct error_trace { int faultCode; char *faultString; char *faultFunction; };
//red: typedef struct errorTrace { int fault_code; char *fault_string; char *fault_function; } ErrorTrace;

//int setError();
int initErrorStruct(struct errorTrace **error); //red: int init_error_struct(ErrorTrace *error);
##############################


ERROC.C ################################

#include "errorClass.h"

int initErrorStruct(struct errorTrace **error)
//red: int init_error_struct(ErrorTrace *error)
{int size = sizeof(struct errorTrace*); //red: int size = sizeof(ErrorTrace);

    *error = (struct errorTrace*)malloc(size);
    (*error)->faultCode = 0;
    (*error)->faultString = (char *)malloc(sizeof(char*));
    (*error)->faultFunction = (char *)malloc(sizeof(char*));
/*red: error = calloc(1, size);
       error->fault_code = 0;
       error->fault_string = NULL;
       error->fault_function = NULL;
*/
return 1;
}