Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Functions
ipcLockProtocol.h File Reference
#include "prtypes.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ipcLockMsg

Defines

#define IPC_LOCK_OP_ACQUIRE   1
#define IPC_LOCK_OP_RELEASE   2
#define IPC_LOCK_OP_STATUS_ACQUIRED   3
#define IPC_LOCK_OP_STATUS_FAILED   4
#define IPC_LOCK_OP_STATUS_BUSY   5
#define IPC_LOCK_FL_NONBLOCKING   1
#define IPC_LOCK_TARGETID

Functions

PRUint8IPC_FlattenLockMsg (const ipcLockMsg *msg, PRUint32 *bufLen)
void IPC_UnflattenLockMsg (const PRUint8 *buf, PRUint32 bufLen, ipcLockMsg *msg)

Class Documentation

struct ipcLockMsg

Definition at line 66 of file ipcLockProtocol.h.

Class Members
PRUint8 flags
const char * key
PRUint8 opcode

Define Documentation

Definition at line 63 of file ipcLockProtocol.h.

Definition at line 56 of file ipcLockProtocol.h.

Definition at line 57 of file ipcLockProtocol.h.

Definition at line 58 of file ipcLockProtocol.h.

Definition at line 60 of file ipcLockProtocol.h.

Definition at line 59 of file ipcLockProtocol.h.

Value:
{ /* 703ada8a-2d38-4d5d-9d39-03d1ccceb567 */         \
    0x703ada8a,                                      \
    0x2d38,                                          \
    0x4d5d,                                          \
    {0x9d, 0x39, 0x03, 0xd1, 0xcc, 0xce, 0xb5, 0x67} \
}

Definition at line 90 of file ipcLockProtocol.h.


Function Documentation

PRUint8* IPC_FlattenLockMsg ( const ipcLockMsg msg,
PRUint32 bufLen 
)

Definition at line 63 of file ipcLockProtocol.cpp.

{
    PRUint32 len = 1                 // header byte
                 + strlen(msg->key)  // key
                 + 1;                // null terminator

    PRUint8 *buf = (PRUint8 *) ::operator new(len);
    if (!buf)
        return NULL;

    buf[0] = (msg->opcode | (msg->flags << 4));

    memcpy(&buf[1], msg->key, len - 1);
    *bufLen = len;
    return buf;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void IPC_UnflattenLockMsg ( const PRUint8 buf,
PRUint32  bufLen,
ipcLockMsg msg 
)

Definition at line 81 of file ipcLockProtocol.cpp.

{
    PR_ASSERT(bufLen > 2); // malformed buffer otherwise
    msg->opcode = get_opcode(buf);
    msg->flags = get_flags(buf);
    msg->key = get_key(buf);
}

Here is the call graph for this function:

Here is the caller graph for this function: