Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(532)

Side by Side Diff: gdb/common/format.h

Issue 11969036: Merge GDB 7.5.1 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@master
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gdb/common/buffer.c ('k') | gdb/common/format.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /* Parse a printf-style format string.
2
3 Copyright (C) 1986-2012 Free Software Foundation, Inc.
4
5 This file is part of GDB.
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
19
20 #if defined(__MINGW32__) && !defined(PRINTF_HAS_LONG_LONG)
21 # define USE_PRINTF_I64 1
22 # define PRINTF_HAS_LONG_LONG
23 #else
24 # define USE_PRINTF_I64 0
25 #endif
26
27 /* The argclass represents the general type of data that goes with a
28 format directive; int_arg for %d, long_arg for %l, and so forth.
29 Note that these primarily distinguish types by size and need for
30 special handling, so for instance %u and %x are (at present) also
31 classed as int_arg. */
32
33 enum argclass
34 {
35 literal_piece,
36 int_arg, long_arg, long_long_arg, ptr_arg,
37 string_arg, wide_string_arg, wide_char_arg,
38 double_arg, long_double_arg, decfloat_arg
39 };
40
41 /* A format piece is a section of the format string that may include a
42 single print directive somewhere in it, and the associated class
43 for the argument. */
44
45 struct format_piece
46 {
47 char *string;
48 enum argclass argclass;
49 };
50
51 /* Return an array of printf fragments found at the given string, and
52 rewrite ARG with a pointer to the end of the format string. */
53
54 extern struct format_piece *parse_format_string (char **arg);
55
56 /* Given a pointer to an array of format pieces, free any memory that
57 would have been allocated by parse_format_string. */
58
59 extern void free_format_pieces (struct format_piece *frags);
60
61 /* Freeing, cast as a cleanup. */
62
63 extern void free_format_pieces_cleanup (void *);
OLDNEW
« no previous file with comments | « gdb/common/buffer.c ('k') | gdb/common/format.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698