📄 bitset.h
字号:
/* TiMidity++ -- MIDI to WAVE converter and player Copyright (C) 1999-2002 Masanao Izumo <mo@goice.co.jp> Copyright (C) 1995 Tuukka Toivonen <tt@cgs.fi> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA bitset.h Author: Masanao Izumo <mo@goice.co.jp> Create: Sun Mar 02 1997*/#ifndef ___BITSET_H_#define ___BITSET_H_typedef struct _Bitset{ int nbits; unsigned int *bits;} Bitset;#define BIT_CHUNK_SIZE ((unsigned int)(8 * sizeof(unsigned int)))/* * Bitset の介袋步 * 介袋步稿、链てのビットは 0 に介袋步される */extern void init_bitset(Bitset *bitset, int nbits);/* * start 戎誊のビットから、nbit 尸、0 にセットする。 */extern void clear_bitset(Bitset *bitset, int start_bit, int nbits);/* * start ビットから、nbits 尸、评る */extern void get_bitset(const Bitset *bitset, unsigned int *bits_return, int start_bit, int nbits);/* get_bitset の 1 ビット惹 */extern int get_bitset1(Bitset *bitset, int n);/* * start ビットから、nbits 尸、bits にセットする */extern void set_bitset(Bitset *bitset, const unsigned int *bits, int start_bit, int nbits);/* set_bitset の 1 ビット惹 */extern void set_bitset1(Bitset *bitset, int n, int bit);/* * bitset の面に 1 ビットも崔まれていなければ 0 を手し· * 1 ビットでも崔まれている眷圭は 0 笆嘲の猛を手すˉ */extern unsigned int has_bitset(const Bitset *bitset);/* bitset の面を山绩 */extern void print_bitset(Bitset *bitset);#endif /* ___BITSET_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -