Server Wait On Clients System - API Documentation  v1.6.4
Server Wait On Clients System.
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. More...
 
int swc_show_srv_block_status (void)
 Display status of server blocking. More...
 
int swc_block (void)
 Set block flag on server to prevent this client from setting any more locks. More...
 
int swc_unblock (void)
 Remove block flag on server to allow this client to set locks. More...
 
int swc_set_lock (void)
 Set lock flag on server. More...
 
int swc_rel_lock (void)
 Release lock flag on server. More...
 
int swc_client_wait (char *cnumlocks)
 Wait until only a maximum of cnumlocks for this client remains. More...
 
int swc_reset (void)
 Reset the client on the server to 0 locks and unblocked. More...
 
char * libswocclient_get_pkg_version (void)
 Get the git-describe based package version. More...
 
char * libswocclient_get_src_version (void)
 Get the source version. More...
 
void libswocclient_print_pkg_version (void)
 Print the package version string to stdout. More...
 
void libswocclient_print_src_version (void)
 Print the source version string to stdout. More...
 

Variables

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

Detailed Description

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

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

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

Version
v1.0.14 ==== 17/09/2022

Function Documentation

◆ libswocclient_get_pkg_version()

char* libswocclient_get_pkg_version ( void  )

Get the git-describe based package version.

Returns
The package version string.

◆ libswocclient_get_src_version()

char* libswocclient_get_src_version ( void  )

Get the source version.

Returns
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 ( 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.