Deleted Added
full compact
dict.c (76116) dict.c (77443)
1/*******************************************************************
2** d i c t . c
3** Forth Inspired Command Language - dictionary methods
4** Author: John Sadler (john_sadler@alum.mit.edu)
5** Created: 19 July 1997
6** $Id: dict.c,v 1.6 2000-06-17 07:43:44-07 jsadler Exp jsadler $
7*******************************************************************/
8/*

--- 39 unchanged lines hidden (view full) ---

48** I am interested in hearing from anyone who uses ficl. If you have
49** a problem, a success story, a defect, an enhancement request, or
50** if you would like to contribute to the ficl release, please send
51** contact me by email at the address above.
52**
53** $Id: dict.c,v 1.8 2001-04-26 21:41:45-07 jsadler Exp jsadler $
54*/
55
1/*******************************************************************
2** d i c t . c
3** Forth Inspired Command Language - dictionary methods
4** Author: John Sadler (john_sadler@alum.mit.edu)
5** Created: 19 July 1997
6** $Id: dict.c,v 1.6 2000-06-17 07:43:44-07 jsadler Exp jsadler $
7*******************************************************************/
8/*

--- 39 unchanged lines hidden (view full) ---

48** I am interested in hearing from anyone who uses ficl. If you have
49** a problem, a success story, a defect, an enhancement request, or
50** if you would like to contribute to the ficl release, please send
51** contact me by email at the address above.
52**
53** $Id: dict.c,v 1.8 2001-04-26 21:41:45-07 jsadler Exp jsadler $
54*/
55
56/* $FreeBSD: head/sys/boot/ficl/dict.c 76116 2001-04-29 02:36:36Z dcs $ */
56/* $FreeBSD: head/sys/boot/ficl/dict.c 77443 2001-05-29 23:44:12Z dcs $ */
57
58#ifdef TESTMAIN
59#include <stdio.h>
60#include <stdlib.h>
61#include <ctype.h>
62#else
63#include <stand.h>
64#endif
65#include <string.h>
66#include "ficl.h"
67
68/* Dictionary on-demand resizing control variables */
57
58#ifdef TESTMAIN
59#include <stdio.h>
60#include <stdlib.h>
61#include <ctype.h>
62#else
63#include <stand.h>
64#endif
65#include <string.h>
66#include "ficl.h"
67
68/* Dictionary on-demand resizing control variables */
69unsigned int dictThreshold;
70unsigned int dictIncrease;
69CELL dictThreshold;
70CELL dictIncrease;
71
72
73static char *dictCopyName(FICL_DICT *pDict, STRINGINFO si);
74
75/**************************************************************************
76 d i c t A b o r t D e f i n i t i o n
77** Abort a definition in process: reclaim its memory and unlink it
78** from the dictionary list. Assumes that there is a smudged

--- 690 unchanged lines hidden (view full) ---

769/**************************************************************************
770 d i c t C h e c k T h r e s h o l d
771** Verify if an increase in the dictionary size is warranted, and do it if
772** so.
773**************************************************************************/
774
775void dictCheckThreshold(FICL_DICT* dp)
776{
71
72
73static char *dictCopyName(FICL_DICT *pDict, STRINGINFO si);
74
75/**************************************************************************
76 d i c t A b o r t D e f i n i t i o n
77** Abort a definition in process: reclaim its memory and unlink it
78** from the dictionary list. Assumes that there is a smudged

--- 690 unchanged lines hidden (view full) ---

769/**************************************************************************
770 d i c t C h e c k T h r e s h o l d
771** Verify if an increase in the dictionary size is warranted, and do it if
772** so.
773**************************************************************************/
774
775void dictCheckThreshold(FICL_DICT* dp)
776{
777 if( dictCellsAvail(dp) < dictThreshold ) {
778 dp->dict = ficlMalloc( dictIncrease * sizeof (CELL) );
777 if( dictCellsAvail(dp) < dictThreshold.u ) {
778 dp->dict = ficlMalloc( dictIncrease.u * sizeof (CELL) );
779 assert(dp->dict);
780 dp->here = dp->dict;
779 assert(dp->dict);
780 dp->here = dp->dict;
781 dp->size = dictIncrease;
781 dp->size = dictIncrease.u;
782 dictAlign(dp);
782 }
783}
784
783 }
784}
785