可怕的Esperanto

Posted on 2009年8月17日 22:56

Esperanto是世界语,libdwg的函数名、结构体名、注释使用的就是世界语,太可怕了,例如/libdwg-0.3/fontkodo/dvg.h:

// Cxefa interna inkluziv-dosiero de la biblioteko.

#ifndef DVG_H
#define DVG_H

#ifdef __cplusplus
extern "C"
{
#endif

/**
 Supertipoj de objektoj kiuj ekzistas en dvg-dosieroj.
 */
    typedef enum DVG_OBJEKTO_SUPERTIPO
    {
        DVG_OST_NEKONATAJXO,
        DVG_OST_ESTAJXO,
        DVG_OST_ORDINARAJXO
    } Dvg_Objekto_Supertipo;

/*--------------------------------------------------
 * Funkcioj
 */
int dvg_legi_dosiero (char *dosiernomo, Dvg_Strukturo *skt);

 

 

NSXMLParser的parse

Posted on 2009年8月16日 06:06

我把一个bin文件mv到/tmp/fake.xml,然后试试看NSXMLParser的parse判断there is an error or if the parsing operation is aborted的能力

- (void)parseXMLFile {
    BOOL ret;
    NSURL *xmlURL = [NSURL fileURLWithPath:@"/tmp/fake.xml"];
    NSXMLParser *xmlParser = [[NSXMLParser alloc] initWithContentsOfURL:xmlURL];
   
    ret = [xmlParser parse];
    if (ret == FALSE) {
        NSLog(@"there is an error or if the parsing operation is aborted!");
        return ;
    }
}