/rusxmms/librcd

To get this branch, use:
bzr branch http://suren.me/webbzr/rusxmms/librcd

« back to all changes in this revision

Viewing changes to statgen/debug.c

  • Committer: Suren A. Chilingaryan
  • Date: 2005-06-16 23:19:27 UTC
  • Revision ID: Arch-1:ds@dside.dyndns.org--darksoft-2004%librcd--main--0.1--base-0
initial import

(automatically generated log message)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <stdio.h>
 
2
#define _AUTO_DEBUG
 
3
#include "charset_auto_russian.h"
 
4
 
 
5
 
 
6
main(int argc, char *argv[]) {
 
7
    FILE *f;
 
8
    int len,st;
 
9
    char word[256];
 
10
 
 
11
 
 
12
    if (argc!=2) {
 
13
        printf("Usage: %s <file name>\n",argv[0]);
 
14
        exit(0);
 
15
    }
 
16
 
 
17
    f=fopen(argv[1],"r");
 
18
    if (!f) {
 
19
        printf("Failed to open specified file. Check permissions!\n");
 
20
        exit(1);
 
21
    }
 
22
    
 
23
    while(!feof(f)) {
 
24
        fscanf(f,"%s",&word);
 
25
//      len=strlen(word)-1;
 
26
        for(st=0;word[st]=='"'||word[st]=='\''||word[st]=='(';st++);
 
27
        for(len=strlen(word)-1;word[len]==','||word[len]=='.'||word[len]=='!'||word[len]=='?'||word[len]==';'||word[len]=='-'||word[len]==':'||word[len]=='"'||word[len]=='\''||word[len]==')';len--);
 
28
        if (len<5) continue;
 
29
        else word[len+1]=0;
 
30
 
 
31
        autocharset_russian_uc(word+st,len+1-st);
 
32
    }
 
33
}