ARPDAS_QNX6 1.0
|
#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"
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 LABEL_FULL_HEIGHT (LABEL_HEIGHT+4) |
Definition at line 78 of file nlphcmd.c.
Referenced by nlph_cmdclt_init().
#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().
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().
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().
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().
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().
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().
void nlph_cmdclt_init | ( | void *(*)(void *) | cmd_thread | ) |
Definition at line 93 of file nlphcmd.c.
References attr, char_sem, cic_cmd_quit_fd, cic_cmd_quit_func(), cic_init(), cmd_prompt, cmd_text, cmd_window, LABEL_FULL_HEIGHT, LABEL_HEIGHT, LABEL_SPACE, LABEL_WIDTH, LOGO_WIDTH, my_key_event(), new_cmd_window(), new_text_widget(), nl_error, WINDOW_HEIGHT, and WINDOW_WIDTH.
int nlph_getch | ( | void | ) |
Definition at line 153 of file nlphcmd.c.
References char_sem, queue_t::chars, queue_t::head, nl_error, QUEUE_LENGTH, queue_mutex, and queue_t::tail.
void nlph_update_cmdtext | ( | const char * | cmdtext, |
const char * | prompttext | ||
) |
Definition at line 212 of file nlphcmd.c.
References cmd_prompt, and cmd_text.
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] |
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] |
pthread_mutex_t queue_mutex = PTHREAD_MUTEX_INITIALIZER [static] |
Definition at line 18 of file nlphcmd.c.
Referenced by enqueue_char(), and nlph_getch().