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
bfa2159e
Commit
bfa2159e
authored
16 years ago
by
rds
Browse files
Options
Downloads
Patches
Plain Diff
removed some old code and added support for pending config (ini)
changes.
parent
b7299863
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/zmapUtils/zmapConfigDir.c
+44
-59
44 additions, 59 deletions
src/zmapUtils/zmapConfigDir.c
src/zmapUtils/zmapConfigDir_P.h
+10
-2
10 additions, 2 deletions
src/zmapUtils/zmapConfigDir_P.h
with
54 additions
and
61 deletions
src/zmapUtils/zmapConfigDir.c
+
44
−
59
View file @
bfa2159e
...
...
@@ -27,9 +27,9 @@
*
* Exported functions: See ZMap/zmapConfigDir.h
* HISTORY:
* Last edited:
Oct 10
1
0
:1
1
200
6
(
edgrif
)
* Last edited:
Aug 28
1
5
:1
9
200
8
(
rds
)
* Created: Thu Feb 10 10:05:36 2005 (edgrif)
* CVS info: $Id: zmapConfigDir.c,v 1.
5
200
6-11
-0
8
09:2
4:40 edgrif
Exp $
* CVS info: $Id: zmapConfigDir.c,v 1.
6
200
8-09
-0
4
09:2
5:34 rds
Exp $
*-------------------------------------------------------------------
*/
...
...
@@ -63,8 +63,9 @@ gboolean zMapConfigDirCreate(char *config_dir, char *config_file)
gboolean
result
=
FALSE
;
ZMapConfigDir
dir_context
=
NULL
;
gboolean
home_relative
=
FALSE
,
make_dir
=
FALSE
;
char
*
zmap_home
;
zMapAssert
(
!
dir_context_G
)
;
g_return_val_if_fail
(
dir_context_G
==
NULL
,
FALSE
)
;
dir_context_G
=
dir_context
=
g_new0
(
ZMapConfigDirStruct
,
1
)
;
...
...
@@ -81,30 +82,24 @@ gboolean zMapConfigDirCreate(char *config_dir, char *config_file)
&&
(
dir_context
->
config_file
=
zMapGetFile
(
dir_context
->
config_dir
,
config_file
,
FALSE
)))
result
=
TRUE
;
if
((
zmap_home
=
getenv
(
"ZMAP_HOME"
)))
{
zmap_home
=
g_strdup_printf
(
"%s/etc"
,
zmap_home
);
if
((
dir_context
->
zmap_conf_dir
=
zMapGetDir
(
zmap_home
,
FALSE
,
FALSE
)))
dir_context
->
zmap_conf_file
=
zMapGetFile
(
dir_context
->
zmap_conf_dir
,
ZMAP_USER_CONFIG_FILE
,
FALSE
);
g_free
(
zmap_home
);
}
else
dir_context
->
zmap_conf_dir
=
dir_context
->
zmap_conf_file
=
NULL
;
return
result
;
}
#ifdef ED_G_NEVER_INCLUDE_THIS_CODE
/* Is this needed ?? */
char
*
zMapConfigDirSetConfigFile
(
char
*
config_file
)
{
char
*
config_path
;
ZMapConfigDir
dir_context
=
dir_context_G
;
zMapAssert
(
dir_context
)
;
config_path
=
dir_context
->
config__dir
;
if
(
!
((
dir_context
->
sys_conf_dir
=
zMapGetDir
(
"/etc"
,
FALSE
,
FALSE
))
&&
(
dir_context
->
sys_conf_file
=
zMapGetFile
(
dir_context
->
sys_conf_dir
,
ZMAP_USER_CONFIG_FILE
,
FALSE
))))
{
dir_context
->
sys_conf_dir
=
dir_context
->
sys_conf_file
=
NULL
;
}
return
config_dir
;
return
result
;
}
#endif
/* ED_G_NEVER_INCLUDE_THIS_CODE */
...
...
@@ -169,6 +164,31 @@ char *zMapConfigDirFindDir(char *directory_in)
}
char
*
zMapConfigDirGetZmapHomeFile
(
void
)
{
char
*
config_file
;
ZMapConfigDir
dir_context
=
dir_context_G
;
zMapAssert
(
dir_context
)
;
config_file
=
dir_context
->
zmap_conf_file
;
return
config_file
;
}
char
*
zMapConfigDirGetSysFile
(
void
)
{
char
*
config_file
;
ZMapConfigDir
dir_context
=
dir_context_G
;
zMapAssert
(
dir_context
)
;
config_file
=
dir_context
->
sys_conf_file
;
return
config_file
;
}
void
zMapConfigDirDestroy
(
void
)
{
...
...
@@ -182,38 +202,3 @@ void zMapConfigDirDestroy(void)
return
;
}
/* Needs top ZMap window id.... and name for it.
* Get a window id with GDK_DRAWABLE_XID(top_zmap_window);
* It'll need to be a unique name */
void
zMapConfigDirWriteWindowIdFile
(
unsigned
long
id
,
char
*
window_name
)
{
GError
*
g_error
=
NULL
;
GIOChannel
*
winid_file
=
NULL
;
gsize
bytes
=
0
;
char
*
config_dir
=
NULL
;
char
*
path
,
*
id_line
;
if
((
config_dir
=
zMapConfigDirGetDir
()))
{
path
=
g_strdup_printf
(
"%s/%s.%s"
,
config_dir
,
window_name
,
WINDOWID_SUFFIX
);
if
((
winid_file
=
g_io_channel_new_file
(
path
,
"w+"
,
&
g_error
)))
{
g_error
=
NULL
;
id_line
=
g_strdup_printf
(
"WindowID: 0x%lx
\n
"
,
id
);
/* zMapLogMessage("Recorded %s to file %s", id_line, path); */
g_io_channel_write_chars
(
winid_file
,
id_line
,
-
1
,
&
bytes
,
&
g_error
);
/* should catch not writing here */
g_io_channel_flush
(
winid_file
,
&
g_error
);
/* should catch not writing here */
g_free
(
id_line
);
}
else
{
zMapLogWarning
(
"Error doing something to path '%s', %s"
,
path
,
g_error
->
message
);
}
if
(
path
)
g_free
(
path
);
}
else
{
zMapLogWarning
(
"%s"
,
"Unable to find a configuration directory."
)
;
}
}
This diff is collapsed.
Click to expand it.
src/zmapUtils/zmapConfigDir_P.h
+
10
−
2
View file @
bfa2159e
...
...
@@ -27,9 +27,9 @@
*
* Exported functions: See XXXXXXXXXXXXX.h
* HISTORY:
* Last edited:
Feb 10 13:50
200
5
(
edgrif
)
* Last edited:
Aug 28 15:13
200
8
(
rds
)
* Created: Thu Feb 10 10:10:27 2005 (edgrif)
* CVS info: $Id: zmapConfigDir_P.h,v 1.
2
200
6-11
-0
8
09:2
4
:4
1 edgrif
Exp $
* CVS info: $Id: zmapConfigDir_P.h,v 1.
3
200
8-09
-0
4
09:2
5
:4
3 rds
Exp $
*-------------------------------------------------------------------
*/
#ifndef ZMAP_CONFIGDIR_P_H
...
...
@@ -45,6 +45,14 @@ typedef struct _ZMapConfigDirStruct
char
*
config_dir
;
char
*
config_file
;
char
*
zmap_conf_dir
;
/* The directory of $ZMAP_HOME/etc */
char
*
zmap_conf_file
;
/* The full path of $ZMAP_HOME/etc/ZMAP_USER_CONFIG_FILE */
char
*
sys_conf_dir
;
/* The directory of /etc. N.B. This should be changed to reflect any ./configure --sysconfdir=/somewhere/etc */
char
*
sys_conf_file
;
/* The full path of $ZMAP_HOME/etc/ZMAP_USER_CONFIG_FILE */
}
ZMapConfigDirStruct
,
*
ZMapConfigDir
;
...
...
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