亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? i18ntr.c

?? 手寫識別Chinput源碼
?? C
字號:
/******************************************************************          Copyright 1994, 1995 by Sun Microsystems, Inc.         Copyright 1993, 1994 by Hewlett-Packard Company Permission to use, copy, modify, distribute, and sell this softwareand its documentation for any purpose is hereby granted without fee,provided that the above copyright notice appear in all copies andthat both that copyright notice and this permission notice appearin supporting documentation, and that the name of Sun Microsystems, Inc.and Hewlett-Packard not be used in advertising or publicity pertaining todistribution of the software without specific, written prior permission.Sun Microsystems, Inc. and Hewlett-Packard make no representations aboutthe suitability of this software for any purpose.  It is provided "as is"without express or implied warranty. SUN MICROSYSTEMS INC. AND HEWLETT-PACKARD COMPANY DISCLAIMS ALLWARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIEDWARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALLSUN MICROSYSTEMS, INC. AND HEWLETT-PACKARD COMPANY BE LIABLE FOR ANYSPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVERRESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OFCONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF ORIN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.   Author: Hidetoshi Tajima(tajima@Eng.Sun.COM) Sun Microsystems, Inc.    This version tidied and debugged by Steve Underwood May 1999 ******************************************************************/#include <X11/Xlib.h>#include <X11/Xlibint.h>#include <stdlib.h>#include <stdio.h>#include "Xtrans.h"#include "FrameMgr.h"#include "IMdkit.h"#include "Xi18n.h"#include "Xi18nTr.h"extern Xi18nClient *_Xi18nFindClient (Xi18n, CARD16);extern Xi18nClient *_Xi18nNewClient (Xi18n);extern void _Xi18nDeleteClient (Xi18n, CARD16);static Bool TransRead (XtransConnInfo, char *, int, int *);static Bool TransWrite (XtransConnInfo, char *, int);static void Xi18nWaitTransListen (Display *, int, XPointer);static void Xi18nWaitTransAccept (Display *, int, XPointer);static unsigned char *ReadTrIMMessage (XIMS ims, int fd, int *connect_id){    Xi18n i18n_core = ims->protocol;    Xi18nClient *client = i18n_core->address.clients;    TransClient *tr_client;    FrameMgr fm;    extern XimFrameRec packet_header_fr[];    register int total_size;    unsigned char *p = NULL;    unsigned char *pp;    int read_length;    XimProtoHdr	*hdr;    Bool isConnect = False;    CARD8 major_opcode, minor_opcode;    CARD16 length;    while (client != NULL)    {        tr_client = (TransClient *) client->trans_rec;        if (tr_client->accept_fd == fd)        {            *connect_id = client->connect_id;            break;        }        /*endif*/        client = client->next;    }    /*endwhile*/    if ((hdr = (XimProtoHdr *) malloc (sizeof (hdr))) == NULL)        return (unsigned char *) NULL;    /*endif*/        if (!TransRead (tr_client->accept_conn,                    (char *) hdr,                    sizeof (hdr),                    &read_length)        ||        read_length != sizeof (hdr))    {        goto read_error;    }    else    {        if (client->byte_order == '?')        {            if (hdr->major_opcode == XIM_CONNECT)            {                CARD8 byte_order;                                if (!TransRead (tr_client->accept_conn,                                (char *) &byte_order,                                sizeof (CARD8),                                &read_length)                    ||                    read_length != sizeof (CARD8))                {                    goto read_error;                }                /*endif*/                isConnect = True;                client->byte_order = (CARD8) byte_order;            }            else            {                return (unsigned char *) NULL; 	/* can do nothing */            }            /*endif*/        }        /*endif*/        fm = FrameMgrInit (packet_header_fr,                           (char *) hdr,                           _Xi18nNeedSwap (i18n_core, *connect_id));        total_size = FrameMgrGetTotalSize (fm);        /* get data */        FrameMgrGetToken (fm, major_opcode);        FrameMgrGetToken (fm, minor_opcode);        FrameMgrGetToken (fm, length);        FrameMgrFree (fm);        if ((p = (unsigned char *) malloc (total_size + length*4)) == NULL)            return (unsigned char *) NULL;        /*endif*/        pp = p;        memmove(pp, &major_opcode, sizeof (CARD8));        pp += sizeof (CARD8);        memmove(pp, &minor_opcode, sizeof (CARD8));        pp += sizeof (CARD8);        memmove(pp, &length, sizeof (CARD16));        pp += sizeof (CARD16);        XFree (hdr);        if (!isConnect)        {            if (length > 0)            {                if (!TransRead (tr_client->accept_conn,                                (char *) pp,                                length*4,                                &read_length)                    ||                    read_length != length * 4)                {                    goto read_error;                }                /*endif*/            }            /*endif*/        }        else        {            memmove (pp, &client->byte_order, sizeof (CARD8));            pp += sizeof (CARD8);            if (!TransRead (tr_client->accept_conn,                            (char *) pp,                            length*4 - sizeof (CARD8),                            &read_length)                ||                read_length != length*4 - sizeof (CARD8))            {                goto read_error;            }            /*endif*/        }        /*endif*/    }    /*endif*/    return (unsigned char *) p;    //TODO: Get rid of this label, and the goto'sread_error:    _XUnregisterInternalConnection (i18n_core->address.dpy, fd);    _XimdXTransDisconnect (tr_client->accept_conn);    _XimdXTransClose (tr_client->accept_conn);    return (unsigned char *) NULL;}static Bool Xi18nTransBegin(XIMS ims){    Xi18n i18n_core = ims->protocol;    char *address = i18n_core->address.im_addr;    TransSpecRec *spec = (TransSpecRec *) i18n_core->address.connect_addr;    int fd;    if (((spec->trans_conn = (struct _XtransConnInfo *)                             _XimdXTransOpenCOTSServer(address)) == NULL)        ||        (_XimdXTransCreateListener(spec->trans_conn, spec->port) != 0))    {        return False;    }    /*endif*/    fd = _XimdXTransGetConnectionNumber(spec->trans_conn);    return _XRegisterInternalConnection(i18n_core->address.dpy, fd,                                        (_XInternalConnectionProc)Xi18nWaitTransListen,                                        (XPointer)ims);}static Bool Xi18nTransEnd(XIMS ims){    Xi18n i18n_core = ims->protocol;    TransSpecRec *spec = (TransSpecRec *) i18n_core->address.connect_addr;    int fd;    fd = _XimdXTransGetConnectionNumber (spec->trans_conn);    if (fd == 0)        return False;    /*endif*/    _XUnregisterInternalConnection (i18n_core->address.dpy, fd);    _XimdXTransDisconnect (spec->trans_conn);    _XimdXTransClose (spec->trans_conn);    XFree (spec->port);    XFree (spec);    return True;}static Bool Xi18nTransSend (XIMS ims,                            CARD16 connect_id,                            unsigned char *reply,                            long length){    Xi18n i18n_core = ims->protocol;    Xi18nClient *client = _Xi18nFindClient (i18n_core, connect_id);    TransClient *tr_client = (TransClient *) client->trans_rec;    if (length > 0)    {        if (TransWrite (tr_client->accept_conn, (char *) reply, length)            != length)        {            return False;        }        /*endif*/    }    /*endif*/    return True;}static Bool Xi18nTransWait (XIMS ims,                            CARD16 connect_id,                            CARD8 major_opcode,                            CARD8 minor_opcode){    Xi18n i18n_core = ims->protocol;    Xi18nClient *client = _Xi18nFindClient(i18n_core, connect_id);    TransClient *tr_client = (TransClient *)client->trans_rec;    int fd = _XimdXTransGetConnectionNumber(tr_client->accept_conn);    for (;;)    {        unsigned char *packet;        XimProtoHdr *hdr;        int connect_id_ret;        if ((packet = ReadTrIMMessage (ims, fd, &connect_id_ret))            == (unsigned char *) NULL)        {            return False;        }        /*endif*/        hdr = (XimProtoHdr *) packet;        if ((hdr->major_opcode == major_opcode)            &&            (hdr->minor_opcode == minor_opcode))        {            return True;        }        else if (hdr->major_opcode == XIM_ERROR)        {            return False;        }        /*endif*/    }    /*endfor*/}static Bool Xi18nTransDisconnect(XIMS ims, CARD16 connect_id){    Xi18n i18n_core = ims->protocol;    Xi18nClient *client = _Xi18nFindClient (i18n_core, connect_id);    TransClient *tr_client = (TransClient *) client->trans_rec;    _XUnregisterInternalConnection (i18n_core->address.dpy,                                    tr_client->accept_fd);    _XimdXTransDisconnect (tr_client->accept_conn);    _XimdXTransClose (tr_client->accept_conn);    XFree (tr_client);    _Xi18nDeleteClient (i18n_core, connect_id);    return True;}static Bool TransRead (XtransConnInfo accept_conn,                       char *buf,                       int buf_len,                       int *ret_len){    int len;    if ((len = _XimdXTransRead (accept_conn, buf, buf_len)) <= 0)        return False;    /*endif*/    *ret_len = len;    return True;}static Bool TransWrite (XtransConnInfo accept_conn, char *buf, int len){    register int nbyte;    while (len > 0)    {        if ((nbyte = _XimdXTransWrite (accept_conn, buf, len)) <= 0)            return False;        /*endif*/        len -= nbyte;        buf += nbyte;    }    /*endwhile*/    return True;}Bool _Xi18nCheckTransAddress (Xi18n i18n_core,                              TransportSW *transSW,                              char *address){    TransSpecRec *spec;    char *p;    char *hostname;    if (!(spec = (TransSpecRec *) malloc (sizeof (TransSpecRec))))        return False;    /*endif*/    if (!(hostname = (char *) malloc (strlen (address) + 1)))    {        XFree (spec);        return False;    }    /*endif*/    strcpy (hostname, address);    if (p = index (hostname, ':'))    {        p++;        if (!(spec->port = (char *) malloc (strlen (p) + 1)))        {            XFree (spec);            XFree (hostname);            return False;        }        /*endif*/        strcpy (spec->port, p);        XFree (hostname);    }    else    {        XFree (spec);        XFree (hostname);        return False;    }    /*endif*/    i18n_core->address.connect_addr = (TransSpecRec *) spec;    i18n_core->methods.begin = Xi18nTransBegin;    i18n_core->methods.end = Xi18nTransEnd;    i18n_core->methods.send = Xi18nTransSend;    i18n_core->methods.wait = Xi18nTransWait;    i18n_core->methods.disconnect = Xi18nTransDisconnect;    return True;}static TransClient *NewTrClient (Xi18n i18n_core, XtransConnInfo accept_conn){    Xi18nClient *client = _Xi18nNewClient (i18n_core);    TransClient *tr_client;    tr_client = (TransClient *) malloc (sizeof (TransClient));    tr_client->accept_conn = accept_conn;    tr_client->accept_fd = _XimdXTransGetConnectionNumber (accept_conn);    client->trans_rec = tr_client;    return ((TransClient *) tr_client);}static void Xi18nWaitTransListen (Display *d, int fd, XPointer arg){    XIMS ims = (XIMS)arg;    Xi18n i18n_core = ims->protocol;    TransSpecRec *spec = (TransSpecRec *) i18n_core->address.connect_addr;    XtransConnInfo new_client;    TransClient *client;    int status;    if ((new_client = (struct _XtransConnInfo *)                      _XimdXTransAccept (spec->trans_conn, &status)) != NULL)    {        client = NewTrClient (i18n_core, new_client);        _XRegisterInternalConnection (i18n_core->address.dpy,                                      client->accept_fd,                                      (_XInternalConnectionProc) Xi18nWaitTransAccept,                                      (XPointer) ims);    }    /*endif*/    return;}static void Xi18nWaitTransAccept (Display *d, int fd, XPointer arg){    XIMS ims = (XIMS) arg;    extern void _Xi18nMessageHandler (XIMS, CARD16, unsigned char *, Bool *);    Bool delete = True;    unsigned char *packet;    int connect_id;    if ((packet = ReadTrIMMessage (ims, fd, &connect_id))        == (unsigned char *) NULL)    {        return;    }    /*endif*/    _Xi18nMessageHandler (ims, connect_id, packet, &delete);    if (delete == True)        XFree (packet);    /*endif*/    return;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
经典三级视频一区| 天堂蜜桃91精品| 成人精品高清在线| 国产精品久久久久国产精品日日| 成人激情免费网站| 国产精品美女视频| 欧美探花视频资源| 人人精品人人爱| 久久精品男人天堂av| 99久久精品免费看| 亚洲第一主播视频| 精品国产露脸精彩对白| 成人av在线观| 午夜精品福利视频网站| 日韩一级免费观看| 欧美午夜免费电影| 香蕉成人啪国产精品视频综合网 | 成人av在线播放网站| 一区在线观看免费| 6080国产精品一区二区| 国产一区二区三区四区五区入口| 中文字幕一区在线观看| 欧美理论片在线| 国产成人激情av| 亚洲国产综合人成综合网站| 欧美成人在线直播| 99久久99久久久精品齐齐| 日韩成人午夜精品| 国产三级精品三级在线专区| 在线观看www91| 韩国一区二区三区| 亚洲福利一区二区| 亚洲国产成人午夜在线一区| 欧美人与禽zozo性伦| 懂色av一区二区三区蜜臀| 亚洲成a人片综合在线| 亚洲国产高清在线观看视频| 欧美伦理电影网| 成人动漫在线一区| 久久99精品久久久久久动态图| 亚洲三级免费电影| 国产亚洲精品免费| 9191成人精品久久| 91色porny在线视频| 国产一区二区三区四区在线观看| 亚洲国产中文字幕在线视频综合| 国产欧美日韩亚州综合| 91精品免费在线| 欧美影院一区二区| thepron国产精品| 国产一区二区三区高清播放| 亚洲18影院在线观看| 一区免费观看视频| 欧美国产精品一区二区三区| 欧美不卡在线视频| 91麻豆精品国产91久久久久久久久 | 蜜臀久久99精品久久久画质超高清 | 久久99国产精品成人| 亚洲va韩国va欧美va精品| 亚洲视频一二三| 国产精品天干天干在观线| 亚洲精品在线一区二区| 7777精品伊人久久久大香线蕉 | 91网站最新地址| 国产精品一二三区| 韩国女主播一区| 免费观看一级特黄欧美大片| 丝袜美腿高跟呻吟高潮一区| 亚洲成人动漫在线免费观看| 亚洲综合成人在线视频| 一区二区三区av电影| 亚洲精品中文字幕在线观看| 成人欧美一区二区三区小说| 国产日韩欧美精品一区| 欧美经典一区二区| 国产精品美女一区二区三区 | 一级精品视频在线观看宜春院| 亚洲欧洲日韩在线| 亚洲免费视频中文字幕| 亚洲欧美电影一区二区| 亚洲精品一卡二卡| 亚洲在线中文字幕| 亚洲国产一区视频| 午夜免费欧美电影| 免费成人美女在线观看.| 免费的成人av| 国产又黄又大久久| 丰满白嫩尤物一区二区| 不卡一区二区三区四区| 色国产综合视频| 欧美日韩视频在线观看一区二区三区| 欧美三级电影网站| 91精品国产欧美一区二区 | 欧美成人国产一区二区| 欧美成人r级一区二区三区| 欧美不卡视频一区| 久久精品一二三| 国产精品初高中害羞小美女文| 成人欧美一区二区三区白人| 亚洲精品国产第一综合99久久 | 亚洲精品乱码久久久久| 午夜精品福利久久久| 久久不见久久见免费视频7 | 久久精品国产精品亚洲红杏| 国产福利91精品一区二区三区| 成人精品一区二区三区中文字幕| 色综合婷婷久久| 久久精品久久久精品美女| 国产成人在线视频免费播放| 99久久精品国产毛片| 欧美日本免费一区二区三区| 久久综合中文字幕| 一区二区三区不卡视频| 精品一区二区影视| 99vv1com这只有精品| 91精品国产全国免费观看| 国产精品久久三| 琪琪久久久久日韩精品| 99视频在线精品| 日韩欧美一二三区| 亚洲啪啪综合av一区二区三区| 日本成人在线网站| 91亚洲男人天堂| 欧美成人vr18sexvr| 一区二区三区不卡在线观看| 精品无人码麻豆乱码1区2区| 91首页免费视频| 久久综合狠狠综合久久综合88| 一区二区三区欧美视频| 国内一区二区视频| 欧美日韩国产三级| 日本一区二区成人在线| 蜜桃视频一区二区三区在线观看| 99久久国产综合精品女不卡| 欧美精品一区二区三区在线播放| 亚洲一区二区三区视频在线 | 日韩一区二区三区在线视频| 亚洲欧美偷拍卡通变态| 国产一区91精品张津瑜| 欧美一区二区三区在线| 亚洲品质自拍视频网站| 高清在线观看日韩| 日韩精品影音先锋| 日韩在线卡一卡二| 色94色欧美sute亚洲线路一ni| 国产日韩欧美在线一区| 精品夜夜嗨av一区二区三区| 欧美人妖巨大在线| 亚洲午夜电影在线| 色老头久久综合| 亚洲人一二三区| 91在线小视频| 国产精品的网站| eeuss鲁片一区二区三区在线看| 精品国产乱码久久久久久夜甘婷婷| 亚洲bt欧美bt精品777| 91久久免费观看| 亚洲你懂的在线视频| 97se亚洲国产综合自在线观| 国产日本一区二区| 丁香婷婷综合色啪| 国产亚洲成aⅴ人片在线观看| 精品在线播放免费| 337p日本欧洲亚洲大胆精品| 久久精工是国产品牌吗| 日韩欧美一区二区视频| 美女一区二区三区| 精品久久国产老人久久综合| 精品在线亚洲视频| 久久久夜色精品亚洲| 国产成人在线视频网站| 欧美激情艳妇裸体舞| 99精品一区二区| 一区二区三区欧美激情| 欧美婷婷六月丁香综合色| 天堂蜜桃一区二区三区 | 在线观看国产一区二区| 亚洲一区二区三区视频在线| 欧美精品一级二级| 久久99国产精品免费| 国产欧美视频在线观看| 91美女精品福利| 亚洲国产精品自拍| 日韩西西人体444www| 国产乱码字幕精品高清av| 国产精品国产三级国产普通话蜜臀| 91在线精品一区二区| 亚洲成人激情社区| 精品黑人一区二区三区久久| 国产成a人亚洲| 亚洲一区二区免费视频| 6080日韩午夜伦伦午夜伦| 精品亚洲欧美一区| 亚洲婷婷在线视频| 欧美伦理视频网站| 国产成人av电影在线观看| 亚洲伦理在线精品| 欧美本精品男人aⅴ天堂| 国产成人精品影视| 亚洲小说春色综合另类电影|