ctrump/common/symbol.c File Reference

シンボル定義 More...

#include "ctrump/common/symbol.h"
#include "ctrump/common/mempool.h"
#include <stdlib.h>
#include <string.h>

Include dependency graph for symbol.c:

Go to the source code of this file.

Data Structures

struct  table
 シンボルテーブル More...

Functions

static unsigned int hash (const char *symstr, int symlen)
void ctrump_init_symtab (int initial_size)
void ctrump_destroy_symtab (void)
struct ctrump_symbolctrump_intern (const char *symstr, int symstrlen)
 get symbol
int ctrump_get_current_symbol_num (void)
 get current number of symbols.

Variables

static int symbol_id = 0


Detailed Description

シンボル定義

Definition in file symbol.c.


Function Documentation

void ctrump_destroy_symtab ( void   ) 

Definition at line 81 of file symbol.c.

References ctrump_mempool_destroy().

int ctrump_get_current_symbol_num ( void   ) 

get current number of symbols.

Definition at line 125 of file symbol.c.

References symbol_id.

Referenced by env_Init().

void ctrump_init_symtab ( int  initial_size  ) 

Definition at line 68 of file symbol.c.

References ctrump_mempool_init(), and symbol_id.

Referenced by ctrump_init_all().

struct ctrump_symbol* ctrump_intern ( const char *  symstr,
int  symstrlen 
) [read]

get symbol

Parameters:
symstr charactors (not require zero terminate charactor)
symstrlen length of `symstr'
Returns:
symbol

Definition at line 88 of file symbol.c.

References ctrump_symbol::chain, ctrump_mempool_alloc, ctrump_mempool_alloc_align(), hash(), ctrump_symbol::hashval, ctrump_symbol::id, symbol_id, ctrump_symbol::symlen, and ctrump_symbol::symstr.

Referenced by build_symbol().

static unsigned int hash ( const char *  symstr,
int  symlen 
) [static]

Definition at line 43 of file symbol.c.

Referenced by ctrump_intern().


Variable Documentation

int symbol_id = 0 [static]

Definition at line 65 of file symbol.c.

Referenced by ctrump_get_current_symbol_num(), ctrump_init_symtab(), and ctrump_intern().


Generated on Tue Mar 31 20:19:24 2009 for ctrump by  doxygen 1.5.6