bit_sequence.h

00001 #ifndef _CP_BIT_SEQUENCE_H
00002 #define _CP_BIT_SEQUENCE_H
00003 
00004 #include "common.h"
00005 
00006 typedef struct _cp_bit_sequence
00007 {
00008     unsigned char *bits;
00009     int length;
00010 } cp_bit_sequence;
00011 
00012 #define BYTECOUNT(b) (((b)->length + 7) >> 3)
00013 
00014 CPROPS_DLL
00015 cp_bit_sequence *cp_bit_sequence_create(int length, unsigned char *bits);
00016 
00021 cp_bit_sequence *cstr_to_bit_sequence(char *str);
00022 
00023 CPROPS_DLL
00024 void cp_bit_sequence_destroy(cp_bit_sequence *seq);
00025 
00026 CPROPS_DLL
00027 cp_bit_sequence *cp_bit_sequence_dup(cp_bit_sequence *seq);
00028 
00029 CPROPS_DLL
00030 cp_bit_sequence *cp_bit_sequence_cpy(cp_bit_sequence *dst, cp_bit_sequence *src);
00031 
00032 CPROPS_DLL
00033 cp_bit_sequence *cp_bit_sequence_cat(cp_bit_sequence *head, cp_bit_sequence *tail);
00034 
00038 CPROPS_DLL
00039 int cp_bit_sequence_shift_left(cp_bit_sequence *seq, int count);
00040 
00048 CPROPS_DLL
00049 int cp_bit_sequence_cmp(cp_bit_sequence *a, cp_bit_sequence *b, int *pos);
00050 
00051 #define cp_bit_sequence_length(seq) (seq)->length
00052 
00053 CPROPS_DLL
00054 void cp_bit_sequence_dump(cp_bit_sequence *seq);
00055 
00056 CPROPS_DLL
00057 char *cp_bit_sequence_to_string(cp_bit_sequence *seq);
00058 
00059 #endif /* _CP_BIT_SEQUENCE_H */
00060 

Generated on Mon Dec 5 23:00:21 2011 for cprops by  doxygen 1.4.7