/* -*-objc-*- */

/* 
  $Header$
  $Author: dglattin $
  $Date$
  $Log$
 */

#include  <assert.h>
#include  <limits.h>
#include  <stdlib.h>
#include  <strings.h>
#include  <SubClass3.h>


@implementation SubClass3

#define THE_MESSAGE "This is a test message from"


+ initialize {

  printf( "If you see this message then SubClass3 received a"
    " +initialize method\n" );
  
  return self;
}


+ new {

  self = [ super new ];
  sprintf (smart, THE_MESSAGE);

  return self;
}


- print:( const char* )aPhrase {

  char  aMsg[ 2048 ];
  
  
  sprintf( aMsg, "This message comes to you from SubClass3 forwarded"
    " to it's super class, msg=%s\n", aPhrase );
  
  return [ super print:aMsg ] ;
}


- ( int )additionalMethod {


  return INT_MAX;
}


- storeOn:( int )aFd {

  int len;
  
  
  [ super storeOn:aFd ];
  len = write (aFd, smart, sizeof (smart));
  assert(len == sizeof (smart));
  
  return self;
}


- readFrom:( int )aFd {

  int len;
  
  
  [ super readFrom:aFd ];
  len = read (aFd, smart, sizeof (smart));
  assert(len == sizeof (smart));
  assert(!strcmp (smart, THE_MESSAGE));
  
  return self;
}



@end