Beispiel #1
0
void
rbffi_DynamicLibrary_Init(VALUE moduleFFI)
{
    LibraryClass = rb_define_class_under(moduleFFI, "DynamicLibrary", rb_cObject);
    rb_global_variable(&LibraryClass);
    SymbolClass = rb_define_class_under(LibraryClass, "Symbol", rbffi_PointerClass);
    rb_global_variable(&SymbolClass);

    rb_define_const(moduleFFI, "NativeLibrary", LibraryClass); // backwards compat library
    rb_define_alloc_func(LibraryClass, library_allocate);
    rb_define_singleton_method(LibraryClass, "open", library_open, 2);
    rb_define_singleton_method(LibraryClass, "last_error", library_dlerror, 0);
    rb_define_method(LibraryClass, "initialize", library_initialize, 2);
    rb_define_method(LibraryClass, "find_symbol", library_dlsym, 1);
    rb_define_method(LibraryClass, "find_function", library_dlsym, 1);
    rb_define_method(LibraryClass, "find_variable", library_dlsym, 1);
    rb_define_method(LibraryClass, "last_error", library_dlerror, 0);
    rb_define_attr(LibraryClass, "name", 1, 0);

    rb_define_alloc_func(SymbolClass, symbol_allocate);
    rb_undef_method(SymbolClass, "new");
    rb_define_method(SymbolClass, "inspect", symbol_inspect, 0);

#define DEF(x) rb_define_const(LibraryClass, "RTLD_" #x, UINT2NUM(RTLD_##x))
    DEF(LAZY);
    DEF(NOW);
    DEF(GLOBAL);
    DEF(LOCAL);

}
Beispiel #2
0
js_val *
bootstrap_error()
{
  js_val *error = JSNFUNC(error_new, 1);
  js_val *prototype = JSOBJ();
  prototype->proto = fh->object_proto;

  // Error
  // -----

  // Properties
  DEF(error, "prototype", prototype);

  // Error.prototype
  // ---------------
  
  // Properties
  DEF(prototype, "constructor", JSNFUNC(error_new, 1));
  DEF(prototype, "name", JSSTR("Error"));
  DEF(prototype, "message", JSSTR(""));

  // Methods
  DEF(prototype, "toString", JSNFUNC(error_proto_to_string, 0));

  fh_attach_prototype(prototype, fh->function_proto);

  return error;
}
Beispiel #3
0
static void DEF(ff_put_no_rnd_pixels16_y2)(uint8_t *block,
                                           const uint8_t *pixels,
                                           ptrdiff_t line_size, int h)
{
    DEF(ff_put_no_rnd_pixels8_y2)(block,     pixels,     line_size, h);
    DEF(ff_put_no_rnd_pixels8_y2)(block + 8, pixels + 8, line_size, h);
}
// -gen-rs-data-type-enums
//
// ENUM_PRIMITIVE_DATA_TYPE(type, cname, bits)
// ENUM_PRIMITIVE_DATA_TYPE_RANGE(begin_type, end_type)
// ENUM_RS_MATRIX_DATA_TYPE(type, cname, bits)
// ENUM_RS_MATRIX_DATA_TYPE_RANGE(begin_type, end_type)
// ENUM_RS_OBJECT_DATA_TYPE(type, cname, bits)
// ENUM_RS_OBJECT_DATA_TYPE_RANGE(begin_type, end_type)
//
// ENUM_RS_DATA_TYPE(type, cname, bits)
// e.g., ENUM_RS_DATA_TYPE(Float32, "float", 256)
static int GenRSDataTypeEnums(const RSDataTypeSpec *const DataTypes[],
                              unsigned NumDataTypes) {
  // Alias missing #define
#define ALIAS_DEF(x, y) \
  printf("#ifndef " #x "\n");  \
  printf("#define " #x "(type, cname, bits) " #y "(type, cname, bits)\n");  \
  printf("#endif\n\n")
  ALIAS_DEF(ENUM_PRIMITIVE_DATA_TYPE, ENUM_RS_DATA_TYPE);
  ALIAS_DEF(ENUM_RS_MATRIX_DATA_TYPE, ENUM_RS_DATA_TYPE);
  ALIAS_DEF(ENUM_RS_OBJECT_DATA_TYPE, ENUM_RS_DATA_TYPE);
#undef ALIAS_DEF

#define ALIAS_DEF(x) \
  printf("#ifndef " #x "\n");  \
  printf("#define " #x "(begin_type, end_type)\n");  \
  printf("#endif\n\n")
  ALIAS_DEF(ENUM_PRIMITIVE_DATA_TYPE_RANGE);
  ALIAS_DEF(ENUM_RS_MATRIX_DATA_TYPE_RANGE);
  ALIAS_DEF(ENUM_RS_OBJECT_DATA_TYPE_RANGE);
#undef ALIAS_DEF

#define DEF(x) \
  printf(#x "(%s, \"%s\", %lu)\n",  \
         DataTypes[i]->getTypeName(), \
         DataTypes[i]->getTypePragmaName(), \
         (unsigned long) DataTypes[i]->getSizeInBit());  // NOLINT(runtime/int)
#define DEF_RANGE(x, begin, end)  \
  printf(#x "(%s, %s)\n\n", \
         DataTypes[begin]->getTypeName(), \
         DataTypes[end]->getTypeName())
  for (unsigned i = FirstPrimitiveType; i <= LastPrimitiveType; i++)
    DEF(ENUM_PRIMITIVE_DATA_TYPE);
  DEF_RANGE(ENUM_PRIMITIVE_DATA_TYPE_RANGE,
            FirstPrimitiveType, LastPrimitiveType);
  for (unsigned i = FirstRSMatrixType; i <= LastRSMatrixType; i++)
    DEF(ENUM_RS_MATRIX_DATA_TYPE)
  DEF_RANGE(ENUM_RS_MATRIX_DATA_TYPE_RANGE,
            FirstRSMatrixType, LastRSMatrixType);
  for (unsigned i = FirstRSObjectType; i <= LastRSObjectType; i++)
    DEF(ENUM_RS_OBJECT_DATA_TYPE)
  DEF_RANGE(ENUM_RS_OBJECT_DATA_TYPE_RANGE,
            FirstRSObjectType, LastRSObjectType);
#undef DEF
#undef DEF_RANGE

#define UNDEF(x)  \
  printf("#undef " #x "\n")
  UNDEF(ENUM_PRIMITIVE_DATA_TYPE);
  UNDEF(ENUM_RS_MATRIX_DATA_TYPE);
  UNDEF(ENUM_RS_OBJECT_DATA_TYPE);
  UNDEF(ENUM_PRIMITIVE_DATA_TYPE_RANGE);
  UNDEF(ENUM_RS_MATRIX_DATA_TYPE_RANGE);
  UNDEF(ENUM_RS_OBJECT_DATA_TYPE_RANGE);
  UNDEF(ENUM_RS_DATA_TYPE);
  return 0;
}
Beispiel #5
0
alias_used_builtins ()
{
  int rule, one_builtin_used = false;
  brother = laststdpred;
  for (builtin = laststdpred; builtin != nil; builtin = BROTHER (builtin))
    if ((builtin != cut) && (builtin != nestarset) &&
        (!mystrcmp (REPR (builtin), "select")) &&
        (builtin != tltraditionalterm) &&
        (builtin != transformlatticeterm) &&
        (builtin != tltraditional) &&
        (builtin != transformlattice) &&
        (builtin != skip) &&
        (builtin != explintersect) &&
        (builtin != getip) &&
        (builtin != falseip) &&
        (builtin != restoreip) &&
        (builtin != evalmeta) &&
        (builtin != initmeta) &&
        (builtin != evalmeta) && (builtin != resetinputptr) && (builtin != nestaralt) && (builtin != where))
    {
      int mem, alt;
      char *n, *m = REPR (builtin);
      if (!builtin_used ())
        continue;
      one_builtin_used = true;
      if (det_flag)
        if ((builtin == tltraditional) || (builtin == tltraditionalterm)
            || (mystrcmp (REPR (builtin), "select")) || (mystrcmp (REPR (builtin), "delete")))
          continue;
      make_new_rule (brother);
      new_rule = brother;

      n = (char *) malloc (strlen (m) + 7);
      if (n == NULL)
        fprintf (stderr, "glammar: Out of memory.\n"), exit (-1);
      strcpy (n, "built_"), strcpy (n + 6, m);
      REPR (new_rule) = n;
      SET (new_rule, external);
      PART (new_rule) = PART (root);
      for (rule = root; rule != laststdpred; rule = BROTHER (rule))
        for (alt = SON (rule); alt != nil; alt = BROTHER (alt))
          for (mem = SON (alt); mem != nil; mem = BROTHER (mem))
            if ((builtin == DEF (mem)) && !(TERMINAL (mem)))
            {
              DEF (mem) = new_rule;
              REPR (mem) = n;
            }
    }
  if (!one_builtin_used)
    return;
  for (rule = root; BROTHER (rule) != laststdpred; rule = BROTHER (rule));
  BROTHER (rule) = new_rule;
}
Beispiel #6
0
js_val *
bootstrap_function()
{
  js_val *function = JSNFUNC(func_new, 1);
  js_val *prototype = JSFUNC(NULL);
  function->proto = prototype;
  prototype->proto = fh->object_proto;

  // Function
  // --------

  DEF(function, "prototype", prototype);

  // Function.prototype
  // ------------------

  // Properties
  DEF(prototype, "length", JSNUM(0));
  DEF(prototype, "constructor", JSNFUNC(func_new, 1));

  // Methods
  DEF(prototype, "apply", JSNFUNC(func_proto_apply, 2));
  DEF(prototype, "bind", JSNFUNC(func_proto_bind, 1));
  DEF(prototype, "call", JSNFUNC(func_proto_call, 1));
  DEF(prototype, "isGenerator", JSNFUNC(func_proto_is_generator, 0));
  DEF(prototype, "toString", JSNFUNC(func_proto_to_string, 0));

  fh->function_proto = prototype;

  return function;
}
Beispiel #7
0
tail_recursion_elimination ()
{
  int alt;
  int tre = 0;

  if (no_recursion_elm_flag)
    return false;

  for (alt = SON (ulhs); alt != nil; alt = BROTHER (alt))
  {
    int mem = SON (alt);
    if (mem == nil)
      continue;
    if (FLAG_MARKED (alt, no_tail_recursion_opt_f))
      continue;
    mem = get_last_but_cut_mem (mem);
    if (DEF (mem) == ulhs)
    {
      FLAG_SET (alt, tail_recursion_opt_f);
      FLAG_SET (mem, tail_recursion_opt_f);
      tre = 1;
    }
  }
  return tre;
}
Beispiel #8
0
void Native::install_methods(Class *c)
{
	DEF(c, "repr")
		Native *n = static_cast<Native*>(self.obj);
		std::stringstream ss;
		ss << "<Native:" << (void*)self.obj << "/" << (void*)n->fn << ">";
		return ctx->make_string(ss.str());
	END
}
Beispiel #9
0
builtin_used ()
{
  int rule, alt, mem;
  for (rule = root; rule != laststdpred; rule = BROTHER (rule))
    for (alt = SON (rule); alt != nil; alt = BROTHER (alt))
      for (mem = SON (alt); mem != nil; mem = BROTHER (mem))
        if ((builtin == DEF (mem)) && !(TERMINAL (mem)))
          return true;
  return false;
}
Beispiel #10
0
det_rule_head ()
{
  fprintf (output, "\n\n/*  %s   */\n", FREPR (ulhs));
  if (MARKED (ulhs, external))
    fprintf (output, "int D%s(", REPR (ulhs));
  else
    fprintf (output, "static int D_%d(", ulhs);
  det_get_affixes (AFFIXDEF (SON (ulhs)));

  if (fprintf (output, " {\n register AFFIX raf = af;\n") == EOF)
  {
    fprintf (stderr, "glammar: Write failed (try again later)\n");
    exit (12);
  }
  if (BROTHER (SON (ulhs)) != nil)
  {
    fprintf (output, "  char *rc = c,  *rip = ip;\n");
  }
  if (lookahead_in_alt (SON (ulhs)))
    fprintf (output, "  char *lkh;\n");
  if (BROTHER (SON (ulhs)) != nil)
    fprintf (output, "  int cut_set = 0;\n");
  fprintf (output, "  int ltr=level++;\n");
  if (trace_flag)
    fprintf (output, " char *pntnamesv = pntname; char *ntname = \"%s\";\n", FREPR (ulhs));
  else if (errormsg_flag)
  {
    int mem = SON (SON (ulhs));
    if (mem != nil && DEF (mem) == equal)
      fprintf (output, "  char *pntnamesv = pntname; char *ntname = \"%s\"; int lsave = level+10;\n", FREPR (ulhs));
    else
      fprintf (output, "  char *pntnamesv = pntname; char *ntname = \"%s\"; int lsave = level++;\n", FREPR (ulhs));
  }

  if (stat_flag)
  {
    fprintf (output, "  int s1 = stat_count++;\n");
  }
  save_lattice_afx ();
  if (tail_recursion_elimination ())
    fprintf (output, " label_%d:\n\n", ulhs);

}
Beispiel #11
0
#include "mail-storage-private.h"
#include "mail-storage-settings.h"

#include <stddef.h>

static bool mail_storage_settings_check(void *_set, pool_t pool, const char **error_r);
static bool namespace_settings_check(void *_set, pool_t pool, const char **error_r);
static bool mailbox_settings_check(void *_set, pool_t pool, const char **error_r);
static bool mail_user_settings_check(void *_set, pool_t pool, const char **error_r);

#undef DEF
#define DEF(type, name) \
	{ type, #name, offsetof(struct mail_storage_settings, name), NULL }

static const struct setting_define mail_storage_setting_defines[] = {
	DEF(SET_STR_VARS, mail_location),
	{ SET_ALIAS, "mail", 0, NULL },
	DEF(SET_STR_VARS, mail_attachment_fs),
	DEF(SET_STR_VARS, mail_attachment_dir),
	DEF(SET_STR, mail_attachment_hash),
	DEF(SET_SIZE, mail_attachment_min_size),
	DEF(SET_STR_VARS, mail_attribute_dict),
	DEF(SET_UINT, mail_prefetch_count),
	DEF(SET_STR, mail_cache_fields),
	DEF(SET_STR, mail_never_cache_fields),
	DEF(SET_UINT, mail_cache_min_mail_count),
	DEF(SET_TIME, mailbox_idle_check_interval),
	DEF(SET_UINT, mail_max_keyword_length),
	DEF(SET_TIME, mail_max_lock_timeout),
	DEF(SET_TIME, mail_temp_scan_interval),
	DEF(SET_BOOL, mail_save_crlf),
#include "lib.h"
#include "settings-parser.h"
#include "master-service-private.h"
#include "master-service-ssl-settings.h"

#include <stddef.h>

#undef DEF
#define DEF(type, name) \
	{ type, #name, offsetof(struct master_service_ssl_settings, name), NULL }

static bool
master_service_ssl_settings_check(void *_set, pool_t pool, const char **error_r);

static const struct setting_define master_service_ssl_setting_defines[] = {
	DEF(SET_ENUM, ssl),
	DEF(SET_STR, ssl_ca),
	DEF(SET_STR, ssl_cert),
	DEF(SET_STR, ssl_key),
	DEF(SET_STR, ssl_key_password),
	DEF(SET_STR, ssl_cipher_list),
	DEF(SET_STR, ssl_protocols),
	DEF(SET_STR, ssl_cert_username_field),	
	DEF(SET_STR, ssl_crypto_device),
	DEF(SET_STR, ssl_cert_md_algorithm),
	DEF(SET_UINT, ssl_verify_depth),
	DEF(SET_BOOL, ssl_verify_client_cert),
	DEF(SET_BOOL, ssl_require_crl),
	DEF(SET_BOOL, verbose_ssl),
	DEF(SET_BOOL, ssl_prefer_server_ciphers),
	DEF(SET_BOOL, ssl_cert_info),
	.service_count = 1,
	.idle_kill = 0,
	.vsz_limit = (uoff_t)-1,

	.unix_listeners = ARRAY_INIT,
	.fifo_listeners = ARRAY_INIT,
	.inet_listeners = { { &managesieve_login_inet_listeners_buf,
		sizeof(managesieve_login_inet_listeners[0]) } }
};

#undef DEF
#define DEF(type, name) \
	{ type, #name, offsetof(struct managesieve_login_settings, name), NULL }

static const struct setting_define managesieve_login_setting_defines[] = {
	DEF(SET_STR, managesieve_implementation_string),
	DEF(SET_STR, managesieve_sieve_capability),
	DEF(SET_STR, managesieve_notify_capability),

	SETTING_DEFINE_LIST_END
};

static const struct managesieve_login_settings managesieve_login_default_settings = {
	.managesieve_implementation_string = DOVECOT_NAME " " PIGEONHOLE_NAME,
	.managesieve_sieve_capability = "",
	.managesieve_notify_capability = NULL
};

static const struct setting_parser_info *managesieve_login_setting_dependencies[] = {
	&login_setting_parser_info,
	NULL
Beispiel #14
0
/* Copyright (c) 2005-2016 Dovecot authors, see the included COPYING file */

#include "lib.h"
#include "settings-parser.h"
#include "mail-storage-settings.h"
#include "mbox-settings.h"

#include <stddef.h>

#undef DEF
#define DEF(type, name) \
	{ type, #name, offsetof(struct mbox_settings, name), NULL }

static const struct setting_define mbox_setting_defines[] = {
	DEF(SET_STR, mbox_read_locks),
	DEF(SET_STR, mbox_write_locks),
	DEF(SET_TIME, mbox_lock_timeout),
	DEF(SET_TIME, mbox_dotlock_change_timeout),
	DEF(SET_SIZE, mbox_min_index_size),
	DEF(SET_BOOL, mbox_dirty_syncs),
	DEF(SET_BOOL, mbox_very_dirty_syncs),
	DEF(SET_BOOL, mbox_lazy_writes),
	DEF(SET_ENUM, mbox_md5),

	SETTING_DEFINE_LIST_END
};

static const struct mbox_settings mbox_default_settings = {
	.mbox_read_locks = "fcntl",
	.mbox_write_locks = "dotlock fcntl",
	.mbox_lock_timeout = 5*60,
Beispiel #15
0
void mt ## x(unsigned int data) \
{ \
	__asm volatile (STR(mt ## x %0) :: STR(r)(data)); \
} \

#define DEF(x) \
	{ #x, mf ## x, mt ## x }

FUNC(msr);

struct {
	char *op;
	unsigned int (*mf)(void);
	void (*mt)(unsigned int);
} mreg [] = {
	DEF(msr),
	{ NULL, NULL, NULL },
};

void
db_cmd_mf(int argc, char **argv)
{
	int i = 0;

	if (argc != 2) {
		printf("mf register\nregister:");
		while (mreg[i].op != NULL)
			printf(" %s", mreg[i++].op);
		printf("\n");
		return;
	}
Beispiel #16
0
/* Copyright (c) 2005-2015 Dovecot authors, see the included COPYING file */

#include "lib.h"
#include "settings-parser.h"
#include "mail-storage-settings.h"
#include "maildir-settings.h"

#include <stddef.h>

#undef DEF
#define DEF(type, name) \
	{ type, #name, offsetof(struct maildir_settings, name), NULL }

static const struct setting_define maildir_setting_defines[] = {
	DEF(SET_BOOL, maildir_copy_with_hardlinks),
	DEF(SET_BOOL, maildir_very_dirty_syncs),
	DEF(SET_BOOL, maildir_broken_filename_sizes),
	DEF(SET_BOOL, maildir_empty_new),

	SETTING_DEFINE_LIST_END
};

static const struct maildir_settings maildir_default_settings = {
	.maildir_copy_with_hardlinks = TRUE,
	.maildir_very_dirty_syncs = FALSE,
	.maildir_broken_filename_sizes = FALSE,
	.maildir_empty_new = FALSE
};

static const struct setting_parser_info maildir_setting_parser_info = {
	.module_name = "maildir",
Beispiel #17
0
}

/*
 * Public libvlc functions
 */

#define DEF( a ) { libvlc_##a, #a, },

typedef struct
{
    int type;
    const char name[40];
} event_name_t;

static const event_name_t event_list[] = {
    DEF(MediaMetaChanged)
    DEF(MediaSubItemAdded)
    DEF(MediaDurationChanged)
    DEF(MediaParsedChanged)
    DEF(MediaFreed)
    DEF(MediaStateChanged)
    DEF(MediaSubItemTreeAdded)

    DEF(MediaPlayerMediaChanged)
    DEF(MediaPlayerNothingSpecial)
    DEF(MediaPlayerOpening)
    DEF(MediaPlayerBuffering)
    DEF(MediaPlayerPlaying)
    DEF(MediaPlayerPaused)
    DEF(MediaPlayerStopped)
    DEF(MediaPlayerForward)
Beispiel #18
0
            &stats_fifo_listeners_buf,
            sizeof(stats_fifo_listeners[0])
        }
    },
    .inet_listeners = ARRAY_INIT,

    .process_limit_1 = TRUE
};

/* we're kind of kludging here to avoid "stats_" prefix in the struct fields */
#undef DEF
#define DEF(type, name) \
	{ type, "stats_"#name, offsetof(struct stats_settings, name), NULL }

static const struct setting_define stats_setting_defines[] = {
    DEF(SET_SIZE, memory_limit),
    DEF(SET_TIME, command_min_time),
    DEF(SET_TIME, session_min_time),
    DEF(SET_TIME, user_min_time),
    DEF(SET_TIME, domain_min_time),
    DEF(SET_TIME, ip_min_time),

    SETTING_DEFINE_LIST_END
};

const struct stats_settings stats_default_settings = {
    .memory_limit = 1024*1024*16,

    .command_min_time = 60,
    .session_min_time = 60*15,
    .user_min_time = 60*60,
Beispiel #19
0
#include "master-service-settings.h"
#include "master-service-ssl-settings.h"
#include "master-service-settings-cache.h"
#include "login-settings.h"

#include <stddef.h>
#include <unistd.h>

static bool login_settings_check(void *_set, pool_t pool, const char **error_r);

#undef DEF
#define DEF(type, name) \
	{ type, #name, offsetof(struct login_settings, name), NULL }

static const struct setting_define login_setting_defines[] = {
	DEF(SET_STR, login_trusted_networks),
	DEF(SET_STR, login_source_ips),
	DEF(SET_STR_VARS, login_greeting),
	DEF(SET_STR, login_log_format_elements),
	DEF(SET_STR, login_log_format),
	DEF(SET_STR, login_access_sockets),
	DEF(SET_STR, director_username_hash),

	DEF(SET_STR, ssl_client_cert),
	DEF(SET_STR, ssl_client_key),
	DEF(SET_BOOL, ssl_require_crl),
	DEF(SET_BOOL, auth_ssl_require_client_cert),
	DEF(SET_BOOL, auth_ssl_username_from_cert),

	DEF(SET_BOOL, disable_plaintext_auth),
	DEF(SET_BOOL, auth_verbose),
Beispiel #20
0
#include "hsa_linkloader.h"
#include "hsa_fexcept.h"

#define DEF(NAME, ADDR) \
{NAME, sizeof(NAME) - 1, (void *)(&(ADDR))},

typedef struct func_entry_t {
    char const *name;
    size_t name_len;
    void *addr;
} func_entry_t;

static int isfailed;

func_entry_t const helper_tab[] = {
    DEF("hsa_printf_32", hsa_printf_32)
    DEF("hsa_printf_64", hsa_printf_64)
    DEF("_ins_count", hsa_ins_count)


    DEF("hsa_load_8", hsa_load_8)
    DEF("hsa_load_16", hsa_load_16)
    DEF("hsa_load_32", hsa_load_32)
    DEF("hsa_load_64", hsa_load_64)
    DEF("hsa_store_8", hsa_store_8)
    DEF("hsa_store_16", hsa_store_16)
    DEF("hsa_store_32", hsa_store_32)
    DEF("hsa_store_64", hsa_store_64)

    DEF("Barrier", hsa_helper_barrier)
	.service_count = 1,
	.idle_kill = 0,
	.vsz_limit = (uoff_t)-1,

	.unix_listeners = { { &imap_urlauth_worker_unix_listeners_buf,
			      sizeof(imap_urlauth_worker_unix_listeners[0]) } },
	.fifo_listeners = ARRAY_INIT,
	.inet_listeners = ARRAY_INIT
};

#undef DEF
#define DEF(type, name) \
	{ type, #name, offsetof(struct imap_urlauth_worker_settings, name), NULL }

static const struct setting_define imap_urlauth_worker_setting_defines[] = {
	DEF(SET_BOOL, verbose_proctitle),

	DEF(SET_STR, imap_urlauth_host),
	DEF(SET_IN_PORT, imap_urlauth_port),

	SETTING_DEFINE_LIST_END
};

const struct imap_urlauth_worker_settings imap_urlauth_worker_default_settings = {
	.verbose_proctitle = FALSE,

	.imap_urlauth_host = "",
	.imap_urlauth_port = 143
};

static const struct setting_parser_info *imap_urlauth_worker_setting_dependencies[] = {
Beispiel #22
0
	.service_count = 0,
	.idle_kill = 0,
	.vsz_limit = (uoff_t)-1,

	.unix_listeners = { { &lmtp_unix_listeners_buf,
			      sizeof(lmtp_unix_listeners[0]) } },
	.fifo_listeners = ARRAY_INIT,
	.inet_listeners = ARRAY_INIT
};

#undef DEF
#define DEF(type, name) \
	{ type, #name, offsetof(struct lmtp_settings, name), NULL }

static const struct setting_define lmtp_setting_defines[] = {
	DEF(SET_BOOL, lmtp_proxy),
	DEF(SET_BOOL, lmtp_save_to_detail_mailbox),

	SETTING_DEFINE_LIST_END
};

static const struct lmtp_settings lmtp_default_settings = {
	.lmtp_proxy = FALSE,
	.lmtp_save_to_detail_mailbox = FALSE
};

static const struct setting_parser_info *lmtp_setting_dependencies[] = {
	&lda_setting_parser_info,
	NULL
};
#include "lib.h"
#include "settings-parser.h"
#include "mail-storage-settings.h"
#include "pop3c-settings.h"

#include <stddef.h>

#undef DEF
#define DEF(type, name) \
	{ type, #name, offsetof(struct pop3c_settings, name), NULL }

static bool pop3c_settings_check(void *_set, pool_t pool, const char **error_r);

static const struct setting_define pop3c_setting_defines[] = {
	DEF(SET_STR, pop3c_host),
	DEF(SET_UINT, pop3c_port),

	DEF(SET_STR_VARS, pop3c_user),
	DEF(SET_STR_VARS, pop3c_master_user),
	DEF(SET_STR, pop3c_password),

	DEF(SET_ENUM, pop3c_ssl),
	DEF(SET_BOOL, pop3c_ssl_verify),

	DEF(SET_STR, pop3c_rawlog_dir),
	DEF(SET_BOOL, pop3c_quick_received_date),

	SETTING_DEFINE_LIST_END
};
Beispiel #24
0
static int libx_stat(L) {
	const char *name = kstr_of(l, ymd_argv(l, 0))->land;
	struct stat x;
	memset(&x, 0, sizeof(x));
	if (lstat(name, &x) < 0)
		return 0;
	ymd_hmap(l, 16);
#define DEF(mem) ymd_int(l, x. mem); ymd_def(l, #mem)
	DEF(st_dev);
	DEF(st_ino);
	DEF(st_mode);
	DEF(st_nlink);
	DEF(st_uid);
	DEF(st_gid);
	DEF(st_rdev);
	DEF(st_size);
	DEF(st_atime);
	DEF(st_mtime);
	DEF(st_ctime);
	DEF(st_blksize);
	DEF(st_blocks);
#undef DEF
	return 1;
}
Beispiel #25
0
	.unix_listeners = { { &imap_unix_listeners_buf,
			      sizeof(imap_unix_listeners[0]) } },
	.fifo_listeners = ARRAY_INIT,
	.inet_listeners = ARRAY_INIT
};

#undef DEF
#undef DEFLIST
#define DEF(type, name) \
	{ type, #name, offsetof(struct imap_settings, name), NULL }
#define DEFLIST(field, name, defines) \
	{ SET_DEFLIST, name, offsetof(struct imap_settings, field), defines }

static const struct setting_define imap_setting_defines[] = {
	DEF(SET_BOOL, verbose_proctitle),

	DEF(SET_SIZE, imap_max_line_length),
	DEF(SET_TIME, imap_idle_notify_interval),
	DEF(SET_STR, imap_capability),
	DEF(SET_STR, imap_client_workarounds),
	DEF(SET_STR, imap_logout_format),
	DEF(SET_STR, imap_id_send),
	DEF(SET_STR, imap_id_log),

	DEF(SET_STR, imap_urlauth_host),
	DEF(SET_UINT, imap_urlauth_port),

	SETTING_DEFINE_LIST_END
};
Beispiel #26
0
//FIXME the following could be optimized too ...
static void DEF(put_no_rnd_pixels16_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
    DEF(put_no_rnd_pixels8_x2)(block  , pixels  , line_size, h);
    DEF(put_no_rnd_pixels8_x2)(block+8, pixels+8, line_size, h);
}
	.service_count = 0,
	.idle_kill = 0,
	.vsz_limit = (uoff_t)-1,

	.unix_listeners = { { &ssl_params_unix_listeners_buf,
			      sizeof(ssl_params_unix_listeners[0]) } },
	.fifo_listeners = ARRAY_INIT,
	.inet_listeners = ARRAY_INIT
};

#undef DEF
#define DEF(type, name) \
	{ type, #name, offsetof(struct ssl_params_settings, name), NULL }

static const struct setting_define ssl_params_setting_defines[] = {
	DEF(SET_TIME, ssl_parameters_regenerate),

	SETTING_DEFINE_LIST_END
};

static const struct ssl_params_settings ssl_params_default_settings = {
	.ssl_parameters_regenerate = 3600*24*7
};

const struct setting_parser_info ssl_params_setting_parser_info = {
	.module_name = "ssl-params",
	.defines = ssl_params_setting_defines,
	.defaults = &ssl_params_default_settings,

	.type_offset = (size_t)-1,
	.struct_size = sizeof(struct ssl_params_settings),
Beispiel #28
0
static void DEF(avg_pixels16_xy2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
    DEF(avg_pixels8_xy2)(block  , pixels  , line_size, h);
    DEF(avg_pixels8_xy2)(block+8, pixels+8, line_size, h);
}
	.service_count = 1,
	.idle_kill = 0,
	.vsz_limit = (uoff_t)-1,

	.unix_listeners = { { &imap_urlauth_unix_listeners_buf,
			      sizeof(imap_urlauth_unix_listeners[0]) } },
	.fifo_listeners = ARRAY_INIT,
	.inet_listeners = ARRAY_INIT
};

#undef DEF
#define DEF(type, name) \
	{ type, #name, offsetof(struct imap_urlauth_settings, name), NULL }

static const struct setting_define imap_urlauth_setting_defines[] = {
	DEF(SET_STR, base_dir),

	DEF(SET_BOOL, mail_debug),

	DEF(SET_BOOL, verbose_proctitle),

	DEF(SET_STR, imap_urlauth_logout_format),
	DEF(SET_STR, imap_urlauth_submit_user),
	DEF(SET_STR, imap_urlauth_stream_user),

	SETTING_DEFINE_LIST_END
};

const struct imap_urlauth_settings imap_urlauth_default_settings = {
	.base_dir = PKG_RUNDIR,
  .mail_debug = FALSE,
Beispiel #30
0
void init_defs(void) {
  DEF("dent_set", 8, "DEF_FN DENT_TYPE ! DENT_NAME ! DENT_PARAM !", 43);
  DEF("dent+", 5, "W+ W+ W+ W+ W+", 14);
  DEF("dent_next", 9, "DICT_HEAD @ PENT_PREV ! HEAP_NEXT @ DICT_HEAD ! HEAP_NEXT @ dent+ HEAP_NEXT !", 77);
  DEF("def", 3, "dent_set dent_next", 18);
}