示例#1
0
static void
ase_metric_prnt(Lisp_Object obj, Lisp_Object pcf, int unused)
{
	EMOD_ASE_DEBUG_METR("m:0x%08x@0x%08x (rc:%d)\n",
			    (unsigned int)(XASE_METRIC(obj)),
			    (unsigned int)obj, 1);
	write_c_string("#<", pcf);
	print_internal(XDYNACAT_TYPE(obj), pcf, unused);
	{
		if (NILP(XASE_METRIC_LDIST(obj))) {
			write_hex_ptr(XASE_METRIC_DIST(obj),pcf);
		} else {
			Lisp_Object ldist = XASE_METRIC_LDIST(obj);
			if (SYMBOLP(ldist)) {
				Lisp_String *name =
					symbol_name(XSYMBOL(ldist));
				write_fmt_string(pcf, " #'%s", string_data(name));
			} else if (SUBRP(ldist)) {
				const char *name = subr_name(XSUBR(ldist));
				write_fmt_string(pcf, " #'%s", name);
			} else {
				write_c_string(" #'(lambda ...)", pcf);
			}
		}
	}
	write_c_string(">", pcf);
	return;
}
示例#2
0
文件: eldap.c 项目: hroptatyr/sxemacs
static void
print_ldap(Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
{
	char buf[32];

	Lisp_LDAP *ldap = XLDAP(obj);

	if (print_readably)
		error("printing unreadable object #<ldap %s>",
		      XSTRING_DATA(ldap->host));

	write_c_string("#<ldap ", printcharfun);
	print_internal(ldap->host, printcharfun, 1);
	if (!ldap->ld)
		write_c_string("(dead) ", printcharfun);
	write_fmt_string(printcharfun, " 0x%lx>", (long)ldap);
}
示例#3
0
static void
ase_cartesian_prnt(Lisp_Object obj, Lisp_Object pcf, int unused)
{
	EMOD_ASE_DEBUG_CART("n:0x%08x@0x%08x (rc:%d)\n",
			    (unsigned int)(XASE_CARTESIAN(obj)),
			    (unsigned int)obj, 1);
	write_c_string("#<", pcf);
	print_internal(XDYNACAT_TYPE(obj), pcf, unused);
	if (!NILP(XASE_CARTESIAN_INTERIOR_TYPE(obj))) {
		print_internal(XASE_CARTESIAN_INTERIOR_TYPE(obj), pcf, unused);
	}
	write_fmt_str(pcf, " of dimension %d, ",
		      XASE_CARTESIAN_DIMENSION(obj));
	_ase_cartesian_prnt(XASE_CARTESIAN(obj), pcf);

	write_c_string(">", pcf);
}
示例#4
0
static int	
write_func_as_strings(FILE *file, FileFuncInfo funcInfo)
{
    char	recVarName[256];
    char	ptrVarName[256];
    char	*funcNamePtr = NULL;

    funcNamePtr = funcInfo->funcName;
    if (strncmp(funcNamePtr, "dtb_", 4) == 0)
    {
	funcNamePtr += 4;
    }
    sprintf(recVarName, "%%abmfP_lrc_%s", funcNamePtr);
    sprintf(ptrVarName, "%%abmfP_lib_%s", funcNamePtr);

    abio_puts(file, "\n");
    abio_puts(file,   "/*\n");
    abio_printf(file, " * %s\n", ptrVarName);
    abio_puts(file,   " */\n");

    abio_printf(file, "static LibFuncRec %s = \n", recVarName);
    abio_printf(file, "{\n");
    abio_indent(file);

    abio_puts(file, "/* name */\n");
    write_c_string(file, funcInfo->funcName);
    abio_puts(file, ",\n");
    abio_puts(file, "\n");

    abio_printf(file, "/* proto */\n");
    write_c_string(file, funcInfo->funcProto);
    abio_puts(file, ",\n");
    abio_puts(file, "\n");

    abio_printf(file, "/* def */\n");
    write_c_string(file, funcInfo->funcCode);

    abio_puts(file, "\n");
    abio_outdent(file);
    abio_printf(file, "}; /* %s */\n", recVarName);

    abio_printf(file, "LibFunc %s = &(%s);\n", 
	ptrVarName, recVarName);
    return 0;
}
示例#5
0
static void
sound_oss_print(Lisp_Object device, Lisp_Object pcfun, int ef)
{
	sound_oss_data_t *sod = NULL;

	sod = get_audio_device_data(device);
	/* cannot use incomplete or corrupt audio devices */
	if (XAUDIO_DEVICE_DRIVER(device) != MYSELF || sod == NULL) {
		write_c_string(" VOID", pcfun);
		/* now that we are here, mark AO device as dead */
		XAUDIO_DEVICE_STATE(device) = ASTATE_DEAD;
		return;
	}

	/* info about the connected output plugin */
	write_c_string(" :device ", pcfun);
	if (NILP(sod->device))
		write_c_string("\"/dev/dsp\"", pcfun);
	else
		print_internal(sod->device, pcfun, ef);

	if (sod->lock) {
		write_c_string(" :busy t", pcfun);
	} else
		write_c_string(" :busy nil", pcfun);

	if (sod->keep_open) {
		write_c_string(" :keep-open t", pcfun);
	} else
		write_c_string(" :keep-open nil", pcfun);

	return;
}
示例#6
0
static void
bigc_print(Lisp_Object obj, Lisp_Object printcharfun, int SXE_UNUSED(escapeflag))
{
	Bufbyte *fstr = bigc_to_string(XBIGC_DATA(obj), 10);
	write_c_string((char*)fstr, printcharfun);
	xfree(fstr);
	fstr = (Bufbyte *)NULL;
	return;
}
示例#7
0
static void
gtk_print_font_instance (struct Lisp_Font_Instance *f,
			 Lisp_Object printcharfun,
			 int escapeflag)
{
  char buf[200];
  sprintf (buf, " 0x%lx", (unsigned long) gdk_font_id (FONT_INSTANCE_GTK_FONT (f)));
  write_c_string (buf, printcharfun);
}
示例#8
0
static void
print_database (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
{
  char buf[64];
  Lisp_Database *db = XDATABASE (obj);

  if (print_readably)
    error ("printing unreadable object #<database 0x%x>", db->header.uid);

  write_c_string ("#<database \"", printcharfun);
  print_internal (db->fname, printcharfun, 0);
  sprintf (buf, "\" (%s/%s/%s) 0x%x>",
	   (char *) string_data (XSYMBOL (db->funcs->get_type (db))->name),
	   (char *) string_data (XSYMBOL (db->funcs->get_subtype (db))->name),
	   (!DATABASE_LIVE_P (db)    ? "closed"    :
	    (db->access_ & O_WRONLY) ? "writeonly" :
	    (db->access_ & O_RDWR)   ? "readwrite" : "readonly"),
	   db->header.uid);
  write_c_string (buf, printcharfun);
}
示例#9
0
static void
gtk_print_color_instance (struct Lisp_Color_Instance *c,
			  Lisp_Object printcharfun,
			  int escapeflag)
{
  char buf[100];
  GdkColor *color = COLOR_INSTANCE_GTK_COLOR (c);
  sprintf (buf, " %ld=(%X,%X,%X)",
	   color->pixel, color->red, color->green, color->blue);
  write_c_string (buf, printcharfun);
}
示例#10
0
static void
print_device (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
{
  struct device *d = XDEVICE (obj);
  char buf[256];

  if (print_readably)
    error ("printing unreadable object #<device %s 0x%x>",
	   XSTRING_DATA (d->name), d->header.uid);

  sprintf (buf, "#<%s-device", !DEVICE_LIVE_P (d) ? "dead" :
	   DEVICE_TYPE_NAME (d));
  write_c_string (buf, printcharfun);
  if (DEVICE_LIVE_P (d) && !NILP (DEVICE_CONNECTION (d)))
    {
      write_c_string (" on ", printcharfun);
      print_internal (DEVICE_CONNECTION (d), printcharfun, 1);
    }
  sprintf (buf, " 0x%x>", d->header.uid);
  write_c_string (buf, printcharfun);
}
示例#11
0
static void
sound_nas_print(Lisp_Object device, Lisp_Object pcfun, int ef)
{
	sound_nas_data_t *snd = NULL;

	snd = get_audio_device_data(device);

	/* cannot use incomplete or corrupt audio devices */
	if (XAUDIO_DEVICE_DRIVER(device) != MYSELF || snd == NULL) {
		write_c_string(" VOID", pcfun);
		/* now that we are here, mark AO device as dead */
		XAUDIO_DEVICE_STATE(device) = ASTATE_DEAD;
		return;
	}

	/* info about the connected output plugin */
	write_c_string(" :server ", pcfun);
	if (snd->aud && snd->aud->server_name)
		write_c_string(snd->aud->server_name, pcfun);
	else
		write_c_string("#unknown", pcfun);

	write_c_string(" :server-handle ", pcfun);
	if (snd->aud == NULL)
		write_c_string("#b0rked", pcfun);
	else
		write_fmt_str(pcfun, "0x%x", (unsigned int)snd->aud);

	return;
}
示例#12
0
static void
sound_ao_print(Lisp_Object device, Lisp_Object pcfun, int ef)
{
	sound_ao_data_t *saod = NULL;

	saod = get_audio_device_data(device);
	/* cannot use AO on incomplete or corrupt audio devices */
	if (XAUDIO_DEVICE_DRIVER(device) != MYSELF || saod == NULL) {
		write_c_string("VOID", pcfun);
		/* now that we are here, mark AO device as dead */
		XAUDIO_DEVICE_STATE(device) = ASTATE_DEAD;
		return;
	}

	/* info about the connected output plugin */
	write_c_string(" :driver \"", pcfun);
	write_c_string(ao_driver_info(saod->driver_id)->short_name, pcfun);
	write_c_string("\"", pcfun);

	if (ef);
	return;
}
示例#13
0
static void
_ase_cartesian_prnt(ase_cartesian_t n, Lisp_Object pcf)
{
	Lisp_Object *objs;
	int i;

	objs = n->objects;
	for (i = 0; i < n->dimension; i++) {
		Lisp_Object obji = objs[i];
		if (!_ase_cartesian_prnt_ase_object(obji, pcf)) {
			print_internal(objs[i], pcf, 0);
		}
		if (i+1 < n->dimension)
			write_c_string(" x ", pcf);
	}
}