1 /* 2 TiMidity++ -- MIDI to WAVE converter and player 3 Copyright (C) 1999-2002 Masanao Izumo <mo@goice.co.jp> 4 Copyright (C) 1995 Tuukka Toivonen <tt@cgs.fi> 5 6 This program is free software; you can redistribute it and/or modify 7 it under the terms of the GNU General Public License as published by 8 the Free Software Foundation; either version 2 of the License, or 9 (at your option) any later version. 10 11 This program is distributed in the hope that it will be useful, 12 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 GNU General Public License for more details. 15 16 You should have received a copy of the GNU General Public License 17 along with this program; if not, write to the Free Software 18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 20 bitset.h 21 22 Author: Masanao Izumo <mo@goice.co.jp> 23 Create: Sun Mar 02 1997 24 */ 25 26 #ifndef ___BITSET_H_ 27 #define ___BITSET_H_ 28 29 typedef struct _Bitset 30 { 31 int nbits; 32 unsigned int *bits; 33 } Bitset; 34 #define BIT_CHUNK_SIZE ((unsigned int)(8 * sizeof(unsigned int))) 35 36 /* 37 * Bitset �ν���� 38 * ������塢���ƤΥӥåȤ� 0 �˽��������� 39 */ 40 extern void init_bitset(Bitset *bitset, int nbits); 41 42 /* 43 * start ���ܤΥӥåȤ��顢nbit ʬ��0 �˥��åȤ��롣 44 */ 45 extern void clear_bitset(Bitset *bitset, int start_bit, int nbits); 46 47 /* 48 * start �ӥåȤ��顢nbits ʬ������ 49 */ 50 extern void get_bitset(const Bitset *bitset, unsigned int *bits_return, 51 int start_bit, int nbits); 52 /* get_bitset �� 1 �ӥå��� */ 53 extern int get_bitset1(Bitset *bitset, int n); 54 55 /* 56 * start �ӥåȤ��顢nbits ʬ��bits �˥��åȤ��� 57 */ 58 extern void set_bitset(Bitset *bitset, const unsigned int *bits, 59 int start_bit, int nbits); 60 /* set_bitset �� 1 �ӥå��� */ 61 extern void set_bitset1(Bitset *bitset, int n, int bit); 62 63 /* 64 * bitset ����� 1 �ӥåȤ�ޤޤ�Ƥ��ʤ���� 0 ���֤��� 65 * 1 �ӥåȤǤ�ޤޤ�Ƥ������ 0 �ʳ����ͤ��֤��� 66 */ 67 extern unsigned int has_bitset(const Bitset *bitset); 68 69 /* bitset �����ɽ�� */ 70 extern void print_bitset(Bitset *bitset); 71 72 #endif /* ___BITSET_H_ */ 73