File: types.c

package info (click to toggle)
libproplist 0.7.1-4
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 684 kB
  • ctags: 452
  • sloc: ansic: 3,684; sh: 1,856; lex: 181; yacc: 118; makefile: 106; tcl: 40
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;
}