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
9e5ce48c
Commit
9e5ce48c
authored
18 years ago
by
edgrif
Browse files
Options
Downloads
Patches
Plain Diff
add minor utility to remove a char from a string.
parent
08057040
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/include/ZMap/zmapGLibUtils.h
+4
-2
4 additions, 2 deletions
src/include/ZMap/zmapGLibUtils.h
src/zmapUtils/zmapGLibUtils.c
+40
-2
40 additions, 2 deletions
src/zmapUtils/zmapGLibUtils.c
with
44 additions
and
4 deletions
src/include/ZMap/zmapGLibUtils.h
+
4
−
2
View file @
9e5ce48c
...
...
@@ -26,9 +26,9 @@
* glib but not included with their distribution.
*
* HISTORY:
* Last edited: Ma
r 27 12:20
2006 (edgrif)
* Last edited: Ma
y 19 16:51
2006 (edgrif)
* Created: Thu Oct 13 15:56:54 2005 (edgrif)
* CVS info: $Id: zmapGLibUtils.h,v 1.
5
2006-0
3-27 12:10
:5
4
edgrif Exp $
* CVS info: $Id: zmapGLibUtils.h,v 1.
6
2006-0
5-19 15:55
:5
8
edgrif Exp $
*-------------------------------------------------------------------
*/
#ifndef ZMAP_GLIBUTILS_H
...
...
@@ -60,6 +60,8 @@ typedef enum
char
*
zMap_g_remove_char
(
char
*
string
,
char
ch
)
;
void
zMap_g_list_foreach_reverse
(
GList
*
list
,
GFunc
func
,
gpointer
user_data
);
void
zMap_g_list_foreach_directional
(
GList
*
list
,
GFunc
func
,
...
...
This diff is collapsed.
Click to expand it.
src/zmapUtils/zmapGLibUtils.c
+
40
−
2
View file @
9e5ce48c
...
...
@@ -26,9 +26,9 @@
*
* Exported functions: See ZMap/zmapGLibUtils.h
* HISTORY:
* Last edited: Ma
r 27 12:42
2006 (edgrif)
* Last edited: Ma
y 19 16:50
2006 (edgrif)
* Created: Thu Oct 13 15:22:35 2005 (edgrif)
* CVS info: $Id: zmapGLibUtils.c,v 1.
5
2006-0
3-27 12:10
:5
4
edgrif Exp $
* CVS info: $Id: zmapGLibUtils.c,v 1.
6
2006-0
5-19 15:55
:5
8
edgrif Exp $
*-------------------------------------------------------------------
*/
...
...
@@ -90,6 +90,44 @@ static inline GQuark g_quark_new(ZMapQuarkSet quark_set, gchar *string) ;
* */
/*
* Additions to String utilities
*/
/* This routine removes all occurences of the given char from the target string,
* this is done inplace so the returned string will be shorter. */
char
*
zMap_g_remove_char
(
char
*
string
,
char
ch
)
{
char
*
cp
;
zMapAssert
(
string
)
;
cp
=
string
;
while
(
*
cp
)
{
if
(
*
cp
==
ch
)
{
char
*
cq
;
cq
=
cp
;
while
(
*
cq
)
{
*
cq
=
*
(
cq
+
1
)
;
cq
++
;
}
*
cq
=
'\0'
;
}
cp
++
;
}
return
string
;
}
/*
...
...
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