Exemplo n.º 1
0
UInt16 OpenPrefsDatabase(void) {
  JMPalmPrefs = DmOpenDatabaseByTypeCreator(JMPalmPrefsType, JMPalmAppID,
					    dmModeReadWrite);

  // the database doesn't exist
  if (!JMPalmPrefs) {
    MemHandle foo;
    UInt16 position = 1;

    if (DmCreateDatabase(0, JMPalmPrefsName,
			 JMPalmAppID, JMPalmPrefsType, false))
      return true;
    
    JMPalmPrefs = DmOpenDatabaseByTypeCreator(JMPalmPrefsType, JMPalmAppID,
					      dmModeReadWrite);
		 		 
    ResetHeader();
    
    // create dummy record
    foo = DmNewRecord(JMPalmPrefs, &position, sizeof(headerdata));
    DmReleaseRecord(JMPalmPrefs, position, true);
    WriteHeader();

    // Do some special handling for the first run of the application
    HandleFirstRun();
  }

  return false;
}
Exemplo n.º 2
0
CFileLayer::CFileLayer(char* pName)
: CBaseLayer(pName)
{
	ResetHeader();
	m_ackReady = FALSE;
	BooleanErr = TRUE;
	RecEnd = FALSE;
}
Exemplo n.º 3
0
ARPLayer::ARPLayer(char* pName)
	: CBaseLayer(pName)
{
	ResetHeader();


	ARPTable.InitHashTable(23);
}
Exemplo n.º 4
0
// Read the header data
UInt16 ReadHeader(void) {
  UInt16 err;
  MemHandle headerMH = NULL;
  MemPtr    headerMP = NULL;
  headerdata* foo;

  err = false;

  headerMH = DmGetRecord(JMPalmPrefs, 0);
  
  if (headerMH != NULL)
    headerMP = MemHandleLock(headerMH);

  foo = (headerdata*)headerMP;

  // copy the object
  if (foo != NULL) {
    memcpy(&hd, foo, sizeof(headerdata));

    // Header version incompatible?
    if (hd.version <= INCOMPATIBILITY_LEVEL) { 
      FrmCustomAlert(ErrorMessageForm, "Installation error: You must"\
		     " delete old JMPalm versions before installing"\
		     " this version. Please delete and reinstall.",
		     0, 0);
      err = true;
    }
    else if (hd.version < CURRENT_SETTINGS_VERSION) {
      FrmCustomAlert(ErrorMessageForm, "New (incompatible) version of "\
		     "JMPalm installed, "\
		     "your settings are lost!", 0, 0);
      drawSplash();
      ResetHeader();
    }
  }

  if (headerMH != NULL) {
    MemHandleUnlock(headerMH);
    DmReleaseRecord(JMPalmPrefs, 0, true);
  }

  return err;
}
Exemplo n.º 5
0
CEthernetLayer::CEthernetLayer( char* pName )
: CBaseLayer( pName )
{
	ResetHeader( ) ;
}
Exemplo n.º 6
0
CIPLayer::CIPLayer( char* pName )
: CBaseLayer( pName )
{
	ResetHeader( );
}
Exemplo n.º 7
0
CChatAppLayer::CChatAppLayer( char* pName ) 
	: CBaseLayer( pName ), 
	mp_Dlg( NULL )
{
	ResetHeader( ) ;
}
Exemplo n.º 8
0
CARPLayer::CARPLayer(char* pName)
: CBaseLayer( pName ), ARP_REQUEST(0x100), ARP_REPLY(0x200) // bigendian 으로 가기때문에 이렇게 설정.
{
	ResetHeader();
}
Exemplo n.º 9
0
BinaryMessage& BinaryMessage::operator=(const BinaryMessage& rvalue) {
  data_ = rvalue.data_;
  ResetHeader();
  return *this;
}
Exemplo n.º 10
0
BinaryMessage::BinaryMessage(const BinaryMessage& other) : Message(MessageType::BINARY) {
  data_ = other.data_;
  ResetHeader();
}
Exemplo n.º 11
0
BinaryMessage::BinaryMessage(const char* data, uint32_t length, bool has_hdr) : Message(MessageType::BINARY) {
  AssignData(data, length, has_hdr);
  ResetHeader();
}
Exemplo n.º 12
0
BinaryMessage::BinaryMessage(const std::string& data, bool has_hdr) : Message(MessageType::BINARY) {
  AssignData(data.data(), data.size(), has_hdr);
  ResetHeader();
}
CARPLayer::CARPLayer(char* pName)
: CBaseLayer( pName ), ARP_REQUEST(0x100), ARP_REPLY(0x200)
{
	ResetHeader();
}