Server Wait On Clients System - API Documentation v1.7.4
Server Wait On Clients System.
Loading...
Searching...
No Matches
libswocclient.h File Reference

Header file for Server Wait on Clients client-side library. More...

#include <libmgec/mge-portability.h>
Include dependency graph for libswocclient.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int swc_show_status (void)
 Display client's lock status.
 
int swc_show_srv_block_status (void)
 Display status of server blocking.
 
int swc_block (void)
 Set block flag on server to prevent this client from setting any more locks.
 
int swc_unblock (void)
 Remove block flag on server to allow this client to set locks.
 
int swc_set_lock (void)
 Set lock flag on server.
 
int swc_rel_lock (void)
 Release lock flag on server.
 
int swc_client_wait (const char *cnumlocks)
 Wait until only a maximum of cnumlocks for this client remains.
 
int swc_reset (void)
 Reset the client on the server to 0 locks and unblocked.
 
 __attribute__ ((const)) const char *libswocclient_get_pkg_version(void)
 Get the source version.
 
void libswocclient_print_pkg_version (void)
 Print the package version string to stdout.
 
void libswocclient_print_src_version (void)
 Print the source version string to stdout.
 

Variables

BEGIN_C_DECLS char locks_held []
 Holds the number of locks currently held during swc_client_wait().
 

Detailed Description

Header file for Server Wait on Clients client-side library.

Author
Copyright (C) 2016-2019, 2021-2023 Mark Grant

Released under the GPLv3 only.
SPDX-License-Identifier: GPL-3.0-only

Version
v1.1.0 ==== 25/11/2023

Function Documentation

◆ __attribute__()

__attribute__ ( (const)  ) const

Get the source version.

Returns
The source version string.

Get the source version.

Returns
The package version string.
The source version string.

◆ libswocclient_print_pkg_version()

void libswocclient_print_pkg_version ( void  )

Print the package version string to stdout.

◆ libswocclient_print_src_version()

void libswocclient_print_src_version ( void  )

Print the source version string to stdout.

◆ swc_block()

int swc_block ( void  )

Set block flag on server to prevent this client from setting any more locks.

On error mge_errno will be set.

Returns
0 on success, < zero on failure.

◆ swc_client_wait()

int swc_client_wait ( const char *  cnumlocks)

Wait until only a maximum of cnumlocks for this client remains.

If cnumlocks > 0 this realistically means that a previous command in this sequence would have been a lock request. On error mge_errno will be set.

Parameters
cnumlocksWait until the number of locks is <= this value. This value must be 0 or 1.
Returns
0 on success, < zero on failure.

◆ swc_rel_lock()

int swc_rel_lock ( void  )

Release lock flag on server.

On error mge_errno will be set.

Returns
0 on success, < zero on failure.

◆ swc_reset()

int swc_reset ( void  )

Reset the client on the server to 0 locks and unblocked.

On error mge_errno will be set.

Returns
0 on success, < zero on failure.

◆ swc_set_lock()

int swc_set_lock ( void  )

Set lock flag on server.

On error mge_errno will be set.

Returns
0 on success, < zero on failure.

◆ swc_show_srv_block_status()

int swc_show_srv_block_status ( void  )

Display status of server blocking.

On error mge_errno will be set.

Returns
0 on success, < zero on failure.

◆ swc_show_status()

int swc_show_status ( void  )

Display client's lock status.

On error mge_errno will be set.

Returns
0 on success, < zero on failure.

◆ swc_unblock()

int swc_unblock ( void  )

Remove block flag on server to allow this client to set locks.

On error mge_errno will be set.

Returns
0 on success, < zero on failure.

Variable Documentation

◆ locks_held

BEGIN_C_DECLS char locks_held[]
extern

Holds the number of locks currently held during swc_client_wait().

This value can be accessed in a handler if a signal is received.

Holds the number of locks currently held during swc_client_wait().

This value can be accessed in a handler if a signal is received.