📄 getversion.hhf
字号:
#include( "os.hhf" )#if( !os.linux ) #error( "Can only include 'getversion.hhf' under Linux" )#else #openread( "/usr/include/linux/version.h" ) ?brk := false; ?r1 :string; ?r2 :string; ?r3 :string; ?r4 :string; ?UTS_RELEASE :string; ?lf := #$a; #while( !brk & @read( s ) ) #if( @matchstr( s, "#define", r1 )) #if( @oneOrMoreWS( r1, r2 )) #if( @matchstr( r2, "UTS_RELEASE """, r3 )) #if( @oneOrMoreCset( r3, {'0'..'9', '.', '-'}, r4, UTS_RELEASE )) #openwrite( "version.hhf" ) #write( "#asm", lf ) #write( " .section .modinfo,""a"",@progbits", lf ) #write( " .type __module_kernel_version,@object", lf ) #write ( " .size __module_kernel_version,", @length(UTS_RELEASE)+16, lf ) #write( "__module_kernel_version:", lf ) #write( ".string ""kernel_version=", UTS_RELEASE, """", lf ) #write( "#endasm", lf ) #closewrite ?brk := true; #endif #endif #endif #endif #endwhile #closeread // Create the LINUX_VERSION_CODE value: ?r1 := UTS_RELEASE; ?lvc2:dword; ?lvc1:dword; ?lvc0:dword; ?r3 := @matchIntConst( r1, r1, lvc2 ) & @oneChar( r1, '.', r1 ); ?r3 := @matchIntConst( r1, r1, lvc1 ) & @oneChar( r1, '.', r1 ); ?r3 := @matchIntConst( r1, r1, lvc0 ); ?LINUX_VERSION_CODE :dword := (lvc2 << 16) + (lvc1 << 8) + lvc0; #includeOnce( "version.hhf" ) #endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -