mirror of
				https://gitlab.freedesktop.org/wayland/wayland.git
				synced 2025-11-03 09:01:42 -05:00 
			
		
		
		
	scanner: Fix reported executable name to 'wayland-scanner'
'wayland-scanner -v' (correctly) reports the program as named "wayland-scanner", but 'wayland-scanner -h' was inconsistent, referring to it as './scanner'. Also refactor this and other references to the program name to use a common #define, PROGRAM_NAME. Signed-off-by: Bryce Harrington <bryce@osg.samsung.com> Reviewed-by: Jonas Ådahl <jadahl@gmail.com> Reviewed-by: Yong Bakos <ybakos@humanoriented.com> Tested-by: Yong Bakos <ybakos@humanoriented.com>
This commit is contained in:
		
							parent
							
								
									d588efcbc8
								
							
						
					
					
						commit
						36aeaf037b
					
				
					 1 changed files with 8 additions and 6 deletions
				
			
		| 
						 | 
					@ -42,6 +42,8 @@
 | 
				
			||||||
#if HAVE_LIBXML
 | 
					#if HAVE_LIBXML
 | 
				
			||||||
#include <libxml/parser.h>
 | 
					#include <libxml/parser.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#define PROGRAM_NAME "wayland-scanner"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Embedded wayland.dtd file, see dtddata.S */
 | 
					/* Embedded wayland.dtd file, see dtddata.S */
 | 
				
			||||||
extern char DTD_DATA_begin;
 | 
					extern char DTD_DATA_begin;
 | 
				
			||||||
extern int DTD_DATA_len;
 | 
					extern int DTD_DATA_len;
 | 
				
			||||||
| 
						 | 
					@ -57,8 +59,8 @@ enum side {
 | 
				
			||||||
static int
 | 
					static int
 | 
				
			||||||
usage(int ret)
 | 
					usage(int ret)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	fprintf(stderr, "usage: ./scanner [OPTION] [client-header|server-header|code]"
 | 
						fprintf(stderr, "usage: %s [OPTION] [client-header|server-header|code]"
 | 
				
			||||||
		" [input_file output_file]\n");
 | 
							" [input_file output_file]\n", PROGRAM_NAME);
 | 
				
			||||||
	fprintf(stderr, "\n");
 | 
						fprintf(stderr, "\n");
 | 
				
			||||||
	fprintf(stderr, "Converts XML protocol descriptions supplied on "
 | 
						fprintf(stderr, "Converts XML protocol descriptions supplied on "
 | 
				
			||||||
			"stdin or input file to client\n"
 | 
								"stdin or input file to client\n"
 | 
				
			||||||
| 
						 | 
					@ -76,7 +78,7 @@ usage(int ret)
 | 
				
			||||||
static int
 | 
					static int
 | 
				
			||||||
scanner_version(int ret)
 | 
					scanner_version(int ret)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	fprintf(stderr, "wayland-scanner %s\n", WAYLAND_VERSION);
 | 
						fprintf(stderr, "%s %s\n", PROGRAM_NAME, WAYLAND_VERSION);
 | 
				
			||||||
	exit(ret);
 | 
						exit(ret);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -236,7 +238,7 @@ static void *
 | 
				
			||||||
fail_on_null(void *p)
 | 
					fail_on_null(void *p)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	if (p == NULL) {
 | 
						if (p == NULL) {
 | 
				
			||||||
		fprintf(stderr, "wayland-scanner: out of memory\n");
 | 
							fprintf(stderr, "%s: out of memory\n", PROGRAM_NAME);
 | 
				
			||||||
		exit(EXIT_FAILURE);
 | 
							exit(EXIT_FAILURE);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1467,7 +1469,7 @@ emit_header(struct protocol *protocol, enum side side)
 | 
				
			||||||
	const char *s = (side == SERVER) ? "SERVER" : "CLIENT";
 | 
						const char *s = (side == SERVER) ? "SERVER" : "CLIENT";
 | 
				
			||||||
	char **p, *prev;
 | 
						char **p, *prev;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	printf("/* Generated by wayland-scanner %s */\n\n", WAYLAND_VERSION);
 | 
						printf("/* Generated by %s %s */\n\n", PROGRAM_NAME, WAYLAND_VERSION);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	printf("#ifndef %s_%s_PROTOCOL_H\n"
 | 
						printf("#ifndef %s_%s_PROTOCOL_H\n"
 | 
				
			||||||
	       "#define %s_%s_PROTOCOL_H\n"
 | 
						       "#define %s_%s_PROTOCOL_H\n"
 | 
				
			||||||
| 
						 | 
					@ -1670,7 +1672,7 @@ emit_code(struct protocol *protocol)
 | 
				
			||||||
	struct wl_array types;
 | 
						struct wl_array types;
 | 
				
			||||||
	char **p, *prev;
 | 
						char **p, *prev;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	printf("/* Generated by wayland-scanner %s */\n\n", WAYLAND_VERSION);
 | 
						printf("/* Generated by %s %s */\n\n", PROGRAM_NAME, WAYLAND_VERSION);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (protocol->copyright)
 | 
						if (protocol->copyright)
 | 
				
			||||||
		format_text_to_comment(protocol->copyright, true);
 | 
							format_text_to_comment(protocol->copyright, true);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue