Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
G
geany
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
geany
Commits
53f83e7c
Kaydet (Commit)
53f83e7c
authored
Eki 11, 2016
tarafından
Jiří Techet
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
read: add lineFposMap
üst
ed03c204
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
4 deletions
+39
-4
read.c
ctags/main/read.c
+39
-4
No files found.
ctags/main/read.c
Dosyayı görüntüle @
53f83e7c
...
...
@@ -151,10 +151,8 @@ extern MIOPos getInputFilePosition (void)
extern
MIOPos
getInputFilePositionForLine
(
int
line
)
{
MIOPos
pos
;
return
pos
;
/* return File.lineFposMap.pos[(((File.lineFposMap.count > (line - 1)) \
&& (line > 0))? (line - 1): 0)];*/
return
File
.
lineFposMap
.
pos
[(((
File
.
lineFposMap
.
count
>
(
line
-
1
))
\
&&
(
line
>
0
))
?
(
line
-
1
)
:
0
)];
}
extern
langType
getInputLanguage
(
void
)
...
...
@@ -244,6 +242,41 @@ extern void freeInputFileResources (void)
freeInputFileInfo
(
&
File
.
source
);
}
/*
* inputLineFposMap related functions
*/
static
void
freeLineFposMap
(
inputLineFposMap
*
lineFposMap
)
{
if
(
lineFposMap
->
pos
)
{
free
(
lineFposMap
->
pos
);
lineFposMap
->
pos
=
NULL
;
lineFposMap
->
count
=
0
;
lineFposMap
->
size
=
0
;
}
}
static
void
allocLineFposMap
(
inputLineFposMap
*
lineFposMap
)
{
#define INITIAL_lineFposMap_LEN 256
lineFposMap
->
pos
=
xCalloc
(
INITIAL_lineFposMap_LEN
,
MIOPos
);
lineFposMap
->
size
=
INITIAL_lineFposMap_LEN
;
lineFposMap
->
count
=
0
;
}
static
void
appendLineFposMap
(
inputLineFposMap
*
lineFposMap
,
MIOPos
pos
)
{
if
(
lineFposMap
->
size
==
lineFposMap
->
count
)
{
lineFposMap
->
size
*=
2
;
lineFposMap
->
pos
=
xRealloc
(
lineFposMap
->
pos
,
lineFposMap
->
size
,
MIOPos
);
}
lineFposMap
->
pos
[
lineFposMap
->
count
]
=
pos
;
lineFposMap
->
count
++
;
}
/*
* Input file access functions
*/
...
...
@@ -540,6 +573,7 @@ extern bool openInputFile (const char *const fileName, const langType language,
setSourceFileParameters
(
vStringNewInit
(
fileName
),
language
);
File
.
source
.
lineNumberOrigin
=
0L
;
File
.
source
.
lineNumber
=
File
.
source
.
lineNumberOrigin
;
allocLineFposMap
(
&
File
.
lineFposMap
);
verbose
(
"OPENING %s as %s language %sfile
\n
"
,
fileName
,
getLanguageName
(
language
),
...
...
@@ -580,6 +614,7 @@ extern void closeInputFile (void)
}
mio_free
(
File
.
mio
);
File
.
mio
=
NULL
;
freeLineFposMap
(
&
File
.
lineFposMap
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment