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
f3ab17c1
Commit
f3ab17c1
authored
20 years ago
by
edgrif
Browse files
Options
Downloads
Patches
Plain Diff
add code to parse GFF coming back from acedb server.
parent
2af87d2f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/zmapServer/acedb/acedbServer.c
+72
-6
72 additions, 6 deletions
src/zmapServer/acedb/acedbServer.c
with
72 additions
and
6 deletions
src/zmapServer/acedb/acedbServer.c
+
72
−
6
View file @
f3ab17c1
...
...
@@ -26,14 +26,16 @@
* Description:
* Exported functions: See zmapServer.h
* HISTORY:
* Last edited:
Mar
2
2
11:2
6
2004 (edgrif)
* Last edited:
Jun
2
5
11:
5
2 2004 (edgrif)
* Created: Wed Aug 6 15:46:38 2003 (edgrif)
* CVS info: $Id: acedbServer.c,v 1.
2
2004-0
3
-2
2
13:3
2:05
edgrif Exp $
* CVS info: $Id: acedbServer.c,v 1.
3
2004-0
6
-2
5
13:3
9:11
edgrif Exp $
*-------------------------------------------------------------------
*/
#include
<AceConn.h>
#include
<ZMap/zmapUtils.h>
#include
<ZMap/zmapServerPrototype.h>
#include
<ZMap/zmapGFF.h>
#include
<acedbServer_P.h>
...
...
@@ -42,7 +44,8 @@ static gboolean createConnection(void **server_out,
char
*
host
,
int
port
,
char
*
userid
,
char
*
passwd
,
int
timeout
)
;
static
gboolean
openConnection
(
void
*
server
)
;
static
gboolean
request
(
void
*
server
,
char
*
request
,
void
**
reply
,
int
*
reply_len
)
;
static
gboolean
request
(
void
*
server
,
ZMapServerRequestType
request
,
char
*
sequence
,
ZMapFeatureContext
*
feature_context
)
;
char
*
lastErrorMsg
(
void
*
server
)
;
static
gboolean
closeConnection
(
void
*
server
)
;
static
gboolean
destroyConnection
(
void
*
server
)
;
...
...
@@ -117,14 +120,77 @@ static gboolean openConnection(void *server_in)
}
static
gboolean
request
(
void
*
server_in
,
char
*
request
,
void
**
reply
,
int
*
reply_len
)
static
gboolean
request
(
void
*
server_in
,
ZMapServerRequestType
request
,
char
*
sequence
,
ZMapFeatureContext
*
feature_context_out
)
{
gboolean
result
=
FALSE
;
AcedbServer
server
=
(
AcedbServer
)
server_in
;
char
*
acedb_request
=
NULL
;
void
*
reply
=
NULL
;
int
reply_len
=
0
;
/* Lash up for now, we will later need a "ZMap request" -> "acedb request" translator. */
acedb_request
=
g_strdup_printf
(
"gif seqget %s ; seqfeatures"
,
sequence
)
;
if
((
server
->
last_err_status
=
AceConnRequest
(
server
->
connection
,
request
,
reply
,
reply_len
))
==
ACECONN_OK
)
result
=
TRUE
;
AceConnRequest
(
server
->
connection
,
acedb_request
,
&
reply
,
&
reply_len
))
==
ACECONN_OK
)
{
char
*
next_line
;
ZMapReadLine
line_reader
;
gboolean
inplace
=
TRUE
;
ZMapGFFParser
parser
;
ZMapFeatureContext
feature_context
=
NULL
;
/* Here we can convert the GFF that comes back, in the end we should be doing a number of
* calls to AceConnRequest() as the server slices...but that will need a change to my
* AceConn package.....
* We make the big assumption that what comes back is a C string for now, this is true
* for most acedb requests, only images/postscript are not and we aren't asking for them. */
line_reader
=
zMapReadLineCreate
((
char
*
)
reply
,
inplace
)
;
parser
=
zMapGFFCreateParser
(
FALSE
)
;
/* We probably won't have to deal with part lines here acedb should only return whole lines
* ....but should check for sure...bomb out for now.... */
do
{
if
(
!
zMapReadLineNext
(
line_reader
,
&
next_line
)
&&
*
next_line
)
{
zMapLogFatal
(
"Request from server contained incomplete line: %s"
,
next_line
)
;
}
else
{
if
(
!
zMapGFFParseLine
(
parser
,
next_line
))
{
GError
*
error
=
zMapGFFGetError
(
parser
)
;
if
(
!
error
)
{
zMapLogCritical
(
"zMapGFFParseLine() failed with no GError for line %d: %s
\n
"
,
zMapGFFGetLineNumber
(
parser
),
next_line
)
;
}
else
zMapLogWarning
(
"%s
\n
"
,
(
zMapGFFGetError
(
parser
))
->
message
)
;
}
}
}
while
(
*
next_line
)
;
if
((
feature_context
=
zmapGFFGetFeatures
(
parser
)))
{
*
feature_context_out
=
feature_context
;
result
=
TRUE
;
}
zMapReadLineDestroy
(
line_reader
,
TRUE
)
;
zMapGFFSetFreeOnDestroy
(
parser
,
FALSE
)
;
zMapGFFDestroyParser
(
parser
)
;
}
g_free
(
acedb_request
)
;
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