/*
 * Neotonic ClearSilver Templating System
 *
 * This code is made available under the terms of the
 * Neotonic ClearSilver License.
 * http://www.neotonic.com/clearsilver/license.hdf
 *
 * Copyright (C) 2001 by Brandon Long
 */

#ifndef incl_HPHP_ULIST_H_
#define incl_HPHP_ULIST_H_ 1

#include "hphp/neo/neo_err.h"

typedef struct _ulist
{
  int flags;
  void **items;
  int num;
  int max;
} ULIST;

#define ULIST_INTEGER (1<<0)
#define ULIST_FREE (1<<1)
#define ULIST_COPY (1<<2)

NEOERR * uListInit(ULIST **ul, int size, int flags);
int uListLength (ULIST *ul);
NEOERR * uListAppend (ULIST *ul, void *data);
NEOERR * uListGet (ULIST *ul, int x, void **data);
NEOERR * uListSort (ULIST *ul, int (*compareFunc)(const void*, const void*));
NEOERR * uListDestroy (ULIST **ul, int flags);
NEOERR * uListDestroyFunc (ULIST **ul, void (*destroyFunc)(void *));

#endif /* incl_HPHP_ULIST_H_ */
