#ifndef __MULTREE_H__ #define __MULTREE_H__ 1 /* elmo - ELectronic Mail Operator Copyright (C) 2002 rzyjontko This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ---------------------------------------------------------------------- This may look strange. This is not a regular tree. */ /***************************************************************************** * INTERFACE REQUIRED HEADERS ****************************************************************************/ /***************************************************************************** * INTERFACE DEFINITIONS / ENUMERATIONS / SIMPLE TYPEDEFS ****************************************************************************/ /**************************************************************************** * INTERFACE CLASS PROTOTYPES / EXTERNAL CLASS REFERENCES ****************************************************************************/ /**************************************************************************** * INTERFACE STRUCTURES / UTILITY CLASSES ****************************************************************************/ typedef struct multree { struct multree **children; unsigned short children_count; unsigned short children_filled; void *data; } multree_t; /**************************************************************************** * INTERFACE DATA DECLARATIONS ****************************************************************************/ /**************************************************************************** * INTERFACE FUNCTION PROTOTYPES ****************************************************************************/ extern multree_t *multree_create (unsigned short children_count); extern void multree_node_destroy (multree_t *node); extern void multree_preorder (multree_t *tree, void (*)(multree_t *)); extern void multree_postorder (multree_t *tree, void (*)(multree_t *)); extern multree_t *multree_add_child (multree_t *parent, multree_t *child); extern multree_t *multree_add_new_child (multree_t *parent, unsigned short children_count); /**************************************************************************** * INTERFACE OBJECT CLASS DEFINITIONS ****************************************************************************/ /**************************************************************************** * INTERFACE TRAILING HEADERS ****************************************************************************/ /**************************************************************************** * * END HEADER multree.h * ****************************************************************************/ #endif