File: Panel.c

package info (click to toggle)
grass 6.0.2-6
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 40,044 kB
  • ctags: 31,303
  • sloc: ansic: 321,125; tcl: 25,676; sh: 11,176; cpp: 10,098; makefile: 5,025; fortran: 1,846; yacc: 493; lex: 462; perl: 133; sed: 1
file content (53 lines) | stat: -rw-r--r-- 851 bytes parent folder | download | duplicates (2)
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include "raster.h"
#include "graph.h"

int R_panel_save(char *name, int t,int b,int l,int r)
{
	int z ;
	int num ;

/* make sure this file can be written by anybody */
	num = umask(0);
	close(creat(name,0666));
	umask(num);

	_send_ident(PANEL_SAVE) ;
	_send_text(name) ;
	z = t ;
	_send_int(&z) ;
	z = b ;
	_send_int(&z) ;
	z = l ;
	_send_int(&z) ;
	z = r ;
	_send_int(&z) ;
	R_stabilize();

	return 0;
}

int R_panel_restore(char *name )
{
	_send_ident(PANEL_RESTORE) ;
	_send_text(name) ;
	R_stabilize();

	return 0;
}

int R_panel_delete(char *name )
{
	_send_ident(PANEL_DELETE) ;
	_send_text(name) ;

/* first make sure that driver is done with file */
	R_stabilize();
/* now delete the file, in case driver couldn't or didn't */
	unlink (name);

	return 0;
}