00001 00008 /* 00009 * ============================================================================ 00010 * 00011 * Copyright (c) 2008-2012, Texas Instruments Incorporated 00012 * 00013 * Redistribution and use in source and binary forms, with or without 00014 * modification, are permitted provided that the following conditions 00015 * are met: 00016 * 00017 * * Redistributions of source code must retain the above copyright 00018 * notice, this list of conditions and the following disclaimer. 00019 * 00020 * * Redistributions in binary form must reproduce the above copyright 00021 * notice, this list of conditions and the following disclaimer in the 00022 * documentation and/or other materials provided with the distribution. 00023 * 00024 * * Neither the name of Texas Instruments Incorporated nor the names of 00025 * its contributors may be used to endorse or promote products derived 00026 * from this software without specific prior written permission. 00027 * 00028 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00029 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 00030 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 00031 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 00032 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00033 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 00034 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 00035 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 00036 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 00037 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 00038 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00039 * Contact information for paper mail: 00040 * Texas Instruments 00041 * Post Office Box 655303 00042 * Dallas, Texas 75265 00043 * Contact information: 00044 * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm? 00045 * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact 00046 * ============================================================================ 00047 * 00048 */ 00049 00050 00051 #ifndef ti_syslink_utils_ResTrack__include 00052 #define ti_syslink_utils_ResTrack__include 00053 00054 #include <ti/syslink/osal/OsalTypes.h> 00055 #include <ti/syslink/utils/List.h> 00056 00057 00058 #if defined (__cplusplus) 00059 extern "C" { 00060 #endif 00061 00062 00063 /* ============================================================================= 00064 * Macros and types 00065 * ============================================================================= 00066 */ 00067 00068 #define ResTrack_S_SUCCESS 0 00069 #define ResTrack_E_FAIL (-1) 00070 #define ResTrack_E_MEMORY (-2) 00071 #define ResTrack_E_PID (-3) 00072 #define ResTrack_E_NOTFOUND (-4) 00073 00074 00078 typedef Bool (*ResTrack_Fxn)(Void *ptrA, Void *ptrB); 00079 00083 typedef struct ResTrack_Object *ResTrack_Handle; 00084 00088 typedef struct { 00089 Int temp; 00090 } ResTrack_Params; 00091 00092 00093 /* ============================================================================= 00094 * APIs 00095 * ============================================================================= 00096 */ 00105 Void ResTrack_Params_init(ResTrack_Params *params); 00106 00117 ResTrack_Handle ResTrack_create(ResTrack_Params *params); 00118 00126 Void ResTrack_delete(ResTrack_Handle *handlePtr); 00127 00140 Int ResTrack_pop(ResTrack_Handle handle, Osal_Pid pid, List_Elem **resPtr); 00141 00154 Int ResTrack_push(ResTrack_Handle handle, Osal_Pid pid, List_Elem *res); 00155 00167 Int ResTrack_register(ResTrack_Handle handle, Osal_Pid pid); 00168 00185 Int ResTrack_remove(ResTrack_Handle handle, Osal_Pid pid, List_Elem *ref, 00186 ResTrack_Fxn cmpFxn, List_Elem **resPtr); 00187 00199 Int ResTrack_unregister(ResTrack_Handle handle, Osal_Pid pid); 00200 00201 00202 #if defined (__cplusplus) 00203 } 00204 #endif 00205 00206 #endif /* ti_syslink_utils_ResTrack__include */