C Server-Side SDK
LaunchDarkly SDK
user.h
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include <launchdarkly/boolean.h>
9 #include <launchdarkly/export.h>
10 #include <launchdarkly/json.h>
11 
16 struct LDUser;
17 
26 LD_EXPORT(struct LDUser *) LDUserNew(const char *const key);
27 
33 LD_EXPORT(void) LDUserFree(struct LDUser *const user);
34 
41 LD_EXPORT(void)
42 LDUserSetAnonymous(struct LDUser *const user, const LDBoolean anon);
43 
50 LD_EXPORT(LDBoolean)
51 LDUserSetIP(struct LDUser *const user, const char *const ip);
52 
59 LD_EXPORT(LDBoolean)
60 LDUserSetFirstName(struct LDUser *const user, const char *const firstName);
61 
68 LD_EXPORT(LDBoolean)
69 LDUserSetLastName(struct LDUser *const user, const char *const lastName);
70 
77 LD_EXPORT(LDBoolean)
78 LDUserSetEmail(struct LDUser *const user, const char *const email);
79 
86 LD_EXPORT(LDBoolean)
87 LDUserSetName(struct LDUser *const user, const char *const name);
88 
95 LD_EXPORT(LDBoolean)
96 LDUserSetAvatar(struct LDUser *const user, const char *const avatar);
97 
104 LD_EXPORT(LDBoolean)
105 LDUserSetCountry(struct LDUser *const user, const char *const country);
106 
113 LD_EXPORT(LDBoolean)
114 LDUserSetSecondary(struct LDUser *const user, const char *const secondary);
115 
122 LD_EXPORT(void)
123 LDUserSetCustom(struct LDUser *const user, struct LDJSON *const custom);
124 
131 LD_EXPORT(LDBoolean)
133  struct LDUser *const user, const char *const attribute);
134 
142 LD_EXPORT(void)
144  struct LDUser *const user, struct LDJSON *const privateAttributes);
145 
150 LD_EXPORT(void)
152  struct LDUser *const user, struct LDJSON *const custom);
LDUserSetName
LDBoolean LDUserSetName(struct LDUser *const user, const char *const name)
Set the user's name.
LDUserSetSecondary
LDBoolean LDUserSetSecondary(struct LDUser *const user, const char *const secondary)
Set the user's secondary key.
LDUserSetEmail
LDBoolean LDUserSetEmail(struct LDUser *const user, const char *const email)
Set the user's email.
LDUserSetCustom
void LDUserSetCustom(struct LDUser *const user, struct LDJSON *const custom)
Set the user's custom JSON.
boolean.h
A custom c89 boolean type.
LDUserSetPrivateAttributes
void LDUserSetPrivateAttributes(struct LDUser *const user, struct LDJSON *const privateAttributes)
Mark a set of attributes as private.
LDUserSetFirstName
LDBoolean LDUserSetFirstName(struct LDUser *const user, const char *const firstName)
Set the user's first name.
LDUserSetAnonymous
void LDUserSetAnonymous(struct LDUser *const user, const LDBoolean anon)
Mark the user as anonymous.
LDUserAddPrivateAttribute
LDBoolean LDUserAddPrivateAttribute(struct LDUser *const user, const char *const attribute)
Mark an attribute as private.
LDUserSetCountry
LDBoolean LDUserSetCountry(struct LDUser *const user, const char *const country)
Set the user's country.
LDUserSetCustomAttributesJSON
void LDUserSetCustomAttributesJSON(struct LDUser *const user, struct LDJSON *const custom)
Set the user's custom field.
LD_EXPORT
#define LD_EXPORT(x)
Used to ensure only intended symbols are exported in the binaries.
Definition: export.h:10
LDUser
An opaque user object.
LDUserSetAvatar
LDBoolean LDUserSetAvatar(struct LDUser *const user, const char *const avatar)
Set the user's avatar.
LDUserSetLastName
LDBoolean LDUserSetLastName(struct LDUser *const user, const char *const lastName)
Set the user's last name.
LDUserFree
void LDUserFree(struct LDUser *const user)
Destroy an existing user object.
json.h
Public API Interface for JSON usage.
LDUserSetIP
LDBoolean LDUserSetIP(struct LDUser *const user, const char *const ip)
Set the user's IP.
LDUserNew
struct LDUser * LDUserNew(const char *const key)
Allocate a new empty user Object.
export.h
Public. Configuration of exported symbols.