summaryrefslogtreecommitdiff
path: root/source3/lib/genparser_samba.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/genparser_samba.c')
-rw-r--r--source3/lib/genparser_samba.c82
1 files changed, 41 insertions, 41 deletions
diff --git a/source3/lib/genparser_samba.c b/source3/lib/genparser_samba.c
index 6c700d1094..bece587747 100644
--- a/source3/lib/genparser_samba.c
+++ b/source3/lib/genparser_samba.c
@@ -22,25 +22,25 @@
/* PARSE functions */
-int gen_parse_uint8(char *ptr, const char *str)
+int gen_parse_uint8(TALLOC_CTX *mem_ctx, char *ptr, const char *str)
{
*(uint8 *)ptr = atoi(str);
return 0;
}
-int gen_parse_uint16(char *ptr, const char *str)
+int gen_parse_uint16(TALLOC_CTX *mem_ctx, char *ptr, const char *str)
{
*(uint16 *)ptr = atoi(str);
return 0;
}
-int gen_parse_uint32(char *ptr, const char *str)
+int gen_parse_uint32(TALLOC_CTX *mem_ctx, char *ptr, const char *str)
{
*(uint32 *)ptr = strtoul(str, NULL, 10);
return 0;
}
-int gen_parse_NTTIME(char *ptr, const char *str)
+int gen_parse_NTTIME(TALLOC_CTX *mem_ctx, char *ptr, const char *str)
{
if(sscanf(str, "%u,%u", &(((NTTIME *)(ptr))->high), &(((NTTIME *)(ptr))->low)) != 2) {
errno = EINVAL;
@@ -49,19 +49,19 @@ int gen_parse_NTTIME(char *ptr, const char *str)
return 0;
}
-int gen_parse_DOM_SID(char *ptr, const char *str)
+int gen_parse_DOM_SID(TALLOC_CTX *mem_ctx, char *ptr, const char *str)
{
if(!string_to_sid((DOM_SID *)ptr, str)) return -1;
return 0;
}
-int gen_parse_SEC_ACCESS(char *ptr, const char *str)
+int gen_parse_SEC_ACCESS(TALLOC_CTX *mem_ctx, char *ptr, const char *str)
{
((SEC_ACCESS *)ptr)->mask = strtoul(str, NULL, 10);
return 0;
}
-int gen_parse_GUID(char *ptr, const char *str)
+int gen_parse_GUID(TALLOC_CTX *mem_ctx, char *ptr, const char *str)
{
int info[GUID_SIZE];
int i;
@@ -89,27 +89,27 @@ int gen_parse_GUID(char *ptr, const char *str)
return 0;
}
-int gen_parse_SEC_ACE(char *ptr, const char *str)
+int gen_parse_SEC_ACE(TALLOC_CTX *mem_ctx, char *ptr, const char *str)
{
- return gen_parse_struct(pinfo_security_ace_info, ptr, str);
+ return gen_parse_struct(mem_ctx, pinfo_security_ace_info, ptr, str);
}
-int gen_parse_SEC_ACL(char *ptr, const char *str)
+int gen_parse_SEC_ACL(TALLOC_CTX *mem_ctx, char *ptr, const char *str)
{
- return gen_parse_struct(pinfo_security_acl_info, ptr, str);
+ return gen_parse_struct(mem_ctx, pinfo_security_acl_info, ptr, str);
}
-int gen_parse_SEC_DESC(char *ptr, const char *str)
+int gen_parse_SEC_DESC(TALLOC_CTX *mem_ctx, char *ptr, const char *str)
{
- return gen_parse_struct(pinfo_security_descriptor_info, ptr, str);
+ return gen_parse_struct(mem_ctx, pinfo_security_descriptor_info, ptr, str);
}
-int gen_parse_LUID_ATTR(char *ptr, const char *str)
+int gen_parse_LUID_ATTR(TALLOC_CTX *mem_ctx, char *ptr, const char *str)
{
- return gen_parse_struct(pinfo_luid_attr_info, ptr, str);
+ return gen_parse_struct(mem_ctx, pinfo_luid_attr_info, ptr, str);
}
-int gen_parse_LUID(char *ptr, const char *str)
+int gen_parse_LUID(TALLOC_CTX *mem_ctx, char *ptr, const char *str)
{
if(sscanf(str, "%u,%u", &(((LUID *)(ptr))->high), &(((LUID *)(ptr))->low)) != 2) {
errno = EINVAL;
@@ -122,79 +122,79 @@ int gen_parse_LUID(char *ptr, const char *str)
/* DUMP functions */
-int gen_dump_uint8(struct parse_string *p, const char *ptr, unsigned indent)
+int gen_dump_uint8(TALLOC_CTX *mem_ctx, struct parse_string *p, const char *ptr, unsigned indent)
{
- return addshort(p, "%u", *(uint8 *)(ptr));
+ return addshort(mem_ctx, p, "%u", *(uint8 *)(ptr));
}
-int gen_dump_uint16(struct parse_string *p, const char *ptr, unsigned indent)
+int gen_dump_uint16(TALLOC_CTX *mem_ctx, struct parse_string *p, const char *ptr, unsigned indent)
{
- return addshort(p, "%u", *(uint16 *)(ptr));
+ return addshort(mem_ctx, p, "%u", *(uint16 *)(ptr));
}
-int gen_dump_uint32(struct parse_string *p, const char *ptr, unsigned indent)
+int gen_dump_uint32(TALLOC_CTX *mem_ctx, struct parse_string *p, const char *ptr, unsigned indent)
{
- return addshort(p, "%u", *(uint32 *)(ptr));
+ return addshort(mem_ctx, p, "%u", *(uint32 *)(ptr));
}
-int gen_dump_NTTIME(struct parse_string *p, const char *ptr, unsigned indent)
+int gen_dump_NTTIME(TALLOC_CTX *mem_ctx, struct parse_string *p, const char *ptr, unsigned indent)
{
uint32 low, high;
high = ((NTTIME *)(ptr))->high;
low = ((NTTIME *)(ptr))->low;
- return addshort(p, "%u,%u", high, low);
+ return addshort(mem_ctx, p, "%u,%u", high, low);
}
-int gen_dump_DOM_SID(struct parse_string *p, const char *ptr, unsigned indent)
+int gen_dump_DOM_SID(TALLOC_CTX *mem_ctx, struct parse_string *p, const char *ptr, unsigned indent)
{
fstring sidstr;
sid_to_string(sidstr, (DOM_SID *)ptr);
- return addstr(p, sidstr);
+ return addstr(mem_ctx, p, sidstr);
}
-int gen_dump_SEC_ACCESS(struct parse_string *p, const char *ptr, unsigned indent)
+int gen_dump_SEC_ACCESS(TALLOC_CTX *mem_ctx, struct parse_string *p, const char *ptr, unsigned indent)
{
- return addshort(p, "%u", ((SEC_ACCESS *)ptr)->mask);
+ return addshort(mem_ctx, p, "%u", ((SEC_ACCESS *)ptr)->mask);
}
-int gen_dump_GUID(struct parse_string *p, const char *ptr, unsigned indent)
+int gen_dump_GUID(TALLOC_CTX *mem_ctx, struct parse_string *p, const char *ptr, unsigned indent)
{
int i, r;
for (i = 0; i < (GUID_SIZE - 1); i++) {
- if (!(r = addshort(p, "%d,", ((GUID *)ptr)->info[i]))) return r;
+ if (!(r = addshort(mem_ctx, p, "%d,", ((GUID *)ptr)->info[i]))) return r;
}
- return addshort(p, "%d", ((GUID *)ptr)->info[i]);
+ return addshort(mem_ctx, p, "%d", ((GUID *)ptr)->info[i]);
}
-int gen_dump_SEC_ACE(struct parse_string *p, const char *ptr, unsigned indent)
+int gen_dump_SEC_ACE(TALLOC_CTX *mem_ctx, struct parse_string *p, const char *ptr, unsigned indent)
{
- return gen_dump_struct(pinfo_security_ace_info, p, ptr, indent);
+ return gen_dump_struct(mem_ctx, pinfo_security_ace_info, p, ptr, indent);
}
-int gen_dump_SEC_ACL(struct parse_string *p, const char *ptr, unsigned indent)
+int gen_dump_SEC_ACL(TALLOC_CTX *mem_ctx, struct parse_string *p, const char *ptr, unsigned indent)
{
- return gen_dump_struct(pinfo_security_acl_info, p, ptr, indent);
+ return gen_dump_struct(mem_ctx, pinfo_security_acl_info, p, ptr, indent);
}
-int gen_dump_SEC_DESC(struct parse_string *p, const char *ptr, unsigned indent)
+int gen_dump_SEC_DESC(TALLOC_CTX *mem_ctx, struct parse_string *p, const char *ptr, unsigned indent)
{
- return gen_dump_struct(pinfo_security_descriptor_info, p, ptr, indent);
+ return gen_dump_struct(mem_ctx, pinfo_security_descriptor_info, p, ptr, indent);
}
-int gen_dump_LUID_ATTR(struct parse_string *p, const char *ptr, unsigned indent)
+int gen_dump_LUID_ATTR(TALLOC_CTX *mem_ctx, struct parse_string *p, const char *ptr, unsigned indent)
{
- return gen_dump_struct(pinfo_luid_attr_info, p, ptr, indent);
+ return gen_dump_struct(mem_ctx, pinfo_luid_attr_info, p, ptr, indent);
}
-int gen_dump_LUID(struct parse_string *p, const char *ptr, unsigned indent)
+int gen_dump_LUID(TALLOC_CTX *mem_ctx, struct parse_string *p, const char *ptr, unsigned indent)
{
uint32 low, high;
high = ((LUID *)(ptr))->high;
low = ((LUID *)(ptr))->low;
- return addshort(p, "%u,%u", high, low);
+ return addshort(mem_ctx, p, "%u,%u", high, low);
}