head 1.1; branch 1.1.1; access; symbols netbsd-11-0-RC4:1.1.1.1 netbsd-11-0-RC3:1.1.1.1 netbsd-11-0-RC2:1.1.1.1 netbsd-11-0-RC1:1.1.1.1 perseant-exfatfs-base-20250801:1.1.1.1 netbsd-11:1.1.1.1.0.78 netbsd-11-base:1.1.1.1 netbsd-10-1-RELEASE:1.1.1.1 perseant-exfatfs-base-20240630:1.1.1.1 perseant-exfatfs:1.1.1.1.0.76 perseant-exfatfs-base:1.1.1.1 netbsd-8-3-RELEASE:1.1.1.1 netbsd-9-4-RELEASE:1.1.1.1 netbsd-10-0-RELEASE:1.1.1.1 netbsd-10-0-RC6:1.1.1.1 netbsd-10-0-RC5:1.1.1.1 netbsd-10-0-RC4:1.1.1.1 netbsd-10-0-RC3:1.1.1.1 netbsd-10-0-RC2:1.1.1.1 netbsd-10-0-RC1:1.1.1.1 netbsd-10:1.1.1.1.0.74 netbsd-10-base:1.1.1.1 netbsd-9-3-RELEASE:1.1.1.1 cjep_sun2x-base1:1.1.1.1 cjep_sun2x:1.1.1.1.0.72 cjep_sun2x-base:1.1.1.1 cjep_staticlib_x-base1:1.1.1.1 netbsd-9-2-RELEASE:1.1.1.1 cjep_staticlib_x:1.1.1.1.0.70 cjep_staticlib_x-base:1.1.1.1 netbsd-9-1-RELEASE:1.1.1.1 phil-wifi-20200421:1.1.1.1 phil-wifi-20200411:1.1.1.1 is-mlppp:1.1.1.1.0.68 is-mlppp-base:1.1.1.1 phil-wifi-20200406:1.1.1.1 netbsd-8-2-RELEASE:1.1.1.1 netbsd-9-0-RELEASE:1.1.1.1 netbsd-9-0-RC2:1.1.1.1 netbsd-9-0-RC1:1.1.1.1 phil-wifi-20191119:1.1.1.1 netbsd-9:1.1.1.1.0.66 netbsd-9-base:1.1.1.1 phil-wifi-20190609:1.1.1.1 netbsd-8-1-RELEASE:1.1.1.1 netbsd-8-1-RC1:1.1.1.1 pgoyette-compat-merge-20190127:1.1.1.1 pgoyette-compat-20190127:1.1.1.1 pgoyette-compat-20190118:1.1.1.1 pgoyette-compat-1226:1.1.1.1 pgoyette-compat-1126:1.1.1.1 pgoyette-compat-1020:1.1.1.1 pgoyette-compat-0930:1.1.1.1 pgoyette-compat-0906:1.1.1.1 netbsd-7-2-RELEASE:1.1.1.1 pgoyette-compat-0728:1.1.1.1 netbsd-8-0-RELEASE:1.1.1.1 phil-wifi:1.1.1.1.0.64 phil-wifi-base:1.1.1.1 pgoyette-compat-0625:1.1.1.1 netbsd-8-0-RC2:1.1.1.1 pgoyette-compat-0521:1.1.1.1 pgoyette-compat-0502:1.1.1.1 pgoyette-compat-0422:1.1.1.1 netbsd-8-0-RC1:1.1.1.1 pgoyette-compat-0415:1.1.1.1 pgoyette-compat-0407:1.1.1.1 pgoyette-compat-0330:1.1.1.1 pgoyette-compat-0322:1.1.1.1 pgoyette-compat-0315:1.1.1.1 netbsd-7-1-2-RELEASE:1.1.1.1 pgoyette-compat:1.1.1.1.0.62 pgoyette-compat-base:1.1.1.1 netbsd-7-1-1-RELEASE:1.1.1.1 matt-nb8-mediatek:1.1.1.1.0.60 matt-nb8-mediatek-base:1.1.1.1 perseant-stdc-iso10646:1.1.1.1.0.58 perseant-stdc-iso10646-base:1.1.1.1 netbsd-8:1.1.1.1.0.56 netbsd-8-base:1.1.1.1 prg-localcount2-base3:1.1.1.1 prg-localcount2-base2:1.1.1.1 prg-localcount2-base1:1.1.1.1 prg-localcount2:1.1.1.1.0.54 prg-localcount2-base:1.1.1.1 pgoyette-localcount-20170426:1.1.1.1 bouyer-socketcan-base1:1.1.1.1 pgoyette-localcount-20170320:1.1.1.1 netbsd-7-1:1.1.1.1.0.52 netbsd-7-1-RELEASE:1.1.1.1 netbsd-7-1-RC2:1.1.1.1 netbsd-7-nhusb-base-20170116:1.1.1.1 bouyer-socketcan:1.1.1.1.0.50 bouyer-socketcan-base:1.1.1.1 pgoyette-localcount-20170107:1.1.1.1 netbsd-7-1-RC1:1.1.1.1 pgoyette-localcount-20161104:1.1.1.1 netbsd-7-0-2-RELEASE:1.1.1.1 localcount-20160914:1.1.1.1 netbsd-7-nhusb:1.1.1.1.0.48 netbsd-7-nhusb-base:1.1.1.1 pgoyette-localcount-20160806:1.1.1.1 pgoyette-localcount-20160726:1.1.1.1 pgoyette-localcount:1.1.1.1.0.46 pgoyette-localcount-base:1.1.1.1 netbsd-7-0-1-RELEASE:1.1.1.1 netbsd-7-0:1.1.1.1.0.44 netbsd-7-0-RELEASE:1.1.1.1 netbsd-7-0-RC3:1.1.1.1 netbsd-7-0-RC2:1.1.1.1 netbsd-7-0-RC1:1.1.1.1 netbsd-5-2-3-RELEASE:1.1.1.1 netbsd-5-1-5-RELEASE:1.1.1.1 netbsd-6-0-6-RELEASE:1.1.1.1 netbsd-6-1-5-RELEASE:1.1.1.1 netbsd-7:1.1.1.1.0.42 netbsd-7-base:1.1.1.1 yamt-pagecache-base9:1.1.1.1 yamt-pagecache-tag8:1.1.1.1 netbsd-6-1-4-RELEASE:1.1.1.1 netbsd-6-0-5-RELEASE:1.1.1.1 tls-earlyentropy:1.1.1.1.0.40 tls-earlyentropy-base:1.1.1.1 riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.1.1.1 riastradh-drm2-base3:1.1.1.1 netbsd-6-1-3-RELEASE:1.1.1.1 netbsd-6-0-4-RELEASE:1.1.1.1 netbsd-5-2-2-RELEASE:1.1.1.1 netbsd-5-1-4-RELEASE:1.1.1.1 netbsd-6-1-2-RELEASE:1.1.1.1 netbsd-6-0-3-RELEASE:1.1.1.1 netbsd-5-2-1-RELEASE:1.1.1.1 netbsd-5-1-3-RELEASE:1.1.1.1 netbsd-6-1-1-RELEASE:1.1.1.1 riastradh-drm2-base2:1.1.1.1 riastradh-drm2-base1:1.1.1.1 riastradh-drm2:1.1.1.1.0.34 riastradh-drm2-base:1.1.1.1 netbsd-6-1:1.1.1.1.0.38 netbsd-6-0-2-RELEASE:1.1.1.1 netbsd-6-1-RELEASE:1.1.1.1 netbsd-6-1-RC4:1.1.1.1 netbsd-6-1-RC3:1.1.1.1 agc-symver:1.1.1.1.0.36 agc-symver-base:1.1.1.1 netbsd-6-1-RC2:1.1.1.1 netbsd-6-1-RC1:1.1.1.1 yamt-pagecache-base8:1.1.1.1 netbsd-5-2:1.1.1.1.0.32 netbsd-6-0-1-RELEASE:1.1.1.1 yamt-pagecache-base7:1.1.1.1 netbsd-5-2-RELEASE:1.1.1.1 netbsd-5-2-RC1:1.1.1.1 matt-nb6-plus-nbase:1.1.1.1 yamt-pagecache-base6:1.1.1.1 netbsd-6-0:1.1.1.1.0.30 netbsd-6-0-RELEASE:1.1.1.1 netbsd-6-0-RC2:1.1.1.1 tls-maxphys:1.1.1.1.0.28 tls-maxphys-base:1.1.1.1 matt-nb6-plus:1.1.1.1.0.26 matt-nb6-plus-base:1.1.1.1 netbsd-6-0-RC1:1.1.1.1 yamt-pagecache-base5:1.1.1.1 yamt-pagecache-base4:1.1.1.1 netbsd-6:1.1.1.1.0.24 netbsd-6-base:1.1.1.1 netbsd-5-1-2-RELEASE:1.1.1.1 netbsd-5-1-1-RELEASE:1.1.1.1 yamt-pagecache-base3:1.1.1.1 yamt-pagecache-base2:1.1.1.1 yamt-pagecache:1.1.1.1.0.4 yamt-pagecache-base:1.1.1.1 cherry-xenmp:1.1.1.1.0.22 cherry-xenmp-base:1.1.1.1 bouyer-quota2-nbase:1.1.1.1 bouyer-quota2:1.1.1.1.0.20 bouyer-quota2-base:1.1.1.1 matt-mips64-premerge-20101231:1.1.1.1 matt-nb5-mips64-premerge-20101231:1.1.1.1 matt-nb5-pq3:1.1.1.1.0.18 matt-nb5-pq3-base:1.1.1.1 netbsd-5-1:1.1.1.1.0.16 netbsd-5-1-RELEASE:1.1.1.1 netbsd-5-1-RC4:1.1.1.1 matt-nb5-mips64-k15:1.1.1.1 netbsd-5-1-RC3:1.1.1.1 netbsd-5-1-RC2:1.1.1.1 netbsd-5-1-RC1:1.1.1.1 netbsd-5-0-2-RELEASE:1.1.1.1 matt-nb5-mips64-premerge-20091211:1.1.1.1 matt-premerge-20091211:1.1.1.1 matt-nb5-mips64-u2-k2-k4-k7-k8-k9:1.1.1.1 matt-nb4-mips64-k7-u2a-k9b:1.1.1.1 matt-nb5-mips64-u1-k1-k5:1.1.1.1 matt-nb5-mips64:1.1.1.1.0.14 netbsd-5-0-1-RELEASE:1.1.1.1 jym-xensuspend-nbase:1.1.1.1 netbsd-5-0:1.1.1.1.0.12 netbsd-5-0-RELEASE:1.1.1.1 netbsd-5-0-RC4:1.1.1.1 netbsd-5-0-RC3:1.1.1.1 netbsd-5-0-RC2:1.1.1.1 jym-xensuspend:1.1.1.1.0.10 jym-xensuspend-base:1.1.1.1 netbsd-5-0-RC1:1.1.1.1 haad-dm-base:1.1.1.1 haad-dm-base2:1.1.1.1 haad-nbase2:1.1.1.1 netbsd-5:1.1.1.1.0.8 netbsd-5-base:1.1.1.1 matt-mips64-base2:1.1.1.1 haad-dm:1.1.1.1.0.6 haad-dm-base1:1.1.1.1 wrstuden-revivesa-base-3:1.1.1.1 wrstuden-revivesa:1.1.1.1.0.2 wrstuden-revivesa-base-2:1.1.1.1 TOP3_8BETA1:1.1.1.1 LEFEBVRE:1.1.1; locks; strict; comment @# @; 1.1 date 2008.07.16.00.20.33; author christos; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2008.07.16.00.20.33; author christos; state Exp; branches 1.1.1.1.2.1 1.1.1.1.6.1; next ; 1.1.1.1.2.1 date 2008.07.16.00.20.33; author wrstuden; state dead; branches; next 1.1.1.1.2.2; 1.1.1.1.2.2 date 2008.09.18.05.15.51; author wrstuden; state Exp; branches; next ; 1.1.1.1.6.1 date 2008.07.16.00.20.33; author haad; state dead; branches; next 1.1.1.1.6.2; 1.1.1.1.6.2 date 2008.10.19.22.40.53; author haad; state Exp; branches; next ; desc @@ 1.1 log @Initial revision @ text @/* * Copyright (c) 1984 through 2008, William LeFebvre * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * * Neither the name of William LeFebvre nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* hash.m4h */ /* Interface definition for hash.c */ /* The file hash.h is generated from hash.m4h via the preprocessor M4 */ #ifndef _HASH_H #define _HASH_H #include typedef struct pidthr_t { pid_t k_pid; id_t k_thr; } pidthr_t; typedef struct llistitem { void *datum; struct llistitem *next; } llistitem; typedef struct llist { llistitem *head; unsigned int count; } llist; typedef struct bucket { llist list; } bucket_t; typedef struct hash_table { int num_buckets; bucket_t *buckets; } hash_table; typedef struct hash_pos { int num_buckets; int curr; bucket_t *hash_bucket; llistitem *ll_item; llistitem *ll_last; } hash_pos; hash_table *hash_create(int num); void hash_sizeinfo(unsigned int *sizes, int max, hash_table *ht); define(`HASH_TYPE_TMPL', ` typedef struct hash_item_$1 { $2 key; void *value; } hash_item_$1; void *hash_add_$1(hash_table *ht, $2 key, void *value); void *hash_replace_$1(hash_table *ht, $2 key, void *value); void *hash_lookup_$1(hash_table *ht, $2 key); void *hash_remove_$1(hash_table *ht, $2 key); hash_item_$1 *hash_first_$1(hash_table *ht, hash_pos *pos); hash_item_$1 *hash_next_$1(hash_pos *pos); void *hash_remove_pos_$1(hash_pos *pos); ') HASH_TYPE_TMPL(`uint', `unsigned int') HASH_TYPE_TMPL(`pid', `pid_t') HASH_TYPE_TMPL(`string', `char *') HASH_TYPE_TMPL(`pidthr', `pidthr_t') #if HAVE_LWPID_T HASH_TYPE_TMPL(`lwpid', `lwpid_t') #endif #endif @ 1.1.1.1 log @import latest top @ text @@ 1.1.1.1.6.1 log @file hash.m4h was added on branch haad-dm on 2008-10-19 22:40:53 +0000 @ text @d1 103 @ 1.1.1.1.6.2 log @Sync with HEAD. @ text @a0 103 /* * Copyright (c) 1984 through 2008, William LeFebvre * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * * Neither the name of William LeFebvre nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* hash.m4h */ /* Interface definition for hash.c */ /* The file hash.h is generated from hash.m4h via the preprocessor M4 */ #ifndef _HASH_H #define _HASH_H #include typedef struct pidthr_t { pid_t k_pid; id_t k_thr; } pidthr_t; typedef struct llistitem { void *datum; struct llistitem *next; } llistitem; typedef struct llist { llistitem *head; unsigned int count; } llist; typedef struct bucket { llist list; } bucket_t; typedef struct hash_table { int num_buckets; bucket_t *buckets; } hash_table; typedef struct hash_pos { int num_buckets; int curr; bucket_t *hash_bucket; llistitem *ll_item; llistitem *ll_last; } hash_pos; hash_table *hash_create(int num); void hash_sizeinfo(unsigned int *sizes, int max, hash_table *ht); define(`HASH_TYPE_TMPL', ` typedef struct hash_item_$1 { $2 key; void *value; } hash_item_$1; void *hash_add_$1(hash_table *ht, $2 key, void *value); void *hash_replace_$1(hash_table *ht, $2 key, void *value); void *hash_lookup_$1(hash_table *ht, $2 key); void *hash_remove_$1(hash_table *ht, $2 key); hash_item_$1 *hash_first_$1(hash_table *ht, hash_pos *pos); hash_item_$1 *hash_next_$1(hash_pos *pos); void *hash_remove_pos_$1(hash_pos *pos); ') HASH_TYPE_TMPL(`uint', `unsigned int') HASH_TYPE_TMPL(`pid', `pid_t') HASH_TYPE_TMPL(`string', `char *') HASH_TYPE_TMPL(`pidthr', `pidthr_t') #if HAVE_LWPID_T HASH_TYPE_TMPL(`lwpid', `lwpid_t') #endif #endif @ 1.1.1.1.2.1 log @file hash.m4h was added on branch wrstuden-revivesa on 2008-09-18 05:15:51 +0000 @ text @d1 103 @ 1.1.1.1.2.2 log @Sync with wrstuden-revivesa-base-2. @ text @a0 103 /* * Copyright (c) 1984 through 2008, William LeFebvre * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * * Neither the name of William LeFebvre nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* hash.m4h */ /* Interface definition for hash.c */ /* The file hash.h is generated from hash.m4h via the preprocessor M4 */ #ifndef _HASH_H #define _HASH_H #include typedef struct pidthr_t { pid_t k_pid; id_t k_thr; } pidthr_t; typedef struct llistitem { void *datum; struct llistitem *next; } llistitem; typedef struct llist { llistitem *head; unsigned int count; } llist; typedef struct bucket { llist list; } bucket_t; typedef struct hash_table { int num_buckets; bucket_t *buckets; } hash_table; typedef struct hash_pos { int num_buckets; int curr; bucket_t *hash_bucket; llistitem *ll_item; llistitem *ll_last; } hash_pos; hash_table *hash_create(int num); void hash_sizeinfo(unsigned int *sizes, int max, hash_table *ht); define(`HASH_TYPE_TMPL', ` typedef struct hash_item_$1 { $2 key; void *value; } hash_item_$1; void *hash_add_$1(hash_table *ht, $2 key, void *value); void *hash_replace_$1(hash_table *ht, $2 key, void *value); void *hash_lookup_$1(hash_table *ht, $2 key); void *hash_remove_$1(hash_table *ht, $2 key); hash_item_$1 *hash_first_$1(hash_table *ht, hash_pos *pos); hash_item_$1 *hash_next_$1(hash_pos *pos); void *hash_remove_pos_$1(hash_pos *pos); ') HASH_TYPE_TMPL(`uint', `unsigned int') HASH_TYPE_TMPL(`pid', `pid_t') HASH_TYPE_TMPL(`string', `char *') HASH_TYPE_TMPL(`pidthr', `pidthr_t') #if HAVE_LWPID_T HASH_TYPE_TMPL(`lwpid', `lwpid_t') #endif #endif @