File: align_string.c

package info (click to toggle)
libffi-platypus-perl 2.10-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,860 kB
  • sloc: perl: 7,388; ansic: 6,862; cpp: 53; sh: 19; makefile: 14
file content (27 lines) | stat: -rw-r--r-- 392 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
#include "libtest.h"

typedef struct {
  char mess_up_alignment;
  const char *value;
} foo_t;

EXTERN const char *
align_string_get_value(foo_t *foo)
{
  return foo->value;
}

EXTERN void
align_string_set_value(foo_t *foo, const char *value)
{
  static char buffer[512];
  if(value != NULL)
  {
    strcpy(buffer, value);
    foo->value = buffer;
  }
  else
  {
    foo->value = NULL;
  }
}