ekg2  GIT master
Struktury danych | Definicje | Funkcje | Zmienne
Dokumentacja pliku themes.c
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "stuff.h"
#include "themes.h"
#include "xmalloc.h"
#include "windows.h"
#include "userlist.h"
#include "debug.h"
#include "dynstuff_inline.h"
#include "queries.h"
Wykres zależności załączania dla themes.c:

Struktury danych

struct  format
 

Definicje

#define ROL(x)   (((x>>25)&0x7f)|((x<<7)&0xffffff80))
 
#define NPAR   16 /* ECMA-48 CSI have got max 16 params (NPAR) defined in <linux/console_struct.h> */
 
#define FORE_COMMON(x)
 
#define FORE_COMMON_BOLD(x)
 
#define BACK_COMMON(x)
 

Funkcje

static void theme_cache_reset ()
 
static void list_format_free (struct format *data)
 
static void formats_add (struct format **lista, struct format *new)
 
static void formats_destroy (struct format **lista)
 
static int gim_hash (const char *name)
 
const char * format_find (const char *name)
 
static const char * format_ansi (char ch)
 
static void format_ansi_append (string_t str, char ch)
 
static char * va_format_string (const char *format, va_list ap)
 
fstring_tfstring_new (const char *str)
 
fstring_tfstring_new_format (const char *format,...)
 
void fstring_free (fstring_t *str)
 
char * format_string (const char *format,...)
 
static char * split_line (char **ptr)
 
static void window_print (window_t *w, fstring_t *line)
 
void print_window_w (window_t *w, int activity, const char *theme,...)
 
static fstring_tremote_format_string (const char *str, time_t ts)
 
 __attribute__ ((visibility("hidden")))
 
static void format_add_c (const char *name, const char *value, int remote)
 
void format_add (const char *name, const char *value, int replace)
 

Zmienne

static char * prompt_cache = NULL
 
static char * prompt2_cache = NULL
 
static char * error_cache = NULL
 
static const char * timestamp_cache = NULL
 
static int no_prompt_cache = 0
 
static int no_prompt_cache_hash = 0x139dcbd6
 
static struct formatformats [0x100]
 

Dokumentacja definicji

◆ BACK_COMMON

#define BACK_COMMON (   x)
Wartość:
attr |= x << 3; \
break;
Definition: themes.h:98
Definition: themes.h:96

◆ FORE_COMMON

#define FORE_COMMON (   x)
Wartość:
attr &= (FSTR_BACKMASK); \
attr &= ~(FSTR_NORMAL+FSTR_FOREMASK); \
attr |= x; \
isbold = 0; \
break;
Definition: themes.h:98
Definition: themes.h:92
Definition: themes.h:96

◆ FORE_COMMON_BOLD

#define FORE_COMMON_BOLD (   x)
Wartość:
attr |= x; \
attr |= FSTR_BOLD; \
isbold = 1; \
break;
Definition: themes.h:98
Definition: themes.h:97
Definition: themes.h:92

◆ NPAR

#define NPAR   16 /* ECMA-48 CSI have got max 16 params (NPAR) defined in <linux/console_struct.h> */

◆ ROL

#define ROL (   x)    (((x>>25)&0x7f)|((x<<7)&0xffffff80))

Dokumentacja funkcji

◆ __attribute__()

__attribute__ ( (visibility("hidden"))  )

◆ format_add()

void format_add ( const char *  name,
const char *  value,
int  replace 
)

format_add()

Add format with name and value.
If replace set to 1, than if format with the same name exists. than format value will be replaced.

Do zrobienia:
What about creating global variable: formats_unique_here.. and if set to 1, don't search if this format already exists? It should speedup theme_init() a little.
Parametry
name- name of format
value- value of format
replace- if this format exists and is set to 1 than format value will be replaced with new one. else do nothing.

◆ format_add_c()

static void format_add_c ( const char *  name,
const char *  value,
int  remote 
)
static

◆ format_ansi()

static const char* format_ansi ( char  ch)
static

◆ format_ansi_append()

static void format_ansi_append ( string_t  str,
char  ch 
)
static

◆ format_find()

const char* format_find ( const char *  name)

◆ format_string()

char* format_string ( const char *  format,
  ... 
)

◆ formats_add()

static void formats_add ( struct format **  lista,
struct format new 
)
static

◆ formats_destroy()

static void formats_destroy ( struct format **  lista)
static

◆ fstring_free()

void fstring_free ( fstring_t str)

fstring_free()

Free memory allocated by str

Do zrobienia:
XXX Think about freeing str->priv_data
Parametry
str- fstring_t * to free.

◆ fstring_new()

fstring_t* fstring_new ( const char *  str)

fstring_new()

Change formatted ansi string (str) to Nowy-i-Lepszy (tm) [New-and-Better].

Parametry
str- string
Zobacz również
format_string() - Function to format strings.
fstring_free() - Function to free fstring_t.
Zwraca
Allocated fstring_t.

◆ fstring_new_format()

fstring_t* fstring_new_format ( const char *  format,
  ... 
)

fstring_new_format()

char *tmp = format_string("format", .....); fstr = fstring_new(tmp); xfree(tmp);

◆ gim_hash()

static int gim_hash ( const char *  name)
static

◆ list_format_free()

static void list_format_free ( struct format data)
static

◆ print_window_w()

void print_window_w ( window_t w,
int  activity,
const char *  theme,
  ... 
)

print_window_w()

Like print_window() but it takes window_t struct instead of target+session.

Nota
The same as in print_window_c(): we don't check if w is valid window ptr. Just be careful. If you are not sure call:
print_window_c(window_find_ptr(w), separate, theme, ...) And in worst case text will be displayed in (__status / or __current) window instead of a usual one.. But ekg2 won't crash.
Parametry
w- window to display,
if NULL than __status or __current will be used. it depends on: config_default_status_window and config_display_crap variables.

◆ remote_format_string()

static fstring_t* remote_format_string ( const char *  str,
time_t  ts 
)
static

◆ split_line()

static char* split_line ( char **  ptr)
static

◆ theme_cache_reset()

static void theme_cache_reset ( )
static

◆ va_format_string()

static char* va_format_string ( const char *  format,
va_list  ap 
)
static

◆ window_print()

static void window_print ( window_t w,
fstring_t line 
)
static

Dokumentacja zmiennych

◆ error_cache

char * error_cache = NULL
static

◆ formats

struct format* formats[0x100]
static

◆ no_prompt_cache

int no_prompt_cache = 0
static

◆ no_prompt_cache_hash

int no_prompt_cache_hash = 0x139dcbd6
static

◆ prompt2_cache

char * prompt2_cache = NULL
static

◆ prompt_cache

char* prompt_cache = NULL
static

◆ timestamp_cache

const char* timestamp_cache = NULL
static