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_vector.h (download)

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


Changes since 1.3: +6 -8 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_vector.h
 * @brief Vector object implementation.
 **/
/* }}} */

#ifndef __CO_VECTOR_H__
#define __CO_VECTOR_H__

#include "co_object.h"

#define CO_VECTOR_AUTODEL 0x1

struct co_vector_data;
/* {{{ */
CO_OBJECT (co_vector, default)
    /// Implementation of a dynamic-sized vector (array).
{
    CO_ATTR (int, items);
    CO_ATTR (int, size);
    struct co_vector_data *data;
    void *sortval_arg;
    CO_ATTR (int, flags);
};
/* }}} */
/* {{{ */
struct co_vector_data
    /// Data cell of a vector (internal).
    /** @internal */
{
    co_v_t sortval;
    co o;
};
CO_TYPEDEF (co_vector_data);
/* }}} */

/* {{{ */
CO_OBJECT (co_vector_item, small)
    /// Generic vector item - for primitive types (uses co_v).
{
    CO_ATTR (co_type, t);
    CO_ATTR (co_v, v);
};
/* }}} */

//co_vector co_vector_new (void);
//co_vector_item co_vector_item_new (co_type t, ...);

typedef int (*co_vector_filter_f) (co_vector_data d, void *user);
int co_vector_filter_str (co_vector_data d, void *str);

#endif /* __CO_VECTOR_H__ */

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