Example #1
0
/* ---------------------------- exported variables (globals) --------------- */

/* IMPORTANT: command description should not be longer than 53 characters. */
/* If you change func_table format, change also perllib/FVWM/create-commands */
/* The next line must be blank for modules to properly parse this file. */

const func_t func_table[] =
{
	/* CMD_ENT("#", CMD_Comment, 0, 0, 0), */
	/* # - Comment line (ignored) */

	/* CMD_ENT("*", CMD_Asterisk, 0, 0, 0), */
	/* * - Module configuration line (no space after asterisk) */

	CMD_ENT("+", CMD_Plus, F_ADDMENU2, 0, 0),
	/* + - Continue the last AddToFunc, AddToMenu or AddToDecor */

	CMD_ENT("addbuttonstyle", CMD_AddButtonStyle, F_ADD_BUTTON_STYLE,
		FUNC_DECOR, 0),
	/* - Add to a button style (see ButtonStyle) */

	CMD_ENT("addtitlestyle", CMD_AddTitleStyle, F_ADD_TITLE_STYLE,
		FUNC_DECOR, 0),
	/* - Add to a title style (see TitleStyle) */

#ifdef USEDECOR
	CMD_ENT("addtodecor", CMD_AddToDecor, F_ADD_DECOR, 0, 0),
	/* - Add a decor definition (will be obsolete) */

#endif /* USEDECOR */
Example #2
0
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>

#include "server.h"
#include "commands.h"

#define INIT_DICT_SIZE 16  /* the initial key dict size */

/* the command table */
#define CMD_ENT(name) {#name, name##_command, NOT_BLOCKED}
#define CMD_BENT(name) {#name, name##_command, BLOCKED}
#define NUM_COMMANDS 63

EXTERN command_t commad_tbl[] = {CMD_ENT(del), CMD_ENT(exists),
                                 CMD_ENT(randomkey), CMD_ENT(rename),
                                 CMD_ENT(keys), CMD_ENT(type),
                                 CMD_ENT(append), CMD_ENT(getbit),
                                 CMD_ENT(setbit), CMD_ENT(mget),
                                 CMD_ENT(bitcount), CMD_ENT(setrange),
                                 CMD_ENT(getrange), CMD_ENT(incr),
                                 CMD_ENT(decr), CMD_ENT(incrby),
                                 CMD_ENT(decrby), CMD_ENT(msetnx),
                                 CMD_ENT(get), CMD_ENT(set),
                                 CMD_ENT(strlen), CMD_ENT(hdel),
                                 CMD_ENT(hlen), CMD_ENT(hexists),
                                 CMD_ENT(hmget), CMD_ENT(hget),
                                 CMD_ENT(hmset), CMD_ENT(hgetall),
                                 CMD_ENT(hincrby), CMD_ENT(hset),
                                 CMD_ENT(hincrbyfloat), CMD_ENT(hsetnx),