Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Friday, March 29, 2024

File: [Platon] / libco / libco / co_super.h (download)

Revision 1.3, Sun Mar 30 10:27:17 2003 UTC (21 years ago) by yenar


Changes since 1.2: +2 -3 lines

adapt to object system changes (flavours, data pointer) [co_super.h, co_tab.c, co_tab.h, co_vector.c, co_vector.h]

/***{{{*******************************************************************
 * This file is part of libco - object library for C                     *
 * Copyright (c) 2002                                                    *
 *     Peter Rockai (yenar) <yenar@host.sk>                              *
 *                                                                       *
 * This library is free software; you can redistribute it and/or         *
 * modify it under the terms of the GNU Lesser General Public            *
 * License as published by the Free Software Foundation; either          *
 * version 2 of the License, or (at your option) any later version.      *
 *                                                                       *
 * This library 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     *
 * Lesser General Public License for more details.                       *
 *                                                                       *
 * You should have received a copy of the GNU Lesser General Public      *
 * License along with this library; if not, write to the Free Software   *
 * Foundation, Inc., 59 Temple Place, Suite 330,                         *
 * Boston, MA 02111-1307  USA                                            *
 *******************************************************************}}}***/
/* {{{ file description */
/**
 * @file co_super.h
 * @brief Program super-object (each program has 1 instance).
 **/
/* }}} */

#ifndef __CO_SUPER_H__
#define __CO_SUPER_H__

#include "co_object.h"

/* {{{ */
struct co_id_head
{
    int id;
    const char *name;
};
CO_TYPEDEF (co_id_head);
/* }}} */
/* {{{ */
struct co_id_array
{
    int n;
    int size;
    int memb_sz;
    co_id_head master; // index-sorted (fixed order)
    co_id_head *shadow; // name-sorted for bsearch
};
CO_TYPEDEF (co_id_array);
/* }}} */

/* {{{ */
struct co_id_type
{
    co_id_head_s _head;
    void *construct;
    void *tab_meth;
    void *tab_prop;
};
/* }}} */

/* {{{ */
CO_OBJECT (co_super, default)
{
    co_id_array id_type;
    co_id_array id_msg;
    co_id_array id_prop;
    co_id_array id_exception;
    co_id_array id_event;
    //co_id_array type;
    //co_msg_rec *msgs;
};
/* }}} */

co co_super_new (void);

void *co_id_find (const co_id_array, const char *name);
int co_id_init (const co_id_array, const char *name);

#endif /* __CO_SUPER_H__ */

Platon Group <platon@platon.org> http://platon.org/
Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top