From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 3160DBB9A for ; Sat, 29 Oct 2005 02:24:36 +0200 (CEST) Received: from xproxy.gmail.com (xproxy.gmail.com [66.249.82.207]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j9T0OZ8H023928 for ; Sat, 29 Oct 2005 02:24:35 +0200 Received: by xproxy.gmail.com with SMTP id s15so475004wxc for ; Fri, 28 Oct 2005 17:24:35 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=UTYhcCGoeEcKSW2G/F4GCIxoXCd6BieD9JuP0KE2kD4xExo3q/1ymRM+AJFhFqnmOvjPznI9jXoDfYcotghikvxEU7lXjMhaAvD0xwDzEYsEg+jTy2XSLjXWe+SqP99jq3Hj6BZhSoaAs8wdyZTSR9Uyht+v6aK60dFhoE+bMwU= Received: by 10.65.242.9 with SMTP id u9mr514132qbr; Fri, 28 Oct 2005 17:24:34 -0700 (PDT) Received: by 10.65.23.20 with HTTP; Fri, 28 Oct 2005 17:24:34 -0700 (PDT) Message-ID: Date: Sat, 29 Oct 2005 13:24:34 +1300 From: Jonathan Roewen To: caml-list@yquem.inria.fr Subject: [Caml-list] caml_copy_string MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Miltered: at nez-perce with ID 4362C143.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 char:01 ocaml:01 ocaml:01 data:02 data:02 caml:02 caml:02 string:03 string:03 null:05 embedded:08 itself:12 knowing:13 does:14 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_BY_IP autolearn=disabled version=3.0.3 Hi, I notice than caml_copy_string only works with null terminated C-strings. What is the alternative way to copy a random amount of char* data that contains embedded nulls into an ocaml string (knowing the length of the data)? Also, out of curiosity: does caml_copy_string reference the string itself, or does it make a full copy of it (no sharing)? IE, does modification of the C-string affect the ocaml string? Jonathan