changeset 14:5045b9678bb0

woops
author David A. Holland
date Sun, 19 Dec 2010 19:51:36 -0500
parents 120629a5d6bf
children f6177d3ed5c2
files main.c place.c place.h
diffstat 3 files changed, 16 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/main.c	Sun Dec 19 19:49:43 2010 -0500
+++ b/main.c	Sun Dec 19 19:51:36 2010 -0500
@@ -912,7 +912,7 @@
 		if (argv[i][0] != '-') {
 			break;
 		}
-		place_setcommandline(&cmdplace, i);
+		place_setcommandline(&cmdplace, i, 1);
 		if (check_flag_option(argv[i]+1)) {
 			continue;
 		}
@@ -922,7 +922,7 @@
 		if (check_prefix_option(&cmdplace, argv[i]+1)) {
 			continue;
 		}
-		place_setcommandline(&cmdplace, i+1);
+		place_setcommandline(&cmdplace, i+1, 1);
 		if (check_arg_option(argv[i]+1, &cmdplace, argv[i+1])) {
 			i++;
 			continue;
--- a/place.c	Sun Dec 19 19:49:43 2010 -0500
+++ b/place.c	Sun Dec 19 19:51:36 2010 -0500
@@ -7,10 +7,6 @@
 #include "array.h"
 #include "place.h"
 
-#define NOWHERE_LINE      0
-#define BUILTIN_LINE      1
-#define COMMANDLINE_LINE  2
-
 struct placefile {
 	struct place includedfrom;
 	char *name;
@@ -81,13 +77,23 @@
 }
 
 void
-place_setcommandline(struct place *p, unsigned column)
+place_setcommandline(struct place *p, unsigned line, unsigned column)
 {
+	p->type = P_COMMANDLINE;
 	p->file = NULL;
-	p->line = COMMANDLINE_LINE;
+	p->line = line;
 	p->column = column;
 }
 
+void
+place_setfilestart(struct place *p, const struct placefile *pf)
+{
+	p->type = P_COMMANDLINE;
+	p->file = pf;
+	p->line = 1;
+	p->column = 1;
+}
+
 static
 const char *
 place_getname(const struct place *p)
--- a/place.h	Sun Dec 19 19:49:43 2010 -0500
+++ b/place.h	Sun Dec 19 19:51:36 2010 -0500
@@ -17,7 +17,8 @@
 
 void place_setnowhere(struct place *p);
 void place_setbuiltin(struct place *p, unsigned num);
-void place_setcommandline(struct place *p, unsigned word);
+void place_setcommandline(struct place *p, unsigned word, unsigned column);
+void place_setfilestart(struct place *p, const struct placefile *pf);
 
 const struct placefile *place_addfile(const struct place *incplace,
 				      const char *name, bool fromsystemdir);