File: loadsave.h

package info (click to toggle)
xmorph 1%3A20060817
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 5,688 kB
  • ctags: 2,022
  • sloc: ansic: 19,988; sh: 9,418; cpp: 1,230; makefile: 560; sed: 16
file content (39 lines) | stat: -rw-r--r-- 746 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39

/* load/save hooks  */ 

gboolean save_session(int lp,
		      const char *file);

gboolean load_session(int lp,
		      const char *file);

gboolean save_as_ppm(gchar *file,GdkPixbuf * pb);

gboolean save_image_to_file(int lp,
			    const char *file);

gboolean save_pixbuf_to_file(const char *file,
			     GdkPixbuf * pb);


static inline gchar *extension(const gchar *file )
{
  int len=strlen(file);
  len--;
  while(len>0) {
    if(file[len]=='.')      
      return ((gchar *)file)+len+1;
    len--;
  }
  return NULL;
}
static inline int cmp_extension(const gchar *file,
				const gchar *ext)
{
  int len=strlen(file), l=strlen(ext);
  if(len<l)
    return 2;
  if(file[len-l-1] != '.')
    return 3;
  return strcmp(file+len-l,ext);
}