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
52076d19
Kaydet (Commit)
52076d19
authored
Eki 10, 2014
tarafından
Jiří Techet
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Remove unused tm_file_entry.[ch]
üst
26587454
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
1 addition
and
411 deletions
+1
-411
Makefile.am
tagmanager/src/Makefile.am
+0
-2
makefile.win32
tagmanager/src/makefile.win32
+1
-2
tm_file_entry.c
tagmanager/src/tm_file_entry.c
+0
-281
tm_file_entry.h
tagmanager/src/tm_file_entry.h
+0
-124
tm_tagmanager.h
tagmanager/src/tm_tagmanager.h
+0
-1
wscript
wscript
+0
-1
No files found.
tagmanager/src/Makefile.am
Dosyayı görüntüle @
52076d19
...
@@ -23,8 +23,6 @@ tagmanager_include_HEADERS = \
...
@@ -23,8 +23,6 @@ tagmanager_include_HEADERS = \
libtagmanager_a_SOURCES
=
\
libtagmanager_a_SOURCES
=
\
tm_tagmanager.h
\
tm_tagmanager.h
\
tm_parser.h
\
tm_parser.h
\
tm_file_entry.h
\
tm_file_entry.c
\
tm_source_file.h
\
tm_source_file.h
\
tm_source_file.c
\
tm_source_file.c
\
tm_tag.h
\
tm_tag.h
\
...
...
tagmanager/src/makefile.win32
Dosyayı görüntüle @
52076d19
...
@@ -44,8 +44,7 @@ all: $(COMPLIB)
...
@@ -44,8 +44,7 @@ all: $(COMPLIB)
clean
:
clean
:
-
$(RM)
deps.mak
*
.o
$(COMPLIB)
-
$(RM)
deps.mak
*
.o
$(COMPLIB)
$(COMPLIB)
:
tm_workspace.o tm_source_file.o tm_tag.o
\
$(COMPLIB)
:
tm_workspace.o tm_source_file.o tm_tag.o
tm_file_entry.o
$(AR)
rc
$@
$^
$(AR)
rc
$@
$^
$(RANLIB)
$@
$(RANLIB)
$@
...
...
tagmanager/src/tm_file_entry.c
deleted
100644 → 0
Dosyayı görüntüle @
26587454
/*
*
* Copyright (c) 2001-2002, Biswapesh Chattopadhyay
*
* This source code is released for free distribution under the terms of the
* GNU General Public License.
*
*/
#include "general.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <dirent.h>
#ifdef HAVE_FCNTL_H
# include <fcntl.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>
#ifdef HAVE_FNMATCH_H
# include <fnmatch.h>
#endif
#include <glib/gstdio.h>
#include "tm_file_entry.h"
#include "tm_source_file.h"
#define FILE_NEW(T) ((T) = g_slice_new0(TMFileEntry))
#define FILE_FREE(T) g_slice_free(TMFileEntry, (T))
void
tm_file_entry_print
(
TMFileEntry
*
entry
,
gpointer
UNUSED
user_data
,
guint
level
)
{
guint
i
;
g_return_if_fail
(
entry
);
for
(
i
=
0
;
i
<
level
;
++
i
)
fputc
(
'\t'
,
stderr
);
fprintf
(
stderr
,
"%s
\n
"
,
entry
->
name
);
}
gint
tm_file_entry_compare
(
TMFileEntry
*
e1
,
TMFileEntry
*
e2
)
{
g_return_val_if_fail
(
e1
&&
e2
&&
e1
->
name
&&
e2
->
name
,
0
);
#ifdef TM_DEBUG
g_message
(
"Comparing %s and %s"
,
e1
->
name
,
e2
->
name
);
#endif
return
strcmp
(
e1
->
name
,
e2
->
name
);
}
/* TTimo - modified to handle symlinks */
static
TMFileType
tm_file_entry_type
(
const
char
*
path
)
{
struct
stat
s
;
#ifndef G_OS_WIN32
if
(
0
!=
g_lstat
(
path
,
&
s
))
return
tm_file_unknown_t
;
#endif
if
(
S_ISDIR
(
s
.
st_mode
))
return
tm_file_dir_t
;
#ifndef G_OS_WIN32
else
if
(
S_ISLNK
(
s
.
st_mode
))
return
tm_file_link_t
;
#endif
else
if
(
S_ISREG
(
s
.
st_mode
))
return
tm_file_regular_t
;
else
return
tm_file_unknown_t
;
}
static
gboolean
apply_filter
(
const
char
*
name
,
GList
*
match
,
GList
*
unmatch
,
gboolean
ignore_hidden
)
{
GList
*
tmp
;
gboolean
matched
=
(
match
==
NULL
);
g_return_val_if_fail
(
name
,
FALSE
);
if
(
ignore_hidden
&&
(
'.'
==
name
[
0
]))
return
FALSE
;
/* TTimo - ignore .svn directories */
if
(
!
strcmp
(
name
,
".svn"
))
return
FALSE
;
for
(
tmp
=
match
;
tmp
;
tmp
=
g_list_next
(
tmp
))
{
if
(
0
==
fnmatch
((
char
*
)
tmp
->
data
,
name
,
0
))
{
matched
=
TRUE
;
break
;
}
}
if
(
!
matched
)
return
FALSE
;
for
(
tmp
=
unmatch
;
tmp
;
tmp
=
g_list_next
(
tmp
))
{
if
(
0
==
fnmatch
((
char
*
)
tmp
->
data
,
name
,
0
))
{
return
FALSE
;
}
}
return
matched
;
}
TMFileEntry
*
tm_file_entry_new
(
const
char
*
path
,
TMFileEntry
*
parent
,
gboolean
recurse
,
GList
*
file_match
,
GList
*
file_unmatch
,
GList
*
dir_match
,
GList
*
dir_unmatch
,
gboolean
ignore_hidden_files
,
gboolean
ignore_hidden_dirs
)
{
TMFileEntry
*
entry
;
/* GList *tmp; */
char
*
real_path
;
DIR
*
dir
;
struct
dirent
*
dir_entry
;
TMFileEntry
*
new_entry
;
char
*
file_name
;
struct
stat
s
;
char
*
entries
=
NULL
;
g_return_val_if_fail
(
path
!=
NULL
,
NULL
);
/* TTimo - don't follow symlinks */
if
(
tm_file_entry_type
(
path
)
==
tm_file_link_t
)
return
NULL
;
real_path
=
tm_get_real_path
(
path
);
if
(
!
real_path
)
return
NULL
;
FILE_NEW
(
entry
);
entry
->
type
=
tm_file_entry_type
(
real_path
);
entry
->
parent
=
parent
;
entry
->
path
=
real_path
;
entry
->
name
=
strrchr
(
entry
->
path
,
'/'
);
if
(
entry
->
name
)
++
(
entry
->
name
);
else
entry
->
name
=
entry
->
path
;
switch
(
entry
->
type
)
{
case
tm_file_unknown_t
:
g_free
(
real_path
);
FILE_FREE
(
entry
);
return
NULL
;
case
tm_file_link_t
:
case
tm_file_regular_t
:
if
(
parent
&&
!
apply_filter
(
entry
->
name
,
file_match
,
file_unmatch
,
ignore_hidden_files
))
{
tm_file_entry_free
(
entry
);
return
NULL
;
}
break
;
case
tm_file_dir_t
:
if
(
parent
&&
!
(
recurse
&&
apply_filter
(
entry
->
name
,
dir_match
,
dir_unmatch
,
ignore_hidden_dirs
)))
{
tm_file_entry_free
(
entry
);
return
NULL
;
}
file_name
=
g_strdup_printf
(
"%s/CVS/Entries"
,
entry
->
path
);
if
(
0
==
g_stat
(
file_name
,
&
s
))
{
if
(
S_ISREG
(
s
.
st_mode
))
{
int
fd
;
entries
=
g_new
(
char
,
s
.
st_size
+
2
);
if
(
0
>
(
fd
=
open
(
file_name
,
O_RDONLY
)))
{
g_free
(
entries
);
entries
=
NULL
;
}
else
{
off_t
n
=
0
;
off_t
total_read
=
1
;
while
(
0
<
(
n
=
read
(
fd
,
entries
+
total_read
,
s
.
st_size
-
total_read
)))
total_read
+=
n
;
entries
[
s
.
st_size
]
=
'\0'
;
entries
[
0
]
=
'\n'
;
close
(
fd
);
entry
->
version
=
g_strdup
(
"D"
);
}
}
}
g_free
(
file_name
);
if
(
NULL
!=
(
dir
=
opendir
(
entry
->
path
)))
{
while
(
NULL
!=
(
dir_entry
=
readdir
(
dir
)))
{
if
((
0
==
strcmp
(
dir_entry
->
d_name
,
"."
))
||
(
0
==
strcmp
(
dir_entry
->
d_name
,
".."
)))
continue
;
file_name
=
g_strdup_printf
(
"%s/%s"
,
entry
->
path
,
dir_entry
->
d_name
);
new_entry
=
tm_file_entry_new
(
file_name
,
entry
,
recurse
,
file_match
,
file_unmatch
,
dir_match
,
dir_unmatch
,
ignore_hidden_files
,
ignore_hidden_dirs
);
g_free
(
file_name
);
if
(
new_entry
)
{
if
(
entries
)
{
char
*
str
=
g_strconcat
(
"
\n
/"
,
new_entry
->
name
,
"/"
,
NULL
);
char
*
name_pos
=
strstr
(
entries
,
str
);
if
(
NULL
!=
name_pos
)
{
int
len
=
strlen
(
str
);
char
*
version_pos
=
strchr
(
name_pos
+
len
,
'/'
);
if
(
NULL
!=
version_pos
)
{
*
version_pos
=
'\0'
;
new_entry
->
version
=
g_strdup
(
name_pos
+
len
);
*
version_pos
=
'/'
;
}
}
g_free
(
str
);
}
entry
->
children
=
g_slist_prepend
(
entry
->
children
,
new_entry
);
}
}
}
closedir
(
dir
);
entry
->
children
=
g_slist_sort
(
entry
->
children
,
(
GCompareFunc
)
tm_file_entry_compare
);
g_free
(
entries
);
break
;
}
return
entry
;
}
void
tm_file_entry_free
(
gpointer
entry
)
{
if
(
entry
)
{
TMFileEntry
*
file_entry
=
TM_FILE_ENTRY
(
entry
);
if
(
file_entry
->
children
)
{
GSList
*
tmp
;
for
(
tmp
=
file_entry
->
children
;
tmp
;
tmp
=
g_slist_next
(
tmp
))
tm_file_entry_free
(
tmp
->
data
);
g_slist_free
(
file_entry
->
children
);
}
g_free
(
file_entry
->
version
);
g_free
(
file_entry
->
path
);
FILE_FREE
(
file_entry
);
}
}
void
tm_file_entry_foreach
(
TMFileEntry
*
entry
,
TMFileEntryFunc
func
,
gpointer
user_data
,
guint
level
,
gboolean
reverse
)
{
g_return_if_fail
(
entry
!=
NULL
);
g_return_if_fail
(
func
!=
NULL
);
if
((
reverse
)
&&
(
entry
->
children
))
{
GSList
*
tmp
;
for
(
tmp
=
entry
->
children
;
tmp
;
tmp
=
g_slist_next
(
tmp
))
tm_file_entry_foreach
(
TM_FILE_ENTRY
(
tmp
->
data
),
func
,
user_data
,
level
+
1
,
TRUE
);
}
func
(
entry
,
user_data
,
level
);
if
((
!
reverse
)
&&
(
entry
->
children
))
{
GSList
*
tmp
;
for
(
tmp
=
entry
->
children
;
tmp
;
tmp
=
g_slist_next
(
tmp
))
tm_file_entry_foreach
(
TM_FILE_ENTRY
(
tmp
->
data
),
func
,
user_data
,
level
+
1
,
FALSE
);
}
}
GList
*
tm_file_entry_list
(
TMFileEntry
*
entry
,
GList
*
files
)
{
GSList
*
tmp
;
files
=
g_list_prepend
(
files
,
g_strdup
(
entry
->
path
));
for
(
tmp
=
entry
->
children
;
tmp
;
tmp
=
g_slist_next
(
tmp
))
{
files
=
tm_file_entry_list
((
TMFileEntry
*
)
tmp
->
data
,
files
);
}
if
(
!
files
)
files
=
g_list_reverse
(
files
);
return
files
;
}
tagmanager/src/tm_file_entry.h
deleted
100644 → 0
Dosyayı görüntüle @
26587454
/*
*
* Copyright (c) 2001-2002, Biswapesh Chattopadhyay
*
* This source code is released for free distribution under the terms of the
* GNU General Public License.
*
*/
#ifndef TM_FILE_ENTRY_H
#define TM_FILE_ENTRY_H
#include <glib.h>
/* \file
The TMFileEntry structure and associated functions can be used
for file and directory traversal. The following example demonstrates
the use of TMFileEntry.
\include tm_file_tree_dump.c
*/
#ifdef __cplusplus
extern
"C"
{
#endif
/* Enum defining file types */
typedef
enum
{
tm_file_unknown_t
,
/* Unknown file type/file does not exist */
tm_file_regular_t
,
/* Is a regular file */
tm_file_dir_t
,
/* Is a directory */
tm_file_link_t
/* Is a symbolic link */
}
TMFileType
;
/*
This example demonstrates the use of TMFileEntry and associated functions
for managing file hierarchies in a project.
\example tm_file_tree_dump.c
*/
/* This structure stores the file tree */
typedef
struct
_TMFileEntry
{
TMFileType
type
;
/* File type */
char
*
path
;
/* Full path to the file (incl. dir and name) */
char
*
name
;
/* Just the file name (path minus the directory) */
char
*
version
;
/* CVS version in case there is a CVS entry for this file */
struct
_TMFileEntry
*
parent
;
/* The parent directory file entry */
GSList
*
children
;
/* List of children (for directory) */
}
TMFileEntry
;
/* Prototype for the function that gets called for each entry when
tm_file_entry_foreach() is called.
*/
typedef
void
(
*
TMFileEntryFunc
)
(
TMFileEntry
*
entry
,
gpointer
user_data
,
guint
level
);
/* Convinience casting macro */
#define TM_FILE_ENTRY(E) ((TMFileEntry *) (E))
/* Function that compares two file entries on name and returns the
difference
*/
gint
tm_file_entry_compare
(
TMFileEntry
*
e1
,
TMFileEntry
*
e2
);
/* Function to create a new file entry structure.
\param path Path to the file for which the entry is to be created.
\param parent Should be NULL for the first call. Since the function calls
itself recursively, this parameter is required to build the hierarchy.
\param recurse Whether the entry is to be recursively scanned (for
directories only)
\param file_match List of file name patterns to match. If set to NULL,
all files match. You can use wildcards like '*.c'. See the example program
for usage.
\param file_unmatch Opposite of file_match. All files matching any of the patterns
supplied are ignored. If set to NULL, no file is ignored.
\param dir_match List of directory name patterns to match. If set to NULL,
all directories match. You can use wildcards like '\.*'.
\param dir_unmatch Opposite of dir_match. All directories matching any of the
patterns supplied are ignored. If set to NULL, no directory is ignored.
\param ignore_hidden_files If set to TRUE, hidden files (starting with '.')
are ignored.
\param ignore_hidden_dirs If set to TRUE, hidden directories (starting with '.')
are ignored.
\return Populated TMFileEntry structure on success, NULL on failure.
*/
TMFileEntry
*
tm_file_entry_new
(
const
char
*
path
,
TMFileEntry
*
parent
,
gboolean
recurse
,
GList
*
file_match
,
GList
*
file_unmatch
,
GList
*
dir_match
,
GList
*
dir_unmatch
,
gboolean
ignore_hidden_files
,
gboolean
ignore_hidden_dirs
);
/* Frees a TMFileEntry structure. Freeing is recursive, so all child
entries are freed as well.
\param entry The TMFileEntry structure to be freed.
*/
void
tm_file_entry_free
(
gpointer
entry
);
/* This will call the function func() for each file entry.
\param entry The root file entry.
\param func The function to be called.
\param user_data Extra information to be passed to the function.
\param level The recursion level. You should set this to 0 initially.
\param reverse If set to TRUE, traversal is in reverse hierarchical order
*/
void
tm_file_entry_foreach
(
TMFileEntry
*
entry
,
TMFileEntryFunc
func
,
gpointer
user_data
,
guint
level
,
gboolean
reverse
);
/* This is a sample function to show the use of tm_file_entry_foreach().
*/
void
tm_file_entry_print
(
TMFileEntry
*
entry
,
gpointer
user_data
,
guint
level
);
/* Creates a list of path names from a TMFileEntry structure.
\param entry The TMFileEntry structure.
\files Current file list. Should be NULL.
*/
GList
*
tm_file_entry_list
(
TMFileEntry
*
entry
,
GList
*
files
);
#ifdef __cplusplus
}
#endif
#endif
/* TM_FILE_ENTRY_H */
tagmanager/src/tm_tagmanager.h
Dosyayı görüntüle @
52076d19
...
@@ -14,7 +14,6 @@
...
@@ -14,7 +14,6 @@
#include "tm_workspace.h"
#include "tm_workspace.h"
#include "tm_source_file.h"
#include "tm_source_file.h"
#ifdef GEANY_PRIVATE
#ifdef GEANY_PRIVATE
#include "tm_file_entry.h"
#include "tm_parser.h"
#include "tm_parser.h"
#endif
/* GEANY_PRIVATE */
#endif
/* GEANY_PRIVATE */
...
...
wscript
Dosyayı görüntüle @
52076d19
...
@@ -118,7 +118,6 @@ ctags_sources = set([
...
@@ -118,7 +118,6 @@ ctags_sources = set([
'tagmanager/ctags/vstring.c'])
'tagmanager/ctags/vstring.c'])
tagmanager_sources = set([
tagmanager_sources = set([
'tagmanager/src/tm_file_entry.c',
'tagmanager/src/tm_source_file.c',
'tagmanager/src/tm_source_file.c',
'tagmanager/src/tm_tag.c',
'tagmanager/src/tm_tag.c',
'tagmanager/src/tm_workspace.c'])
'tagmanager/src/tm_workspace.c'])
...
...
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