コード例 #1
0
ファイル: i18nIMProto.c プロジェクト: Abioy/sunpinyin
 
******************************************************************/

/* Protocol Packet frames */

#include "FrameMgr.h"

/* Data type definitions */

static XimFrameRec ximattr_fr[] =
{
    _FRAME(BIT16),              /* attribute ID */
    _FRAME(BIT16),              /* type of the value */
    _FRAME(BIT16),              /* length of im-attribute */
    _FRAME(BARRAY),             /* im-attribute */
    _PAD4(2),
    _FRAME(EOL),
};

static XimFrameRec xicattr_fr[] =
{
    _FRAME(BIT16),              /* attribute ID */
    _FRAME(BIT16),              /* type of the value */
    _FRAME(BIT16),              /* length of ic-attribute */
    _FRAME(BARRAY),             /* ic-attribute */
    _PAD4(2),
    _FRAME(EOL),
};

static XimFrameRec ximattribute_fr[] =
{
コード例 #2
0
ファイル: SndFont.c プロジェクト: svkaiser/doom64DS
void SF_Setup(void)
{
    data    = &soundfont.data;
    list    = &soundfont.presetlist;
    sample  = &soundfont.samples;
    preset  = &soundfont.presetlist.preset;
    inst    = &soundfont.presetlist.inst;

    //
    // setup tags
    //
    strncpy(soundfont.RIFF, "RIFF", 4);
    strncpy(soundfont.sfbk, "sfbk", 4);
    strncpy(soundfont.LIST, "LIST", 4);
    strncpy(soundfont.INFO, "INFO", 4);
    strncpy(soundfont.data.LIST, "LIST", 4);
    strncpy(soundfont.data.sdta, "sdta", 4);
    strncpy(soundfont.data.smpl, "smpl", 4);
    strncpy(soundfont.version.ifil, "ifil", 4);
    strncpy(soundfont.name.INAM, "INAM", 4);
    strncpy(list->LIST, "LIST", 4);
    strncpy(list->pdta, "pdta", 4);
    strncpy(preset->info.phdr, "phdr", 4);
    strncpy(preset->gen.pgen, "pgen", 4);
    strncpy(preset->bag.pbag, "pbag", 4);
    strncpy(preset->mod.pmod, "pmod", 4);
    strncpy(inst->info.inst, "inst", 4);
    strncpy(inst->gen.igen, "igen", 4);
    strncpy(inst->bag.ibag, "ibag", 4);
    strncpy(inst->mod.imod, "imod", 4);
    strncpy(soundfont.samples.shdr, "shdr", 4);

    //
    // version
    //
    soundfont.version.size = 4;
    soundfont.version.wMajor = 2;
    soundfont.version.wMinor = 1;

    //
    // name
    //
    soundfont.name.size = strlen("DOOMSND.SF2") + 1;
    _PAD4(soundfont.name.size);
    soundfont.name.name = (char*)Mem_Alloc(soundfont.name.size);
    strncpy(soundfont.name.name, "DOOMSND.SF2", soundfont.name.size);

    //
    // initalize chunks
    //
    soundfont.listsize      = 24 + soundfont.name.size;
    soundfont.filesize      = 20 + soundfont.listsize;

    sample->size            = 0;
    sample->info            = (sfsampleinfo_t*)Mem_Alloc(1);

    data->size              = 0;
    data->wavdata           = (byte*)Mem_Alloc(1);

    preset->info.size       = 0;
    preset->bag.size        = 0;
    preset->gen.size        = 0;
    preset->info.presets    = (sfpresetinfo_t*)Mem_Alloc(1);
    preset->bag.presetbags  = (sfpresetbag_t*)Mem_Alloc(1);
    preset->gen.info        = (sfpresetgen_t*)Mem_Alloc(1);

    inst->info.size         = 0;
    inst->bag.size          = 0;
    inst->gen.size          = 0;
    inst->info.instruments  = (sfinstinfo_t*)Mem_Alloc(1);
    inst->bag.instbags      = (sfinstbag_t*)Mem_Alloc(1);
    inst->gen.info          = (sfinstgen_t*)Mem_Alloc(1);
}