Changeset 129

Show
Ignore:
Timestamp:
03/10/09 14:52:58 (15 years ago)
Author:
bhilburn
Message:

Policy engine demo now compiling and successfully building a binary. The code is
a horrible, horrible mismatch of C and C++ string functions, however. Need to
clean it up, badly.

Location:
vtcross/branches/bhilburn
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • vtcross/branches/bhilburn/.gitignore

    r122 r129  
    2929 
    3030\.* 
     31 
     32# Binary files 
     33policy_demo 
  • vtcross/branches/bhilburn/src/policy_engines/default_policy_engine.cpp

    r127 r129  
    1 #include <stdio.h> 
     1#include <cstdlib> 
     2#include <cstdio> 
    23#include <sys/types.h> 
    34#include <sys/socket.h> 
    45#include <netinet/in.h> 
    56#include <netdb.h> 
    6 #include <stdlib.h> 
     7#include <string> 
    78#include <string.h> 
    89 
    910#include "vtcross/cbr.h" 
    1011#include "vtcross/containers.h" 
     12 
    1113 
    1214#define CR_PORT 30002 
     
    9698        ReadMessage(sockfd,buffer); 
    9799        printf("Name: %s\n", buffer); 
    98         strcpy(pList[i].name, buffer); 
     100        pList[i].name = std::string(buffer); 
     101//        strcpy(pList[i].name.c_str(), buffer); 
    99102     
    100103        bzero(buffer,256); 
    101104        ReadMessage(sockfd,buffer); 
    102105        printf("Units: %s\n", buffer); 
    103         strcpy(pList[i].units, buffer); 
     106        pList[i].units = std::string(buffer); 
     107 //       strcpy(pList[i].units.c_str(), buffer); 
    104108 
    105109        bzero(buffer,256);