opensrv_plat/messagequeue_api/inc/msgqinternal.h
branchRCL_3
changeset 11 3404599e4dda
parent 9 46cc8e302e43
equal deleted inserted replaced
9:46cc8e302e43 11:3404599e4dda
     1 /** 
       
     2  *  @file MsgQInternal.h
       
     3  *  Description: Internal Header file for MsgQLib
       
     4  *  Copyright (c) 2007 Nokia Corporation.
       
     5 *  All rights reserved.
       
     6 *  Redistribution and use in source and binary forms, with or without modification, 
       
     7 *  are permitted provided that the following conditions are met:
       
     8 *  Redistributions of source code must retain the above copyright notice, this list 
       
     9 *  of conditions and the following disclaimer.Redistributions in binary form must 
       
    10 *  reproduce the above copyright notice, this list of conditions and the following 
       
    11 *  disclaimer in the documentation and/or other materials provided with the distribution.
       
    12 *  Neither the name of the Nokia Corporation nor the names of its contributors may be used 
       
    13 *  to endorse or promote products derived from this software without specific prior written 
       
    14 *  permission.
       
    15 *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
       
    16 *  EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 
       
    17 *  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 
       
    18 *  SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
       
    19 *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 
       
    20 *  OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
       
    21 *  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
       
    22 *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 
       
    23 *  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
       
    24 */
       
    25 
       
    26 #ifndef MSGQINTERNAL_H
       
    27 #define MSGQINTERNAL_H
       
    28 
       
    29 #include <msgqlib.h>
       
    30 #ifdef __cplusplus
       
    31 extern "C" {
       
    32 #endif
       
    33 
       
    34 /* data strucure used for maintaining message queues */
       
    35 
       
    36 typedef struct MsgQInfo* MSGQ_INFO_PTR;
       
    37 
       
    38 typedef struct MsgQInfo {
       
    39 	MSGQ_INFO_PTR	 next;	      /* next entry in list                  */
       
    40 	ULONG			 qName;       /* queue name                          */
       
    41 	int				 qId;		  /* queue id                 			 */
       
    42 	int				 semId ;      /* semaphore id           			 */
       
    43 	ULONG			 sendState;	  /* message can be sent                 */
       
    44 	ULONG			 numMsgs;     /* number of messages queued           */
       
    45 	ULONG			 maxNumMsgs;  /* maximum number of messages queued   */
       
    46 	struct msqid_ds* slMqInfo_p;  /* msg q info                  		 */
       
    47 }MSGQ_INFO;
       
    48 
       
    49 
       
    50 /* Linked List used for maintaining list of all message queues created */
       
    51 
       
    52 typedef struct MsgQInfoList* MSGQ_INFO_LIST_PTR;
       
    53 
       
    54 typedef struct MsgQInfoList {
       
    55 	MSGQ_INFO_LIST_PTR next;     /* next entry in list */
       
    56 	ULONG               qName;   /* queue name         */
       
    57 } MSGQ_INFO_LIST;
       
    58 
       
    59 /* Forward Declaration of Internal Functions */
       
    60 int   InstallMsqQTable(ULONG qName, int qId, int semId, int* err);
       
    61 void  AddToMsgQTable(ULONG qName);
       
    62 int   RemoveFromMsqQTable(ULONG qName, int* err);
       
    63 void  DeleteFromMsgQTable(ULONG qName);
       
    64 MSGQ_INFO* MsgQTableLookup(ULONG qName);
       
    65 
       
    66 #ifdef __cplusplus
       
    67 }
       
    68 #endif
       
    69 #endif /* MSGQINTERNAL_H */