Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
23caf521
Commit
23caf521
authored
Apr 25, 2008
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
get_files added
parent
9c47ed0a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
2 deletions
+61
-2
src/lib/co/src/co_dcli.h
src/lib/co/src/co_dcli.h
+6
-1
src/lib/co/src/co_dcli_dir.c
src/lib/co/src/co_dcli_dir.c
+55
-1
No files found.
src/lib/co/src/co_dcli.h
View file @
23caf521
/**
* Proview $Id: co_dcli.h,v 1.1
0 2007-01-04 07:51:42
claes Exp $
* Proview $Id: co_dcli.h,v 1.1
1 2008-04-25 11:26:04
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -102,6 +102,11 @@ int dcli_search_file( char *file_name ,
char
*
found_file
,
int
new_search
);
int
dcli_get_files
(
char
*
dir
,
char
*
pattern
,
pwr_tString40
*
filelist
[],
int
*
filecnt
);
int
dcli_parse_filename
(
char
*
filename
,
char
*
dev
,
char
*
dir
,
...
...
src/lib/co/src/co_dcli_dir.c
View file @
23caf521
/**
* Proview $Id: co_dcli_dir.c,v 1.
4 2005-09-01 14:57:52
claes Exp $
* Proview $Id: co_dcli_dir.c,v 1.
5 2008-04-25 11:26:04
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -272,6 +272,60 @@ int dcli_search_file( char *name ,
return
DCLI__SUCCESS
;
}
/*************************************************************************
*
* Name: dcli_get_files
*
*
**************************************************************************/
int
dcli_get_files
(
char
*
dir
,
char
*
pattern
,
pwr_tString40
*
filelist
[],
int
*
filecnt
)
{
pwr_tStatus
sts
;
pwr_tFileName
file_spec
,
found_file
;
int
cnt
=
0
;
int
idx
=
0
;
char
*
s
;
strcpy
(
file_spec
,
dir
);
strcat
(
file_spec
,
"/"
);
strcat
(
file_spec
,
pattern
);
dcli_translate_filename
(
file_spec
,
file_spec
);
sts
=
dcli_search_file
(
file_spec
,
found_file
,
DCLI_DIR_SEARCH_INIT
);
while
(
ODD
(
sts
))
{
cnt
++
;
sts
=
dcli_search_file
(
file_spec
,
found_file
,
DCLI_DIR_SEARCH_NEXT
);
}
dcli_search_file
(
file_spec
,
found_file
,
DCLI_DIR_SEARCH_END
);
if
(
!
cnt
)
{
*
filecnt
=
0
;
return
0
;
}
*
filelist
=
calloc
(
cnt
,
sizeof
(
pwr_tString40
));
sts
=
dcli_search_file
(
file_spec
,
found_file
,
DCLI_DIR_SEARCH_INIT
);
while
(
ODD
(
sts
))
{
if
(
(
s
=
strrchr
(
found_file
,
'/'
)))
{
strncpy
(
(
*
filelist
)[
idx
],
s
+
1
,
sizeof
(
pwr_tString40
));
(
*
filelist
)[
idx
][
sizeof
(
pwr_tString40
)
-
1
]
=
0
;
}
else
{
strncpy
(
(
*
filelist
)[
idx
],
found_file
,
sizeof
(
pwr_tString40
));
(
*
filelist
)[
idx
][
sizeof
(
pwr_tString40
)
-
1
]
=
0
;
}
idx
++
;
sts
=
dcli_search_file
(
file_spec
,
found_file
,
DCLI_DIR_SEARCH_NEXT
);
}
dcli_search_file
(
file_spec
,
found_file
,
DCLI_DIR_SEARCH_END
);
*
filecnt
=
cnt
;
return
DCLI__SUCCESS
;
}
/*************************************************************************
*
...
...
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