Commit 119ffdd2 authored by Darin Adler's avatar Darin Adler

Take const char *, not char *.

	* rsvg.h:
	* rsvg.c: (rsvg_pixbuf_from_file), (rsvg_pixbuf_from_file_at_zoom),
	(rsvg_pixbuf_from_file_at_size): Take const char *, not char *.

	* test-rsvg.c: (main): Remove unneeded casts. Restore the error
	message for the case when the parser doesn't parse anything.
parent 33742823
2001-09-24 Darin Adler <darin@bentspoon.com>
* rsvg.h:
* rsvg.c: (rsvg_pixbuf_from_file), (rsvg_pixbuf_from_file_at_zoom),
(rsvg_pixbuf_from_file_at_size): Take const char *, not char *.
* test-rsvg.c: (main): Remove unneeded casts. Restore the error
message for the case when the parser doesn't parse anything.
2001-09-24 Darin Adler <darin@bentspoon.com>
* rsvg.c: (rsvg_entity_decl): Change so it can handle a NULL
......
......@@ -1605,8 +1605,8 @@ rsvg_size_callback (gint *width,
* Return value: A newly allocated #GdkPixbuf, or %NULL
**/
GdkPixbuf *
rsvg_pixbuf_from_file (gchar *file_name,
GError **error)
rsvg_pixbuf_from_file (const gchar *file_name,
GError **error)
{
return rsvg_pixbuf_from_file_at_size (file_name, -1, -1, error);
}
......@@ -1627,10 +1627,10 @@ rsvg_pixbuf_from_file (gchar *file_name,
* Return value: A newly allocated #GdkPixbuf, or %NULL
**/
GdkPixbuf *
rsvg_pixbuf_from_file_at_zoom (gchar *file_name,
double x_zoom,
double y_zoom,
GError **error)
rsvg_pixbuf_from_file_at_zoom (const gchar *file_name,
double x_zoom,
double y_zoom,
GError **error)
{
FILE *f;
char chars[10];
......@@ -1681,10 +1681,10 @@ rsvg_pixbuf_from_file_at_zoom (gchar *file_name,
* Return value: A newly allocated #GdkPixbuf, or %NULL
**/
GdkPixbuf *
rsvg_pixbuf_from_file_at_size (gchar *file_name,
gint width,
gint height,
GError **error)
rsvg_pixbuf_from_file_at_size (const gchar *file_name,
gint width,
gint height,
GError **error)
{
FILE *f;
char chars[10];
......
......@@ -59,13 +59,13 @@ GdkPixbuf *rsvg_handle_get_pixbuf (RsvgHandle *handle);
void rsvg_handle_free (RsvgHandle *handle);
/* convenience API */
GdkPixbuf *rsvg_pixbuf_from_file (gchar *file_name,
GdkPixbuf *rsvg_pixbuf_from_file (const gchar *file_name,
GError **error);
GdkPixbuf *rsvg_pixbuf_from_file_at_zoom (gchar *file_name,
GdkPixbuf *rsvg_pixbuf_from_file_at_zoom (const gchar *file_name,
double x_zoom,
double y_zoom,
GError **error);
GdkPixbuf *rsvg_pixbuf_from_file_at_size (gchar *file_name,
GdkPixbuf *rsvg_pixbuf_from_file_at_size (const gchar *file_name,
gint width,
gint height,
GError **error);
......
......@@ -33,7 +33,7 @@
int
main (int argc, char **argv)
main (int argc, const char **argv)
{
GdkPixbuf *pixbuf;
char *x_zoom_str = "1.0";
......@@ -50,16 +50,20 @@ main (int argc, char **argv)
g_type_init ();
optCtx = poptGetContext ("test-rsvg", argc, (const char **)argv, optionsTable, 0);
optCtx = poptGetContext ("test-rsvg", argc, argv, optionsTable, 0);
c = poptGetNextOpt (optCtx);
args = poptGetArgs (optCtx);
pixbuf = rsvg_pixbuf_from_file_at_zoom ((char *)args[0],
pixbuf = rsvg_pixbuf_from_file_at_zoom (args[0],
atof (x_zoom_str),
atof (y_zoom_str),
NULL);
if (pixbuf)
gdk_pixbuf_save (pixbuf, args[1], "png", NULL, NULL);
else {
fprintf (stderr, "Error loading SVG file.\n");
return 1;
}
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment