セルフサービス用のコードを追加。
ついでに、「ち」を普通の特殊検索に変更。
@@ -72,10 +72,8 @@ | ||
72 | 72 | int umeLen; |
73 | 73 | |
74 | 74 | FILE *nfp; /* 全数 */ |
75 | +FILE *cfp; /* ち */ | |
75 | 76 | FILE *tfp; /* ↑以外の特殊検索 */ |
76 | -#ifdef CHIN | |
77 | -FILE *cfp; /* ち */ | |
78 | -#endif /* CHIN */ | |
79 | 77 | #ifdef REON |
80 | 78 | FILE *rfp; /* 正規表現 */ |
81 | 79 | #endif /* REON */ |
@@ -102,6 +100,11 @@ | ||
102 | 100 | #define DEF_GEAR 10 |
103 | 101 | int gear; |
104 | 102 | |
103 | +#ifdef SELF | |
104 | +#define SELF_LIM_CNT 50 | |
105 | +#define SELF_LIM_SEC 60 * 60 * 1000 /* 1h */ | |
106 | +#endif /* SELF */ | |
107 | + | |
105 | 108 | unsigned char saltChar[2]; |
106 | 109 | |
107 | 110 | #ifdef ALLKEY |
@@ -132,8 +135,8 @@ | ||
132 | 135 | #define ST_NIKO 1<<0x1 /* 二構 */ |
133 | 136 | #define ST_BUOO 1<<0x8 /* ぶお */ |
134 | 137 | #define ST_DOSU 1<<0x9 /* 怒数 */ |
135 | -#define ST_CHIN 1<<0xb /* ^Chinko Uni では感嘆用のフラグ */ | |
136 | -#define ST_EROI 1<<0xc /* エロい人 Uni では拡飛のフラグ */ | |
138 | +#define ST_CHIN 1<<0xb /* ちん Uni では感嘆用のフラグ */ | |
139 | +#define ST_EROI 1<<0xc /* エロ Uni では拡飛のフラグ */ | |
137 | 140 | #define ST_HREN 1<<0xd /* 飛連 */ |
138 | 141 | #define ST_YAKU 1<<0xe /* 八雲 */ |
139 | 142 |
@@ -156,6 +159,7 @@ | ||
156 | 159 | case '9': special |= (ST_DOSU | ST_ALLN); break; |
157 | 160 | case 'd': special |= ST_HREN; break; |
158 | 161 | case 'e': special |= ST_YAKU; break; |
162 | + case 'Y': special |= ST_CHIN; break; | |
159 | 163 | case 'Z': special |= ST_EROI; break; |
160 | 164 | case 'S': |
161 | 165 | seedOffset = atoi( str + 4 ); |
@@ -1235,14 +1239,14 @@ | ||
1235 | 1239 | char *trip; |
1236 | 1240 | unsigned char *kind; |
1237 | 1241 | { |
1238 | -#ifdef CHIN | |
1239 | - /* 強制的に検索 */ | |
1240 | - if ( trip[0] == 'C' && trip[1] == 'h' && trip[2] == 'i' && | |
1241 | - trip[3] == 'n' && trip[4] == 'k' && trip[5] == 'o' ) { | |
1242 | - strcpy( kind, "ち" ); | |
1243 | - return( cfp ); | |
1242 | + if ( special & ST_CHIN ) { | |
1243 | + /* ^Chi(r */ | |
1244 | + if ( trip[0] == 'C' && trip[1] == 'h' && trip[2] == 'i' && | |
1245 | + trip[3] == 'n' && trip[4] == 'k' && trip[5] == 'o' ) { | |
1246 | + strcpy( kind, "ち" ); | |
1247 | + return( cfp ); | |
1248 | + } | |
1244 | 1249 | } |
1245 | -#endif /* CHIN */ | |
1246 | 1250 | |
1247 | 1251 | if ( special & ST_BUOO ) { |
1248 | 1252 | /* ぶお [A-Za-z]aoo[A-Za-z]uoo$ */ |
@@ -1558,9 +1562,6 @@ | ||
1558 | 1562 | /* タゲ読み込み */ |
1559 | 1563 | root_expr = expr_parse( "target.txt" ); |
1560 | 1564 | |
1561 | -#ifdef CHIN | |
1562 | - special |= ST_CHIN; | |
1563 | -#endif /* CHIN */ | |
1564 | 1565 | if ( verbose ) { |
1565 | 1566 | printf( "特殊検索オプション : " ); |
1566 | 1567 | if ( special & ST_DOSU ) { |
@@ -1579,6 +1580,9 @@ | ||
1579 | 1580 | if ( special & ST_BUOO ) { |
1580 | 1581 | printf( "ぶお " ); |
1581 | 1582 | } |
1583 | + if ( special & ST_CHIN ) { | |
1584 | + printf( "ちん " ); | |
1585 | + } | |
1582 | 1586 | if ( special & ST_HREN ) { |
1583 | 1587 | printf( "飛連 " ); |
1584 | 1588 | } |
@@ -1777,13 +1781,11 @@ | ||
1777 | 1781 | return errno; |
1778 | 1782 | } |
1779 | 1783 | setvbuf( nfp, NULL, _IONBF, BUFSIZ ); |
1780 | -#ifdef CHIN | |
1781 | 1784 | if ( (cfp = fopen( "logchi.txt", "at" )) == NULL ) { |
1782 | 1785 | perror( "logchi.txt" ); |
1783 | 1786 | return errno; |
1784 | 1787 | } |
1785 | 1788 | setvbuf( cfp, NULL, _IONBF, BUFSIZ ); |
1786 | -#endif /* CHIN */ | |
1787 | 1789 | #ifdef REON |
1788 | 1790 | if ( (rfp = fopen( "logreg.txt", "at" )) == NULL ) { |
1789 | 1791 | perror( "logreg.txt" ); |
@@ -2032,6 +2034,10 @@ | ||
2032 | 2034 | cr = 0; |
2033 | 2035 | { |
2034 | 2036 | unsigned char len[10]; |
2037 | +#ifdef SELF | |
2038 | + static hitCount = 0; | |
2039 | +#endif /* SELF */ | |
2040 | + | |
2035 | 2041 | sprintf( len, "%02d", hitLen ); |
2036 | 2042 | #ifdef NAMA |
2037 | 2043 | hit( ofp, hash, pkt_c->uk.key, kk, k, len, MAKAI_FALSE ); |
@@ -2038,6 +2044,13 @@ | ||
2038 | 2044 | #else /* NAMA */ |
2039 | 2045 | hit( ofp, hash, pkt_c->uk.key, kk, k, len, MAKAI_TRUE ); |
2040 | 2046 | #endif /* NAMA */ |
2047 | + | |
2048 | +#ifdef SELF | |
2049 | + hitCount++; | |
2050 | + if ( hitCount >= SELF_LIM_CNT ) { | |
2051 | + exit( 0 ); | |
2052 | + } | |
2053 | +#endif /* SELF */ | |
2041 | 2054 | } |
2042 | 2055 | } |
2043 | 2056 | } |
@@ -2061,6 +2074,11 @@ | ||
2061 | 2074 | int a, b, c; |
2062 | 2075 | /* 通算(単位 ktrips/sec) */ |
2063 | 2076 | diffTime = curTime - status.startTime; |
2077 | +#ifdef SELF | |
2078 | + if ( diffTime >= SELF_LIM_SEC ) { | |
2079 | + exit( 0 ); | |
2080 | + } | |
2081 | +#endif /* SELF */ | |
2064 | 2082 | a = status.loop / ((1000 / USEC_SEC) * diffTime); |
2065 | 2083 | #ifdef BENCH |
2066 | 2084 | if ( (diffTime / USEC_SEC) > (BENCH * 60) ) { |
@@ -44,4 +44,5 @@ | ||
44 | 44 | #[9] 怒数 |
45 | 45 | #[d] 飛連 |
46 | 46 | #[e] 八雲 |
47 | +#[Y] ちん | |
47 | 48 | #[Z] エロ |