aboutsummaryrefslogtreecommitdiff
path: root/nx-X11
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2019-10-23 00:18:27 +0200
committerUlrich Sibiller <uli42@gmx.de>2020-01-05 22:37:36 +0100
commit19ba07472fa7833d072b78c39200876517c5194f (patch)
tree12fb92f221733dfae035288303bb1b7caa00b1c6 /nx-X11
parent9b1e29937c39c23a9db6bc1c3661cb2cf2e50671 (diff)
downloadnx-libs-19ba07472fa7833d072b78c39200876517c5194f.tar.gz
nx-libs-19ba07472fa7833d072b78c39200876517c5194f.tar.bz2
nx-libs-19ba07472fa7833d072b78c39200876517c5194f.zip
Handlers.c: reformat comments
Diffstat (limited to 'nx-X11')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Handlers.c187
1 files changed, 76 insertions, 111 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c
index 7311889b7..2c0ee731a 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c
@@ -57,47 +57,42 @@
#undef DUMP
/*
- * Log begin and end of the important
- * handlers.
+ * Log begin and end of the important handlers.
*/
#undef BLOCKS
/*
- * If not defined, flush immediately
- * upon entering the block handler.
+ * If not defined, flush immediately upon entering the block handler.
*/
#define FLUSH_AFTER_MULTIPLE_READS
/*
- * The soft limit should roughly match
- * the size of the Xlib I/O buffer.
+ * The soft limit should roughly match the size of the Xlib I/O
+ * buffer.
*/
#define BYTES_BEFORE_SOFT_TOKEN 2048
#define BYTES_BEFORE_HARD_TOKEN 65536
/*
- * Maximum number of synchronization
- * requests before waiting for the
+ * Maximum number of synchronization requests before waiting for the
* remote.
*/
#define TOKENS_PENDING_LIMIT 8
/*
- * Limits are very unobtrusive. We don't
- * want to interfere with the normal
- * dispatching.
+ * Limits are very unobtrusive. We don't want to interfere with the
+ * normal dispatching.
*/
#define BYTES_BEFORE_YIELD 1048576
#define TIME_BEFORE_YIELD 500
/*
- * Dynamically reduce the display buffer
- * size after a congestion.
+ * Dynamically reduce the display buffer size after a congestion.
*/
#undef DYNAMIC_DISPLAY_BUFFER
@@ -116,16 +111,14 @@ extern void nxagentDumpInputDevicesState(void);
#endif
/*
- * Used in the handling of the X desktop
- * manager protocol.
+ * Used in the handling of the X desktop manager protocol.
*/
int nxagentXdmcpUp = 0;
int nxagentXdmcpAlertUp = 0;
/*
- * Also used in the block, wakeup and
- * sync handlers.
+ * Also used in the block, wakeup and sync handlers.
*/
int nxagentBuffer;
@@ -136,30 +129,28 @@ double nxagentBytesIn;
double nxagentBytesOut;
/*
- * Total number of descriptors ready
- * as reported by the wakeup handler.
+ * Total number of descriptors ready as reported by the wakeup
+ * handler.
*/
int nxagentReady;
/*
- * Timestamp of the last write to the
- * remote display.
+ * Timestamp of the last write to the remote display.
*/
int nxagentFlush;
/*
- * Arbitrate the bandwidth among our
- * clients.
+ * Arbitrate the bandwidth among our clients.
*/
struct _TokensRec nxagentTokens = { 0, 0, 0 };
struct _DispatchRec nxagentDispatch = { UNDEFINED, 0, 0, 0 };
/*
- * Called just before blocking, waiting
- * for our clients or the X server.
+ * Called just before blocking, waiting for our clients or the X
+ * server.
*/
extern int nxagentSkipImage;
@@ -179,15 +170,13 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask)
static int now;
/*
- * Pending bytes to write to the
- * network.
+ * Pending bytes to write to the network.
*/
static int flushable;
/*
- * Set if we need to synchronize
- * any drawable.
+ * Set if we need to synchronize any drawable.
*/
static int synchronize;
@@ -242,8 +231,8 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask)
#endif
/*
- * Slow down the agent if the session is
- * not connected to a valid display.
+ * Slow down the agent if the session is not connected to a valid
+ * display.
*/
if (NXDisplayError(nxagentDisplay) == 1 && nxagentShadowCounter == 0 && nxagentOption(SleepTime) > 0)
@@ -263,8 +252,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask)
#endif
/*
- * Update the shadow display. This is
- * only for test purposes.
+ * Update the shadow display. This is only for test purposes.
*/
#ifdef DUMP
@@ -276,17 +264,14 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask)
#endif
/*
- * We need this here because some window
- * configuration changes can be generated
- * by the X server outside the control of
- * the DIX.
+ * We need this here because some window configuration changes can
+ * be generated by the X server outside the control of the DIX.
*/
nxagentFlushConfigureWindow();
/*
- * Check whether there is any drawable to
- * synchronize.
+ * Check whether there is any drawable to synchronize.
*/
#ifdef TEST
@@ -300,8 +285,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask)
nxagentCorruptedPixmaps > 0);
/*
- * The synchronization function requires a mask as
- * parameter:
+ * The synchronization function requires a mask as parameter:
*
* EVENT_BREAK Breaks if an user input, like
* a key press or a mouse move,
@@ -324,9 +308,8 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask)
if (synchronize == 1)
{
/*
- * We should not enter the synchronization
- * loop if there is any user input pending,
- * i.e. if we are in the middle of a scroll
+ * We should not enter the synchronization loop if there is any
+ * user input pending, i.e. if we are in the middle of a scroll
* operation.
*/
@@ -361,9 +344,8 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask)
#endif
/*
- * Check if we have more corrupted resources
- * and whether the conditions are satisfied
- * to continue with the synchronization.
+ * Check if we have more corrupted resources and whether the
+ * conditions are satisfied to continue with the synchronization.
*/
synchronize = (nxagentCongestion <= 4 &&
@@ -405,9 +387,9 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask)
}
/*
- * If the remote X server is blocking, reduce the
- * amount of data sent in a single display update
- * by reducing the size of the display buffer.
+ * If the remote X server is blocking, reduce the amount of data
+ * sent in a single display update by reducing the size of the
+ * display buffer.
*/
#ifdef DYNAMIC_DISPLAY_BUFFER
@@ -445,8 +427,8 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask)
#endif /* #ifdef DYNAMIC_DISPLAY_BUFFER */
/*
- * Dispatch to the clients the events that
- * may have become available.
+ * Dispatch to the clients the events that may have become
+ * available.
*/
if (nxagentPendingEvents(nxagentDisplay) > 0)
@@ -459,9 +441,8 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask)
}
/*
- * Check if there is any data remaining,
- * either in the display buffer or in
- * the NX transport.
+ * Check if there is any data remaining, either in the display
+ * buffer or in the NX transport.
*/
flushable = NXDisplayFlushable(nxagentDisplay);
@@ -471,9 +452,8 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask)
#ifdef FLUSH_AFTER_MULTIPLE_READS
/*
- * Flush all the outstanding data if
- * the wakeup handler didn't detect
- * any activity.
+ * Flush all the outstanding data if the wakeup handler didn't
+ * detect any activity.
*/
if (nxagentReady == 0 || now - nxagentFlush >=
@@ -487,8 +467,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask)
NXFlushDisplay(nxagentDisplay, NXFlushLink);
/*
- * New events may have become available
- * after the flush.
+ * New events may have become available after the flush.
*/
if (nxagentPendingEvents(nxagentDisplay) > 0)
@@ -516,9 +495,8 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask)
#else /* #ifdef FLUSH_AFTER_MULTIPLE_READS */
/*
- * We are entering the select. Tell the NX
- * transport to write any produced data to
- * the remote end.
+ * We are entering the select. Tell the NX transport to write any
+ * produced data to the remote end.
*/
NXFlushDisplay(nxagentDisplay, NXFlushLink);
@@ -556,12 +534,11 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask)
}
/*
- * WaitForSomething() sets a zero timeout if there
- * are clients with input, but doesn't stop the
- * timer. The select is then interrupted to update
- * the schedule time even if, what the dispatcher
- * cares, is only the number of ticks at the time
- * the client is scheduled in.
+ * WaitForSomething() sets a zero timeout if there are clients with
+ * input, but doesn't stop the timer. The select is then interrupted
+ * to update the schedule time even if, what the dispatcher cares,
+ * is only the number of ticks at the time the client is scheduled
+ * in.
*/
#ifdef DEBUG
@@ -641,8 +618,7 @@ void nxagentWakeupHandler(void * data, int count, void * mask)
else if (nxagentQueuedEvents(nxagentDisplay) == 1)
{
/*
- * We may have left some events in
- * the queue.
+ * We may have left some events in the queue.
*/
#ifdef TEST
@@ -674,9 +650,8 @@ void nxagentWakeupHandler(void * data, int count, void * mask)
#endif
/*
- * If the XDM connection can't be established
- * we'll need to create a dialog to notify the
- * user and give him/her a chance to terminate
+ * If the XDM connection can't be established we'll need to create a
+ * dialog to notify the user and give him/her a chance to terminate
* the session.
*/
@@ -813,14 +788,12 @@ void nxagentShadowBlockHandler(void * data, struct timeval **timeout, void * mas
}
/*
- * We are entering the select. Tell the NX
- * transport to write any produced data to
- * the remote end.
+ * We are entering the select. Tell the NX transport to write any
+ * produced data to the remote end.
*/
/*
-FIXME: Must queue multiple writes and handle
- the events by resembling the ordinary
- block handler.
+FIXME: Must queue multiple writes and handle the events by resembling
+ the ordinary block handler.
*/
NXFlushDisplay(nxagentDisplay, NXFlushLink);
@@ -929,8 +902,7 @@ void nxagentShadowWakeupHandler(void * data, int count, void * mask)
else if (nxagentQueuedEvents(nxagentDisplay) == 1)
{
/*
- * We may have left some events in
- * the queue.
+ * We may have left some events in the queue.
*/
#ifdef TEST
@@ -1022,13 +994,11 @@ Bool nxagentCollectInputFocusPredicate(Display *display, XEvent *X, XPointer ptr
void nxagentDispatchHandler(ClientPtr client, int in, int out)
{
/*
- * This function is called by the dispatcher (with 0
- * bytes out) after a new request has been processed.
- * It is also called by the write handler (with 0
- * bytes in) after more data has been written to the
- * display. It may be optionally called in the block
- * and wakeup handlers. In this case both in and out
- * must be 0.
+ * This function is called by the dispatcher (with 0 bytes out)
+ * after a new request has been processed. It is also called by the
+ * write handler (with 0 bytes in) after more data has been written
+ * to the display. It may be optionally called in the block and
+ * wakeup handlers. In this case both in and out must be 0.
*/
if (out > 0)
@@ -1050,14 +1020,12 @@ void nxagentDispatchHandler(ClientPtr client, int in, int out)
#endif
/*
- * Don't take care of the synchronization if
- * the NX transport is running. The NX trans-
- * port has its own token-based control flow.
+ * Don't take care of the synchronization if the NX transport is
+ * running. The NX transport has its own token-based control flow.
*
- * We can't produce more output here because
- * we are in the middle of the flush. We will
- * take care of the sync requests when called
- * by the dispatcher.
+ * We can't produce more output here because we are in the middle
+ * of the flush. We will take care of the sync requests when
+ * called by the dispatcher.
*/
if (nxagentOption(LinkType) == LINK_TYPE_NONE)
@@ -1079,8 +1047,8 @@ void nxagentDispatchHandler(ClientPtr client, int in, int out)
{
/*
- * Pay attention to the next client if this
- * client produced enough output.
+ * Pay attention to the next client if this client produced
+ * enough output.
*/
if (nxagentBytesOut - nxagentDispatch.out > BYTES_BEFORE_YIELD)
@@ -1142,12 +1110,11 @@ void nxagentDispatchHandler(ClientPtr client, int in, int out)
#endif
/*
- * When using the dumb scheduler, before reading from
- * another client, the dispatcher tries to drain all
- * the input from the client being processed. This
- * means that, if isItTimeToYield is never set and the
- * client never produces any output, we'll stick into
- * the inner dispatch loop forever.
+ * When using the dumb scheduler, before reading from another
+ * client, the dispatcher tries to drain all the input from the
+ * client being processed. This means that, if isItTimeToYield is
+ * never set and the client never produces any output, we'll stick
+ * into the inner dispatch loop forever.
*/
if (!SmartScheduleSignalEnable)
@@ -1228,10 +1195,9 @@ void nxagentDispatchHandler(ClientPtr client, int in, int out)
else if (nxagentTokens.soft > BYTES_BEFORE_SOFT_TOKEN)
{
/*
- * Alternatively, the amounts of bytes
- * accounted for each sync request may
- * be decreased according to the number
- * of pending replies already awaited.
+ * Alternatively, the amounts of bytes accounted for each sync
+ * request may be decreased according to the number of pending
+ * replies already awaited.
*
* else if (nxagentTokens.soft > (BYTES_BEFORE_SOFT_TOKEN / (nxagentTokens.pending + 1)))
*/
@@ -1239,9 +1205,8 @@ void nxagentDispatchHandler(ClientPtr client, int in, int out)
int resource;
/*
- * Wait eventually for the number of
- * synchronization requests to return
- * below the limit.
+ * Wait eventually for the number of synchronization requests to
+ * return below the limit.
*/
#ifdef TEST