Server Wait On Clients System - API Documentation v1.8.3
Server Wait On Clients System.
Loading...
Searching...
No Matches
main.c File Reference

Server Wait On Clients server daemon. More...

#include <errno.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <syslog.h>
#include <unistd.h>
#include <configmake.h>
#include "internal.h"
#include <libmgec/libmgec.h>
#include <libmgec/mge-bstree.h>
#include <libmgec/mge-errno.h>
#include <swoc/cmdlineargs.h>
#include <swoc/signalhandle.h>
Include dependency graph for main.c:

Macros

#define _Bool   signed char
#define bool   _Bool
#define false   0
#define true   1
#define __bool_true_false_are_defined   1

Functions

static void daemonise (void)
static int csscmp (const struct comm_spec *first, const struct comm_spec *last)
int main (int argc, char **argv)
 Program entry point.

Variables

int swsd_err
 swoc daemon error number.
char client [_POSIX_HOST_NAME_MAX]
 Client name.
int debug
 Debug - 0 false, 1 true.
int end
 End pending.
int cursockfd
 Socket file descriptor in use.
struct comm_spec * port_spec
 Port / socket config mappings.
bool srv_blocked
 Server is blocked?
struct bstree * cli_locks
 Clients and locks.
struct bstree * cli_blocked
 Blocked client list.
struct bstree * port_sock
 Port / socket actual mappings.

Detailed Description

Server Wait On Clients server daemon.

Daemon to enable a server to manage client locks and wait on the removal of those locks prior to further server processing.

Author
Copyright (C) 2016-2023, 2025 Mark Grant

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

Version
v1.1.1 ==== 31/03/2025

Macro Definition Documentation

◆ __bool_true_false_are_defined

#define __bool_true_false_are_defined   1

◆ _Bool

#define _Bool   signed char

◆ bool

#define bool   _Bool

◆ false

#define false   0

◆ true

#define true   1

Function Documentation

◆ csscmp()

int csscmp ( const struct comm_spec * first,
const struct comm_spec * last )
static

◆ daemonise()

void daemonise ( void )
static

◆ main()

int main ( int argc,
char ** argv )

Program entry point.

Parameters
argcStandard CLA argc.
argvStandard CLA argv.
Returns
EXIT_SUCCESS on success, EXIT_FAILURE on error.

Variable Documentation

◆ cli_blocked

struct bstree* cli_blocked

Blocked client list.

◆ cli_locks

struct bstree* cli_locks

Clients and locks.

◆ client

char client[_POSIX_HOST_NAME_MAX]

Client name.

◆ cursockfd

int cursockfd

Socket file descriptor in use.

◆ debug

int debug

Debug - 0 false, 1 true.

◆ end

int end

End pending.

◆ port_sock

struct bstree* port_sock

Port / socket actual mappings.

◆ port_spec

struct comm_spec* port_spec

Port / socket config mappings.

◆ srv_blocked

bool srv_blocked

Server is blocked?

◆ swsd_err

int swsd_err

swoc daemon error number.