| 1 | '\" | 
|---|
| 2 | '\" Copyright (c) 1989-1993 The Regents of the University of California. | 
|---|
| 3 | '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. | 
|---|
| 4 | '\" | 
|---|
| 5 | '\" See the file "license.terms" for information on usage and redistribution | 
|---|
| 6 | '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. | 
|---|
| 7 | '\"  | 
|---|
| 8 | '\" RCS: @(#) $Id: Concat.3,v 1.9 2005/05/10 18:33:54 kennykb Exp $ | 
|---|
| 9 | '\"  | 
|---|
| 10 | .so man.macros | 
|---|
| 11 | .TH Tcl_Concat 3 7.5 Tcl "Tcl Library Procedures" | 
|---|
| 12 | .BS | 
|---|
| 13 | .SH NAME | 
|---|
| 14 | Tcl_Concat \- concatenate a collection of strings | 
|---|
| 15 | .SH SYNOPSIS | 
|---|
| 16 | .nf | 
|---|
| 17 | \fB#include <tcl.h>\fR | 
|---|
| 18 | .sp | 
|---|
| 19 | const char * | 
|---|
| 20 | \fBTcl_Concat\fR(\fIargc, argv\fR) | 
|---|
| 21 | .SH ARGUMENTS | 
|---|
| 22 | .AS "const char *const" argv[] | 
|---|
| 23 | .AP int argc in | 
|---|
| 24 | Number of strings. | 
|---|
| 25 | .AP "const char *const" argv[] in | 
|---|
| 26 | Array of strings to concatenate.  Must have \fIargc\fR entries. | 
|---|
| 27 | .BE | 
|---|
| 28 |  | 
|---|
| 29 | .SH DESCRIPTION | 
|---|
| 30 | .PP | 
|---|
| 31 | \fBTcl_Concat\fR is a utility procedure used by several of the | 
|---|
| 32 | Tcl commands.  Given a collection of strings, it concatenates | 
|---|
| 33 | them together into a single string, with the original strings | 
|---|
| 34 | separated by spaces.  This procedure behaves differently than | 
|---|
| 35 | \fBTcl_Merge\fR, in that the arguments are simply concatenated: | 
|---|
| 36 | no effort is made to ensure proper list structure. | 
|---|
| 37 | However, in most common usage the arguments will all be proper | 
|---|
| 38 | lists themselves;  if this is true, then the result will also have | 
|---|
| 39 | proper list structure. | 
|---|
| 40 | .PP | 
|---|
| 41 | \fBTcl_Concat\fR eliminates leading and trailing white space as it | 
|---|
| 42 | copies strings from \fBargv\fR to the result.  If an element of | 
|---|
| 43 | \fBargv\fR consists of nothing but white space, then that string | 
|---|
| 44 | is ignored entirely.  This white-space removal was added to make | 
|---|
| 45 | the output of the \fBconcat\fR command cleaner-looking. | 
|---|
| 46 | .PP | 
|---|
| 47 | The result string is dynamically allocated | 
|---|
| 48 | using \fBTcl_Alloc\fR;  the caller must eventually release the space | 
|---|
| 49 | by calling \fBTcl_Free\fR. | 
|---|
| 50 | .SH "SEE ALSO" | 
|---|
| 51 | Tcl_ConcatObj | 
|---|
| 52 | .SH KEYWORDS | 
|---|
| 53 | concatenate, strings | 
|---|