Example #1
0
void vpm_frontend_init(void) {
  /* clear all core options */
  memset(&options,0,sizeof(options));
#if MAMEVER < 6100
  /* directly define these */
  options.use_emulated_ym3812 = 1;
#endif /* MAMEVER */
  /* create the rc object */
  if (!(rc = rc_create()))
    { fprintf (stderr, "error on rc creation\n"); exit(1); }
  if (rc_register(rc, opts))
    { fprintf (stderr, "error on registering opts\n"); exit(1); }
  /* need a decent default for debug width/height */
  if (options.debug_width == 0)  options.debug_width = 640;
  if (options.debug_height == 0) options.debug_height = 480;
#if MAMEVER >= 6100
  options.debug_depth = 8; // Debugger only works with 8 bits?
#endif /* MAMEVER */
  options.gui_host = 1;
//#ifdef MAME_DEBUG
//  options.mame_debug = 1;
//#endif /* MAME_DEBUG */
#if (defined(DEBUG) || defined(_DEBUG))
  set_option("log","1",0);
#endif /* DEBUG */
}
Example #2
0
struct rc_struct *cli_rc_create(void)
{
	struct rc_struct *result;

	result = rc_create();
	if (!result)
		return NULL;

	if (rc_register(result, opts))
	{
		rc_destroy(result);
		return NULL;
	}

	return result;
}
Example #3
0
int
option_dereference(struct option **dest, const char *file, int line)
{
	if (!dest)
	        return DHCP_R_INVALIDARG;

	if (!*dest) {
#if defined (POINTER_DEBUG)
	        log_fatal("%s(%d): dereference of null pointer!", file, line);
#else
	        return DHCP_R_INVALIDARG;
#endif
	}

	if ((*dest)->refcnt <= 0) {
#if defined (POINTER_DEBUG)
	        log_fatal("%s(%d): dereference of <= 0 refcnt!", file, line);
#else
	        return DHCP_R_INVALIDARG;
#endif
	}

	(*dest)->refcnt--;

	rc_register(file, line, dest, (*dest), (*dest)->refcnt, 1, RC_MISC);

	if ((*dest)->refcnt == 0) {
		/* The option name may be packed in the same alloc as the
		 * option structure.
		 */
	        if ((char *) (*dest)->name != (char *) ((*dest) + 1))
	                dfree((char *) (*dest)->name, file, line);

		/* It's either a user-configured format (allocated), or the
		 * default static format.
		 */
		if (((*dest)->format != NULL) &&
		    ((*dest)->format != default_option_format)) {
			dfree((char *) (*dest)->format, file, line);
		}

	        dfree(*dest, file, line);
	}

	*dest = NULL;
	return ISC_R_SUCCESS;
}
Example #4
0
/* Must match hash_reference/dereference types in omapip/hash.h. */
int
option_reference(struct option **dest, struct option *src,
	         const char * file, int line)
{
	if (!dest || !src)
	        return DHCP_R_INVALIDARG;

	if (*dest) {
#if defined(POINTER_DEBUG)
	        log_fatal("%s(%d): reference store into non-null pointer!",
	                  file, line);
#else
	        return DHCP_R_INVALIDARG;
#endif
	}

	*dest = src;
	src->refcnt++;
	rc_register(file, line, dest, src, src->refcnt, 0, RC_MISC);
	return(ISC_R_SUCCESS);
}