/[guile]/guile/guile-core/libguile/weaks.c
ViewVC logotype

Diff of /guile/guile-core/libguile/weaks.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.51 by hanwen, Sun Aug 4 00:17:18 2002 UTC revision 1.52 by mdj, Tue Feb 11 13:49:32 2003 UTC
# Line 1  Line 1 
1  /* Copyright (C) 1995,1996,1998,2000,2001 Free Software Foundation, Inc.  /* Copyright (C) 1995,1996,1998,2000,2001, 2003 Free Software Foundation, Inc.
2   *   *
3   * This program is free software; you can redistribute it and/or modify   * This program is free software; you can redistribute it and/or modify
4   * it under the terms of the GNU General Public License as published by   * it under the terms of the GNU General Public License as published by
# Line 45  Line 45 
45  #include "libguile/_scm.h"  #include "libguile/_scm.h"
46  #include "libguile/vectors.h"  #include "libguile/vectors.h"
47  #include "libguile/lang.h"  #include "libguile/lang.h"
48    #include "libguile/hashtab.h"
49    
50  #include "libguile/validate.h"  #include "libguile/validate.h"
51  #include "libguile/weaks.h"  #include "libguile/weaks.h"
# Line 169  SCM_DEFINE (scm_weak_vector_p, "weak-vec Line 170  SCM_DEFINE (scm_weak_vector_p, "weak-vec
170    
171    
172    
173  SCM_DEFINE (scm_make_weak_key_hash_table, "make-weak-key-hash-table", 1, 0, 0,  SCM_DEFINE (scm_make_weak_key_hash_table, "make-weak-key-hash-table", 0, 1, 0,
174              (SCM size),              (SCM size),
175              "@deffnx {Scheme Procedure} make-weak-value-hash-table size\n"              "@deffnx {Scheme Procedure} make-weak-value-hash-table size\n"
176              "@deffnx {Scheme Procedure} make-doubly-weak-hash-table size\n"              "@deffnx {Scheme Procedure} make-doubly-weak-hash-table size\n"
# Line 181  SCM_DEFINE (scm_make_weak_key_hash_table Line 182  SCM_DEFINE (scm_make_weak_key_hash_table
182              "would modify regular hash tables. (@pxref{Hash Tables})")              "would modify regular hash tables. (@pxref{Hash Tables})")
183  #define FUNC_NAME s_scm_make_weak_key_hash_table  #define FUNC_NAME s_scm_make_weak_key_hash_table
184  {  {
185    return allocate_weak_vector (1, size, SCM_EOL, FUNC_NAME);    if (SCM_UNBNDP (size))
186        return scm_vector_to_hash_table (allocate_weak_vector (1, SCM_MAKINUM (37),
187                                                               SCM_EOL, FUNC_NAME));
188      else
189        return allocate_weak_vector (1, size, SCM_EOL, FUNC_NAME);
190  }  }
191  #undef FUNC_NAME  #undef FUNC_NAME
192    
193    
194  SCM_DEFINE (scm_make_weak_value_hash_table, "make-weak-value-hash-table", 1, 0, 0,  SCM_DEFINE (scm_make_weak_value_hash_table, "make-weak-value-hash-table", 0, 1, 0,
195              (SCM size),              (SCM size),
196              "Return a hash table with weak values with @var{size} buckets.\n"              "Return a hash table with weak values with @var{size} buckets.\n"
197              "(@pxref{Hash Tables})")              "(@pxref{Hash Tables})")
198  #define FUNC_NAME s_scm_make_weak_value_hash_table  #define FUNC_NAME s_scm_make_weak_value_hash_table
199  {  {
200    return allocate_weak_vector (2, size, SCM_EOL, FUNC_NAME);    if (SCM_UNBNDP (size))
201        return scm_vector_to_hash_table (allocate_weak_vector (2, SCM_MAKINUM (37),
202                                                               SCM_EOL, FUNC_NAME));
203      else
204        return allocate_weak_vector (2, size, SCM_EOL, FUNC_NAME);
205  }  }
206  #undef FUNC_NAME  #undef FUNC_NAME
207    
# Line 203  SCM_DEFINE (scm_make_doubly_weak_hash_ta Line 212  SCM_DEFINE (scm_make_doubly_weak_hash_ta
212              "buckets.  (@pxref{Hash Tables})")              "buckets.  (@pxref{Hash Tables})")
213  #define FUNC_NAME s_scm_make_doubly_weak_hash_table  #define FUNC_NAME s_scm_make_doubly_weak_hash_table
214  {  {
215    return allocate_weak_vector (3, size, SCM_EOL, FUNC_NAME);    if (SCM_UNBNDP (size))
216        return scm_vector_to_hash_table (allocate_weak_vector (3, SCM_MAKINUM (37),
217                                                               SCM_EOL, FUNC_NAME));
218      else
219        return allocate_weak_vector (3, size, SCM_EOL, FUNC_NAME);
220  }  }
221  #undef FUNC_NAME  #undef FUNC_NAME
222    

Legend:
Removed from v.1.51  
changed lines
  Added in v.1.52

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26