Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libdap-server-core
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
cellframe
libdap-server-core
Commits
766f188f
Commit
766f188f
authored
6 years ago
by
armatusmiles
Browse files
Options
Downloads
Patches
Plain Diff
[+] dap_memcache_get func
parent
04f94d54
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dap_memcached.c
+8
-14
8 additions, 14 deletions
dap_memcached.c
dap_memcached.h
+18
-0
18 additions, 0 deletions
dap_memcached.h
with
26 additions
and
14 deletions
dap_memcached.c
+
8
−
14
View file @
766f188f
...
@@ -4,13 +4,6 @@
...
@@ -4,13 +4,6 @@
static
memcached_st
*
_memc
;
static
memcached_st
*
_memc
;
static
time_t
_expiration
;
static
time_t
_expiration
;
/**
* @brief dap_memcached_init
* @param server_host
* @param port
* @param expiration
* @return
*/
int
dap_memcached_init
(
const
char
*
server_host
,
uint16_t
port
,
time_t
expiration
)
int
dap_memcached_init
(
const
char
*
server_host
,
uint16_t
port
,
time_t
expiration
)
{
{
_expiration
=
expiration
;
_expiration
=
expiration
;
...
@@ -41,13 +34,7 @@ int dap_memcached_init(const char *server_host, uint16_t port, time_t expiration
...
@@ -41,13 +34,7 @@ int dap_memcached_init(const char *server_host, uint16_t port, time_t expiration
return
0
;
return
0
;
}
}
/**
* @brief dap_memcache_put
* @param key
* @param value
* @param value_size
* @return
*/
bool
dap_memcache_put
(
const
char
*
key
,
void
*
value
,
size_t
value_size
)
bool
dap_memcache_put
(
const
char
*
key
,
void
*
value
,
size_t
value_size
)
{
{
memcached_return
rc
;
memcached_return
rc
;
...
@@ -59,6 +46,13 @@ bool dap_memcache_put(const char* key, void *value, size_t value_size)
...
@@ -59,6 +46,13 @@ bool dap_memcache_put(const char* key, void *value, size_t value_size)
return
true
;
return
true
;
}
}
bool
dap_memcache_get
(
const
char
*
key
,
size_t
*
value_size
,
void
**
result
)
{
memcached_return
rc
;
*
result
=
memcached_get
(
_memc
,
key
,
strlen
(
key
),
value_size
,
NULL
,
&
rc
);
return
rc
==
MEMCACHED_SUCCESS
;
}
/**
/**
* @brief dap_memcached_deinit
* @brief dap_memcached_deinit
*/
*/
...
...
This diff is collapsed.
Click to expand it.
dap_memcached.h
+
18
−
0
View file @
766f188f
...
@@ -16,6 +16,24 @@
...
@@ -16,6 +16,24 @@
* @return
* @return
*/
*/
int
dap_memcached_init
(
const
char
*
server_host
,
uint16_t
port
,
time_t
expiration
);
int
dap_memcached_init
(
const
char
*
server_host
,
uint16_t
port
,
time_t
expiration
);
/**
* @brief dap_memcached_deinit
*/
void
dap_memcached_deinit
(
void
);
void
dap_memcached_deinit
(
void
);
/**
* @brief dap_memcache_put
* @param key
* @param value
* @param value_size
* @return
*/
bool
dap_memcache_put
(
const
char
*
key
,
void
*
value
,
size_t
value_size
);
bool
dap_memcache_put
(
const
char
*
key
,
void
*
value
,
size_t
value_size
);
/**
* @brief dap_memcache_get
* @param key
* @return true if key found
*/
bool
dap_memcache_get
(
const
char
*
key
,
size_t
*
value_size
,
void
**
result
);
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