2 * Copyright (c) 2010-2011 Matthias Rustler
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included
12 * in all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
25 #include "identify_intern.h"
27 static STRPTR
finddollar(TEXT
*t
);
29 /*****************************************************************************
32 #include <proto/identify.h>
34 AROS_LH2(ULONG
, IdEstimateFormatSize
,
37 AROS_LHA(STRPTR
, string
, A0
),
38 AROS_LHA(struct TagItem
*, tags
, A1
),
41 struct IdentifyBaseIntern
*, IdentifyBase
, 12, Identify
)
44 Estimates the size of the buffer that will contain the output
45 of the format string when used on IdFormatString().
48 String -- (STRPTR) Format string
49 Tags -- (struct TagItem *) Tags, currently NULL or TAG_DONE.
52 Length -- (ULONG) Length of the buffer size that will
53 be able to hold the entire result.
59 The returned size will be large enough to contain the result
60 of a IdFormatString(). It is not necessarily the size of the
61 resulting buffer (the result length of IdFormatString()).
68 IdHardware(), IdFormatString()
75 *****************************************************************************/
101 from
= finddollar(from
);
102 result
+= STRBUFSIZE
;
115 } /* IdEstimateFormatSize */
118 static STRPTR
finddollar(TEXT
*t
)
120 while (*t
&& *t
!= '$')