/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* * Copyright (C) 2000 Helix Code, Inc. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public License * as published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with the Gnome Library; see the file COPYING.LIB. If not, * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ /* index.c: high-level indexing ops */ #include #include #include #include #include #include "ibex_internal.h" /* Index a file, given its name. (Replace any previously indexed contents * of this file with the new contents.) */ int ibex_index_file (ibex *ib, char *filename) { int fd; int status; struct stat st; fd = open (filename, O_RDONLY); if (fd < 0) return -1; if (fstat (fd, &st) == -1) { close (fd); return -1; } if (!S_ISREG (st.st_mode)) { close (fd); errno = EINVAL; return -1; } ibex_unindex (ib, filename); status = ibex_index_fd (ib, filename, fd, st.st_size); close (fd); return status; } /* Given a file descriptor and a name to refer to it by, index LEN * bytes of data from it. */ int ibex_index_fd (ibex *ib, char *name, int fd, size_t len) { char *buf; int off = 0, nread, status; buf = g_malloc (len); do { nread = read (fd, buf + off, len - off); if (nread == -1) { g_free (buf); return -1; } off += nread; } while (off != len); status = ibex_index_buffer (ib, name, buf, len, NULL); g_free (buf); return status; } void ibex_unindex (ibex *ib, char *name) { ibex_file *ibf; ibf = g_tree_lookup (ib->files, name); if (ibf) { ibf->index = -1; g_tree_remove (ib->files, name); g_ptr_array_add (ib->oldfiles, ibf); } } void ibex_rename (ibex *ib, char *oldname, char *newname) { ibex_file *ibf; ibf = g_tree_lookup (ib->files, oldname); if (ibf) { g_tree_remove (ib->files, oldname); g_free (ibf->name); ibf->name = g_strdup (newname); g_tree_insert (ib->files, ibf->name, ibf); } } yarn/devel/electron4/files/minimist-1.2.3'>dependabot/npm_and_yarn/devel/electron4/files/minimist-1.2.3 FreeBSD GNOME current development ports (https://github.com/freebsd/freebsd-ports-gnome)
aboutsummaryrefslogtreecommitdiffstats
Commit message (Expand)AuthorAgeFilesLines
* Since there is not going to be any new version of GCC in the FreeBSDgerald2015-04-231-16/+13
* Move LANG_GCC_IS from bsd.gcc.mk to bsd.default-versions.mk and usegerald2015-01-261-3/+0
* Rename the somewhat confusingly named GCC_DEFAULT_V to LANG_GCC_IS.gerald2015-01-041-2/+2
* Update examples to use GCC 4.9 instead of 4.8, since the latter is nowgerald2014-11-071-2/+2
* Add support for USE_GCC=5 and its preferred form USE_GCC=5+.gerald2014-11-031-1/+2
* Depend on lang/gccXY if users wish to use a different version of gcc bytijl2014-09-271-2/+3
* Refer to bsd.default-versions.mk for the canonical version of GCC; nogerald2014-03-161-3/+2
* Update the default version of GCC used in the Ports Collection fromgerald2014-03-111-1/+1
* Revert bogus parts of revision 345909.gerald2014-02-251-1/+1
* Reword the documentation at the top of this file.gerald2014-02-251-1/+1
* Replace all uses of GCC_DEFAULT_VERSION by GCC_DEFAULT, remove thegerald2014-02-251-6/+7
* Remove the _GCC_BUILD_DEPENDS variable which we had kept for the sakegerald2014-02-231-3/+0
* Convert all USE_FORTRAN=yes to "USES=fortran, USE_GCC=yes". In most casestijl2014-02-171-49/+1
* Unregister lang/gcc44 now that it is no longer used by any port.rene2014-01-271-2/+1
* Disconnect lang/gcc34 from bsd.gcc.mk, it is not used by any port anymore.rene2014-01-041-12/+1
* Explicitly include the GCC run time directory in LDFLAGS. This shouldgerald2013-12-081-1/+1
* Unbreak USE_GCC=any. We do need to keep GCC 4.2 in our internal tablesgerald2013-11-231-1/+2
* Bye, bye lang/gcc42 aka GCC 4.2. As a port you have served us well,gerald2013-11-231-5/+2
* Document USE_GCC=any. Reformat the description a bit and use newergerald2013-11-111-5/+11
* Add support for USE_GCC=4.9 and USE_GCC=4.9+.gerald2013-10-141-1/+2
* Merge two loops and initialize _GCC_FOUND${v} and check whether USE_GCCgerald2013-03-291-14/+9
* When the same version of GCC is present as a port and in base, prefergerald2013-03-201-4/+2
* Simplify (and strictly speaking, though not practically given versiongerald2013-03-161-4/+6
* Do not just rely on the version number of FreeBSD in deciding whethergerald2013-03-031-3/+5
* Remove a bogus old check that assumes that every version of FreeBSD hasgerald2013-03-021-5/+1
* Fix when bsd.gcc.mk is included and USE_GCC is undefined for example in case abapt2012-12-231-1/+1
* Add a new form of USE_GCC, USE_GCC=yes, which generically requestsgerald2012-12-231-4/+14
* In addition to CFLAGS and LDFLAGS now also CXXFLAGS set an rpath togerald2012-11-061-0/+1
* Introduce the new semantic USE_GCC=any, which can be set in any portlinimon2012-10-081-4/+23
* Introduce _GCC_RUNTIME, to be used by ports in need of knowing thegerald2012-08-041-3/+4
* Add support for USE_GCC=4.8, USE_GCC=4.8+, and generally detectgerald2012-08-041-1/+2
* Use the stable, slow moving lang/gcc instead of lang/gcc46 forgerald2012-08-031-7/+14
* - Revert accidental commitsunpoet2012-06-261-8/+1
* - Add shared TLS descriptionsunpoet2012-06-261-1/+8
* - Remove emacs mode, -*- mode: ...; -*- [1]miwi2012-05-231-1/+1
* Remove last reference to GCC 4.5 now that no port refers to it any more.gerald2012-04-291-5/+0
* Disconnect GCC 4.5 alias lang/gcc45.gerald2011-11-131-3/+7
* Fix mis-applied patch from revision 1.59 (moving the new code onegerald2011-10-311-4/+5
* Refer to GCC 4.7 instead of GCC 4.5. Mark the part that should not seegerald2011-10-301-3/+2
* When USE_GCC=X.Y+ has been specified, prefer the default version ofgerald2011-10-301-4/+9
* Fix the previous commit for the case where USE_FORTRAN is undefined.gerald2011-10-081-0/+2
* Reference the GCC run-time libraries via FFLAGS, too, in addition togerald2011-10-081-0/+3
* Make USE_FORTRAN=yes imply the use of GCC 4.6 over GCC 4.5 so far.gerald2011-09-191-4/+4
* Cater to versions of FreeBSD greater than 9 (up to 99). [1]gerald2011-09-101-6/+6
* Refer to GCC 4.2+ instead of GCC 3.4+ in a comment, since the latter isgerald2011-09-051-1/+1
* Clean up after revision 1.51 and adjust comments to the new reality of usgerald2011-08-011-4/+2
* Add support for USE_GCC=4.7, USE_GCC=4.7+ and notably an installation ofgerald2011-07-201-1/+2
* Latest round of infrastructure changes.flz2011-05-051-8/+0
* lang/gcc44 and later depend on the devel/binutils port. Leverage thatgerald2011-02-011-0/+5
* Simplify the case of USE_FORTRAN=g77. Update a comment.gerald2010-10-171-8/+4
* In addition to CC and CXX now also set CPP with USE_GCC. Add the outputgerald2010-09-281-2/+3
* USE_FORTRAN=yes now implies lang/gcc45 up from lang/gcc44.gerald2010-09-251-4/+4
* Remove the transparent rewriting of USE_GCC=4.3+ to USE_GCC=4.4+.gerald2010-09-051-6/+0
* Disconnect lang/gcc43, that is, USE_GCC=4.3 is not supported any longer.gerald2010-08-071-5/+2
* Extend and clarify the documentation for USE_GCC, making it explicitgerald2010-06-121-5/+5
* Tweak a conditional added in the previous commit that apparently causesgerald2010-06-071-2/+2
* USE_GCC=4.3 is deprecated (and no port uses it anymore). USE_GCC=4.3+gerald2010-06-071-1/+9
* Add support for early GCC 4.6 snapshots (lang/gcc46) via USE_GCC=4.6gerald2010-05-031-1/+2
* Replace the use of GCC 4.3 in a comment/example by GCC 4.5 since thegerald2010-05-021-1/+1
* Locate the GCC run-time libraries under ${LOCALBASE}, where the GCCgerald2010-02-151-2/+2
* Split the logic around USE_GCC in two parts. The first handles thegerald2010-01-021-33/+30
* Quote the output for BUILD_DEPENDS and RUN_DEPENDS in the test-gccgerald2010-01-021-2/+2
* Add a run-time dependency for all uses of lang/gcc* except for gcc34gerald2010-01-021-1/+4
* Add support for USE_GCC=4.5 and USE_GCC=4.5+. Improve the documentationgerald2009-10-101-3/+4
* Have CFLAGS and LDFLAGS set an -rpath to the lang/gcc44 library directorygerald2009-09-261-0/+2
* Also print LDFLAGS as part of the test-gcc target. Print quotes aroundgerald2009-09-241-2/+3
* USE_FORTRAN=yes now implies lang/gcc44 up from lang/gcc43. Remove onegerald2009-09-131-8/+8
* Tweak some comments. The two non-whitespace changes are a fix fromgerald2009-07-131-5/+5
* Remove support for USE_GCC=2.95 after lang/gcc295 has been failing togerald2009-06-201-2/+1
* Remove GCC 2.8 from the list of options for USE_GCC; the lang/gcc28gerald2009-03-291-2/+1
* Remove support for GCC 3.3. No port in the tree uses this any longer,gerald2009-03-081-2/+1
* Set CC and CXX to match the choice of GNU Fortran compilers for C andgerald2009-02-021-6/+15
* Add support for USE_GCC=4.4+ and remove USE_GCC=4.1+ (which is not usedgerald2009-01-181-2/+2
* Fix typo.maho2009-01-061-1/+1
* Add RUN_DEPENDS as well when we specify USE_FORTRAN.maho2009-01-061-0/+3
* Fix whitespace to four rows per tab style, update version numbers in thegerald2009-01-061-7/+6
* When USE_FORTRAN is specified, add F77, FC, and FFLAGS to CONFIGURE_ENVgerald2009-01-061-1/+2
* Update USE_FORTRAN=yes to leverage lang/gcc43 instead of lang/gcc42gerald2009-01-051-5/+5
* Remove support for GCC 2.7 (the lang/gcc27 port) which, as it turns out,gerald2008-08-171-2/+1
* Remove support for GCC 3.2 which is not used by a port anymore (andgerald2008-08-171-2/+1
* - Add CC and CXX to MAKE_ENV for all portspav2008-07-251-2/+0
* Provide the test-gcc target and at least key information there even ifgerald2008-06-291-3/+9
* Add support for GCC 4.3 (lang/gcc43), to be enabled by USE_GCC=4.3+.gerald2008-05-061-1/+2
* Remove lang/gcc40 which only has three dependencies left in the treegerald2007-11-061-2/+1
* - Pass FFLAGS to make when USE_FORTRAN is set [1]pav2007-07-281-4/+6
* Add USE_FORTRAN knob. All ports that use FORTRAN shouldmaho2007-07-121-22/+54
* Recognize gcc42 in 7-CURRENT basepav2007-05-201-2/+2
* - Transfer maintainership of this file to Gerald Pfeiferpav2007-01-291-1/+1
* Make WITH_FORTRAN use lang/gcc42 (which now builds the Fortran frontend bygerald2007-01-061-3/+4
* * Split bsd.port.mk pre and post includes into 3 pieces instead of 2, tolinimon2006-10-011-7/+25
* * Change all bogus uses of BROKEN to IGNORE. Note: the BROKEN_WITH_*linimon2006-07-051-2/+2
* - Fix 'all-depends-list' target in cases if dependencies list iskrion2006-01-221-2/+2
* Add support for lang/gcc42edwin2006-01-211-1/+2
* Remove gcc3.1krion2005-08-011-5/+4
* Add support for USE_GCC=2.8 (*)edwin2005-06-061-2/+3
* USE_GCC=X.Y+ should prefer the stock compileredwin2005-06-031-3/+12
* [patch] Include gcc 4.1 in Mk/bsd.gcc.mkedwin2005-05-211-1/+2