media/webrtc/signaling/src/sipcc/core/common/resource_manager.h
author Phil Ringnalda <philringnalda@gmail.com>
Mon, 08 Dec 2014 20:53:07 -0800
changeset 218811 960303b07c909e69db87467d0b499351d65c82af
permissions -rw-r--r--
Backed out 10 changesets (bug 1091242) for Android/b2g non-unified build bustage CLOSED TREE Backed out changeset 7f72b55c5de7 (bug 1091242) Backed out changeset f1501aa24397 (bug 1091242) Backed out changeset 7fde5994aee5 (bug 1091242) Backed out changeset 59b415714087 (bug 1091242) Backed out changeset dadb65fedc08 (bug 1091242) Backed out changeset 21be81424e4e (bug 1091242) Backed out changeset 498fb1dafba5 (bug 1091242) Backed out changeset 8d0653eb85ab (bug 1091242) Backed out changeset c82d484e135a (bug 1091242) Backed out changeset 3e0c8932f1b1 (bug 1091242)

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef _RM_MGR_H__
#define _RM_MGR_H__

typedef struct resource_manager {
    int16_t  max_element;
    int16_t  max_index;
    uint32_t *table;
} resource_manager_t;

void               rm_clear_all_elements(resource_manager_t *rm);
void               rm_clear_element(resource_manager_t *rm, int16_t element);
void               rm_set_element(resource_manager_t *rm, int16_t element);
boolean            rm_is_element_set(resource_manager_t *rm, int16_t element);
int16_t            rm_get_free_element(resource_manager_t *rm);
void               rm_show(resource_manager_t *rm);
resource_manager_t *rm_create(int16_t max_element);
void               rm_destroy(resource_manager_t *rm);

#endif