axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From susan...@apache.org
Subject cvs commit: xml-axis/c/src/server/samples/cservice Service.c Service.h
Date Mon, 01 Sep 2003 13:36:24 GMT
susantha    2003/09/01 06:36:24

  Added:       c/src/server/samples/cservice Service.c Service.h
  Log:
  new sample web services
  
  Revision  Changes    Path
  1.1                  xml-axis/c/src/server/samples/cservice/Service.c
  
  Index: Service.c
  ===================================================================
  // Service.cpp: implementation of the Service functions.
  //
  //////////////////////////////////////////////////////////////////////
  
  #include "Service.h"
  #include <math.h>
  
  
  int AddInt(int a, int b)
  {
  	return a+b;
  }
  
  Point* AddPoint(Point *p1, Point *p2)
  {
  	Point* ret = (Point*)malloc(sizeof(Point));
  	ret->x = p1->x + p2->x;
  	ret->y = p1->y + p2->y;
  	return ret;
  }
  
  double Distance(Point *p1, Point *p2)
  {
  	return sqrt(pow((p1->x - p2->x),2) + pow((p1->y - p2->y),2));
  }
  
  double Perimeter(const Triangle* pTri)
  {
  	double peri = 0;
  	peri = sqrt(pow((pTri->p1->x - pTri->p2->x),2) + pow((pTri->p1->y - pTri->p2->y),2));
  	peri += sqrt(pow((pTri->p3->x - pTri->p2->x),2) + pow((pTri->p3->y -
pTri->p2->y),2));
  	peri += sqrt(pow((pTri->p1->x - pTri->p3->x),2) + pow((pTri->p1->y -
pTri->p3->y),2));
  	return peri;
  }
  
  
  1.1                  xml-axis/c/src/server/samples/cservice/Service.h
  
  Index: Service.h
  ===================================================================
  // Service.h: interface for the Service functions.
  //
  //////////////////////////////////////////////////////////////////////
  
  #if !defined(__SERVICE_HEADERFILE_INCLUDED__)
  #define __SERVICE_HEADERFILE_INCLUDED__
  
  #include <malloc.h>
  
  typedef struct PointTag
  {
  	int x;
  	int y;
  } Point;
  
  typedef struct TriangleTag
  {
  	Point* p1;
  	Point* p2;
  	Point* p3;
  } Triangle;
  
  //double Distance(Point* p1, Point* p2);
  //Point* AddPoint(Point* p1, Point* p2);
  //int AddInt(int a, int b);
  
  #endif // !defined(__SERVICE_HEADERFILE_INCLUDED__)
  
  
  

Mime
View raw message