Develop and Download Open Source Software

Browse Subversion Repository

Diff of /branches/mty-makai/mty.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 200 by notanpe, Fri Jun 27 14:38:47 2008 UTC revision 202 by notanpe, Thu Jul 31 14:01:57 2008 UTC
# Line 100  struct DT *dtidx[0x100 + 1]; Line 100  struct DT *dtidx[0x100 + 1];
100  int     special = 0;  int     special = 0;
101  #define ST_ALLN 1  #define ST_ALLN 1
102  #define ST_NIKO 1<<1  #define ST_NIKO 1<<1
103    #define ST_BUOO 1<<8
104    
105  void  void
106  comment( str )  comment( str )
# Line 134  char   *str; Line 135  char   *str;
135        special |= ST_NIKO;        special |= ST_NIKO;
136        printf( "二構\n" );        printf( "二構\n" );
137        break;        break;
138         case '8':
139          special |= ST_BUOO;
140          printf( "ぶお\n" );
141          break;
142      }      }
143     }     }
144    }    }
# Line 1369  char   *path; Line 1374  char   *path;
1374             MIN_THREAD, MAX_THREAD );             MIN_THREAD, MAX_THREAD );
1375    printf( " -m mask : 実行する CPU を指定するマスク ( 1 ビット ≦ mask のビット数 ≦ %d ビット )\n",    printf( " -m mask : 実行する CPU を指定するマスク ( 1 ビット ≦ mask のビット数 ≦ %d ビット )\n",
1376            MAX_THREAD );            MAX_THREAD );
1377    printf( " 【 -t と -m は排他】\n" );    printf( " 【-t と -m は排他】\n" );
1378    printf( " str : 先頭に埋め込む文字列 ( %d ≦ str のバイト数 ≦ %d )\n",    printf( " str : 先頭に埋め込む文字列 ( %d ≦ str のバイト数 ≦ %d )\n",
1379             MIN_UME, MAX_UME );             MIN_UME, MAX_UME );
1380  }  }
1381    
1382  /* ヒット時には出力ファイルへのポインタを返す */  /* ヒット時には出力ファイルへのポインタを返す */
1383  FILE *  FILE *
1384  checkSpecial( trip )  checkSpecial( trip, kind )
1385  char    *trip;  char    *trip;
1386    unsigned char   *kind;
1387  {  {
1388    if ( special & ST_ALLN ) {    if ( special & ST_BUOO ) {
1389     /* 全数字 */     /* ぶお [A-Za-z]aoo[A-Za-z]uoo$ */
1390     if ( isdigit( trip[0] ) && isdigit( trip[1] ) && isdigit( trip[2] ) &&     if ( trip[3] == 'a' && trip[4] == 'o' && trip[5] == 'o' &&
1391          isdigit( trip[3] ) && isdigit( trip[4] ) && isdigit( trip[5] ) &&          trip[7] == 'u' && trip[8] == 'o' && trip[9] == 'o' &&
1392          isdigit( trip[6] ) && isdigit( trip[7] ) && isdigit( trip[8] ) &&          isalpha( trip[2] ) && isalpha( trip[6] ) ) {
1393          isdigit( trip[9] ) ) {      strcpy( kind, "ぶ" );
1394      return( tfp );      return( tfp );
1395     }     }
1396    }    }
# Line 1402  char   *trip; Line 1408  char   *trip;
1408     for ( ; i < TRIP_LEN; i++ ) {     for ( ; i < TRIP_LEN; i++ ) {
1409      if ( trip[i] != ch1 && trip[i] != ch2 ) goto NONIKO;      if ( trip[i] != ch1 && trip[i] != ch2 ) goto NONIKO;
1410     }     }
1411       strcpy( kind, "二" );
1412     return( tfp );     return( tfp );
1413    }    }
1414    NONIKO:    NONIKO:
1415    
1416      if ( special & ST_ALLN ) {
1417       /* 全数字 */
1418       if ( isdigit( trip[0] ) && isdigit( trip[1] ) && isdigit( trip[2] ) &&
1419            isdigit( trip[3] ) && isdigit( trip[4] ) && isdigit( trip[5] ) &&
1420            isdigit( trip[6] ) && isdigit( trip[7] ) && isdigit( trip[8] ) &&
1421            isdigit( trip[9] ) ) {
1422        strcpy( kind, "数" );
1423        return( tfp );
1424       }
1425      }
1426    
1427    return( NULL );    return( NULL );
1428  }  }
1429  /* MAKAI end */  /* MAKAI end */
# Line 1934  main(int argc, char *argv[]) Line 1952  main(int argc, char *argv[])
1952    char hash[16];    char hash[16];
1953    uint8_t buf[32];    uint8_t buf[32];
1954    FILE  *lfp;    FILE  *lfp;
1955      unsigned char kind[3];
1956    
1957    for ( k = 0; k < ALU_BITS; k++ ) {    for ( k = 0; k < ALU_BITS; k++ ) {
1958     for ( i = 1; i < 11; i++ ) {     for ( i = 1; i < 11; i++ ) {
# Line 1943  main(int argc, char *argv[]) Line 1962  main(int argc, char *argv[])
1962      hash[i - 1] = C64[c];      hash[i - 1] = C64[c];
1963     }     }
1964     hash[10] = 0;     hash[10] = 0;
1965     if ( (lfp = checkSpecial( hash )) != NULL ) {     if ( (lfp = checkSpecial( hash, kind )) != NULL ) {
1966      struct timeb tb;      struct timeb tb;
1967      struct tm *plt;      struct tm *plt;
1968    
1969      ftime( &tb );      ftime( &tb );
1970      plt = localtime( &tb.time );      plt = localtime( &tb.time );
1971      memcpy( buf, pkt_c->uk.key, 8 );      buf[0] = '#';
1972      buf[8] = buf[9] = 0;      memcpy( buf+1, pkt_c->uk.key, 8 );
1973      buf[7] = ( buf[7] & - ( 1 << N_STRIDE ) & 0x7F ) + ALU_BITS * kk + k;      buf[9] = buf[10] = 0;
1974        buf[8] = ( buf[8] & - ( 1 << N_STRIDE ) & 0x7F ) + ALU_BITS * kk + k;
1975      if ( cr ) fprintf( stderr, "\n" );      if ( cr ) fprintf( stderr, "\n" );
1976      cr = 0;      cr = 0;
1977      if ( translate( buf, 0, 1 ) ) {      if ( ! translate( buf+1, 0, 1 ) ) {
1978       log_printf( lfp, "◆%s #%s"       strcpy( buf, "残念でした" );
                  "\t%04d/%02d/%02d %02d:%02d:%02d.%03d"  
                  "\t(%02X %02X %02X %02X %02X %02X %02X %02X/%02X) ☆\n",  
                  hash, buf,  
                  plt->tm_year + 1900, plt->tm_mon + 1, plt->tm_mday,  
                  plt->tm_hour, plt->tm_min, plt->tm_sec, tb.millitm,  
                  buf[0], buf[1], buf[2], buf[3], buf[4],  
                  buf[5], buf[6], buf[7], buf[8] );  
     } else {  
      log_printf( lfp, "◆%s 残念でした"  
                  "\t%04d/%02d/%02d %02d:%02d:%02d.%03d"  
                  "\t(%02X %02X %02X %02X %02X %02X %02X %02X/%02X) ☆\n",  
                  hash,  
                  plt->tm_year + 1900, plt->tm_mon + 1, plt->tm_mday,  
                  plt->tm_hour, plt->tm_min, plt->tm_sec, tb.millitm,  
                  buf[0], buf[1], buf[2], buf[3], buf[4],  
                  buf[5], buf[6], buf[7], buf[8] );  
1979      }      }
1980        log_printf( lfp, "◆%s %s"
1981                    "\t%04d/%02d/%02d %02d:%02d:%02d.%03d"
1982                    "\t(%02X %02X %02X %02X %02X %02X %02X %02X/%02X) %s\n",
1983                    hash, buf,
1984                    plt->tm_year + 1900, plt->tm_mon + 1, plt->tm_mday,
1985                    plt->tm_hour, plt->tm_min, plt->tm_sec, tb.millitm,
1986                    buf[0], buf[1], buf[2], buf[3], buf[4],
1987                    buf[5], buf[6], buf[7], buf[8], kind );
1988     }     }
1989    }    }
1990    }    }

Legend:
Removed from v.200  
changed lines
  Added in v.202

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26