Commit Graph

149 Commits

Author SHA1 Message Date
Joel Rosdahl
95f1260b50 Add hash_file2() and hash_fd2() functions that update two hash sums 2010-09-05 10:28:29 +02:00
Joel Rosdahl
0a6b820cc4 Use bool, true and false for boolean values 2010-08-29 13:26:55 +02:00
Joel Rosdahl
d8880584ec Introduce system.h 2010-08-29 11:54:08 +02:00
Joel Rosdahl
c85386d928 Extract knowledge about languages and extensions into a separate file 2010-08-29 10:50:44 +02:00
Joel Rosdahl
c358e7c801 Read files into memory instead of using mmap()
This has two benefits:

- It's more robust against file changes during reading.
- It improves performance on poor systems where mmap() doesn't use the disk
  cache.
2010-08-26 22:23:32 +02:00
Joel Rosdahl
0d16041092 Implement read_file() for reading an arbitrary file into memory 2010-08-26 22:03:33 +02:00
Joel Rosdahl
4ac86e614b Rename read_file() to read_text_file() 2010-08-26 21:07:43 +02:00
Joel Rosdahl
95dbcc38cb Add x_calloc() 2010-08-25 22:11:10 +02:00
Joel Rosdahl
d8927d46cb Add support for using precompiled headers if -fpch-preprocess is used 2010-08-21 16:46:51 +02:00
Joel Rosdahl
76a2b0f0c5 Generalize cc_log_executed_command 2010-08-14 21:14:07 +02:00
Joel Rosdahl
54fd1b1765 Put args declarations higher up in ccache.h 2010-08-14 21:14:07 +02:00
Joel Rosdahl
861184b725 Add args_set() function 2010-08-14 21:14:07 +02:00
Joel Rosdahl
65c847fa22 Add hash_equal() function 2010-08-14 21:14:07 +02:00
Joel Rosdahl
f86dbeaf3c Put functions in hash.c in a more natural order 2010-08-14 21:14:07 +02:00
Joel Rosdahl
18cc772aa6 Add support for running a custom command to identify the compiler 2010-08-11 08:17:42 +02:00
Joel Rosdahl
16b25cac09 Make reading and writing of statistics counters forward-compatible
Previously, ccache threw away counters values it didn't know about, i.e., new
counters coming from later ccache versions.
2010-08-04 11:03:40 +02:00
Joel Rosdahl
01fa3dfbf4 Explicitly set values of enum stats since they are important 2010-08-04 10:39:02 +02:00
Joel Rosdahl
52c4606d2c Move read_file from test/util.c to util.c 2010-08-03 23:09:16 +02:00
Joel Rosdahl
8c071cf6e0 Isolate knowledge of the counters data structure to stats.c 2010-08-03 17:27:41 +02:00
Joel Rosdahl
530dfe7c11 Format code to use a more consistent coding style 2010-08-01 17:20:33 +02:00
Joel Rosdahl
7daab1e4c2 Use lock files instead of POSIX locks when writing stats files
When writing a stats file, locking is now done by atomically creating a
symlink with lockfile_acquire() instead of locking with fcntl(). Updating
of the stats file while holding the lock is done using the
rename-into-place idiom since the lock may be intentionally broken by
another process, and if that happens, there should be no file corruption,
only lost information.

The major reason for the change is to be more robust against badly
implemented or configured network filesystems (e.g. NFS) where POSIX locks
may be broken in different ways.
2010-08-01 17:20:33 +02:00
Joel Rosdahl
852228dea5 Implement file locking primitives
Windows support is not yet done.
2010-08-01 17:20:33 +02:00
Joel Rosdahl
ff2a6f1b3a Add x_readlink() utility function 2010-08-01 17:20:33 +02:00
Joel Rosdahl
a98cbbc465 Introduce and use function-like macros str_eq() and str_startswith() 2010-08-01 17:20:15 +02:00
Joel Rosdahl
2538f20aab Introduce cc_reset(), enabling the test suite to reset global state 2010-08-01 17:20:15 +02:00
Joel Rosdahl
0ea9d9e0a3 Introduce x_rename(), which unlink()s destination if necessary before rename() 2010-07-21 15:15:42 +02:00
Joel Rosdahl
a9b2f164ff Add comments about which files declarations in ccache.h belong to 2010-07-18 14:10:29 +02:00
Joel Rosdahl
187817a707 Remove now unused x_asprintf() 2010-07-17 23:06:19 +02:00
Joel Rosdahl
8005f7a243 Add a function that formats a string in a handier way than x_asprintf 2010-07-17 22:51:29 +02:00
Joel Rosdahl
4e07d0ea7d Implement args_extend function 2010-07-17 18:49:12 +02:00
Joel Rosdahl
ca8330398f Get rid of the ARGS typedef; use struct args explicitly 2010-07-17 18:31:56 +02:00
Ramiro Polla
4d7b4810bd Win32 support 2010-07-16 16:56:43 -03:00
Ramiro Polla
3a442eb97b Implement is_full_path() helper function 2010-07-16 16:54:14 -03:00
Joel Rosdahl
8809f726ab Merge branch 'unittest'
* unittest:
  Regenerate test/suites.h on Makefile updates
  Add CHECK macros for ARGS
  Improve CHECK_{STR,UNS,INT}_EQ macros
  Let basedir("foo") return "."
  Add framework for tests written in C
  Split the main function into a separate compilation unit
  Simplify getopt_long() usage
  Add args_init_from_string function
  Add stats_get_pending() function
  Include all dependency files in .deps to make it work with sources in subdirs

Conflicts:
	configure.ac
2010-07-16 17:08:15 +02:00
Joel Rosdahl
2bacab3f92 Use semicolon as the CCACHE_EXTRAFILES path separator on Windows 2010-07-16 16:56:48 +02:00
Ramiro Polla
f38e9f397a Add a define for path delimiter 2010-07-16 16:19:54 +02:00
Ramiro Polla
6014657219 Implement compare_executable_name() helper function 2010-07-16 16:03:00 +02:00
Ramiro Polla
82b7876473 Implement is_absolute_path() helper function 2010-07-16 16:01:02 +02:00
Ramiro Polla
1fc590556f Introduce and use x_fmmap() and x_munmap()
x_fmmap() opens, stats, and mmap()s a file. x_munmap() is currently just a
wrapper around munmap().
2010-07-16 15:45:52 +02:00
Joel Rosdahl
033d21e329 Add CHECK macros for ARGS 2010-07-16 14:40:21 +02:00
Joel Rosdahl
d674630d24 Add args_init_from_string function 2010-07-15 19:20:33 +02:00
Joel Rosdahl
117e0c6e3a Add stats_get_pending() function 2010-07-15 19:20:33 +02:00
Joel Rosdahl
a417ea68b2 Add exit functions functionality 2010-07-14 18:59:06 +02:00
Joel Rosdahl
fdad44c641 Let stats_update() update counters in memory and stats_flush() write to disk 2010-07-14 15:57:57 +02:00
Joel Rosdahl
62511a1d5f Rename process_args to cc_process_args and let it return failure status 2010-07-14 14:12:00 +02:00
Joel Rosdahl
342dae0d59 Include git revision info in version number 2010-06-09 21:10:03 +02:00
Joel Rosdahl
7acf0db7ab Count actual cache size and number of files again 2010-06-08 23:12:24 +02:00
Joel Rosdahl
ba0be15954 Rename "not a C/C++ file" counter to "unsupported source language" 2010-06-03 22:07:39 +02:00
Joel Rosdahl
2d3de36d24 Add args_copy function 2010-06-02 23:28:36 +02:00
Joel Rosdahl
dd153c944a Fix handling of -finput-charset when CCACHE_CPP2 is in effect 2010-06-02 20:25:36 +02:00