[Pcsclite-cvs-commit] r4951 - in /trunk/PCSC/src: pcscdaemon.c winscard_clnt.c winscard_msg.c winscard_msg.h winscard_msg_srv.c winscard_svc.c
rousseau at users.alioth.debian.org
rousseau at users.alioth.debian.org
Tue May 18 09:35:14 UTC 2010
Author: rousseau
Date: Tue May 18 09:35:09 2010
New Revision: 4951
URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=4951
Log:
rename SHMfoobar() functions in foobar() since we do not use shared
memory (SHM) anymore
Modified:
trunk/PCSC/src/pcscdaemon.c
trunk/PCSC/src/winscard_clnt.c
trunk/PCSC/src/winscard_msg.c
trunk/PCSC/src/winscard_msg.h
trunk/PCSC/src/winscard_msg_srv.c
trunk/PCSC/src/winscard_svc.c
Modified: trunk/PCSC/src/pcscdaemon.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/pcscdaemon.c?rev=4951&op=diff
==============================================================================
--- trunk/PCSC/src/pcscdaemon.c (original)
+++ trunk/PCSC/src/pcscdaemon.c Tue May 18 09:35:09 2010
@@ -70,7 +70,7 @@
/**
* @brief The Server's Message Queue Listener function.
*
- * An endless loop calls the function \c SHMProcessEventsServer() to check for
+ * An endless loop calls the function \c ProcessEventsServer() to check for
* messages sent by clients.
* If the message is valid, \c CreateContextThread() is called to serve this
* request.
@@ -88,7 +88,7 @@
/*
* Initialize the comm structure
*/
- rsp = SHMInitializeCommonSegment();
+ rsp = InitializeSocket();
if (rsp == -1)
{
@@ -131,7 +131,7 @@
while (TRUE)
{
- switch (rsp = SHMProcessEventsServer(&dwClientID))
+ switch (rsp = ProcessEventsServer(&dwClientID))
{
case 0:
@@ -144,14 +144,14 @@
case 2:
/*
- * timeout in SHMProcessEventsServer(): do nothing
+ * timeout in ProcessEventsServer(): do nothing
* this is used to catch the Ctrl-C signal at some time when
* nothing else happens
*/
break;
case -1:
- Log1(PCSC_LOG_ERROR, "Error in SHMProcessEventsServer");
+ Log1(PCSC_LOG_ERROR, "Error in ProcessEventsServer");
break;
case -2:
@@ -161,7 +161,7 @@
break;
default:
- Log2(PCSC_LOG_ERROR, "SHMProcessEventsServer unknown retval: %d",
+ Log2(PCSC_LOG_ERROR, "ProcessEventsServer unknown retval: %d",
rsp);
break;
}
Modified: trunk/PCSC/src/winscard_clnt.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/winscard_clnt.c?rev=4951&op=diff
==============================================================================
--- trunk/PCSC/src/winscard_clnt.c (original)
+++ trunk/PCSC/src/winscard_clnt.c Tue May 18 09:35:09 2010
@@ -268,7 +268,7 @@
/**
- * creation time of pcscd PCSCLITE_PUBSHM_FILE file
+ * creation time of pcscd PCSCLITE_CSOCK_NAME file
*/
static time_t daemon_ctime = 0;
static pid_t daemon_pid = 0;
@@ -555,7 +555,7 @@
/* Establishes a connection to the server */
- if (SHMClientSetupSession(&dwClientID) != 0)
+ if (ClientSetupSession(&dwClientID) != 0)
{
return SCARD_E_NO_SERVICE;
}
@@ -567,12 +567,12 @@
veStr.minor = PROTOCOL_VERSION_MINOR;
veStr.rv = SCARD_S_SUCCESS;
- if (-1 == SHMMessageSendWithHeader(CMD_VERSION, dwClientID, sizeof(veStr),
+ if (-1 == MessageSendWithHeader(CMD_VERSION, dwClientID, sizeof(veStr),
PCSCLITE_WRITE_TIMEOUT, &veStr))
return SCARD_E_NO_SERVICE;
/* Read a message from the server */
- if (SHMMessageReceive(CMD_VERSION, &veStr, sizeof(veStr), dwClientID,
+ if (MessageReceive(CMD_VERSION, &veStr, sizeof(veStr), dwClientID,
PCSCLITE_READ_TIMEOUT) < 0)
{
Log1(PCSC_LOG_CRITICAL, "Your pcscd is too old and does not support CMD_VERSION");
@@ -594,7 +594,7 @@
scEstablishStruct.hContext = 0;
scEstablishStruct.rv = SCARD_S_SUCCESS;
- rv = SHMMessageSendWithHeader(SCARD_ESTABLISH_CONTEXT, dwClientID,
+ rv = MessageSendWithHeader(SCARD_ESTABLISH_CONTEXT, dwClientID,
sizeof(scEstablishStruct), PCSCLITE_WRITE_TIMEOUT,
(void *) &scEstablishStruct);
@@ -604,7 +604,7 @@
/*
* Read the response from the server
*/
- rv = SHMMessageReceive(SCARD_ESTABLISH_CONTEXT, &scEstablishStruct, sizeof(scEstablishStruct), dwClientID, PCSCLITE_READ_TIMEOUT);
+ rv = MessageReceive(SCARD_ESTABLISH_CONTEXT, &scEstablishStruct, sizeof(scEstablishStruct), dwClientID, PCSCLITE_READ_TIMEOUT);
if (rv < 0)
return SCARD_F_COMM_ERROR;
@@ -683,7 +683,7 @@
scReleaseStruct.hContext = hContext;
scReleaseStruct.rv = SCARD_S_SUCCESS;
- rv = SHMMessageSendWithHeader(SCARD_RELEASE_CONTEXT,
+ rv = MessageSendWithHeader(SCARD_RELEASE_CONTEXT,
currentContextMap->dwClientID,
sizeof(scReleaseStruct),
PCSCLITE_WRITE_TIMEOUT, (void *) &scReleaseStruct);
@@ -697,7 +697,7 @@
/*
* Read a message from the server
*/
- rv = SHMMessageReceive(SCARD_RELEASE_CONTEXT, &scReleaseStruct, sizeof(scReleaseStruct),
+ rv = MessageReceive(SCARD_RELEASE_CONTEXT, &scReleaseStruct, sizeof(scReleaseStruct),
currentContextMap->dwClientID,
PCSCLITE_READ_TIMEOUT);
@@ -861,7 +861,7 @@
scConnectStruct.dwActiveProtocol = 0;
scConnectStruct.rv = SCARD_S_SUCCESS;
- rv = SHMMessageSendWithHeader(SCARD_CONNECT, currentContextMap->dwClientID,
+ rv = MessageSendWithHeader(SCARD_CONNECT, currentContextMap->dwClientID,
sizeof(scConnectStruct),
PCSCLITE_READ_TIMEOUT, (void *) &scConnectStruct);
@@ -874,7 +874,7 @@
/*
* Read a message from the server
*/
- rv = SHMMessageReceive(SCARD_CONNECT, &scConnectStruct, sizeof(scConnectStruct),
+ rv = MessageReceive(SCARD_CONNECT, &scConnectStruct, sizeof(scConnectStruct),
currentContextMap->dwClientID,
PCSCLITE_READ_TIMEOUT);
@@ -1023,7 +1023,7 @@
scReconnectStruct.dwActiveProtocol = *pdwActiveProtocol;
scReconnectStruct.rv = SCARD_S_SUCCESS;
- rv = SHMMessageSendWithHeader(SCARD_RECONNECT,
+ rv = MessageSendWithHeader(SCARD_RECONNECT,
currentContextMap->dwClientID,
sizeof(scReconnectStruct),
PCSCLITE_READ_TIMEOUT, (void *) &scReconnectStruct);
@@ -1037,7 +1037,7 @@
/*
* Read a message from the server
*/
- rv = SHMMessageReceive(SCARD_RECONNECT, &scReconnectStruct,
+ rv = MessageReceive(SCARD_RECONNECT, &scReconnectStruct,
sizeof(scReconnectStruct),
currentContextMap->dwClientID,
PCSCLITE_READ_TIMEOUT);
@@ -1131,7 +1131,7 @@
scDisconnectStruct.dwDisposition = dwDisposition;
scDisconnectStruct.rv = SCARD_S_SUCCESS;
- rv = SHMMessageSendWithHeader(SCARD_DISCONNECT,
+ rv = MessageSendWithHeader(SCARD_DISCONNECT,
currentContextMap->dwClientID,
sizeof(scDisconnectStruct),
PCSCLITE_READ_TIMEOUT, (void *) &scDisconnectStruct);
@@ -1145,7 +1145,7 @@
/*
* Read a message from the server
*/
- rv = SHMMessageReceive(SCARD_DISCONNECT, &scDisconnectStruct,
+ rv = MessageReceive(SCARD_DISCONNECT, &scDisconnectStruct,
sizeof(scDisconnectStruct),
currentContextMap->dwClientID,
PCSCLITE_READ_TIMEOUT);
@@ -1243,7 +1243,7 @@
do
{
- rv = SHMMessageSendWithHeader(SCARD_BEGIN_TRANSACTION,
+ rv = MessageSendWithHeader(SCARD_BEGIN_TRANSACTION,
currentContextMap->dwClientID,
sizeof(scBeginStruct),
PCSCLITE_READ_TIMEOUT, (void *) &scBeginStruct);
@@ -1257,7 +1257,7 @@
/*
* Read a message from the server
*/
- rv = SHMMessageReceive(SCARD_BEGIN_TRANSACTION, &scBeginStruct, sizeof(scBeginStruct),
+ rv = MessageReceive(SCARD_BEGIN_TRANSACTION, &scBeginStruct, sizeof(scBeginStruct),
currentContextMap->dwClientID,
PCSCLITE_READ_TIMEOUT);
@@ -1359,7 +1359,7 @@
scEndStruct.dwDisposition = dwDisposition;
scEndStruct.rv = SCARD_S_SUCCESS;
- rv = SHMMessageSendWithHeader(SCARD_END_TRANSACTION,
+ rv = MessageSendWithHeader(SCARD_END_TRANSACTION,
currentContextMap->dwClientID,
sizeof(scEndStruct),
PCSCLITE_READ_TIMEOUT, (void *) &scEndStruct);
@@ -1373,7 +1373,7 @@
/*
* Read a message from the server
*/
- rv = SHMMessageReceive(SCARD_END_TRANSACTION, &scEndStruct, sizeof(scEndStruct),
+ rv = MessageReceive(SCARD_END_TRANSACTION, &scEndStruct, sizeof(scEndStruct),
currentContextMap->dwClientID,
PCSCLITE_READ_TIMEOUT);
@@ -1436,7 +1436,7 @@
scCancelStruct.hCard = hCard;
- rv = SHMMessageSendWithHeader(SCARD_CANCEL_TRANSACTION,
+ rv = MessageSendWithHeader(SCARD_CANCEL_TRANSACTION,
currentContextMap->dwClientID,
sizeof(scCancelStruct),
PCSCLITE_READ_TIMEOUT, (void *) &scCancelStruct);
@@ -1450,7 +1450,7 @@
/*
* Read a message from the server
*/
- rv = SHMMessageReceive(SCARD_CANCEL_TRANSACTION, &scCancelStruct, sizeof(scCancelStruct),
+ rv = MessageReceive(SCARD_CANCEL_TRANSACTION, &scCancelStruct, sizeof(scCancelStruct),
currentContextMap->dwClientID,
PCSCLITE_READ_TIMEOUT);
@@ -1647,7 +1647,7 @@
scStatusStruct.pcchReaderLen = sizeof(scStatusStruct.mszReaderNames);
scStatusStruct.pcbAtrLen = sizeof(scStatusStruct.pbAtr);
- rv = SHMMessageSendWithHeader(SCARD_STATUS, currentContextMap->dwClientID,
+ rv = MessageSendWithHeader(SCARD_STATUS, currentContextMap->dwClientID,
sizeof(scStatusStruct),
PCSCLITE_READ_TIMEOUT, (void *) &scStatusStruct);
@@ -1660,7 +1660,7 @@
/*
* Read a message from the server
*/
- rv = SHMMessageReceive(SCARD_STATUS, &scStatusStruct, sizeof(scStatusStruct),
+ rv = MessageReceive(SCARD_STATUS, &scStatusStruct, sizeof(scStatusStruct),
currentContextMap->dwClientID,
PCSCLITE_READ_TIMEOUT);
@@ -2224,7 +2224,7 @@
waitStatusStruct.timeOut = dwTime;
waitStatusStruct.rv = SCARD_S_SUCCESS;
- rv = SHMMessageSendWithHeader(CMD_WAIT_READER_STATE_CHANGE,
+ rv = MessageSendWithHeader(CMD_WAIT_READER_STATE_CHANGE,
currentContextMap->dwClientID,
sizeof(waitStatusStruct), PCSCLITE_WRITE_TIMEOUT,
&waitStatusStruct);
@@ -2238,7 +2238,7 @@
/*
* Read a message from the server
*/
- rv = SHMMessageReceive(CMD_WAIT_READER_STATE_CHANGE, &waitStatusStruct, sizeof(waitStatusStruct),
+ rv = MessageReceive(CMD_WAIT_READER_STATE_CHANGE, &waitStatusStruct, sizeof(waitStatusStruct),
currentContextMap->dwClientID,
dwTime);
@@ -2246,7 +2246,7 @@
if (-2 == rv)
{
/* ask server to remove us from the event list */
- rv = SHMMessageSendWithHeader(CMD_STOP_WAITING_READER_STATE_CHANGE,
+ rv = MessageSendWithHeader(CMD_STOP_WAITING_READER_STATE_CHANGE,
currentContextMap->dwClientID,
sizeof(waitStatusStruct), PCSCLITE_WRITE_TIMEOUT,
&waitStatusStruct);
@@ -2258,7 +2258,7 @@
}
/* Read a message from the server */
- rv = SHMMessageReceive(CMD_STOP_WAITING_READER_STATE_CHANGE, &waitStatusStruct, sizeof(waitStatusStruct),
+ rv = MessageReceive(CMD_STOP_WAITING_READER_STATE_CHANGE, &waitStatusStruct, sizeof(waitStatusStruct),
currentContextMap->dwClientID,
PCSCLITE_READ_TIMEOUT);
@@ -2426,7 +2426,7 @@
scControlStruct.cbSendLength = cbSendLength;
scControlStruct.cbRecvLength = cbRecvLength;
- rv = SHMMessageSendWithHeader(SCARD_CONTROL,
+ rv = MessageSendWithHeader(SCARD_CONTROL,
currentContextMap->dwClientID,
sizeof(scControlStruct), PCSCLITE_READ_TIMEOUT, &scControlStruct);
@@ -2437,7 +2437,7 @@
}
/* write the sent buffer */
- rv = SHMMessageSend((char *)pbSendBuffer, cbSendLength,
+ rv = MessageSend((char *)pbSendBuffer, cbSendLength,
currentContextMap->dwClientID, PCSCLITE_WRITE_TIMEOUT);
if (rv == -1)
@@ -2449,7 +2449,7 @@
/*
* Read a message from the server
*/
- rv = SHMMessageReceive(SCARD_CONTROL, &scControlStruct, sizeof(scControlStruct),
+ rv = MessageReceive(SCARD_CONTROL, &scControlStruct, sizeof(scControlStruct),
currentContextMap->dwClientID,
PCSCLITE_READ_TIMEOUT);
@@ -2462,7 +2462,7 @@
if (SCARD_S_SUCCESS == scControlStruct.rv)
{
/* read the received buffer */
- rv = SHMMessageReceive(SCARD_CONTROL, pbRecvBuffer, scControlStruct.dwBytesReturned,
+ rv = MessageReceive(SCARD_CONTROL, pbRecvBuffer, scControlStruct.dwBytesReturned,
currentContextMap->dwClientID,
PCSCLITE_READ_TIMEOUT);
@@ -2728,7 +2728,7 @@
if (SCARD_SET_ATTRIB == command)
memcpy(scGetSetStruct.pbAttr, pbAttr, *pcbAttrLen);
- rv = SHMMessageSendWithHeader(command,
+ rv = MessageSendWithHeader(command,
currentContextMap->dwClientID, sizeof(scGetSetStruct),
PCSCLITE_READ_TIMEOUT, &scGetSetStruct);
@@ -2741,7 +2741,7 @@
/*
* Read a message from the server
*/
- rv = SHMMessageReceive(command, &scGetSetStruct, sizeof(scGetSetStruct),
+ rv = MessageReceive(command, &scGetSetStruct, sizeof(scGetSetStruct),
currentContextMap->dwClientID,
PCSCLITE_READ_TIMEOUT);
@@ -2904,7 +2904,7 @@
scTransmitStruct.ioRecvPciLength = sizeof(SCARD_IO_REQUEST);
}
- rv = SHMMessageSendWithHeader(SCARD_TRANSMIT,
+ rv = MessageSendWithHeader(SCARD_TRANSMIT,
currentContextMap->dwClientID, sizeof(scTransmitStruct),
PCSCLITE_WRITE_TIMEOUT, (void *) &scTransmitStruct);
@@ -2915,7 +2915,7 @@
}
/* write the sent buffer */
- rv = SHMMessageSend((void *)pbSendBuffer, cbSendLength,
+ rv = MessageSend((void *)pbSendBuffer, cbSendLength,
currentContextMap->dwClientID, PCSCLITE_WRITE_TIMEOUT);
if (rv == -1)
@@ -2927,7 +2927,7 @@
/*
* Read a message from the server
*/
- rv = SHMMessageReceive(SCARD_TRANSMIT, &scTransmitStruct, sizeof(scTransmitStruct),
+ rv = MessageReceive(SCARD_TRANSMIT, &scTransmitStruct, sizeof(scTransmitStruct),
currentContextMap->dwClientID,
PCSCLITE_READ_TIMEOUT);
@@ -2940,7 +2940,7 @@
if (SCARD_S_SUCCESS == scTransmitStruct.rv)
{
/* read the received buffer */
- rv = SHMMessageReceive(SCARD_TRANSMIT, pbRecvBuffer, scTransmitStruct.pcbRecvLength,
+ rv = MessageReceive(SCARD_TRANSMIT, pbRecvBuffer, scTransmitStruct.pcbRecvLength,
currentContextMap->dwClientID,
PCSCLITE_READ_TIMEOUT);
@@ -3342,7 +3342,7 @@
return SCARD_E_INVALID_HANDLE;
/* create a new connection to the server */
- if (SHMClientSetupSession(&dwClientID) != 0)
+ if (ClientSetupSession(&dwClientID) != 0)
{
rv = SCARD_E_NO_SERVICE;
goto error;
@@ -3351,7 +3351,7 @@
scCancelStruct.hContext = hContext;
scCancelStruct.rv = SCARD_S_SUCCESS;
- rv = SHMMessageSendWithHeader(SCARD_CANCEL,
+ rv = MessageSendWithHeader(SCARD_CANCEL,
dwClientID,
sizeof(scCancelStruct), PCSCLITE_READ_TIMEOUT, (void *)
&scCancelStruct);
@@ -3365,7 +3365,7 @@
/*
* Read a message from the server
*/
- rv = SHMMessageReceive(SCARD_CANCEL, &scCancelStruct, sizeof(scCancelStruct),
+ rv = MessageReceive(SCARD_CANCEL, &scCancelStruct, sizeof(scCancelStruct),
dwClientID, PCSCLITE_READ_TIMEOUT);
if (rv < 0)
@@ -3376,7 +3376,7 @@
rv = scCancelStruct.rv;
end:
- SHMClientCloseSession(dwClientID);
+ ClientCloseSession(dwClientID);
error:
PROFILE_END(rv)
@@ -3573,7 +3573,7 @@
CHANNEL_MAP * currentChannelMap;
targetContextMap->hContext = 0;
- (void)SHMClientCloseSession(targetContextMap->dwClientID);
+ (void)ClientCloseSession(targetContextMap->dwClientID);
targetContextMap->dwClientID = 0;
(void)pthread_mutex_destroy(targetContextMap->mMutex);
free(targetContextMap->mMutex);
@@ -3817,12 +3817,12 @@
{
int32_t dwClientID = currentContextMap->dwClientID;
- if (-1 == SHMMessageSendWithHeader(CMD_GET_READERS_STATE, dwClientID, 0,
+ if (-1 == MessageSendWithHeader(CMD_GET_READERS_STATE, dwClientID, 0,
PCSCLITE_WRITE_TIMEOUT, NULL))
return SCARD_E_NO_SERVICE;
/* Read a message from the server */
- if (SHMMessageReceive(CMD_GET_READERS_STATE, &readerStates, sizeof(readerStates), dwClientID,
+ if (MessageReceive(CMD_GET_READERS_STATE, &readerStates, sizeof(readerStates), dwClientID,
PCSCLITE_READ_TIMEOUT) < 0)
return SCARD_F_COMM_ERROR;
Modified: trunk/PCSC/src/winscard_msg.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/winscard_msg.c?rev=4951&op=diff
==============================================================================
--- trunk/PCSC/src/winscard_msg.c (original)
+++ trunk/PCSC/src/winscard_msg.c Tue May 18 09:35:09 2010
@@ -58,7 +58,7 @@
* @retval -1 The socket can not open a connection.
* @retval -1 Can not set the socket to non-blocking.
*/
-INTERNAL int SHMClientSetupSession(uint32_t *pdwClientID)
+INTERNAL int ClientSetupSession(uint32_t *pdwClientID)
{
struct sockaddr_un svc_addr;
int one;
@@ -105,7 +105,7 @@
*
* @retval 0 Success.
*/
-INTERNAL int SHMClientCloseSession(uint32_t dwClientID)
+INTERNAL int ClientCloseSession(uint32_t dwClientID)
{
return close(dwClientID);
}
@@ -125,7 +125,7 @@
* @retval -1 Socket is closed.
* @retval -1 A signal was received.
*/
-INTERNAL int32_t SHMMessageSend(void *buffer_void, uint64_t buffer_size,
+INTERNAL int32_t MessageSend(void *buffer_void, uint64_t buffer_size,
int32_t filedes, int32_t timeOut)
{
char *buffer = buffer_void;
@@ -249,7 +249,7 @@
* @retval -1 Socket is closed.
* @retval -1 A signal was received.
*/
-INTERNAL int32_t SHMMessageReceive(uint32_t command, void *buffer_void,
+INTERNAL int32_t MessageReceive(uint32_t command, void *buffer_void,
uint64_t buffer_size, int32_t filedes, int32_t timeOut)
{
char *buffer = buffer_void;
@@ -366,7 +366,7 @@
}
/**
- * @brief Wrapper for the SHMMessageSend() function.
+ * @brief Wrapper for the MessageSend() function.
*
* Called by clients to send messages to the server.
* The parameters \p command and \p data are set in the \c sharedSegmentMsg
@@ -378,9 +378,9 @@
* @param[in] timeOut Timeout to the operation in ms.
* @param[in] data_void Data to be sent.
*
- * @return Same error codes as SHMMessageSend().
- */
-INTERNAL int32_t SHMMessageSendWithHeader(uint32_t command, uint32_t dwClientID,
+ * @return Same error codes as MessageSend().
+ */
+INTERNAL int32_t MessageSendWithHeader(uint32_t command, uint32_t dwClientID,
uint64_t size, uint32_t timeOut, void *data_void)
{
struct rxHeader header;
@@ -389,10 +389,10 @@
/* header */
header.command = command;
header.size = size;
- ret = SHMMessageSend(&header, sizeof(header), dwClientID, timeOut);
+ ret = MessageSend(&header, sizeof(header), dwClientID, timeOut);
/* command */
- ret = SHMMessageSend(data_void, size, dwClientID, timeOut);
+ ret = MessageSend(data_void, size, dwClientID, timeOut);
return ret;
}
@@ -406,7 +406,7 @@
* @param[in] sockValue Socket to be closed.
* @param[in] pcFilePath File used by the socket.
*/
-INTERNAL void SHMCleanupSharedSegment(int sockValue, const char *pcFilePath)
+INTERNAL void CleanupSharedSegment(int sockValue, const char *pcFilePath)
{
(void)close(sockValue);
(void)remove(pcFilePath);
Modified: trunk/PCSC/src/winscard_msg.h
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/winscard_msg.h?rev=4951&op=diff
==============================================================================
--- trunk/PCSC/src/winscard_msg.h (original)
+++ trunk/PCSC/src/winscard_msg.h Tue May 18 09:35:09 2010
@@ -270,17 +270,17 @@
* Now some function definitions
*/
- int32_t SHMClientSetupSession(uint32_t *);
- int32_t SHMClientCloseSession(uint32_t);
- int32_t SHMInitializeCommonSegment(void);
- int32_t SHMProcessEventsServer(/*@out@*/ uint32_t *);
- int32_t SHMMessageSend(void *buffer, uint64_t buffer_size, int32_t filedes,
+ int32_t ClientSetupSession(uint32_t *);
+ int32_t ClientCloseSession(uint32_t);
+ int32_t InitializeSocket(void);
+ int32_t ProcessEventsServer(/*@out@*/ uint32_t *);
+ int32_t MessageSend(void *buffer, uint64_t buffer_size, int32_t filedes,
int32_t blockAmount);
- int32_t SHMMessageReceive(uint32_t command, /*@out@*/ void *buffer,
+ int32_t MessageReceive(uint32_t command, /*@out@*/ void *buffer,
uint64_t buffer_size, int32_t filedes, int32_t blockAmount);
- int32_t SHMMessageSendWithHeader(uint32_t command, uint32_t dwClientID, uint64_t size,
+ int32_t MessageSendWithHeader(uint32_t command, uint32_t dwClientID, uint64_t size,
uint32_t blockAmount, void *data);
- void SHMCleanupSharedSegment(int32_t, const char *);
+ void CleanupSharedSegment(int32_t, const char *);
#ifdef __cplusplus
}
Modified: trunk/PCSC/src/winscard_msg_srv.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/winscard_msg_srv.c?rev=4951&op=diff
==============================================================================
--- trunk/PCSC/src/winscard_msg_srv.c (original)
+++ trunk/PCSC/src/winscard_msg_srv.c Tue May 18 09:35:09 2010
@@ -52,7 +52,7 @@
/**
* @brief Accepts a Client connection.
*
- * Called by \c SHMProcessEventsServer().
+ * Called by \c ProcessEventsServer().
*
* @param[out] pdwClientID Connection ID used to reference the Client.
*
@@ -60,7 +60,7 @@
* @retval 0 Success.
* @retval -1 Can not establish the connection.
*/
-static int SHMProcessCommonChannelRequest(/*@out@*/ uint32_t *pdwClientID)
+static int ProcessCommonChannelRequest(/*@out@*/ uint32_t *pdwClientID)
{
socklen_t clnt_len;
int new_sock;
@@ -95,7 +95,7 @@
* @retval -1 Can not bind the socket to the file \c PCSCLITE_CSOCK_NAME.
* @retval -1 Can not put the socket in listen mode.
*/
-INTERNAL int32_t SHMInitializeCommonSegment(void)
+INTERNAL int32_t InitializeSocket(void)
{
static struct sockaddr_un serv_adr;
@@ -119,7 +119,7 @@
{
Log2(PCSC_LOG_CRITICAL, "Unable to bind common socket: %s",
strerror(errno));
- SHMCleanupSharedSegment(commonSocket, PCSCLITE_CSOCK_NAME);
+ CleanupSharedSegment(commonSocket, PCSCLITE_CSOCK_NAME);
return -1;
}
@@ -127,7 +127,7 @@
{
Log2(PCSC_LOG_CRITICAL, "Unable to listen common socket: %s",
strerror(errno));
- SHMCleanupSharedSegment(commonSocket, PCSCLITE_CSOCK_NAME);
+ CleanupSharedSegment(commonSocket, PCSCLITE_CSOCK_NAME);
return -1;
}
@@ -155,7 +155,7 @@
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
#define DO_TIMEOUT
#endif
-INTERNAL int32_t SHMProcessEventsServer(uint32_t *pdwClientID)
+INTERNAL int32_t ProcessEventsServer(uint32_t *pdwClientID)
{
fd_set read_fd;
int selret;
@@ -202,10 +202,10 @@
if (FD_ISSET(commonSocket, &read_fd))
{
Log1(PCSC_LOG_DEBUG, "Common channel packet arrival");
- if (SHMProcessCommonChannelRequest(pdwClientID) == -1)
+ if (ProcessCommonChannelRequest(pdwClientID) == -1)
{
Log2(PCSC_LOG_ERROR,
- "error in SHMProcessCommonChannelRequest: %d", *pdwClientID);
+ "error in ProcessCommonChannelRequest: %d", *pdwClientID);
return -1;
}
}
@@ -213,7 +213,7 @@
return -1;
Log2(PCSC_LOG_DEBUG,
- "SHMProcessCommonChannelRequest detects: %d", *pdwClientID);
+ "ProcessCommonChannelRequest detects: %d", *pdwClientID);
return 0;
}
Modified: trunk/PCSC/src/winscard_svc.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/winscard_svc.c?rev=4951&op=diff
==============================================================================
--- trunk/PCSC/src/winscard_svc.c (original)
+++ trunk/PCSC/src/winscard_svc.c Tue May 18 09:35:09 2010
@@ -273,14 +273,14 @@
#define READ_BODY(v) \
if (header.size != sizeof(v)) { goto wrong_length; } \
- ret = SHMMessageReceive(header.command, &v, sizeof(v), filedes, PCSCLITE_READ_TIMEOUT); \
+ ret = MessageReceive(header.command, &v, sizeof(v), filedes, PCSCLITE_READ_TIMEOUT); \
if (ret < 0) { Log2(PCSC_LOG_DEBUG, "Client die: %d", filedes); goto exit; }
#define WRITE_BODY(v) \
WRITE_BODY_WITH_COMMAND(CommandsText[header.command], v)
#define WRITE_BODY_WITH_COMMAND(command, v) \
Log4(SCARD_S_SUCCESS == v.rv ? PCSC_LOG_DEBUG : PCSC_LOG_ERROR, "%s rv=0x%X for client %d", command, v.rv, filedes); \
- ret = SHMMessageSend(&v, sizeof(v), filedes, PCSCLITE_WRITE_TIMEOUT);
+ ret = MessageSend(&v, sizeof(v), filedes, PCSCLITE_WRITE_TIMEOUT);
static void ContextThread(LPVOID newContext)
{
@@ -293,7 +293,7 @@
while (1)
{
struct rxHeader header;
- int32_t ret = SHMMessageReceive(0, &header, sizeof(header), filedes, PCSCLITE_READ_TIMEOUT);
+ int32_t ret = MessageReceive(0, &header, sizeof(header), filedes, PCSCLITE_READ_TIMEOUT);
if (ret < 0)
{
@@ -353,7 +353,7 @@
/* nothing to read */
/* dump the readers state */
- ret = SHMMessageSend(readerStates, sizeof(readerStates), filedes, PCSCLITE_WRITE_TIMEOUT);
+ ret = MessageSend(readerStates, sizeof(readerStates), filedes, PCSCLITE_WRITE_TIMEOUT);
}
break;
@@ -619,7 +619,7 @@
goto exit;
/* read sent buffer */
- ret = SHMMessageReceive(SCARD_TRANSMIT, pbSendBuffer, trStr.cbSendLength,
+ ret = MessageReceive(SCARD_TRANSMIT, pbSendBuffer, trStr.cbSendLength,
filedes, PCSCLITE_READ_TIMEOUT);
if (ret < 0)
{
@@ -647,7 +647,7 @@
/* write received buffer */
if (SCARD_S_SUCCESS == trStr.rv)
- ret = SHMMessageSend(pbRecvBuffer, cbRecvLength,
+ ret = MessageSend(pbRecvBuffer, cbRecvLength,
filedes, PCSCLITE_WRITE_TIMEOUT);
}
break;
@@ -672,7 +672,7 @@
}
/* read sent buffer */
- ret = SHMMessageReceive(SCARD_CONTROL, pbSendBuffer, ctStr.cbSendLength,
+ ret = MessageReceive(SCARD_CONTROL, pbSendBuffer, ctStr.cbSendLength,
filedes, PCSCLITE_READ_TIMEOUT);
if (ret < 0)
{
@@ -693,7 +693,7 @@
/* write received buffer */
if (SCARD_S_SUCCESS == ctStr.rv)
- ret = SHMMessageSend(pbRecvBuffer, dwBytesReturned,
+ ret = MessageSend(pbRecvBuffer, dwBytesReturned,
filedes, PCSCLITE_WRITE_TIMEOUT);
}
break;
@@ -748,7 +748,7 @@
goto exit;
}
- /* SHMMessageSend() failed */
+ /* MessageSend() failed */
if (-1 == ret)
{
/* Clean up the dead client */
More information about the Pcsclite-cvs-commit
mailing list