您的位置:首页 > 财经 > 产业 > 网页设计制作教程:一个页面的完全制作_网页版传奇链接_seo课程排行榜_软文营销经典案例优秀软文

网页设计制作教程:一个页面的完全制作_网页版传奇链接_seo课程排行榜_软文营销经典案例优秀软文

2025/1/11 21:36:37 来源:https://blog.csdn.net/u013315564/article/details/144668283  浏览:    关键词:网页设计制作教程:一个页面的完全制作_网页版传奇链接_seo课程排行榜_软文营销经典案例优秀软文
网页设计制作教程:一个页面的完全制作_网页版传奇链接_seo课程排行榜_软文营销经典案例优秀软文

FFmpeg更改文件名, 文件名最终格式:libavutil_avutil.h

脚本存放目录:

目录:change_name.shthininclude	libavcodeclibavfilterlibavformat.....libs
#!/bin/shTHIN=$(pwd)/"thin"echo "Renaming header files and updating includes"
INCLUDE_DIR="$THIN/include"
MODULES="libavcodec libavfilter libavformat libavutil libswresample libswscale"# 临时存储重命名文件映射
RENAME_MAP=$(mktemp)# Step 1: Rename header files
for MODULE in $MODULES
doif [ -d "$INCLUDE_DIR/$MODULE" ]; thencd "$INCLUDE_DIR/$MODULE"for HEADER in *.hdoif [ -f "$HEADER" ]; then# Skip if file is already renamedif [[ "$HEADER" != ${MODULE}_* ]]; thenNEW_NAME="${MODULE}_${HEADER}"mv "$HEADER" "$NEW_NAME"echo "$MODULE/$HEADER,$NEW_NAME" >> "$RENAME_MAP"echo "Renamed $HEADER to $NEW_NAME"fifidonefi
done# Step 2: Scan and update includes
for MODULE in $MODULES
doif [ -d "$INCLUDE_DIR/$MODULE" ]; thencd "$INCLUDE_DIR/$MODULE"for FILE in *.hdoif [ -f "$FILE" ]; then# Read file and replace #include directivesTEMP_FILE="${FILE}.tmp"while IFS= read -r LINEdoif echo "$LINE" | grep -qE '^#include ".*"'; thenINCLUDE_PATH=$(echo "$LINE" | sed -E 's/^#include "(.*)"/\1/')if echo "$INCLUDE_PATH" | grep -q "/"; then# 包含路径的 #includeMODULE_PATH=$(dirname "$INCLUDE_PATH")BASE_NAME=$(basename "$INCLUDE_PATH")RENAMED_FILE=$(grep "^$MODULE_PATH/$BASE_NAME," "$RENAME_MAP" | cut -d',' -f2)if [ -n "$RENAMED_FILE" ]; thenNEW_INCLUDE="$MODULE_PATH/$RENAMED_FILE"LINE=$(printf '%s' "$LINE" | sed "s#\"$INCLUDE_PATH\"#\"$NEW_INCLUDE\"#")echo "Updated include with path in $FILE: $INCLUDE_PATH -> $NEW_INCLUDE"fielse# 不包含路径的 #includeRENAMED_FILE=$(grep "^$MODULE/$INCLUDE_PATH," "$RENAME_MAP" | cut -d',' -f2)if [ -n "$RENAMED_FILE" ]; thenNEW_INCLUDE="$RENAMED_FILE"LINE=$(printf '%s' "$LINE" | sed "s#\"$INCLUDE_PATH\"#\"$NEW_INCLUDE\"#")echo "Updated local include in $FILE: $INCLUDE_PATH -> $NEW_INCLUDE"fififiecho "$LINE" >> "$TEMP_FILE"done < "$FILE"mv "$TEMP_FILE" "$FILE"fidonefi
done# 清理临时文件
rm "$RENAME_MAP"echo "Header renaming and include updates complete!"

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com