ARPDAS_QNX6 1.0
Classes | Defines | Functions | Variables
nlphcmd.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <semaphore.h>
#include <pthread.h>
#include <errno.h>
#include <ctype.h>
#include <Pt.h>
#include "nortlib.h"
#include "tablelib.h"
#include "nlphcmd.h"
#include "tm.h"
Include dependency graph for nlphcmd.c:

Go to the source code of this file.

Classes

struct  queue_t

Defines

#define QUEUE_LENGTH   10
#define LABEL_HEIGHT   25
#define LABEL_FULL_HEIGHT   (LABEL_HEIGHT+4)
#define LABEL_SPACE   6
#define LABEL_WIDTH   780
#define LABEL_FULL_WIDTH   (LABEL_WIDTH+4)
#define WINDOW_HEIGHT   (2*LABEL_FULL_HEIGHT + 3*LABEL_SPACE + 1)
#define WINDOW_WIDTH   (LABEL_FULL_WIDTH + 2*LABEL_SPACE)
#define LOGO_WIDTH   20

Functions

static int my_key_event (PtWidget_t *widget, void *apinfo, PtCallbackInfo_t *cbinfo)
static PtWidget_t * new_cmd_window (char *title, int width, int height)
static PtWidget_t * new_text_widget (PtWidget_t *window, char *text, int x, int y, char *font, PgColor_t color, int align)
static int cic_cmd_quit_func (int fd, void *data, unsigned mode)
void nlph_cmdclt_init (void *(*cmd_thread)(void *))
static void enqueue_char (int c)
int nlph_getch (void)
void nlph_update_cmdtext (const char *cmdtext, const char *prompttext)

Variables

static sem_t char_sem
static pthread_mutex_t queue_mutex = PTHREAD_MUTEX_INITIALIZER
static queue_t queue
static int cmd_quit_fd
static PtWidget_t * cmd_window
static PtWidget_t * cmd_text
static PtWidget_t * cmd_prompt
static const char * cur_prompt_text

Define Documentation

#define LABEL_FULL_HEIGHT   (LABEL_HEIGHT+4)

Definition at line 78 of file nlphcmd.c.

Referenced by nlph_cmdclt_init().

#define LABEL_FULL_WIDTH   (LABEL_WIDTH+4)

Definition at line 81 of file nlphcmd.c.

#define LABEL_HEIGHT   25

Definition at line 77 of file nlphcmd.c.

Referenced by nlph_cmdclt_init().

#define LABEL_SPACE   6

Definition at line 79 of file nlphcmd.c.

Referenced by nlph_cmdclt_init().

#define LABEL_WIDTH   780

Definition at line 80 of file nlphcmd.c.

Referenced by nlph_cmdclt_init().

#define LOGO_WIDTH   20

Definition at line 84 of file nlphcmd.c.

Referenced by nlph_cmdclt_init().

#define QUEUE_LENGTH   10

Definition at line 19 of file nlphcmd.c.

Referenced by enqueue_char(), and nlph_getch().

#define WINDOW_HEIGHT   (2*LABEL_FULL_HEIGHT + 3*LABEL_SPACE + 1)

Definition at line 82 of file nlphcmd.c.

Referenced by nlph_cmdclt_init().

#define WINDOW_WIDTH   (LABEL_FULL_WIDTH + 2*LABEL_SPACE)

Definition at line 83 of file nlphcmd.c.

Referenced by nlph_cmdclt_init().


Function Documentation

static int cic_cmd_quit_func ( int  fd,
void *  data,
unsigned  mode 
) [static]

Definition at line 86 of file nlphcmd.c.

References cic_reset().

Referenced by nlph_cmdclt_init().

Here is the call graph for this function:

Here is the caller graph for this function:

static void enqueue_char ( int  c) [static]

Definition at line 134 of file nlphcmd.c.

References char_sem, queue_t::chars, queue_t::head, nl_error, QUEUE_LENGTH, queue_mutex, and queue_t::tail.

Referenced by my_key_event().

Here is the caller graph for this function:

static int my_key_event ( PtWidget_t *  widget,
void *  apinfo,
PtCallbackInfo_t *  cbinfo 
) [static]

Definition at line 172 of file nlphcmd.c.

References enqueue_char(), and nl_error.

Referenced by nlph_cmdclt_init().

Here is the call graph for this function:

Here is the caller graph for this function:

static PtWidget_t* new_cmd_window ( char *  title,
int  width,
int  height 
) [static]

Definition at line 34 of file nlphcmd.c.

Referenced by nlph_cmdclt_init().

Here is the caller graph for this function:

static PtWidget_t* new_text_widget ( PtWidget_t *  window,
char *  text,
int  x,
int  y,
char *  font,
PgColor_t  color,
int  align 
) [static]

Definition at line 51 of file nlphcmd.c.

Referenced by nlph_cmdclt_init().

Here is the caller graph for this function:

void nlph_cmdclt_init ( void *(*)(void *)  cmd_thread)
int nlph_getch ( void  )
void nlph_update_cmdtext ( const char *  cmdtext,
const char *  prompttext 
)

Definition at line 212 of file nlphcmd.c.

References cmd_prompt, and cmd_text.


Variable Documentation

sem_t char_sem [static]

Definition at line 17 of file nlphcmd.c.

Referenced by enqueue_char(), nlph_cmdclt_init(), and nlph_getch().

PtWidget_t* cmd_prompt [static]

Definition at line 32 of file nlphcmd.c.

Referenced by nlph_cmdclt_init(), and nlph_update_cmdtext().

int cmd_quit_fd [static]

Definition at line 29 of file nlphcmd.c.

PtWidget_t* cmd_text [static]

Definition at line 31 of file nlphcmd.c.

Referenced by nlph_cmdclt_init(), and nlph_update_cmdtext().

PtWidget_t* cmd_window [static]

Definition at line 30 of file nlphcmd.c.

Referenced by nlph_cmdclt_init().

const char* cur_prompt_text [static]

Definition at line 211 of file nlphcmd.c.

queue_t queue [static]

Definition at line 25 of file nlphcmd.c.

pthread_mutex_t queue_mutex = PTHREAD_MUTEX_INITIALIZER [static]

Definition at line 18 of file nlphcmd.c.

Referenced by enqueue_char(), and nlph_getch().

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines