k.c

来自「操作系统源代码」· C语言 代码 · 共 44 行

C
44
字号
/* * a small awk clone * * (C) 1989 Saeko Hirabauashi & Kouichi Hirabayashi * * Absolutely no warranty. Use this software with your own risk. * * Permission to use, copy, modify and distribute this software for any * purpose and without fee is hereby granted, provided that the above * copyright and disclaimer notice. * * This program was written to fit into 64K+64K memory of the Minix 1.2. */#include <stdio.h>isKanji(c){  c &= 0xff;  return (c > 0x80 && c < 0xa0 || c > 0xdf && c < 0xfd);}jstrlen(s) char *s;{  int i;  for (i = 0; *s; i++, s++)	if (isKanji(*s))		s++;  return i;}char *jStrchr(s, c) char *s;{  for ( ; *s; s++)	if (isKanji(*s))		s++;	else if (*s == c)		return s;  return NULL;}

⌨️ 快捷键说明

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