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

Side by Side Diff: base/third_party/xdg_mime/xdgmimeint.c

Issue 10824186: Linux: update base/third_party/xdg_mime from upstream. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « base/third_party/xdg_mime/xdgmimeint.h ('k') | base/third_party/xdg_mime/xdgmimemagic.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* -*- mode: C; c-file-style: "gnu" -*- */ 1 /* -*- mode: C; c-file-style: "gnu" -*- */
2 /* xdgmimeint.c: Internal defines and functions. 2 /* xdgmimeint.c: Internal defines and functions.
3 * 3 *
4 * More info can be found at http://www.freedesktop.org/standards/ 4 * More info can be found at http://www.freedesktop.org/standards/
5 * 5 *
6 * Copyright (C) 2003 Red Hat, Inc. 6 * Copyright (C) 2003 Red Hat, Inc.
7 * Copyright (C) 2003 Jonathan Blandford <jrb@alum.mit.edu> 7 * Copyright (C) 2003 Jonathan Blandford <jrb@alum.mit.edu>
8 * 8 *
9 * Licensed under the Academic Free License version 2.0 9 * Licensed under the Academic Free License version 2.0
10 * Or under the following terms: 10 * Or under the following terms:
11 * 11 *
12 * This library is free software; you can redistribute it and/or 12 * This library is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Lesser General Public 13 * modify it under the terms of the GNU Lesser General Public
14 * License as published by the Free Software Foundation; either 14 * License as published by the Free Software Foundation; either
15 * version 2 of the License, or (at your option) any later version. 15 * version 2 of the License, or (at your option) any later version.
16 * 16 *
17 * This library is distributed in the hope that it will be useful, 17 * This library is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Lesser General Public License for more details. 20 * Lesser General Public License for more details.
21 * 21 *
22 * You should have received a copy of the GNU Lesser General Public 22 * You should have received a copy of the GNU Lesser General Public
23 * License along with this library; if not, write to the 23 * License along with this library; if not, write to the
24 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 24 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
25 * Boston, MA 02111-1307, USA. 25 * Boston, MA 02111-1307, USA.
26 */ 26 */
27 27
28 #ifdef HAVE_CONFIG_H 28 #ifdef HAVE_CONFIG_H
29 #include "config.h" 29 #include <config.h>
30 #endif 30 #endif
31 31
32 #include "xdgmimeint.h" 32 #include "xdgmimeint.h"
33 #include <ctype.h> 33 #include <ctype.h>
34 #include <string.h> 34 #include <string.h>
35 35
36 #ifndef FALSE 36 #ifndef FALSE
37 #define FALSE (0) 37 #define FALSE (0)
38 #endif 38 #endif
39 39
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 int i; 182 int i;
183 183
184 for (i = 0; i < len - i - 1; i++) 184 for (i = 0; i < len - i - 1; i++)
185 { 185 {
186 c = source[i]; 186 c = source[i];
187 source[i] = source[len - i - 1]; 187 source[i] = source[len - i - 1];
188 source[len - i - 1] = c; 188 source[len - i - 1] = c;
189 } 189 }
190 } 190 }
191 191
192 const char *
193 _xdg_binary_or_text_fallback(const void *data, size_t len)
194 {
195 unsigned char *chardata;
196 int i;
197
198 chardata = (unsigned char *) data;
199 for (i = 0; i < 32 && i < len; ++i)
200 {
201 if (chardata[i] < 32 && chardata[i] != 9 && chardata[i] != 10 && chardata [i] != 13)
202 return XDG_MIME_TYPE_UNKNOWN; /* binary data */
203 }
204
205 return XDG_MIME_TYPE_TEXTPLAIN;
206 }
OLDNEW
« no previous file with comments | « base/third_party/xdg_mime/xdgmimeint.h ('k') | base/third_party/xdg_mime/xdgmimemagic.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698