亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? 列表9.2.txt

?? klinux書籍的配套光盤。可以學習學習。
?? TXT
字號:
【列表9.2】 CheckMailStuff 的程序代碼。
unit checkmailstuff;

interface

uses
   SysUtils, Libc;

type                                            
 CountType= (MSG_COUNT, MSG_NOCOUNT);

 function CheckNewMail(logName: String; opType:CountType): Integer;

implementation
var
 ma ilFile: String;
 mailCount: Integer;                                
 new_mailCount: Integer;
 old_mailCount: Integer;
 newMsgs: Integer;                                 
 oldMsgs: Integer;
 lastMTime: Time_T;
 lastSize: Off_T;
 isInternal: boolean;

function isOld( buf: String ): boolean;
begin
  Result := False;
  if ( Pos( 'S', buf ) <> 1 ) and ( Pos( 'X', buf ) <> 1 )
   then Exit;                                       
  // Now check for new status from normal mail clients ..
  if Pos( 'Status:', buf ) = 1
   then begin
     if ( Pos( 'R', buf ) <> 0 ) or ( Pos( '0', buf ) <> 0 )
      then begin
        Result := True;
        Exit;
      end;
 end;
       // ...and check for new status from Netscape clients
       if ( Pos( 'X-Mozilla-Status:', buf ) =1)
        and ( Pos( '0000', buf ) = 19 )
         then begin
           Result := True;
           Exit;
         end;

   end;

   function isFrom( buf: String): boolean;
    var
      sender: String;
      dayNum: Integer;

         function GetWord(s : String; idx : Integer) : String;
         var
          i : Integer;
         s1 : String;
          w : String;
        begin
          s1 := s;
          W := '';
          for i := 1 to idx do
           begin
             while (Length(s1) > 0) and (s1[1] in [' ', ^I]) do
              Delete(s1, 1, 1);
            while (Length(s1) > 0) and not (s1[1] in [' ', ^I]) do
              begin
                if i = idx then w := w + s1[1];
               Delete(s1, 1, 1);
              end; { while }
           end; { for }
         Result := w;
        end;

        function ForceIntConversion(s : String) : Integer;
        var
         i : Integer;
       begin
         if Length(s) > 0
          then begin
                   try
                     i := StrToInt(s);
                   except
                     i := 0;
                end; { try }  ,
              end
       else i := 0;
     Result := i;
    end;

begin                                           
 sender  := '';                                              
 Result := False;

 // If the first 5 chars of the string are    
 // not "From ", return false.
   if Pos( 'From ', buf ) <> 1 then Exit;

  // See if the sending address is missing, by looking
  // for the day of the month in field 4 or 5.
  dayNum := ForceIntConversion(GetWord(buf, 4)
  if dayNum = 0
   then begin                              
            sender := GetWord(buf, 2);
            dayNum := ForceIntConversion(GetWord(buf, 5));
            if (Length(sender) = 0) or (dayNum =0)
              then Exit;
           end;  
                                               
  if dayNum > 31 then Exit;
  // Needed for an "is_Internal" check outsidethis function.
  // THIS IS A SIDE EFFECT.                       
                             
  if  strcmp( PChar( sender), 'MAILER-DAEMON' ) =0
    then isInternal := True;   
                    
   Result := True;
 end;

 function isMultipartMsg( buf: String;
                          var sepLine: String ): boolean;
 var
   idxField: Integer;
   idxSep: Integer;
   lenSep: Integer;
  begin
   Result := false;

   // If the string doesn't start with 'Content-Type: ' return Fa
   if Pos( 'Content-Type: '. buf ) <> i then Exit;
 if Pos( 'multipart/', Copy( buf, 15, 10 ) ) <> 1 then Exit;

 // Starting at the 15th character...
 idxField := 15;

 // ...loop to the end of the string.
 while idxField <= Length( buf ) do
   begin
    // find the next ';' character
    while ( idxField <= Length( buf ) )
      and (Copy( buf, idxField, 1) <> ';' ) do Inc( idxField );

     if Copy( buf, idxField,1) = ';' then Inc( idxField );

     // Now find the next non-space character
     while ( idxField <= Length( buf ))
      and (Copy( buf, idxField, 1 ) = ' ' ) do Inc( idxField);

     // If where we are right now says 'boundary='
     if Copy( buf. idxField, 9 ) = 'boundary=' then
      begin
        idxSep := idxField + 9;
        if Copy( buf, idxSep, 1 ) = '"' then
         begin
           Inc( idxSep );
           lenSep :=0;

           // Count the number of chars between  '"'  chars
           while ( Copy( buf, idxSep + lenSep, 1 ) <>  '"'  )
             and ( Copy( buf, idxSep + lenSep, 1 ) >= ' ' )
              do Inc( lenSep );
          end
        else
          begin
            lenSep := 0;

            // Count the number of chars until a ';' char
           while ( Copy( buf, idxSep + lenSep, 1 ) <> ';'
             and ( Copy( buf, idxSep + lenSep, 1 ) >- ' ' )
               do Inc( lenSep );
          end;
         // copy the separator string into the supplied buffer
         sepLine := '--';
         sepLine := sepLine + Copy( buf, idxSep, lenSep );
         sepLine := sepLine +'--'
       Result := True;
      end;
   end;
end;

function CheckNewMail(logName: String;opType: CountType): Integer;
var
 F: TextFile;
 statBuf: TStatBuf;                              
 timeBuf: TUTimeBuffer;
 line: String;                                   
 sepStr: String;                                 
 inHeader: boolean;
 markedRead: boolean;
 isMultipart: boolean;
begin
 inHeader := False;                              
 markedRead := False;                           
 isMultipart := False;
 timeBuf.actime := 0;                           
 timeBuf.modtime := 0;

 // 第一步,我們郵件的名字是什么?  
 mailFile := _PATH_MAILDIR + '/' + logName;
 // stat the file into the statbuf. If we fail,the file isn't
 // accessible and we automatically return a -l(error)
 if stat(PChar(mailFile), statbuf ) <> 0      
  then begin
           mailCount:= 0;                            
           newMsgs := 0;                               
           oldMsgs := 0;
           Result := -1;                            
           Exit;
          end;

 // If we're running in "no-count" mode then we'll report new mail
 // based on the mailbox file's modification time and size.
 if opType = MSG_NOCOUNT
  then begin
           if   ( statbuf.st_size > 0 )
             and ( statbuf.st_size >= lastSize )
             and ( statbuf.st_mtime >= statbuf.st_atime )
             then new_mailCount := 1
             else new_mailCount := 0;
           // We're not counting, so simply use the fields as a
           // boolean value (that is, either there's mail there,
           // or there isn't).
           if statbuf.st_size > 0
            then mailCount := 1
            else mailCount := 0;
          old_mailCount :=0;
          // Keep track of the size and modification time of the file.
          lastSize := statBuf.st_size;
          lastMTime := statBuf.st_mtime;
          // If there's new mail, return 1. Otherwise, return 0.
          if new_mailCount <> 0
            then begin
                     Result := 1;
                     Exit;
                   end
            else begin
                     Result := 0;
                     Exit;
                   end;
         end;
// We're running in "count" mode.
// If the mailboxes have been modified since last check,
// count the new/total messages.
if  ( statBuf.st_mtime <> lastMTime )
 or ( statBuf.st_size <> lastSize )
 then begin
          // Open the mail file for reading. If we can't,
          // return -1 (error).
          {$I-}
          AssignFile( F, mailFile );
          Reset( F );
          if IOResult <> 0
           then begin
                    {$I+}
                    Result := -1;
                    Exit;
                   end;
         mailCount := 0;
         old_mailCount := 0;
      // Read a line from the file, and loop on whether or not
      // it is available. When we run out of lineS we're done.
while not EOF( F ) do
 begin                                     
   Readln( F, line );
   // If is_multipart is true, AND in_header is false
   if isMultipart and not inHeader
    then begin                               
             // Skip to last line of multipart mail
             if Pos( sepStr, line ) = 1
               then isMultipart := False;
            end                              
     // Else if the line is empty (first char is a newline)
     else begin
     if Length( line ) = 0                 
      then begin
               inHeader := False;              
               isInternal := False;            
              end                                
                                                                                                  // Else if we're on a From: line (see function above)
     else begin                          
              if isFrom( line )
               then begin                       
                        Inc( mailCount );         
                        inHeader := True;        
                        markedRead := False;     
                       end                         
     // Else if inHeader is true AND status_is_old (see above)
     // returns true AND markedRead is false
     else begin                               
              if ( inHeader and isOld( line )and not markedRead)
                then begin                       
                         Inc( old_mailCount );
                         markedRead := True;       
                       end
     // Else if in_header is true AND mailstats.is_internal
     // is true
     else begin
              if inHeader and isInternal
                                                              
                then begin
                         if Pos( 'From: Mail System Internal Data',
                               line ) = 1
                          then begin
                                   inHeader := False;
                                   Dec( mailCount );
                                   isInternal := False;
                               end;
                           end
                         // Else if in_header is true AND this is a
                         // multipart mail message
                        else if inHeader
                                 and isMultipartMsg( line, sepStr )
                                  then isMultipart := True;
              end;
              end;
              end;
              end; { If line is empty }
              end; { while }
          // Close the file  we're done with it.
          CloseFile( F );
          {$I+}

          // Restore the mailfile stat time so that other mail
          // checking programs will function correctly.
          timeBuf.actime := statBuf.st_atime;
          timeBuf.modtime := statBuf.st_mtime;
          utime(PChar(mailFile), @timeBuf );
           // Keep track of things for next time
           lastMtime := statBuf.st_mtime;
           lastSize := statBuf.st_size;
           // Compute the number of new messages
           new_mailCount := mailCount - old_mailCount;
          end; ( if statBuf.st_mtime <> stats.lastMTime }
 Result := new_mailCount;
end;

end.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区在线观看视频| 国产精品免费久久| 婷婷激情综合网| 欧美日韩电影在线播放| 日韩av中文字幕一区二区三区| 日韩一区二区三区在线观看| 蜜臀精品一区二区三区在线观看| 日韩精品一区二区三区视频在线观看 | 奇米色一区二区三区四区| 777午夜精品免费视频| 激情成人综合网| 国产精品成人午夜| 欧美亚洲愉拍一区二区| 美国精品在线观看| 国产精品毛片久久久久久久| 99久久精品国产导航| 午夜精品福利久久久| 久久影院电视剧免费观看| 91蜜桃婷婷狠狠久久综合9色| 亚洲第一久久影院| 久久嫩草精品久久久精品一| 91欧美激情一区二区三区成人| 亚洲成av人片在线观看| 欧美成人女星排行榜| 成人黄动漫网站免费app| 天堂成人免费av电影一区| 国产亚洲精品bt天堂精选| 色94色欧美sute亚洲线路一久 | 日韩视频免费观看高清在线视频| 国产一区二区三区视频在线播放| 中文字幕永久在线不卡| 欧美一级黄色大片| 99精品国产热久久91蜜凸| 美女高潮久久久| 国产精品国产精品国产专区不片| 欧美高清性hdvideosex| 99精品视频一区| 国产一区二区美女诱惑| 亚洲v日本v欧美v久久精品| 国产欧美日韩综合| 欧美一级日韩免费不卡| 99久久精品免费精品国产| 伦理电影国产精品| 亚洲最快最全在线视频| 日本一区免费视频| 精品久久久久久综合日本欧美| 91麻豆免费视频| 国产成人免费9x9x人网站视频| 天使萌一区二区三区免费观看| 国产精品久久久久婷婷二区次| 日韩欧美123| 欧美日韩国产美| 91啪九色porn原创视频在线观看| 国产成人在线看| 精东粉嫩av免费一区二区三区| 亚洲成人av中文| 一区二区三区四区激情| 综合电影一区二区三区| 欧美国产精品v| 国产视频一区二区在线| 精品三级av在线| 91精品国产91久久综合桃花| 91免费精品国自产拍在线不卡| 国产成都精品91一区二区三| 狠狠色狠狠色综合| 国模套图日韩精品一区二区| 久久超碰97中文字幕| 日韩中文字幕亚洲一区二区va在线| 亚洲欧美成aⅴ人在线观看| 综合自拍亚洲综合图不卡区| 国产精品高潮呻吟| 中文字幕在线一区免费| 国产精品久久久久一区二区三区| 国产精品人成在线观看免费| 欧美经典一区二区三区| 亚洲国产精品高清| 欧美激情一区在线观看| 国产精品久久夜| 亚洲欧美激情一区二区| 亚洲色图欧美激情| 亚洲午夜精品一区二区三区他趣| 亚洲午夜在线电影| 丝袜诱惑制服诱惑色一区在线观看 | 欧美电视剧在线观看完整版| 欧美大胆一级视频| 久久久久久免费毛片精品| 精品国产百合女同互慰| 久久久午夜精品| 国产精品三级视频| 一个色综合av| 日本不卡1234视频| 国产精品综合av一区二区国产馆| 国产91精品一区二区| 97se亚洲国产综合自在线不卡| 在线观看亚洲精品| 69堂成人精品免费视频| xfplay精品久久| 亚洲天堂中文字幕| 亚洲成国产人片在线观看| 久久av老司机精品网站导航| 丁香婷婷综合网| 欧美在线观看禁18| 久久亚洲综合av| 亚洲乱码国产乱码精品精的特点 | 日韩精品一区二区在线观看| 国产亚洲制服色| 亚洲欧美日韩在线| 裸体健美xxxx欧美裸体表演| 国产成人高清视频| 欧洲另类一二三四区| 精品黑人一区二区三区久久| 中文字幕中文字幕在线一区| 首页国产欧美日韩丝袜| 福利电影一区二区| 欧美日韩一区二区不卡| 久久久亚洲高清| 亚洲一区av在线| 国产白丝精品91爽爽久久| 欧美日免费三级在线| 国产日本欧洲亚洲| 午夜日韩在线电影| 成人av免费网站| 日韩欧美国产午夜精品| 亚洲乱码中文字幕综合| 国产精品一区二区x88av| 欧美日韩中文国产| 日本一区二区三级电影在线观看| 午夜精品久久久久久久| 成人黄色小视频| 日韩欧美一二三| 亚洲国产精品人人做人人爽| 成人网男人的天堂| 精品久久久网站| 日韩精品一级二级 | 国产一区二区看久久| 精品视频在线免费观看| 国产精品久久久久久久第一福利 | 国产精品久久久久精k8 | 欧美高清在线精品一区| 欧美a一区二区| 欧美在线观看18| 亚洲天堂中文字幕| 国产成人免费在线视频| 精品少妇一区二区三区免费观看| 亚洲午夜在线观看视频在线| 不卡在线观看av| 国产亚洲精品免费| 久久成人精品无人区| 91精品国产综合久久蜜臀| 亚洲午夜一二三区视频| 成人精品高清在线| 久久综合九色综合97婷婷女人| 免费成人在线观看| 91精品国产综合久久久久久久久久 | 亚洲动漫第一页| 91偷拍与自偷拍精品| 国产精品三级av| 成人av资源在线| 中文字幕高清不卡| 成熟亚洲日本毛茸茸凸凹| 久久久91精品国产一区二区精品| 激情文学综合插| 久久久久国产一区二区三区四区 | 懂色av一区二区在线播放| 久久精品欧美日韩| 国产精品1024| 国产精品免费视频一区| 不卡一区二区在线| 亚洲人成电影网站色mp4| 日本精品一区二区三区高清| 自拍偷拍国产精品| 欧美在线|欧美| 日韩av在线免费观看不卡| 欧美一级久久久久久久大片| 久久国产尿小便嘘嘘尿| 2021国产精品久久精品| 国产在线不卡一区| 国产精品久久久久久久浪潮网站 | 欧美一级生活片| 激情综合色丁香一区二区| 久久九九99视频| 99久久综合国产精品| 亚洲人成伊人成综合网小说| 欧美自拍偷拍一区| 免费观看在线综合| 国产欧美一区二区精品仙草咪| av亚洲精华国产精华精| 亚洲成av人片一区二区梦乃| 欧美α欧美αv大片| 国产成人午夜视频| 亚洲一区在线视频| 欧美大片一区二区三区| 福利电影一区二区| 亚洲一区成人在线| 久久一区二区视频| 91久久奴性调教| 激情综合亚洲精品| 亚洲精品视频免费观看| 欧美大片日本大片免费观看| av高清久久久|