Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
zmap
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ensembl-gh-mirror
zmap
Commits
9ada7ba5
Commit
9ada7ba5
authored
16 years ago
by
edgrif
Browse files
Options
Downloads
Patches
Plain Diff
chanage parse_header func to return when finished.
parent
96f375b7
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/include/ZMap/zmapGFF.h
+3
-3
3 additions, 3 deletions
src/include/ZMap/zmapGFF.h
src/zmapGFF/gffparser.c
+7
-5
7 additions, 5 deletions
src/zmapGFF/gffparser.c
src/zmapGFF/zmapGFF2parser.c
+13
-10
13 additions, 10 deletions
src/zmapGFF/zmapGFF2parser.c
with
23 additions
and
18 deletions
src/include/ZMap/zmapGFF.h
+
3
−
3
View file @
9ada7ba5
...
...
@@ -28,9 +28,9 @@
* of ZMapFeatureStruct's, one for each GFF source.
*
* HISTORY:
* Last edited:
Feb
1
9
1
3:26
200
7
(edgrif)
* Last edited:
Oct
1
7
1
4:14
200
8
(edgrif)
* Created: Sat May 29 13:18:32 2004 (edgrif)
* CVS info: $Id: zmapGFF.h,v 1.1
2
200
7-03-01 09:11:47
edgrif Exp $
* CVS info: $Id: zmapGFF.h,v 1.1
3
200
8-10-29 16:09:38
edgrif Exp $
*-------------------------------------------------------------------
*/
#ifndef ZMAP_GFF_H
...
...
@@ -71,7 +71,7 @@ typedef struct
ZMapGFFParser
zMapGFFCreateParser
(
GData
*
sources
,
gboolean
parse_only
)
;
gboolean
zMapGFFParseHeader
(
ZMapGFFParser
parser
,
char
*
line
)
;
gboolean
zMapGFFParseHeader
(
ZMapGFFParser
parser
,
char
*
line
,
gboolean
*
header_finished
)
;
gboolean
zMapGFFParseLine
(
ZMapGFFParser
parser
,
char
*
line
)
;
void
zMapGFFSetStopOnError
(
ZMapGFFParser
parser
,
gboolean
stop_on_error
)
;
void
zMapGFFSetParseOnly
(
ZMapGFFParser
parser
,
gboolean
parse_only
)
;
...
...
This diff is collapsed.
Click to expand it.
src/zmapGFF/gffparser.c
+
7
−
5
View file @
9ada7ba5
...
...
@@ -27,9 +27,9 @@
*
* Exported functions: See XXXXXXXXXXXXX.h
* HISTORY:
* Last edited:
Jul 21 17:57
200
7
(
rds
)
* Last edited:
Oct 17 14:18
200
8
(
edgrif
)
* Created: Wed Jan 11 11:30:39 2006 (rds)
* CVS info: $Id: gffparser.c,v 1.
5
200
7-07-22 09:15:41 rds
Exp $
* CVS info: $Id: gffparser.c,v 1.
6
200
8-10-29 16:09:38 edgrif
Exp $
*-------------------------------------------------------------------
*/
...
...
@@ -71,7 +71,7 @@ int main(int argc, char *argv[])
zMapLogCreate
(
NULL
)
;
styles
=
zMapFeatureTypeGetFromFile
(
argv
[
2
])
;
styles
=
zMapFeatureTypeGetFromFile
(
argv
[
2
]
,
argv
[
3
]
)
;
main_rc
=
parseFile
(
argv
[
1
],
styles
)
;
zMapLogDestroy
()
;
...
...
@@ -132,10 +132,12 @@ static int readHeader(parserFile data)
&
terminator_pos
,
&
gff_file_err
))
==
G_IO_STATUS_NORMAL
)
{
gboolean
done_header
=
FALSE
;
*
(
data
->
gff_line
->
str
+
terminator_pos
)
=
'\0'
;
if
(
!
zMapGFFParseHeader
(
data
->
parser
,
data
->
gff_line
->
str
))
if
(
!
zMapGFFParseHeader
(
data
->
parser
,
data
->
gff_line
->
str
,
&
done_header
))
{
if
(
!
zMapGFFParseHeader
(
data
->
parser
,
data
->
gff_line
->
str
))
if
(
!
zMapGFFParseHeader
(
data
->
parser
,
data
->
gff_line
->
str
,
&
done_header
))
{
GError
*
error
=
zMapGFFGetError
(
data
->
parser
)
;
...
...
This diff is collapsed.
Click to expand it.
src/zmapGFF/zmapGFF2parser.c
+
13
−
10
View file @
9ada7ba5
...
...
@@ -26,9 +26,9 @@
*
* Exported functions: See ZMap/zmapGFF.h
* HISTORY:
* Last edited:
Aug 29
13:
54
2008 (edgrif)
* Last edited:
Oct 17
13:
38
2008 (edgrif)
* Created: Fri May 28 14:25:12 2004 (edgrif)
* CVS info: $Id: zmapGFF2parser.c,v 1.8
3
2008-0
8
-29 1
2:55:44
edgrif Exp $
* CVS info: $Id: zmapGFF2parser.c,v 1.8
4
2008-
1
0-29 1
6:09:38
edgrif Exp $
*-------------------------------------------------------------------
*/
...
...
@@ -261,7 +261,7 @@ gboolean zMapGFFParseLine(ZMapGFFParser parser, char *line)
/* Parses a single line of GFF data, should be called repeatedly with successive lines
* GFF data from a GFF source. This function expects to find the GFF header, once all
* the required header lines have been found or a non-comment line is found it will stop.
* The zMapGFFParseLine() function can be used to parse the rest of the file.
* The zMapGFFParseLine() function can
then
be used to parse the rest of the file.
*
* This function expects a null-terminated C string that contains a complete GFF line
* (comment or non-comment line), the function expects the caller to already have removed the
...
...
@@ -273,19 +273,15 @@ gboolean zMapGFFParseLine(ZMapGFFParser parser, char *line)
* Once an error has been returned the parser object cannot be used anymore and
* zMapGFFDestroyParser() should be called to free it.
*
*/
/* ISSUE: need to decide on rules for comments, can they be embedded within other gff lines, are
* the header comments compulsory ? etc. etc.
*
* Current code assumes that the header block will be a contiguous set of header lines
* at the top of the file and that the first non-header line marks the beginning
* of the GFF data. If this is not true then its an error.
*/
gboolean
zMapGFFParseHeader
(
ZMapGFFParser
parser
,
char
*
line
)
gboolean
zMapGFFParseHeader
(
ZMapGFFParser
parser
,
char
*
line
,
gboolean
*
header_finished
)
{
gboolean
result
=
FALSE
;
zMapAssert
(
parser
&&
line
&&
header_finished
)
;
parser
->
line_count
++
;
...
...
@@ -308,9 +304,16 @@ gboolean zMapGFFParseHeader(ZMapGFFParser parser, char *line)
/* If we found all the header parts move on to the body. */
if
(
parser
->
done_header
)
parser
->
state
=
ZMAPGFF_PARSE_BODY
;
{
parser
->
state
=
ZMAPGFF_PARSE_BODY
;
*
header_finished
=
TRUE
;
}
}
}
else
{
*
header_finished
=
FALSE
;
}
}
return
result
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment