createmodule
来自「decode the h264 video」· 代码 · 共 36 行
TXT
36 行
#!/bin/bash[ ! "$1" ] && { echo "makemodule: create a new module in src/" echo "$0 <modulename>" exit 1}[ -e "$1.c" -o -e "$1.c" ] && { echo "module $1 already exists, so I refuse to overwrite it" exit 1}upper=$(echo $1 | tr "[:lower:]" "[:upper:]")cat >$1.h <<-EOT#ifndef __${upper}_H__#define __${upper}_H__// TODO: insert code here#endif /*__${upper}_H__*/EOTcat >$1.c <<-EOT#include "common.h"#include "$1.h"///////////////////////////////////////////////////////////////////////////////int _test_$1(int argc, char *argv[]) { printf("Nothing to test in $1.\n"); return 0;}EOT
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?