h4lib

#!/bin/sh
find_ubuntu(){
    sourcedir=$1
    directdir=$2
if [ -f /var/tmp/ubuntu ];then
    rm /var/tmp/ubuntu
fi
touch /var/tmp/ubuntu
if [ -f /var/tmp/ubuntuall ];then
    rm /var/tmp/ubuntuall
fi
touch /var/tmp/ubuntuall
find $directdir/lib/ $directdir/usr/lib/ $directdir/usr/local/lib/ $directdir/opt/ ! -type d -name "*.so*"  |  while read file
do
    if [ -z "$file"  ];then
        continue
    fi
    ex=`basename $(ls -l $file | awk '{if(($1~/^-/) || ($1~/^l/)) print $8}') | awk -F"." '{print $1}'`
    if [ "$ex" != "" ];then
        echo $ex>>/var/tmp/ubuntu
        echo $file>>/var/tmp/ubuntuall
        echo "write $file"
    fi
done
}


find_copy(){
    sdir=$1
    directdir=$2

find $sdir/lib/ $sdir/usr/  ! -type d -name "*.so*"  |  while read file
do
    if [ ! -z `ls -l $file | awk '{if(($1~/^-/) || ($1~/^l/)) print $8}'` ];then
        ex=`basename $(ls -l $file | awk '{if(($1~/^-/) || ($1~/^l/)) print $8}') | awk -F"." '{print $1}'`
        if [ "$ex" != "" ];then
            grep -q "\<$ex" /var/tmp/ubuntu
            if [ "$?" -eq "1" ];then
                dname=`dirname $file`
                tmpdir=`echo "$dname $sdir" | awk '{print substr($1,1+length($2))}'`
                echo "$tmpdir"
                if [ ! -d $directdir/$tmpdir ];then
                    mkdir -p $directdir/$tmpdir
                fi
                echo "h3 lib $file"
                cp -a $file $directdir/$tmpdir
            else
                dname=`dirname $file`
                tmpdir=`echo "$dname $sdir" | awk '{print substr($1,1+length($2))}'`
                if [ ! -z `echo $tmpdir | grep "^/"` ];then
                    tmpdir=`echo $tmpdir | awk '{print substr($1,2)}'`
                fi
                ex=$tmpdir/$ex
                grep -q "\<$ex" /var/tmp/ubuntuall
                if [ "$?" -eq "1" ];then
                    if [ ! -d $directdir/$tmpdir ];then
                        mkdir -p $directdir/$tmpdir
                    fi
                    cp -a $file $directdir/$tmpdir
                fi
            fi
        fi
    fi
done
}


if [ -z "$1" -o -z "$2" ];then
    echo "error:lack of parameter"
    echo "usage:sh h3only.sh sourcedir dirctdir"
    echo "sourcedir"
    echo "    intel filesystem directory"
    echo "directdir"
    echo "    your filesystem dirctory"
    exit 1
fi
if [ ! -d $1 ];then
    echo "$1 is not exits"
    exit 1
fi
sourcedir=`realpath $1`
echo "source dir $sourcedir"
if [ ! -d $2 ];then
    mkdir -p $2
fi
directdir=`realpath $2`
echo "direct dir $directdir"


find_ubuntu $sourcedir  $directdir
compiledir=$sourcedir/build_i686/staging_dir/
compiledir=`realpath $compiledir`
find_copy $compiledir  $directdir
rootdir=$sourcedir/project_build_i686/IntelCE/root/
rootdir=`realpath $rootdir`
find_copy $rootdir  $directdir
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
在 VB.NET 中,可以使用 Windows API 函数来实现接收外部发来的字符串消息。 首先需要在代码中声明以下函数: ```vbnet Public Declare Function RegisterWindowMessage Lib "user32" Alias "RegisterWindowMessageA" (ByVal lpString As String) As Integer Public Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hWnd As IntPtr, ByVal Msg As Integer, ByVal wParam As Integer, ByVal lParam As String) As Boolean ``` 其中 `RegisterWindowMessage` 用于注册一个自定义的消息,`PostMessage` 用于发送消息到指定的窗口。 接下来,在需要接收消息的窗口中,可以使用以下代码来接收消息: ```vbnet Protected Overrides Sub WndProc(ByRef m As Message) Const WM_COPYDATA As Integer = &H4A If m.Msg = WM_COPYDATA Then Dim data As CopyDataStruct = CType(m.GetLParam(GetType(CopyDataStruct)), CopyDataStruct) Dim msg As String = New String(data.lpData) ' 处理接收到的消息 MessageBox.Show(msg) End If MyBase.WndProc(m) End Sub ``` 其中 `WM_COPYDATA` 是用来接收复制数据的消息,`CopyDataStruct` 是一个结构体,用来存储接收到的数据。 需要注意的是,接收消息的窗口需要调用 `RegisterWindowMessage` 函数来注册一个唯一的自定义消息,发送消息的程序需要使用该消息来向接收消息的窗口发送数据。 以下是一个简单的示例代码: 接收消息的窗口: ```vbnet Imports System.Runtime.InteropServices Public Class Form1 Public Structure CopyDataStruct Public dwData As IntPtr Public cbData As Integer Public lpData As IntPtr End Structure Public Declare Function RegisterWindowMessage Lib "user32" Alias "RegisterWindowMessageA" (ByVal lpString As String) As Integer Public Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hWnd As IntPtr, ByVal Msg As Integer, ByVal wParam As Integer, ByVal lParam As String) As Boolean Private Const WM_COPYDATA As Integer = &H4A Private msgId As Integer Protected Overrides Sub WndProc(ByRef m As Message) If m.Msg = msgId Then Dim data As CopyDataStruct = CType(m.GetLParam(GetType(CopyDataStruct)), CopyDataStruct) Dim msg As String = New String(data.lpData) MessageBox.Show(msg) End If MyBase.WndProc(m) End Sub Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load msgId = RegisterWindowMessage("MyMsg") End Sub End Class ``` 发送消息的程序: ```vbnet Imports System.Runtime.InteropServices Public Class Form1 Public Structure CopyDataStruct Public dwData As IntPtr Public cbData As Integer Public lpData As IntPtr End Structure Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr Public Declare Function RegisterWindowMessage Lib "user32" Alias "RegisterWindowMessageA" (ByVal lpString As String) As Integer Public Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hWnd As IntPtr, ByVal Msg As Integer, ByVal wParam As Integer, ByVal lParam As String) As Boolean Private Const WM_COPYDATA As Integer = &H4A Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim hWnd As IntPtr = FindWindow(Nothing, "Form1") If hWnd <> IntPtr.Zero Then Dim msgId As Integer = RegisterWindowMessage("MyMsg") Dim data As New CopyDataStruct With { .dwData = IntPtr.Zero, .cbData = TextBox1.Text.Length, .lpData = Marshal.StringToHGlobalAnsi(TextBox1.Text) } PostMessage(hWnd, WM_COPYDATA, msgId, data) End If End Sub End Class ``` 在上面的示例代码中,接收消息的窗口使用了 `MyMsg` 作为自定义消息的名称,发送消息的程序也使用了相同的名称。当发送消息的程序点击按钮时,会向接收消息的窗口发送一个包含文本框中的文本的消息,接收消息的窗口会弹出一个消息框显示接收到的文本。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值