pike.git
/
src
/
program.c
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/program.c:7390:
if (file) { add_ref(file); return file; } } return NULL; }
-
static char *make_plain_file (
char
*file, size
_
t
len
,
INT32 shift,
int malloced)
+
static char *make_plain_file (
struct
pike
_
string
*filename
, int malloced)
{ static char buf[1000];
-
+
char *file = filename->str;
+
size_t len = filename->len;
+
INT32 shift = filename->size_shift;
+
if(shift) { size_t bufsize; char *buffer; PCHARP from=MKPCHARP(file, shift); size_t ptr=0; if (malloced) {
-
bufsize = len +
1
;
+
bufsize = len +
21
;
buffer = malloc (bufsize); } else { bufsize = NELEM(buf) - 1; buffer = buf; } for (; len--; INC_PCHARP(from, 1)) { size_t space;
pike.git/src/program.c:7471:
PMOD_EXPORT char *low_get_program_line_plain(struct program *prog, INT_TYPE *linep, int malloced) { *linep = 0; if (prog->linenumbers) { struct pike_string *file; FIND_PROGRAM_LINE (prog, file, (*linep)); if (file)
-
return make_plain_file(file
->str
,
file->len, file->size_shift,
malloced);
+
return make_plain_file(file, malloced);
} return NULL; } /* Returns the file where the program is defined. The line of the * class start is written to linep, or 0 if the program is the top * level of the file. */ PMOD_EXPORT struct pike_string *get_program_line(struct program *prog, INT_TYPE *linep)
pike.git/src/program.c:7588:
CHECK_FILE_ENTRY (Pike_compiler->new_program, strno); file = prog->strings[strno]; } off+=get_small_number(&cnt); if(off > offset) break; line+=get_small_number(&cnt); } linep[0]=line; if (file)
-
return make_plain_file(file
->str
,
file->len, file->size_shift,
malloced);
+
return make_plain_file(file, malloced);
} } return NULL; } #ifdef PIKE_DEBUG /* Variants for convenient use from a debugger. */ void gdb_program_line (struct program *prog)