Lines Matching refs:JM

118   JM: ^JamMsgType;
279 New(JM);
283 If ((JM = Nil) Or (JamIdx = Nil) or (MsgHdr = Nil) or (TxtBuf = Nil)) Then
285 If JM <> Nil Then
286 Dispose(JM);
298 FillChar(JM^, SizeOf(JM^), #0);
299 JM^.MsgPath := '';
300 JM^.IdxStart := -30;
301 JM^.IdxRead := 0;
309 If JM <> Nil Then Dispose(JM);
331 JM^.MsgPath := Copy(St, 1, 124);
337 GetHighMsgNum := JM^.BaseHdr.BaseMsgNum + FileSize(JM^.IdxFile) - 1;
343 JM^.Dest := Addr;
349 JM^.Orig := Addr;
355 JM^.MsgFrom := Name;
361 JM^.MsgTo := Name;
367 JM^.MsgSubj := Str;
391 JM^.MsgDate := SDate;
397 JM^.MsgTime := STime;
507 If (JM^.TxtPos - JM^.TxtBufStart) >= JamTxtBufSize Then
509 If JM^.TxtBufStart = 0 Then
513 Assign(JM^.BufFile, TmpStr);
515 ReWrite(JM^.BufFile, 1);
517 NumWrite := JM^.TxtPos - JM^.TxtBufStart;
518 BlockWrite(JM^.BufFile, TxtBuf^, NumWrite);
520 JM^.TxtBufStart := FileSize(JM^.BufFile);
522 TxtBuf^[JM^.TxtPos - JM^.TxtBufStart] := Ch;
523 Inc(JM^.TxtPos);
639 Case JM^.MailType of
646 DT.Year := Str2Long(Copy(JM^.MsgDate, 7, 2)); {Convert date written}
647 DT.Month := Str2Long(Copy(JM^.MsgDate, 1, 2));
648 DT.Day := Str2Long(Copy(JM^.MsgDate, 4, 2));
654 DT.Hour := Str2Long(Copy(JM^.MsgTime, 1, 2));
655 DT.Min := Str2Long(Copy(JM^.MsgTime, 4, 2));
665 MsgHdr^.JamHdr.TextOfs := FileSize(JM^.TxtFile);
667 MsgHdr^.Jamhdr.TextLen := JM^.TxtPos;
668 If JM^.TxtBufStart > 0 Then
670 i := JM^.TxtPos - JM^.TxtBufStart;
671 BlockWrite(JM^.BufFile, TxtBuf^, i); {write buffer to file}
675 Seek(JM^.BufFile, 0);
680 Seek(JM^.TxtFile, FileSize(JM^.TxtFile));
683 While ((Not Eof(JM^.BufFile)) and (WriteError = 0)) Do
685 BlockRead(JM^.BufFile, TxtBuf^, SizeOf(TxtBuf^), i);
689 JM^.TxtBufStart := FilePos(JM^.TxtFile);
690 JM^.TxtRead := i;
691 BlockWrite(JM^.TxtFile, TxtBuf^, i);
695 Close(JM^.BufFile);
697 Erase(JM^.BufFile);
702 Seek(JM^.Txtfile, FileSize(JM^.TxtFile));
706 BlockWrite(JM^.TxtFile, TxtBuf^, JM^.TxtPos);
708 JM^.TxtRead := JM^.TxtPos;
713 TmpIdx.HdrLoc := FileSize(JM^.HdrFile);
714 TmpIdx.MsgToCrc := JamStrCrc(JM^.MsgTo);
715 Seek(JM^.IdxFile, FileSize(JM^.IdxFile));
720 BlockWrite(JM^.IdxFile, TmpIdx, 1);
725 If Length(JM^.MsgTo) > 0 Then
726 AddSubField(3, JM^.MsgTo);
727 If Length(JM^.MsgFrom) > 0 Then
728 AddSubField(2, JM^.MsgFrom);
729 If Length(JM^.MsgSubj) > 0 Then
732 AddSubField(11, JM^.MsgSubj)
734 AddSubField(6, JM^.MsgSubj);
736 If ((JM^.Dest.Zone <> 0) or (JM^.Dest.Net <> 0) or
737 (JM^.Dest.Node <> 0) or (JM^.Dest.Point <> 0)) Then
738 AddSubField(1, AddrStr(JM^.Dest));
739 If ((JM^.Orig.Zone <> 0) or (JM^.Orig.Net <> 0) or
740 (JM^.Orig.Node <> 0) or (JM^.Orig.Point <> 0)) Then
741 AddSubField(0, AddrStr(JM^.Orig));
742 Seek(JM^.HdrFile, FileSize(JM^.HdrFile)); {Seek to end of .jhr file}
747 BlockWrite(JM^.HdrFile, MsgHdr^, SizeOf(MsgHdr^.JamHdr) +
753 Inc(JM^.BaseHdr.ActiveMsgs);
754 Inc(JM^.BaseHdr.ModCounter);
769 If JM^.TxtPos < 0 Then
771 GetChar := JM^.TxtSubBuf[JM^.TxtSubChars + JM^.TxtPos];
772 Inc(JM^.TxtPos);
773 If JM^.TxtPos >= 0 Then
774 JM^.TxtPos := MsgHdr^.JamHdr.TextOfs;
778 If ((JM^.TxtPos < JM^.TxtBufStart) Or
779 (JM^.TxtPos >= JM^.TxtBufStart + JM^.TxtRead)) Then
781 JM^.TxtBufStart := JM^.TxtPos - 80;
782 If JM^.TxtBufStart < 0 Then
783 JM^.TxtBufStart := 0;
784 Seek(JM^.TxtFile, JM^.TxtBufStart);
789 BlockRead(JM^.TxtFile, TxtBuf^, SizeOf(TxtBuf^), NR);
790 JM^.TxtRead := NR;
792 BlockRead(JM^.TxtFile, TxtBuf^, SizeOf(TxtBuf^), JM^.TxtRead);
797 GetChar := TxtBuf^[JM^.TxtPos - JM^.TxtBufStart];
798 Inc(JM^.TxtPos);
800 EOM := (((JM^.TxtPos < MsgHdr^.JamHdr.TextOfs) Or
801 (JM^.TxtPos > JM^.TxtEnd)) And (JM^.TxtPos >= 0));
813 If JM^.TxtSubChars <= TxtSubBufSize Then
815 JM^.TxtSubBuf[JM^.TxtSubChars] := St[i];
816 Inc(JM^.TxtSubChars);
819 If JM^.TxtSubChars <= TxtSubBufSize Then
821 JM^.TxtSubBuf[JM^.TxtSubChars] := #13;
822 Inc(JM^.TxtSubChars);
852 JM^.MsgFrom := '';
853 JM^.MsgTo := '';
854 JM^.MsgSubj := '';
855 JM^.TxtSubChars := 0;
858 Seek(JM^.HdrFile, JamIdx^[IdxLoc - JM^.IdxStart].HdrLoc);
859 BlockRead(JM^.HdrFile, MsgHdr^, SizeOf(MsgHdr^), NumRead);
863 JM^.MsgDate := FormattedDate(Dt, 'MM-DD-YY');
864 JM^.MsgTime := FormattedDate(Dt, 'HH:II');
873 FillChar(JM^.Orig, SizeOf(JM^.Orig), #0);
878 ParseAddr(TmpStr, JM^.Orig);
882 FillChar(JM^.Dest, SizeOf(JM^.Dest), #0);
887 ParseAddr(TmpStr, JM^.Dest);
890 JM^.MsgFrom[0] := Chr(SubPtr^.DataLen and $ff);
891 If Ord(JM^.MsgFrom[0]) > 65 Then
892 JM^.MsgFrom[0] := #65;
893 Move(SubPtr^.Data, JM^.MsgFrom[1], Ord(JM^.MsgFrom[0]));
896 JM^.MsgTo[0] := Chr(SubPtr^.DataLen and $ff);
897 If Ord(JM^.MsgTo[0]) > 65 Then
898 JM^.MsgTo[0] := #65;
899 Move(SubPtr^.Data, JM^.MsgTo[1], Ord(JM^.MsgTo[0]));
916 JM^.MsgSubj[0] := Chr(SubPtr^.DataLen and $ff);
917 If Ord(JM^.MsgSubj[0]) > 100 Then
918 JM^.MsgSubj[0] := #100;
919 Move(SubPtr^.Data, JM^.MsgSubj[1], Ord(JM^.MsgSubj[0]));
938 JM^.MsgSubj[0] := Chr(SubPtr^.DataLen and $ff);
939 If Ord(JM^.MsgSubj[0]) > 100 Then
940 JM^.MsgSubj[0] := #100;
941 Move(SubPtr^.Data, JM^.MsgSubj[1], Ord(JM^.MsgSubj[0]));
947 JM^.MsgSubj[0] := Chr(SubPtr^.DataLen and $ff);
948 If Ord(JM^.MsgSubj[0]) > 100 Then
949 JM^.MsgSubj[0] := #100;
950 Move(SubPtr^.Data, JM^.MsgSubj[1], Ord(JM^.MsgSubj[0]));
992 JM^.TxtEnd := MsgHdr^.JamHdr.TextOfs + MsgHdr^.JamHdr.TextLen - 1;
993 If JM^.TxtSubChars > 0 Then
994 JM^.TxtPos := - JM^.TxtSubChars
996 JM^.TxtPos := MsgHdr^.JamHdr.TextOfs;
1014 PPos := JM^.TxtPos;
1036 WPos := JM^.TxtPos;
1062 Dec(JM^.TxtPos);
1067 JM^.TxtPos := WPos;
1070 EOM := (((JM^.TxtPos < MsgHdr^.JamHdr.TextOfs) Or
1071 (JM^.TxtPos > JM^.TxtEnd)) And (JM^.TxtPos >= 0));
1078 GetFrom := JM^.MsgFrom;
1084 GetTo := JM^.MsgTo;
1090 GetSubj := JM^.MsgSubj;
1102 GetDate := JM^.MsgDate;
1108 GetTime := JM^.MsgTime;
1130 Seek(JM^.HdrFile, JamIdx^[IdxLoc - JM^.IdxStart].HdrLoc);
1131 BlockRead(JM^.HdrFile, MsgHdr^.JamHdr, SizeOf(MsgHdr^.JamHdr));
1140 Addr := JM^.Orig;
1146 Addr := JM^.Dest;
1243 JM^.CurrMsgNum := MsgNum - 1;
1244 …If JM^.CurrMsgNum < (JM^.BaseHdr.BaseMsgNum - 1) Then JM^.CurrMsgNum := JM^.BaseHdr.BaseMsgNum - 1;
1253 If JM^.CurrMsgNum <= GetHighMsgNum Then Inc(JM^.CurrMsgNum);
1255 While ((JM^.CurrMsgNum <= GetHighMsgNum) and
1256 ((JamIdx^[IdxLoc - JM^.IdxStart].HdrLoc < 0) or
1257 (JamIdx^[IdxLoc - JM^.IdxStart].MsgToCrc = -1))) Do Begin
1258 Inc(JM^.CurrMsgNum);
1268 If JM^.CurrMsgNum >= JM^.BaseHdr.BaseMsgNum Then Dec(JM^.CurrMsgNum);
1270 If JM^.CurrMsgNum >= JM^.BaseHdr.BaseMsgNum Then Begin
1271 While (JM^.CurrMsgNum >= JM^.BaseHdr.BaseMsgNum) and
1272 ((JamIdx^[IdxLoc - JM^.IdxStart].HdrLoc < 0) or
1273 (JamIdx^[IdxLoc - JM^.IdxStart].MsgToCrc = -1)) Do Begin
1274 Dec(JM^.CurrMsgNum);
1283 SeekFound := ((JM^.CurrMsgNum >= JM^.BaseHdr.BaseMsgNum) and
1284 (JM^.CurrMsgNum <= GetHighMsgNum));
1296 JM^.CurrMsgNum := ML;
1302 JM^.TxtBufStart := 0;
1303 JM^.TxtPos := 0;
1309 JM^.MsgTo := '';
1310 JM^.MsgFrom := '';
1311 JM^.MsgSubj := '';
1312 FillChar(JM^.Orig, SizeOf(JM^.Orig), #0);
1313 FillChar(JM^.Dest, SizeOf(JM^.Dest), #0);
1314 JM^.MsgDate := DateStr(GetDosDate);
1315 JM^.MsgTime := TimeStr(GetDosDate);
1321 MsgBaseExists := (FileExist(JM^.MsgPath + '.jhr'));
1332 If JM^.IdxStart < 0 Then JM^.IdxStart := 0;
1333 Seek(JM^.IdxFile, JM^.IdxStart);
1335 BlockRead(JM^.IdxFile, JamIdx^, JamIdxBufSize, NR);
1336 JM^.IdxRead := NR;
1338 BlockRead(JM^.IdxFile, JamIdx^, JamIdxBufSize, JM^.IdxRead);
1345 Seek(JM^.IdxFile, JM^.IdxStart);
1346 BlockWrite(JM^.IdxFile, JamIdx^, JM^.IdxRead);
1356 JM^.LockCount := 0;
1357 Assign(JM^.HdrFile, JM^.MsgPath + '.jhr');
1358 Assign(JM^.TxtFile, JM^.MsgPath + '.jdt');
1359 Assign(JM^.IdxFile, JM^.MsgPath + '.jdx');
1361 Reset(JM^.HdrFile, 1);
1366 BlockRead(JM^.HdrFile, JM^.BaseHdr.Signature{[2]} , SizeOf(JM^.BaseHdr){ - 1});
1372 Reset(JM^.TxtFile, 1);
1378 Reset(JM^.IdxFile, SizeOf(JamIdxType));
1381 JM^.IdxStart := -10;
1382 JM^.IdxRead := 0;
1383 JM^.TxtBufStart := - 10;
1384 JM^.TxtRead := 0;
1394 Close(JM^.HdrFile);
1396 Close(JM^.TxtFile);
1399 Close(JM^.IdxFile);
1415 i := PosLastChar(DirSep, JM^.MsgPath);
1417 If Not MakePath(Copy(JM^.MsgPath, 1, i)) Then
1431 CreateError := SaveFile(JM^.MsgPath + '.jhr', TmpHdr^, SizeOf(TmpHdr^));
1433 If CreateError = 0 Then CreateError := SaveFile(JM^.MsgPath + '.jlr', CreateError, 0);
1434 If CreateError = 0 Then CreateError := SaveFile(JM^.MsgPath + '.jdt', CreateError, 0);
1435 If CreateError = 0 Then CreateError := SaveFile(JM^.MsgPath + '.jdx', CreateError , 0);
1444 JM^.MailType := MT;
1466 Seek(JM^.HdrFile, JamIdx^[IdxLoc - JM^.IdxStart].HdrLoc);
1471 BlockWrite(JM^.HdrFile, MsgHdr^.JamHdr, SizeOf(MsgHdr^.JamHdr));
1487 Dec(JM^.BaseHdr.ActiveMsgs);
1492 Inc(JM^.BaseHdr.ModCounter);
1493 JamIdx^[IdxLoc - JM^.IdxStart].MsgToCrc := -1;
1494 JamIdx^[IdxLoc - JM^.IdxStart].HdrLoc := -1;
1551 Assign(LastFile, JM^.MsgPath + '.jlr');
1578 Assign(LastFile, JM^.MsgPath + '.jlr');
1592 TmpLast.HighRead := JM^.BaseHdr.ActiveMsgs;
1627 GetTxtPos := JM^.TxtPos;
1633 JM^.TxtPos := TP;
1642 If JM^.LockCount = 0 Then
1646 LockError := shLock(JM^.HdrFile, 0, 1);
1650 Seek(JM^.HdrFile, 0);
1655 BlockRead(JM^.HdrFile, JM^.BaseHdr , SizeOf(JM^.BaseHdr));
1659 Inc(JM^.LockCount);
1668 if JM^.LockCount > 0 then Dec(JM^.LockCount);
1669 if JM^.LockCount = 0 then begin
1671 LockError := UnLockFile(JM^.HdrFile, 0, 1);
1674 Seek(JM^.HdrFile, 0);
1678 BlockWrite(JM^.HdrFile, JM^.BaseHdr, SizeOf(JM^.BaseHdr));
1698 IdxLoc := JM^.CurrMsgNum - JM^.BaseHdr.BaseMsgNum;
1699 if ((IdxLoc < JM^.IdxStart) or (IdxLoc >= (JM^.IdxStart+JM^.IdxRead))) then begin
1700 JM^.IdxStart := IdxLoc - 100;