File: types.c

package info (click to toggle)
libproplist 0.9.1-2
  • links: PTS
  • area: main
  • in suites: potato
  • size: 772 kB
  • ctags: 381
  • sloc: sh: 8,260; ansic: 2,786; lex: 172; yacc: 139; makefile: 79
file content (29 lines) | stat: -rw-r--r-- 762 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/* types.c: This is -*- c -*-

 This file contains routines for setting up the elementary
 (i.e. simple) types string and data. */

#include "proplistP.h"
#include "util.h"

proplist_t PLMakeString(unsigned char *bytes)
{
  plptr_t internal = MyMalloc(__FILE__, __LINE__, sizeof(plint_t));
  internal->type = PLSTRING;
  internal->filename = NULL;
  internal->container = NULL;
  internal->str.string = bytes;
  return (proplist_t)internal;
}

proplist_t PLMakeData(unsigned char *data, unsigned int length)
{
  plptr_t internal = MyMalloc(__FILE__, __LINE__, sizeof(plint_t));
  internal->type = PLDATA;
  internal->filename = NULL;
  internal->container = NULL;
  internal->data.data = data;
  internal->data.length = length;
  return (proplist_t)internal;
}