Hallo
DP'ler.
Wir schreiben ein werkzeug das mit Tobit David kommunizieren soll.
Im Archiv-Verzeichnis des David-Servers liegt unter anderem eine Datei names archive.dat.
Diese Daten enthält Informationen über die im Archiv enthaltenen Objekte.
Diese Informationen sind als 430 Byte große Datensätze abgespeichert und können ausgelesen werden (sollen).
Dafür liegt der Doku eine C-Struktur names TSendRec bei.
Leider sind meine C-Kentnisse mehr als dürftig und so habe ich große Schwierigkeiten diese Structur in Delphi umzusetzen.
Ich weiß dass das eine ungewöhnliche Frage ist, aber ihr würdet mir echt weiterhelfen wenn ihr mir diese Structur in Delphi übersetzt könntet.
Vielen Dank schon mal im voraus.
Hier die C-Structur TSendRec: (sorry für den langen Post)
Code:
#ifndef TSENDREC_H_INCLUDED
#define MA_KEINE 0
#define MA_ABSCHLUSS 1
#define MA_IMMER 2
#define MA_ERROR 3
#define MA_ABSCHLUSSERROR 4
#ifdef __TURBOC__
typedef struct {
WORD From;
WORD Threshold;
} TSAMCond;
#else
typedef struct {
WORD From;
WORD Threshold;
} TSAMCondOld;
typedef struct {
long From : 12;
long To : 12;
long Threshold : 8;
} TSAMCond;
#endif
#define LineSpecL(n) (*((long*) &n))
typedef enum {
PL_G3,
PL_FAXPLUS,
PL_FAXIP,
PL_EMAIL,
PL_WAV,
PL_TMAIL,
PL_SMS,
PL_ECT,
PL_FAX_BCAST,
PL_EMAIL_BCAST,
PL_SMS_BCAST,
PL_HOUSECTRL,
PL_COUNT
} TLineSpecNo;
#define LSN2LS(lsn) (1L << lsn)
#define LS_G3 LSN2LS(PL_G3)
#define LS_FAXPLUS LSN2LS(PL_FAXPLUS)
#define LS_FAXIP LSN2LS(PL_FAXIP)
#define LS_EMAIL LSN2LS(PL_EMAIL)
#define LS_WAV LSN2LS(PL_WAV)
#define LS_TMAIL LSN2LS(PL_TMAIL)
#define LS_SMS LSN2LS(PL_SMS)
#define LS_ECT LSN2LS(PL_ECT)
#define LS_FAX_BCAST LSN2LS(PL_FAX_BCAST)
#define LS_EMAIL_BCAST LSN2LS(PL_EMAIL_BCAST)
#define LS_SMS_BCAST LSN2LS(PL_SMS_BCAST)
#define LS_HOUSECTRL LSN2LS(PL_HOUSECTRL)
#define LS_ALL (0xFFFFFFFF)
#define LS_FAX_ (LS_G3|LS_FAXPLUS|LS_FAXIP|LS_FAX_BCAST)
#define LS_FREE_MAIL (LS_EMAIL|LS_EMAIL_BCAST|LS_SMS_BCAST)
typedef long TLineSpec;
#define SRFBDocNo NextBroadCastPos
typedef enum {
DOC_TYPE_FAX, // 000
DOC_TYPE_DIR, // 001
DOC_TYPE_EMAIL, // 010
DOC_TYPE_TMAIL, // 011
DOC_TYPE_WAV, // 100
DOC_TYPE_EXT, // 101
DOC_TYPE_ADDR, // 110
DOC_TYPE_SMS, // 111
DOC_TYPE_UNKNOWN, // 1000
DOC_TYPE_SCHEDULE, // 1001
DOC_TYPE_ECT, // 1010
DOC_TYPE_LINK, // 1011
} TDocTypeEnum;
#define FAXHUB_ACCEPTED 0
#define FAXHUB_ACTIVE 1
#define FAXHUB_REJECTED 2
#define FAXHUB_DONE 3
#ifndef TCHKSUM
#define TCHKSUM
//see also y:\allgdef.h
typedef union {
WORD W;
struct { BYTE xorsum;
BYTE nullen;
};
} TChkSum;
#endif
typedef struct {
BYTE Compression : 3;
BYTE Flash : 1;
BYTE Split : 4;
} TSMSFlags;
typedef union {
DWORD DW;
struct {
DWORD Time: 20;
#define SSA_BUSY 0
#define SSA_FREE 1
#define SSA_TENTATIVE 2
#define SSA_OUTOFOFFICE 3
DWORD ShowAs: 4;
DWORD reserved1: 4;
DWORD reserved: 1;
DWORD Private: 1;
DWORD WasActive: 1;
DWORD Active: 1;
};
#define SetScheduleShowAs(v,as) (v).ShowAs = (DWORD) (as)
#define SetSRScheduleShowAs(sr,as) SetScheduleShowAs((sr)->ScheduleReminderOffset,as)
#define GetScheduleShowAs(v) (v).ShowAs
#define GetSRScheduleShowAs(sr) GetScheduleShowAs ((sr)->ScheduleReminderOffset)
} TScheduleReminderOffset;
#define SRSMSFlags(sr) (*((TSMSFlags*) (&(sr)->FaxBoxFlags)))
#define ARCHIVE_USER_ID (0xFFFFFFFFL)
#define SERVER_USER_ID (-2)
typedef struct {
#define SND_FREE Bit00
#define SND_AT_TLD Bit01
#define SND_DIR_ONLYMAINARCHIVE SND_AT_TLD
#define SND_RNDWAIT Bit02
#define SND_RX Bit03
#define SND_PRINTED Bit04
#define SND_INHIBIT Bit05
#define SND_MASTER_BROADCAST Bit06
#define SND_MOVE_AS_DEFAULT SND_MASTER_BROADCAST
#define SND_BROADCAST Bit07
#define SND_VIEWED Bit08
#define SND_ACCOUNTED Bit09
#define SND_DELETED Bit10
#define SND_USR_INHIBIT Bit11
#define SND_DEL_RND Bit12
#define SND_IGNORE_TRY Bit13
#define SND_MASTER_COLLECTION Bit14
#define SND_READONLY Bit15
WORD Status;
#define SNDO_SHORTCUT Bit00
#define SNDO_PRIVATE Bit01
#define SNDO_PRIORITY_MASK (Bit02|Bit03)
#define SNDO_100x200 Bit04
#define SNDO_HTML SNDO_100x200
#define SNDO_EMAIL_EXTERN Bit05
#define SNDO_DISABLE_COLLECT Bit06
#define SNDO_FAXMERGE Bit07
#define SNDO_BFX Bit08
#define SNDO_NOAPPENDDEL Bit09
#define xxx SNDO_CALC_ACC_REQ Bit10
#define SNDO_FAXBOX Bit11
#define SNDO_DOCTYPE_MASK (Bit12|Bit13|Bit14)
#define SNDO_REMINDER Bit15
WORD Options;
#define SNDF_PM_SEND_MASK (SNDF_GOOD_BAD_MASK|SNDF_DFML|SNDF_CC|SNDF_TRACK_ENTRY|SNDF_REGISTERED_DELIVERY)
#define SNDF_FORWARD Bit00
#define SNDF_THUMBNAILCREATED Bit01
#define SNDF_OWNER Bit02
#define SNDF_DONOTCHECKDELIVERY Bit03
#define SNDF_DIAL_ACCOUNTKEY Bit04
#define SNDF_GOOD Bit05
#define SNDF_BAD Bit06
#define SNDF_GOOD_BAD_MASK (SNDF_GOOD|SNDF_BAD)
#define SNDF_NOLOG Bit07
#define SNDF_CHKSUM Bit08
#define SNDF_ARCHIVE_OWNER Bit09
#define SNDF_SORT_UP Bit10 /* only in ARCHIVE.DIR */
#define SNDF_ALLDAY_EVENT Bit10 /* only in ARCHIVE.DAT */
#define SNDF_AUTODEL_CORRECT Bit11
#define SNDF_AUTODEL_CONCLUSION Bit12
#define SNDF_AUTODEL (SNDF_AUTODEL_CORRECT | SNDF_AUTODEL_CONCLUSION)
#define SNDF_CHECKARCHIVE Bit13
#define SNDF_0PAGES Bit14
#define SNDF_DISABLE_IHS_REPLICATION Bit15
#define SNDF_RESENDED_JOB Bit16
#define SNDF_CALC_ACCOUNT Bit17
#define SNDF_CONNECT Bit18
#define SNDF_BROADCAST Bit19
#define SNDF_DFML Bit20
#define SNDF_CC Bit21
#define SNDF_MIGRATE Bit22
#define SNDF_MA_DELETE_MARK Bit23
#define SNDF_CALC_ACC_REQ Bit24
#define SNDF_REPLICATE Bit25 /* only in ARCHIVE.DIR */
#define SNDF_TRACK_ENTRY Bit25 /* only in ARCHIVE.DAT */
#define SNDF_INHIBIT_REPLICATE Bit26 /* only in ARCHIVE.DIR */
#define SNDF_REGISTERED_DELIVERY Bit26 /* only in ARCHIVE.DAT */
#define SNDF_NUMBER_CLI_COMPARE Bit27
#define SNDF_APPOINTMENT Bit28
#define SNDF_DISABLE_INDEX Bit29 /* only in ARCHIVE.DIR */
#define SNDF_EX_BROADCAST Bit29 /* only in ARCHIVE.DAT */
#define SNDF_DOCMAN Bit30 /* Fa: Info-SYS */
/* Produkt: DocMan */
#define SNDF_TELEFORM_FLAG Bit31
//----------------------------------------
long Flags;
#define SNDX_
#define SNDX_NO_LOCAL Bit21
#define SNDX_ATTENDEES Bit22
#define SNDX_ETRN Bit23
#define SNDX_REPLYED Bit24
#define SNDX_FORWARDED Bit25
#define SNDX_IHS_JOB Bit26
#define SNDX_TLS_USED Bit27
#define SNDX_OVERWRITE Bit28
#define SNDX_USETLS Bit29
#define SNDX_NOARCHIVE Bit30
#define SNDX_RESEARCH Bit31
long FlagsEx; //Only for internal use
long Owner; //Only for internal use
long QID; //The Queue where the job
//was printed
WORD PageCount; //Summary pages of the job
Long StatusTime; //Time of the log according to
//the status, and the time is
//coded as UCT (Unsiversal
//Coordinated Time). Represents
//a counter of secondes since
//00:00:00 1.Jan.1970
long SendTime; //Sending date for the job.
//Definitions are in the following
//table:
#define ST_IMMEDIATE -1
#define ST_NIGHT -2
#define xST_DY (-10)
#define xST_DY_IMMEDIATE (-10)
#define xST_DY_QUICK (-11)
#define xST_DY_NORMAL (-12)
#define xST_DY_AT_BEST (-13)
char TriesDone; //Number of sending tries.
char ErrorNo; //The following error codes are
//obligatory for the Transport Layer
//Drivers. They are stored in the
//variable ErrorNo in the TsendRec
0 sent
1..9 unknown error
10 unknown hardware problem
...
97..100 unknown error
WORD AbortStatus; // Reserved
long TotalBroadCastCnt; //total number of broadcasts
char PagesSent; //Correct transmitted pages before
//an error appears
char FaxBoxFlags; //Only for internal use.
//Definitions are in the following
//table:
#define FBF_DELDOC Bit00
#define FBF_APPDOC Bit01
#define FBF_NEWDOC (Bit00 | Bit01)
#define FBF_FORWARD Bit02
WORD RndCount; //Current broadcast counter
WORD BaudRate; //In the case of the TLD.TX,
//this entry contains the baud
//rate which should not be
//exceeded when sending. When
//a fax is received, the
//corresponding transmissionrate is
//entered into thisvariable in the
//file TLD.RX.
0 = 2.400 Baud
1 = 4.800 Baud
2 = 7.200 Baud
3 = 9.600 Baud
4 = 12.000 Baud
5 = 14.400 Baud
char AktLine; //Only for internal use
WORD RecNo; //Only for internal use
WORD UnitsCount; //Only for internal use
WORD Duration; //If the fax hardware does NOT
//support the evalution of the
//charge impulse, the entries
//transmission time (in seconds)
//requested for the transmission
//has to be inserted in this
//variable.
char PrintedOn; //Only for internal use
char MaxRepeats; //Only for internal use
char NoticeType; //Only for internal use
char xxxx_del_GraphType; //Only for internal use
char SysArt; //Kind of the log file for
//example saREC, saLOG…
long NextBroadCastPos; //Only for internal use
char Printing; //Only for internal use
//Definitions are in the following
//table:
#define DR_NEVER 0
#define DR_ONLY_IF_SENT 1
#define DR_ALWAYS 2
#define DR_ONLY_IF_NOT_SENT 3
#define DR_ON_COMPLETION 4
long OutPRNNo; //Only for internal use
char SourceFileName [8+1]; //Only for internal use
long ExStatusTime; //Only for internal use
WORD Account; //Supports the fax hardware
//the accounting, so is account
//carying the number of tics.
char AllowedTLDLine; //Only for internal use
TChkSum ChkSum; //Checksum
char SourceFileDir; //Number of the FileFaxService
long SenderID; //Only for internal use
TSAMCond SAM; //Information about a collection
TScheduleReminderOffset ScheduleReminderOffset;
char xxx_2_try_RoutNo [8 + 1];//Indentification for distribution
char RoutSign; //Only for internal use.
//Definitions are in the following
//table:
#define xVA_CSID 0
#define xVA_DTMF 1
#define xVA_DID 2
#define xVA_EAZ 3
char Application; //To find easier the logs it is
//possible to give a job an
//application number. You can do it
//with the command @@APPLICATION
//directly in your fax.
long CurrentNumber; //Only for internal use
char ErrorGroup; //Only for internal use
char Text [263]; //This field contains the most
//important information about a log
//like
0 –
1 Called Number
// ...
//Every entry is beginning with
//the string ID, look above, and
//ends with NULL.
char Reserve [1]; //Only for internal use
long LastChangedTime; //Last Replication time
//(in Sec. since 01/01/1970)
BYTE NewDocType; //Same as Options/SNDO_DOCTYPE_MASK
//but has priority over
long ExpireTime; //Expiration of message
BYTE ExtDocType;
#define SRCMD_FLAG_MASK 0xFF000000
#define SRCMDF_COPY 0x01000000
#define SRCMDF_MULTIRX 0x02000000
#define SRCMD_TCK_CMD_MASK 0x000FF000
#define SetSRCommand(sr,cmd) { (sr)->command &= ~ SRCMD_ENUM_MASK; \
(sr)->command |= (cmd & SRCMD_ENUM_MASK); \
}
#define GetSRCommand(sr) ((sr)->command & SRCMD_ENUM_MASK)
#define SetSRTckCmd(sr,n) { (sr)->command &= ~SRCMD_TCK_CMD_MASK; \
(sr)->command |= ((((long) (n)) << 12) & SRCMD_TCK_CMD_MASK); \
}
#define GetSRTckCmd(sr) (((sr)->command & SRCMD_TCK_CMD_MASK) >> 12)
#define SRCMD_ENUM_MASK 0x00000FFF
#define SRCMD_CREATEJOB 1
#define SRCMD_REMIND 2
#define SRCMD_FAX_POLL 3
#define SRCMD_MSG_TRACKING 4
#define SRCMD_INSERTSENDREC 5
#define SRCMD_ADDTRACKINGREPLY 6
#define SRCMD_CREATEARCHIVE 200
long ArchiveProtocolPrinter; //Printer entered in ServiceLayer
//available Printers
long TrackingID [2]; //Message Tracking Information
#define TCKI_RECNO 0 /* RecNo in Tracking List */
#define TCKI_JOBID 1 /* Copy of JobID */
long command; //Only for internal use
char SymbolColor; //Symbol color of Archive icon
long ReminderBits; //Reminder, means what kind of
//remind used
char ServiceID; //Only for internal use
char xxx_del_DirSplitNo; //Only for internal use
WORD OrigDuration; //Only for internal use
TLineSpec LineSpec; //Only for internal use
char RatesNo; //Is used the accounting area
long StopTime; //Calendar stop time of entry
char Delivery; //Only for internal use
//Definitions are in the following
//table:
#define DY_OPTIMIZEDVALUE 10000
#define DY_IMMEDIATE 0
#define DY_QUICK 1
#define DY_NORMAL 2
#define DY_OPTIMIZED 3
long JobID; //Only for internal use
char SymNumber; //Only for internal use
long Creator; //Only for internal use
} TSendRec;
#define SetSRDocType(sr,DocType) { \
(sr)->Options &= ~SNDO_DOCTYPE_MASK; \
(sr)->Options |= (DocType << 12); }
#define GetDocType(options) ((options & SNDO_DOCTYPE_MASK) >> 12)
#define GetSRDocType(sr) GetDocType ((sr)->Options)
#define GetSRDocTypeEx(sr) (((sr)->Flags & SNDF_APPOINTMENT) ? DOC_TYPE_SCHEDULE : \
((sr)->Flags & SNDF_CONNECT) ? DOC_TYPE_ECT : \
GetSRDocType (sr))
#define IsValidExpireTime(ExpireTime) ( (ExpireTime == 0) || (ExpireTime > flGetTime ()) )
#define IsSRValidExpireTime(sr) (IsValidExpireTime ((sr)->ExpireTime))
#define IsSpecialExpireTimeFlag(ExpireTime) ((ExpireTime == 1))
#define IsSRSpecialExpireTimeFlag(sr) (IsSpecialExpireTimeFlag((sr)->ExpireTime))
#define LOW_PRIORITY 1
#define NORMAL_PRIORITY 0
#define HIGH_PRIORITY 2
#ifndef _WINDOWS
#define GetPriority(o) ((o & SNDO_PRIORITY_MASK) >> 2)
#define GetSRPriority(sr) (GetPriority ((sr)->Options))
#else
#define _GetPriority(o) ((o & SNDO_PRIORITY_MASK) >> 2)
#define GetSRPriority(sr) (_GetPriority ((sr)->Options))
#endif
#define SetSRPriority(sr,priority) { \
(sr)->Options &= ~SNDO_PRIORITY_MASK; \
(sr)->Options |= ((priority&3) << 2); }
#define SR_NORMAL 0
#define SR_GOOD 1
#define SR_BAD 2
#define GetGoodBad(f) ((f & SNDF_GOOD_BAD_MASK) >> 5)
#define GetSRGoodBad(sr) (GetGoodBad((sr)->Flags))
#define SetSRGoodBad(sr,goodbad) { \
(sr)->Flags &= ~SNDF_GOOD_BAD; \
(sr)->Flags |= ((goodbad&3) << 5); }
#define IsSRReminderOffset(sr) ((sr)->ScheduleReminderOffset.Active != 0)
#define GetSRReminderOffset(sr) (IsSRReminderOffset(sr) ? (60L * (sr)->ScheduleReminderOffset.Time) : 0)
#define GetSRReminderDateTime(sr) ( ((sr)->ScheduleReminderOffset.Active == 0) ? \
(sr)->SendTime : \
(sr)->SendTime - (60L * (sr)->ScheduleReminderOffset.Time) )
#define TRECRec TSendRec
#define TSENDREC_H_INCLUDED
#endif
Danke und Grüße
Reiner