⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cygmagic

📁 cygwin, 著名的在win32下模拟unix操作系统的东东
💻
字号:
#!/bin/sh# cygmagic - Generate "magic numbers" from a structure.##   Copyright 2001, 2002 Red Hat, Inc.## This file is part of Cygwin.## This software is a copyrighted work licensed under the terms of the# Cygwin license.  Please consult the file "CYGWIN_LICENSE" for# details.file_magic=$1; shiftgcc=$1; shiftfile=$1; shifttrap "rm -f /tmp/$$.magic" 0 1 2 15cat <<EOF > $file_magic/* autogenerated - do not edit */#include "$file"EOFsumit() {    cksum $*}while [ -n "$1" ]; do    define=$1; shift    struct=$1; shift    sum=`$gcc -E $file | sed -n "/^$struct/,/^};/p" | sed -e 's/[ 	]//g' -e '/^$/d' | sumit | awk '{printf "0x%xU", $1}'`    echo "#define $define $sum"    curr=`sed -n "s/^#[ 	]*define CURR_$define[ 	][ 	]*\([^ 	][^ 	]*\)/\1/p" $file`    [ "$curr" != "$sum" ] && echo "*** WARNING WARNING WARNING WARNING WARNING ****** $file: magic number for $define changed old $curr != new $sum*** WARNING WARNING WARNING WARNING WARNING ***" 1>&2done >> $file_magicexit 0

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -