source: rtems/cpukit/score/src/wkstringduplicate.c @ eea7c937

4.115
Last change on this file since eea7c937 was 1b475860, checked in by Christopher Kerl <zargyyoyo@…>, on 11/29/12 at 19:39:17

score misc: Score misc: Clean up Doxygen #6 (GCI 2012)

This patch is a task from GCI 2012 which improves the Doxygen
comments in the RTEMS source.

http://www.google-melange.com/gci/task/view/google/gci2012/7976215

  • Property mode set to 100644
File size: 772 bytes
Line 
1/**
2 * @file
3 *
4 * @brief Duplicates String with Memory from the Workspace
5 *
6 * @ingroup ScoreWorkspace
7 */
8
9/*
10 * Copyright (c) 2011 embedded brains GmbH.  All rights reserved.
11 *
12 *  embedded brains GmbH
13 *  Obere Lagerstr. 30
14 *  82178 Puchheim
15 *  Germany
16 *  <rtems@embedded-brains.de>
17 *
18 * The license and distribution terms for this file may be
19 * found in the file LICENSE in this distribution or at
20 * http://www.rtems.com/license/LICENSE.
21 */
22
23#if HAVE_CONFIG_H
24  #include "config.h"
25#endif
26
27#include <rtems/score/wkspace.h>
28
29#include <string.h>
30
31char *_Workspace_String_duplicate(
32  const char *string,
33  size_t len
34)
35{
36  char *dup = _Workspace_Allocate(len + 1);
37
38  if (dup != NULL) {
39    dup [len] = '\0';
40    memcpy(dup, string, len);
41  }
42
43  return dup;
44}
Note: See TracBrowser for help on using the repository browser.