1 // written in the D programming language 2 /** 3 * Copyright: © 2014-2016 Anton Gushcha 4 * License: Subject to the terms of the MIT license, as written in the included LICENSE file. 5 * Authors: Anton Gushcha <ncrashed@gmail.com> 6 */ 7 module daemonize..string; 8 9 import core.stdc..string; 10 11 static if (__VERSION__ < 2066) 12 { 13 // from upcoming release of phobos 14 /** 15 * Returns a D-style array of $(B char) given a zero-terminated C-style string. 16 * The returned array will retain the same type qualifiers as the input. 17 * 18 * $(B Important Note:) The returned array is a slice of the original buffer. 19 * The original data is not changed and not copied. 20 */ 21 inout(char)[] fromStringz(inout(char)* cString) @system pure 22 { 23 return cString ? cString[0 .. strlen(cString)] : null; 24 } 25 } 26 else 27 { 28 public import std..string; 29 }