Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TLMSP curl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CYBER - Cyber Security
TS 103 523 MSP
TLMSP
TLMSP curl
Commits
409ac807
Commit
409ac807
authored
22 years ago
by
Daniel Stenberg
Browse files
Options
Downloads
Patches
Plain Diff
removed weirdo {{{ and }}} comments
removed emacs local-variables stuff
parent
fc7bebdf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/hash.c
+4
-53
4 additions, 53 deletions
lib/hash.c
with
4 additions
and
53 deletions
lib/hash.c
+
4
−
53
View file @
409ac807
...
...
@@ -35,8 +35,6 @@
#endif
/* {{{ static unsigned long _hash_str (const char *, size_t)
*/
static
unsigned
long
_hash_str
(
const
char
*
key
,
size_t
key_length
)
{
...
...
@@ -50,10 +48,7 @@ _hash_str (const char *key, size_t key_length)
return
h
;
}
/* }}} */
/* {{{ static void _hash_element_dtor (void *, void *)
*/
static
void
_hash_element_dtor
(
void
*
user
,
void
*
element
)
{
...
...
@@ -68,10 +63,7 @@ _hash_element_dtor (void *user, void *element)
free
(
e
);
}
/* }}} */
/* {{{ void curl_hash_init (curl_hash *, int, curl_hash_dtor)
*/
void
Curl_hash_init
(
curl_hash
*
h
,
int
slots
,
curl_hash_dtor
dtor
)
{
...
...
@@ -86,10 +78,7 @@ Curl_hash_init (curl_hash *h, int slots, curl_hash_dtor dtor)
h
->
table
[
i
]
=
Curl_llist_alloc
((
curl_llist_dtor
)
_hash_element_dtor
);
}
}
/* }}} */
/* {{{ curl_hash *curl_hash_alloc (int, curl_hash_dtor)
*/
curl_hash
*
Curl_hash_alloc
(
int
slots
,
curl_hash_dtor
dtor
)
{
...
...
@@ -103,10 +92,7 @@ Curl_hash_alloc (int slots, curl_hash_dtor dtor)
return
h
;
}
/* }}} */
/* {{{ static int _hash_key_compare (char *, size_t, char *, size_t)
*/
static
int
_hash_key_compare
(
char
*
key1
,
size_t
key1_len
,
char
*
key2
,
size_t
key2_len
)
{
...
...
@@ -118,12 +104,10 @@ _hash_key_compare (char *key1, size_t key1_len, char *key2, size_t key2_len)
return
0
;
}
/* }}} */
/* {{{ static int _mk_hash_element (curl_hash_element **, char *, size_t, const void *)
*/
static
int
_mk_hash_element
(
curl_hash_element
**
e
,
char
*
key
,
size_t
key_len
,
const
void
*
p
)
_mk_hash_element
(
curl_hash_element
**
e
,
char
*
key
,
size_t
key_len
,
const
void
*
p
)
{
*
e
=
(
curl_hash_element
*
)
malloc
(
sizeof
(
curl_hash_element
));
(
*
e
)
->
key
=
strdup
(
key
);
...
...
@@ -131,16 +115,12 @@ _mk_hash_element (curl_hash_element **e, char *key, size_t key_len, const void *
(
*
e
)
->
ptr
=
(
void
*
)
p
;
return
0
;
}
/* }}} */
#define find_slot(__h, __k, __k_len) (_hash_str(__k, __k_len) % (__h)->slots)
#define FETCH_LIST \
curl_llist *l = h->table[find_slot(h, key, key_len)]
/* {{{ int curl_hash_add (curl_hash *, char *, size_t, const void *)
*/
int
Curl_hash_add
(
curl_hash
*
h
,
char
*
key
,
size_t
key_len
,
const
void
*
p
)
{
...
...
@@ -169,10 +149,7 @@ Curl_hash_add (curl_hash *h, char *key, size_t key_len, const void *p)
return
0
;
}
/* }}} */
/* {{{ int curl_hash_delete (curl_hash *, char *, size_t)
*/
int
Curl_hash_delete
(
curl_hash
*
h
,
char
*
key
,
size_t
key_len
)
{
...
...
@@ -193,10 +170,7 @@ Curl_hash_delete(curl_hash *h, char *key, size_t key_len)
return
0
;
}
/* }}} */
/* {{{ int curl_hash_pick (curl_hash *, char *, size_t, void **)
*/
void
*
Curl_hash_pick
(
curl_hash
*
h
,
char
*
key
,
size_t
key_len
)
{
...
...
@@ -215,10 +189,7 @@ Curl_hash_pick(curl_hash *h, char *key, size_t key_len)
return
NULL
;
}
/* }}} */
/* {{{ void curl_hash_apply (curl_hash *, void *, void (*)(void *, curl_hash_element *))
*/
void
Curl_hash_apply
(
curl_hash
*
h
,
void
*
user
,
void
(
*
cb
)(
void
*
user
,
void
*
ptr
))
...
...
@@ -235,10 +206,7 @@ Curl_hash_apply(curl_hash *h, void *user,
}
}
}
/* }}} */
/* {{{ void curl_hash_clean (curl_hash *)
*/
void
Curl_hash_clean
(
curl_hash
*
h
)
{
...
...
@@ -250,11 +218,7 @@ Curl_hash_clean(curl_hash *h)
free
(
h
->
table
);
}
/* }}} */
/* {{{ void curl_hash_clean_with_criterium (curl_hash *, void *,
int (*)(void *, void *))
*/
void
Curl_hash_clean_with_criterium
(
curl_hash
*
h
,
void
*
user
,
int
(
*
comp
)(
void
*
,
void
*
))
...
...
@@ -277,17 +241,12 @@ Curl_hash_clean_with_criterium(curl_hash *h, void *user,
}
}
/* {{{ int curl_hash_count (curl_hash *)
*/
int
int
Curl_hash_count
(
curl_hash
*
h
)
{
return
h
->
size
;
}
/* }}} */
/* {{{ void curl_hash_destroy (curl_hash *)
*/
void
Curl_hash_destroy
(
curl_hash
*
h
)
{
...
...
@@ -297,12 +256,4 @@ Curl_hash_destroy(curl_hash *h)
Curl_hash_clean
(
h
);
free
(
h
);
}
/* }}} */
/*
* local variables:
* eval: (load-file "../curl-mode.el")
* end:
* vim600: fdm=marker
* vim: et sw=2 ts=2 sts=2 tw=78
*/
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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