libk  gen-conds.awk at tip

File global/gen-conds.awk from the latest check-in


BEGIN { FS=":"
	offset = 0x7F

	print "#ifndef KIglobal_cond"
	print "#define KIglobal_cond"
	print "typedef enum kglobal_cond {"
	printf("kglobal_module_offset = 0x%x,\n", offset)
}

$2 == "short" { printf("\t%scond_id = 0x%x,\n", $3, offset*NR) }
$2 == "long" { printf("\t%s_cond_id = 0x%x,\n", $3, offset*NR) }

END {
	print "} kglobal_cond;"
	print "extern struct kglobal_module_record"
	print "\t{ const char* name, * desc, ** error_list }"
	print "\tkglobal_module_ident[];"
	print "#endif"
}