Mercurial > ~dholland > hg > tradcpp > index.cgi
comparison place.c @ 14:5045b9678bb0
woops
author | David A. Holland |
---|---|
date | Sun, 19 Dec 2010 19:51:36 -0500 |
parents | 120629a5d6bf |
children | 8a955e3dda2c |
comparison
equal
deleted
inserted
replaced
13:120629a5d6bf | 14:5045b9678bb0 |
---|---|
4 #include <stdlib.h> | 4 #include <stdlib.h> |
5 | 5 |
6 #include "utils.h" | 6 #include "utils.h" |
7 #include "array.h" | 7 #include "array.h" |
8 #include "place.h" | 8 #include "place.h" |
9 | |
10 #define NOWHERE_LINE 0 | |
11 #define BUILTIN_LINE 1 | |
12 #define COMMANDLINE_LINE 2 | |
13 | 9 |
14 struct placefile { | 10 struct placefile { |
15 struct place includedfrom; | 11 struct place includedfrom; |
16 char *name; | 12 char *name; |
17 bool fromsystemdir; | 13 bool fromsystemdir; |
79 p->line = num; | 75 p->line = num; |
80 p->column = 1; | 76 p->column = 1; |
81 } | 77 } |
82 | 78 |
83 void | 79 void |
84 place_setcommandline(struct place *p, unsigned column) | 80 place_setcommandline(struct place *p, unsigned line, unsigned column) |
85 { | 81 { |
82 p->type = P_COMMANDLINE; | |
86 p->file = NULL; | 83 p->file = NULL; |
87 p->line = COMMANDLINE_LINE; | 84 p->line = line; |
88 p->column = column; | 85 p->column = column; |
86 } | |
87 | |
88 void | |
89 place_setfilestart(struct place *p, const struct placefile *pf) | |
90 { | |
91 p->type = P_COMMANDLINE; | |
92 p->file = pf; | |
93 p->line = 1; | |
94 p->column = 1; | |
89 } | 95 } |
90 | 96 |
91 static | 97 static |
92 const char * | 98 const char * |
93 place_getname(const struct place *p) | 99 place_getname(const struct place *p) |