milk  1.01
Modular Image processing Library toolKit
streamCTRL.c File Reference

Data streams control panel. More...

#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/file.h>
#include <malloc.h>
#include <sys/mman.h>
#include <time.h>
#include <signal.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <ncurses.h>
#include <fcntl.h>
#include <ctype.h>
#include <dirent.h>
#include <wchar.h>
#include <locale.h>
#include <errno.h>
#include <pthread.h>
#include "CommandLineInterface/timeutils.h"
#include "CLIcore.h"
#include "COREMOD_tools/COREMOD_tools.h"
#include "COREMOD_memory/COREMOD_memory.h"
#include "streamCTRL.h"
Include dependency graph for streamCTRL.c:

Data Structures

struct  streamCTRLarg_struct
 

Macros

#define _GNU_SOURCE
 
#define STREAMCTRL_LOGDEBUG   1
 
#define SHAREDSHMDIR   data.shmdir
 
#define STRINGLENMAX   32
 
#define streamOpenNBpid_MAX   100
 
#define nameNBchar   100
 
#define PIDnameStringLen   12
 
#define DISPLAY_MODE_HELP   1
 
#define DISPLAY_MODE_SEMVAL   2
 
#define DISPLAY_MODE_WRITE   3
 
#define DISPLAY_MODE_READ   4
 
#define DISPLAY_MODE_SPTRACE   5
 
#define DISPLAY_MODE_FUSER   6
 
#define PRINT_PID_DEFAULT   0
 
#define PRINT_PID_FORCE_NOUPSTREAM   1
 
#define NO_DOWNSTREAM_INDEX   100
 

Typedefs

typedef int errno_t
 

Functions

static int initncurses ()
 
static errno_t streamCTRL__print_header (const char *str, char c)
 
imageID image_ID_from_images (IMAGE *images, const char *restrict name)
 
imageID image_get_first_ID_available_from_images (IMAGE *images)
 
int get_process_name_by_pid (const int pid, char *pname)
 
int streamCTRL_CatchSignals ()
 
static int get_PIDmax ()
 
int find_streams (STREAMINFO *streaminfo, int filter, const char *namefilter)
 find shared memory streams on system More...
 
void * streamCTRL_scan (void *argptr)
 
static int streamCTRL_print_inode (ino_t inode, ino_t *upstreaminode, int NBupstreaminode, int downstreamindex)
 
static int streamCTRL_print_procpid (pid_t procpid, pid_t *upstreamproc, int NBupstreamproc, uint32_t mode)
 print PID with highlighting More...
 
static errno_t streamCTRL_print_SPTRACE_details (IMAGE *streamCTRLimages, imageID ID, pid_t *upstreamproc, int NBupstreamproc, uint32_t print_pid_mode)
 
errno_t streamCTRL_CTRLscreen ()
 

Variables

static int wrow
 
static int wcol
 

Detailed Description

Data streams control panel.

Manages data streams

Macro Definition Documentation

◆ SHAREDSHMDIR

#define SHAREDSHMDIR   data.shmdir

default location of file mapped semaphores, can be over-ridden by env variable MILK_SHM_DIR

Function Documentation

◆ find_streams()

int find_streams ( STREAMINFO streaminfo,
int  filter,
const char *  namefilter 
)

find shared memory streams on system

If filter is set to 1, require stream name to contain namefilter string streaminfo needs to be pre-allocated

◆ get_process_name_by_pid()

int get_process_name_by_pid ( const int  pid,
char *  pname 
)

INITIALIZE ncurses

◆ initncurses()

static int initncurses ( )
static

INITIALIZE ncurses

◆ streamCTRL_CTRLscreen()

errno_t streamCTRL_CTRLscreen ( )

Purpose

Control screen for stream structures

Description

Relies on ncurses for display

◆ streamCTRL_print_procpid()

static int streamCTRL_print_procpid ( pid_t  procpid,
pid_t *  upstreamproc,
int  NBupstreamproc,
uint32_t  mode 
)
static

print PID with highlighting