Chinaunix首页 | 论坛 | 博客
  • 博客访问: 57089
  • 博文数量: 35
  • 博客积分: 735
  • 博客等级: 军士长
  • 技术积分: 290
  • 用 户 组: 普通用户
  • 注册时间: 2011-06-28 16:23
文章分类
文章存档

2014年(2)

2013年(2)

2012年(31)

我的朋友

分类: Python/Ruby

2012-02-24 18:24:23

#!/usr/bin/perl
#use strict;
###################################################################################
# 移植如下文件名:debug 模式
###################################################################################
my @port_code_in_files;
$port_code_in_files[0]="$port_code_in_files[1]="$port_code_in_files[2]="$port_code_in_files[3]="$port_code_in_files[4]="$port_code_in_files[5]="$port_code_in_files[6]="$port_code_in_files[7]="$port_code_in_files[8]="$port_code_in_files[9]="$port_code_in_files[10]="$port_code_in_files[11]="$port_code_in_files[12]="$port_code_in_files[13]="$port_code_in_files[14]="$port_code_in_files[15]="$port_code_in_files[16]="$port_code_in_files[17]="$port_code_in_files[18]="$port_code_in_files[19]="$port_code_in_files[20]="$port_code_in_files[21]="$port_code_in_files[22]="$port_code_in_files[23]="$port_code_in_files[24]="$port_code_in_files[25]="$port_code_in_files[26]="$port_code_in_files[27]="
my @port_code_out_files;
$port_code_out_files[0]=">port_code_out/app.mk";
$port_code_out_files[1]=">port_code_out/gui_ucs2gb.c";
$port_code_out_files[2]=">port_code_out/gui_unicode.h";
$port_code_out_files[3]=">port_code_out/guianim.c";
$port_code_out_files[4]=">port_code_out/guianim.h";
$port_code_out_files[5]=">port_code_out/guires_img.c";
$port_code_out_files[6]=">port_code_out/Makefile";
$port_code_out_files[7]=">port_code_out/Makefile.third-party";
$port_code_out_files[8]=">port_code_out/mmi_appmsg.h";
$port_code_out_files[9]=">port_code_out/mmi_res_prj_def.h";
$port_code_out_files[10]=">port_code_out/mmicc_app.c";
$port_code_out_files[11]=">port_code_out/mmifmm.c";
$port_code_out_files[12]=">port_code_out/mmifmm.h";
$port_code_out_files[13]=">port_code_out/mmifmm_interface.h";
$port_code_out_files[14]=">port_code_out/mmifmm_wintab.c";
$port_code_out_files[15]=">port_code_out/mmimain.c";
$port_code_out_files[16]=">port_code_out/mmimp3_music.c";
$port_code_out_files[17]=">port_code_out/mmiphone.c";
$port_code_out_files[18]=">port_code_out/mmiset_display.c";
$port_code_out_files[19]=">port_code_out/mmisms_receive.c";
$port_code_out_files[20]=">port_code_out/mmisms_send.c";
$port_code_out_files[21]=">port_code_out/mmiudisk_wintab.c";
$port_code_out_files[22]=">port_code_out/Mmiwclk_main.c";
$port_code_out_files[23]=">port_code_out/mmiwclk_main.h";
$port_code_out_files[24]=">port_code_out/mmk_applet.c";
$port_code_out_files[25]=">port_code_out/project_sc6600l_sp6601l_8225.mk";
$port_code_out_files[26]=">port_code_out/resource.mk";
$port_code_out_files[27]=">port_code_out/simulator.mk";
###################################################################################
# author:  
###################################################################################
my $flag=0;
my $port_mode_name;
my $port_code_txt_file;
my $port_code_in_file;
my $port_code_out_file;
my $cur_file_index=0;
sub inset_port_code
{
    my ($fh) = @_; 
    printf "UP_SUPPORT is inserting!!!--->[$port_mode_name]   ok\n";      
    open FILE_UP_SUPPORT, $port_code_txt_file;
    my @port_code_lines = ;
    close FILE_UP_SUPPORT;   
    print $fh @port_code_lines; 
}
my @entire_lines;
sub check_is_port
{
    $flag=0;
    open FILE_HANDLE, $port_code_in_file;
    @entire_lines = ;   
   
    for my $file_line (@entire_lines)
    {
        if ($file_line=~/UP_SUPPORT/)
        {
            printf "UP_SUPPORT has inserted!!!\n";
            $flag = 1;
            last;
        }
    }
    close FILE_HANDLE;
}
sub set_port_filename
{
    $port_code_in_file= $port_code_in_files[$cur_file_index];  
    $port_code_out_file= $port_code_out_files[$cur_file_index];   
    $cur_file_index++;
    $port_mode_name = $port_code_in_file;
}
sub hello_port_begin
{
    set_port_filename();
    check_is_port();
}
###################################################################################
# author: ################################################## 
$port_code_txt_file="###################################################################################
hello_port_begin();
if (!$flag)
{
    open FILE_HANDLE, $port_code_out_file;   
    print FILE_HANDLE @entire_lines;
   
    printf FILE_HANDLE "\n";    
    inset_port_code(\*FILE_HANDLE);   
    close FILE_HANDLE;
}
###################################################################################
# author: ##################################################
$port_code_txt_file="###################################################################################
hello_port_begin();
my @file_lines1;
my @file_lines2;
if (!$flag)
{
    my $flag_key_isfind;
    for my $file_line (@entire_lines)
    {               
        if ($file_line=~/PUBLIC uint16 GUI_WstrToGB/)
        {
            printf "UP_SUPPORT has reach!!!\n";
            $flag_key_isfind = 1;
        }
           
        if($flag_key_isfind)
        {
            push(@file_lines2,$file_line);       
        }
        else
        {
            push(@file_lines1,$file_line);
        }              
    }          
    open FILE_HANDLE, $port_code_out_file;       
    print FILE_HANDLE @file_lines1;
    printf FILE_HANDLE "\n";   
    inset_port_code(\*FILE_HANDLE);
    printf FILE_HANDLE "\n";   
    print FILE_HANDLE @file_lines2;            
    close FILE_HANDLE;
}
###################################################################################
# author: ##################################################
$port_code_txt_file="###################################################################################
hello_port_begin();
my @file_lines1;
my @file_lines2;
if (!$flag)
{
    my $flag_key_isfind;
    for my $file_line (@entire_lines)
    {               
        if($flag_key_isfind)
        {
            push(@file_lines2,$file_line);       
        }
        else
        {
            push(@file_lines1,$file_line);
        }
        if ($file_line=~/GUI_IsCharOneAsciiWidth/)
        {
            printf "key word has reach!!!\n";
            $flag_key_isfind = 1;
        }       
    }          
    open FILE_HANDLE, $port_code_out_file;       
    print FILE_HANDLE @file_lines1;
    printf FILE_HANDLE "\n";   
    inset_port_code(\*FILE_HANDLE);
    printf FILE_HANDLE "\n";   
    print FILE_HANDLE @file_lines2;            
    close FILE_HANDLE;
}
###################################################################################
# author: ##################################################
$port_code_txt_file="###################################################################################
hello_port_begin();
if (!$flag)
{
    open FILE_HANDLE, $port_code_out_file;
   
    my $last_line;
    $last_line = pop @entire_lines;   
   
    print FILE_HANDLE @entire_lines;
    printf FILE_HANDLE "\n";   
    inset_port_code(\*FILE_HANDLE);
    printf FILE_HANDLE "\n";   
    printf FILE_HANDLE $last_line;    
       
    close FILE_HANDLE;
}
###################################################################################
# author: ##################################################
$port_code_txt_file="###################################################################################
hello_port_begin();
my @file_lines1;
my @file_lines2;
if (!$flag)
{
    my $flag_key_isfind;
    for my $file_line (@entire_lines)
    {               
        if($flag_key_isfind)
        {
            push(@file_lines2,$file_line);       
        }
        else
        {
            push(@file_lines1,$file_line);
        }
        if ($file_line=~/extern const wchar g_guianim_miniature_suffix_wstr/)
        {
            printf "UP_SUPPORT has reach!!!\n";
            $flag_key_isfind = 1;
        }       
    }          
    open FILE_HANDLE, $port_code_out_file;       
    print FILE_HANDLE @file_lines1;
    printf FILE_HANDLE "\n";   
    inset_port_code(\*FILE_HANDLE);
    printf FILE_HANDLE "\n";   
    print FILE_HANDLE @file_lines2;            
    close FILE_HANDLE;
}
###################################################################################
# author: ##################################################
$port_code_txt_file="###################################################################################
hello_port_begin();
if (!$flag)
{
    open FILE_HANDLE, $port_code_out_file;
   
    my $last_line;
    $last_line = pop @entire_lines;   
   
    print FILE_HANDLE @entire_lines;
    printf FILE_HANDLE "\n";   
    inset_port_code(\*FILE_HANDLE);
    printf FILE_HANDLE "\n";   
    printf FILE_HANDLE $last_line;    
       
    close FILE_HANDLE;
}
###################################################################################
# author: ##################################################
$port_code_txt_file="###################################################################################
hello_port_begin();
my @file_lines1;
my @file_lines2;
my $key_lines=6;
if (!$flag)
{
    my $flag_key_isfind;
    my $flag_pos_isfind;   
    my $key_skip_lines=0;
    for my $file_line (@entire_lines)
    {               
        if($flag_pos_isfind)
        {
            push(@file_lines2,$file_line);       
        }
        else
        {
            push(@file_lines1,$file_line);
        }
       
       
        if ($file_line=~/COMPLIBS_DBG =app  custom_drv chip_drv gui   mmk  char_lib/)
        {
            printf "key has reach!!!\n";
            $flag_key_isfind = 1;
            $key_lines++;                         
        }
        if (($flag_key_isfind)&& ($key_skip_lines <$key_lines))
        {
            printf $key_skip_lines;       
            $key_skip_lines++;      
        }
       
        if(($key_lines==$key_skip_lines)&& (!$flag_pos_isfind))
        {
            printf $key_lines;
            $flag_pos_isfind = 1;       
        }                      
    }          
    open FILE_HANDLE, $port_code_out_file;       
    print FILE_HANDLE @file_lines1;
    printf FILE_HANDLE "\n";   
    inset_port_code(\*FILE_HANDLE);
    printf FILE_HANDLE "\n";   
    print FILE_HANDLE @file_lines2;            
    close FILE_HANDLE;
}
###################################################################################
# author: ##################################################
$port_code_txt_file="###################################################################################
hello_port_begin();
if (!$flag)
{
    open FILE_HANDLE, $port_code_out_file;   
    print FILE_HANDLE @entire_lines;
    printf FILE_HANDLE "\n";    
    inset_port_code(\*FILE_HANDLE);   
    close FILE_HANDLE;
}
###################################################################################
# author: ##################################################
$port_code_txt_file="###################################################################################
hello_port_begin();
my @file_lines1;
my @file_lines2;
if (!$flag)
{
    my $flag_key_isfind;
    for my $file_line (@entire_lines)
    {               
        if($flag_key_isfind)
        {
            push(@file_lines2,$file_line);       
        }
        else
        {
            push(@file_lines1,$file_line);
        }
        if ($file_line=~/MSG_JAVA_SEND_TIMER/)
        {
            printf "key word has reach!!!\n";
            $flag_key_isfind = 1;
        }       
    }          
    open FILE_HANDLE, $port_code_out_file;       
    print FILE_HANDLE @file_lines1;
    printf FILE_HANDLE "\n";   
    inset_port_code(\*FILE_HANDLE);
    printf FILE_HANDLE "\n";   
    print FILE_HANDLE @file_lines2;            
    close FILE_HANDLE;
}
###################################################################################
# author: ##################################################
$port_code_txt_file="###################################################################################
hello_port_begin();
my @file_lines1;
my @file_lines2;
if (!$flag)
{
    my $flag_key_isfind;
    for my $file_line (@entire_lines)
    {               
        if($flag_key_isfind)
        {
            push(@file_lines2,$file_line);       
        }
        else
        {
            push(@file_lines1,$file_line);
        }
        if ($file_line=~/bt_mdu_def/)
        {
            printf "key word has reach!!!\n";
            $flag_key_isfind = 1;
        }       
    }          
    open FILE_HANDLE, $port_code_out_file;       
    print FILE_HANDLE @file_lines1;
    printf FILE_HANDLE "\n";   
    inset_port_code(\*FILE_HANDLE);
    printf FILE_HANDLE "\n";   
    print FILE_HANDLE @file_lines2;            
    close FILE_HANDLE;
}
###################################################################################
# author: ##################################################
$port_code_txt_file="###################################################################################
hello_port_begin();
if (!$flag)
{
    open FILE_HANDLE, $port_code_out_file;   
    print FILE_HANDLE @entire_lines;
    printf FILE_HANDLE "\n";    
    inset_port_code(\*FILE_HANDLE);   
    close FILE_HANDLE;
}
###################################################################################
# author: ##################################################
$port_code_txt_file="$port_code_txt_file2="###################################################################################
hello_port_begin();
my @file_lines1;
my @file_lines2;
my @file_lines3;
if (!$flag)
{
    my $flag_key_isfind;
    my $flag_key_isfind2;   
    my $skip_lines=0;
    for my $file_line (@entire_lines)
    { 
        if ($file_line=~/case MMIFMM_MOVIE_VCF/)
        {
            printf "key2 word has reach!!!\n";
            $flag_key_isfind2 = 1;
        }
                     
        if($flag_key_isfind)
        {
           $skip_lines++;                             
           if($skip_lines >4)
           {
            if($flag_key_isfind2)
            {
                push(@file_lines3,$file_line);       
            }
            else
            {
                push(@file_lines2,$file_line);
            }       
           }
        }
        else
        {
            push(@file_lines1,$file_line);
        }
        if ($file_line=~/{"jad",     MMIFMM_JAVA_JAD,    TRUE}/)
        {
            printf "key1 word has reach!!!\n";
            $flag_key_isfind = 1;
        }                  
    }          
    open FILE_HANDLE, $port_code_out_file;       
    print FILE_HANDLE @file_lines1;
    printf FILE_HANDLE "\n";
   
    $port_code_txt_file=$port_code_txt_file;       
    inset_port_code(\*FILE_HANDLE);
    printf FILE_HANDLE "\n";   
    print FILE_HANDLE @file_lines2;            
    $port_code_txt_file=$port_code_txt_file2;   
    inset_port_code(\*FILE_HANDLE);
    printf FILE_HANDLE "\n";   
    print FILE_HANDLE @file_lines3;
       
    close FILE_HANDLE;
}
###################################################################################
# author: ##################################################
$port_code_txt_file="###################################################################################
hello_port_begin();
my @file_lines1;
my @file_lines2;
my $key_lines=1;
if (!$flag)
{
    my $flag_key_isfind;
    my $flag_pos_isfind;   
    my $key_skip_lines=0;
    for my $file_line (@entire_lines)
    {               
        if($flag_pos_isfind)
        {
            push(@file_lines2,$file_line);       
        }
        else
        {
            push(@file_lines1,$file_line);
        }
       
       
        if ($file_line=~/MMIFMM_FILE_TYPE_EBOOK/)
        {
            printf "key has reach!!!\n";
            $flag_key_isfind = 1;
            $key_lines++;                         
        }
        if (($flag_key_isfind)&& ($key_skip_lines <$key_lines))
        {
            printf $key_skip_lines;       
            $key_skip_lines++;      
        }
       
        if(($key_lines==$key_skip_lines)&& (!$flag_pos_isfind))
        {
            printf $key_lines;
            $flag_pos_isfind = 1;       
        }       
       
      
    }          
    open FILE_HANDLE, $port_code_out_file;       
    print FILE_HANDLE @file_lines1;
    printf FILE_HANDLE "\n";   
    inset_port_code(\*FILE_HANDLE);
    printf FILE_HANDLE "\n";   
    print FILE_HANDLE @file_lines2;            
    close FILE_HANDLE;
}
###################################################################################
# author: ##################################################
$port_code_txt_file="###################################################################################
hello_port_begin();
my @file_lines1;
my @file_lines2;
if (!$flag)
{
    my $flag_key_isfind;
    for my $file_line (@entire_lines)
    {               
        if($flag_key_isfind)
        {
            push(@file_lines2,$file_line);       
        }
        else
        {
            push(@file_lines1,$file_line);
        }
        if ($file_line=~/MMIFMM_SUFFIX_BASE<<27/)
        {
            printf "UP_SUPPORT has reach!!!\n";
            $flag_key_isfind = 1;
        }       
    }          
    open FILE_HANDLE, $port_code_out_file;       
    print FILE_HANDLE @file_lines1;
    printf FILE_HANDLE "\n";   
    inset_port_code(\*FILE_HANDLE);
    printf FILE_HANDLE "\n";   
    print FILE_HANDLE @file_lines2;            
    close FILE_HANDLE;
}
###################################################################################
# author: ##################################################
$port_code_txt_file="$port_code_txt_file2="$port_code_txt_file3="###################################################################################
hello_port_begin();
my @file_lines1;
my @file_lines2;
my @file_lines3;
if (!$flag)
{
    my $flag_key_isfind;
    my $flag_key2_isfind;   
   
    for my $file_line (@entire_lines)
    {  
        if ($file_line=~/^            case MMIFMM_FILE_TYPE_VCARD:/)
        {
            printf "key word2 has reach!!!\n";
            $flag_key2_isfind = 1;
        }
                    
        if ($file_line=~/FmmCheckMemoryCardState\(MMIFMM_MEMCARD_STAT_T \*state\);/)
        {
            printf "key word has reach!!!\n";
            $flag_key_isfind = 1;
        }                 
           
        if($flag_key_isfind)
        {
            if($flag_key2_isfind)
            {
                push(@file_lines3,$file_line);       
            }
            else
            {
                push(@file_lines2,$file_line);
            }           
        }
        else
        {
            push(@file_lines1,$file_line);
        }                              
    }          
    open FILE_HANDLE, $port_code_out_file;       
    print FILE_HANDLE @file_lines1;
    printf FILE_HANDLE "\n";
      
    $port_code_txt_file=$port_code_txt_file;   
    inset_port_code(\*FILE_HANDLE);
    printf FILE_HANDLE "\n";   
    print FILE_HANDLE @file_lines2;            
    $port_code_txt_file=$port_code_txt_file2;   
    inset_port_code(\*FILE_HANDLE);
    printf FILE_HANDLE "\n";   
    print FILE_HANDLE @file_lines3;
    $port_code_txt_file=$port_code_txt_file3;   
    inset_port_code(\*FILE_HANDLE);
    printf FILE_HANDLE "\n"; 
           
    close FILE_HANDLE;
}
###################################################################################
# author: ##################################################
$port_code_txt_file="###################################################################################
hello_port_begin();
my @file_lines1;
my @file_lines2;
if (!$flag)
{
    my $flag_key_isfind;
    for my $file_line (@entire_lines)
    {               
        if($flag_key_isfind)
        {
            push(@file_lines2,$file_line);       
        }
        else
        {
            push(@file_lines1,$file_line);
        }
        if ($file_line=~/MMIAPIEBOOK_InitModule/)
        {
            printf "UP_SUPPORT has reach!!!\n";
            $flag_key_isfind = 1;
        }       
    }          
    open FILE_HANDLE, $port_code_out_file;       
    print FILE_HANDLE @file_lines1;
    printf FILE_HANDLE "\n";   
    inset_port_code(\*FILE_HANDLE);
    printf FILE_HANDLE "\n";   
    print FILE_HANDLE @file_lines2;            
    close FILE_HANDLE;
}
###################################################################################
# author: ##################################################
$port_code_txt_file="###################################################################################
hello_port_begin();
if (!$flag)
{
    open FILE_HANDLE, $port_code_out_file;   
    print FILE_HANDLE @entire_lines;
    printf FILE_HANDLE "\n";    
    inset_port_code(\*FILE_HANDLE);   
    close FILE_HANDLE;
}
###################################################################################
# author: ##################################################
$port_code_txt_file="$port_code_txt_file2="$port_code_txt_file3="###################################################################################
hello_port_begin();
my @file_lines1;
my @file_lines2;
my @file_lines3;
if (!$flag)
{
    my $flag_key_isfind;
    my $flag_key_isfind2;   
    my $flag_key_isfind3;   
    my $key_skip_lines=0;
    my $key_skip_lines2=0;   
    my $key_skip_lines3=0;    
    for my $file_line (@entire_lines)
    {                                                         
        if($flag_key_isfind)
        {
         $key_skip_lines++;
        }
        if($flag_key_isfind2)
        {
         $key_skip_lines2++;
        }
        if($flag_key_isfind3)
        {
         $key_skip_lines3++;
        }
                                   
        if(($flag_key_isfind)&&($key_skip_lines >7))
        {
            if(($flag_key_isfind2)&&($key_skip_lines2 >8))
            {      
                if(($flag_key_isfind3)&&($key_skip_lines3 >3))
                {
                    push(@file_lines4,$file_line);       
                }
                else
                {
                    push(@file_lines3,$file_line);
                }               
            }
            else
            {
 
                push(@file_lines2,$file_line);
 
            }           
        }
        else
        {
            push(@file_lines1,$file_line);
        }
       
        #find key
        if ($file_line=~/MSG_HANDLE_SD_ERR/)
        {
            printf "key word has reach!!!\n";
            $flag_key_isfind = 1;
        }
        if ($file_line=~/kjava_socket_polling_timeOut_process/)
        {
            printf "key word2 has reach!!!\n";
            $flag_key_isfind2 = 1;
        }
        if ($file_line=~/MMIPHONE_StartupSmsCB\(network_status_ind.dual_sys\)/)
        {
            printf "key word3 has reach!!!\n";
            $flag_key_isfind3 = 1;
        }       
                              
    }          
    open FILE_HANDLE, $port_code_out_file;       
    print FILE_HANDLE @file_lines1;
    printf FILE_HANDLE "\n";
      
    $port_code_txt_file=$port_code_txt_file;   
    inset_port_code(\*FILE_HANDLE);
    printf FILE_HANDLE "\n";   
    print FILE_HANDLE @file_lines2;            
    $port_code_txt_file=$port_code_txt_file2;   
    inset_port_code(\*FILE_HANDLE);
    printf FILE_HANDLE "\n";   
    print FILE_HANDLE @file_lines3;
    $port_code_txt_file=$port_code_txt_file3;   
    inset_port_code(\*FILE_HANDLE);
    printf FILE_HANDLE "\n";   
    print FILE_HANDLE @file_lines4;
           
    close FILE_HANDLE;
}
###################################################################################
# author: ##################################################
$port_code_txt_file="###################################################################################
hello_port_begin();
if (!$flag)
{
    open FILE_HANDLE, $port_code_out_file;   
    print FILE_HANDLE @entire_lines;
    printf FILE_HANDLE "\n";    
    inset_port_code(\*FILE_HANDLE);   
    close FILE_HANDLE;
}
###################################################################################
# author: ##################################################
$port_code_txt_file="$port_code_txt_file2="###################################################################################
hello_port_begin();
my @file_lines1;
my @file_lines2;
my @file_lines3;
if (!$flag)
{
    my $flag_key_isfind;
    my $flag_key2_isfind;   
    for my $file_line (@entire_lines)
    {               
        if ($file_line=~/MMISMS_HandleSMSMTInd/)
        {
            printf "key word has reach!!!\n";
            $flag_key_isfind = 1;
        }                 
           
        if($flag_key_isfind)
        {
            if($flag_key2_isfind)
            {
                push(@file_lines3,$file_line);       
            }
            else
            {
                push(@file_lines2,$file_line);
            }           
        }
        else
        {
            push(@file_lines1,$file_line);
        }
       
        if ($file_line=~/operate as SMS/)
        {
            printf "key word2 has reach!!!\n";
            $flag_key2_isfind = 1;
        }                       
    }          
    open FILE_HANDLE, $port_code_out_file;       
    print FILE_HANDLE @file_lines1;
    printf FILE_HANDLE "\n";
      
    $port_code_txt_file=$port_code_txt_file;   
    inset_port_code(\*FILE_HANDLE);
    printf FILE_HANDLE "\n";   
    print FILE_HANDLE @file_lines2;            
    $port_code_txt_file=$port_code_txt_file2;   
    inset_port_code(\*FILE_HANDLE);
    printf FILE_HANDLE "\n";   
    print FILE_HANDLE @file_lines3;
       
    close FILE_HANDLE;
}
###################################################################################
# author: ##################################################
$port_code_txt_file="$port_code_txt_file2="###################################################################################
hello_port_begin();
my @file_lines1;
my @file_lines2;
if (!$flag)
{
    my $flag_key_isfind;
    for my $file_line (@entire_lines)
    {               
        if($flag_key_isfind)
        {
            push(@file_lines2,$file_line);       
        }
        else
        {
            push(@file_lines1,$file_line);
        }
        if ($file_line=~/SCI_ASSERT\(PNULL != sig_ptr\)\;/)
        {
            printf "key word has reach!!!\n";
            $flag_key_isfind = 1;
        }       
    }          
    open FILE_HANDLE, $port_code_out_file;       
    print FILE_HANDLE @file_lines1;
    printf FILE_HANDLE "\n";   
    inset_port_code(\*FILE_HANDLE);
    printf FILE_HANDLE "\n";   
    print FILE_HANDLE @file_lines2;            
    printf FILE_HANDLE "\n";    
    $port_code_txt_file=$port_code_txt_file2;
    inset_port_code(\*FILE_HANDLE); 
       
    close FILE_HANDLE;
}
###################################################################################
# author: ##################################################
$port_code_txt_file="###################################################################################
hello_port_begin();
my @file_lines1;
my @file_lines2;
my $key_lines=8;
if (!$flag)
{
    my $flag_key_isfind;
    my $key_skip_lines=0;
    for my $file_line (@entire_lines)
    {               
        if($flag_key_isfind)
        {
            push(@file_lines2,$file_line);       
        }
        else
        {
            push(@file_lines1,$file_line);
        }
       
       
        if ($file_line=~/RESTART_BY_CHARGE != restart_condition/)
        {
            printf "key has reach!!!\n";
            $key_skip_lines++;                        
        }
        if (($key_skip_lines >0)&& ($key_skip_lines < $key_lines))
        {
            printf $key_skip_lines;       
            $key_skip_lines++;      
        }
        if(($key_lines==$key_skip_lines)&& (!$flag_key_isfind))
        {
            printf $key_lines;
            $flag_key_isfind = 1;       
        }       
       
      
    }          
    open FILE_HANDLE, $port_code_out_file;       
    print FILE_HANDLE @file_lines1;
    printf FILE_HANDLE "\n";   
    inset_port_code(\*FILE_HANDLE);
    printf FILE_HANDLE "\n";   
    print FILE_HANDLE @file_lines2;            
    close FILE_HANDLE;
}
###################################################################################
# author: ##################################################
$port_code_txt_file="$port_code_txt_file2="$port_code_txt_file3="###################################################################################
hello_port_begin();
my @file_lines1;
my @file_lines2;
my @file_lines3;
if (!$flag)
{
    my $flag_key_isfind;
    my $flag_key_count;
    my $flag_key_count2;
    for my $file_line (@entire_lines)
    {               
        if ($file_line=~/PUBLIC BOOLEAN MMIWCLK_Init/)
        {
            $flag_key_count++;
            printf "key word has reach!!!\n";
            if ($flag_key_count==2)
            {
               $flag_key_isfind = 1;
            }
        }
           
        if($flag_key_isfind)
        {
            if ($flag_key_count2<2)
            {
                push(@file_lines2,$file_line);
            }
            else
            {
                push(@file_lines3,$file_line);
            }
            $flag_key_count2++ ;      
        }
        else
        {
            push(@file_lines1,$file_line);
        }              
    }          
    open FILE_HANDLE, $port_code_out_file;       
    print FILE_HANDLE @file_lines1;
    $port_code_txt_file = $port_code_txt_file;   
    printf FILE_HANDLE "\n";   
    inset_port_code(\*FILE_HANDLE);
    printf FILE_HANDLE "\n";       
    print FILE_HANDLE @file_lines2;            
    $port_code_txt_file = $port_code_txt_file2;   
    printf FILE_HANDLE "\n";   
    inset_port_code(\*FILE_HANDLE);
    printf FILE_HANDLE "\n";       
    print FILE_HANDLE @file_lines3; 
   
    $port_code_txt_file = $port_code_txt_file3;
    printf FILE_HANDLE "\n";    
    inset_port_code(\*FILE_HANDLE);
         
    close FILE_HANDLE;
}
###################################################################################
# author: ##################################################
$port_code_txt_file="###################################################################################
hello_port_begin();
my @file_lines1;
my @file_lines2;
if (!$flag)
{
    my $flag_key_isfind;
    for my $file_line (@entire_lines)
    {               
        if($flag_key_isfind)
        {
            push(@file_lines2,$file_line);       
        }
        else
        {
            push(@file_lines1,$file_line);
        }
        if ($file_line=~/MMIAPIWCLK_OpenMainWin/)
        {
            printf "UP_SUPPORT has reach!!!\n";
            $flag_key_isfind = 1;
        }       
    }          
    open FILE_HANDLE, $port_code_out_file;       
    print FILE_HANDLE @file_lines1;
    printf FILE_HANDLE "\n";   
    inset_port_code(\*FILE_HANDLE);
    printf FILE_HANDLE "\n";   
    print FILE_HANDLE @file_lines2;            
    close FILE_HANDLE;
}
###################################################################################
# author: ##################################################
$port_code_txt_file="###################################################################################
hello_port_begin();
my @file_lines1;
my @file_lines2;
if (!$flag)
{
    my $flag_key_isfind;
    for my $file_line (@entire_lines)
    {               
        if($flag_key_isfind)
        {
            push(@file_lines2,$file_line);       
        }
        else
        {
            push(@file_lines1,$file_line);
        }
        if ($file_line=~/extern MMI_WIN_ID_T  g_idle_win;/)
        {
            printf "UP_SUPPORT has reach!!!\n";
            $flag_key_isfind = 1;
        }       
    }          
    open FILE_HANDLE, $port_code_out_file;       
    print FILE_HANDLE @file_lines1;
    printf FILE_HANDLE "\n";   
    inset_port_code(\*FILE_HANDLE);
    printf FILE_HANDLE "\n";   
    print FILE_HANDLE @file_lines2;            
    close FILE_HANDLE;
}
###################################################################################
# author: ##################################################
$port_code_txt_file="###################################################################################
hello_port_begin();
my @file_lines1;
my @file_lines2;
my $key_lines=3;
if (!$flag)
{
    my $flag_key_isfind;
    my $flag_pos_isfind;   
    my $key_skip_lines=0;
    for my $file_line (@entire_lines)
    {               
        if($flag_pos_isfind)
        {
            push(@file_lines2,$file_line);       
        }
        else
        {
            push(@file_lines1,$file_line);
        }
       
       
        if ($file_line=~/DV_RECORD_3GP_SUPPORT = MJPEG/)
        {
            printf "key has reach!!!\n";
            $flag_key_isfind = 1;
            $key_lines++;                         
        }
        if (($flag_key_isfind)&& ($key_skip_lines <$key_lines))
        {
            printf $key_skip_lines;       
            $key_skip_lines++;      
        }
       
        if(($key_lines==$key_skip_lines)&& (!$flag_pos_isfind))
        {
            printf $key_lines;
            $flag_pos_isfind = 1;       
        }       
       
      
    }          
    open FILE_HANDLE, $port_code_out_file;       
    print FILE_HANDLE @file_lines1;
    printf FILE_HANDLE "\n";   
    inset_port_code(\*FILE_HANDLE);
    printf FILE_HANDLE "\n";   
    print FILE_HANDLE @file_lines2;            
    close FILE_HANDLE;
}
###################################################################################
# author: ##################################################
$port_code_txt_file="###################################################################################
hello_port_begin();
my @file_lines1;
my @file_lines2;
if (!$flag)
{
    my $flag_key_isfind;
    for my $file_line (@entire_lines)
    {               
        if ($file_line=~/MS_MMI\/source\/mmi_app\/app\/mms/)
        {
            printf "Ukey word has reach!!!\n";
            $flag_key_isfind = 1;
        }
           
        if($flag_key_isfind)
        {
            push(@file_lines2,$file_line);       
        }
        else
        {
            push(@file_lines1,$file_line);
        }              
    }          
    open FILE_HANDLE, $port_code_out_file;       
    print FILE_HANDLE @file_lines1;
    printf FILE_HANDLE "\n";   
    inset_port_code(\*FILE_HANDLE);
    printf FILE_HANDLE "\n";   
    print FILE_HANDLE @file_lines2;            
    close FILE_HANDLE;
}
###################################################################################
# author: ##################################################
$port_code_txt_file="###################################################################################
hello_port_begin();
my @file_lines1;
my @file_lines2;
if (!$flag)
{
    my $flag_key_isfind;
    for my $file_line (@entire_lines)
    {               
        if($flag_key_isfind)
        {
            push(@file_lines2,$file_line);       
        }
        else
        {
            push(@file_lines1,$file_line);
        }
        if ($file_line=~/dsp_modules_cus = chip_drv utility app gui/)
        {
            printf "UP_SUPPORT has reach!!!\n";
            $flag_key_isfind = 1;
        }       
    }          
    open FILE_HANDLE, $port_code_out_file;       
    print FILE_HANDLE @file_lines1;
    printf FILE_HANDLE "\n";   
    inset_port_code(\*FILE_HANDLE);
    printf FILE_HANDLE "\n";   
    print FILE_HANDLE @file_lines2;            
    close FILE_HANDLE;
}
 
 
阅读(564) | 评论(0) | 转发(1) |
0

上一篇:没有了

下一篇:perl 实现目录下文件导出到文本

给主人留下些什么吧!~~