# PaCkAgE DaTaStReAm subversion 1 66439 # end of header 0707010002c630000081a40000000000000000000000014cb7a72a000001260000010000010036ffffffffffffffff0000001300000000subversion/pkginfoPKG=subversion NAME=subversion 1.6.13 SPARC 64bit Solaris 10 VERSION=1.6.13 PSTAMP=13th October 2010 VENDOR=The Subversion Project EMAIL=http://subversion.apache.org/ DESC=Open source version control system ARCH=sparc CATEGORY=utility CLASSES=none BASEDIR=/ ISTATES=S s 1 2 3 RSTATES=S s 1 2 3 0707010002c62f000081a40000000000000000000000014cb7a72a0000368b0000010000010036ffffffffffffffff0000001200000000subversion/pkgmap: 1 66439 1 d none /usr ? ? ? 1 d none /usr/local ? ? ? 1 d none /usr/local/bin 0755 root root 1 f none /usr/local/bin/svn 0755 root root 1217632 2059 1286933903 1 f none /usr/local/bin/svnadmin 0755 root root 124248 54163 1286933904 1 f none /usr/local/bin/svndumpfilter 0755 root root 84088 28779 1286933904 1 f none /usr/local/bin/svnlook 0755 root root 154920 7054 1286933905 1 f none /usr/local/bin/svnserve 0755 root root 279536 42820 1286933906 1 f none /usr/local/bin/svnsync 0755 root root 122416 63589 1286933906 1 f none /usr/local/bin/svnversion 0755 root root 33904 10386 1286933907 1 d none /usr/local/include 0755 root root 1 d none /usr/local/include/subversion-1 0755 root root 1 f none /usr/local/include/subversion-1/mod_authz_svn.h 0644 root root 1485 54864 1286933902 1 f none /usr/local/include/subversion-1/mod_dav_svn.h 0644 root root 3296 46899 1286933902 1 f none /usr/local/include/subversion-1/svn-revision.txt 0644 root root 9 885 1286933915 1 f none /usr/local/include/subversion-1/svn_auth.h 0644 root root 44696 14679 1286933903 1 f none /usr/local/include/subversion-1/svn_base64.h 0644 root root 3430 19901 1286933902 1 f none /usr/local/include/subversion-1/svn_checksum.h 0644 root root 5753 6247 1286933902 1 f none /usr/local/include/subversion-1/svn_client.h 0644 root root 169757 52899 1286933902 1 f none /usr/local/include/subversion-1/svn_cmdline.h 0644 root root 12618 22443 1286933902 1 f none /usr/local/include/subversion-1/svn_compat.h 0644 root root 3291 5155 1286933902 1 f none /usr/local/include/subversion-1/svn_config.h 0644 root root 22775 3028 1286933902 1 f none /usr/local/include/subversion-1/svn_ctype.h 0644 root root 6210 29146 1286933902 1 f none /usr/local/include/subversion-1/svn_dav.h 0644 root root 6679 36145 1286933901 1 f none /usr/local/include/subversion-1/svn_delta.h 0644 root root 50249 58994 1286933902 1 f none /usr/local/include/subversion-1/svn_diff.h 0644 root root 28863 48186 1286933902 1 f none /usr/local/include/subversion-1/svn_dirent_uri.h 0644 root root 6929 42176 1286933902 1 f none /usr/local/include/subversion-1/svn_dso.h 0644 root root 3291 9760 1286933902 1 f none /usr/local/include/subversion-1/svn_error.h 0644 root root 17301 51122 1286933902 1 f none /usr/local/include/subversion-1/svn_error_codes.h 0644 root root 45746 52446 1286933902 1 f none /usr/local/include/subversion-1/svn_fs.h 0644 root root 76786 30786 1286933902 1 f none /usr/local/include/subversion-1/svn_hash.h 0644 root root 7092 44918 1286933902 1 f none /usr/local/include/subversion-1/svn_io.h 0644 root root 57515 5449 1286933902 1 f none /usr/local/include/subversion-1/svn_iter.h 0644 root root 4365 20204 1286933902 1 f none /usr/local/include/subversion-1/svn_md5.h 0644 root root 2426 782 1286933902 1 f none /usr/local/include/subversion-1/svn_mergeinfo.h 0644 root root 18247 23798 1286933902 1 f none /usr/local/include/subversion-1/svn_nls.h 0644 root root 1403 48808 1286933902 1 f none /usr/local/include/subversion-1/svn_opt.h 0644 root root 25589 22125 1286933902 1 f none /usr/local/include/subversion-1/svn_path.h 0644 root root 21278 59310 1286933902 1 f none /usr/local/include/subversion-1/svn_pools.h 0644 root root 2451 6391 1286933903 1 f none /usr/local/include/subversion-1/svn_props.h 0644 root root 18013 40439 1286933902 1 f none /usr/local/include/subversion-1/svn_quoprint.h 0644 root root 2418 7070 1286933903 1 f none /usr/local/include/subversion-1/svn_ra.h 0644 root root 82299 18687 1286933902 1 f none /usr/local/include/subversion-1/svn_ra_svn.h 0644 root root 17712 19619 1286933902 1 f none /usr/local/include/subversion-1/svn_repos.h 0644 root root 101813 15884 1286933902 1 f none /usr/local/include/subversion-1/svn_sorts.h 0644 root root 6218 54638 1286933902 1 f none /usr/local/include/subversion-1/svn_string.h 0644 root root 12519 20262 1286933902 1 f none /usr/local/include/subversion-1/svn_subst.h 0644 root root 20918 4378 1286933902 1 f none /usr/local/include/subversion-1/svn_time.h 0644 root root 2742 30027 1286933902 1 f none /usr/local/include/subversion-1/svn_types.h 0644 root root 32993 16847 1286933902 1 f none /usr/local/include/subversion-1/svn_user.h 0644 root root 1453 55308 1286933901 1 f none /usr/local/include/subversion-1/svn_utf.h 0644 root root 7250 50665 1286933902 1 f none /usr/local/include/subversion-1/svn_version.h 0644 root root 6946 43615 1286933902 1 f none /usr/local/include/subversion-1/svn_wc.h 0644 root root 213554 55631 1286933902 1 f none /usr/local/include/subversion-1/svn_xml.h 0644 root root 11483 8755 1286933902 1 d none /usr/local/lib 0755 root root 1 f none /usr/local/lib/libsvn_client-1.a 0644 root root 2327896 13326 1286933901 1 f none /usr/local/lib/libsvn_client-1.la 0755 root root 1796 27730 1286933901 1 s none /usr/local/lib/libsvn_client-1.so=libsvn_client-1.so.0.0.0 1 s none /usr/local/lib/libsvn_client-1.so.0=libsvn_client-1.so.0.0.0 1 f none /usr/local/lib/libsvn_client-1.so.0.0.0 0755 root root 1751936 45772 1286933901 1 f none /usr/local/lib/libsvn_delta-1.a 0644 root root 320736 50164 1286933838 1 f none /usr/local/lib/libsvn_delta-1.la 0755 root root 1300 47755 1286933838 1 s none /usr/local/lib/libsvn_delta-1.so=libsvn_delta-1.so.0.0.0 1 s none /usr/local/lib/libsvn_delta-1.so.0=libsvn_delta-1.so.0.0.0 1 f none /usr/local/lib/libsvn_delta-1.so.0.0.0 0755 root root 247704 37680 1286933838 1 f none /usr/local/lib/libsvn_diff-1.a 0644 root root 278040 17968 1286933882 1 f none /usr/local/lib/libsvn_diff-1.la 0755 root root 1293 46964 1286933882 1 s none /usr/local/lib/libsvn_diff-1.so=libsvn_diff-1.so.0.0.0 1 s none /usr/local/lib/libsvn_diff-1.so.0=libsvn_diff-1.so.0.0.0 1 f none /usr/local/lib/libsvn_diff-1.so.0.0.0 0755 root root 218144 26119 1286933882 1 f none /usr/local/lib/libsvn_fs-1.a 0644 root root 131904 12154 1286933855 1 f none /usr/local/lib/libsvn_fs-1.la 0755 root root 1415 58128 1286933855 1 s none /usr/local/lib/libsvn_fs-1.so=libsvn_fs-1.so.0.0.0 1 s none /usr/local/lib/libsvn_fs-1.so.0=libsvn_fs-1.so.0.0.0 1 f none /usr/local/lib/libsvn_fs-1.so.0.0.0 0755 root root 117704 58686 1286933855 1 f none /usr/local/lib/libsvn_fs_base-1.a 0644 root root 2550232 63415 1286933850 1 f none /usr/local/lib/libsvn_fs_base-1.la 0755 root root 1382 55430 1286933850 1 s none /usr/local/lib/libsvn_fs_base-1.so=libsvn_fs_base-1.so.0.0.0 1 s none /usr/local/lib/libsvn_fs_base-1.so.0=libsvn_fs_base-1.so.0.0.0 1 f none /usr/local/lib/libsvn_fs_base-1.so.0.0.0 0755 root root 2201280 53764 1286933850 1 f none /usr/local/lib/libsvn_fs_fs-1.a 0644 root root 988248 16309 1286933845 1 f none /usr/local/lib/libsvn_fs_fs-1.la 0755 root root 1368 54072 1286933845 1 s none /usr/local/lib/libsvn_fs_fs-1.so=libsvn_fs_fs-1.so.0.0.0 1 s none /usr/local/lib/libsvn_fs_fs-1.so.0=libsvn_fs_fs-1.so.0.0.0 1 f none /usr/local/lib/libsvn_fs_fs-1.so.0.0.0 0755 root root 703648 2927 1286933845 1 f none /usr/local/lib/libsvn_fs_util-1.a 0644 root root 25192 509 1286933841 1 f none /usr/local/lib/libsvn_fs_util-1.la 0755 root root 1314 49407 1286933841 1 s none /usr/local/lib/libsvn_fs_util-1.so=libsvn_fs_util-1.so.0.0.0 1 s none /usr/local/lib/libsvn_fs_util-1.so.0=libsvn_fs_util-1.so.0.0.0 1 f none /usr/local/lib/libsvn_fs_util-1.so.0.0.0 0755 root root 27632 14151 1286933841 1 f none /usr/local/lib/libsvn_ra-1.a 0644 root root 235480 16264 1286933890 1 f none /usr/local/lib/libsvn_ra-1.la 0755 root root 1676 16414 1286933889 1 s none /usr/local/lib/libsvn_ra-1.so=libsvn_ra-1.so.0.0.0 1 s none /usr/local/lib/libsvn_ra-1.so.0=libsvn_ra-1.so.0.0.0 1 f none /usr/local/lib/libsvn_ra-1.so.0.0.0 0755 root root 190248 48181 1286933889 1 f none /usr/local/lib/libsvn_ra_local-1.a 0644 root root 150216 35165 1286933868 1 f none /usr/local/lib/libsvn_ra_local-1.la 0755 root root 1520 2635 1286933868 1 s none /usr/local/lib/libsvn_ra_local-1.so=libsvn_ra_local-1.so.0.0.0 1 s none /usr/local/lib/libsvn_ra_local-1.so.0=libsvn_ra_local-1.so.0.0.0 1 f none /usr/local/lib/libsvn_ra_local-1.so.0.0.0 0755 root root 132512 8767 1286933868 1 f none /usr/local/lib/libsvn_ra_neon-1.a 0644 root root 1042608 1586 1286933878 1 f none /usr/local/lib/libsvn_ra_neon-1.la 0755 root root 1373 54677 1286933878 1 s none /usr/local/lib/libsvn_ra_neon-1.so=libsvn_ra_neon-1.so.0.0.0 1 s none /usr/local/lib/libsvn_ra_neon-1.so.0=libsvn_ra_neon-1.so.0.0.0 1 f none /usr/local/lib/libsvn_ra_neon-1.so.0.0.0 0755 root root 831464 5340 1286933878 1 f none /usr/local/lib/libsvn_ra_serf-1.a 0644 root root 1311608 42662 1286933873 1 f none /usr/local/lib/libsvn_ra_serf-1.la 0755 root root 1379 55064 1286933873 1 s none /usr/local/lib/libsvn_ra_serf-1.so=libsvn_ra_serf-1.so.0.0.0 1 s none /usr/local/lib/libsvn_ra_serf-1.so.0=libsvn_ra_serf-1.so.0.0.0 1 f none /usr/local/lib/libsvn_ra_serf-1.so.0.0.0 0755 root root 1067768 9342 1286933873 1 f none /usr/local/lib/libsvn_ra_svn-1.a 0644 root root 581032 54383 1286933859 1 f none /usr/local/lib/libsvn_ra_svn-1.la 0755 root root 1340 51660 1286933859 1 s none /usr/local/lib/libsvn_ra_svn-1.so=libsvn_ra_svn-1.so.0.0.0 1 s none /usr/local/lib/libsvn_ra_svn-1.so.0=libsvn_ra_svn-1.so.0.0.0 1 f none /usr/local/lib/libsvn_ra_svn-1.so.0.0.0 0755 root root 425776 54396 1286933859 1 f none /usr/local/lib/libsvn_repos-1.a 0644 root root 967936 22346 1286933864 1 f none /usr/local/lib/libsvn_repos-1.la 0755 root root 1466 63191 1286933864 1 s none /usr/local/lib/libsvn_repos-1.so=libsvn_repos-1.so.0.0.0 1 s none /usr/local/lib/libsvn_repos-1.so.0=libsvn_repos-1.so.0.0.0 1 f none /usr/local/lib/libsvn_repos-1.so.0.0.0 0755 root root 694824 54107 1286933863 1 f none /usr/local/lib/libsvn_subr-1.a 0644 root root 1901496 42927 1286933834 1 f none /usr/local/lib/libsvn_subr-1.la 0755 root root 1261 44271 1286933834 1 s none /usr/local/lib/libsvn_subr-1.so=libsvn_subr-1.so.0.0.0 1 s none /usr/local/lib/libsvn_subr-1.so.0=libsvn_subr-1.so.0.0.0 1 f none /usr/local/lib/libsvn_subr-1.so.0.0.0 0755 root root 1423688 42649 1286933834 1 f none /usr/local/lib/libsvn_wc-1.a 0644 root root 1988960 58407 1286933894 1 f none /usr/local/lib/libsvn_wc-1.la 0755 root root 1344 51546 1286933894 1 s none /usr/local/lib/libsvn_wc-1.so=libsvn_wc-1.so.0.0.0 1 s none /usr/local/lib/libsvn_wc-1.so.0=libsvn_wc-1.so.0.0.0 1 f none /usr/local/lib/libsvn_wc-1.so.0.0.0 0755 root root 1402208 7785 1286933894 1 d none /usr/local/share 0755 root root 1 d none /usr/local/share/locale 0755 root root 1 d none /usr/local/share/locale/de 0755 root root 1 d none /usr/local/share/locale/de/LC_MESSAGES 0755 root root 1 f none /usr/local/share/locale/de/LC_MESSAGES/subversion.mo 0644 root root 312655 65181 1286933914 1 d none /usr/local/share/locale/es 0755 root root 1 d none /usr/local/share/locale/es/LC_MESSAGES 0755 root root 1 f none /usr/local/share/locale/es/LC_MESSAGES/subversion.mo 0644 root root 237418 24909 1286933915 1 d none /usr/local/share/locale/fr 0755 root root 1 d none /usr/local/share/locale/fr/LC_MESSAGES 0755 root root 1 f none /usr/local/share/locale/fr/LC_MESSAGES/subversion.mo 0644 root root 310600 29765 1286933915 1 d none /usr/local/share/locale/it 0755 root root 1 d none /usr/local/share/locale/it/LC_MESSAGES 0755 root root 1 f none /usr/local/share/locale/it/LC_MESSAGES/subversion.mo 0644 root root 191643 9367 1286933915 1 d none /usr/local/share/locale/ja 0755 root root 1 d none /usr/local/share/locale/ja/LC_MESSAGES 0755 root root 1 f none /usr/local/share/locale/ja/LC_MESSAGES/subversion.mo 0644 root root 294398 65014 1286933915 1 d none /usr/local/share/locale/ko 0755 root root 1 d none /usr/local/share/locale/ko/LC_MESSAGES 0755 root root 1 f none /usr/local/share/locale/ko/LC_MESSAGES/subversion.mo 0644 root root 284779 38622 1286933915 1 d none /usr/local/share/locale/nb 0755 root root 1 d none /usr/local/share/locale/nb/LC_MESSAGES 0755 root root 1 f none /usr/local/share/locale/nb/LC_MESSAGES/subversion.mo 0644 root root 267717 63099 1286933915 1 d none /usr/local/share/locale/pl 0755 root root 1 d none /usr/local/share/locale/pl/LC_MESSAGES 0755 root root 1 f none /usr/local/share/locale/pl/LC_MESSAGES/subversion.mo 0644 root root 313549 28403 1286933915 1 d none /usr/local/share/locale/pt_BR 0755 root root 1 d none /usr/local/share/locale/pt_BR/LC_MESSAGES 0755 root root 1 f none /usr/local/share/locale/pt_BR/LC_MESSAGES/subversion.mo 0644 root root 177981 43957 1286933915 1 d none /usr/local/share/locale/sv 0755 root root 1 d none /usr/local/share/locale/sv/LC_MESSAGES 0755 root root 1 f none /usr/local/share/locale/sv/LC_MESSAGES/subversion.mo 0644 root root 161957 65434 1286933915 1 d none /usr/local/share/locale/zh_CN 0755 root root 1 d none /usr/local/share/locale/zh_CN/LC_MESSAGES 0755 root root 1 f none /usr/local/share/locale/zh_CN/LC_MESSAGES/subversion.mo 0644 root root 278884 38079 1286933915 1 d none /usr/local/share/locale/zh_TW 0755 root root 1 d none /usr/local/share/locale/zh_TW/LC_MESSAGES 0755 root root 1 f none /usr/local/share/locale/zh_TW/LC_MESSAGES/subversion.mo 0644 root root 139461 9027 1286933915 1 d none /usr/local/share/man 0755 root root 1 d none /usr/local/share/man/man1 0755 root root 1 f none /usr/local/share/man/man1/svn.1 0644 root root 1047 29048 1286933907 1 f none /usr/local/share/man/man1/svnadmin.1 0644 root root 1094 33855 1286933907 1 f none /usr/local/share/man/man1/svndumpfilter.1 0644 root root 1094 33867 1286933907 1 f none /usr/local/share/man/man1/svnlook.1 0644 root root 1087 33190 1286933907 1 f none /usr/local/share/man/man1/svnsync.1 0644 root root 1085 33157 1286933907 1 f none /usr/local/share/man/man1/svnversion.1 0644 root root 1085 32912 1286933907 1 d none /usr/local/share/man/man5 0755 root root 1 f none /usr/local/share/man/man5/svnserve.conf.5 0644 root root 2794 55682 1286933907 1 d none /usr/local/share/man/man8 0755 root root 1 f none /usr/local/share/man/man8/svnserve.8 0644 root root 4449 8815 1286933907 1 i checkinstall 785 2565 1287104298 1 i pkginfo 294 23564 1287104298 07070100000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000b00000000TRAILER!!!0707010002c630000081a40000000000000000000000014cb7a72a000001260000010000010036ffffffffffffffff0000000800000000pkginfoPKG=subversion NAME=subversion 1.6.13 SPARC 64bit Solaris 10 VERSION=1.6.13 PSTAMP=13th October 2010 VENDOR=The Subversion Project EMAIL=http://subversion.apache.org/ DESC=Open source version control system ARCH=sparc CATEGORY=utility CLASSES=none BASEDIR=/ ISTATES=S s 1 2 3 RSTATES=S s 1 2 3 0707010002c62f000081a40000000000000000000000014cb7a72a0000368b0000010000010036ffffffffffffffff0000000700000000pkgmap: 1 66439 1 d none /usr ? ? ? 1 d none /usr/local ? ? ? 1 d none /usr/local/bin 0755 root root 1 f none /usr/local/bin/svn 0755 root root 1217632 2059 1286933903 1 f none /usr/local/bin/svnadmin 0755 root root 124248 54163 1286933904 1 f none /usr/local/bin/svndumpfilter 0755 root root 84088 28779 1286933904 1 f none /usr/local/bin/svnlook 0755 root root 154920 7054 1286933905 1 f none /usr/local/bin/svnserve 0755 root root 279536 42820 1286933906 1 f none /usr/local/bin/svnsync 0755 root root 122416 63589 1286933906 1 f none /usr/local/bin/svnversion 0755 root root 33904 10386 1286933907 1 d none /usr/local/include 0755 root root 1 d none /usr/local/include/subversion-1 0755 root root 1 f none /usr/local/include/subversion-1/mod_authz_svn.h 0644 root root 1485 54864 1286933902 1 f none /usr/local/include/subversion-1/mod_dav_svn.h 0644 root root 3296 46899 1286933902 1 f none /usr/local/include/subversion-1/svn-revision.txt 0644 root root 9 885 1286933915 1 f none /usr/local/include/subversion-1/svn_auth.h 0644 root root 44696 14679 1286933903 1 f none /usr/local/include/subversion-1/svn_base64.h 0644 root root 3430 19901 1286933902 1 f none /usr/local/include/subversion-1/svn_checksum.h 0644 root root 5753 6247 1286933902 1 f none /usr/local/include/subversion-1/svn_client.h 0644 root root 169757 52899 1286933902 1 f none /usr/local/include/subversion-1/svn_cmdline.h 0644 root root 12618 22443 1286933902 1 f none /usr/local/include/subversion-1/svn_compat.h 0644 root root 3291 5155 1286933902 1 f none /usr/local/include/subversion-1/svn_config.h 0644 root root 22775 3028 1286933902 1 f none /usr/local/include/subversion-1/svn_ctype.h 0644 root root 6210 29146 1286933902 1 f none /usr/local/include/subversion-1/svn_dav.h 0644 root root 6679 36145 1286933901 1 f none /usr/local/include/subversion-1/svn_delta.h 0644 root root 50249 58994 1286933902 1 f none /usr/local/include/subversion-1/svn_diff.h 0644 root root 28863 48186 1286933902 1 f none /usr/local/include/subversion-1/svn_dirent_uri.h 0644 root root 6929 42176 1286933902 1 f none /usr/local/include/subversion-1/svn_dso.h 0644 root root 3291 9760 1286933902 1 f none /usr/local/include/subversion-1/svn_error.h 0644 root root 17301 51122 1286933902 1 f none /usr/local/include/subversion-1/svn_error_codes.h 0644 root root 45746 52446 1286933902 1 f none /usr/local/include/subversion-1/svn_fs.h 0644 root root 76786 30786 1286933902 1 f none /usr/local/include/subversion-1/svn_hash.h 0644 root root 7092 44918 1286933902 1 f none /usr/local/include/subversion-1/svn_io.h 0644 root root 57515 5449 1286933902 1 f none /usr/local/include/subversion-1/svn_iter.h 0644 root root 4365 20204 1286933902 1 f none /usr/local/include/subversion-1/svn_md5.h 0644 root root 2426 782 1286933902 1 f none /usr/local/include/subversion-1/svn_mergeinfo.h 0644 root root 18247 23798 1286933902 1 f none /usr/local/include/subversion-1/svn_nls.h 0644 root root 1403 48808 1286933902 1 f none /usr/local/include/subversion-1/svn_opt.h 0644 root root 25589 22125 1286933902 1 f none /usr/local/include/subversion-1/svn_path.h 0644 root root 21278 59310 1286933902 1 f none /usr/local/include/subversion-1/svn_pools.h 0644 root root 2451 6391 1286933903 1 f none /usr/local/include/subversion-1/svn_props.h 0644 root root 18013 40439 1286933902 1 f none /usr/local/include/subversion-1/svn_quoprint.h 0644 root root 2418 7070 1286933903 1 f none /usr/local/include/subversion-1/svn_ra.h 0644 root root 82299 18687 1286933902 1 f none /usr/local/include/subversion-1/svn_ra_svn.h 0644 root root 17712 19619 1286933902 1 f none /usr/local/include/subversion-1/svn_repos.h 0644 root root 101813 15884 1286933902 1 f none /usr/local/include/subversion-1/svn_sorts.h 0644 root root 6218 54638 1286933902 1 f none /usr/local/include/subversion-1/svn_string.h 0644 root root 12519 20262 1286933902 1 f none /usr/local/include/subversion-1/svn_subst.h 0644 root root 20918 4378 1286933902 1 f none /usr/local/include/subversion-1/svn_time.h 0644 root root 2742 30027 1286933902 1 f none /usr/local/include/subversion-1/svn_types.h 0644 root root 32993 16847 1286933902 1 f none /usr/local/include/subversion-1/svn_user.h 0644 root root 1453 55308 1286933901 1 f none /usr/local/include/subversion-1/svn_utf.h 0644 root root 7250 50665 1286933902 1 f none /usr/local/include/subversion-1/svn_version.h 0644 root root 6946 43615 1286933902 1 f none /usr/local/include/subversion-1/svn_wc.h 0644 root root 213554 55631 1286933902 1 f none /usr/local/include/subversion-1/svn_xml.h 0644 root root 11483 8755 1286933902 1 d none /usr/local/lib 0755 root root 1 f none /usr/local/lib/libsvn_client-1.a 0644 root root 2327896 13326 1286933901 1 f none /usr/local/lib/libsvn_client-1.la 0755 root root 1796 27730 1286933901 1 s none /usr/local/lib/libsvn_client-1.so=libsvn_client-1.so.0.0.0 1 s none /usr/local/lib/libsvn_client-1.so.0=libsvn_client-1.so.0.0.0 1 f none /usr/local/lib/libsvn_client-1.so.0.0.0 0755 root root 1751936 45772 1286933901 1 f none /usr/local/lib/libsvn_delta-1.a 0644 root root 320736 50164 1286933838 1 f none /usr/local/lib/libsvn_delta-1.la 0755 root root 1300 47755 1286933838 1 s none /usr/local/lib/libsvn_delta-1.so=libsvn_delta-1.so.0.0.0 1 s none /usr/local/lib/libsvn_delta-1.so.0=libsvn_delta-1.so.0.0.0 1 f none /usr/local/lib/libsvn_delta-1.so.0.0.0 0755 root root 247704 37680 1286933838 1 f none /usr/local/lib/libsvn_diff-1.a 0644 root root 278040 17968 1286933882 1 f none /usr/local/lib/libsvn_diff-1.la 0755 root root 1293 46964 1286933882 1 s none /usr/local/lib/libsvn_diff-1.so=libsvn_diff-1.so.0.0.0 1 s none /usr/local/lib/libsvn_diff-1.so.0=libsvn_diff-1.so.0.0.0 1 f none /usr/local/lib/libsvn_diff-1.so.0.0.0 0755 root root 218144 26119 1286933882 1 f none /usr/local/lib/libsvn_fs-1.a 0644 root root 131904 12154 1286933855 1 f none /usr/local/lib/libsvn_fs-1.la 0755 root root 1415 58128 1286933855 1 s none /usr/local/lib/libsvn_fs-1.so=libsvn_fs-1.so.0.0.0 1 s none /usr/local/lib/libsvn_fs-1.so.0=libsvn_fs-1.so.0.0.0 1 f none /usr/local/lib/libsvn_fs-1.so.0.0.0 0755 root root 117704 58686 1286933855 1 f none /usr/local/lib/libsvn_fs_base-1.a 0644 root root 2550232 63415 1286933850 1 f none /usr/local/lib/libsvn_fs_base-1.la 0755 root root 1382 55430 1286933850 1 s none /usr/local/lib/libsvn_fs_base-1.so=libsvn_fs_base-1.so.0.0.0 1 s none /usr/local/lib/libsvn_fs_base-1.so.0=libsvn_fs_base-1.so.0.0.0 1 f none /usr/local/lib/libsvn_fs_base-1.so.0.0.0 0755 root root 2201280 53764 1286933850 1 f none /usr/local/lib/libsvn_fs_fs-1.a 0644 root root 988248 16309 1286933845 1 f none /usr/local/lib/libsvn_fs_fs-1.la 0755 root root 1368 54072 1286933845 1 s none /usr/local/lib/libsvn_fs_fs-1.so=libsvn_fs_fs-1.so.0.0.0 1 s none /usr/local/lib/libsvn_fs_fs-1.so.0=libsvn_fs_fs-1.so.0.0.0 1 f none /usr/local/lib/libsvn_fs_fs-1.so.0.0.0 0755 root root 703648 2927 1286933845 1 f none /usr/local/lib/libsvn_fs_util-1.a 0644 root root 25192 509 1286933841 1 f none /usr/local/lib/libsvn_fs_util-1.la 0755 root root 1314 49407 1286933841 1 s none /usr/local/lib/libsvn_fs_util-1.so=libsvn_fs_util-1.so.0.0.0 1 s none /usr/local/lib/libsvn_fs_util-1.so.0=libsvn_fs_util-1.so.0.0.0 1 f none /usr/local/lib/libsvn_fs_util-1.so.0.0.0 0755 root root 27632 14151 1286933841 1 f none /usr/local/lib/libsvn_ra-1.a 0644 root root 235480 16264 1286933890 1 f none /usr/local/lib/libsvn_ra-1.la 0755 root root 1676 16414 1286933889 1 s none /usr/local/lib/libsvn_ra-1.so=libsvn_ra-1.so.0.0.0 1 s none /usr/local/lib/libsvn_ra-1.so.0=libsvn_ra-1.so.0.0.0 1 f none /usr/local/lib/libsvn_ra-1.so.0.0.0 0755 root root 190248 48181 1286933889 1 f none /usr/local/lib/libsvn_ra_local-1.a 0644 root root 150216 35165 1286933868 1 f none /usr/local/lib/libsvn_ra_local-1.la 0755 root root 1520 2635 1286933868 1 s none /usr/local/lib/libsvn_ra_local-1.so=libsvn_ra_local-1.so.0.0.0 1 s none /usr/local/lib/libsvn_ra_local-1.so.0=libsvn_ra_local-1.so.0.0.0 1 f none /usr/local/lib/libsvn_ra_local-1.so.0.0.0 0755 root root 132512 8767 1286933868 1 f none /usr/local/lib/libsvn_ra_neon-1.a 0644 root root 1042608 1586 1286933878 1 f none /usr/local/lib/libsvn_ra_neon-1.la 0755 root root 1373 54677 1286933878 1 s none /usr/local/lib/libsvn_ra_neon-1.so=libsvn_ra_neon-1.so.0.0.0 1 s none /usr/local/lib/libsvn_ra_neon-1.so.0=libsvn_ra_neon-1.so.0.0.0 1 f none /usr/local/lib/libsvn_ra_neon-1.so.0.0.0 0755 root root 831464 5340 1286933878 1 f none /usr/local/lib/libsvn_ra_serf-1.a 0644 root root 1311608 42662 1286933873 1 f none /usr/local/lib/libsvn_ra_serf-1.la 0755 root root 1379 55064 1286933873 1 s none /usr/local/lib/libsvn_ra_serf-1.so=libsvn_ra_serf-1.so.0.0.0 1 s none /usr/local/lib/libsvn_ra_serf-1.so.0=libsvn_ra_serf-1.so.0.0.0 1 f none /usr/local/lib/libsvn_ra_serf-1.so.0.0.0 0755 root root 1067768 9342 1286933873 1 f none /usr/local/lib/libsvn_ra_svn-1.a 0644 root root 581032 54383 1286933859 1 f none /usr/local/lib/libsvn_ra_svn-1.la 0755 root root 1340 51660 1286933859 1 s none /usr/local/lib/libsvn_ra_svn-1.so=libsvn_ra_svn-1.so.0.0.0 1 s none /usr/local/lib/libsvn_ra_svn-1.so.0=libsvn_ra_svn-1.so.0.0.0 1 f none /usr/local/lib/libsvn_ra_svn-1.so.0.0.0 0755 root root 425776 54396 1286933859 1 f none /usr/local/lib/libsvn_repos-1.a 0644 root root 967936 22346 1286933864 1 f none /usr/local/lib/libsvn_repos-1.la 0755 root root 1466 63191 1286933864 1 s none /usr/local/lib/libsvn_repos-1.so=libsvn_repos-1.so.0.0.0 1 s none /usr/local/lib/libsvn_repos-1.so.0=libsvn_repos-1.so.0.0.0 1 f none /usr/local/lib/libsvn_repos-1.so.0.0.0 0755 root root 694824 54107 1286933863 1 f none /usr/local/lib/libsvn_subr-1.a 0644 root root 1901496 42927 1286933834 1 f none /usr/local/lib/libsvn_subr-1.la 0755 root root 1261 44271 1286933834 1 s none /usr/local/lib/libsvn_subr-1.so=libsvn_subr-1.so.0.0.0 1 s none /usr/local/lib/libsvn_subr-1.so.0=libsvn_subr-1.so.0.0.0 1 f none /usr/local/lib/libsvn_subr-1.so.0.0.0 0755 root root 1423688 42649 1286933834 1 f none /usr/local/lib/libsvn_wc-1.a 0644 root root 1988960 58407 1286933894 1 f none /usr/local/lib/libsvn_wc-1.la 0755 root root 1344 51546 1286933894 1 s none /usr/local/lib/libsvn_wc-1.so=libsvn_wc-1.so.0.0.0 1 s none /usr/local/lib/libsvn_wc-1.so.0=libsvn_wc-1.so.0.0.0 1 f none /usr/local/lib/libsvn_wc-1.so.0.0.0 0755 root root 1402208 7785 1286933894 1 d none /usr/local/share 0755 root root 1 d none /usr/local/share/locale 0755 root root 1 d none /usr/local/share/locale/de 0755 root root 1 d none /usr/local/share/locale/de/LC_MESSAGES 0755 root root 1 f none /usr/local/share/locale/de/LC_MESSAGES/subversion.mo 0644 root root 312655 65181 1286933914 1 d none /usr/local/share/locale/es 0755 root root 1 d none /usr/local/share/locale/es/LC_MESSAGES 0755 root root 1 f none /usr/local/share/locale/es/LC_MESSAGES/subversion.mo 0644 root root 237418 24909 1286933915 1 d none /usr/local/share/locale/fr 0755 root root 1 d none /usr/local/share/locale/fr/LC_MESSAGES 0755 root root 1 f none /usr/local/share/locale/fr/LC_MESSAGES/subversion.mo 0644 root root 310600 29765 1286933915 1 d none /usr/local/share/locale/it 0755 root root 1 d none /usr/local/share/locale/it/LC_MESSAGES 0755 root root 1 f none /usr/local/share/locale/it/LC_MESSAGES/subversion.mo 0644 root root 191643 9367 1286933915 1 d none /usr/local/share/locale/ja 0755 root root 1 d none /usr/local/share/locale/ja/LC_MESSAGES 0755 root root 1 f none /usr/local/share/locale/ja/LC_MESSAGES/subversion.mo 0644 root root 294398 65014 1286933915 1 d none /usr/local/share/locale/ko 0755 root root 1 d none /usr/local/share/locale/ko/LC_MESSAGES 0755 root root 1 f none /usr/local/share/locale/ko/LC_MESSAGES/subversion.mo 0644 root root 284779 38622 1286933915 1 d none /usr/local/share/locale/nb 0755 root root 1 d none /usr/local/share/locale/nb/LC_MESSAGES 0755 root root 1 f none /usr/local/share/locale/nb/LC_MESSAGES/subversion.mo 0644 root root 267717 63099 1286933915 1 d none /usr/local/share/locale/pl 0755 root root 1 d none /usr/local/share/locale/pl/LC_MESSAGES 0755 root root 1 f none /usr/local/share/locale/pl/LC_MESSAGES/subversion.mo 0644 root root 313549 28403 1286933915 1 d none /usr/local/share/locale/pt_BR 0755 root root 1 d none /usr/local/share/locale/pt_BR/LC_MESSAGES 0755 root root 1 f none /usr/local/share/locale/pt_BR/LC_MESSAGES/subversion.mo 0644 root root 177981 43957 1286933915 1 d none /usr/local/share/locale/sv 0755 root root 1 d none /usr/local/share/locale/sv/LC_MESSAGES 0755 root root 1 f none /usr/local/share/locale/sv/LC_MESSAGES/subversion.mo 0644 root root 161957 65434 1286933915 1 d none /usr/local/share/locale/zh_CN 0755 root root 1 d none /usr/local/share/locale/zh_CN/LC_MESSAGES 0755 root root 1 f none /usr/local/share/locale/zh_CN/LC_MESSAGES/subversion.mo 0644 root root 278884 38079 1286933915 1 d none /usr/local/share/locale/zh_TW 0755 root root 1 d none /usr/local/share/locale/zh_TW/LC_MESSAGES 0755 root root 1 f none /usr/local/share/locale/zh_TW/LC_MESSAGES/subversion.mo 0644 root root 139461 9027 1286933915 1 d none /usr/local/share/man 0755 root root 1 d none /usr/local/share/man/man1 0755 root root 1 f none /usr/local/share/man/man1/svn.1 0644 root root 1047 29048 1286933907 1 f none /usr/local/share/man/man1/svnadmin.1 0644 root root 1094 33855 1286933907 1 f none /usr/local/share/man/man1/svndumpfilter.1 0644 root root 1094 33867 1286933907 1 f none /usr/local/share/man/man1/svnlook.1 0644 root root 1087 33190 1286933907 1 f none /usr/local/share/man/man1/svnsync.1 0644 root root 1085 33157 1286933907 1 f none /usr/local/share/man/man1/svnversion.1 0644 root root 1085 32912 1286933907 1 d none /usr/local/share/man/man5 0755 root root 1 f none /usr/local/share/man/man5/svnserve.conf.5 0644 root root 2794 55682 1286933907 1 d none /usr/local/share/man/man8 0755 root root 1 f none /usr/local/share/man/man8/svnserve.8 0644 root root 4449 8815 1286933907 1 i checkinstall 785 2565 1287104298 1 i pkginfo 294 23564 1287104298 0707010002c6ca000041ed0000000000000000000000024cb7a72b000000000000010000010036ffffffffffffffff0000000800000000install0707010002c6cb000081ed0000000000000000000000014cb7a72a000003110000010000010036ffffffffffffffff0000001500000000install/checkinstall#!/bin/sh # expected_bits="64" expected_release="5.10" expected_platform="sparc" # release=`uname -r` platform=`uname -p` bits=`isainfo -b` # if [ ${platform} != ${expected_platform} ]; then echo "\n\n\n\tThis package must be installed on a ${expected_platform} architecture\n" echo "\tAborting installation.\n\n\n" exit 1 fi if [ ${release} != ${expected_release} ]; then echo "\n\n\n\tThis package must be installed on a ${expected_release} machine\n" echo "\tAborting installation.\n\n\n" exit 1 fi if [ ${bits} != ${expected_bits} ]; then echo "\n\n\n\tThis package must be installed on a ${expected_bits} bit machine\n" echo "\tYour machine is running a ${bits} bit O.S. currently\n" echo "\tAborting installation.\n\n\n" exit 1 fi exit 0 0707010002c631000041ed0000000000000000000000034cb7a72a000000000000010000010036ffffffffffffffff0000000500000000root0707010002c632000041ed0000000000000000000000034cb7a72a000000000000010000010036ffffffffffffffff0000000900000000root/usr0707010002c633000041ed0000000000000000000000064cb7a72a000000000000010000010036ffffffffffffffff0000000f00000000root/usr/local0707010002c63c000041ed0000000000000000000000034cb7a72a000000000000010000010036ffffffffffffffff0000001700000000root/usr/local/include0707010002c63d000041ed0000000000000000000000024cb7a72a000000000000010000010036ffffffffffffffff0000002400000000root/usr/local/include/subversion-10707010002c662000081a40000000000000000000000014cb50d8e00000ab60000010000010036ffffffffffffffff0000002f00000000root/usr/local/include/subversion-1/svn_time.h/** * @copyright * ==================================================================== * Copyright (c) 2000-2004, 2008 CollabNet. All rights reserved. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://subversion.tigris.org/license-1.html. * If newer versions of this license are posted there, you may use a * newer version instead, at your option. * * This software consists of voluntary contributions made by many * individuals. For exact contribution history, see the revision * history and logs, available at http://subversion.tigris.org/. * ==================================================================== * @endcopyright * * @file svn_time.h * @brief Time/date utilities */ #ifndef SVN_TIME_H #define SVN_TIME_H #include #include #include "svn_error.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** Convert @a when to a const char * representation allocated * in @a pool. Use svn_time_from_cstring() for the reverse * conversion. */ const char * svn_time_to_cstring(apr_time_t when, apr_pool_t *pool); /** Convert @a data to an @c apr_time_t @a when. * Use @a pool for temporary memory allocation. */ svn_error_t * svn_time_from_cstring(apr_time_t *when, const char *data, apr_pool_t *pool); /** Convert @a when to a const char * representation allocated * in @a pool, suitable for human display in UTF8. */ const char * svn_time_to_human_cstring(apr_time_t when, apr_pool_t *pool); /** Convert a human-readable date @a text into an @c apr_time_t, using * @a now as the current time and storing the result in @a result. * The local time zone will be used to compute the appropriate GMT * offset if @a text contains a local time specification. Set @a * matched to indicate whether or not @a text was parsed successfully. * Perform any allocation in @a pool. Return an error iff an internal * error (rather than a simple parse error) occurs. */ svn_error_t * svn_parse_date(svn_boolean_t *matched, apr_time_t *result, const char *text, apr_time_t now, apr_pool_t *pool); /** Sleep until the next second, to ensure that any files modified * after we exit have a different timestamp than the one we recorded. * * @deprecated Provided for backward compatibility with the 1.5 API. * Use svn_io_sleep_for_timestamps() instead. */ SVN_DEPRECATED void svn_sleep_for_timestamps(void); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* SVN_TIME_H */ 0707010002c64d000081a40000000000000000000000014cb50d8e00000cdb0000010000010036ffffffffffffffff0000002e00000000root/usr/local/include/subversion-1/svn_dso.h/** * @copyright * ==================================================================== * Copyright (c) 2006, 2008 CollabNet. All rights reserved. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://subversion.tigris.org/license-1.html. * If newer versions of this license are posted there, you may use a * newer version instead, at your option. * * This software consists of voluntary contributions made by many * individuals. For exact contribution history, see the revision * history and logs, available at http://subversion.tigris.org/. * ==================================================================== * @endcopyright * * @file svn_dso.h * @brief DSO loading routines */ #ifndef SVN_DSO_H #define SVN_DSO_H #include #include "svn_types.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * Initialize the DSO loading routines. * * @note This should be called prior to the creation of any pool that * is passed to a function that comes from a DSO, otherwise you * risk having the DSO unloaded before all pool cleanup callbacks * that live in the DSO have been executed. If it is not called * prior to @c svn_dso_load being used for the first time there * will be a best effort attempt made to initialize the subsystem, * but it will not be entirely thread safe and it risks running * into the previously mentioned problems with DSO unloading and * pool cleanup callbacks. * * Returns svn_error_t object with corresponding apr_err returned by * underlying calls. In case of no error returns @c SVN_NO_ERROR. * * @since New in 1.6. */ svn_error_t * svn_dso_initialize2(void); /** * Initialize the DSO loading routines. * * @note This should be called prior to the creation of any pool that * is passed to a function that comes from a DSO, otherwise you * risk having the DSO unloaded before all pool cleanup callbacks * that live in the DSO have been executed. If it is not called * prior to @c svn_dso_load being used for the first time there * will be a best effort attempt made to initialize the subsystem, * but it will not be entirely thread safe and it risks running * into the previously mentioned problems with DSO unloading and * pool cleanup callbacks. * * Calls svn_dso_initialize2(void) upon error aborts. * * @deprecated Provided for backwards compatibility with the 1.5 API. * * @since New in 1.4. */ SVN_DEPRECATED void svn_dso_initialize(void); #if APR_HAS_DSO /** * Attempt to load @a libname, returning it in @a dso. * * If @a libname cannot be loaded set @a dso to NULL and return * @c SVN_NO_ERROR. * * @note Due to pool lifetime issues DSOs are all loaded into a global * pool, so you must be certain that there is a bounded number of * them that will ever be loaded by the system, otherwise you will * leak memory. * * @since New in 1.4. */ svn_error_t * svn_dso_load(apr_dso_handle_t **dso, const char *libname); #endif /* APR_HAS_DSO */ #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* SVN_DSO_H */ 0707010002c659000081a40000000000000000000000014cb50d8f000009930000010000010036ffffffffffffffff0000003000000000root/usr/local/include/subversion-1/svn_pools.h/** * @copyright * ==================================================================== * Copyright (c) 2000-2004, 2008 CollabNet. All rights reserved. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://subversion.tigris.org/license-1.html. * If newer versions of this license are posted there, you may use a * newer version instead, at your option. * * This software consists of voluntary contributions made by many * individuals. For exact contribution history, see the revision * history and logs, available at http://subversion.tigris.org/. * ==================================================================== * @endcopyright * * @file svn_pools.h * @brief APR pool management for Subversion */ #ifndef SVN_POOLS_H #define SVN_POOLS_H #include #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /* Wrappers around APR pools, so we get debugging. */ /** The recommended maximum amount of memory (4MB) to keep in an APR * allocator on the free list, conveniently defined here to share * between all our applications. */ #define SVN_ALLOCATOR_RECOMMENDED_MAX_FREE (4096 * 1024) /** Wrapper around apr_pool_create_ex(), with a simpler interface. * The return pool will have an abort function set, which will call * abort() on OOM. */ apr_pool_t * svn_pool_create_ex(apr_pool_t *parent_pool, apr_allocator_t *allocator); #ifndef DOXYGEN_SHOULD_SKIP_THIS apr_pool_t * svn_pool_create_ex_debug(apr_pool_t *parent_pool, apr_allocator_t *allocator, const char *file_line); #if APR_POOL_DEBUG #define svn_pool_create_ex(pool, allocator) \ svn_pool_create_ex_debug(pool, allocator, APR_POOL__FILE_LINE__) #endif /* APR_POOL_DEBUG */ #endif /* DOXYGEN_SHOULD_SKIP_THIS */ /** Create a pool as a subpool of @a parent_pool */ #define svn_pool_create(parent_pool) svn_pool_create_ex(parent_pool, NULL) /** Clear a @a pool destroying its children. * * This define for @c svn_pool_clear exists for completeness. */ #define svn_pool_clear apr_pool_clear /** Destroy a @a pool and all of its children. * * This define for @c svn_pool_destroy exists for symmetry and * completeness. */ #define svn_pool_destroy apr_pool_destroy #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* SVN_POOLS_H */ 0707010002c663000081a40000000000000000000000014cb50d8e000080e10000010000010036ffffffffffffffff0000003000000000root/usr/local/include/subversion-1/svn_types.h/** * @copyright * ==================================================================== * Copyright (c) 2000-2008 CollabNet. All rights reserved. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://subversion.tigris.org/license-1.html. * If newer versions of this license are posted there, you may use a * newer version instead, at your option. * * This software consists of voluntary contributions made by many * individuals. For exact contribution history, see the revision * history and logs, available at http://subversion.tigris.org/. * ==================================================================== * @endcopyright * * @file svn_types.h * @brief Subversion's data types */ #ifndef SVN_TYPES_H #define SVN_TYPES_H /* ### this should go away, but it causes too much breakage right now */ #include #include /* for apr_size_t, apr_int64_t, ... */ #include /* for apr_status_t */ #include /* for apr_pool_t */ #include /* for apr_hash_t */ #include /* for apr_array_push() */ #include /* for apr_time_t */ #include /* for apr_atoi64() */ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** Macro used to mark deprecated functions. * * @since New in 1.6. */ #ifndef SVN_DEPRECATED #if !defined(SWIGPERL) && !defined(SWIGPYTHON) && !defined(SWIGRUBY) #if defined(__GNUC__) && (__GNUC__ >= 4 || (__GNUC__==3 && __GNUC_MINOR__>=1)) #define SVN_DEPRECATED __attribute__((deprecated)) #elif defined(_MSC_VER) && _MSC_VER >= 1300 #define SVN_DEPRECATED __declspec(deprecated) #else #define SVN_DEPRECATED #endif #else #define SVN_DEPRECATED #endif #endif /** Subversion error object. * * Defined here, rather than in svn_error.h, to avoid a recursive @#include * situation. */ typedef struct svn_error_t { /** APR error value, possibly SVN_ custom err */ apr_status_t apr_err; /** details from producer of error */ const char *message; /** ptr to the error we "wrap" */ struct svn_error_t *child; /** The pool holding this error and any child errors it wraps */ apr_pool_t *pool; /** Source file where the error originated. Only used iff @c SVN_DEBUG. */ const char *file; /** Source line where the error originated. Only used iff @c SVN_DEBUG. */ long line; } svn_error_t; /** @defgroup APR_ARRAY_compat_macros APR Array Compatibility Helper Macros * These macros are provided by APR itself from version 1.3. * Definitions are provided here for when using older versions of APR. * @{ */ /** index into an apr_array_header_t */ #ifndef APR_ARRAY_IDX #define APR_ARRAY_IDX(ary,i,type) (((type *)(ary)->elts)[i]) #endif /** easier array-pushing syntax */ #ifndef APR_ARRAY_PUSH #define APR_ARRAY_PUSH(ary,type) (*((type *)apr_array_push(ary))) #endif /** @} */ /** The various types of nodes in the Subversion filesystem. */ typedef enum { /** absent */ svn_node_none, /** regular file */ svn_node_file, /** directory */ svn_node_dir, /** something's here, but we don't know what */ svn_node_unknown } svn_node_kind_t; /** Return a constant string expressing @a kind as an English word, e.g., * "file", "dir", etc. The string is not localized, as it may be used for * client<->server communications. If the kind is not recognized, return * "unknown". * * @since New in 1.6. */ const char * svn_node_kind_to_word(svn_node_kind_t kind); /** Return the appropriate node_kind for @a word. @a word is as * returned from svn_node_kind_to_word(). If @a word does not * represent a recognized kind or is @c NULL, return @c svn_node_unknown. * * @since New in 1.6. */ svn_node_kind_t svn_node_kind_from_word(const char *word); /** About Special Files in Subversion * * Subversion denotes files that cannot be portably created or * modified as "special" files (svn_node_special). It stores these * files in the repository as a plain text file with the svn:special * property set. The file contents contain: a platform-specific type * string, a space character, then any information necessary to create * the file on a supported platform. For example, if a symbolic link * were being represented, the repository file would have the * following contents: * * "link /path/to/link/target" * * Where 'link' is the identifier string showing that this special * file should be a symbolic link and '/path/to/link/target' is the * destination of the symbolic link. * * Special files are stored in the text-base exactly as they are * stored in the repository. The platform specific files are created * in the working copy at EOL/keyword translation time using * svn_subst_copy_and_translate2(). If the current platform does not * support a specific special file type, the file is copied into the * working copy as it is seen in the repository. Because of this, * users of other platforms can still view and modify the special * files, even if they do not have their unique properties. * * New types of special files can be added by: * 1. Implementing a platform-dependent routine to create a uniquely * named special file and one to read the special file in * libsvn_subr/io.c. * 2. Creating a new textual name similar to * SVN_SUBST__SPECIAL_LINK_STR in libsvn_subr/subst.c. * 3. Handling the translation/detranslation case for the new type in * create_special_file and detranslate_special_file, using the * routines from 1. */ /** A revision number. */ typedef long int svn_revnum_t; /** Valid revision numbers begin at 0 */ #define SVN_IS_VALID_REVNUM(n) ((n) >= 0) /** The 'official' invalid revision num */ #define SVN_INVALID_REVNUM ((svn_revnum_t) -1) /** Not really invalid...just unimportant -- one day, this can be its * own unique value, for now, just make it the same as * @c SVN_INVALID_REVNUM. */ #define SVN_IGNORED_REVNUM ((svn_revnum_t) -1) /** Convert NULL-terminated C string @a str to a revision number. */ #define SVN_STR_TO_REV(str) ((svn_revnum_t) atol(str)) /** * Parse NULL-terminated C string @a str as a revision number and * store its value in @a rev. If @a endptr is non-NULL, then the * address of the first non-numeric character in @a str is stored in * it. If there are no digits in @a str, then @a endptr is set (if * non-NULL), and the error @c SVN_ERR_REVNUM_PARSE_FAILURE error is * returned. Negative numbers parsed from @a str are considered * invalid, and result in the same error. * * @since New in 1.5. */ svn_error_t * svn_revnum_parse(svn_revnum_t *rev, const char *str, const char **endptr); /** Originally intended to be used in printf()-style functions to format * revision numbers. Deprecated due to incompatibilities with language * translation tools (e.g. gettext). * * New code should use a bare "%ld" format specifier for formatting revision * numbers. * * @deprecated Provided for backward compatibility with the 1.0 API. */ #define SVN_REVNUM_T_FMT "ld" /** The size of a file in the Subversion FS. */ typedef apr_int64_t svn_filesize_t; /** The 'official' invalid file size constant. */ #define SVN_INVALID_FILESIZE ((svn_filesize_t) -1) /** In printf()-style functions, format file sizes using this. */ #define SVN_FILESIZE_T_FMT APR_INT64_T_FMT #ifndef DOXYGEN_SHOULD_SKIP_THIS /* Parse a base-10 numeric string into a 64-bit unsigned numeric value. */ /* NOTE: Private. For use by Subversion's own code only. See issue #1644. */ /* FIXME: APR should supply a function to do this, such as "apr_atoui64". */ #define svn__atoui64(X) ((apr_uint64_t) apr_atoi64(X)) #endif /** YABT: Yet Another Boolean Type */ typedef int svn_boolean_t; #ifndef TRUE /** uhh... true */ #define TRUE 1 #endif /* TRUE */ #ifndef FALSE /** uhh... false */ #define FALSE 0 #endif /* FALSE */ /** An enum to indicate whether recursion is needed. */ enum svn_recurse_kind { svn_nonrecursive = 1, svn_recursive }; /** The concept of depth for directories. * * @note This is similar to, but not exactly the same as, the WebDAV * and LDAP concepts of depth. * * @since New in 1.5. */ typedef enum { /* The order of these depths is important: the higher the number, the deeper it descends. This allows us to compare two depths numerically to decide which should govern. */ /* Depth undetermined or ignored. In some contexts, this means the client should choose an appropriate default depth. The server will generally treat it as @c svn_depth_infinity. */ svn_depth_unknown = -2, /* Exclude (i.e., don't descend into) directory D. */ /* NOTE: In Subversion 1.5, svn_depth_exclude is *not* supported anywhere in the client-side (libsvn_wc/libsvn_client/etc) code; it is only supported as an argument to set_path functions in the ra and repos reporters. (This will enable future versions of Subversion to run updates, etc, against 1.5 servers with proper svn_depth_exclude behavior, once we get a chance to implement client-side support for svn_depth_exclude.) */ svn_depth_exclude = -1, /* Just the named directory D, no entries. Updates will not pull in any files or subdirectories not already present. */ svn_depth_empty = 0, /* D + its file children, but not subdirs. Updates will pull in any files not already present, but not subdirectories. */ svn_depth_files = 1, /* D + immediate children (D and its entries). Updates will pull in any files or subdirectories not already present; those subdirectories' this_dir entries will have depth-empty. */ svn_depth_immediates = 2, /* D + all descendants (full recursion from D). Updates will pull in any files or subdirectories not already present; those subdirectories' this_dir entries will have depth-infinity. Equivalent to the pre-1.5 default update behavior. */ svn_depth_infinity = 3 } svn_depth_t; /** Return a constant string expressing @a depth as an English word, * e.g., "infinity", "immediates", etc. The string is not localized, * as it may be used for client<->server communications. * * @since New in 1.5. */ const char * svn_depth_to_word(svn_depth_t depth); /** Return the appropriate depth for @a depth_str. @a word is as * returned from svn_depth_to_word(). If @a depth_str does not * represent a recognized depth, return @c svn_depth_unknown. * * @since New in 1.5. */ svn_depth_t svn_depth_from_word(const char *word); /* Return @c svn_depth_infinity if boolean @a recurse is TRUE, else * return @c svn_depth_files. * * @note New code should never need to use this, it is called only * from pre-depth APIs, for compatibility. * * @since New in 1.5. */ #define SVN_DEPTH_INFINITY_OR_FILES(recurse) \ ((recurse) ? svn_depth_infinity : svn_depth_files) /* Return @c svn_depth_infinity if boolean @a recurse is TRUE, else * return @c svn_depth_immediates. * * @note New code should never need to use this, it is called only * from pre-depth APIs, for compatibility. * * @since New in 1.5. */ #define SVN_DEPTH_INFINITY_OR_IMMEDIATES(recurse) \ ((recurse) ? svn_depth_infinity : svn_depth_immediates) /* Return @c svn_depth_infinity if boolean @a recurse is TRUE, else * return @c svn_depth_empty. * * @note New code should never need to use this, it is called only * from pre-depth APIs, for compatibility. * * @since New in 1.5. */ #define SVN_DEPTH_INFINITY_OR_EMPTY(recurse) \ ((recurse) ? svn_depth_infinity : svn_depth_empty) /* Return a recursion boolean based on @a depth. * * Although much code has been converted to use depth, some code still * takes a recurse boolean. In most cases, it makes sense to treat * unknown or infinite depth as recursive, and any other depth as * non-recursive (which in turn usually translates to @c svn_depth_files). */ #define SVN_DEPTH_IS_RECURSIVE(depth) \ (((depth) == svn_depth_infinity || (depth) == svn_depth_unknown) \ ? TRUE : FALSE) /** * It is sometimes convenient to indicate which parts of an @c svn_dirent_t * object you are actually interested in, so that calculating and sending * the data corresponding to the other fields can be avoided. These values * can be used for that purpose. * * @defgroup svn_dirent_fields Dirent fields * @{ */ /** An indication that you are interested in the @c kind field */ #define SVN_DIRENT_KIND 0x00001 /** An indication that you are interested in the @c size field */ #define SVN_DIRENT_SIZE 0x00002 /** An indication that you are interested in the @c has_props field */ #define SVN_DIRENT_HAS_PROPS 0x00004 /** An indication that you are interested in the @c created_rev field */ #define SVN_DIRENT_CREATED_REV 0x00008 /** An indication that you are interested in the @c time field */ #define SVN_DIRENT_TIME 0x00010 /** An indication that you are interested in the @c last_author field */ #define SVN_DIRENT_LAST_AUTHOR 0x00020 /** A combination of all the dirent fields */ #define SVN_DIRENT_ALL ~((apr_uint32_t ) 0) /** @} */ /** A general subversion directory entry. */ typedef struct svn_dirent_t { /** node kind */ svn_node_kind_t kind; /** length of file text, or 0 for directories */ svn_filesize_t size; /** does the node have props? */ svn_boolean_t has_props; /** last rev in which this node changed */ svn_revnum_t created_rev; /** time of created_rev (mod-time) */ apr_time_t time; /** author of created_rev */ const char *last_author; /* IMPORTANT: If you extend this struct, check svn_dirent_dup(). */ } svn_dirent_t; /** Return a deep copy of @a dirent, allocated in @a pool. * * @since New in 1.4. */ svn_dirent_t * svn_dirent_dup(const svn_dirent_t *dirent, apr_pool_t *pool); /** Keyword substitution. * * All the keywords Subversion recognizes. * * Note that there is a better, more general proposal out there, which * would take care of both internationalization issues and custom * keywords (e.g., $NetBSD$). See * * @verbatim http://subversion.tigris.org/servlets/ReadMsg?list=dev&msgNo=8921 ===== From: "Jonathan M. Manning" To: dev@subversion.tigris.org Date: Fri, 14 Dec 2001 11:56:54 -0500 Message-ID: <87970000.1008349014@bdldevel.bl.bdx.com> Subject: Re: keywords @endverbatim * * and Eric Gillespie's support of same: * * @verbatim http://subversion.tigris.org/servlets/ReadMsg?list=dev&msgNo=8757 ===== From: "Eric Gillespie, Jr." To: dev@subversion.tigris.org Date: Wed, 12 Dec 2001 09:48:42 -0500 Message-ID: <87k7vsebp1.fsf@vger.pretzelnet.org> Subject: Re: Customizable Keywords @endverbatim * * However, it is considerably more complex than the scheme below. * For now we're going with simplicity, hopefully the more general * solution can be done post-1.0. * * @defgroup svn_types_keywords Keyword definitions * @{ */ /** The maximum size of an expanded or un-expanded keyword. */ #define SVN_KEYWORD_MAX_LEN 255 /** The most recent revision in which this file was changed. */ #define SVN_KEYWORD_REVISION_LONG "LastChangedRevision" /** Short version of LastChangedRevision */ #define SVN_KEYWORD_REVISION_SHORT "Rev" /** Medium version of LastChangedRevision, matching the one CVS uses. * @since New in 1.1. */ #define SVN_KEYWORD_REVISION_MEDIUM "Revision" /** The most recent date (repository time) when this file was changed. */ #define SVN_KEYWORD_DATE_LONG "LastChangedDate" /** Short version of LastChangedDate */ #define SVN_KEYWORD_DATE_SHORT "Date" /** Who most recently committed to this file. */ #define SVN_KEYWORD_AUTHOR_LONG "LastChangedBy" /** Short version of LastChangedBy */ #define SVN_KEYWORD_AUTHOR_SHORT "Author" /** The URL for the head revision of this file. */ #define SVN_KEYWORD_URL_LONG "HeadURL" /** Short version of HeadURL */ #define SVN_KEYWORD_URL_SHORT "URL" /** A compressed combination of the other four keywords. */ #define SVN_KEYWORD_ID "Id" /** A full combination of the first four keywords. * @since New in 1.6. */ #define SVN_KEYWORD_HEADER "Header" /** @} */ /** All information about a commit. * * @note Objects of this type should always be created using the * svn_create_commit_info() function. * * @since New in 1.3. */ typedef struct svn_commit_info_t { /** just-committed revision. */ svn_revnum_t revision; /** server-side date of the commit. */ const char *date; /** author of the commit. */ const char *author; /** error message from post-commit hook, or NULL. */ const char *post_commit_err; } svn_commit_info_t; /** * Allocate an object of type @c svn_commit_info_t in @a pool and * return it. * * The @c revision field of the new struct is set to @c * SVN_INVALID_REVNUM. All other fields are initialized to @c NULL. * * @note Any object of the type @c svn_commit_info_t should * be created using this function. * This is to provide for extending the svn_commit_info_t in * the future. * * @since New in 1.3. */ svn_commit_info_t * svn_create_commit_info(apr_pool_t *pool); /** * Return a deep copy @a src_commit_info allocated in @a pool. * * @since New in 1.4. */ svn_commit_info_t * svn_commit_info_dup(const svn_commit_info_t *src_commit_info, apr_pool_t *pool); /** * A structure to represent a path that changed for a log entry. * * @note To allow for extending the @c svn_log_changed_path2_t structure in * future releases, always use svn_log_changed_path2_create() to allocate * the structure. * * @since New in 1.6. */ typedef struct svn_log_changed_path2_t { /** 'A'dd, 'D'elete, 'R'eplace, 'M'odify */ char action; /** Source path of copy (if any). */ const char *copyfrom_path; /** Source revision of copy (if any). */ svn_revnum_t copyfrom_rev; /** The type of the node, may be svn_node_unknown. */ svn_node_kind_t node_kind; /* NOTE: Add new fields at the end to preserve binary compatibility. Also, if you add fields here, you have to update svn_log_changed_path2_dup(). */ } svn_log_changed_path2_t; /** * Returns an @c svn_log_changed_path2_t, allocated in @a pool with all fields * initialized to NULL, None or empty values. * * @note To allow for extending the @c svn_log_changed_path2_t structure in * future releases, this function should always be used to allocate the * structure. * * @since New in 1.6. */ svn_log_changed_path2_t * svn_log_changed_path2_create(apr_pool_t *pool); /** * Return a deep copy of @a changed_path, allocated in @a pool. * * @since New in 1.6. */ svn_log_changed_path2_t * svn_log_changed_path2_dup(const svn_log_changed_path2_t *changed_path, apr_pool_t *pool); /** * A structure to represent a path that changed for a log entry. Same as * @c svn_log_changed_path2_t, but without the node kind. * * @deprecated Provided for backward compatibility with the 1.5 API. */ typedef struct svn_log_changed_path_t { /** 'A'dd, 'D'elete, 'R'eplace, 'M'odify */ char action; /** Source path of copy (if any). */ const char *copyfrom_path; /** Source revision of copy (if any). */ svn_revnum_t copyfrom_rev; } svn_log_changed_path_t; /** * Return a deep copy of @a changed_path, allocated in @a pool. * * @since New in 1.3. * @deprecated Provided for backward compatibility with the 1.5 API. */ SVN_DEPRECATED svn_log_changed_path_t * svn_log_changed_path_dup(const svn_log_changed_path_t *changed_path, apr_pool_t *pool); /** * A structure to represent all the information about a particular log entry. * * @note To allow for extending the @c svn_log_entry_t structure in future * releases, always use svn_log_entry_create() to allocate the structure. * * @since New in 1.5. */ typedef struct svn_log_entry_t { /** A hash containing as keys every path committed in @a revision; the * values are (@c svn_log_changed_path_t *) stuctures. * * The subversion core libraries will always set this field to the same * value as changed_paths2 for compatibity reasons. * * @deprecated Provided for backward compatibility with the 1.5 API. */ apr_hash_t *changed_paths; /** The revision of the commit. */ svn_revnum_t revision; /** The hash of requested revision properties, which may be NULL if it * would contain no revprops. */ apr_hash_t *revprops; /** * Whether or not this message has children. * * When a log operation requests additional merge information, extra log * entries may be returned as a result of this entry. The new entries, are * considered children of the original entry, and will follow it. When * the HAS_CHILDREN flag is set, the receiver should increment its stack * depth, and wait until an entry is provided with SVN_INVALID_REVNUM which * indicates the end of the children. * * For log operations which do not request additional merge information, the * HAS_CHILDREN flag is always FALSE. * * For more information see: * http://subversion.tigris.org/merge-tracking/design.html#commutative-reporting */ svn_boolean_t has_children; /** A hash containing as keys every path committed in @a revision; the * values are (@c svn_log_changed_path2_t *) stuctures. * * If this value is not @c NULL, it MUST have the same value as * changed_paths or svn_log_entry_dup() will not create an identical copy. * * The subversion core libraries will always set this field to the same * value as changed_paths for compatibity with users assuming an older * version. * * @since New in 1.6. */ apr_hash_t *changed_paths2; /* NOTE: Add new fields at the end to preserve binary compatibility. Also, if you add fields here, you have to update svn_log_entry_dup(). */ } svn_log_entry_t; /** * Returns an @c svn_log_entry_t, allocated in @a pool with all fields * initialized to NULL values. * * @note To allow for extending the @c svn_log_entry_t structure in future * releases, this function should always be used to allocate the structure. * * @since New in 1.5. */ svn_log_entry_t * svn_log_entry_create(apr_pool_t *pool); /** Return a deep copy of @a log_entry, allocated in @a pool. * * The resulting svn_log_entry_t has @c changed_paths set to the same * value as @c changed_path2. @c changed_paths will be @c NULL if * @c changed_paths2 was @c NULL. * * @since New in 1.6. */ svn_log_entry_t * svn_log_entry_dup(svn_log_entry_t *log_entry, apr_pool_t *pool); /** The callback invoked by log message loopers, such as * @c svn_ra_plugin_t.get_log() and svn_repos_get_logs(). * * This function is invoked once on each log message, in the order * determined by the caller (see above-mentioned functions). * * @a baton is what you think it is, and @a log_entry contains relevent * information for the log message. Any of @a log_entry->author, * @a log_entry->date, or @a log_entry->message may be @c NULL. * * If @a log_entry->date is neither NULL nor the empty string, it was * generated by svn_time_to_cstring() and can be converted to * @c apr_time_t with svn_time_from_cstring(). * * If @a log_entry->changed_paths is non-@c NULL, then it contains as keys * every path committed in @a log_entry->revision; the values are * (@c svn_log_changed_path_t *) structures. * * If @a log_entry->has_children is @c TRUE, the message will be followed * immediately by any number of merged revisions (child messages), which are * terminated by an invocation with SVN_INVALID_REVNUM. This usage may * be recursive. * * Use @a pool for temporary allocation. If the caller is iterating * over log messages, invoking this receiver on each, we recommend the * standard pool loop recipe: create a subpool, pass it as @a pool to * each call, clear it after each iteration, destroy it after the loop * is done. (For allocation that must last beyond the lifetime of a * given receiver call, use a pool in @a baton.) * * @since New in 1.5. */ typedef svn_error_t *(*svn_log_entry_receiver_t) (void *baton, svn_log_entry_t *log_entry, apr_pool_t *pool); /** * Similar to @c svn_log_entry_receiver_t, except this uses separate * parameters for each part of the log entry. * * @deprecated Provided for backward compatibility with the 1.4 API. */ typedef svn_error_t *(*svn_log_message_receiver_t) (void *baton, apr_hash_t *changed_paths, svn_revnum_t revision, const char *author, const char *date, /* use svn_time_from_cstring() if need apr_time_t */ const char *message, apr_pool_t *pool); /** Callback function type for commits. * * When a commit succeeds, an instance of this is invoked with the * @a commit_info, along with the @a baton closure. * @a pool can be used for temporary allocations. * * @since New in 1.4. */ typedef svn_error_t *(*svn_commit_callback2_t) (const svn_commit_info_t *commit_info, void *baton, apr_pool_t *pool); /** Same as @c svn_commit_callback2_t, but uses individual * data elements instead of the @c svn_commit_info_t structure * * @deprecated Provided for backward compatibility with the 1.3 API. */ typedef svn_error_t *(*svn_commit_callback_t) (svn_revnum_t new_revision, const char *date, const char *author, void *baton); /** A buffer size that may be used when processing a stream of data. * * @note We don't use this constant any longer, since it is considered to be * unnecessarily large. * * @deprecated Provided for backwards compatibility with the 1.3 API. */ #define SVN_STREAM_CHUNK_SIZE 102400 #ifndef DOXYGEN_SHOULD_SKIP_THIS /* * The maximum amount we (ideally) hold in memory at a time when * processing a stream of data. * * For example, when copying data from one stream to another, do it in * blocks of this size. * * NOTE: This is an internal macro, put here for convenience. * No public API may depend on the particular value of this macro. */ #define SVN__STREAM_CHUNK_SIZE 16384 #endif /** The maximum amount we can ever hold in memory. */ /* FIXME: Should this be the same as SVN_STREAM_CHUNK_SIZE? */ #define SVN_MAX_OBJECT_SIZE (((apr_size_t) -1) / 2) /* ### Note: despite being about mime-TYPES, these probably don't * ### belong in svn_types.h. However, no other header is more * ### appropriate, and didn't feel like creating svn_validate.h for * ### so little. */ /** Validate @a mime_type. * * If @a mime_type does not contain a "/", or ends with non-alphanumeric * data, return @c SVN_ERR_BAD_MIME_TYPE, else return success. * * Use @a pool only to find error allocation. * * Goal: to match both "foo/bar" and "foo/bar; charset=blah", without * being too strict about it, but to disallow mime types that have * quotes, newlines, or other garbage on the end, such as might be * unsafe in an HTTP header. */ svn_error_t * svn_mime_type_validate(const char *mime_type, apr_pool_t *pool); /** Return FALSE iff @a mime_type is a textual type. * * All mime types that start with "text/" are textual, plus some special * cases (for example, "image/x-xbitmap"). */ svn_boolean_t svn_mime_type_is_binary(const char *mime_type); /** A user defined callback that subversion will call with a user defined * baton to see if the current operation should be continued. If the operation * should continue, the function should return @c SVN_NO_ERROR, if not, it * should return @c SVN_ERR_CANCELLED. */ typedef svn_error_t *(*svn_cancel_func_t)(void *cancel_baton); /** * A lock object, for client & server to share. * * A lock represents the exclusive right to add, delete, or modify a * path. A lock is created in a repository, wholly controlled by the * repository. A "lock-token" is the lock's UUID, and can be used to * learn more about a lock's fields, and or/make use of the lock. * Because a lock is immutable, a client is free to not only cache the * lock-token, but the lock's fields too, for convenience. * * Note that the 'is_dav_comment' field is wholly ignored by every * library except for mod_dav_svn. The field isn't even marshalled * over the network to the client. Assuming lock structures are * created with apr_pcalloc(), a default value of 0 is universally safe. * * @note in the current implementation, only files are lockable. * * @since New in 1.2. */ typedef struct svn_lock_t { const char *path; /**< the path this lock applies to */ const char *token; /**< unique URI representing lock */ const char *owner; /**< the username which owns the lock */ const char *comment; /**< (optional) description of lock */ svn_boolean_t is_dav_comment; /**< was comment made by generic DAV client? */ apr_time_t creation_date; /**< when lock was made */ apr_time_t expiration_date; /**< (optional) when lock will expire; If value is 0, lock will never expire. */ } svn_lock_t; /** * Returns an @c svn_lock_t, allocated in @a pool with all fields initialized * to NULL values. * * @note To allow for extending the @c svn_lock_t structure in the future * releases, this function should always be used to allocate the structure. * * @since New in 1.2. */ svn_lock_t * svn_lock_create(apr_pool_t *pool); /** * Return a deep copy of @a lock, allocated in @a pool. * * @since New in 1.2. */ svn_lock_t * svn_lock_dup(const svn_lock_t *lock, apr_pool_t *pool); /** * Return a formatted Universal Unique IDentifier (UUID) string. * * @since New in 1.4. */ const char * svn_uuid_generate(apr_pool_t *pool); /** * Mergeinfo representing a merge of a range of revisions. * * @since New in 1.5 */ typedef struct svn_merge_range_t { /** * If the 'start' field is less than the 'end' field then 'start' is * exclusive and 'end' inclusive of the range described. This is termed * a forward merge range. If 'start' is greater than 'end' then the * opposite is true. This is termed a reverse merge range. If 'start' * equals 'end' the meaning of the range is not defined. */ svn_revnum_t start; svn_revnum_t end; /** * Whether this merge range should be inherited by treewise * descendants of the path to which the range applies. */ svn_boolean_t inheritable; } svn_merge_range_t; /** * Return a copy of @a range, allocated in @a pool. * * @since New in 1.5. */ svn_merge_range_t * svn_merge_range_dup(svn_merge_range_t *range, apr_pool_t *pool); /** * Returns true if the changeset committed in revision @a rev is one * of the changesets in the range @a range. * * @since New in 1.5. */ svn_boolean_t svn_merge_range_contains_rev(svn_merge_range_t *range, svn_revnum_t rev); /** @defgroup node_location_seg_reporting Node location segment reporting. * @{ */ /** * A representation of a segment of a object's version history with an * emphasis on the object's location in the repository as of various * revisions. * * @since New in 1.5. */ typedef struct svn_location_segment_t { /** The beginning (oldest) and ending (youngest) revisions for this segment. */ svn_revnum_t range_start; svn_revnum_t range_end; /** The absolute (sans leading slash) path for this segment. May be NULL to indicate gaps in an object's history. */ const char *path; } svn_location_segment_t; /** * A callback invoked by generators of @c svn_location_segment_t * objects, used to report information about a versioned object's * history in terms of its location in the repository filesystem over * time. */ typedef svn_error_t *(*svn_location_segment_receiver_t) (svn_location_segment_t *segment, void *baton, apr_pool_t *pool); /** * Return a deep copy of @a segment, allocated in @a pool. * * @since New in 1.5. */ svn_location_segment_t * svn_location_segment_dup(svn_location_segment_t *segment, apr_pool_t *pool); /** @} */ #ifdef __cplusplus } #endif /* __cplusplus */ /* * Everybody and their brother needs to deal with svn_error_t, the error * codes, and whatever else. While they *should* go and include svn_error.h * in order to do that... bah. Let's just help everybody out and include * that header whenever somebody grabs svn_types.h. * * Note that we do this at the END of this header so that its contents * are available to svn_error.h (our guards will prevent the circular * include). We also need to do the include *outside* of the cplusplus * guard. */ #include "svn_error.h" #endif /* SVN_TYPES_H */ 0707010002c63f000081a40000000000000000000000014cb50d8e00000ce00000010000010036ffffffffffffffff0000003200000000root/usr/local/include/subversion-1/mod_dav_svn.h/** * @copyright * ==================================================================== * Copyright (c) 2000-2007 CollabNet. All rights reserved. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://subversion.tigris.org/license-1.html. * If newer versions of this license are posted there, you may use a * newer version instead, at your option. * * This software consists of voluntary contributions made by many * individuals. For exact contribution history, see the revision * history and logs, available at http://subversion.tigris.org/. * ==================================================================== * @endcopyright * * @file mod_dav_svn.h * @brief Subversion's backend for Apache's mod_dav module */ #ifndef MOD_DAV_SVN_H #define MOD_DAV_SVN_H #include #include #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /* Given an apache request R, a URI, and a ROOT_PATH to the svn location block, process URI and return many things, allocated in r->pool: * CLEANED_URI: The uri with duplicate and trailing slashes removed. * TRAILING_SLASH: Whether the uri had a trailing slash on it. Three special substrings of the uri are returned for convenience: * REPOS_NAME: The single path component that is the directory which contains the repository. * RELATIVE_PATH: The remaining imaginary path components. * REPOS_PATH: The actual path within the repository filesystem, or NULL if no part of the uri refers to a path in the repository (e.g. "!svn/vcc/default" or "!svn/bln/25"). For example, consider the uri /svn/repos/proj1/!svn/blah/13//A/B/alpha In the SVNPath case, this function would receive a ROOT_PATH of '/svn/repos/proj1', and in the SVNParentPath case would receive a ROOT_PATH of '/svn/repos'. But either way, we would get back: * CLEANED_URI: /svn/repos/proj1/!svn/blah/13/A/B/alpha * REPOS_NAME: proj1 * RELATIVE_PATH: /!svn/blah/13/A/B/alpha * REPOS_PATH: A/B/alpha * TRAILING_SLASH: FALSE */ AP_MODULE_DECLARE(dav_error *) dav_svn_split_uri(request_rec *r, const char *uri, const char *root_path, const char **cleaned_uri, int *trailing_slash, const char **repos_name, const char **relative_path, const char **repos_path); /* Given an apache request R and a ROOT_PATH to the svn location block sets *REPOS_PATH to the path of the repository on disk. */ AP_MODULE_DECLARE(dav_error *) dav_svn_get_repos_path(request_rec *r, const char *root_path, const char **repos_path); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* MOD_DAV_SVN_H */ 0707010002c641000081a40000000000000000000000014cb50d8f0000ae980000010000010036ffffffffffffffff0000002f00000000root/usr/local/include/subversion-1/svn_auth.h/** * @copyright * ==================================================================== * Copyright (c) 2002-2009 CollabNet. All rights reserved. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://subversion.tigris.org/license-1.html. * If newer versions of this license are posted there, you may use a * newer version instead, at your option. * * This software consists of voluntary contributions made by many * individuals. For exact contribution history, see the revision * history and logs, available at http://subversion.tigris.org/. * ==================================================================== * @endcopyright * * @file svn_auth.h * @brief Subversion's authentication system */ #ifndef SVN_AUTH_H #define SVN_AUTH_H #include #include #include #include #include "svn_types.h" #include "svn_config.h" #include "svn_version.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** Overview of the svn authentication system. * * We define an authentication "provider" as a module that is able to * return a specific set of credentials. (e.g. username/password, * certificate, etc.) Each provider implements a vtable that * * - can fetch initial credentials * - can retry the fetch (or try to fetch something different) * - can store the credentials for future use * * For any given type of credentials, there can exist any number of * separate providers -- each provider has a different method of * fetching. (i.e. from a disk store, by prompting the user, etc.) * * The application begins by creating an auth baton object, and * "registers" some number of providers with the auth baton, in a * specific order. (For example, it may first register a * username/password provider that looks in disk store, then register * a username/password provider that prompts the user.) * * Later on, when any svn library is challenged, it asks the auth * baton for the specific credentials. If the initial credentials * fail to authenticate, the caller keeps requesting new credentials. * Under the hood, libsvn_auth effectively "walks" over each provider * (in order of registry), one at a time, until all the providers have * exhausted all their retry options. * * This system allows an application to flexibly define authentication * behaviors (by changing registration order), and very easily write * new authentication providers. * * An auth_baton also contains an internal hashtable of run-time * parameters; any provider or library layer can set these run-time * parameters at any time, so that the provider has access to the * data. (For example, certain run-time data may not be available * until an authentication challenge is made.) Each credential type * must document the run-time parameters that are made available to * its providers. * * @defgroup auth_fns Authentication functions * @{ */ /** The type of a Subversion authentication object */ typedef struct svn_auth_baton_t svn_auth_baton_t; /** The type of a Subversion authentication-iteration object */ typedef struct svn_auth_iterstate_t svn_auth_iterstate_t; /** The main authentication "provider" vtable. */ typedef struct svn_auth_provider_t { /** The kind of credentials this provider knows how to retrieve. */ const char *cred_kind; /** Get an initial set of credentials. * * Set @a *credentials to a set of valid credentials within @a * realmstring, or NULL if no credentials are available. Set @a * *iter_baton to context that allows a subsequent call to @c * next_credentials, in case the first credentials fail to * authenticate. @a provider_baton is general context for the * vtable, @a parameters contains any run-time data that the * provider may need, and @a realmstring comes from the * svn_auth_first_credentials() call. */ svn_error_t * (*first_credentials)(void **credentials, void **iter_baton, void *provider_baton, apr_hash_t *parameters, const char *realmstring, apr_pool_t *pool); /** Get a different set of credentials. * * Set @a *credentials to another set of valid credentials (using @a * iter_baton as the context from previous call to first_credentials * or next_credentials). If no more credentials are available, set * @a *credentials to NULL. If the provider only has one set of * credentials, this function pointer should simply be NULL. @a * provider_baton is general context for the vtable, @a parameters * contains any run-time data that the provider may need, and @a * realmstring comes from the svn_auth_first_credentials() call. */ svn_error_t * (*next_credentials)(void **credentials, void *iter_baton, void *provider_baton, apr_hash_t *parameters, const char *realmstring, apr_pool_t *pool); /** Save credentials. * * Store @a credentials for future use. @a provider_baton is * general context for the vtable, and @a parameters contains any * run-time data the provider may need. Set @a *saved to TRUE if * the save happened, or FALSE if not. The provider is not required * to save; if it refuses or is unable to save for non-fatal * reasons, return FALSE. If the provider never saves data, then * this function pointer should simply be NULL. @a realmstring comes * from the svn_auth_first_credentials() call. */ svn_error_t * (*save_credentials)(svn_boolean_t *saved, void *credentials, void *provider_baton, apr_hash_t *parameters, const char *realmstring, apr_pool_t *pool); } svn_auth_provider_t; /** A provider object, ready to be put into an array and given to svn_auth_open(). */ typedef struct svn_auth_provider_object_t { const svn_auth_provider_t *vtable; void *provider_baton; } svn_auth_provider_object_t; /** The type of function returning authentication provider. */ typedef void (*svn_auth_simple_provider_func_t) (svn_auth_provider_object_t **provider, apr_pool_t *pool); /** Specific types of credentials **/ /** Simple username/password pair credential kind. * * The following auth parameters are available to the providers: * * - @c SVN_AUTH_PARAM_CONFIG_CATEGORY_CONFIG (@c svn_config_t*) * - @c SVN_AUTH_PARAM_CONFIG_CATEGORY_SERVERS (@c svn_config_t*) * * The following auth parameters may be available to the providers: * * - @c SVN_AUTH_PARAM_NO_AUTH_CACHE (@c void*) * - @c SVN_AUTH_PARAM_DEFAULT_USERNAME (@c char*) * - @c SVN_AUTH_PARAM_DEFAULT_PASSWORD (@c char*) */ #define SVN_AUTH_CRED_SIMPLE "svn.simple" /** @c SVN_AUTH_CRED_SIMPLE credentials. */ typedef struct svn_auth_cred_simple_t { /** Username */ const char *username; /** Password */ const char *password; /** Indicates if the credentials may be saved (to disk). For example, a * GUI prompt implementation with a remember password checkbox shall set * @a may_save to TRUE if the checkbox is checked. */ svn_boolean_t may_save; } svn_auth_cred_simple_t; /** Username credential kind. * * The following optional auth parameters are relevant to the providers: * * - @c SVN_AUTH_PARAM_NO_AUTH_CACHE (@c void*) * - @c SVN_AUTH_PARAM_DEFAULT_USERNAME (@c char*) */ #define SVN_AUTH_CRED_USERNAME "svn.username" /** @c SVN_AUTH_CRED_USERNAME credentials. */ typedef struct svn_auth_cred_username_t { /** Username */ const char *username; /** Indicates if the credentials may be saved (to disk). For example, a * GUI prompt implementation with a remember username checkbox shall set * @a may_save to TRUE if the checkbox is checked. */ svn_boolean_t may_save; } svn_auth_cred_username_t; /** SSL client certificate credential type. * * The following auth parameters are available to the providers: * * - @c SVN_AUTH_PARAM_CONFIG_CATEGORY_SERVERS (@c svn_config_t*) * - @c SVN_AUTH_PARAM_SERVER_GROUP (@c char*) * * The following optional auth parameters are relevant to the providers: * * - @c SVN_AUTH_PARAM_NO_AUTH_CACHE (@c void*) */ #define SVN_AUTH_CRED_SSL_CLIENT_CERT "svn.ssl.client-cert" /** @c SVN_AUTH_CRED_SSL_CLIENT_CERT credentials. */ typedef struct svn_auth_cred_ssl_client_cert_t { /** Absolute path to the certificate file */ const char *cert_file; /** Indicates if the credentials may be saved (to disk). For example, a * GUI prompt implementation with a remember certificate checkbox shall * set @a may_save to TRUE if the checkbox is checked. */ svn_boolean_t may_save; } svn_auth_cred_ssl_client_cert_t; /** A function returning an SSL client certificate passphrase provider. */ typedef void (*svn_auth_ssl_client_cert_pw_provider_func_t) (svn_auth_provider_object_t **provider, apr_pool_t *pool); /** SSL client certificate passphrase credential type. * * @note The realmstring used with this credential type must be a name that * makes it possible for the user to identify the certificate. * * The following auth parameters are available to the providers: * * - @c SVN_AUTH_PARAM_CONFIG_CATEGORY_CONFIG (@c svn_config_t*) * - @c SVN_AUTH_PARAM_CONFIG_CATEGORY_SERVERS (@c svn_config_t*) * - @c SVN_AUTH_PARAM_SERVER_GROUP (@c char*) * * The following optional auth parameters are relevant to the providers: * * - @c SVN_AUTH_PARAM_NO_AUTH_CACHE (@c void*) */ #define SVN_AUTH_CRED_SSL_CLIENT_CERT_PW "svn.ssl.client-passphrase" /** @c SVN_AUTH_CRED_SSL_CLIENT_CERT_PW credentials. */ typedef struct svn_auth_cred_ssl_client_cert_pw_t { /** Certificate password */ const char *password; /** Indicates if the credentials may be saved (to disk). For example, a * GUI prompt implementation with a remember password checkbox shall set * @a may_save to TRUE if the checkbox is checked. */ svn_boolean_t may_save; } svn_auth_cred_ssl_client_cert_pw_t; /** SSL server verification credential type. * * The following auth parameters are available to the providers: * * - @c SVN_AUTH_PARAM_CONFIG_CATEGORY_SERVERS (@c svn_config_t*) * - @c SVN_AUTH_PARAM_SERVER_GROUP (@c char*) * - @c SVN_AUTH_PARAM_SSL_SERVER_FAILURES (@c apr_uint32_t*) * - @c SVN_AUTH_PARAM_SSL_SERVER_CERT_INFO * (@c svn_auth_ssl_server_cert_info_t*) * * The following optional auth parameters are relevant to the providers: * * - @c SVN_AUTH_PARAM_NO_AUTH_CACHE (@c void*) */ #define SVN_AUTH_CRED_SSL_SERVER_TRUST "svn.ssl.server" /** SSL server certificate information used by @c * SVN_AUTH_CRED_SSL_SERVER_TRUST providers. */ typedef struct svn_auth_ssl_server_cert_info_t { /** Primary CN */ const char *hostname; /** ASCII fingerprint */ const char *fingerprint; /** ASCII date from which the certificate is valid */ const char *valid_from; /** ASCII date until which the certificate is valid */ const char *valid_until; /** DN of the certificate issuer */ const char *issuer_dname; /** Base-64 encoded DER certificate representation */ const char *ascii_cert; } svn_auth_ssl_server_cert_info_t; /** * Return a deep copy of @a info, allocated in @a pool. * * @since New in 1.3. */ svn_auth_ssl_server_cert_info_t * svn_auth_ssl_server_cert_info_dup(const svn_auth_ssl_server_cert_info_t *info, apr_pool_t *pool); /** @c SVN_AUTH_CRED_SSL_SERVER_TRUST credentials. */ typedef struct svn_auth_cred_ssl_server_trust_t { /** Indicates if the credentials may be saved (to disk). For example, a * GUI prompt implementation with a checkbox to accept the certificate * permanently shall set @a may_save to TRUE if the checkbox is checked. */ svn_boolean_t may_save; /** Bit mask of the accepted failures */ apr_uint32_t accepted_failures; } svn_auth_cred_ssl_server_trust_t; /** Credential-constructing prompt functions. **/ /** These exist so that different client applications can use * different prompt mechanisms to supply the same credentials. For * example, if authentication requires a username and password, a * command-line client's prompting function might prompt first for the * username and then for the password, whereas a GUI client's would * present a single dialog box asking for both, and a telepathic * client's would read all the information directly from the user's * mind. All these prompting functions return the same type of * credential, but the information used to construct the credential is * gathered in an interface-specific way in each case. */ /** Set @a *cred by prompting the user, allocating @a *cred in @a pool. * @a baton is an implementation-specific closure. * * If @a realm is non-NULL, maybe use it in the prompt string. * * If @a username is non-NULL, then the user might be prompted only * for a password, but @a *cred would still be filled with both * username and password. For example, a typical usage would be to * pass @a username on the first call, but then leave it NULL for * subsequent calls, on the theory that if credentials failed, it's * as likely to be due to incorrect username as incorrect password. * * If @a may_save is FALSE, the auth system does not allow the credentials * to be saved (to disk). A prompt function shall not ask the user if the * credentials shall be saved if @a may_save is FALSE. For example, a GUI * client with a remember password checkbox would grey out the checkbox if * @a may_save is FALSE. */ typedef svn_error_t *(*svn_auth_simple_prompt_func_t) (svn_auth_cred_simple_t **cred, void *baton, const char *realm, const char *username, svn_boolean_t may_save, apr_pool_t *pool); /** Set @a *cred by prompting the user, allocating @a *cred in @a pool. * @a baton is an implementation-specific closure. * * If @a realm is non-NULL, maybe use it in the prompt string. * * If @a may_save is FALSE, the auth system does not allow the credentials * to be saved (to disk). A prompt function shall not ask the user if the * credentials shall be saved if @a may_save is FALSE. For example, a GUI * client with a remember username checkbox would grey out the checkbox if * @a may_save is FALSE. */ typedef svn_error_t *(*svn_auth_username_prompt_func_t) (svn_auth_cred_username_t **cred, void *baton, const char *realm, svn_boolean_t may_save, apr_pool_t *pool); /** @name SSL server certificate failure bits * * @note These values are stored in the on disk auth cache by the SSL * server certificate auth provider, so the meaning of these bits must * not be changed. * @{ */ /** Certificate is not yet valid. */ #define SVN_AUTH_SSL_NOTYETVALID 0x00000001 /** Certificate has expired. */ #define SVN_AUTH_SSL_EXPIRED 0x00000002 /** Certificate's CN (hostname) does not match the remote hostname. */ #define SVN_AUTH_SSL_CNMISMATCH 0x00000004 /** @brief Certificate authority is unknown (i.e. not trusted) */ #define SVN_AUTH_SSL_UNKNOWNCA 0x00000008 /** @brief Other failure. This can happen if neon has introduced a new * failure bit that we do not handle yet. */ #define SVN_AUTH_SSL_OTHER 0x40000000 /** @} */ /** Set @a *cred by prompting the user, allocating @a *cred in @a pool. * @a baton is an implementation-specific closure. * * @a cert_info is a structure describing the server cert that was * presented to the client, and @a failures is a bitmask that * describes exactly why the cert could not be automatically validated, * composed from the constants SVN_AUTH_SSL_* (@c SVN_AUTH_SSL_NOTYETVALID * etc.). @a realm is a string that can be used in the prompt string. * * If @a may_save is FALSE, the auth system does not allow the credentials * to be saved (to disk). A prompt function shall not ask the user if the * credentials shall be saved if @a may_save is FALSE. For example, a GUI * client with a trust permanently checkbox would grey out the checkbox if * @a may_save is FALSE. */ typedef svn_error_t *(*svn_auth_ssl_server_trust_prompt_func_t) (svn_auth_cred_ssl_server_trust_t **cred, void *baton, const char *realm, apr_uint32_t failures, const svn_auth_ssl_server_cert_info_t *cert_info, svn_boolean_t may_save, apr_pool_t *pool); /** Set @a *cred by prompting the user, allocating @a *cred in @a pool. * @a baton is an implementation-specific closure. @a realm is a string * that can be used in the prompt string. * * If @a may_save is FALSE, the auth system does not allow the credentials * to be saved (to disk). A prompt function shall not ask the user if the * credentials shall be saved if @a may_save is FALSE. For example, a GUI * client with a remember certificate checkbox would grey out the checkbox * if @a may_save is FALSE. */ typedef svn_error_t *(*svn_auth_ssl_client_cert_prompt_func_t) (svn_auth_cred_ssl_client_cert_t **cred, void *baton, const char *realm, svn_boolean_t may_save, apr_pool_t *pool); /** Set @a *cred by prompting the user, allocating @a *cred in @a pool. * @a baton is an implementation-specific closure. @a realm is a string * identifying the certificate, and can be used in the prompt string. * * If @a may_save is FALSE, the auth system does not allow the credentials * to be saved (to disk). A prompt function shall not ask the user if the * credentials shall be saved if @a may_save is FALSE. For example, a GUI * client with a remember password checkbox would grey out the checkbox if * @a may_save is FALSE. */ typedef svn_error_t *(*svn_auth_ssl_client_cert_pw_prompt_func_t) (svn_auth_cred_ssl_client_cert_pw_t **cred, void *baton, const char *realm, svn_boolean_t may_save, apr_pool_t *pool); /** A type of callback function for asking whether storing a password to * disk in plaintext is allowed. * * In this callback, the client should ask the user whether storing * a password for the realm identified by @a realmstring to disk * in plaintext is allowed. * * The answer is returned in @a *may_save_plaintext. * @a baton is an implementation-specific closure. * All allocations should be done in @a pool. * * @since New in 1.6 */ typedef svn_error_t *(*svn_auth_plaintext_prompt_func_t) (svn_boolean_t *may_save_plaintext, const char *realmstring, void *baton, apr_pool_t *pool); /** A type of callback function for asking whether storing a passphrase to * disk in plaintext is allowed. * * In this callback, the client should ask the user whether storing * a passphrase for the realm identified by @a realmstring to disk * in plaintext is allowed. * * The answer is returned in @a *may_save_plaintext. * @a baton is an implementation-specific closure. * All allocations should be done in @a pool. * * @since New in 1.6 */ typedef svn_error_t *(*svn_auth_plaintext_passphrase_prompt_func_t) (svn_boolean_t *may_save_plaintext, const char *realmstring, void *baton, apr_pool_t *pool); /** Initialize an authentication system. * * Return an authentication object in @a *auth_baton (allocated in @a * pool) that represents a particular instance of the svn * authentication system. @a providers is an array of @c * svn_auth_provider_object_t pointers, already allocated in @a pool * and intentionally ordered. These pointers will be stored within @a * *auth_baton, grouped by credential type, and searched in this exact * order. */ void svn_auth_open(svn_auth_baton_t **auth_baton, apr_array_header_t *providers, apr_pool_t *pool); /** Set an authentication run-time parameter. * * Store @a name / @a value pair as a run-time parameter in @a * auth_baton, making the data accessible to all providers. @a name * and @a value will NOT be duplicated into the auth_baton's pool. * To delete a run-time parameter, pass NULL for @a value. */ void svn_auth_set_parameter(svn_auth_baton_t *auth_baton, const char *name, const void *value); /** Get an authentication run-time parameter. * * Return a value for run-time parameter @a name from @a auth_baton. * Return NULL if the parameter doesn't exist. */ const void * svn_auth_get_parameter(svn_auth_baton_t *auth_baton, const char *name); /** Universal run-time parameters, made available to all providers. If you are writing a new provider, then to be a "good citizen", you should notice these global parameters! Note that these run-time params should be treated as read-only by providers; the application is responsible for placing them into the auth_baton hash. */ /** The auth-hash prefix indicating that the parameter is global. */ #define SVN_AUTH_PARAM_PREFIX "svn:auth:" /** * @name Default credentials defines * Any 'default' credentials that came in through the application itself, * (e.g. --username and --password options). Property values are * const char *. * @{ */ #define SVN_AUTH_PARAM_DEFAULT_USERNAME SVN_AUTH_PARAM_PREFIX "username" #define SVN_AUTH_PARAM_DEFAULT_PASSWORD SVN_AUTH_PARAM_PREFIX "password" /** @} */ /** @brief The application doesn't want any providers to prompt * users. Property value is irrelevant; only property's existence * matters. */ #define SVN_AUTH_PARAM_NON_INTERACTIVE SVN_AUTH_PARAM_PREFIX "non-interactive" /** @brief The application doesn't want any providers to save passwords * to disk. Property value is irrelevant; only property's existence * matters. */ #define SVN_AUTH_PARAM_DONT_STORE_PASSWORDS SVN_AUTH_PARAM_PREFIX \ "dont-store-passwords" /** @brief Indicates whether providers may save passwords to disk in * plaintext. Property value can be either SVN_CONFIG_TRUE, * SVN_CONFIG_FALSE, or SVN_CONFIG_ASK. */ #define SVN_AUTH_PARAM_STORE_PLAINTEXT_PASSWORDS SVN_AUTH_PARAM_PREFIX \ "store-plaintext-passwords" /** @brief The application doesn't want any providers to save passphrase * to disk. Property value is irrelevant; only property's existence * matters. */ #define SVN_AUTH_PARAM_DONT_STORE_SSL_CLIENT_CERT_PP \ SVN_AUTH_PARAM_PREFIX "dont-store-ssl-client-cert-pp" /** @brief Indicates whether providers may save passphrase to disk in * plaintext. Property value can be either SVN_CONFIG_TRUE, * SVN_CONFIG_FALSE, or SVN_CONFIG_ASK. */ #define SVN_AUTH_PARAM_STORE_SSL_CLIENT_CERT_PP_PLAINTEXT \ SVN_AUTH_PARAM_PREFIX "store-ssl-client-cert-pp-plaintext" /** @brief The application doesn't want any providers to save credentials * to disk. Property value is irrelevant; only property's existence * matters. */ #define SVN_AUTH_PARAM_NO_AUTH_CACHE SVN_AUTH_PARAM_PREFIX "no-auth-cache" /** @brief The following property is for SSL server cert providers. This * provides a pointer to an @c apr_uint32_t containing the failures * detected by the certificate validator. */ #define SVN_AUTH_PARAM_SSL_SERVER_FAILURES SVN_AUTH_PARAM_PREFIX \ "ssl:failures" /** @brief The following property is for SSL server cert providers. This * provides the cert info (svn_auth_ssl_server_cert_info_t). */ #define SVN_AUTH_PARAM_SSL_SERVER_CERT_INFO SVN_AUTH_PARAM_PREFIX \ "ssl:cert-info" /** Some providers need access to the @c svn_config_t configuration. */ #define SVN_AUTH_PARAM_CONFIG_CATEGORY_CONFIG SVN_AUTH_PARAM_PREFIX "config-category-config" #define SVN_AUTH_PARAM_CONFIG_CATEGORY_SERVERS SVN_AUTH_PARAM_PREFIX "config-category-servers" /** @deprecated Provided for backward compatibility with the 1.5 API. */ #define SVN_AUTH_PARAM_CONFIG SVN_AUTH_PARAM_CONFIG_CATEGORY_SERVERS /** The current server group. */ #define SVN_AUTH_PARAM_SERVER_GROUP SVN_AUTH_PARAM_PREFIX "server-group" /** @brief A configuration directory that overrides the default * ~/.subversion. */ #define SVN_AUTH_PARAM_CONFIG_DIR SVN_AUTH_PARAM_PREFIX "config-dir" /** Get an initial set of credentials. * * Ask @a auth_baton to set @a *credentials to a set of credentials * defined by @a cred_kind and valid within @a realmstring, or NULL if * no credentials are available. Otherwise, return an iteration state * in @a *state, so that the caller can call * svn_auth_next_credentials(), in case the first set of credentials * fails to authenticate. * * Use @a pool to allocate @a *state, and for temporary allocation. * Note that @a *credentials will be allocated in @a auth_baton's pool. */ svn_error_t * svn_auth_first_credentials(void **credentials, svn_auth_iterstate_t **state, const char *cred_kind, const char *realmstring, svn_auth_baton_t *auth_baton, apr_pool_t *pool); /** Get another set of credentials, assuming previous ones failed to * authenticate. * * Use @a state to fetch a different set of @a *credentials, as a * follow-up to svn_auth_first_credentials() or * svn_auth_next_credentials(). If no more credentials are available, * set @a *credentials to NULL. * * Note that @a *credentials will be allocated in @c auth_baton's pool. */ svn_error_t * svn_auth_next_credentials(void **credentials, svn_auth_iterstate_t *state, apr_pool_t *pool); /** Save a set of credentials. * * Ask @a state to store the most recently returned credentials, * presumably because they successfully authenticated. * All allocations should be done in @a pool. * * If no credentials were ever returned, do nothing. */ svn_error_t * svn_auth_save_credentials(svn_auth_iterstate_t *state, apr_pool_t *pool); /** @} */ /** Set @a *provider to an authentication provider of type * svn_auth_cred_simple_t that gets information by prompting the user * with @a prompt_func and @a prompt_baton. Allocate @a *provider in * @a pool. * * If both @c SVN_AUTH_PARAM_DEFAULT_USERNAME and * @c SVN_AUTH_PARAM_DEFAULT_PASSWORD are defined as runtime * parameters in the @c auth_baton, then @a *provider will return the * default arguments when svn_auth_first_credentials() is called. If * svn_auth_first_credentials() fails, then @a *provider will * re-prompt @a retry_limit times (via svn_auth_next_credentials()). * For infinite retries, set @a retry_limit to value less than 0. * * @since New in 1.4. */ void svn_auth_get_simple_prompt_provider(svn_auth_provider_object_t **provider, svn_auth_simple_prompt_func_t prompt_func, void *prompt_baton, int retry_limit, apr_pool_t *pool); /** Set @a *provider to an authentication provider of type @c * svn_auth_cred_username_t that gets information by prompting the * user with @a prompt_func and @a prompt_baton. Allocate @a *provider * in @a pool. * * If @c SVN_AUTH_PARAM_DEFAULT_USERNAME is defined as a runtime * parameter in the @c auth_baton, then @a *provider will return the * default argument when svn_auth_first_credentials() is called. If * svn_auth_first_credentials() fails, then @a *provider will * re-prompt @a retry_limit times (via svn_auth_next_credentials()). * For infinite retries, set @a retry_limit to value less than 0. * * @since New in 1.4. */ void svn_auth_get_username_prompt_provider (svn_auth_provider_object_t **provider, svn_auth_username_prompt_func_t prompt_func, void *prompt_baton, int retry_limit, apr_pool_t *pool); /** Set @a *provider to an authentication provider of type @c * svn_auth_cred_simple_t that gets/sets information from the user's * ~/.subversion configuration directory. * * If the provider is going to save the password unencrypted, it calls @a * plaintext_prompt_func, passing @a prompt_baton, before saving the * password. * * If @a plaintext_prompt_func is NULL it is not called and the answer is * assumed to be TRUE. This matches the deprecated behaviour of storing * unencrypted passwords by default, and is only done this way for backward * compatibility reasons. * Client developers are highly encouraged to provide this callback * to ensure their users are made aware of the fact that their password * is going to be stored unencrypted. In the future, providers may * default to not storing the password unencrypted if this callback is NULL. * * Clients can however set the callback to NULL and set * SVN_AUTH_PARAM_STORE_PLAINTEXT_PASSWORDS to SVN_CONFIG_FALSE or * SVN_CONFIG_TRUE to enforce a certain behaviour. * * Allocate @a *provider in @a pool. * * If a default username or password is available, @a *provider will * honor them as well, and return them when * svn_auth_first_credentials() is called. (see @c * SVN_AUTH_PARAM_DEFAULT_USERNAME and @c * SVN_AUTH_PARAM_DEFAULT_PASSWORD). * * @since New in 1.6. */ void svn_auth_get_simple_provider2 (svn_auth_provider_object_t **provider, svn_auth_plaintext_prompt_func_t plaintext_prompt_func, void *prompt_baton, apr_pool_t *pool); /** Like svn_auth_get_simple_provider2, but without the ability to * call the svn_auth_plaintext_prompt_func_t callback, and the provider * always assumes that it is allowed to store the password in plaintext. * * @deprecated Provided for backwards compatibility with the 1.5 API. * @since New in 1.4. */ SVN_DEPRECATED void svn_auth_get_simple_provider(svn_auth_provider_object_t **provider, apr_pool_t *pool); /** Set @a *provider to an authentication provider of type @c * svn_auth_provider_object_t, or return @a NULL if the provider is not * available for the requested platform or the requested provider is unknown. * * Valid @a provider_name values are: "gnome_keyring", "keychain", "kwallet" * and "windows". * * Valid @a provider_type values are: "simple", "ssl_client_cert_pw" and * "ssl_server_trust". * * Allocate @a *provider in @a pool. * * What actually happens is we invoke the appropriate provider function to * supply the @a provider, like so: * * svn_auth_get___provider(@a provider, @a pool); * * @since New in 1.6. */ svn_error_t * svn_auth_get_platform_specific_provider (svn_auth_provider_object_t **provider, const char *provider_name, const char *provider_type, apr_pool_t *pool); /** Set @a *providers to an array of svn_auth_provider_object_t * * objects. * Only client authentication providers available for the current platform are * returned. Order of the platform-specific authentication providers is * determined by the 'password-stores' configuration option which is retrieved * from @a config. @a config can be NULL. * * Create and allocate @a *providers in @a pool. * * Default order of the platform-specific authentication providers: * 1. gnome-keyring * 2. kwallet * 3. keychain * 4. windows-cryptoapi * * @since New in 1.6. */ svn_error_t * svn_auth_get_platform_specific_client_providers (apr_array_header_t **providers, svn_config_t *config, apr_pool_t *pool); #if (defined(WIN32) && !defined(__MINGW32__)) || defined(DOXYGEN) /** * Set @a *provider to an authentication provider of type @c * svn_auth_cred_simple_t that gets/sets information from the user's * ~/.subversion configuration directory. Allocate @a *provider in * @a pool. * * This is like svn_auth_get_simple_provider(), except that, when * running on Window 2000 or newer (or any other Windows version that * includes the CryptoAPI), the provider encrypts the password before * storing it to disk. On earlier versions of Windows, the provider * does nothing. * * @since New in 1.4. * @note This function is only available on Windows. * * @note An administrative password reset may invalidate the account's * secret key. This function will detect that situation and behave as * if the password were not cached at all. */ void svn_auth_get_windows_simple_provider(svn_auth_provider_object_t **provider, apr_pool_t *pool); /** * Set @a *provider to an authentication provider of type @c * svn_auth_cred_ssl_client_cert_pw_t that gets/sets information from the * user's ~/.subversion configuration directory. Allocate @a *provider in * @a pool. * * This is like svn_auth_get_ssl_client_cert_pw_file_provider(), except that * when running on Window 2000 or newer, the provider encrypts the password * before storing it to disk. On earlier versions of Windows, the provider * does nothing. * * @since New in 1.6 * @note This function is only available on Windows. * * @note An administrative password reset may invalidate the account's * secret key. This function will detect that situation and behave as * if the password were not cached at all. */ void svn_auth_get_windows_ssl_client_cert_pw_provider (svn_auth_provider_object_t **provider, apr_pool_t *pool); /** * Set @a *provider to an authentication provider of type @c * svn_auth_cred_ssl_server_trust_t, allocated in @a pool. * * This provider automatically validates ssl server certificates with * the CryptoApi, like Internet Explorer and the Windows network API do. * This allows the rollout of root certificates via Windows Domain * policies, instead of Subversion specific configuration. * * @since New in 1.5. * @note This function is only available on Windows. */ void svn_auth_get_windows_ssl_server_trust_provider (svn_auth_provider_object_t **provider, apr_pool_t *pool); #endif /* WIN32 && !__MINGW32__ || DOXYGEN */ #if defined(DARWIN) || defined(DOXYGEN) /** * Set @a *provider to an authentication provider of type @c * svn_auth_cred_simple_t that gets/sets information from the user's * ~/.subversion configuration directory. Allocate @a *provider in * @a pool. * * This is like svn_auth_get_simple_provider(), except that the * password is stored in the Mac OS KeyChain. * * @since New in 1.4 * @note This function is only available on Mac OS 10.2 and higher. */ void svn_auth_get_keychain_simple_provider(svn_auth_provider_object_t **provider, apr_pool_t *pool); /** * Set @a *provider to an authentication provider of type @c * svn_auth_cred_ssl_client_cert_pw_t that gets/sets information from the * user's ~/.subversion configuration directory. Allocate @a *provider in * @a pool. * * This is like svn_auth_get_ssl_client_cert_pw_file_provider(), except * that the password is stored in the Mac OS KeyChain. * * @since New in 1.6 * @note This function is only available on Mac OS 10.2 and higher. */ void svn_auth_get_keychain_ssl_client_cert_pw_provider (svn_auth_provider_object_t **provider, apr_pool_t *pool); #endif /* DARWIN || DOXYGEN */ #if (!defined(DARWIN) && !defined(WIN32)) || defined(DOXYGEN) /** A type of callback function for obtaining the GNOME Keyring password. * * In this callback, the client should ask the user for default keyring * @a keyring_name password. * * The answer is returned in @a *keyring_password. * @a baton is an implementation-specific closure. * All allocations should be done in @a pool. * * @since New in 1.6 */ typedef svn_error_t *(*svn_auth_gnome_keyring_unlock_prompt_func_t) (char **keyring_password, const char *keyring_name, void *baton, apr_pool_t *pool); /** libsvn_auth_gnome_keyring-specific run-time parameters. */ /** @brief The pointer to function which prompts user for GNOME Keyring * password. * The type of this pointer should be svn_auth_gnome_keyring_unlock_prompt_func_t. */ #define SVN_AUTH_PARAM_GNOME_KEYRING_UNLOCK_PROMPT_FUNC "gnome-keyring-unlock-prompt-func" /** @brief The baton which is passed to * @c *SVN_AUTH_PARAM_GNOME_KEYRING_UNLOCK_PROMPT_FUNC. */ #define SVN_AUTH_PARAM_GNOME_KEYRING_UNLOCK_PROMPT_BATON "gnome-keyring-unlock-prompt-baton" /** * Get libsvn_auth_gnome_keyring version information. * * @since New in 1.6 */ const svn_version_t * svn_auth_gnome_keyring_version(void); /** * Set @a *provider to an authentication provider of type @c * svn_auth_cred_simple_t that gets/sets information from the user's * ~/.subversion configuration directory. * * This is like svn_client_get_simple_provider(), except that the * password is stored in GNOME Keyring. * * If the GNOME Keyring is locked the provider calls * @c *SVN_AUTH_PARAM_GNOME_KEYRING_UNLOCK_PROMPT_FUNC in order to unlock * the keyring. * * @c SVN_AUTH_PARAM_GNOME_KEYRING_UNLOCK_PROMPT_BATON is passed to * @c *SVN_AUTH_PARAM_GNOME_KEYRING_UNLOCK_PROMPT_FUNC. * * Allocate @a *provider in @a pool. * * @since New in 1.6 * @note This function actually works only on systems with * libsvn_auth_gnome_keyring and GNOME Keyring installed. */ void svn_auth_get_gnome_keyring_simple_provider (svn_auth_provider_object_t **provider, apr_pool_t *pool); /** * Set @a *provider to an authentication provider of type @c * svn_auth_cred_ssl_client_cert_pw_t that gets/sets information from the * user's ~/.subversion configuration directory. * * This is like svn_client_get_ssl_client_cert_pw_file_provider(), except * that the password is stored in GNOME Keyring. * * If the GNOME Keyring is locked the provider calls * @c *SVN_AUTH_PARAM_GNOME_KEYRING_UNLOCK_PROMPT_FUNC in order to unlock * the keyring. * * @c SVN_AUTH_PARAM_GNOME_KEYRING_UNLOCK_PROMPT_BATON is passed to * @c *SVN_AUTH_PARAM_GNOME_KEYRING_UNLOCK_PROMPT_FUNC. * * Allocate @a *provider in @a pool. * * @since New in 1.6 * @note This function actually works only on systems with * libsvn_auth_gnome_keyring and GNOME Keyring installed. */ void svn_auth_get_gnome_keyring_ssl_client_cert_pw_provider (svn_auth_provider_object_t **provider, apr_pool_t *pool); /** * Get libsvn_auth_kwallet version information. * * @since New in 1.6 */ const svn_version_t * svn_auth_kwallet_version(void); /** * Set @a *provider to an authentication provider of type @c * svn_auth_cred_simple_t that gets/sets information from the user's * ~/.subversion configuration directory. Allocate @a *provider in * @a pool. * * This is like svn_client_get_simple_provider(), except that the * password is stored in KWallet. * * @since New in 1.6 * @note This function actually works only on systems with libsvn_auth_kwallet * and KWallet installed. */ void svn_auth_get_kwallet_simple_provider(svn_auth_provider_object_t **provider, apr_pool_t *pool); /** * Set @a *provider to an authentication provider of type @c * svn_auth_cred_ssl_client_cert_pw_t that gets/sets information from the * user's ~/.subversion configuration directory. Allocate @a *provider in * @a pool. * * This is like svn_client_get_ssl_client_cert_pw_file_provider(), except * that the password is stored in KWallet. * * @since New in 1.6 * @note This function actually works only on systems with libsvn_auth_kwallet * and KWallet installed. */ void svn_auth_get_kwallet_ssl_client_cert_pw_provider (svn_auth_provider_object_t **provider, apr_pool_t *pool); #endif /* (!DARWIN && !WIN32) || DOXYGEN */ /** Set @a *provider to an authentication provider of type @c * svn_auth_cred_username_t that gets/sets information from a user's * ~/.subversion configuration directory. Allocate @a *provider in * @a pool. * * If a default username is available, @a *provider will honor it, * and return it when svn_auth_first_credentials() is called. (See * @c SVN_AUTH_PARAM_DEFAULT_USERNAME.) * * @since New in 1.4. */ void svn_auth_get_username_provider(svn_auth_provider_object_t **provider, apr_pool_t *pool); /** Set @a *provider to an authentication provider of type @c * svn_auth_cred_ssl_server_trust_t, allocated in @a pool. * * @a *provider retrieves its credentials from the configuration * mechanism. The returned credential is used to override SSL * security on an error. * * @since New in 1.4. */ void svn_auth_get_ssl_server_trust_file_provider (svn_auth_provider_object_t **provider, apr_pool_t *pool); /** Set @a *provider to an authentication provider of type @c * svn_auth_cred_ssl_client_cert_t, allocated in @a pool. * * @a *provider retrieves its credentials from the configuration * mechanism. The returned credential is used to load the appropriate * client certificate for authentication when requested by a server. * * @since New in 1.4. */ void svn_auth_get_ssl_client_cert_file_provider (svn_auth_provider_object_t **provider, apr_pool_t *pool); /** Set @a *provider to an authentication provider of type @c * svn_auth_cred_ssl_client_cert_pw_t that gets/sets information from the user's * ~/.subversion configuration directory. * * If the provider is going to save the passphrase unencrypted, * it calls @a plaintext_passphrase_prompt_func, passing @a * prompt_baton, before saving the passphrase. * * If @a plaintext_passphrase_prompt_func is NULL it is not called * and the passphrase is not stored in plaintext. * Client developers are highly encouraged to provide this callback * to ensure their users are made aware of the fact that their passphrase * is going to be stored unencrypted. * * Clients can however set the callback to NULL and set * SVN_AUTH_PARAM_STORE_SSL_CLIENT_CERT_PP_PLAINTEXT to SVN_CONFIG_FALSE or * SVN_CONFIG_TRUE to enforce a certain behaviour. * * Allocate @a *provider in @a pool. * * @since New in 1.6. */ void svn_auth_get_ssl_client_cert_pw_file_provider2 (svn_auth_provider_object_t **provider, svn_auth_plaintext_passphrase_prompt_func_t plaintext_passphrase_prompt_func, void *prompt_baton, apr_pool_t *pool); /** Like svn_auth_get_ssl_client_cert_pw_file_provider2, but without * the ability to call the svn_auth_plaintext_passphrase_prompt_func_t * callback, and the provider always assumes that it is not allowed * to store the passphrase in plaintext. * * @deprecated Provided for backwards compatibility with the 1.5 API. * @since New in 1.4. */ SVN_DEPRECATED void svn_auth_get_ssl_client_cert_pw_file_provider (svn_auth_provider_object_t **provider, apr_pool_t *pool); /** Set @a *provider to an authentication provider of type @c * svn_auth_cred_ssl_server_trust_t, allocated in @a pool. * * @a *provider retrieves its credentials by using the @a prompt_func * and @a prompt_baton. The returned credential is used to override * SSL security on an error. * * @since New in 1.4. */ void svn_auth_get_ssl_server_trust_prompt_provider (svn_auth_provider_object_t **provider, svn_auth_ssl_server_trust_prompt_func_t prompt_func, void *prompt_baton, apr_pool_t *pool); /** Set @a *provider to an authentication provider of type @c * svn_auth_cred_ssl_client_cert_t, allocated in @a pool. * * @a *provider retrieves its credentials by using the @a prompt_func * and @a prompt_baton. The returned credential is used to load the * appropriate client certificate for authentication when requested by * a server. The prompt will be retried @a retry_limit times. For * infinite retries, set @a retry_limit to value less than 0. * * @since New in 1.4. */ void svn_auth_get_ssl_client_cert_prompt_provider (svn_auth_provider_object_t **provider, svn_auth_ssl_client_cert_prompt_func_t prompt_func, void *prompt_baton, int retry_limit, apr_pool_t *pool); /** Set @a *provider to an authentication provider of type @c * svn_auth_cred_ssl_client_cert_pw_t, allocated in @a pool. * * @a *provider retrieves its credentials by using the @a prompt_func * and @a prompt_baton. The returned credential is used when a loaded * client certificate is protected by a passphrase. The prompt will * be retried @a retry_limit times. For infinite retries, set * @a retry_limit to value less than 0. * * @since New in 1.4. */ void svn_auth_get_ssl_client_cert_pw_prompt_provider (svn_auth_provider_object_t **provider, svn_auth_ssl_client_cert_pw_prompt_func_t prompt_func, void *prompt_baton, int retry_limit, apr_pool_t *pool); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* SVN_AUTH_H */ 0707010002c64a000081a40000000000000000000000014cb50d8e0000c4490000010000010036ffffffffffffffff0000003000000000root/usr/local/include/subversion-1/svn_delta.h/** * @copyright * ==================================================================== * Copyright (c) 2000-2008 CollabNet. All rights reserved. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://subversion.tigris.org/license-1.html. * If newer versions of this license are posted there, you may use a * newer version instead, at your option. * * This software consists of voluntary contributions made by many * individuals. For exact contribution history, see the revision * history and logs, available at http://subversion.tigris.org/. * ==================================================================== * @endcopyright * * @file svn_delta.h * @brief Delta-parsing */ /* ==================================================================== */ #ifndef SVN_DELTA_H #define SVN_DELTA_H #include #include #include #include #include /* for apr_file_t */ #include "svn_types.h" #include "svn_string.h" #include "svn_io.h" #include "svn_version.h" #include "svn_checksum.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * Get libsvn_delta version information. * * @since New in 1.1. */ const svn_version_t * svn_delta_version(void); /** * @defgroup delta_support Delta generation and handling * * @{ */ /** Text deltas. * * A text delta represents the difference between two strings of * bytes, the `source' string and the `target' string. Given a source * string and a target string, we can compute a text delta; given a * source string and a delta, we can reconstruct the target string. * However, note that deltas are not reversible: you cannot always * reconstruct the source string given the target string and delta. * * Since text deltas can be very large, the interface here allows us * to produce and consume them in pieces. Each piece, represented by * an @c svn_txdelta_window_t structure, describes how to produce the * next section of the target string. * * To compute a new text delta: * * - We call svn_txdelta() on the streams we want to compare. That * returns us an @c svn_txdelta_stream_t object. * * - We then call svn_txdelta_next_window() on the stream object * repeatedly. Each call returns a new @c svn_txdelta_window_t * object, which describes the next portion of the target string. * When svn_txdelta_next_window() returns zero, we are done building * the target string. * * @defgroup svn_delta_txt_delta Text deltas * @{ */ /** Action codes for text delta instructions. */ enum svn_delta_action { /** Append the @a length bytes at @a offset in the source view to the * target. * * It must be the case that 0 <= @a offset < @a offset + * @a length <= size of source view. */ svn_txdelta_source, /** Append the @a length bytes at @a offset in the target view, to the * target. * * It must be the case that 0 <= @a offset < current position in the * target view. * * However! @a offset + @a length may be *beyond* the end of the existing * target data. "Where the heck does the text come from, then?" * If you start at @a offset, and append @a length bytes one at a time, * it'll work out --- you're adding new bytes to the end at the * same rate you're reading them from the middle. Thus, if your * current target text is "abcdefgh", and you get an @c svn_txdelta_target * instruction whose @a offset is 6 and whose @a length is 7, * the resulting string is "abcdefghghghghg". This trick is actually * useful in encoding long runs of consecutive characters, long runs * of CR/LF pairs, etc. */ svn_txdelta_target, /** Append the @a length bytes at @a offset in the window's @a new string * to the target. * * It must be the case that 0 <= @a offset < @a offset + * @a length <= length of @a new. Windows MUST use new data in ascending * order with no overlap at the moment; svn_txdelta_to_svndiff() * depends on this. */ svn_txdelta_new }; /** A single text delta instruction. */ typedef struct svn_txdelta_op_t { /** Action code of delta instruction */ enum svn_delta_action action_code; /** Offset of delta, see #svn_delta_action for more details. */ apr_size_t offset; /** Number of bytes of delta, see #svn_delta_action for more details. */ apr_size_t length; } svn_txdelta_op_t; /** An @c svn_txdelta_window_t object describes how to reconstruct a * contiguous section of the target string (the "target view") using a * specified contiguous region of the source string (the "source * view"). It contains a series of instructions which assemble the * new target string text by pulling together substrings from: * * - the source view, * * - the previously constructed portion of the target view, * * - a string of new data contained within the window structure * * The source view must always slide forward from one window to the * next; that is, neither the beginning nor the end of the source view * may move to the left as we read from a window stream. This * property allows us to apply deltas to non-seekable source streams * without making a full copy of the source stream. */ typedef struct svn_txdelta_window_t { /** The offset of the source view for this window. */ svn_filesize_t sview_offset; /** The length of the source view for this window. */ apr_size_t sview_len; /** The length of the target view for this window, i.e. the number of * bytes which will be reconstructed by the instruction stream. */ apr_size_t tview_len; /** The number of instructions in this window. */ int num_ops; /** The number of svn_txdelta_source instructions in this window. If * this number is 0, we don't need to read the source in order to * reconstruct the target view. */ int src_ops; /** The instructions for this window. */ const svn_txdelta_op_t *ops; /** New data, for use by any `svn_txdelta_new' instructions. */ const svn_string_t *new_data; } svn_txdelta_window_t; /** * Return a deep copy of @a window, allocated in @a pool. * * @since New in 1.3. */ svn_txdelta_window_t * svn_txdelta_window_dup(const svn_txdelta_window_t *window, apr_pool_t *pool); /** * Compose two delta windows, yielding a third, allocated in @a pool. * * @since New in 1.4 * */ svn_txdelta_window_t * svn_txdelta_compose_windows(const svn_txdelta_window_t *window_A, const svn_txdelta_window_t *window_B, apr_pool_t *pool); /** * Apply the instructions from @a window to a source view @a sbuf to * produce a target view @a tbuf. * * @a sbuf is assumed to have @a window->sview_len bytes of data and * @a tbuf is assumed to have room for @a tlen bytes of output. @a * tlen may be more than @a window->tview_len, so return the actual * number of bytes written. @a sbuf is not touched and may be NULL if * @a window contains no source-copy operations. This is purely a * memory operation; nothing can go wrong as long as we have a valid * window. * * @since New in 1.4 * */ void svn_txdelta_apply_instructions(svn_txdelta_window_t *window, const char *sbuf, char *tbuf, apr_size_t *tlen); /** A typedef for functions that consume a series of delta windows, for * use in caller-pushes interfaces. Such functions will typically * apply the delta windows to produce some file, or save the windows * somewhere. At the end of the delta window stream, you must call * this function passing zero for the @a window argument. */ typedef svn_error_t *(*svn_txdelta_window_handler_t) (svn_txdelta_window_t *window, void *baton); /** This function will generate delta windows that turn @a source into * @a target, and pushing these windows into the @a handler window handler * callback (passing @a handler_baton to each invocation). * * If @a checksum is not NULL, then a checksum (of kind @a checksum_kind) * will be computed for the target stream, and placed into *checksum. * * If @a cancel_func is not NULL, then it should refer to a cancellation * function (along with @a cancel_baton). * * Results (the checksum) will be allocated from @a result_pool, and all * temporary allocations will be performed in @a scratch_pool. * * Note: this function replaces the combination of svn_txdelta() and * svn_txdelta_send_txstream(). * * @since New in 1.6. */ svn_error_t * svn_txdelta_run(svn_stream_t *source, svn_stream_t *target, svn_txdelta_window_handler_t handler, void *handler_baton, svn_checksum_kind_t checksum_kind, svn_checksum_t **checksum, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *result_pool, apr_pool_t *scratch_pool); /** A delta stream --- this is the hat from which we pull a series of * svn_txdelta_window_t objects, which, taken in order, describe the * entire target string. This type is defined within libsvn_delta, and * opaque outside that library. */ typedef struct svn_txdelta_stream_t svn_txdelta_stream_t; /** A typedef for a function that will set @a *window to the next * window from a @c svn_txdelta_stream_t object. If there are no more * delta windows, NULL will be used. The returned window, if any, * will be allocated in @a pool. @a baton is the baton specified * when the stream was created. * * @since New in 1.4. */ typedef svn_error_t * (*svn_txdelta_next_window_fn_t)(svn_txdelta_window_t **window, void *baton, apr_pool_t *pool); /** A typedef for a function that will return the md5 checksum of the * fulltext deltified by a @c svn_txdelta_stream_t object. Will * return NULL if the final null window hasn't yet been returned by * the stream. The returned value will be allocated in the same pool * as the stream. @a baton is the baton specified when the stream was * created. * * @since New in 1.4. */ typedef const unsigned char * (*svn_txdelta_md5_digest_fn_t)(void *baton); /** Create and return a generic text delta stream with @a baton, @a * next_window and @a md5_digest. Allocate the new stream in @a * pool. * * @since New in 1.4. */ svn_txdelta_stream_t * svn_txdelta_stream_create(void *baton, svn_txdelta_next_window_fn_t next_window, svn_txdelta_md5_digest_fn_t md5_digest, apr_pool_t *pool); /** Set @a *window to a pointer to the next window from the delta stream * @a stream. When we have completely reconstructed the target string, * set @a *window to zero. * * The window will be allocated in @a pool. */ svn_error_t * svn_txdelta_next_window(svn_txdelta_window_t **window, svn_txdelta_stream_t *stream, apr_pool_t *pool); /** Return the md5 digest for the complete fulltext deltified by * @a stream, or @c NULL if @a stream has not yet returned its final * @c NULL window. The digest is allocated in the same memory as @a * STREAM. */ const unsigned char * svn_txdelta_md5_digest(svn_txdelta_stream_t *stream); /** Set @a *stream to a pointer to a delta stream that will turn the byte * string from @a source into the byte stream from @a target. * * @a source and @a target are both readable generic streams. When we call * svn_txdelta_next_window() on @a *stream, it will read from @a source and * @a target to gather as much data as it needs. * * Do any necessary allocation in a sub-pool of @a pool. */ void svn_txdelta(svn_txdelta_stream_t **stream, svn_stream_t *source, svn_stream_t *target, apr_pool_t *pool); /** * Return a writable stream which, when fed target data, will send * delta windows to @a handler/@a handler_baton which transform the * data in @a source to the target data. As usual, the window handler * will receive a NULL window to signify the end of the window stream. * The stream handler functions will read data from @a source as * necessary. * * @since New in 1.1. */ svn_stream_t * svn_txdelta_target_push(svn_txdelta_window_handler_t handler, void *handler_baton, svn_stream_t *source, apr_pool_t *pool); /** Send the contents of @a string to window-handler @a handler/@a baton. * This is effectively a 'copy' operation, resulting in delta windows that * make the target equivalent to the value of @a string. * * All temporary allocation is performed in @a pool. */ svn_error_t * svn_txdelta_send_string(const svn_string_t *string, svn_txdelta_window_handler_t handler, void *handler_baton, apr_pool_t *pool); /** Send the contents of @a stream to window-handler @a handler/@a baton. * This is effectively a 'copy' operation, resulting in delta windows that * make the target equivalent to the stream. * * If @a digest is non-NULL, populate it with the md5 checksum for the * fulltext that was deltified (@a digest must be at least * @c APR_MD5_DIGESTSIZE bytes long). * * All temporary allocation is performed in @a pool. */ svn_error_t * svn_txdelta_send_stream(svn_stream_t *stream, svn_txdelta_window_handler_t handler, void *handler_baton, unsigned char *digest, apr_pool_t *pool); /** Send the contents of @a txstream to window-handler @a handler/@a baton. * Windows will be extracted from the stream and delivered to the handler. * * All temporary allocation is performed in @a pool. */ svn_error_t * svn_txdelta_send_txstream(svn_txdelta_stream_t *txstream, svn_txdelta_window_handler_t handler, void *handler_baton, apr_pool_t *pool); /** Prepare to apply a text delta. @a source is a readable generic stream * yielding the source data, @a target is a writable generic stream to * write target data to, and allocation takes place in a sub-pool of * @a pool. On return, @a *handler is set to a window handler function and * @a *handler_baton is set to the value to pass as the @a baton argument to * @a *handler. * * If @a result_digest is non-NULL, it points to APR_MD5_DIGESTSIZE bytes * of storage, and the final call to @a handler populates it with the * MD5 digest of the resulting fulltext. * * If @a error_info is non-NULL, it is inserted parenthetically into * the error string for any error returned by svn_txdelta_apply() or * @a *handler. (It is normally used to provide path information, * since there's nothing else in the delta application's context to * supply a path for error messages.) * * @note To avoid lifetime issues, @a error_info is copied into * @a pool or a subpool thereof. */ void svn_txdelta_apply(svn_stream_t *source, svn_stream_t *target, unsigned char *result_digest, const char *error_info, apr_pool_t *pool, svn_txdelta_window_handler_t *handler, void **handler_baton); /*** Producing and consuming svndiff-format text deltas. ***/ /** Prepare to produce an svndiff-format diff from text delta windows. * @a output is a writable generic stream to write the svndiff data to. * Allocation takes place in a sub-pool of @a pool. On return, @a *handler * is set to a window handler function and @a *handler_baton is set to * the value to pass as the @a baton argument to @a *handler. The svndiff * version is @a svndiff_version. * * @since New in 1.4. */ void svn_txdelta_to_svndiff2(svn_txdelta_window_handler_t *handler, void **handler_baton, svn_stream_t *output, int svndiff_version, apr_pool_t *pool); /** Similar to svn_txdelta_to_svndiff2, but always using svndiff * version 0. * * @deprecated Provided for backward compatibility with the 1.3 API. */ SVN_DEPRECATED void svn_txdelta_to_svndiff(svn_stream_t *output, apr_pool_t *pool, svn_txdelta_window_handler_t *handler, void **handler_baton); /** Return a writable generic stream which will parse svndiff-format * data into a text delta, invoking @a handler with @a handler_baton * whenever a new window is ready. If @a error_on_early_close is @c * TRUE, attempting to close this stream before it has handled the entire * svndiff data set will result in @c SVN_ERR_SVNDIFF_UNEXPECTED_END, * else this error condition will be ignored. */ svn_stream_t * svn_txdelta_parse_svndiff(svn_txdelta_window_handler_t handler, void *handler_baton, svn_boolean_t error_on_early_close, apr_pool_t *pool); /** * Read and parse one delta window in svndiff format from the * readable stream @a stream and place it in @a *window, allocating * the result in @a pool. The caller must take responsibility for * stripping off the four-byte 'SVN@' header at the beginning of * the svndiff document before reading the first window, and must * provide the version number (the value of the fourth byte) to each * invocation of this routine with the @a svndiff_version argument. * * @since New in 1.1. */ svn_error_t * svn_txdelta_read_svndiff_window(svn_txdelta_window_t **window, svn_stream_t *stream, int svndiff_version, apr_pool_t *pool); /** * Read and skip one delta window in svndiff format from the * file @a file. @a pool is used for temporary allocations. The * caller must take responsibility for stripping off the four-byte * 'SVN@' header at the beginning of the svndiff document before * reading or skipping the first window, and must provide the version * number (the value of the fourth byte) to each invocation of this * routine with the @a svndiff_version argument. * * @since New in 1.1. */ svn_error_t * svn_txdelta_skip_svndiff_window(apr_file_t *file, int svndiff_version, apr_pool_t *pool); /** @} */ /** Traversing tree deltas. * * In Subversion, we've got various producers and consumers of tree * deltas. * * In processing a `commit' command: * - The client examines its working copy data, and produces a tree * delta describing the changes to be committed. * - The client networking library consumes that delta, and sends them * across the wire as an equivalent series of network requests (for * example, to svnserve as an ra_svn protocol stream, or to an * Apache httpd server as WebDAV commands) * - The server receives those requests and produces a tree delta --- * hopefully equivalent to the one the client produced above. * - The Subversion server module consumes that delta and commits an * appropriate transaction to the filesystem. * * In processing an `update' command, the process is reversed: * - The Subversion server module talks to the filesystem and produces * a tree delta describing the changes necessary to bring the * client's working copy up to date. * - The server consumes this delta, and assembles a reply * representing the appropriate changes. * - The client networking library receives that reply, and produces a * tree delta --- hopefully equivalent to the one the Subversion * server produced above. * - The working copy library consumes that delta, and makes the * appropriate changes to the working copy. * * The simplest approach would be to represent tree deltas using the * obvious data structure. To do an update, the server would * construct a delta structure, and the working copy library would * apply that structure to the working copy; the network layer's job * would simply be to get the structure across the net intact. * * However, we expect that these deltas will occasionally be too large * to fit in a typical workstation's swap area. For example, in * checking out a 200Mb source tree, the entire source tree is * represented by a single tree delta. So it's important to handle * deltas that are too large to fit in swap all at once. * * So instead of representing the tree delta explicitly, we define a * standard way for a consumer to process each piece of a tree delta * as soon as the producer creates it. The @c svn_delta_editor_t * structure is a set of callback functions to be defined by a delta * consumer, and invoked by a delta producer. Each invocation of a * callback function describes a piece of the delta --- a file's * contents changing, something being renamed, etc. * * @defgroup svn_delta_tree_deltas Tree deltas * @{ */ /** A structure full of callback functions the delta source will invoke * as it produces the delta. * * Note: Don't try to allocate one of these yourself. Instead, always * use svn_delta_default_editor() or some other constructor, to ensure * that unused slots are filled in with no-op functions. * *

Function Usage

* * Here's how to use these functions to express a tree delta. * * The delta consumer implements the callback functions described in * this structure, and the delta producer invokes them. So the * caller (producer) is pushing tree delta data at the callee * (consumer). * * At the start of traversal, the consumer provides @a edit_baton, a * baton global to the entire delta edit. If there is a target * revision that needs to be set for this operation, the producer * should call the @c set_target_revision function at this point. * * Next, if there are any tree deltas to express, the producer should * pass the @a edit_baton to the @c open_root function, to get a baton * representing root of the tree being edited. * * Most of the callbacks work in the obvious way: * * @c delete_entry * @c add_file * @c add_directory * @c open_file * @c open_directory * * Each of these takes a directory baton, indicating the directory * in which the change takes place, and a @a path argument, giving the * path (relative to the root of the edit) of the file, * subdirectory, or directory entry to change. Editors will usually * want to join this relative path with some base stored in the edit * baton (e.g. a URL, a location in the OS filesystem). * * Since every call requires a parent directory baton, including * @c add_directory and @c open_directory, where do we ever get our * initial directory baton, to get things started? The @c open_root * function returns a baton for the top directory of the change. In * general, the producer needs to invoke the editor's @c open_root * function before it can get anything of interest done. * * While @c open_root provides a directory baton for the root of * the tree being changed, the @c add_directory and @c open_directory * callbacks provide batons for other directories. Like the * callbacks above, they take a @a parent_baton and a relative path * @a path, and then return a new baton for the subdirectory being * created / modified --- @a child_baton. The producer can then use * @a child_baton to make further changes in that subdirectory. * * So, if we already have subdirectories named `foo' and `foo/bar', * then the producer can create a new file named `foo/bar/baz.c' by * calling: * * - @c open_root () --- yielding a baton @a root for the top directory * * - @c open_directory (@a root, "foo") --- yielding a baton @a f for `foo' * * - @c open_directory (@a f, "foo/bar") --- yielding a baton @a b for * `foo/bar' * * - @c add_file (@a b, "foo/bar/baz.c") * * When the producer is finished making changes to a directory, it * should call @c close_directory. This lets the consumer do any * necessary cleanup, and free the baton's storage. * * The @c add_file and @c open_file callbacks each return a baton * for the file being created or changed. This baton can then be * passed to @c apply_textdelta to change the file's contents, or * @c change_file_prop to change the file's properties. When the * producer is finished making changes to a file, it should call * @c close_file, to let the consumer clean up and free the baton. * * The @c add_file and @c add_directory functions each take arguments * @a copyfrom_path and @a copyfrom_revision. If @a copyfrom_path is * non-@c NULL, then @a copyfrom_path and @a copyfrom_revision indicate where * the file or directory should be copied from (to create the file * or directory being added). In that case, @a copyfrom_path must be * either a path relative to the root of the edit, or a URI from the * repository being edited. If @a copyfrom_path is @c NULL, then @a * copyfrom_revision must be @c SVN_INVALID_REVNUM; it is invalid to * pass a mix of valid and invalid copyfrom arguments. * * *

Function Call Ordering

* * There are six restrictions on the order in which the producer * may use the batons: * * 1. The producer may call @c open_directory, @c add_directory, * @c open_file, @c add_file at most once on any given directory * entry. @c delete_entry may be called at most once on any given * directory entry and may later be followed by @c add_directory or * @c add_file on the same directory entry. @c delete_entry may * not be called on any directory entry after @c open_directory, * @c add_directory, @c open_file or @c add_file has been called on * that directory entry. * * 2. The producer may not close a directory baton until it has * closed all batons for its subdirectories. * * 3. When a producer calls @c open_directory or @c add_directory, * it must specify the most recently opened of the currently open * directory batons. Put another way, the producer cannot have * two sibling directory batons open at the same time. * * 4. A producer must call @c change_dir_prop on a directory either * before opening any of the directory's subdirs or after closing * them, but not in the middle. * * 5. When the producer calls @c open_file or @c add_file, either: * * (a) The producer must follow with any changes to the file * (@c change_file_prop and/or @c apply_textdelta, as applicable), * followed by a @c close_file call, before issuing any other file * or directory calls, or * * (b) The producer must follow with a @c change_file_prop call if * it is applicable, before issuing any other file or directory * calls; later, after all directory batons including the root * have been closed, the producer must issue @c apply_textdelta * and @c close_file calls. * * 6. When the producer calls @c apply_textdelta, it must make all of * the window handler calls (including the @c NULL window at the * end) before issuing any other @c svn_delta_editor_t calls. * * So, the producer needs to use directory and file batons as if it * is doing a single depth-first traversal of the tree, with the * exception that the producer may keep file batons open in order to * make @c apply_textdelta calls at the end. * * *

Pool Usage

* * Many editor functions are invoked multiple times, in a sequence * determined by the editor "driver". The driver is responsible for * creating a pool for use on each iteration of the editor function, * and clearing that pool between each iteration. The driver passes * the appropriate pool on each function invocation. * * Based on the requirement of calling the editor functions in a * depth-first style, it is usually customary for the driver to similarly * nest the pools. However, this is only a safety feature to ensure * that pools associated with deeper items are always cleared when the * top-level items are also cleared. The interface does not assume, nor * require, any particular organization of the pools passed to these * functions. In fact, if "postfix deltas" are used for files, the file * pools definitely need to live outside the scope of their parent * directories' pools. * * Note that close_directory can be called *before* a file in that * directory has been closed. That is, the directory's baton is * closed before the file's baton. The implication is that * @c apply_textdelta and @c close_file should not refer to a parent * directory baton UNLESS the editor has taken precautions to * allocate it in a pool of the appropriate lifetime (the @a dir_pool * passed to @c open_directory and @c add_directory definitely does not * have the proper lifetime). In general, it is recommended to simply * avoid keeping a parent directory baton in a file baton. * * *

Errors

* * At least one implementation of the editor interface is * asynchronous; an error from one operation may be detected some * number of operations later. As a result, an editor driver must not * assume that an error from an editing function resulted from the * particular operation being detected. Moreover, once an editing * function returns an error, the edit is dead; the only further * operation which may be called on the editor is abort_edit. */ typedef struct svn_delta_editor_t { /** Set the target revision for this edit to @a target_revision. This * call, if used, should precede all other editor calls. * * @note This is typically used only for server->client update-type * operations. It doesn't really make much sense for commit-type * operations, because the revision of a commit isn't known until * the commit is finalized. */ svn_error_t *(*set_target_revision)(void *edit_baton, svn_revnum_t target_revision, apr_pool_t *pool); /** Set @a *root_baton to a baton for the top directory of the change. * (This is the top of the subtree being changed, not necessarily * the root of the filesystem.) As with any other directory baton, the * producer should call @c close_directory on @a root_baton when done. * And as with other @c open_* calls, the @a base_revision here is the * current revision of the directory (before getting bumped up to the * new target revision set with @c set_target_revision). * * Allocations for the returned @a root_baton should be performed in * @a dir_pool. It is also typical to (possibly) save this pool for later * usage by @c close_directory. */ svn_error_t *(*open_root)(void *edit_baton, svn_revnum_t base_revision, apr_pool_t *dir_pool, void **root_baton); /** Remove the directory entry named @a path, a child of the directory * represented by @a parent_baton. If @a revision is a valid * revision number, it is used as a sanity check to ensure that you * are really removing the revision of @a path that you think you are. * * All allocations should be performed in @a pool. * * @note The @a revision parameter is typically used only for * client->server commit-type operations, allowing the server to * verify that it is deleting what the client thinks it should be * deleting. It only really makes sense in the opposite direction * (during server->client update-type operations) when the trees * whose delta is being described are ancestrally related (that is, * one tree is an ancestor of the other). */ svn_error_t *(*delete_entry)(const char *path, svn_revnum_t revision, void *parent_baton, apr_pool_t *pool); /** We are going to add a new subdirectory named @a path. We will use * the value this callback stores in @a *child_baton as the * @a parent_baton for further changes in the new subdirectory. * * If @a copyfrom_path is non-@c NULL, this add has history (i.e., is a * copy), and the origin of the copy may be recorded as * @a copyfrom_path under @a copyfrom_revision. * * Allocations for the returned @a child_baton should be performed in * @a dir_pool. It is also typical to (possibly) save this pool for later * usage by @c close_directory. */ svn_error_t *(*add_directory)(const char *path, void *parent_baton, const char *copyfrom_path, svn_revnum_t copyfrom_revision, apr_pool_t *dir_pool, void **child_baton); /** We are going to make changes in a subdirectory (of the directory * identified by @a parent_baton). The subdirectory is specified by * @a path. The callback must store a value in @a *child_baton that * should be used as the @a parent_baton for subsequent changes in this * subdirectory. If a valid revnum, @a base_revision is the current * revision of the subdirectory. * * Allocations for the returned @a child_baton should be performed in * @a dir_pool. It is also typical to (possibly) save this pool for later * usage by @c close_directory. */ svn_error_t *(*open_directory)(const char *path, void *parent_baton, svn_revnum_t base_revision, apr_pool_t *dir_pool, void **child_baton); /** Change the value of a directory's property. * - @a dir_baton specifies the directory whose property should change. * - @a name is the name of the property to change. * - @a value is the new (final) value of the property, or @c NULL if the * property should be removed altogether. * * The callback is guaranteed to be called exactly once for each property * whose value differs between the start and the end of the edit. * * All allocations should be performed in @a pool. */ svn_error_t *(*change_dir_prop)(void *dir_baton, const char *name, const svn_string_t *value, apr_pool_t *pool); /** We are done processing a subdirectory, whose baton is @a dir_baton * (set by @c add_directory or @c open_directory). We won't be using * the baton any more, so whatever resources it refers to may now be * freed. */ svn_error_t *(*close_directory)(void *dir_baton, apr_pool_t *pool); /** In the directory represented by @a parent_baton, indicate that * @a path is present as a subdirectory in the edit source, but * cannot be conveyed to the edit consumer (perhaps because of * authorization restrictions). */ svn_error_t *(*absent_directory)(const char *path, void *parent_baton, apr_pool_t *pool); /** We are going to add a new file named @a path. The callback can * store a baton for this new file in @a **file_baton; whatever value * it stores there should be passed through to @c apply_textdelta. * * If @a copyfrom_path is non-@c NULL, this add has history (i.e., is a * copy), and the origin of the copy may be recorded as * @a copyfrom_path under @a copyfrom_revision. * * Allocations for the returned @a file_baton should be performed in * @a file_pool. It is also typical to save this pool for later usage * by @c apply_textdelta and possibly @c close_file. */ svn_error_t *(*add_file)(const char *path, void *parent_baton, const char *copyfrom_path, svn_revnum_t copyfrom_revision, apr_pool_t *file_pool, void **file_baton); /** We are going to make change to a file named @a path, which resides * in the directory identified by @a parent_baton. * * The callback can store a baton for this new file in @a **file_baton; * whatever value it stores there should be passed through to * @c apply_textdelta. If a valid revnum, @a base_revision is the * current revision of the file. * * Allocations for the returned @a file_baton should be performed in * @a file_pool. It is also typical to save this pool for later usage * by @c apply_textdelta and possibly @c close_file. */ svn_error_t *(*open_file)(const char *path, void *parent_baton, svn_revnum_t base_revision, apr_pool_t *file_pool, void **file_baton); /** Apply a text delta, yielding the new revision of a file. * * @a file_baton indicates the file we're creating or updating, and the * ancestor file on which it is based; it is the baton set by some * prior @c add_file or @c open_file callback. * * The callback should set @a *handler to a text delta window * handler; we will then call @a *handler on successive text * delta windows as we receive them. The callback should set * @a *handler_baton to the value we should pass as the @a baton * argument to @a *handler. * * @a base_checksum is the hex MD5 digest for the base text against * which the delta is being applied; it is ignored if NULL, and may * be ignored even if not NULL. If it is not ignored, it must match * the checksum of the base text against which svndiff data is being * applied; if it does not, @c apply_textdelta or the @a *handler call * which detects the mismatch will return the error * SVN_ERR_CHECKSUM_MISMATCH (if there is no base text, there may * still be an error if @a base_checksum is neither NULL nor the hex * MD5 checksum of the empty string). */ svn_error_t *(*apply_textdelta)(void *file_baton, const char *base_checksum, apr_pool_t *pool, svn_txdelta_window_handler_t *handler, void **handler_baton); /** Change the value of a file's property. * - @a file_baton specifies the file whose property should change. * - @a name is the name of the property to change. * - @a value is the new (final) value of the property, or @c NULL if the * property should be removed altogether. * * The callback is guaranteed to be called exactly once for each property * whose value differs between the start and the end of the edit. * * All allocations should be performed in @a pool. */ svn_error_t *(*change_file_prop)(void *file_baton, const char *name, const svn_string_t *value, apr_pool_t *pool); /** We are done processing a file, whose baton is @a file_baton (set by * @c add_file or @c open_file). We won't be using the baton any * more, so whatever resources it refers to may now be freed. * * @a text_checksum is the hex MD5 digest for the fulltext that * resulted from a delta application, see @c apply_textdelta. The * checksum is ignored if NULL. If not null, it is compared to the * checksum of the new fulltext, and the error * SVN_ERR_CHECKSUM_MISMATCH is returned if they do not match. If * there is no new fulltext, @a text_checksum is ignored. */ svn_error_t *(*close_file)(void *file_baton, const char *text_checksum, apr_pool_t *pool); /** In the directory represented by @a parent_baton, indicate that * @a path is present as a file in the edit source, but cannot be * conveyed to the edit consumer (perhaps because of authorization * restrictions). */ svn_error_t *(*absent_file)(const char *path, void *parent_baton, apr_pool_t *pool); /** All delta processing is done. Call this, with the @a edit_baton for * the entire edit. */ svn_error_t *(*close_edit)(void *edit_baton, apr_pool_t *pool); /** The editor-driver has decided to bail out. Allow the editor to * gracefully clean up things if it needs to. */ svn_error_t *(*abort_edit)(void *edit_baton, apr_pool_t *pool); /* Be sure to update svn_delta_get_cancellation_editor() and * svn_delta_default_editor() if you add a new callback here. */ } svn_delta_editor_t; /** Return a default delta editor template, allocated in @a pool. * * The editor functions in the template do only the most basic * baton-swapping: each editor function that produces a baton does so * by copying its incoming baton into the outgoing baton reference. * * This editor is not intended to be useful by itself, but is meant to * be the basis for a useful editor. After getting a default editor, * you substitute in your own implementations for the editor functions * you care about. The ones you don't care about, you don't have to * implement -- you can rely on the template's implementation to * safely do nothing of consequence. */ svn_delta_editor_t * svn_delta_default_editor(apr_pool_t *pool); /** A text-delta window handler which does nothing. * * Editors can return this handler from @c apply_textdelta if they don't * care about text delta windows. */ svn_error_t * svn_delta_noop_window_handler(svn_txdelta_window_t *window, void *baton); /** Set @a *editor and @a *edit_baton to a cancellation editor that * wraps @a wrapped_editor and @a wrapped_baton. * * The @a editor will call @a cancel_func with @a cancel_baton when each of * its functions is called, continuing on to call the corresponding wrapped * function if @a cancel_func returns @c SVN_NO_ERROR. * * If @a cancel_func is @c NULL, set @a *editor to @a wrapped_editor and * @a *edit_baton to @a wrapped_baton. */ svn_error_t * svn_delta_get_cancellation_editor(svn_cancel_func_t cancel_func, void *cancel_baton, const svn_delta_editor_t *wrapped_editor, void *wrapped_baton, const svn_delta_editor_t **editor, void **edit_baton, apr_pool_t *pool); /** Set @a *editor and @a *edit_baton to an depth-based filtering * editor that wraps @a wrapped_editor and @a wrapped_baton. * * The @a editor will track the depth of this drive against the @a * requested_depth, taking into account whether not the edit drive is * making use of a target (via @a has_target), and forward editor * calls which operate "within" the request depth range through to @a * wrapped_editor. * * @a requested_depth must be one of the following depth values: * @c svn_depth_infinity, @c svn_depth_empty, @c svn_depth_files, * @c svn_depth_immediates, or @c svn_depth_unknown. * * If filtering is deemed unncessary (or if @a requested_depth is @c * svn_depth_unknown), @a *editor and @a *edit_baton will be set to @a * wrapped_editor and @a wrapped_baton, respectively; otherwise, * they'll be set to new objects allocated from @a pool. * * @note Because the svn_delta_editor_t interface's @c delete_entry() * function doesn't carry node kind information, a depth-based * filtering editor being asked to filter for @c svn_depth_files but * receiving a @c delete_entry() call on an immediate child of the * editor's target is unable to know if that deletion should be * allowed or filtered out -- a delete of a top-level file is okay in * this case, a delete of a top-level subdirectory is not. As such, * this filtering editor takes a conservative approach, and ignores * top-level deletion requests when filtering for @c svn_depth_files. * Fortunately, most non-depth-aware (pre-1.5) Subversion editor * drivers can be told to drive non-recursively (where non-recursive * means essentially @c svn_depth_files), which means they won't * transmit out-of-scope editor commands anyway. * * @since New in 1.5. */ svn_error_t * svn_delta_depth_filter_editor(const svn_delta_editor_t **editor, void **edit_baton, const svn_delta_editor_t *wrapped_editor, void *wrapped_edit_baton, svn_depth_t requested_depth, svn_boolean_t has_target, apr_pool_t *pool); /** @} */ /** Path-based editor drives. * * @defgroup svn_delta_path_delta_drivers Path-based delta drivers * @{ */ /** Callback function type for svn_delta_path_driver(). * * The handler of this callback is given the callback baton @a * callback_baton, @a path, and the @a parent_baton which represents * path's parent directory as created by the editor passed to * svn_delta_path_driver(). * * If @a path represents a directory, the handler must return a @a * *dir_baton for @a path, generated from the same editor (so that the * driver can later close that directory). * * If, however, @a path represents a file, the handler should NOT * return any file batons. It can close any opened or added files * immediately, or delay that close until the end of the edit when * svn_delta_path_driver() returns. * * Finally, if @a parent_baton is @c NULL, then the root of the edit * is also one of the paths passed to svn_delta_path_driver(). The * handler of this callback must call the editor's open_root() * function and return the top-level root dir baton in @a *dir_baton. */ typedef svn_error_t *(*svn_delta_path_driver_cb_func_t) (void **dir_baton, void *parent_baton, void *callback_baton, const char *path, apr_pool_t *pool); /** Drive @a editor (with its @a edit_baton) in such a way that * each path in @a paths is traversed in a depth-first fashion. As * each path is hit as part of the editor drive, use @a * callback_func and @a callback_baton to allow the caller to handle * the portion of the editor drive related to that path. * * Use @a revision as the revision number passed to intermediate * directory openings. * * Use @a pool for all necessary allocations. */ svn_error_t * svn_delta_path_driver(const svn_delta_editor_t *editor, void *edit_baton, svn_revnum_t revision, apr_array_header_t *paths, svn_delta_path_driver_cb_func_t callback_func, void *callback_baton, apr_pool_t *pool); /** @} */ /*** File revision iterator types ***/ /** * The callback invoked by file rev loopers, such as * svn_ra_plugin_t.get_file_revs2() and svn_repos_get_file_revs2(). * * @a baton is provided by the caller, @a path is the pathname of the file * in revision @a rev and @a rev_props are the revision properties. * * If @a delta_handler and @a delta_baton are non-NULL, they may be set to a * handler/baton which will be called with the delta between the previous * revision and this one after the return of this callback. They may be * left as NULL/NULL. * * @a result_of_merge will be @c TRUE if the revision being returned was * included as the result of a merge. * * @a prop_diffs is an array of svn_prop_t elements indicating the property * delta for this and the previous revision. * * @a pool may be used for temporary allocations, but you can't rely * on objects allocated to live outside of this particular call and * the immediately following calls to @a *delta_handler if any. (Pass * in a pool via @a baton if need be.) * * @since New in 1.5. */ typedef svn_error_t *(*svn_file_rev_handler_t) (void *baton, const char *path, svn_revnum_t rev, apr_hash_t *rev_props, svn_boolean_t result_of_merge, svn_txdelta_window_handler_t *delta_handler, void **delta_baton, apr_array_header_t *prop_diffs, apr_pool_t *pool); /** * The old file rev handler interface. * * @note @c svn_file_rev_handler_old_t is a placeholder type for both * @c svn_repos_file_rev_handler_t and @c svn_ra_file_rev_handler_t. It is * reproduced here for dependency reasons. * * @deprecated This type is provided for the svn_compat_wrap_file_rev_handler() * compatibilty wrapper, and should not be used for new development. * @since New in 1.5. */ typedef svn_error_t *(*svn_file_rev_handler_old_t) (void *baton, const char *path, svn_revnum_t rev, apr_hash_t *rev_props, svn_txdelta_window_handler_t *delta_handler, void **delta_baton, apr_array_header_t *prop_diffs, apr_pool_t *pool); /** Return, in @a *handler2 and @a *handler2_baton a function/baton that * will call @a handler/@a handler_baton, allocating the @a *handler2_baton * in @a pool. * * @note This is used by compatibility wrappers, which exist in more than * Subversion core library. * * @note @c svn_file_rev_handler_old_t is a placeholder type for both * @c svn_repos_file_rev_handler_t and @c svn_ra_file_rev_handler_t. It is * reproduced here for dependency reasons. * * @since New in 1.5. */ void svn_compat_wrap_file_rev_handler(svn_file_rev_handler_t *handler2, void **handler2_baton, svn_file_rev_handler_old_t handler, void *handler_baton, apr_pool_t *pool); /** @} end group: delta_support */ #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* SVN_DELTA_H */ 0707010002c65b000081a40000000000000000000000014cb50d8f000009720000010000010036ffffffffffffffff0000003300000000root/usr/local/include/subversion-1/svn_quoprint.h/** * @copyright * ==================================================================== * Copyright (c) 2000-2004, 2008 CollabNet. All rights reserved. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://subversion.tigris.org/license-1.html. * If newer versions of this license are posted there, you may use a * newer version instead, at your option. * * This software consists of voluntary contributions made by many * individuals. For exact contribution history, see the revision * history and logs, available at http://subversion.tigris.org/. * ==================================================================== * @endcopyright * * @file svn_quoprint.h * @brief quoted-printable encoding and decoding functions. */ #ifndef SVN_QUOPRINT_H #define SVN_QUOPRINT_H #include #include "svn_string.h" /* for svn_strinbuf_t */ #include "svn_io.h" /* for svn_stream_t */ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** Return a writable generic stream which will encode binary data in * quoted-printable format and write the encoded data to @a output. Be * sure to close the stream when done writing in order to squeeze out * the last bit of encoded data. */ svn_stream_t * svn_quoprint_encode(svn_stream_t *output, apr_pool_t *pool); /** Return a writable generic stream which will decode binary data in * quoted-printable format and write the decoded data to @a output. Be * sure to close the stream when done writing in order to squeeze out * the last bit of encoded data. */ svn_stream_t * svn_quoprint_decode(svn_stream_t *output, apr_pool_t *pool); /** Simpler interface for encoding quoted-printable data assuming we have all * of it present at once. The returned string will be allocated from @a pool. */ svn_stringbuf_t * svn_quoprint_encode_string(const svn_stringbuf_t *str, apr_pool_t *pool); /** Simpler interface for decoding quoted-printable data assuming we have all * of it present at once. The returned string will be allocated from @a pool. */ svn_stringbuf_t * svn_quoprint_decode_string(const svn_stringbuf_t *str, apr_pool_t *pool); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* SVN_QUOPRINT_H */ 0707010002c660000081a40000000000000000000000014cb50d8e000030e70000010000010036ffffffffffffffff0000003100000000root/usr/local/include/subversion-1/svn_string.h/** * @copyright * ==================================================================== * Copyright (c) 2000-2006 CollabNet. All rights reserved. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://subversion.tigris.org/license-1.html. * If newer versions of this license are posted there, you may use a * newer version instead, at your option. * * This software consists of voluntary contributions made by many * individuals. For exact contribution history, see the revision * history and logs, available at http://subversion.tigris.org/. * ==================================================================== * @endcopyright * * @file svn_string.h * @brief Counted-length strings for Subversion, plus some C string goodies. * * There are two string datatypes: @c svn_string_t and @c svn_stringbuf_t. * The former is a simple pointer/length pair useful for passing around * strings (or arbitrary bytes) with a counted length. @c svn_stringbuf_t is * buffered to enable efficient appending of strings without an allocation * and copy for each append operation. * * @c svn_string_t contains a const char * for its data, so it is * most appropriate for constant data and for functions which expect constant, * counted data. Functions should generally use const @c svn_string_t * * as their parameter to indicate they are expecting a constant, * counted string. * * @c svn_stringbuf_t uses a plain char * for its data, so it is * most appropriate for modifiable data. * *

Invariants

* * 1. Null termination: * * Both structures maintain a significant invariant: * * s->data[s->len] == '\\0' * * The functions defined within this header file will maintain * the invariant (which does imply that memory is * allocated/defined as @c len+1 bytes). If code outside of the * @c svn_string.h functions manually builds these structures, * then they must enforce this invariant. * * Note that an @c svn_string(buf)_t may contain binary data, * which means that strlen(s->data) does not have to equal @c * s->len. The NULL terminator is provided to make it easier to * pass @c s->data to C string interfaces. * * * 2. Non-NULL input: * * All the functions assume their input data is non-NULL, * unless otherwise documented, and may seg fault if passed * NULL. The input data may *contain* null bytes, of course, just * the data pointer itself must not be NULL. * *

Memory allocation

* * All the functions make a deep copy of all input data, and never store * a pointer to the original input data. */ #ifndef SVN_STRING_H #define SVN_STRING_H #include /* for apr_size_t */ #include /* for apr_pool_t */ #include /* for apr_array_header_t */ #include "svn_types.h" /* for svn_boolean_t, svn_error_t */ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * @defgroup svn_string String handling * @{ */ /** A simple counted string. */ typedef struct svn_string_t { const char *data; /**< pointer to the bytestring */ apr_size_t len; /**< length of bytestring */ } svn_string_t; /** A buffered string, capable of appending without an allocation and copy * for each append. */ typedef struct svn_stringbuf_t { /** a pool from which this string was originally allocated, and is not * necessarily specific to this string. This is used only for allocating * more memory from when the string needs to grow. */ apr_pool_t *pool; /** pointer to the bytestring */ char *data; /** length of bytestring */ apr_size_t len; /** total size of buffer allocated */ apr_size_t blocksize; } svn_stringbuf_t; /** svn_string_t functions. * * @defgroup svn_string_svn_string_t svn_string_t functions * @{ */ /** Create a new bytestring containing a C string (NULL-terminated). */ svn_string_t * svn_string_create(const char *cstring, apr_pool_t *pool); /** Create a new bytestring containing a generic string of bytes * (NOT NULL-terminated) */ svn_string_t * svn_string_ncreate(const char *bytes, apr_size_t size, apr_pool_t *pool); /** Create a new string with the contents of the given stringbuf */ svn_string_t * svn_string_create_from_buf(const svn_stringbuf_t *strbuf, apr_pool_t *pool); /** Create a new bytestring by formatting @a cstring (NULL-terminated) * from varargs, which are as appropriate for apr_psprintf(). */ svn_string_t * svn_string_createf(apr_pool_t *pool, const char *fmt, ...) __attribute__((format(printf, 2, 3))); /** Create a new bytestring by formatting @a cstring (NULL-terminated) * from a @c va_list (see svn_stringbuf_createf()). */ svn_string_t * svn_string_createv(apr_pool_t *pool, const char *fmt, va_list ap) __attribute__((format(printf, 2, 0))); /** Return TRUE if a bytestring is empty (has length zero). */ svn_boolean_t svn_string_isempty(const svn_string_t *str); /** Return a duplicate of @a original_string. */ svn_string_t * svn_string_dup(const svn_string_t *original_string, apr_pool_t *pool); /** Return @c TRUE iff @a str1 and @a str2 have identical length and data. */ svn_boolean_t svn_string_compare(const svn_string_t *str1, const svn_string_t *str2); /** Return offset of first non-whitespace character in @a str, or return * @a str->len if none. */ apr_size_t svn_string_first_non_whitespace(const svn_string_t *str); /** Return position of last occurrence of @a ch in @a str, or return * @a str->len if no occurrence. */ apr_size_t svn_string_find_char_backward(const svn_string_t *str, char ch); /** @} */ /** svn_stringbuf_t functions. * * @defgroup svn_string_svn_stringbuf_t svn_stringbuf_t functions * @{ */ /** Create a new bytestring containing a C string (NULL-terminated). */ svn_stringbuf_t * svn_stringbuf_create(const char *cstring, apr_pool_t *pool); /** Create a new bytestring containing a generic string of bytes * (NON-NULL-terminated) */ svn_stringbuf_t * svn_stringbuf_ncreate(const char *bytes, apr_size_t size, apr_pool_t *pool); /** Create a new empty bytestring with at least @a minimum_size bytes of * space available in the memory block. * * The allocated string buffer will be one byte larger then @a size to account * for a final '\0'. * * @since New in 1.6. */ svn_stringbuf_t * svn_stringbuf_create_ensure(apr_size_t minimum_size, apr_pool_t *pool); /** Create a new stringbuf with the contents of the given string */ svn_stringbuf_t * svn_stringbuf_create_from_string(const svn_string_t *str, apr_pool_t *pool); /** Create a new bytestring by formatting @a cstring (NULL-terminated) * from varargs, which are as appropriate for apr_psprintf(). */ svn_stringbuf_t * svn_stringbuf_createf(apr_pool_t *pool, const char *fmt, ...) __attribute__((format(printf, 2, 3))); /** Create a new bytestring by formatting @a cstring (NULL-terminated) * from a @c va_list (see svn_stringbuf_createf()). */ svn_stringbuf_t * svn_stringbuf_createv(apr_pool_t *pool, const char *fmt, va_list ap) __attribute__((format(printf, 2, 0))); /** Make sure that the string @a str has at least @a minimum_size bytes of * space available in the memory block. * * (@a minimum_size should include space for the terminating NULL character.) */ void svn_stringbuf_ensure(svn_stringbuf_t *str, apr_size_t minimum_size); /** Set a bytestring @a str to @a value */ void svn_stringbuf_set(svn_stringbuf_t *str, const char *value); /** Set a bytestring @a str to empty (0 length). */ void svn_stringbuf_setempty(svn_stringbuf_t *str); /** Return @c TRUE if a bytestring is empty (has length zero). */ svn_boolean_t svn_stringbuf_isempty(const svn_stringbuf_t *str); /** Chop @a nbytes bytes off end of @a str, but not more than @a str->len. */ void svn_stringbuf_chop(svn_stringbuf_t *str, apr_size_t nbytes); /** Fill bytestring @a str with character @a c. */ void svn_stringbuf_fillchar(svn_stringbuf_t *str, unsigned char c); /** Append an array of bytes onto @a targetstr. * * reallocs if necessary. @a targetstr is affected, nothing else is. */ void svn_stringbuf_appendbytes(svn_stringbuf_t *targetstr, const char *bytes, apr_size_t count); /** Append an @c svn_stringbuf_t onto @a targetstr. * * reallocs if necessary. @a targetstr is affected, nothing else is. */ void svn_stringbuf_appendstr(svn_stringbuf_t *targetstr, const svn_stringbuf_t *appendstr); /** Append a C string onto @a targetstr. * * reallocs if necessary. @a targetstr is affected, nothing else is. */ void svn_stringbuf_appendcstr(svn_stringbuf_t *targetstr, const char *cstr); /** Return a duplicate of @a original_string. */ svn_stringbuf_t * svn_stringbuf_dup(const svn_stringbuf_t *original_string, apr_pool_t *pool); /** Return @c TRUE iff @a str1 and @a str2 have identical length and data. */ svn_boolean_t svn_stringbuf_compare(const svn_stringbuf_t *str1, const svn_stringbuf_t *str2); /** Return offset of first non-whitespace character in @a str, or return * @a str->len if none. */ apr_size_t svn_stringbuf_first_non_whitespace(const svn_stringbuf_t *str); /** Strip whitespace from both sides of @a str (modified in place). */ void svn_stringbuf_strip_whitespace(svn_stringbuf_t *str); /** Return position of last occurrence of @a ch in @a str, or return * @a str->len if no occurrence. */ apr_size_t svn_stringbuf_find_char_backward(const svn_stringbuf_t *str, char ch); /** Return @c TRUE iff @a str1 and @a str2 have identical length and data. */ svn_boolean_t svn_string_compare_stringbuf(const svn_string_t *str1, const svn_stringbuf_t *str2); /** @} */ /** C strings. * * @defgroup svn_string_cstrings c string functions * @{ */ /** Divide @a input into substrings along @a sep_chars boundaries, return an * array of copies of those substrings, allocating both the array and * the copies in @a pool. * * None of the elements added to the array contain any of the * characters in @a sep_chars, and none of the new elements are empty * (thus, it is possible that the returned array will have length * zero). * * If @a chop_whitespace is TRUE, then remove leading and trailing * whitespace from the returned strings. */ apr_array_header_t * svn_cstring_split(const char *input, const char *sep_chars, svn_boolean_t chop_whitespace, apr_pool_t *pool); /** Like svn_cstring_split(), but append to existing @a array instead of * creating a new one. Allocate the copied substrings in @a pool * (i.e., caller decides whether or not to pass @a array->pool as @a pool). */ void svn_cstring_split_append(apr_array_header_t *array, const char *input, const char *sep_chars, svn_boolean_t chop_whitespace, apr_pool_t *pool); /** Return @c TRUE iff @a str matches any of the elements of @a list, a list * of zero or more glob patterns. */ svn_boolean_t svn_cstring_match_glob_list(const char *str, apr_array_header_t *list); /** * Return the number of line breaks in @a msg, allowing any kind of newline * termination (CR, LF, CRLF, or LFCR), even inconsistent. * * @since New in 1.2. */ int svn_cstring_count_newlines(const char *msg); /** * Return a cstring which is the concatenation of @a strings (an array * of char *) each followed by @a separator (that is, @a separator * will also end the resulting string). Allocate the result in @a pool. * If @a strings is empty, then return the empty string. * * @since New in 1.2. */ char * svn_cstring_join(const apr_array_header_t *strings, const char *separator, apr_pool_t *pool); /** * Compare two strings @a atr1 and @a atr2, treating case-equivalent * unaccented Latin (ASCII subset) letters as equal. * * Returns in integer greater than, equal to, or less than 0, * according to whether @a str1 is considered greater than, equal to, * or less than @a str2. * * @since New in 1.5. */ int svn_cstring_casecmp(const char *str1, const char *str2); /** @} */ /** @} */ #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* SVN_STRING_H */ 0707010002c655000081a40000000000000000000000014cb50d8e000047470000010000010036ffffffffffffffff0000003400000000root/usr/local/include/subversion-1/svn_mergeinfo.h/** * @copyright * ==================================================================== * Copyright (c) 2006-2008 CollabNet. All rights reserved. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://subversion.tigris.org/license-1.html. * If newer versions of this license are posted there, you may use a * newer version instead, at your option. * * This software consists of voluntary contributions made by many * individuals. For exact contribution history, see the revision * history and logs, available at http://subversion.tigris.org/. * ==================================================================== * @endcopyright * * @file svn_mergeinfo.h * @brief mergeinfo handling and processing */ #ifndef SVN_MERGEINFO_H #define SVN_MERGEINFO_H #include #include /* for apr_array_header_t */ #include #include "svn_types.h" #include "svn_string.h" /* for svn_string_t */ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** Overview of the @c SVN_PROP_MERGEINFO property. * * Merge history is stored in the @c SVN_PROP_MERGEINFO property of files * and directories. The @c SVN_PROP_MERGEINFO property on a path stores the * complete list of changes merged to that path, either directly or via the * path's parent, grand-parent, etc.. A path may have empty mergeinfo which * means that nothing has been merged to that path or all previous merges * to the path were reversed. Note that a path may have no mergeinfo, this * is not the same as empty mergeinfo. * * Every path in a tree may have @c SVN_PROP_MERGEINFO set, but if the * @c SVN_PROP_MERGEINFO for a path is equivalent to the * @c SVN_PROP_MERGEINFO for its parent, then the @c SVN_PROP_MERGEINFO on * the path will 'elide' (be removed) from the path as a post step to any * merge. If a path's parent does not have any @c SVN_PROP_MERGEINFO set, * the path's mergeinfo can elide to its nearest grand-parent, * great-grand-parent, etc. that has equivalent @c SVN_PROP_MERGEINFO set * on it. * * If a path has no @c SVN_PROP_MERGEINFO of its own, it inherits mergeinfo * from its nearest parent that has @c SVN_PROP_MERGEINFO set. The * exception to this is @c SVN_PROP_MERGEINFO with non-ineritable revision * ranges. These non-inheritable ranges apply only to the path which they * are set on. * * Due to Subversion's allowance for mixed revision working copies, both * elision and inheritance within the working copy presume the path * between a path and its nearest parent with mergeinfo is at the same * working revision. If this is not the case then neither inheritance nor * elision can occur. * * The value of the @c SVN_PROP_MERGEINFO property is either an empty string * (representing empty mergeinfo) or a non-empty string consisting of * a path, a colon, and comma separated revision list, containing one or more * revision or revision ranges. Revision range start and end points are * separated by "-". Revisions and revision ranges may have the optional * @c SVN_MERGEINFO_NONINHERITABLE_STR suffix to signify a non-inheritable * revision/revision range. * * @c SVN_PROP_MERGEINFO Value Grammar: * * Token Definition * ----- ---------- * revisionrange REVISION1 "-" REVISION2 * revisioneelement (revisionrange | REVISION)"*"? * rangelist revisioneelement (COMMA revisioneelement)* * revisionline PATHNAME COLON rangelist * top "" | (revisionline (NEWLINE revisionline))* * * The PATHNAME is the source of a merge and the rangelist the revision(s) * merged to the path @c SVN_PROP_MERGEINFO is set on directly or indirectly * via inheritance. PATHNAME must always exist at the specified rangelist * and thus a single merge may result in multiple revisionlines if the source * was renamed. * * Rangelists must be sorted from lowest to highest revision and cannot * contain overlapping revisionlistelements. REVISION1 must be less than * REVISION2. Consecutive single revisions that can be represented by a * revisionrange are allowed however (e.g. '5,6,7,8,9-12' or '5-12' are * both acceptable). */ /* Suffix for SVN_PROP_MERGEINFO revision ranges indicating a given range is non-inheritable. */ #define SVN_MERGEINFO_NONINHERITABLE_STR "*" /** Terminology for data structures that contain mergeinfo. * * Subversion commonly uses several data structures to represent * mergeinfo in RAM: * * (a) Strings (@c svn_string_t *) containing "unparsed mergeinfo". * * (b) A "rangelist". An array (@c apr_array_header_t *) of non-overlapping * merge ranges (@c svn_merge_range_t *), sorted as said by * @c svn_sort_compare_ranges(). An empty range list is represented by * an empty array. Unless specifically noted otherwise, all APIs require * rangelists that describe only forward ranges, i.e. the range's start * revision is less than its end revision. * * (c) @c svn_mergeinfo_t, called "mergeinfo". A hash mapping merge * source paths (@c const char *, starting with slashes) to * non-empty rangelist arrays. A @c NULL hash is used to represent * no mergeinfo and an empty hash is used to represent empty * mergeinfo. * * (d) @c svn_mergeinfo_catalog_t, called a "mergeinfo catalog". A hash * mapping paths (@c const char *, starting with slashes) to * @c svn_mergeinfo_t. * * Both @c svn_mergeinfo_t and @c svn_mergeinfo_catalog_t are just * typedefs for @c apr_hash_t *; there is no static type-checking, and * you still use standard @c apr_hash_t functions to interact with * them. * * Note that while the keys of mergeinfos are always relative to the * repository root, the keys of a catalog may be relative to something * else, such as an RA session root. */ typedef apr_hash_t *svn_mergeinfo_t; typedef apr_hash_t *svn_mergeinfo_catalog_t; /** Parse the mergeinfo from @a input into @a *mergeinfo. If no * mergeinfo is available, return an empty mergeinfo (never @c NULL). * Perform temporary allocations in @a pool. * * If @a input is not a grammatically correct @c SVN_PROP_MERGEINFO * property, contains overlapping revision ranges of differing * inheritability, or revision ranges with a start revision greater * than or equal to its end revision, or contains paths mapped to empty * revision ranges, then return @c SVN_ERR_MERGEINFO_PARSE_ERROR. * Unordered revision ranges are allowed, but will be sorted when * placed into @a *mergeinfo. Overlapping revision ranges of the same * inheritability are also allowed, but will be combined into a single * range when placed into @a *mergeinfo. * * @a input may contain relative merge source paths, but these are * converted to absolute paths in @a *mergeinfo. * * @since New in 1.5. */ svn_error_t * svn_mergeinfo_parse(svn_mergeinfo_t *mergeinfo, const char *input, apr_pool_t *pool); /** Calculate the delta between two mergeinfos, @a mergefrom and @a mergeto * (which may be @c NULL), and place the result in @a *deleted and @a * *added (neither output argument may be @c NULL). * * @a consider_inheritance determines how the rangelists in the two * hashes are compared for equality. If @a consider_inheritance is FALSE, * then the start and end revisions of the @c svn_merge_range_t's being * compared are the only factors considered when determining equality. * * e.g. '/trunk: 1,3-4*,5' == '/trunk: 1,3-5' * * If @a consider_inheritance is TRUE, then the inheritability of the * @c svn_merge_range_t's is also considered and must be the same for two * otherwise identical ranges to be judged equal. * * e.g. '/trunk: 1,3-4*,5' != '/trunk: 1,3-5' * '/trunk: 1,3-4*,5' == '/trunk: 1,3-4*,5' * '/trunk: 1,3-4,5' == '/trunk: 1,3-4,5' * * @since New in 1.5. */ svn_error_t * svn_mergeinfo_diff(svn_mergeinfo_t *deleted, svn_mergeinfo_t *added, svn_mergeinfo_t mergefrom, svn_mergeinfo_t mergeto, svn_boolean_t consider_inheritance, apr_pool_t *pool); /** Merge one mergeinfo, @a changes, into another mergeinfo @a * mergeinfo. * * When intersecting rangelists for a path are merged, the inheritability of * the resulting svn_merge_range_t depends on the inheritability of the * operands. If two non-inheritable ranges are merged the result is always * non-inheritable, in all other cases the resulting range is inheritable. * * e.g. '/A: 1,3-4' merged with '/A: 1,3,4*,5' --> '/A: 1,3-5' * '/A: 1,3-4*' merged with '/A: 1,3,4*,5' --> '/A: 1,3,4*,5' * * @since New in 1.5. */ svn_error_t * svn_mergeinfo_merge(svn_mergeinfo_t mergeinfo, svn_mergeinfo_t changes, apr_pool_t *pool); /** Removes @a eraser (the subtrahend) from @a whiteboard (the * minuend), and places the resulting difference in @a *mergeinfo. * * @since New in 1.5. */ svn_error_t * svn_mergeinfo_remove(svn_mergeinfo_t *mergeinfo, svn_mergeinfo_t eraser, svn_mergeinfo_t whiteboard, apr_pool_t *pool); /** Calculate the delta between two rangelists consisting of @c * svn_merge_range_t * elements (sorted in ascending order), @a from * and @a to, and place the result in @a *deleted and @a *added * (neither output argument will ever be @c NULL). * * @a consider_inheritance determines how to account for the inheritability * of the two rangelist's ranges when calculating the diff, * as described for svn_mergeinfo_diff(). * * @since New in 1.5. */ svn_error_t * svn_rangelist_diff(apr_array_header_t **deleted, apr_array_header_t **added, apr_array_header_t *from, apr_array_header_t *to, svn_boolean_t consider_inheritance, apr_pool_t *pool); /** Merge two rangelists consisting of @c svn_merge_range_t * * elements, @a *rangelist and @a changes, placing the results in * @a *rangelist. Either rangelist may be empty. * * When intersecting rangelists are merged, the inheritability of * the resulting svn_merge_range_t depends on the inheritability of the * operands: see svn_mergeinfo_merge(). * * Note: @a *rangelist and @a changes must be sorted as said by @c * svn_sort_compare_ranges(). @a *rangelist is guaranteed to remain * in sorted order and be compacted to the minimal number of ranges * needed to represent the merged result. * * @since New in 1.5. */ svn_error_t * svn_rangelist_merge(apr_array_header_t **rangelist, apr_array_header_t *changes, apr_pool_t *pool); /** Removes @a eraser (the subtrahend) from @a whiteboard (the * minuend), and places the resulting difference in @a output. * * Note: @a eraser and @a whiteboard must be sorted as said by @c * svn_sort_compare_ranges(). @a output is guaranteed to be in sorted * order. * * @a consider_inheritance determines how to account for the * @c svn_merge_range_t inheritable field when comparing @a whiteboard's * and @a *eraser's rangelists for equality. @see svn_mergeinfo_diff(). * * @since New in 1.5. */ svn_error_t * svn_rangelist_remove(apr_array_header_t **output, apr_array_header_t *eraser, apr_array_header_t *whiteboard, svn_boolean_t consider_inheritance, apr_pool_t *pool); /** Find the intersection of two mergeinfos, @a mergeinfo1 and @a * mergeinfo2, and place the result in @a *mergeinfo, which is (deeply) * allocated in @a pool. * * @since New in 1.5. */ svn_error_t * svn_mergeinfo_intersect(svn_mergeinfo_t *mergeinfo, svn_mergeinfo_t mergeinfo1, svn_mergeinfo_t mergeinfo2, apr_pool_t *pool); /** Find the intersection of two rangelists consisting of @c * svn_merge_range_t * elements, @a rangelist1 and @a rangelist2, and * place the result in @a *rangelist (which is never @c NULL). * * @a consider_inheritance determines how to account for the inheritability * of the two rangelist's ranges when calculating the intersection, * @see svn_mergeinfo_diff(). If @a consider_inheritance is FALSE then * ranges with different inheritance can intersect, but the the resulting * @a *rangelist is non-inheritable only if the corresponding ranges from * both @a rangelist1 and @a rangelist2 are non-inheritable. * If @a consider_inheritance is TRUE, then ranges with different * inheritance can never intersect. * * Note: @a rangelist1 and @a rangelist2 must be sorted as said by @c * svn_sort_compare_ranges(). @a *rangelist is guaranteed to be in sorted * order. * @since New in 1.5. */ svn_error_t * svn_rangelist_intersect(apr_array_header_t **rangelist, apr_array_header_t *rangelist1, apr_array_header_t *rangelist2, svn_boolean_t consider_inheritance, apr_pool_t *pool); /** Reverse @a rangelist, and the @c start and @c end fields of each * range in @a rangelist, in place. * * TODO(miapi): Is this really a valid function? Rangelists that * aren't sorted, or rangelists containing reverse ranges, are * generally not valid in mergeinfo code. Can we rewrite the two * places where this is used? * * @since New in 1.5. */ svn_error_t * svn_rangelist_reverse(apr_array_header_t *rangelist, apr_pool_t *pool); /** Take an array of svn_merge_range_t *'s in @a rangelist, and convert it * back to a text format rangelist in @a output. If @a rangelist contains * no elements, sets @a output to the empty string. * * @since New in 1.5. */ svn_error_t * svn_rangelist_to_string(svn_string_t **output, const apr_array_header_t *rangelist, apr_pool_t *pool); /** Return a deep copy of @c svn_merge_range_t *'s in @a rangelist excluding * all non-inheritable @c svn_merge_range_t. If @a start and @a end are valid * revisions and @a start is less than or equal to @a end, then exclude only the * non-inheritable revision ranges that intersect inclusively with the range * defined by @a start and @a end. If @a rangelist contains no elements, return * an empty array. Allocate the copy in @a pool. * * @since New in 1.5. */ svn_error_t * svn_rangelist_inheritable(apr_array_header_t **inheritable_rangelist, apr_array_header_t *rangelist, svn_revnum_t start, svn_revnum_t end, apr_pool_t *pool); /** Return a deep copy of @a mergeinfo, excluding all non-inheritable * @c svn_merge_range_t. If @a start and @a end are valid revisions * and @a start is less than or equal to @a end, then exclude only the * non-inheritable revisions that intersect inclusively with the range * defined by @a start and @a end. If @a path is not NULL remove * non-inheritable ranges only for @a path. If all ranges are removed * for a given path then remove that path as well. If all paths are * removed or @a rangelist is empty then set @a *inheritable_rangelist * to an empty array. Allocate the copy in @a pool. * * @since New in 1.5. */ svn_error_t * svn_mergeinfo_inheritable(svn_mergeinfo_t *inheritable_mergeinfo, svn_mergeinfo_t mergeinfo, const char *path, svn_revnum_t start, svn_revnum_t end, apr_pool_t *pool); /** Take a mergeinfo in MERGEINPUT, and convert it back to unparsed * mergeinfo in *OUTPUT. If INPUT contains no elements, return the * empty string. * * @a mergeinput may contain relative merge source paths, but these are * converted to absolute paths in @a *output. * * @since New in 1.5. */ svn_error_t * svn_mergeinfo_to_string(svn_string_t **output, svn_mergeinfo_t mergeinput, apr_pool_t *pool); /** Take a hash of mergeinfo in @a mergeinfo, and sort the rangelists * associated with each key (in place). * * TODO(miapi): mergeinfos should *always* be sorted. This should be * a private function. * * @since New in 1.5 */ svn_error_t * svn_mergeinfo_sort(svn_mergeinfo_t mergeinfo, apr_pool_t *pool); /** Return a deep copy of @a mergeinfo_catalog, allocated in @a pool. * * @since New in 1.6. */ svn_mergeinfo_catalog_t svn_mergeinfo_catalog_dup(svn_mergeinfo_catalog_t mergeinfo_catalog, apr_pool_t *pool); /** Return a deep copy of @a mergeinfo, allocated in @a pool. * * @since New in 1.5. */ svn_mergeinfo_t svn_mergeinfo_dup(svn_mergeinfo_t mergeinfo, apr_pool_t *pool); /** Return a deep copy of @a rangelist, allocated in @a pool. * * @since New in 1.5. */ apr_array_header_t * svn_rangelist_dup(apr_array_header_t *rangelist, apr_pool_t *pool); /** * The three ways to request mergeinfo affecting a given path. * * @since New in 1.5. */ typedef enum { /** Explicit mergeinfo only. */ svn_mergeinfo_explicit, /** Explicit mergeinfo, or if that doesn't exist, the inherited mergeinfo from a target's nearest (path-wise, not history-wise) ancestor. */ svn_mergeinfo_inherited, /** Mergeinfo on target's nearest (path-wise, not history-wise) ancestor, regardless of whether target has explict mergeinfo. */ svn_mergeinfo_nearest_ancestor } svn_mergeinfo_inheritance_t; /** Return a constant string expressing @a inherit as an English word, * i.e., "explicit" (default), "inherited", or "nearest_ancestor". * The string is not localized, as it may be used for client<->server * communications. * * @since New in 1.5. */ const char * svn_inheritance_to_word(svn_mergeinfo_inheritance_t inherit); /** Return the appropriate @c svn_mergeinfo_inheritance_t for @a word. * @a word is as returned from svn_inheritance_to_word(). Defaults to * @c svn_mergeinfo_explicit. * * @since New in 1.5. */ svn_mergeinfo_inheritance_t svn_inheritance_from_word(const char *word); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* SVN_MERGEINFO_H */ 0707010002c64e000081a40000000000000000000000014cb50d8e000043950000010000010036ffffffffffffffff0000003000000000root/usr/local/include/subversion-1/svn_error.h/** * @copyright * ==================================================================== * Copyright (c) 2000-2004, 2008 CollabNet. All rights reserved. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://subversion.tigris.org/license-1.html. * If newer versions of this license are posted there, you may use a * newer version instead, at your option. * * This software consists of voluntary contributions made by many * individuals. For exact contribution history, see the revision * history and logs, available at http://subversion.tigris.org/. * ==================================================================== * @endcopyright * * @file svn_error.h * @brief Common exception handling for Subversion. */ #ifndef SVN_ERROR_H #define SVN_ERROR_H #include /* for apr_size_t */ #include /* APR's error system */ #include /* for apr_pool_t */ #ifndef DOXYGEN_SHOULD_SKIP_THIS #define APR_WANT_STDIO #endif #include /* for FILE* */ #include "svn_types.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** the best kind of (@c svn_error_t *) ! */ #define SVN_NO_ERROR 0 /* The actual error codes are kept in a separate file; see comments there for the reasons why. */ #include "svn_error_codes.h" /** Set the error location for debug mode. */ void svn_error__locate(const char *file, long line); /** Put an English description of @a statcode into @a buf and return @a buf, * NULL-terminated. @a statcode is either an svn error or apr error. */ char * svn_strerror(apr_status_t statcode, char *buf, apr_size_t bufsize); /** If @a err has a custom error message, return that, otherwise * store the generic error string associated with @a err->apr_err into * @a buf (terminating with NULL) and return @a buf. * * @since New in 1.4. * * @note @a buf and @a bufsize are provided in the interface so that * this function is thread-safe and yet does no allocation. */ const char *svn_err_best_message(svn_error_t *err, char *buf, apr_size_t bufsize); /** SVN error creation and destruction. * * @defgroup svn_error_error_creation_destroy Error creation and destruction * @{ */ /** Create a nested exception structure. * * Input: an APR or SVN custom error code, * a "child" error to wrap, * a specific message * * Returns: a new error structure (containing the old one). * * @note Errors are always allocated in a subpool of the global pool, * since an error's lifetime is generally not related to the * lifetime of any convenient pool. Errors must be freed * with svn_error_clear(). The specific message should be @c NULL * if there is nothing to add to the general message associated * with the error code. * * If creating the "bottommost" error in a chain, pass @c NULL for * the child argument. */ svn_error_t * svn_error_create(apr_status_t apr_err, svn_error_t *child, const char *message); /** Wrapper macro to collect file and line information */ #define svn_error_create \ (svn_error__locate(__FILE__,__LINE__), (svn_error_create)) /** Create an error structure with the given @a apr_err and @a child, * with a printf-style error message produced by passing @a fmt, using * apr_psprintf(). */ svn_error_t * svn_error_createf(apr_status_t apr_err, svn_error_t *child, const char *fmt, ...) __attribute__ ((format(printf, 3, 4))); /** Wrapper macro to collect file and line information */ #define svn_error_createf \ (svn_error__locate(__FILE__,__LINE__), (svn_error_createf)) /** Wrap a @a status from an APR function. If @a fmt is NULL, this is * equivalent to svn_error_create(status,NULL,NULL). Otherwise, * the error message is constructed by formatting @a fmt and the * following arguments according to apr_psprintf(), and then * appending ": " and the error message corresponding to @a status. * (If UTF-8 translation of the APR error message fails, the ": " and * APR error are not appended to the error message.) */ svn_error_t * svn_error_wrap_apr(apr_status_t status, const char *fmt, ...) __attribute__((format(printf, 2, 3))); /** Wrapper macro to collect file and line information */ #define svn_error_wrap_apr \ (svn_error__locate(__FILE__,__LINE__), (svn_error_wrap_apr)) /** A quick n' easy way to create a wrapped exception with your own * message, before throwing it up the stack. (It uses all of the * @a child's fields.) */ svn_error_t * svn_error_quick_wrap(svn_error_t *child, const char *new_msg); /** Wrapper macro to collect file and line information */ #define svn_error_quick_wrap \ (svn_error__locate(__FILE__,__LINE__), (svn_error_quick_wrap)) /** Compose two errors, returning the composition as a brand new error * and consuming the original errors. Either or both of @a err1 and * @a err2 may be @c SVN_NO_ERROR. If both are not @c SVN_NO_ERROR, * @a err2 will follow @a err1 in the chain of the returned error. * * @since New in 1.6. */ svn_error_t * svn_error_compose_create(svn_error_t *err1, svn_error_t *err2); /** Add @a new_err to the end of @a chain's chain of errors. The @a new_err * chain will be copied into @a chain's pool and destroyed, so @a new_err * itself becomes invalid after this function. */ void svn_error_compose(svn_error_t *chain, svn_error_t *new_err); /** Return the root cause of @a err by finding the last error in its * chain (e.g. it or its children). @a err may be @c SVN_NO_ERROR, in * which case @c SVN_NO_ERROR is returned. * * @since New in 1.5. */ svn_error_t * svn_error_root_cause(svn_error_t *err); /** Create a new error that is a deep copy of @a err and return it. * * @since New in 1.2. */ svn_error_t * svn_error_dup(svn_error_t *err); /** Free the memory used by @a error, as well as all ancestors and * descendants of @a error. * * Unlike other Subversion objects, errors are managed explicitly; you * MUST clear an error if you are ignoring it, or you are leaking memory. * For convenience, @a error may be @c NULL, in which case this function does * nothing; thus, svn_error_clear(svn_foo(...)) works as an idiom to * ignore errors. */ void svn_error_clear(svn_error_t *error); /** * Very basic default error handler: print out error stack @a error to the * stdio stream @a stream, with each error prefixed by @a prefix; quit and * clear @a error iff the @a fatal flag is set. Allocations are performed * in the @a error's pool. * * If you're not sure what prefix to pass, just pass "svn: ". That's * what code that used to call svn_handle_error() and now calls * svn_handle_error2() does. * * @since New in 1.2. */ void svn_handle_error2(svn_error_t *error, FILE *stream, svn_boolean_t fatal, const char *prefix); /** Like svn_handle_error2() but with @c prefix set to "svn: " * * @deprecated Provided for backward compatibility with the 1.1 API. */ SVN_DEPRECATED void svn_handle_error(svn_error_t *error, FILE *stream, svn_boolean_t fatal); /** * Very basic default warning handler: print out the error @a error to the * stdio stream @a stream, prefixed by @a prefix. Allocations are * performed in the error's pool. * * @since New in 1.2. */ void svn_handle_warning2(FILE *stream, svn_error_t *error, const char *prefix); /** Like svn_handle_warning2() but with @c prefix set to "svn: " * * @deprecated Provided for backward compatibility with the 1.1 API. */ SVN_DEPRECATED void svn_handle_warning(FILE *stream, svn_error_t *error); /** A statement macro for checking error values. * * Evaluate @a expr. If it yields an error, return that error from the * current function. Otherwise, continue. * * The do { ... } while (0) wrapper has no semantic effect, * but it makes this macro syntactically equivalent to the expression * statement it resembles. Without it, statements like * * @code * if (a) * SVN_ERR (some operation); * else * foo; * @endcode * * would not mean what they appear to. */ #define SVN_ERR(expr) \ do { \ svn_error_t *svn_err__temp = (expr); \ if (svn_err__temp) \ return svn_err__temp; \ } while (0) /** A statement macro, very similar to @c SVN_ERR. * * This macro will wrap the error with the specified text before * returning the error. */ #define SVN_ERR_W(expr, wrap_msg) \ do { \ svn_error_t *svn_err__temp = (expr); \ if (svn_err__temp) \ return svn_error_quick_wrap(svn_err__temp, wrap_msg); \ } while (0) /** A statement macro, similar to @c SVN_ERR, but returns an integer. * * Evaluate @a expr. If it yields an error, handle that error and * return @c EXIT_FAILURE. */ #define SVN_INT_ERR(expr) \ do { \ svn_error_t *svn_err__temp = (expr); \ if (svn_err__temp) { \ svn_handle_error2(svn_err__temp, stderr, FALSE, "svn: "); \ svn_error_clear(svn_err__temp); \ return EXIT_FAILURE; } \ } while (0) /** @} */ /** * Return TRUE if @a err is an error specifically related to locking a * path in the repository, FALSE otherwise. * * SVN_ERR_FS_OUT_OF_DATE is in here because it's a non-fatal error * that can be thrown when attempting to lock an item. * * @since New in 1.2. */ #define SVN_ERR_IS_LOCK_ERROR(err) \ (err->apr_err == SVN_ERR_FS_PATH_ALREADY_LOCKED || \ err->apr_err == SVN_ERR_FS_OUT_OF_DATE) \ /** * Return TRUE if @a err is an error specifically related to unlocking * a path in the repository, FALSE otherwise. * * @since New in 1.2. */ #define SVN_ERR_IS_UNLOCK_ERROR(err) \ (err->apr_err == SVN_ERR_FS_PATH_NOT_LOCKED || \ err->apr_err == SVN_ERR_FS_BAD_LOCK_TOKEN || \ err->apr_err == SVN_ERR_FS_LOCK_OWNER_MISMATCH || \ err->apr_err == SVN_ERR_FS_NO_SUCH_LOCK || \ err->apr_err == SVN_ERR_RA_NOT_LOCKED || \ err->apr_err == SVN_ERR_FS_LOCK_EXPIRED) /** Report that an internal malfunction has occurred, and possibly terminate * the program. * * Act as determined by the current "malfunction handler" which may have * been specified by a call to svn_error_set_malfunction_handler() or else * is the default handler as specified in that function's documentation. If * the malfunction handler returns, then cause the function using this macro * to return the error object that it generated. * * @note The intended use of this macro is where execution reaches a point * that cannot possibly be reached unless there is a bug in the program. * * @since New in 1.6. */ #define SVN_ERR_MALFUNCTION() \ do { \ return svn_error__malfunction(TRUE, __FILE__, __LINE__, NULL); \ } while (0) /** Similar to SVN_ERR_MALFUNCTION(), but without the option of returning * an error to the calling function. * * If possible you should use SVN_ERR_MALFUNCTION() instead. * * @since New in 1.6. */ #define SVN_ERR_MALFUNCTION_NO_RETURN() \ do { \ svn_error__malfunction(FALSE, __FILE__, __LINE__, NULL); \ abort(); \ } while (1) /** Check that a condition is true: if not, report an error and possibly * terminate the program. * * If the Boolean expression @a expr is true, do nothing. Otherwise, * act as determined by the current "malfunction handler" which may have * been specified by a call to svn_error_set_malfunction_handler() or else * is the default handler as specified in that function's documentation. If * the malfunction handler returns, then cause the function using this macro * to return the error object that it generated. * * @note The intended use of this macro is to check a condition that cannot * possibly be false unless there is a bug in the program. * * @note The condition to be checked should not be computationally expensive * if it is reached often, as, unlike traditional "assert" statements, the * evaluation of this expression is not compiled out in release-mode builds. * * @since New in 1.6. */ #define SVN_ERR_ASSERT(expr) \ do { \ if (!(expr)) \ SVN_ERR(svn_error__malfunction(TRUE, __FILE__, __LINE__, #expr)); \ } while (0) /** Similar to SVN_ERR_ASSERT(), but without the option of returning * an error to the calling function. * * If possible you should use SVN_ERR_ASSERT() instead. * * @since New in 1.6. */ #define SVN_ERR_ASSERT_NO_RETURN(expr) \ do { \ if (!(expr)) { \ svn_error__malfunction(FALSE, __FILE__, __LINE__, #expr); \ abort(); \ } \ } while (0) /** A helper function for the macros that report malfunctions. Handle a * malfunction by calling the current "malfunction handler" which may have * been specified by a call to svn_error_set_malfunction_handler() or else * is the default handler as specified in that function's documentation. * * Pass all of the parameters to the handler. The error occurred in the * source file @a file at line @a line, and was an assertion failure of the * expression @a expr, or, if @a expr is null, an unconditional error. * * If @a can_return is true, the handler can return an error object * that is returned by the caller. If @a can_return is false the * method should never return. (The caller will call abort()) * * @since New in 1.6. */ svn_error_t * svn_error__malfunction(svn_boolean_t can_return, const char *file, int line, const char *expr); /** A type of function that handles an assertion failure or other internal * malfunction detected within the Subversion libraries. * * The error occurred in the source file @a file at line @a line, and was an * assertion failure of the expression @a expr, or, if @a expr is null, an * unconditional error. * * If @a can_return is false a function of this type must never return. * * If @a can_return is true a function of this type must do one of: * - Return an error object describing the error, using an error code in * the category SVN_ERR_MALFUNC_CATEGORY_START. * - Never return. * * The function may alter its behaviour according to compile-time * and run-time and even interactive conditions. * * @since New in 1.6. */ typedef svn_error_t *(*svn_error_malfunction_handler_t) (svn_boolean_t can_return, const char *file, int line, const char *expr); /** Cause subsequent malfunctions to be handled by @a func. * Return the handler that was previously in effect. * * @a func may not be null. * * @note The default handler is svn_error_abort_on_malfunction(). * * @note This function must be called in a single-threaded context. * * @since New in 1.6. */ svn_error_malfunction_handler_t svn_error_set_malfunction_handler(svn_error_malfunction_handler_t func); /** Handle a malfunction by returning an error object that describes it. * * When @a can_return is false, abort() * * This function implements @c svn_error_malfunction_handler_t. * * @since New in 1.6. */ svn_error_t * svn_error_raise_on_malfunction(svn_boolean_t can_return, const char *file, int line, const char *expr); /** Handle a malfunction by printing a message to stderr and aborting. * * This function implements @c svn_error_malfunction_handler_t. * * @since New in 1.6. */ svn_error_t * svn_error_abort_on_malfunction(svn_boolean_t can_return, const char *file, int line, const char *expr); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* SVN_ERROR_H */ 0707010002c656000081a40000000000000000000000014cb50d8e0000057b0000010000010036ffffffffffffffff0000002e00000000root/usr/local/include/subversion-1/svn_nls.h/** * @copyright * ==================================================================== * Copyright (c) 2000-2005, 2008 CollabNet. All rights reserved. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://subversion.tigris.org/license-1.html. * If newer versions of this license are posted there, you may use a * newer version instead, at your option. * * This software consists of voluntary contributions made by many * individuals. For exact contribution history, see the revision * history and logs, available at http://subversion.tigris.org/. * ==================================================================== * @endcopyright * * @file svn_nls.h * @brief Support functions for NLS programs */ #ifndef SVN_NLS_H #define SVN_NLS_H #include "svn_types.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** Set up the NLS. * Return the error @c APR_EINVAL or @c APR_INCOMPLETE if an * error occurs. * * @note This function is for bindings. You should usually * use svn_cmdline_init() instead of calling this * function directly. This function should be called * after initializing APR. * * @since New in 1.3. */ svn_error_t * svn_nls_init(void); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* SVN_NLS_H */ 0707010002c63e000081a40000000000000000000000014cb50d8e000005cd0000010000010036ffffffffffffffff0000003400000000root/usr/local/include/subversion-1/mod_authz_svn.h/** * @copyright * ==================================================================== * Copyright (c) 2007 CollabNet. All rights reserved. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://subversion.tigris.org/license-1.html. * If newer versions of this license are posted there, you may use a * newer version instead, at your option. * * This software consists of voluntary contributions made by many * individuals. For exact contribution history, see the revision * history and logs, available at http://subversion.tigris.org/. * ==================================================================== * @endcopyright * * @file mod_authz_svn.h * @brief Subversion authorization extensions for mod_dav_svn */ #ifndef MOD_AUTHZ_SVN_H #define MOD_AUTHZ_SVN_H #include #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /* * mod_dav_svn to mod_authz_svn bypass mechanism */ #define AUTHZ_SVN__SUBREQ_BYPASS_PROV_GRP "dav2authz_subreq_bypass" #define AUTHZ_SVN__SUBREQ_BYPASS_PROV_NAME "mod_authz_svn_subreq_bypass" #define AUTHZ_SVN__SUBREQ_BYPASS_PROV_VER "00.00a" typedef int (*authz_svn__subreq_bypass_func_t)(request_rec *r, const char *repos_path, const char *repos_name); #ifdef __cplusplus } #endif /* __cplusplus */ #endif 0707010002c650000081a40000000000000000000000014cb50d8e00012bf20000010000010036ffffffffffffffff0000002d00000000root/usr/local/include/subversion-1/svn_fs.h/** * @copyright * ==================================================================== * Copyright (c) 2000-2008 CollabNet. All rights reserved. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://subversion.tigris.org/license-1.html. * If newer versions of this license are posted there, you may use a * newer version instead, at your option. * * This software consists of voluntary contributions made by many * individuals. For exact contribution history, see the revision * history and logs, available at http://subversion.tigris.org/. * ==================================================================== * @endcopyright * * @file svn_fs.h * @brief Interface to the Subversion filesystem. */ #ifndef SVN_FS_H #define SVN_FS_H #include #include #include #include #include /* for apr_time_t */ #include "svn_types.h" #include "svn_string.h" #include "svn_delta.h" #include "svn_io.h" #include "svn_mergeinfo.h" #include "svn_checksum.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * Get libsvn_fs version information. * * @since New in 1.1. */ const svn_version_t * svn_fs_version(void); /** * @defgroup fs_handling Filesystem interaction subsystem * @{ */ /* Opening and creating filesystems. */ /** An object representing a Subversion filesystem. */ typedef struct svn_fs_t svn_fs_t; /** * @name Filesystem configuration options * @{ */ #define SVN_FS_CONFIG_BDB_TXN_NOSYNC "bdb-txn-nosync" #define SVN_FS_CONFIG_BDB_LOG_AUTOREMOVE "bdb-log-autoremove" /* See also svn_fs_type(). */ /** @since New in 1.1. */ #define SVN_FS_CONFIG_FS_TYPE "fs-type" /** @since New in 1.1. */ #define SVN_FS_TYPE_BDB "bdb" /** @since New in 1.1. */ #define SVN_FS_TYPE_FSFS "fsfs" /** Create repository format compatible with Subversion versions * earlier than 1.4. * * @since New in 1.4. */ #define SVN_FS_CONFIG_PRE_1_4_COMPATIBLE "pre-1.4-compatible" /** Create repository format compatible with Subversion versions * earlier than 1.5. * * @since New in 1.5. */ #define SVN_FS_CONFIG_PRE_1_5_COMPATIBLE "pre-1.5-compatible" /** Create repository format compatible with Subversion versions * earlier than 1.6. * * @since New in 1.6. */ #define SVN_FS_CONFIG_PRE_1_6_COMPATIBLE "pre-1.6-compatible" /** @} */ /** * Callers should invoke this function to initialize global state in * the FS library before creating FS objects. If this function is * invoked, no FS objects may be created in another thread at the same * time as this invocation, and the provided @a pool must last longer * than any FS object created subsequently. * * If this function is not called, the FS library will make a best * effort to bootstrap a mutex for protecting data common to FS * objects; however, there is a small window of failure. Also, a * small amount of data will be leaked if the Subversion FS library is * dynamically unloaded, and using the bdb FS can potentially segfault * or invoke other undefined behavior if this function is not called * with an appropriate pool (such as the pool the module was loaded into) * when loaded dynamically. * * If this function is called multiple times before the pool passed to * the first call is destroyed or cleared, the later calls will have * no effect. * * @since New in 1.2. */ svn_error_t * svn_fs_initialize(apr_pool_t *pool); /** The type of a warning callback function. @a baton is the value specified * in the call to svn_fs_set_warning_func(); the filesystem passes it through * to the callback. @a err contains the warning message. * * The callback function should not clear the error that is passed to it; * its caller should do that. */ typedef void (*svn_fs_warning_callback_t)(void *baton, svn_error_t *err); /** Provide a callback function, @a warning, that @a fs should use to * report (non-fatal) errors. To print an error, the filesystem will call * @a warning, passing it @a warning_baton and the error. * * By default, this is set to a function that will crash the process. * Dumping to @c stderr or /dev/tty is not acceptable default * behavior for server processes, since those may both be equivalent to * /dev/null. */ void svn_fs_set_warning_func(svn_fs_t *fs, svn_fs_warning_callback_t warning, void *warning_baton); /** * Create a new, empty Subversion filesystem, stored in the directory * @a path, and return a pointer to it in @a *fs_p. @a path must not * currently exist, but its parent must exist. If @a fs_config is not * @c NULL, the options it contains modify the behavior of the * filesystem. The interpretation of @a fs_config is specific to the * filesystem back-end. The new filesystem may be closed by * destroying @a pool. * * @note The lifetime of @a fs_config must not be shorter than @a * pool's. It's a good idea to allocate @a fs_config from @a pool or * one of its ancestors. * * If @a fs_config contains a value for @c SVN_FS_CONFIG_FS_TYPE, that * value determines the filesystem type for the new filesystem. * Currently defined values are: * * SVN_FS_TYPE_BDB Berkeley-DB implementation * SVN_FS_TYPE_FSFS Native-filesystem implementation * * If @a fs_config is @c NULL or does not contain a value for * @c SVN_FS_CONFIG_FS_TYPE then the default filesystem type will be used. * This will typically be BDB for version 1.1 and FSFS for later versions, * though the caller should not rely upon any particular default if they * wish to ensure that a filesystem of a specific type is created. * * @since New in 1.1. */ svn_error_t * svn_fs_create(svn_fs_t **fs_p, const char *path, apr_hash_t *fs_config, apr_pool_t *pool); /** * Open a Subversion filesystem located in the directory @a path, and * return a pointer to it in @a *fs_p. If @a fs_config is not @c * NULL, the options it contains modify the behavior of the * filesystem. The interpretation of @a fs_config is specific to the * filesystem back-end. The opened filesystem may be closed by * destroying @a pool. * * @note The lifetime of @a fs_config must not be shorter than @a * pool's. It's a good idea to allocate @a fs_config from @a pool or * one of its ancestors. * * Only one thread may operate on any given filesystem object at once. * Two threads may access the same filesystem simultaneously only if * they open separate filesystem objects. * * @note You probably don't want to use this directly. Take a look at * svn_repos_open() instead. * * @since New in 1.1. */ svn_error_t * svn_fs_open(svn_fs_t **fs_p, const char *path, apr_hash_t *fs_config, apr_pool_t *pool); /** * Upgrade the Subversion filesystem located in the directory @a path * to the latest version supported by this library. Return @c * SVN_ERR_FS_UNSUPPORTED_UPGRADE and make no changes to the * filesystem if the requested upgrade is not supported. Use @a pool * for necessary allocations. * * @note You probably don't want to use this directly. Take a look at * svn_repos_upgrade() instead. * * @since New in 1.5. */ svn_error_t * svn_fs_upgrade(const char *path, apr_pool_t *pool); /** * Return, in @a *fs_type, a string identifying the back-end type of * the Subversion filesystem located in @a path. Allocate @a *fs_type * in @a pool. * * The string should be equal to one of the @c SVN_FS_TYPE_* defined * constants, unless the filesystem is a new back-end type added in * a later version of Subversion. * * In general, the type should make no difference in the filesystem's * semantics, but there are a few situations (such as backups) where * it might matter. * * @since New in 1.3. */ svn_error_t * svn_fs_type(const char **fs_type, const char *path, apr_pool_t *pool); /** * Return the path to @a fs's repository, allocated in @a pool. * @note This is just what was passed to svn_fs_create() or * svn_fs_open() -- might be absolute, might not. * * @since New in 1.1. */ const char * svn_fs_path(svn_fs_t *fs, apr_pool_t *pool); /** * Delete the filesystem at @a path. * * @since New in 1.1. */ svn_error_t * svn_fs_delete_fs(const char *path, apr_pool_t *pool); /** * Copy a possibly live Subversion filesystem from @a src_path to * @a dest_path. If @a clean is @c TRUE, perform cleanup on the * source filesystem as part of the copy operation; currently, this * means deleting copied, unused logfiles for a Berkeley DB source * filesystem. * * @since New in 1.1. */ svn_error_t * svn_fs_hotcopy(const char *src_path, const char *dest_path, svn_boolean_t clean, apr_pool_t *pool); /** Perform any necessary non-catastrophic recovery on the Subversion * filesystem located at @a path. * * If @a cancel_func is not @c NULL, it is called periodically with * @a cancel_baton as argument to see if the client wishes to cancel * recovery. BDB filesystems do not currently support cancellation. * * Do any necessary allocation within @a pool. * * For FSFS filesystems, recovery is currently limited to recreating * the db/current file, and does not require exclusive access. * * For BDB filesystems, recovery requires exclusive access, and is * described in detail below. * * After an unexpected server exit, due to a server crash or a system * crash, a Subversion filesystem based on Berkeley DB needs to run * recovery procedures to bring the database back into a consistent * state and release any locks that were held by the deceased process. * The recovery procedures require exclusive access to the database * --- while they execute, no other process or thread may access the * database. * * In a server with multiple worker processes, like Apache, if a * worker process accessing the filesystem dies, you must stop the * other worker processes, and run recovery. Then, the other worker * processes can re-open the database and resume work. * * If the server exited cleanly, there is no need to run recovery, but * there is no harm in it, either, and it take very little time. So * it's a fine idea to run recovery when the server process starts, * before it begins handling any requests. * * @since New in 1.5. */ svn_error_t * svn_fs_recover(const char *path, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool); /** Subversion filesystems based on Berkeley DB. * * The following functions are specific to Berkeley DB filesystems. * * @defgroup svn_fs_bdb Berkeley DB filesystems * @{ */ /** Register an error handling function for Berkeley DB error messages. * * @deprecated Provided for backward compatibility with the 1.2 API. * * Despite being first declared deprecated in Subversion 1.3, this API * is redundant in versions 1.1 and 1.2 as well. * * Berkeley DB's error codes are seldom sufficiently informative to allow * adequate troubleshooting. Berkeley DB provides extra messages through * a callback function - if an error occurs, the @a handler will be called * with two strings: an error message prefix, which will be zero, and * an error message. @a handler might print it out, log it somewhere, * etc. * * Subversion 1.1 and later install their own handler internally, and * wrap the messages from Berkeley DB into the standard svn_error_t object, * making any information gained through this interface redundant. * * It is only worth using this function if your program will be used * with Subversion 1.0. * * This function connects to the Berkeley DB @c DBENV->set_errcall interface. * Since that interface supports only a single callback, Subversion's internal * callback is registered with Berkeley DB, and will forward notifications to * a user provided callback after performing its own processing. */ SVN_DEPRECATED svn_error_t * svn_fs_set_berkeley_errcall(svn_fs_t *fs, void (*handler)(const char *errpfx, char *msg)); /** Set @a *logfiles to an array of const char * log file names * of Berkeley DB-based Subversion filesystem. * * If @a only_unused is @c TRUE, set @a *logfiles to an array which * contains only the names of Berkeley DB log files no longer in use * by the filesystem. Otherwise, all log files (used and unused) are * returned. * This function wraps the Berkeley DB 'log_archive' function * called by the db_archive binary. Repository administrators may * want to run this function periodically and delete the unused log * files, as a way of reclaiming disk space. */ svn_error_t * svn_fs_berkeley_logfiles(apr_array_header_t **logfiles, const char *path, svn_boolean_t only_unused, apr_pool_t *pool); /** * The following functions are similar to their generic counterparts. * * In Subversion 1.2 and earlier, they only work on Berkeley DB filesystems. * In Subversion 1.3 and later, they perform largely as aliases for their * generic counterparts (with the exception of recover, which only gained * a generic counterpart in 1.5). * * @defgroup svn_fs_bdb_deprecated Berkeley DB filesystem compatibility * @{ */ /** @deprecated Provided for backward compatibility with the 1.0 API. */ SVN_DEPRECATED svn_fs_t * svn_fs_new(apr_hash_t *fs_config, apr_pool_t *pool); /** @deprecated Provided for backward compatibility with the 1.0 API. */ SVN_DEPRECATED svn_error_t * svn_fs_create_berkeley(svn_fs_t *fs, const char *path); /** @deprecated Provided for backward compatibility with the 1.0 API. */ SVN_DEPRECATED svn_error_t * svn_fs_open_berkeley(svn_fs_t *fs, const char *path); /** @deprecated Provided for backward compatibility with the 1.0 API. */ SVN_DEPRECATED const char * svn_fs_berkeley_path(svn_fs_t *fs, apr_pool_t *pool); /** @deprecated Provided for backward compatibility with the 1.0 API. */ SVN_DEPRECATED svn_error_t * svn_fs_delete_berkeley(const char *path, apr_pool_t *pool); /** @deprecated Provided for backward compatibility with the 1.0 API. */ SVN_DEPRECATED svn_error_t * svn_fs_hotcopy_berkeley(const char *src_path, const char *dest_path, svn_boolean_t clean_logs, apr_pool_t *pool); /** @deprecated Provided for backward compatibility with the 1.4 API. */ SVN_DEPRECATED svn_error_t * svn_fs_berkeley_recover(const char *path, apr_pool_t *pool); /** @} */ /** @} */ /** Filesystem Access Contexts. * * @since New in 1.2. * * At certain times, filesystem functions need access to temporary * user data. For example, which user is changing a file? If the * file is locked, has an appropriate lock-token been supplied? * * This temporary user data is stored in an "access context" object, * and the access context is then connected to the filesystem object. * Whenever a filesystem function requires information, it can pull * things out of the context as needed. * * @defgroup svn_fs_access_ctx Filesystem access contexts * @{ */ /** An opaque object representing temporary user data. */ typedef struct svn_fs_access_t svn_fs_access_t; /** Set @a *access_ctx to a new @c svn_fs_access_t object representing * @a username, allocated in @a pool. @a username is presumed to * have been authenticated by the caller. * * Make a deep copy of @a username. */ svn_error_t * svn_fs_create_access(svn_fs_access_t **access_ctx, const char *username, apr_pool_t *pool); /** Associate @a access_ctx with an open @a fs. * * This function can be run multiple times on the same open * filesystem, in order to change the filesystem access context for * different filesystem operations. Pass a NULL value for @a * access_ctx to disassociate the current access context from the * filesystem. */ svn_error_t * svn_fs_set_access(svn_fs_t *fs, svn_fs_access_t *access_ctx); /** Set @a *access_ctx to the current @a fs access context, or NULL if * there is no current fs access context. */ svn_error_t * svn_fs_get_access(svn_fs_access_t **access_ctx, svn_fs_t *fs); /** Accessors for the access context: */ /** Set @a *username to the name represented by @a access_ctx. */ svn_error_t * svn_fs_access_get_username(const char **username, svn_fs_access_t *access_ctx); /** Push a lock-token @a token associated with path @a path into the * context @a access_ctx. The context remembers all tokens it * receives, and makes them available to fs functions. The token and * path are not duplicated into @a access_ctx's pool; make sure the * token's lifetime is at least as long as @a access_ctx. * * @since New in 1.6. */ svn_error_t * svn_fs_access_add_lock_token2(svn_fs_access_t *access_ctx, const char *path, const char *token); /** * Same as svn_fs_access_add_lock_token2(), but with @a path set to value 1. * * @deprecated Provided for backward compatibility with the 1.1 API. */ SVN_DEPRECATED svn_error_t * svn_fs_access_add_lock_token(svn_fs_access_t *access_ctx, const char *token); /** @} */ /** Filesystem Nodes. * * In a Subversion filesystem, a `node' corresponds roughly to an * `inode' in a Unix filesystem: * - A node is either a file or a directory. * - A node's contents change over time. * - When you change a node's contents, it's still the same node; it's * just been changed. So a node's identity isn't bound to a specific * set of contents. * - If you rename a node, it's still the same node, just under a * different name. So a node's identity isn't bound to a particular * filename. * * A `node revision' refers to a node's contents at a specific point in * time. Changing a node's contents always creates a new revision of that * node. Once created, a node revision's contents never change. * * When we create a node, its initial contents are the initial revision of * the node. As users make changes to the node over time, we create new * revisions of that same node. When a user commits a change that deletes * a file from the filesystem, we don't delete the node, or any revision * of it --- those stick around to allow us to recreate prior revisions of * the filesystem. Instead, we just remove the reference to the node * from the directory. * * @defgroup svn_fs_nodes Filesystem nodes * @{ */ /** An object representing a node-id. */ typedef struct svn_fs_id_t svn_fs_id_t; /** Return -1, 0, or 1 if node revisions @a a and @a b are unrelated, * equivalent, or otherwise related (respectively). */ int svn_fs_compare_ids(const svn_fs_id_t *a, const svn_fs_id_t *b); /** Return non-zero IFF the nodes associated with @a id1 and @a id2 are * related, else return zero. */ svn_boolean_t svn_fs_check_related(const svn_fs_id_t *id1, const svn_fs_id_t *id2); /** * @note This function is not guaranteed to work with all filesystem * types. There is currently no un-deprecated equivalent; contact the * Subversion developers if you have a need for it. * * @deprecated Provided for backward compatibility with the 1.0 API. */ SVN_DEPRECATED svn_fs_id_t * svn_fs_parse_id(const char *data, apr_size_t len, apr_pool_t *pool); /** Return a Subversion string containing the unparsed form of the * node or node revision id @a id. Allocate the string containing the * unparsed form in @a pool. */ svn_string_t * svn_fs_unparse_id(const svn_fs_id_t *id, apr_pool_t *pool); /** @} */ /** Filesystem Transactions. * * To make a change to a Subversion filesystem: * - Create a transaction object, using svn_fs_begin_txn(). * - Call svn_fs_txn_root(), to get the transaction's root directory. * - Make whatever changes you like in that tree. * - Commit the transaction, using svn_fs_commit_txn(). * * The filesystem implementation guarantees that your commit will * either: * - succeed completely, so that all of the changes are committed to * create a new revision of the filesystem, or * - fail completely, leaving the filesystem unchanged. * * Until you commit the transaction, any changes you make are * invisible. Only when your commit succeeds do they become visible * to the outside world, as a new revision of the filesystem. * * If you begin a transaction, and then decide you don't want to make * the change after all (say, because your net connection with the * client disappeared before the change was complete), you can call * svn_fs_abort_txn(), to cancel the entire transaction; this * leaves the filesystem unchanged. * * The only way to change the contents of files or directories, or * their properties, is by making a transaction and creating a new * revision, as described above. Once a revision has been committed, it * never changes again; the filesystem interface provides no means to * go back and edit the contents of an old revision. Once history has * been recorded, it is set in stone. Clients depend on this property * to do updates and commits reliably; proxies depend on this property * to cache changes accurately; and so on. * * There are two kinds of nodes in the filesystem: mutable, and * immutable. Revisions in the filesystem consist entirely of * immutable nodes, whose contents never change. A transaction in * progress, which the user is still constructing, uses mutable nodes * for those nodes which have been changed so far, and refers to * immutable nodes from existing revisions for portions of the tree * which haven't been changed yet in that transaction. * * Immutable nodes, as part of revisions, never refer to mutable * nodes, which are part of uncommitted transactions. Mutable nodes * may refer to immutable nodes, or other mutable nodes. * * Note that the terms "immutable" and "mutable" describe whether or * not the nodes have been changed as part of a transaction --- not * the permissions on the nodes they refer to. Even if you aren't * authorized to modify the filesystem's root directory, you might be * authorized to change some descendant of the root; doing so would * create a new mutable copy of the root directory. Mutability refers * to the role of the node: part of an existing revision, or part of a * new one. This is independent of your authorization to make changes * to a given node. * * Transactions are actually persistent objects, stored in the * database. You can open a filesystem, begin a transaction, and * close the filesystem, and then a separate process could open the * filesystem, pick up the same transaction, and continue work on it. * When a transaction is successfully committed, it is removed from * the database. * * Every transaction is assigned a name. You can open a transaction * by name, and resume work on it, or find out the name of a * transaction you already have open. You can also list all the * transactions currently present in the database. * * You may assign properties to transactions; these are name/value * pairs. When you commit a transaction, all of its properties become * unversioned revision properties of the new revision. (There is one * exception: the svn:date property will be automatically set on new * transactions to the date that the transaction was created, and will * be overwritten when the transaction is committed by the current * time; changes to a transaction's svn:date property will not affect * its committed value.) * * Transaction names are guaranteed to contain only letters (upper- * and lower-case), digits, `-', and `.', from the ASCII character * set. * * The Subversion filesystem will make a best effort to not reuse * transaction names. The Berkeley DB backend generates transaction * names using a sequence, or a counter, which is stored in the BDB * database. Each new transaction increments the counter. The * current value of the counter is not serialized into a filesystem * dump file, so dumping and restoring the repository will reset the * sequence and reuse transaction names. The FSFS backend generates a * transaction name using the hostname, process ID and current time in * microseconds since 00:00:00 January 1, 1970 UTC. So it is * extremely unlikely that a transaction name will be reused. * * @defgroup svn_fs_txns Filesystem transactions * @{ */ /** The type of a Subversion transaction object. */ typedef struct svn_fs_txn_t svn_fs_txn_t; /** @defgroup svn_fs_begin_txn2_flags Bitmask flags for svn_fs_begin_txn2() * @since New in 1.2. * @{ */ /** Do on-the-fly out-of-dateness checks. That is, an fs routine may * throw error if a caller tries to edit an out-of-date item in the * transaction. * * @warning ### Not yet implemented. */ #define SVN_FS_TXN_CHECK_OOD 0x00001 /** Do on-the-fly lock checks. That is, an fs routine may throw error * if a caller tries to edit a locked item without having rights to the lock. */ #define SVN_FS_TXN_CHECK_LOCKS 0x00002 /** @} */ /** * Begin a new transaction on the filesystem @a fs, based on existing * revision @a rev. Set @a *txn_p to a pointer to the new transaction. * When committed, this transaction will create a new revision. * * Allocate the new transaction in @a pool; when @a pool is freed, the new * transaction will be closed (neither committed nor aborted). * * @a flags determines transaction enforcement behaviors, and is composed * from the constants SVN_FS_TXN_* (@c SVN_FS_TXN_CHECK_OOD etc.). * * @note If you're building a txn for committing, you probably * don't want to call this directly. Instead, call * svn_repos_fs_begin_txn_for_commit(), which honors the * repository's hook configurations. * * @since New in 1.2. */ svn_error_t * svn_fs_begin_txn2(svn_fs_txn_t **txn_p, svn_fs_t *fs, svn_revnum_t rev, apr_uint32_t flags, apr_pool_t *pool); /** * Same as svn_fs_begin_txn2(), but with @a flags set to 0. * * @deprecated Provided for backward compatibility with the 1.1 API. */ SVN_DEPRECATED svn_error_t * svn_fs_begin_txn(svn_fs_txn_t **txn_p, svn_fs_t *fs, svn_revnum_t rev, apr_pool_t *pool); /** Commit @a txn. * * @note You usually don't want to call this directly. * Instead, call svn_repos_fs_commit_txn(), which honors the * repository's hook configurations. * * If the transaction conflicts with other changes committed to the * repository, return an @c SVN_ERR_FS_CONFLICT error. Otherwise, create * a new filesystem revision containing the changes made in @a txn, * storing that new revision number in @a *new_rev, and return zero. * * If @a conflict_p is non-zero, use it to provide details on any * conflicts encountered merging @a txn with the most recent committed * revisions. If a conflict occurs, set @a *conflict_p to the path of * the conflict in @a txn, with the same lifetime as @a txn; * otherwise, set @a *conflict_p to NULL. * * If the commit succeeds, @a txn is invalid. * * If the commit fails, @a txn is still valid; you can make more * operations to resolve the conflict, or call svn_fs_abort_txn() to * abort the transaction. * * @note Success or failure of the commit of @a txn is determined by * examining the value of @a *new_rev upon this function's return. If * the value is a valid revision number, the commit was successful, * even though a non-@c NULL function return value may indicate that * something else went wrong. */ svn_error_t * svn_fs_commit_txn(const char **conflict_p, svn_revnum_t *new_rev, svn_fs_txn_t *txn, apr_pool_t *pool); /** Abort the transaction @a txn. Any changes made in @a txn are * discarded, and the filesystem is left unchanged. Use @a pool for * any necessary allocations. * * @note This function first sets the state of @a txn to "dead", and * then attempts to purge it and any related data from the filesystem. * If some part of the cleanup process fails, @a txn and some portion * of its data may remain in the database after this function returns. * Use svn_fs_purge_txn() to retry the transaction cleanup. */ svn_error_t * svn_fs_abort_txn(svn_fs_txn_t *txn, apr_pool_t *pool); /** Cleanup the dead transaction in @a fs whose ID is @a txn_id. Use * @a pool for all allocations. If the transaction is not yet dead, * the error @c SVN_ERR_FS_TRANSACTION_NOT_DEAD is returned. (The * caller probably forgot to abort the transaction, or the cleanup * step of that abort failed for some reason.) */ svn_error_t * svn_fs_purge_txn(svn_fs_t *fs, const char *txn_id, apr_pool_t *pool); /** Set @a *name_p to the name of the transaction @a txn, as a * NULL-terminated string. Allocate the name in @a pool. */ svn_error_t * svn_fs_txn_name(const char **name_p, svn_fs_txn_t *txn, apr_pool_t *pool); /** Return @a txn's base revision. */ svn_revnum_t svn_fs_txn_base_revision(svn_fs_txn_t *txn); /** Open the transaction named @a name in the filesystem @a fs. Set @a *txn * to the transaction. * * If there is no such transaction, @c SVN_ERR_FS_NO_SUCH_TRANSACTION is * the error returned. * * Allocate the new transaction in @a pool; when @a pool is freed, the new * transaction will be closed (neither committed nor aborted). */ svn_error_t * svn_fs_open_txn(svn_fs_txn_t **txn, svn_fs_t *fs, const char *name, apr_pool_t *pool); /** Set @a *names_p to an array of const char * ids which are the * names of all the currently active transactions in the filesystem @a fs. * Allocate the array in @a pool. */ svn_error_t * svn_fs_list_transactions(apr_array_header_t **names_p, svn_fs_t *fs, apr_pool_t *pool); /* Transaction properties */ /** Set @a *value_p to the value of the property named @a propname on * transaction @a txn. If @a txn has no property by that name, set * @a *value_p to zero. Allocate the result in @a pool. */ svn_error_t * svn_fs_txn_prop(svn_string_t **value_p, svn_fs_txn_t *txn, const char *propname, apr_pool_t *pool); /** Set @a *table_p to the entire property list of transaction @a txn, as * an APR hash table allocated in @a pool. The resulting table maps property * names to pointers to @c svn_string_t objects containing the property value. */ svn_error_t * svn_fs_txn_proplist(apr_hash_t **table_p, svn_fs_txn_t *txn, apr_pool_t *pool); /** Change a transactions @a txn's property's value, or add/delete a * property. @a name is the name of the property to change, and @a value * is the new value of the property, or zero if the property should be * removed altogether. Do any necessary temporary allocation in @a pool. */ svn_error_t * svn_fs_change_txn_prop(svn_fs_txn_t *txn, const char *name, const svn_string_t *value, apr_pool_t *pool); /** Change, add, and/or delete transaction property values in * transaction @a txn. @a props is an array of svn_prop_t * elements. This is equivalent to calling svn_fs_change_txp_prop * multiple times with the @c name and @c value fields of each * successive svn_prop_t, but may be more efficient. * (Properties not mentioned are left alone.) Do any necessary * temporary allocation in @a pool. * * @since New in 1.5. */ svn_error_t * svn_fs_change_txn_props(svn_fs_txn_t *txn, apr_array_header_t *props, apr_pool_t *pool); /** @} */ /** Roots. * * An @c svn_fs_root_t object represents the root directory of some * revision or transaction in a filesystem. To refer to particular * node, you provide a root, and a directory path relative that root. * * @defgroup svn_fs_roots Filesystem roots * @{ */ /** The Filesystem Root object. */ typedef struct svn_fs_root_t svn_fs_root_t; /** Set @a *root_p to the root directory of revision @a rev in filesystem * @a fs. Allocate @a *root_p in @a pool. */ svn_error_t * svn_fs_revision_root(svn_fs_root_t **root_p, svn_fs_t *fs, svn_revnum_t rev, apr_pool_t *pool); /** Set @a *root_p to the root directory of @a txn. Allocate @a *root_p in * @a pool. */ svn_error_t * svn_fs_txn_root(svn_fs_root_t **root_p, svn_fs_txn_t *txn, apr_pool_t *pool); /** Free the root directory @a root. Simply clearing or destroying the * pool @a root was allocated in will have the same effect as calling * this function. */ void svn_fs_close_root(svn_fs_root_t *root); /** Return the filesystem to which @a root belongs. */ svn_fs_t * svn_fs_root_fs(svn_fs_root_t *root); /** Return @c TRUE iff @a root is a transaction root. */ svn_boolean_t svn_fs_is_txn_root(svn_fs_root_t *root); /** Return @c TRUE iff @a root is a revision root. */ svn_boolean_t svn_fs_is_revision_root(svn_fs_root_t *root); /** If @a root is the root of a transaction, return the name of the * transaction, allocated in @a pool; otherwise, return NULL. */ const char * svn_fs_txn_root_name(svn_fs_root_t *root, apr_pool_t *pool); /** If @a root is the root of a transaction, return the number of the * revision on which is was based when created. Otherwise, return @c * SVN_INVALID_REVNUM. * * @since New in 1.5. */ svn_revnum_t svn_fs_txn_root_base_revision(svn_fs_root_t *root); /** If @a root is the root of a revision, return the revision number. * Otherwise, return @c SVN_INVALID_REVNUM. */ svn_revnum_t svn_fs_revision_root_revision(svn_fs_root_t *root); /** @} */ /** Directory entry names and directory paths. * * Here are the rules for directory entry names, and directory paths: * * A directory entry name is a Unicode string encoded in UTF-8, and * may not contain the NULL character (U+0000). The name should be in * Unicode canonical decomposition and ordering. No directory entry * may be named '.', '..', or the empty string. Given a directory * entry name which fails to meet these requirements, a filesystem * function returns an SVN_ERR_FS_PATH_SYNTAX error. * * A directory path is a sequence of zero or more directory entry * names, separated by slash characters (U+002f), and possibly ending * with slash characters. Sequences of two or more consecutive slash * characters are treated as if they were a single slash. If a path * ends with a slash, it refers to the same node it would without the * slash, but that node must be a directory, or else the function * returns an SVN_ERR_FS_NOT_DIRECTORY error. * * A path consisting of the empty string, or a string containing only * slashes, refers to the root directory. * * @defgroup svn_fs_directories Filesystem directories * @{ */ /** The kind of change that occurred on the path. */ typedef enum { /** path modified in txn */ svn_fs_path_change_modify = 0, /** path added in txn */ svn_fs_path_change_add, /** path removed in txn */ svn_fs_path_change_delete, /** path removed and re-added in txn */ svn_fs_path_change_replace, /** ignore all previous change items for path (internal-use only) */ svn_fs_path_change_reset } svn_fs_path_change_kind_t; /** Change descriptor. * * @note Fields may be added to the end of this structure in future * versions. Therefore, to preserve binary compatibility, users * should not directly allocate structures of this type. * * @since New in 1.6. */ typedef struct svn_fs_path_change2_t { /** node revision id of changed path */ const svn_fs_id_t *node_rev_id; /** kind of change */ svn_fs_path_change_kind_t change_kind; /** were there text mods? */ svn_boolean_t text_mod; /** were there property mods? */ svn_boolean_t prop_mod; /** what node kind is the path? (Note: it is legal for this to be @c svn_node_unknown.) */ svn_node_kind_t node_kind; /** Copyfrom revision and path; this is only valid if copyfrom_known * is true. */ svn_boolean_t copyfrom_known; svn_revnum_t copyfrom_rev; const char *copyfrom_path; /* NOTE! Please update svn_fs_path_change2_create() when adding new fields here. */ } svn_fs_path_change2_t; /** Similar to @c svn_fs_path_change2_t, but without kind and copyfrom * information. * * @deprecated Provided for backwards compatibility with the 1.5 API. */ typedef struct svn_fs_path_change_t { /** node revision id of changed path */ const svn_fs_id_t *node_rev_id; /** kind of change */ svn_fs_path_change_kind_t change_kind; /** were there text mods? */ svn_boolean_t text_mod; /** were there property mods? */ svn_boolean_t prop_mod; } svn_fs_path_change_t; /** * Allocate an @c svn_fs_path_change2_t structure in @a pool, initialize and * return it. * * Set the @c node_rev_id field of the created struct to @a node_rev_id, and * @c change_kind to @a change_kind. Set all other fields to their * @c _unknown, @c NULL or invalid value, respectively. * * @since New in 1.6. */ svn_fs_path_change2_t * svn_fs_path_change2_create(const svn_fs_id_t *node_rev_id, svn_fs_path_change_kind_t change_kind, apr_pool_t *pool); /** Determine what has changed under a @a root. * * Allocate and return a hash @a *changed_paths_p containing descriptions * of the paths changed under @a root. The hash is keyed with * const char * paths, and has @c svn_fs_path_change2_t * values. * * Callers can assume that this function takes time proportional to * the amount of data output, and does not need to do tree crawls; * however, it is possible that some of the @c node_kind fields in the * @c svn_fs_path_change2_t * values will be @c svn_node_unknown or * that and some of the @c copyfrom_known fields will be FALSE. * * Use @c pool for all allocations, including the hash and its values. * * @since New in 1.6. */ svn_error_t * svn_fs_paths_changed2(apr_hash_t **changed_paths_p, svn_fs_root_t *root, apr_pool_t *pool); /** Same as svn_fs_paths_changed2(), only with @c svn_fs_path_change_t * values * in the hash (and thus no kind or copyfrom data). * * @deprecated Provided for backward compatibility with the 1.5 API. */ SVN_DEPRECATED svn_error_t * svn_fs_paths_changed(apr_hash_t **changed_paths_p, svn_fs_root_t *root, apr_pool_t *pool); /** @} */ /* Operations appropriate to all kinds of nodes. */ /** Set @a *kind_p to the type of node present at @a path under @a * root. If @a path does not exist under @a root, set @a *kind_p to @c * svn_node_none. Use @a pool for temporary allocation. */ svn_error_t * svn_fs_check_path(svn_node_kind_t *kind_p, svn_fs_root_t *root, const char *path, apr_pool_t *pool); /** An opaque node history object. */ typedef struct svn_fs_history_t svn_fs_history_t; /** Set @a *history_p to an opaque node history object which * represents @a path under @a root. @a root must be a revision root. * Use @a pool for all allocations. */ svn_error_t * svn_fs_node_history(svn_fs_history_t **history_p, svn_fs_root_t *root, const char *path, apr_pool_t *pool); /** Set @a *prev_history_p to an opaque node history object which * represents the previous (or "next oldest") interesting history * location for the filesystem node represented by @a history, or @c * NULL if no such previous history exists. If @a cross_copies is @c * FALSE, also return @c NULL if stepping backwards in history to @a * *prev_history_p would cross a filesystem copy operation. * * @note If this is the first call to svn_fs_history_prev() for the @a * history object, it could return a history object whose location is * the same as the original. This will happen if the original * location was an interesting one (where the node was modified, or * took place in a copy event). This behavior allows looping callers * to avoid the calling svn_fs_history_location() on the object * returned by svn_fs_node_history(), and instead go ahead and begin * calling svn_fs_history_prev(). * * @note This function uses node-id ancestry alone to determine * modifiedness, and therefore does NOT claim that in any of the * returned revisions file contents changed, properties changed, * directory entries lists changed, etc. * * @note The revisions returned for @a path will be older than or * the same age as the revision of that path in @a root. That is, if * @a root is a revision root based on revision X, and @a path was * modified in some revision(s) younger than X, those revisions * younger than X will not be included for @a path. */ svn_error_t * svn_fs_history_prev(svn_fs_history_t **prev_history_p, svn_fs_history_t *history, svn_boolean_t cross_copies, apr_pool_t *pool); /** Set @a *path and @a *revision to the path and revision, * respectively, of the @a history object. Use @a pool for all * allocations. */ svn_error_t * svn_fs_history_location(const char **path, svn_revnum_t *revision, svn_fs_history_t *history, apr_pool_t *pool); /** Set @a *is_dir to @c TRUE iff @a path in @a root is a directory. * Do any necessary temporary allocation in @a pool. */ svn_error_t * svn_fs_is_dir(svn_boolean_t *is_dir, svn_fs_root_t *root, const char *path, apr_pool_t *pool); /** Set @a *is_file to @c TRUE iff @a path in @a root is a file. * Do any necessary temporary allocation in @a pool. */ svn_error_t * svn_fs_is_file(svn_boolean_t *is_file, svn_fs_root_t *root, const char *path, apr_pool_t *pool); /** Get the id of a node. * * Set @a *id_p to the node revision ID of @a path in @a root, allocated in * @a pool. * * If @a root is the root of a transaction, keep in mind that other * changes to the transaction can change which node @a path refers to, * and even whether the path exists at all. */ svn_error_t * svn_fs_node_id(const svn_fs_id_t **id_p, svn_fs_root_t *root, const char *path, apr_pool_t *pool); /** Set @a *revision to the revision in which @a path under @a root was * created. Use @a pool for any temporary allocations. @a *revision will * be set to @c SVN_INVALID_REVNUM for uncommitted nodes (i.e. modified nodes * under a transaction root). Note that the root of an unmodified transaction * is not itself considered to be modified; in that case, return the revision * upon which the transaction was based. */ svn_error_t * svn_fs_node_created_rev(svn_revnum_t *revision, svn_fs_root_t *root, const char *path, apr_pool_t *pool); /** Set @a *revision to the revision in which the line of history * represented by @a path under @a root originated. Use @a pool for * any temporary allocations. If @a root is a transaction root, @a * *revision will be set to @c SVN_INVALID_REVNUM for any nodes newly * added in that transaction (brand new files or directories created * using @c svn_fs_make_dir or @c svn_fs_make_file). * * @since New in 1.5. */ svn_error_t * svn_fs_node_origin_rev(svn_revnum_t *revision, svn_fs_root_t *root, const char *path, apr_pool_t *pool); /** Set @a *created_path to the path at which @a path under @a root was * created. Use @a pool for all allocations. Callers may use this * function in conjunction with svn_fs_node_created_rev() to perform a * reverse lookup of the mapping of (path, revision) -> node-id that * svn_fs_node_id() performs. */ svn_error_t * svn_fs_node_created_path(const char **created_path, svn_fs_root_t *root, const char *path, apr_pool_t *pool); /** Set @a *value_p to the value of the property named @a propname of * @a path in @a root. If the node has no property by that name, set * @a *value_p to zero. Allocate the result in @a pool. */ svn_error_t * svn_fs_node_prop(svn_string_t **value_p, svn_fs_root_t *root, const char *path, const char *propname, apr_pool_t *pool); /** Set @a *table_p to the entire property list of @a path in @a root, * as an APR hash table allocated in @a pool. The resulting table maps * property names to pointers to @c svn_string_t objects containing the * property value. */ svn_error_t * svn_fs_node_proplist(apr_hash_t **table_p, svn_fs_root_t *root, const char *path, apr_pool_t *pool); /** Change a node's property's value, or add/delete a property. * * - @a root and @a path indicate the node whose property should change. * @a root must be the root of a transaction, not the root of a revision. * - @a name is the name of the property to change. * - @a value is the new value of the property, or zero if the property should * be removed altogether. * Do any necessary temporary allocation in @a pool. */ svn_error_t * svn_fs_change_node_prop(svn_fs_root_t *root, const char *path, const char *name, const svn_string_t *value, apr_pool_t *pool); /** Determine if the properties of two path/root combinations are different. * * Set @a *changed_p to 1 if the properties at @a path1 under @a root1 differ * from those at @a path2 under @a root2, or set it to 0 if they are the * same. Both paths must exist under their respective roots, and both * roots must be in the same filesystem. */ svn_error_t * svn_fs_props_changed(svn_boolean_t *changed_p, svn_fs_root_t *root1, const char *path1, svn_fs_root_t *root2, const char *path2, apr_pool_t *pool); /** Discover a node's copy ancestry, if any. * * If the node at @a path in @a root was copied from some other node, set * @a *rev_p and @a *path_p to the revision and path of the other node, * allocating @a *path_p in @a pool. * * Else if there is no copy ancestry for the node, set @a *rev_p to * @c SVN_INVALID_REVNUM and @a *path_p to NULL. * * If an error is returned, the values of @a *rev_p and @a *path_p are * undefined, but otherwise, if one of them is set as described above, * you may assume the other is set correspondingly. * * @a root may be a revision root or a transaction root. * * Notes: * - Copy ancestry does not descend. After copying directory D to * E, E will have copy ancestry referring to D, but E's children * may not. See also svn_fs_copy(). * * - Copy ancestry *under* a copy is preserved. That is, if you * copy /A/D/G/pi to /A/D/G/pi2, and then copy /A/D/G to /G, then * /G/pi2 will still have copy ancestry pointing to /A/D/G/pi. * We don't know if this is a feature or a bug yet; if it turns * out to be a bug, then the fix is to make svn_fs_copied_from() * observe the following logic, which currently callers may * choose to follow themselves: if node X has copy history, but * its ancestor A also has copy history, then you may ignore X's * history if X's revision-of-origin is earlier than A's -- * because that would mean that X's copy history was preserved in * a copy-under-a-copy scenario. If X's revision-of-origin is * the same as A's, then it was copied under A during the same * transaction that created A. (X's revision-of-origin cannot be * greater than A's, if X has copy history.) @todo See how * people like this, it can always be hidden behind the curtain * if necessary. * * - Copy ancestry is not stored as a regular subversion property * because it is not inherited. Copying foo to bar results in a * revision of bar with copy ancestry; but committing a text * change to bar right after that results in a new revision of * bar without copy ancestry. */ svn_error_t * svn_fs_copied_from(svn_revnum_t *rev_p, const char **path_p, svn_fs_root_t *root, const char *path, apr_pool_t *pool); /** Set @a *root_p and @a *path_p to the revision root and path of the * destination of the most recent copy event that caused @a path to * exist where it does in @a root, or to NULL if no such copy exists. * When non-NULL, allocate @a *root_p and @a *path_p in @a pool. * * @a *path_p might be a parent of @a path, rather than @a path * itself. However, it will always be the deepest relevant path. * That is, if a copy occurs underneath another copy in the same txn, * this function makes sure to set @a *path_p to the longest copy * destination path that is still a parent of or equal to @a path. * * @since New in 1.3. */ svn_error_t * svn_fs_closest_copy(svn_fs_root_t **root_p, const char **path_p, svn_fs_root_t *root, const char *path, apr_pool_t *pool); /** Retrieve mergeinfo for multiple nodes. * * @a *catalog is a catalog for @a paths. It will never be @c NULL, * but may be empty. * * @a root is revision root to use when looking up paths. * * @a paths are the paths you are requesting information for. * * @a inherit indicates whether to retrieve explicit, * explicit-or-inherited, or only inherited mergeinfo. * * If @a include_descendants is TRUE, then additionally return the * mergeinfo for any descendant of any element of @a paths which has * the @c SVN_PROP_MERGEINFO property explicitly set on it. (Note * that inheritance is only taken into account for the elements in @a * paths; descendants of the elements in @a paths which get their * mergeinfo via inheritance are not included in @a *mergeoutput.) * * Do any necessary temporary allocation in @a pool. * * @since New in 1.5. */ svn_error_t * svn_fs_get_mergeinfo(svn_mergeinfo_catalog_t *catalog, svn_fs_root_t *root, const apr_array_header_t *paths, svn_mergeinfo_inheritance_t inherit, svn_boolean_t include_descendants, apr_pool_t *pool); /** Merge changes between two nodes into a third node. * * Given nodes @a source and @a target, and a common ancestor @a ancestor, * modify @a target to contain all the changes made between @a ancestor and * @a source, as well as the changes made between @a ancestor and @a target. * @a target_root must be the root of a transaction, not a revision. * * @a source, @a target, and @a ancestor are generally directories; this * function recursively merges the directories' contents. If they are * files, this function simply returns an error whenever @a source, * @a target, and @a ancestor are all distinct node revisions. * * If there are differences between @a ancestor and @a source that conflict * with changes between @a ancestor and @a target, this function returns an * @c SVN_ERR_FS_CONFLICT error. * * If the merge is successful, @a target is left in the merged state, and * the base root of @a target's txn is set to the root node of @a source. * If an error is returned (whether for conflict or otherwise), @a target * is left unaffected. * * If @a conflict_p is non-NULL, then: a conflict error sets @a *conflict_p * to the name of the node in @a target which couldn't be merged, * otherwise, success sets @a *conflict_p to NULL. * * Do any necessary temporary allocation in @a pool. */ svn_error_t * svn_fs_merge(const char **conflict_p, svn_fs_root_t *source_root, const char *source_path, svn_fs_root_t *target_root, const char *target_path, svn_fs_root_t *ancestor_root, const char *ancestor_path, apr_pool_t *pool); /* Directories. */ /** The type of a Subversion directory entry. */ typedef struct svn_fs_dirent_t { /** The name of this directory entry. */ const char *name; /** The node revision ID it names. */ const svn_fs_id_t *id; /** The node kind. */ svn_node_kind_t kind; } svn_fs_dirent_t; /** Set @a *entries_p to a newly allocated APR hash table containing the * entries of the directory at @a path in @a root. The keys of the table * are entry names, as byte strings, excluding the final NULL * character; the table's values are pointers to @c svn_fs_dirent_t * structures. Allocate the table and its contents in @a pool. */ svn_error_t * svn_fs_dir_entries(apr_hash_t **entries_p, svn_fs_root_t *root, const char *path, apr_pool_t *pool); /** Create a new directory named @a path in @a root. The new directory has * no entries, and no properties. @a root must be the root of a transaction, * not a revision. * * Do any necessary temporary allocation in @a pool. */ svn_error_t * svn_fs_make_dir(svn_fs_root_t *root, const char *path, apr_pool_t *pool); /** Delete the node named @a path in @a root. If the node being deleted is * a directory, its contents will be deleted recursively. @a root must be * the root of a transaction, not of a revision. Use @a pool for * temporary allocation. * * This function may be more efficient than making the equivalent * series of calls to svn_fs_delete(), because it takes advantage of the * fact that, to delete an immutable subtree, shared with some * committed revision, you need only remove the directory entry. The * dumb algorithm would recurse into the subtree and end up cloning * each non-empty directory it contains, only to delete it later. * * If return @c SVN_ERR_FS_NO_SUCH_ENTRY, then the basename of @a path is * missing from its parent, that is, the final target of the deletion * is missing. * * Attempting to remove the root dir also results in an error, * @c SVN_ERR_FS_ROOT_DIR, even if the dir is empty. */ svn_error_t * svn_fs_delete(svn_fs_root_t *root, const char *path, apr_pool_t *pool); /** Create a copy of @a from_path in @a from_root named @a to_path in * @a to_root. If @a from_path in @a from_root is a directory, copy the * tree it refers to recursively. * * The copy will remember its source; use svn_fs_copied_from() to * access this information. * * @a to_root must be the root of a transaction; @a from_root must be the * root of a revision. (Requiring @a from_root to be the root of a * revision makes the implementation trivial: there is no detectable * difference (modulo node revision ID's) between copying @a from and * simply adding a reference to it. So the operation takes place in * constant time. However, there's no reason not to extend this to * mutable nodes --- it's just more code.) Further, @a to_root and @a * from_root must represent the same filesystem. * * @note To do a copy without preserving copy history, use * svn_fs_revision_link(). * * Do any necessary temporary allocation in @a pool. */ svn_error_t * svn_fs_copy(svn_fs_root_t *from_root, const char *from_path, svn_fs_root_t *to_root, const char *to_path, apr_pool_t *pool); /** Like svn_fs_copy(), but doesn't record copy history, and preserves * the PATH. You cannot use svn_fs_copied_from() later to find out * where this copy came from. * * Use svn_fs_revision_link() in situations where you don't care * about the copy history, and where @a to_path and @a from_path are * the same, because it is cheaper than svn_fs_copy(). */ svn_error_t * svn_fs_revision_link(svn_fs_root_t *from_root, svn_fs_root_t *to_root, const char *path, apr_pool_t *pool); /* Files. */ /** Set @a *length_p to the length of the file @a path in @a root, in bytes. * Do any necessary temporary allocation in @a pool. */ svn_error_t * svn_fs_file_length(svn_filesize_t *length_p, svn_fs_root_t *root, const char *path, apr_pool_t *pool); /** Set @a *checksum to the checksum of type @a kind for the file @a path. * @a *checksum will be allocated out of @a pool, which will also be used * for temporary allocations. * * If the filesystem does not have a prerecorded checksum of @a kind for * @a path, and @a force is not TRUE, do not calculate a checksum * dynamically, just put NULL into @a checksum. (By convention, the NULL * checksum is considered to match any checksum.) * * Notes: * * You might wonder, why do we only provide this interface for file * contents, and not for properties or directories? * * The answer is that property lists and directory entry lists are * essentially data structures, not text. We serialize them for * transmission, but there is no guarantee that the consumer will * parse them into the same form, or even the same order, as the * producer. It's difficult to find a checksumming method that * reaches the same result given such variation in input. (I suppose * we could calculate an independent MD5 sum for each propname and * value, and XOR them together; same with directory entry names. * Maybe that's the solution?) Anyway, for now we punt. The most * important data, and the only data that goes through svndiff * processing, is file contents, so that's what we provide * checksumming for. * * Internally, of course, the filesystem checksums everything, because * it has access to the lowest level storage forms: strings behind * representations. * * @since New in 1.6. */ svn_error_t * svn_fs_file_checksum(svn_checksum_t **checksum, svn_checksum_kind_t kind, svn_fs_root_t *root, const char *path, svn_boolean_t force, apr_pool_t *pool); /** * Same as svn_fs_file_checksum(), only always put the MD5 checksum of file * @a path into @a digest, which should point to @c APR_MD5_DIGESTSIZE bytes * of storage. If the checksum doesn't exist, put all 0's into @a digest. * * @deprecated Provided for backward compatibility with the 1.5 API. */ SVN_DEPRECATED svn_error_t * svn_fs_file_md5_checksum(unsigned char digest[], svn_fs_root_t *root, const char *path, apr_pool_t *pool); /** Set @a *contents to a readable generic stream that will yield the * contents of the file @a path in @a root. Allocate the stream in * @a pool. You can only use @a *contents for as long as the underlying * filesystem is open. If @a path is not a file, return * @c SVN_ERR_FS_NOT_FILE. * * If @a root is the root of a transaction, it is possible that the * contents of the file @a path will change between calls to * svn_fs_file_contents(). In that case, the result of reading from * @a *contents is undefined. * * ### @todo kff: I am worried about lifetime issues with this pool vs * the trail created farther down the call stack. Trace this function * to investigate... */ svn_error_t * svn_fs_file_contents(svn_stream_t **contents, svn_fs_root_t *root, const char *path, apr_pool_t *pool); /** Create a new file named @a path in @a root. The file's initial contents * are the empty string, and it has no properties. @a root must be the * root of a transaction, not a revision. * * Do any necessary temporary allocation in @a pool. */ svn_error_t * svn_fs_make_file(svn_fs_root_t *root, const char *path, apr_pool_t *pool); /** Apply a text delta to the file @a path in @a root. @a root must be the * root of a transaction, not a revision. * * Set @a *contents_p to a function ready to receive text delta windows * describing how to change the file's contents, relative to its * current contents. Set @a *contents_baton_p to a baton to pass to * @a *contents_p. * * If @a path does not exist in @a root, return an error. (You cannot use * this routine to create new files; use svn_fs_make_file() to create * an empty file first.) * * @a base_checksum is the hex MD5 digest for the base text against * which the delta is to be applied; it is ignored if NULL, and may be * ignored even if not NULL. If it is not ignored, it must match the * checksum of the base text against which svndiff data is being * applied; if not, svn_fs_apply_textdelta() or the @a *contents_p call * which detects the mismatch will return the error * @c SVN_ERR_CHECKSUM_MISMATCH (if there is no base text, there may * still be an error if @a base_checksum is neither NULL nor the * checksum of the empty string). * * @a result_checksum is the hex MD5 digest for the fulltext that * results from this delta application. It is ignored if NULL, but if * not NULL, it must match the checksum of the result; if it does not, * then the @a *contents_p call which detects the mismatch will return * the error @c SVN_ERR_CHECKSUM_MISMATCH. * * The caller must send all delta windows including the terminating * NULL window to @a *contents_p before making further changes to the * transaction. * * Do temporary allocation in @a pool. */ svn_error_t * svn_fs_apply_textdelta(svn_txdelta_window_handler_t *contents_p, void **contents_baton_p, svn_fs_root_t *root, const char *path, const char *base_checksum, const char *result_checksum, apr_pool_t *pool); /** Write data directly to the file @a path in @a root. @a root must be the * root of a transaction, not a revision. * * Set @a *contents_p to a stream ready to receive full textual data. * When the caller closes this stream, the data replaces the previous * contents of the file. The caller must write all file data and close * the stream before making further changes to the transaction. * * If @a path does not exist in @a root, return an error. (You cannot use * this routine to create new files; use svn_fs_make_file() to create * an empty file first.) * * @a result_checksum is the hex MD5 digest for the final fulltext * written to the stream. It is ignored if NULL, but if not null, it * must match the checksum of the result; if it does not, then the @a * *contents_p call which detects the mismatch will return the error * @c SVN_ERR_CHECKSUM_MISMATCH. * * Do any necessary temporary allocation in @a pool. * * ### This is like svn_fs_apply_textdelta(), but takes the text * straight. It is currently used only by the loader, see * libsvn_repos/load.c. It should accept a checksum, of course, which * would come from an (optional) header in the dump file. See * http://subversion.tigris.org/issues/show_bug.cgi?id=1102 for more. */ svn_error_t * svn_fs_apply_text(svn_stream_t **contents_p, svn_fs_root_t *root, const char *path, const char *result_checksum, apr_pool_t *pool); /** Check if the contents of two root/path combos have changed. * * Set @a *changed_p to 1 if the contents at @a path1 under @a root1 differ * from those at @a path2 under @a root2, or set it to 0 if they are the * same. Both paths must exist under their respective roots, and both * roots must be in the same filesystem. */ svn_error_t * svn_fs_contents_changed(svn_boolean_t *changed_p, svn_fs_root_t *root1, const char *path1, svn_fs_root_t *root2, const char *path2, apr_pool_t *pool); /* Filesystem revisions. */ /** Set @a *youngest_p to the number of the youngest revision in filesystem * @a fs. Use @a pool for all temporary allocation. * * The oldest revision in any filesystem is numbered zero. */ svn_error_t * svn_fs_youngest_rev(svn_revnum_t *youngest_p, svn_fs_t *fs, apr_pool_t *pool); /** Provide filesystem @a fs the opportunity to compress storage relating to * associated with @a revision in filesystem @a fs. Use @a pool for all * allocations. * * @note This can be a time-consuming process, depending the breadth * of the changes made in @a revision, and the depth of the history of * those changed paths. This may also be a no op. */ svn_error_t * svn_fs_deltify_revision(svn_fs_t *fs, svn_revnum_t revision, apr_pool_t *pool); /** Set @a *value_p to the value of the property named @a propname on * revision @a rev in the filesystem @a fs. If @a rev has no property by * that name, set @a *value_p to zero. Allocate the result in @a pool. */ svn_error_t * svn_fs_revision_prop(svn_string_t **value_p, svn_fs_t *fs, svn_revnum_t rev, const char *propname, apr_pool_t *pool); /** Set @a *table_p to the entire property list of revision @a rev in * filesystem @a fs, as an APR hash table allocated in @a pool. The table * maps char * property names to @c svn_string_t * values; the names * and values are allocated in @a pool. */ svn_error_t * svn_fs_revision_proplist(apr_hash_t **table_p, svn_fs_t *fs, svn_revnum_t rev, apr_pool_t *pool); /** Change a revision's property's value, or add/delete a property. * * - @a fs is a filesystem, and @a rev is the revision in that filesystem * whose property should change. * - @a name is the name of the property to change. * - @a value is the new value of the property, or zero if the property should * be removed altogether. * * Note that revision properties are non-historied --- you can change * them after the revision has been committed. They are not protected * via transactions. * * Do any necessary temporary allocation in @a pool. */ svn_error_t * svn_fs_change_rev_prop(svn_fs_t *fs, svn_revnum_t rev, const char *name, const svn_string_t *value, apr_pool_t *pool); /* Computing deltas. */ /** Set @a *stream_p to a pointer to a delta stream that will turn the * contents of the file @a source into the contents of the file @a target. * If @a source_root is zero, use a file with zero length as the source. * * This function does not compare the two files' properties. * * Allocate @a *stream_p, and do any necessary temporary allocation, in * @a pool. */ svn_error_t * svn_fs_get_file_delta_stream(svn_txdelta_stream_t **stream_p, svn_fs_root_t *source_root, const char *source_path, svn_fs_root_t *target_root, const char *target_path, apr_pool_t *pool); /* UUID manipulation. */ /** Populate @a *uuid with the UUID associated with @a fs. Allocate @a *uuid in @a pool. */ svn_error_t * svn_fs_get_uuid(svn_fs_t *fs, const char **uuid, apr_pool_t *pool); /** If not @c NULL, associate @a *uuid with @a fs. Otherwise (if @a * uuid is @c NULL), generate a new UUID for @a fs. Use @a pool for * any scratchwork. */ svn_error_t * svn_fs_set_uuid(svn_fs_t *fs, const char *uuid, apr_pool_t *pool); /* Non-historical properties. */ /* [[Yes, do tell.]] */ /** @defgroup svn_fs_locks Filesystem locks * @{ * @since New in 1.2. */ /** A lock represents one user's exclusive right to modify a path in a * filesystem. In order to create or destroy a lock, a username must * be associated with the filesystem's access context (see @c * svn_fs_access_t). * * When a lock is created, a 'lock-token' is returned. The lock-token * is a unique URI that represents the lock (treated as an opaque * string by the client), and is required to make further use of the * lock (including removal of the lock.) A lock-token can also be * queried to return a svn_lock_t structure that describes the details * of the lock. lock-tokens must not contain any newline character, * mainly due to the serialization for tokens for pre-commit hook. * * Locks are not secret; anyone can view existing locks in a * filesystem. Locks are not omnipotent: they can broken and stolen * by people who don't "own" the lock. (Though admins can tailor a * custom break/steal policy via libsvn_repos pre-lock hook script.) * * Locks can be created with an optional expiration date. If a lock * has an expiration date, then the act of fetching/reading it might * cause it to automatically expire, returning either nothing or an * expiration error (depending on the API). */ /** Lock @a path in @a fs, and set @a *lock to a lock * representing the new lock, allocated in @a pool. * * @warning You may prefer to use svn_repos_fs_lock() instead, * which see. * * @a fs must have a username associated with it (see @c * svn_fs_access_t), else return @c SVN_ERR_FS_NO_USER. Set the * 'owner' field in the new lock to the fs username. * * @a comment is optional: it's either an xml-escapable UTF8 string * which describes the lock, or it is @c NULL. * * @a is_dav_comment describes whether the comment was created by a * generic DAV client; only mod_dav_svn's autoversioning feature needs * to use it. If in doubt, pass 0. * * If path is already locked, then return @c SVN_ERR_FS_PATH_ALREADY_LOCKED, * unless @a steal_lock is TRUE, in which case "steal" the existing * lock, even if the FS access-context's username does not match the * current lock's owner: delete the existing lock on @a path, and * create a new one. * * @a token is a lock token such as can be generated using * svn_fs_generate_lock_token() (indicating that the caller wants to * dictate the lock token used), or it is @c NULL (indicating that the * caller wishes to have a new token generated by this function). If * @a token is not @c NULL, and represents an existing lock, then @a * path must match the path associated with that existing lock. * * If @a expiration_date is zero, then create a non-expiring lock. * Else, the lock will expire at @a expiration_date. * * If @a current_rev is a valid revnum, then do an out-of-dateness * check. If the revnum is less than the last-changed-revision of @a * path (or if @a path doesn't exist in HEAD), return @c * SVN_ERR_FS_OUT_OF_DATE. * * @note At this time, only files can be locked. */ svn_error_t * svn_fs_lock(svn_lock_t **lock, svn_fs_t *fs, const char *path, const char *token, const char *comment, svn_boolean_t is_dav_comment, apr_time_t expiration_date, svn_revnum_t current_rev, svn_boolean_t steal_lock, apr_pool_t *pool); /** Generate a unique lock-token using @a fs. Return in @a *token, * allocated in @a pool. * * This can be used in to populate lock->token before calling * svn_fs_attach_lock(). */ svn_error_t * svn_fs_generate_lock_token(const char **token, svn_fs_t *fs, apr_pool_t *pool); /** Remove the lock on @a path represented by @a token in @a fs. * * If @a token doesn't point to a lock, return @c SVN_ERR_FS_BAD_LOCK_TOKEN. * If @a token points to an expired lock, return @c SVN_ERR_FS_LOCK_EXPIRED. * If @a fs has no username associated with it, return @c SVN_ERR_FS_NO_USER * unless @a break_lock is specified. * * If @a token points to a lock, but the username of @a fs's access * context doesn't match the lock's owner, return @c * SVN_ERR_FS_LOCK_OWNER_MISMATCH. If @a break_lock is TRUE, however, don't * return error; allow the lock to be "broken" in any case. In the latter * case, @a token shall be @c NULL. * * Use @a pool for temporary allocations. */ svn_error_t * svn_fs_unlock(svn_fs_t *fs, const char *path, const char *token, svn_boolean_t break_lock, apr_pool_t *pool); /** If @a path is locked in @a fs, set @a *lock to an svn_lock_t which * represents the lock, allocated in @a pool. * * If @a path is not locked, set @a *lock to NULL. */ svn_error_t * svn_fs_get_lock(svn_lock_t **lock, svn_fs_t *fs, const char *path, apr_pool_t *pool); /** The type of a lock discovery callback function. @a baton is the * value specified in the call to svn_fs_get_locks(); the filesystem * passes it through to the callback. @a lock is a lock structure. * @a pool is a temporary subpool for use by the callback * implementation -- it is cleared after invocation of the callback. */ typedef svn_error_t *(*svn_fs_get_locks_callback_t)(void *baton, svn_lock_t *lock, apr_pool_t *pool); /** Report locks on or below @a path in @a fs using the @a * get_locks_func / @a get_locks_baton. Use @a pool for necessary * allocations. * * If the @a get_locks_func callback implementation returns an error, * lock iteration will terminate and that error will be returned by * this function. */ svn_error_t * svn_fs_get_locks(svn_fs_t *fs, const char *path, svn_fs_get_locks_callback_t get_locks_func, void *get_locks_baton, apr_pool_t *pool); /** @} */ /** * Append a textual list of all available FS modules to the stringbuf * @a output. * * @since New in 1.2. */ svn_error_t * svn_fs_print_modules(svn_stringbuf_t *output, apr_pool_t *pool); /** The kind of action being taken by 'pack'. */ typedef enum { /** packing of the shard has commenced */ svn_fs_pack_notify_start = 0, /** packing of the shard is completed */ svn_fs_pack_notify_end } svn_fs_pack_notify_action_t; /** The type of a pack notification function. @a shard is the shard being * acted upon; @a action is the type of action being performed. @a baton is * the corresponding baton for the notification function, and @a pool can * be used for temporary allocations, but will be cleared between invocations. */ typedef svn_error_t *(*svn_fs_pack_notify_t)(void *baton, apr_int64_t shard, svn_fs_pack_notify_action_t action, apr_pool_t *pool); /** * Possibly update the filesystem located in the directory @a path * to use disk space more efficiently. * * @since New in 1.6. */ svn_error_t * svn_fs_pack(const char *db_path, svn_fs_pack_notify_t notify_func, void *notify_baton, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool); /** @} */ #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* SVN_FS_H */ 0707010002c642000081a40000000000000000000000014cb50d8e00000d660000010000010036ffffffffffffffff0000003100000000root/usr/local/include/subversion-1/svn_base64.h/** * @copyright * ==================================================================== * Copyright (c) 2000-2004, 2008 CollabNet. All rights reserved. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://subversion.tigris.org/license-1.html. * If newer versions of this license are posted there, you may use a * newer version instead, at your option. * * This software consists of voluntary contributions made by many * individuals. For exact contribution history, see the revision * history and logs, available at http://subversion.tigris.org/. * ==================================================================== * @endcopyright * * @file svn_base64.h * @brief Base64 encoding and decoding functions */ #ifndef SVN_BASE64_H #define SVN_BASE64_H #include #include "svn_types.h" #include "svn_io.h" /* for svn_stream_t */ #include "svn_string.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * * * @defgroup base64 Base64 encoding/decoding functions * * @{ */ /** Return a writable generic stream which will encode binary data in * base64 format and write the encoded data to @c output. Be sure to * close the stream when done writing in order to squeeze out the last * bit of encoded data. The stream is allocated in @c pool. */ svn_stream_t * svn_base64_encode(svn_stream_t *output, apr_pool_t *pool); /** Return a writable generic stream which will decode base64-encoded * data and write the decoded data to @c output. The stream is allocated * in @c pool. */ svn_stream_t * svn_base64_decode(svn_stream_t *output, apr_pool_t *pool); /** Encode an @c svn_stringbuf_t into base64. * * A simple interface for encoding base64 data assuming we have all of * it present at once. If @a break_lines is true, newlines will be * inserted periodically; otherwise the string will only consist of * base64 encoding characters. The returned string will be allocated * from @c pool. * * @since New in 1.6. */ const svn_string_t * svn_base64_encode_string2(const svn_string_t *str, svn_boolean_t break_lines, apr_pool_t *pool); /** * Same as svn_base64_encode_string2, but with @a break_lines always * TRUE. * * @deprecated Provided for backward compatibility with the 1.5 API. */ SVN_DEPRECATED const svn_string_t * svn_base64_encode_string(const svn_string_t *str, apr_pool_t *pool); /** Decode an @c svn_stringbuf_t from base64. * * A simple interface for decoding base64 data assuming we have all of * it present at once. The returned string will be allocated from @c * pool. * */ const svn_string_t * svn_base64_decode_string(const svn_string_t *str, apr_pool_t *pool); /** Return a base64-encoded checksum for finalized @c digest. * * @c digest contains @c APR_MD5_DIGESTSIZE bytes of finalized data. * Allocate the returned checksum in @c pool. * * @deprecated Provided for backward compatibility with the 1.5 API. */ SVN_DEPRECATED svn_stringbuf_t * svn_base64_from_md5(unsigned char digest[], apr_pool_t *pool); /** @} end group: Base64 encoding/decoding functions */ #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* SVN_BASE64_H */ 0707010002c658000081a40000000000000000000000014cb50d8e0000531e0000010000010036ffffffffffffffff0000002f00000000root/usr/local/include/subversion-1/svn_path.h/** * @copyright * ==================================================================== * Copyright (c) 2000-2004 CollabNet. All rights reserved. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://subversion.tigris.org/license-1.html. * If newer versions of this license are posted there, you may use a * newer version instead, at your option. * * This software consists of voluntary contributions made by many * individuals. For exact contribution history, see the revision * history and logs, available at http://subversion.tigris.org/. * ==================================================================== * @endcopyright * * @file svn_path.h * @brief A path manipulation library * * All incoming and outgoing paths are non-NULL and in UTF-8, unless * otherwise documented. * * No result path ever ends with a separator, no matter whether the * path is a file or directory, because we always canonicalize() it. * * Nearly all the @c svn_path_xxx functions expect paths passed into * them to be in canonical form as defined by the Subversion path * library itself. The only functions which do *not* have such * expectations are: * * - @c svn_path_canonicalize() * - @c svn_path_is_canonical() * - @c svn_path_internal_style() * - @c svn_path_uri_encode() * * For the most part, we mean what most anyone would mean when talking * about canonical paths, but to be on the safe side, you must run * your paths through @c svn_path_canonicalize() before passing them to * other functions in this API. */ #ifndef SVN_PATH_H #define SVN_PATH_H #include #include #include #include "svn_types.h" #include "svn_string.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** Convert @a path from the local style to the canonical internal style. */ const char * svn_path_internal_style(const char *path, apr_pool_t *pool); /** Convert @a path from the canonical internal style to the local style. */ const char * svn_path_local_style(const char *path, apr_pool_t *pool); /** Join a base path (@a base) with a component (@a component), allocating * the result in @a pool. @a component need not be a single component: it * can be any path, absolute or relative to @a base. * * If either @a base or @a component is the empty path, then the other * argument will be copied and returned. If both are the empty path the * empty path is returned. * * If the @a component is an absolute path, then it is copied and returned. * Exactly one slash character ('/') is used to join the components, * accounting for any trailing slash in @a base. * * Note that the contents of @a base are not examined, so it is possible to * use this function for constructing URLs, or for relative URLs or * repository paths. * * This function is NOT appropriate for native (local) file * paths. Only for "internal" canonicalized paths, since it uses '/' * for the separator. Further, an absolute path (for @a component) is * based on a leading '/' character. Thus, an "absolute URI" for the * @a component won't be detected. An absolute URI can only be used * for the base. */ char * svn_path_join(const char *base, const char *component, apr_pool_t *pool); /** Join multiple components onto a @a base path, allocated in @a pool. The * components are terminated by a @c NULL. * * If any component is the empty string, it will be ignored. * * If any component is an absolute path, then it resets the base and * further components will be appended to it. * * This function does not support URLs. * * See svn_path_join() for further notes about joining paths. */ char * svn_path_join_many(apr_pool_t *pool, const char *base, ...); /** Get the basename of the specified canonicalized @a path. The * basename is defined as the last component of the path (ignoring any * trailing slashes). If the @a path is root ("/"), then that is * returned. Otherwise, the returned value will have no slashes in * it. * * Example: svn_path_basename("/foo/bar") -> "bar" * * The returned basename will be allocated in @a pool. * * @note If an empty string is passed, then an empty string will be returned. */ char * svn_path_basename(const char *path, apr_pool_t *pool); /** Get the dirname of the specified canonicalized @a path, defined as * the path with its basename removed. If @a path is root ("/"), it is * returned unchanged. * * The returned dirname will be allocated in @a pool. */ char * svn_path_dirname(const char *path, apr_pool_t *pool); /** Split @a path into a root portion and an extension such that * the root + the extension = the original path, and where the * extension contains no period (.) characters. If not @c NULL, set * @a *path_root to the root portion. If not @c NULL, set * @a *path_ext to the extension (or "" if there is no extension * found). Allocate both @a *path_root and @a *path_ext in @a pool. * * @since New in 1.5. */ void svn_path_splitext(const char **path_root, const char **path_ext, const char *path, apr_pool_t *pool); /** Return the number of components in the canonicalized @a path. * * @since New in 1.1. */ apr_size_t svn_path_component_count(const char *path); /** Add a @a component (a NULL-terminated C-string) to the * canonicalized @a path. @a component is allowed to contain * directory separators. * * If @a path is non-empty, append the appropriate directory separator * character, and then @a component. If @a path is empty, simply set it to * @a component; don't add any separator character. * * If the result ends in a separator character, then remove the separator. */ void svn_path_add_component(svn_stringbuf_t *path, const char *component); /** Remove one component off the end of the canonicalized @a path. */ void svn_path_remove_component(svn_stringbuf_t *path); /** Remove @a n components off the end of the canonicalized @a path. * Equivalent to calling svn_path_remove_component() @a n times. * * @since New in 1.1. */ void svn_path_remove_components(svn_stringbuf_t *path, apr_size_t n); /** Divide the canonicalized @a path into @a *dirpath and @a * *base_name, allocated in @a pool. * * If @a dirpath or @a base_name is NULL, then don't set that one. * * Either @a dirpath or @a base_name may be @a path's own address, but they * may not both be the same address, or the results are undefined. * * If @a path has two or more components, the separator between @a dirpath * and @a base_name is not included in either of the new names. * * examples: * -
"/foo/bar/baz"  ==>  "/foo/bar" and "baz"
* -
"/bar"          ==>  "/"  and "bar"
* -
"/"             ==>  "/"  and "/"
* -
"X:/"           ==>  "X:/" and "X:/"
* -
"bar"           ==>  ""   and "bar"
* -
""              ==>  ""   and ""
*/ void svn_path_split(const char *path, const char **dirpath, const char **base_name, apr_pool_t *pool); /** Return non-zero iff @a path is empty ("") or represents the current * directory -- that is, if prepending it as a component to an existing * path would result in no meaningful change. */ int svn_path_is_empty(const char *path); #ifndef SVN_DIRENT_URI_H /* This declaration has been moved to svn_dirent_uri.h, remains here only for compatiblity reasons. */ svn_boolean_t svn_dirent_is_root(const char *dirent, apr_size_t len); #endif /* SVN_DIRENT_URI_H */ /** Return a new path (or URL) like @a path, but transformed such that * some types of path specification redundancies are removed. * * This involves collapsing redundant "/./" elements, removing * multiple adjacent separator characters, removing trailing * separator characters, and possibly other semantically inoperative * transformations. * * Convert the scheme and hostname to lowercase (see issue #2475) * * The returned path may be statically allocated, equal to @a path, or * allocated from @a pool. */ const char * svn_path_canonicalize(const char *path, apr_pool_t *pool); /** Return @c TRUE iff path is canonical. Use @a pool for temporary * allocations. * * @since New in 1.5. */ svn_boolean_t svn_path_is_canonical(const char *path, apr_pool_t *pool); /** Return an integer greater than, equal to, or less than 0, according * as @a path1 is greater than, equal to, or less than @a path2. */ int svn_path_compare_paths(const char *path1, const char *path2); /** Return the longest common path shared by two canonicalized paths, * @a path1 and @a path2. If there's no common ancestor, return the * empty path. * * @a path1 and @a path2 may be URLs. In order for two URLs to have * a common ancestor, they must (a) have the same protocol (since two URLs * with the same path but different protocols may point at completely * different resources), and (b) share a common ancestor in their path * component, i.e. 'protocol://' is not a sufficient ancestor. */ char * svn_path_get_longest_ancestor(const char *path1, const char *path2, apr_pool_t *pool); /** Convert @a relative canonicalized path to an absolute path and * return the results in @a *pabsolute, allocated in @a pool. * * @a relative may be a URL, in which case no attempt is made to convert it, * and a copy of the URL is returned. */ svn_error_t * svn_path_get_absolute(const char **pabsolute, const char *relative, apr_pool_t *pool); /** Return the path part of the canonicalized @a path in @a * *pdirectory, and the file part in @a *pfile. If @a path is a * directory, set @a *pdirectory to @a path, and @a *pfile to the * empty string. If @a path does not exist it is treated as if it is * a file, since directories do not normally vanish. */ svn_error_t * svn_path_split_if_file(const char *path, const char **pdirectory, const char **pfile, apr_pool_t *pool); /** Find the common prefix of the canonicalized paths in @a targets * (an array of const char *'s), and remove redundant paths if @a * remove_redundancies is TRUE. * * - Set @a *pcommon to the absolute path of the path or URL common to * all of the targets. If the targets have no common prefix, or * are a mix of URLs and local paths, set @a *pcommon to the * empty string. * * - If @a pcondensed_targets is non-NULL, set @a *pcondensed_targets * to an array of targets relative to @a *pcommon, and if * @a remove_redundancies is TRUE, omit any paths/URLs that are * descendants of another path/URL in @a targets. If *pcommon * is empty, @a *pcondensed_targets will contain full URLs and/or * absolute paths; redundancies can still be removed (from both URLs * and paths). If @a pcondensed_targets is NULL, leave it alone. * * Else if there is exactly one target, then * * - Set @a *pcommon to that target, and * * - If @a pcondensed_targets is non-NULL, set @a *pcondensed_targets * to an array containing zero elements. Else if * @a pcondensed_targets is NULL, leave it alone. * * If there are no items in @a targets, set @a *pcommon and (if * applicable) @a *pcondensed_targets to @c NULL. * * @note There is no guarantee that @a *pcommon is within a working * copy. */ svn_error_t * svn_path_condense_targets(const char **pcommon, apr_array_header_t **pcondensed_targets, const apr_array_header_t *targets, svn_boolean_t remove_redundancies, apr_pool_t *pool); /** Copy a list of canonicalized @a targets, one at a time, into @a * pcondensed_targets, omitting any targets that are found earlier in * the list, or whose ancestor is found earlier in the list. Ordering * of targets in the original list is preserved in the condensed list * of targets. Use @a pool for any allocations. * * How does this differ in functionality from svn_path_condense_targets()? * * Here's the short version: * * 1. Disclaimer: if you wish to debate the following, talk to Karl. :-) * Order matters for updates because a multi-arg update is not * atomic, and CVS users are used to, when doing 'cvs up targetA * targetB' seeing targetA get updated, then targetB. I think the * idea is that if you're in a time-sensitive or flaky-network * situation, a user can say, "I really *need* to update * wc/A/D/G/tau, but I might as well update my whole working copy if * I can." So that user will do 'svn up wc/A/D/G/tau wc', and if * something dies in the middles of the 'wc' update, at least the * user has 'tau' up-to-date. * * 2. Also, we have this notion of an anchor and a target for updates * (the anchor is where the update editor is rooted, the target is * the actual thing we want to update). I needed a function that * would NOT screw with my input paths so that I could tell the * difference between someone being in A/D and saying 'svn up G' and * being in A/D/G and saying 'svn up .' -- believe it or not, these * two things don't mean the same thing. svn_path_condense_targets() * plays with absolute paths (which is fine, so does * svn_path_remove_redundancies()), but the difference is that it * actually tweaks those targets to be relative to the "grandfather * path" common to all the targets. Updates don't require a * "grandfather path" at all, and even if it did, the whole * conversion to an absolute path drops the crucial difference * between saying "i'm in foo, update bar" and "i'm in foo/bar, * update '.'" */ svn_error_t * svn_path_remove_redundancies(apr_array_header_t **pcondensed_targets, const apr_array_header_t *targets, apr_pool_t *pool); /** Decompose the canonicalized @a path into an array of const * char * components, allocated in @a pool. If @a path is * absolute, the first component will be a lone dir separator (the * root directory). */ apr_array_header_t * svn_path_decompose(const char *path, apr_pool_t *pool); /** Join an array of const char * components into a '/' * separated path, allocated in @a pool. The joined path is absolute if * the first component is a lone dir separator. * * Calling svn_path_compose() on the output of svn_path_decompose() * will return the exact same path. * * @since New in 1.5. */ const char * svn_path_compose(const apr_array_header_t *components, apr_pool_t *pool); /** Test that @a name is a single path component, that is: * - not @c NULL or empty. * - not a `/'-separated directory path * - not empty or `..' */ svn_boolean_t svn_path_is_single_path_component(const char *name); /** * Test to see if a backpath, i.e. '..', is present in @a path. * If not, return @c FALSE. * If so, return @c TRUE. * * @since New in 1.1. */ svn_boolean_t svn_path_is_backpath_present(const char *path); /** * Test to see if a dotpath, i.e. '.', is present in @a path. * If not, return @c FALSE. * If so, return @c TRUE. * * @since New in 1.6. */ svn_boolean_t svn_path_is_dotpath_present(const char *path); /** Test if @a path2 is a child of @a path1. * If not, return @c NULL. * If so, return a copy of the remainder path, allocated in @a pool. * (The remainder is the component which, added to @a path1, yields * @a path2. The remainder does not begin with a dir separator.) * * Both paths must be in canonical form, and must either be absolute, * or contain no ".." components. * * If @a path2 is the same as @a path1, it is not considered a child, so the * result is @c NULL; an empty string is never returned. * * @note In 1.5 this function has been extended to allow a @c NULL @a pool * in which case a pointer into @a path2 will be returned to * identify the remainder path. * * ### @todo the ".." restriction is unfortunate, and would ideally * be lifted by making the implementation smarter. But this is not * trivial: if the path is "../foo", how do you know whether or not * the current directory is named "foo" in its parent? */ const char * svn_path_is_child(const char *path1, const char *path2, apr_pool_t *pool); /** Return TRUE if @a path1 is an ancestor of @a path2 or the paths are equal * and FALSE otherwise. * * @since New in 1.3. */ svn_boolean_t svn_path_is_ancestor(const char *path1, const char *path2); /** * Check whether @a path is a valid Subversion path. * * A valid Subversion pathname is a UTF-8 string without control * characters. "Valid" means Subversion can store the pathname in * a repository. There may be other, OS-specific, limitations on * what paths can be represented in a working copy. * * ASSUMPTION: @a path is a valid UTF-8 string. This function does * not check UTF-8 validity. * * Return @c SVN_NO_ERROR if valid and @c SVN_ERR_FS_PATH_SYNTAX if * invalid. * * @note Despite returning an @c SVN_ERR_FS_* error, this function has * nothing to do with the versioned filesystem's concept of validity. * * @since New in 1.2. */ svn_error_t * svn_path_check_valid(const char *path, apr_pool_t *pool); /** URI/URL stuff * * @defgroup svn_path_uri_stuff URI/URL conversion * @{ */ /** Return TRUE iff @a path looks like a valid absolute URL. */ svn_boolean_t svn_path_is_url(const char *path); /** Return @c TRUE iff @a path is URI-safe, @c FALSE otherwise. */ svn_boolean_t svn_path_is_uri_safe(const char *path); /** Return a URI-encoded copy of @a path, allocated in @a pool. (@a path can be an arbitrary UTF-8 string and does not have to be a canonical path.) */ const char * svn_path_uri_encode(const char *path, apr_pool_t *pool); /** Return a URI-decoded copy of @a path, allocated in @a pool. */ const char * svn_path_uri_decode(const char *path, apr_pool_t *pool); /** Extend @a url by @a component, URI-encoding that @a component * before adding it to the @a url; return the new @a url, allocated in * @a pool. If @a component is @c NULL, just return a copy of @a url, * allocated in @a pool. * * @a component need not be a single path segment, but if it contains * multiple segments, they must be separated by '/'. @a component * should not begin with '/', however; if it does, the behavior is * undefined. * * @a url must be in canonical format; it may not have a trailing '/'. * * @note To add a component that is already URI-encoded, use * svn_path_join(url, component, pool) instead. * * @note gstein suggests this for when @a component begins with '/': * * "replace the path entirely * https://example.com:4444/base/path joined with /leading/slash, * should return: https://example.com:4444/leading/slash * per the RFCs on combining URIs" * * We may implement that someday, which is why leading '/' is * merely undefined right now. * * @since New in 1.6. */ const char * svn_path_url_add_component2(const char *url, const char *component, apr_pool_t *pool); /** Like svn_path_url_add_component2, but allows path components that * end with a trailing '/' * * @deprecated Provided for backward compatibility with the 1.5 API. */ SVN_DEPRECATED const char * svn_path_url_add_component(const char *url, const char *component, apr_pool_t *pool); /** * Convert @a iri (Internationalized URI) to an URI. * The return value may be the same as @a iri if it was already * a URI. Else, allocate the return value in @a pool. * * @since New in 1.1. */ const char * svn_path_uri_from_iri(const char *iri, apr_pool_t *pool); /** * URI-encode certain characters in @a uri that are not valid in an URI, but * doesn't have any special meaning in @a uri at their positions. If no * characters need escaping, just return @a uri. * * @note Currently, this function escapes <, >, ", space, {, }, |, \, ^, and `. * This may be extended in the future to do context-dependent escaping. * * @since New in 1.1. */ const char * svn_path_uri_autoescape(const char *uri, apr_pool_t *pool); /** @} */ /** Charset conversion stuff * * @defgroup svn_path_charset_stuff Charset conversion * @{ */ /** Convert @a path_utf8 from UTF-8 to the internal encoding used by APR. */ svn_error_t * svn_path_cstring_from_utf8(const char **path_apr, const char *path_utf8, apr_pool_t *pool); /** Convert @a path_apr from the internal encoding used by APR to UTF-8. */ svn_error_t * svn_path_cstring_to_utf8(const char **path_utf8, const char *path_apr, apr_pool_t *pool); /** @} */ #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* SVN_PATH_H */ 0707010002c65e000081a40000000000000000000000014cb50d8e00018db50000010000010036ffffffffffffffff0000003000000000root/usr/local/include/subversion-1/svn_repos.h/** * @copyright * ==================================================================== * Copyright (c) 2000-2008 CollabNet. All rights reserved. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://subversion.tigris.org/license-1.html. * If newer versions of this license are posted there, you may use a * newer version instead, at your option. * * This software consists of voluntary contributions made by many * individuals. For exact contribution history, see the revision * history and logs, available at http://subversion.tigris.org/. * ==================================================================== * @endcopyright * * @file svn_repos.h * @brief Tools built on top of the filesystem. */ #ifndef SVN_REPOS_H #define SVN_REPOS_H #include #include #include #include #include "svn_types.h" #include "svn_string.h" #include "svn_delta.h" #include "svn_fs.h" #include "svn_io.h" #include "svn_version.h" #include "svn_mergeinfo.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /* ---------------------------------------------------------------*/ /** * Get libsvn_repos version information. * * @since New in 1.1. */ const svn_version_t * svn_repos_version(void); /** Callback type for checking authorization on paths produced by (at * least) svn_repos_dir_delta2(). * * Set @a *allowed to TRUE to indicate that some operation is * authorized for @a path in @a root, or set it to FALSE to indicate * unauthorized (presumably according to state stored in @a baton). * * Do not assume @a pool has any lifetime beyond this call. * * The exact operation being authorized depends on the callback * implementation. For read authorization, for example, the caller * would implement an instance that does read checking, and pass it as * a parameter named [perhaps] 'authz_read_func'. The receiver of * that parameter might also take another parameter named * 'authz_write_func', which although sharing this type, would be a * different implementation. * * @note If someday we want more sophisticated authorization states * than just yes/no, @a allowed can become an enum type. */ typedef svn_error_t *(*svn_repos_authz_func_t)(svn_boolean_t *allowed, svn_fs_root_t *root, const char *path, void *baton, apr_pool_t *pool); /** An enum defining the kinds of access authz looks up. * * @since New in 1.3. */ typedef enum { /** No access. */ svn_authz_none = 0, /** Path can be read. */ svn_authz_read = 1, /** Path can be altered. */ svn_authz_write = 2, /** The other access credentials are recursive. */ svn_authz_recursive = 4 } svn_repos_authz_access_t; /** Callback type for checking authorization on paths produced by * the repository commit editor. * * Set @a *allowed to TRUE to indicate that the @a required access on * @a path in @a root is authorized, or set it to FALSE to indicate * unauthorized (presumable according to state stored in @a baton). * * If @a path is NULL, the callback should perform a global authz * lookup for the @a required access. That is, the lookup should * check if the @a required access is granted for at least one path of * the repository, and set @a *allowed to TRUE if so. @a root may * also be NULL if @a path is NULL. * * This callback is very similar to svn_repos_authz_func_t, with the * exception of the addition of the @a required parameter. * This is due to historical reasons: when authz was first implemented * for svn_repos_dir_delta2(), it seemed there would need only checks * for read and write operations, hence the svn_repos_authz_func_t * callback prototype and usage scenario. But it was then realized * that lookups due to copying needed to be recursive, and that * brute-force recursive lookups didn't square with the O(1) * performances a copy operation should have. * * So a special way to ask for a recursive lookup was introduced. The * commit editor needs this capability to retain acceptable * performance. Instead of revving the existing callback, causing * unnecessary revving of functions that don't actually need the * extended functionality, this second, more complete callback was * introduced, for use by the commit editor. * * Some day, it would be nice to reunite these two callbacks and do * the necessary revving anyway, but for the time being, this dual * callback mechanism will do. */ typedef svn_error_t *(*svn_repos_authz_callback_t) (svn_repos_authz_access_t required, svn_boolean_t *allowed, svn_fs_root_t *root, const char *path, void *baton, apr_pool_t *pool); /** * Similar to @c svn_file_rev_handler_t, but without the @a * result_of_merge parameter. * * @deprecated Provided for backward compatibility with 1.4 API. * @since New in 1.1. */ typedef svn_error_t *(*svn_repos_file_rev_handler_t) (void *baton, const char *path, svn_revnum_t rev, apr_hash_t *rev_props, svn_txdelta_window_handler_t *delta_handler, void **delta_baton, apr_array_header_t *prop_diffs, apr_pool_t *pool); /** The repository object. */ typedef struct svn_repos_t svn_repos_t; /* Opening and creating repositories. */ /** Find the root path of the repository that contains @a path. * * If a repository was found, the path to the root of the repository * is returned, else @c NULL. The pointer to the returned path may be * equal to @a path. */ const char * svn_repos_find_root_path(const char *path, apr_pool_t *pool); /** Set @a *repos_p to a repository object for the repository at @a path. * * Allocate @a *repos_p in @a pool. * * Acquires a shared lock on the repository, and attaches a cleanup * function to @a pool to remove the lock. If no lock can be acquired, * returns error, with undefined effect on @a *repos_p. If an exclusive * lock is present, this blocks until it's gone. */ svn_error_t * svn_repos_open(svn_repos_t **repos_p, const char *path, apr_pool_t *pool); /** Create a new Subversion repository at @a path, building the necessary * directory structure, creating the filesystem, and so on. * Return the repository object in @a *repos_p, allocated in @a pool. * * @a config is a client configuration hash of @c svn_config_t * items * keyed on config category names, and may be NULL. * * @a fs_config is passed to the filesystem, and may be NULL. * * @a unused_1 and @a unused_2 are not used and should be NULL. */ svn_error_t * svn_repos_create(svn_repos_t **repos_p, const char *path, const char *unused_1, const char *unused_2, apr_hash_t *config, apr_hash_t *fs_config, apr_pool_t *pool); /** * Upgrade the Subversion repository (and its underlying versioned * filesystem) located in the directory @a path to the latest version * supported by this library. If the requested upgrade is not * supported due to the current state of the repository or it * underlying filesystem, return @c SVN_ERR_REPOS_UNSUPPORTED_UPGRADE * or @c SVN_ERR_FS_UNSUPPORTED_UPGRADE (respectively) and make no * changes to the repository or filesystem. * * Acquires an exclusive lock on the repository, upgrades the * repository, and releases the lock. If an exclusive lock can't be * acquired, returns error. * * If @a nonblocking is TRUE, an error of type EWOULDBLOCK is * returned if the lock is not immediately available. * * If @a start_callback is not NULL, it will be called with @a * start_callback_baton as argument before the upgrade starts, but * after the exclusive lock has been acquired. * * Use @a pool for necessary allocations. * * @note This functionality is provided as a convenience for * administrators wishing to make use of new Subversion functionality * without a potentially costly full repository dump/load. As such, * the operation performs only the minimum amount of work needed to * accomplish this while maintaining the integrity of the repository. * It does *not* guarantee the most optimized repository state as a * dump and subsequent load would. * * @since New in 1.5. */ svn_error_t * svn_repos_upgrade(const char *path, svn_boolean_t nonblocking, svn_error_t *(*start_callback)(void *baton), void *start_callback_baton, apr_pool_t *pool); /** Destroy the Subversion repository found at @a path, using @a pool for any * necessary allocations. */ svn_error_t * svn_repos_delete(const char *path, apr_pool_t *pool); /** * Set @a *has to TRUE if @a repos has @a capability (one of the * capabilities beginning with @c "SVN_REPOS_CAPABILITY_"), else set * @a *has to FALSE. * * If @a capability isn't recognized, throw @c SVN_ERR_UNKNOWN_CAPABILITY, * with the effect on @a *has undefined. * * Use @a pool for all allocation. * * @since New in 1.5. */ svn_error_t * svn_repos_has_capability(svn_repos_t *repos, svn_boolean_t *has, const char *capability, apr_pool_t *pool); /** * The capability of doing the right thing with merge-tracking * information, both storing it and responding to queries about it. * * @since New in 1.5. */ #define SVN_REPOS_CAPABILITY_MERGEINFO "mergeinfo" /* *** PLEASE READ THIS IF YOU ADD A NEW CAPABILITY *** * * @c SVN_REPOS_CAPABILITY_foo strings should not include colons, to * be consistent with @c SVN_RA_CAPABILITY_foo strings, which forbid * colons for their own reasons. While this RA limitation has no * direct impact on repository capabilities, there's no reason to be * gratuitously different either. */ /** Return the filesystem associated with repository object @a repos. */ svn_fs_t * svn_repos_fs(svn_repos_t *repos); /** Make a hot copy of the Subversion repository found at @a src_path * to @a dst_path. * * Copy a possibly live Subversion repository from @a src_path to * @a dst_path. If @a clean_logs is @c TRUE, perform cleanup on the * source filesystem as part of the copy operation; currently, this * means deleting copied, unused logfiles for a Berkeley DB source * repository. */ svn_error_t * svn_repos_hotcopy(const char *src_path, const char *dst_path, svn_boolean_t clean_logs, apr_pool_t *pool); /** * Possibly update the repository, @a repos, to use a more efficient * filesystem representation. Use @a pool for allocations. * * @since New in 1.6. */ svn_error_t * svn_repos_fs_pack(svn_repos_t *repos, svn_fs_pack_notify_t notify_func, void *notify_baton, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool); /** * Run database recovery procedures on the repository at @a path, * returning the database to a consistent state. Use @a pool for all * allocation. * * Acquires an exclusive lock on the repository, recovers the * database, and releases the lock. If an exclusive lock can't be * acquired, returns error. * * If @a nonblocking is TRUE, an error of type EWOULDBLOCK is * returned if the lock is not immediately available. * * If @a start_callback is not NULL, it will be called with @a * start_callback_baton as argument before the recovery starts, but * after the exclusive lock has been acquired. * * If @a cancel_func is not @c NULL, it is called periodically with * @a cancel_baton as argument to see if the client wishes to cancel * the recovery. * * @note On some platforms the exclusive lock does not exclude other * threads in the same process so this function should only be called * by a single threaded process, or by a multi-threaded process when * no other threads are accessing the repository. * * @since New in 1.5. */ svn_error_t * svn_repos_recover3(const char *path, svn_boolean_t nonblocking, svn_error_t *(*start_callback)(void *baton), void *start_callback_baton, svn_cancel_func_t cancel_func, void * cancel_baton, apr_pool_t *pool); /** * Similar to svn_repos_recover3(), but without cancellation support. * * @deprecated Provided for backward compatibility with the 1.4 API. */ SVN_DEPRECATED svn_error_t * svn_repos_recover2(const char *path, svn_boolean_t nonblocking, svn_error_t *(*start_callback)(void *baton), void *start_callback_baton, apr_pool_t *pool); /** * Similar to svn_repos_recover2(), but with nonblocking set to FALSE, and * with no callbacks provided. * * @deprecated Provided for backward compatibility with the 1.0 API. */ SVN_DEPRECATED svn_error_t * svn_repos_recover(const char *path, apr_pool_t *pool); /** This function is a wrapper around svn_fs_berkeley_logfiles(), * returning log file paths relative to the root of the repository. * * @copydoc svn_fs_berkeley_logfiles() */ svn_error_t * svn_repos_db_logfiles(apr_array_header_t **logfiles, const char *path, svn_boolean_t only_unused, apr_pool_t *pool); /* Repository Paths */ /** Return the top-level repository path allocated in @a pool. */ const char * svn_repos_path(svn_repos_t *repos, apr_pool_t *pool); /** Return the path to @a repos's filesystem directory, allocated in * @a pool. */ const char * svn_repos_db_env(svn_repos_t *repos, apr_pool_t *pool); /** Return path to @a repos's config directory, allocated in @a pool. */ const char * svn_repos_conf_dir(svn_repos_t *repos, apr_pool_t *pool); /** Return path to @a repos's svnserve.conf, allocated in @a pool. */ const char * svn_repos_svnserve_conf(svn_repos_t *repos, apr_pool_t *pool); /** Return path to @a repos's lock directory, allocated in @a pool. */ const char * svn_repos_lock_dir(svn_repos_t *repos, apr_pool_t *pool); /** Return path to @a repos's db lockfile, allocated in @a pool. */ const char * svn_repos_db_lockfile(svn_repos_t *repos, apr_pool_t *pool); /** Return path to @a repos's db logs lockfile, allocated in @a pool. */ const char * svn_repos_db_logs_lockfile(svn_repos_t *repos, apr_pool_t *pool); /** Return the path to @a repos's hook directory, allocated in @a pool. */ const char * svn_repos_hook_dir(svn_repos_t *repos, apr_pool_t *pool); /** Return the path to @a repos's start-commit hook, allocated in @a pool. */ const char * svn_repos_start_commit_hook(svn_repos_t *repos, apr_pool_t *pool); /** Return the path to @a repos's pre-commit hook, allocated in @a pool. */ const char * svn_repos_pre_commit_hook(svn_repos_t *repos, apr_pool_t *pool); /** Return the path to @a repos's post-commit hook, allocated in @a pool. */ const char * svn_repos_post_commit_hook(svn_repos_t *repos, apr_pool_t *pool); /** Return the path to @a repos's pre-revprop-change hook, allocated in * @a pool. */ const char * svn_repos_pre_revprop_change_hook(svn_repos_t *repos, apr_pool_t *pool); /** Return the path to @a repos's post-revprop-change hook, allocated in * @a pool. */ const char * svn_repos_post_revprop_change_hook(svn_repos_t *repos, apr_pool_t *pool); /** @defgroup svn_repos_lock_hooks Paths to lock hooks * @{ * @since New in 1.2. */ /** Return the path to @a repos's pre-lock hook, allocated in @a pool. */ const char * svn_repos_pre_lock_hook(svn_repos_t *repos, apr_pool_t *pool); /** Return the path to @a repos's post-lock hook, allocated in @a pool. */ const char * svn_repos_post_lock_hook(svn_repos_t *repos, apr_pool_t *pool); /** Return the path to @a repos's pre-unlock hook, allocated in @a pool. */ const char * svn_repos_pre_unlock_hook(svn_repos_t *repos, apr_pool_t *pool); /** Return the path to @a repos's post-unlock hook, allocated in @a pool. */ const char * svn_repos_post_unlock_hook(svn_repos_t *repos, apr_pool_t *pool); /** @} */ /* ---------------------------------------------------------------*/ /* Reporting the state of a working copy, for updates. */ /** * Construct and return a @a report_baton that will be passed to the * other functions in this section to describe the state of a pre-existing * tree (typically, a working copy). When the report is finished, * @a editor/@a edit_baton will be driven in such a way as to transform the * existing tree to @a revnum and, if @a tgt_path is non-NULL, switch the * reported hierarchy to @a tgt_path. * * @a fs_base is the absolute path of the node in the filesystem at which * the comparison should be rooted. @a target is a single path component, * used to limit the scope of the report to a single entry of @a fs_base, * or "" if all of @a fs_base itself is the main subject of the report. * * @a tgt_path and @a revnum is the fs path/revision pair that is the * "target" of the delta. @a tgt_path should be provided only when * the source and target paths of the report differ. That is, @a tgt_path * should *only* be specified when specifying that the resultant editor * drive be one that transforms the reported hierarchy into a pristine tree * of @a tgt_path at revision @a revnum. A @c NULL value for @a tgt_path * will indicate that the editor should be driven in such a way as to * transform the reported hierarchy to revision @a revnum, preserving the * reported hierarchy. * * @a text_deltas instructs the driver of the @a editor to enable * the generation of text deltas. * * @a ignore_ancestry instructs the driver to ignore node ancestry * when determining how to transmit differences. * * @a send_copyfrom_args instructs the driver to send 'copyfrom' * arguments to the editor's add_file() and add_directory() methods, * whenever it deems feasible. * * The @a authz_read_func and @a authz_read_baton are passed along to * svn_repos_dir_delta2(); see that function for how they are used. * * All allocation for the context and collected state will occur in * @a pool. * * @a depth is the requested depth of the editor drive. * * If @a depth is @c svn_depth_unknown, the editor will affect only the * paths reported by the individual calls to @c svn_repos_set_path3 and * @c svn_repos_link_path3. * * For example, if the reported tree is the @c A subdir of the Greek Tree * (see Subversion's test suite), at depth @c svn_depth_empty, but the * @c A/B subdir is reported at depth @c svn_depth_infinity, then * repository-side changes to @c A/mu, or underneath @c A/C and @c * A/D, would not be reflected in the editor drive, but changes * underneath @c A/B would be. * * Additionally, the editor driver will call @c add_directory and * and @c add_file for directories with an appropriate depth. For * example, a directory reported at @c svn_depth_files will receive * file (but not directory) additions. A directory at @c svn_depth_empty * will receive neither. * * If @a depth is @c svn_depth_files, @c svn_depth_immediates or * @c svn_depth_infinity and @a depth is greater than the reported depth * of the working copy, then the editor driver will emit editor * operations so as to upgrade the working copy to this depth. * * If @a depth is @c svn_depth_empty, @c svn_depth_files, * @c svn_depth_immediates and @a depth is lower * than or equal to the depth of the working copy, then the editor * operations will affect only paths at or above @a depth. * * @since New in 1.5. */ svn_error_t * svn_repos_begin_report2(void **report_baton, svn_revnum_t revnum, svn_repos_t *repos, const char *fs_base, const char *target, const char *tgt_path, svn_boolean_t text_deltas, svn_depth_t depth, svn_boolean_t ignore_ancestry, svn_boolean_t send_copyfrom_args, const svn_delta_editor_t *editor, void *edit_baton, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, apr_pool_t *pool); /** * The same as svn_repos_begin_report2(), but taking a boolean * @a recurse flag, and sending FALSE for @a send_copyfrom_args. * * If @a recurse is TRUE, the editor driver will drive the editor with * a depth of @c svn_depth_infinity; if FALSE, then with a depth of * @c svn_depth_files. * * @note @a username is ignored, and has been removed in a revised * version of this API. * * @deprecated Provided for backward compatibility with the 1.4 API. */ SVN_DEPRECATED svn_error_t * svn_repos_begin_report(void **report_baton, svn_revnum_t revnum, const char *username, svn_repos_t *repos, const char *fs_base, const char *target, const char *tgt_path, svn_boolean_t text_deltas, svn_boolean_t recurse, svn_boolean_t ignore_ancestry, const svn_delta_editor_t *editor, void *edit_baton, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, apr_pool_t *pool); /** * Given a @a report_baton constructed by svn_repos_begin_report2(), * record the presence of @a path, at @a revision with depth @a depth, * in the current tree. * * @a path is relative to the anchor/target used in the creation of the * @a report_baton. * * @a revision may be SVN_INVALID_REVNUM if (for example) @a path * represents a locally-added path with no revision number, or @a * depth is @c svn_depth_exclude. * * @a path may not be underneath a path on which svn_repos_set_path3() * was previously called with @c svn_depth_exclude in this report. * * The first call of this in a given report usually passes an empty * @a path; this is used to set up the correct root revision for the editor * drive. * * A depth of @c svn_depth_unknown is not allowed, and results in an * error. * * If @a start_empty is TRUE and @a path is a directory, then require the * caller to explicitly provide all the children of @a path - do not assume * that the tree also contains all the children of @a path at @a revision. * This is for 'low confidence' client reporting. * * If the caller has a lock token for @a path, then @a lock_token should * be set to that token. Else, @a lock_token should be NULL. * * All temporary allocations are done in @a pool. * * @since New in 1.5. */ svn_error_t * svn_repos_set_path3(void *report_baton, const char *path, svn_revnum_t revision, svn_depth_t depth, svn_boolean_t start_empty, const char *lock_token, apr_pool_t *pool); /** * Similar to svn_repos_set_path3(), but with @a depth set to * @c svn_depth_infinity. * * @deprecated Provided for backward compatibility with the 1.4 API. */ SVN_DEPRECATED svn_error_t * svn_repos_set_path2(void *report_baton, const char *path, svn_revnum_t revision, svn_boolean_t start_empty, const char *lock_token, apr_pool_t *pool); /** * Similar to svn_repos_set_path2(), but with @a lock_token set to @c NULL. * * @deprecated Provided for backward compatibility with the 1.1 API. */ SVN_DEPRECATED svn_error_t * svn_repos_set_path(void *report_baton, const char *path, svn_revnum_t revision, svn_boolean_t start_empty, apr_pool_t *pool); /** * Given a @a report_baton constructed by svn_repos_begin_report2(), * record the presence of @a path in the current tree, containing the contents * of @a link_path at @a revision with depth @a depth. * * A depth of @c svn_depth_unknown is not allowed, and results in an * error. * * @a path may not be underneath a path on which svn_repos_set_path3() * was previously called with @c svn_depth_exclude in this report. * * Note that while @a path is relative to the anchor/target used in the * creation of the @a report_baton, @a link_path is an absolute filesystem * path! * * If @a start_empty is TRUE and @a path is a directory, then require the * caller to explicitly provide all the children of @a path - do not assume * that the tree also contains all the children of @a link_path at * @a revision. This is for 'low confidence' client reporting. * * If the caller has a lock token for @a link_path, then @a lock_token * should be set to that token. Else, @a lock_token should be NULL. * * All temporary allocations are done in @a pool. * * @since New in 1.5. */ svn_error_t * svn_repos_link_path3(void *report_baton, const char *path, const char *link_path, svn_revnum_t revision, svn_depth_t depth, svn_boolean_t start_empty, const char *lock_token, apr_pool_t *pool); /** * Similar to svn_repos_link_path3(), but with @a depth set to * @c svn_depth_infinity. * * @deprecated Provided for backward compatibility with the 1.4 API. */ SVN_DEPRECATED svn_error_t * svn_repos_link_path2(void *report_baton, const char *path, const char *link_path, svn_revnum_t revision, svn_boolean_t start_empty, const char *lock_token, apr_pool_t *pool); /** * Similar to svn_repos_link_path2(), but with @a lock_token set to @c NULL. * * @deprecated Provided for backward compatibility with the 1.1 API. */ SVN_DEPRECATED svn_error_t * svn_repos_link_path(void *report_baton, const char *path, const char *link_path, svn_revnum_t revision, svn_boolean_t start_empty, apr_pool_t *pool); /** Given a @a report_baton constructed by svn_repos_begin_report2(), * record the non-existence of @a path in the current tree. * * @a path may not be underneath a path on which svn_repos_set_path3() * was previously called with @c svn_depth_exclude in this report. * * (This allows the reporter's driver to describe missing pieces of a * working copy, so that 'svn up' can recreate them.) * * All temporary allocations are done in @a pool. */ svn_error_t * svn_repos_delete_path(void *report_baton, const char *path, apr_pool_t *pool); /** Given a @a report_baton constructed by svn_repos_begin_report2(), * finish the report and drive the editor as specified when the report * baton was constructed. * * If an error occurs during the driving of the editor, do NOT abort the * edit; that responsibility belongs to the caller of this function, if * it happens at all. * * After the call to this function, @a report_baton is no longer valid; * it should not be passed to any other reporting functions, including * svn_repos_abort_report(). */ svn_error_t * svn_repos_finish_report(void *report_baton, apr_pool_t *pool); /** Given a @a report_baton constructed by svn_repos_begin_report2(), * abort the report. This function can be called anytime before * svn_repos_finish_report() is called. * * After the call to this function, @a report_baton is no longer valid; * it should not be passed to any other reporting functions. */ svn_error_t * svn_repos_abort_report(void *report_baton, apr_pool_t *pool); /* ---------------------------------------------------------------*/ /* The magical dir_delta update routines. */ /** Use the provided @a editor and @a edit_baton to describe the changes * necessary for making a given node (and its descendants, if it is a * directory) under @a src_root look exactly like @a tgt_path under * @a tgt_root. @a src_entry is the node to update. If @a src_entry * is empty, then compute the difference between the entire tree * anchored at @a src_parent_dir under @a src_root and @a tgt_path * under @a tgt_root. Else, describe the changes needed to update * only that entry in @a src_parent_dir. Typically, callers of this * function will use a @a tgt_path that is the concatenation of @a * src_parent_dir and @a src_entry. * * @a src_root and @a tgt_root can both be either revision or transaction * roots. If @a tgt_root is a revision, @a editor's set_target_revision() * will be called with the @a tgt_root's revision number, else it will * not be called at all. * * If @a authz_read_func is non-NULL, invoke it before any call to * * @a editor->open_root * @a editor->add_directory * @a editor->open_directory * @a editor->add_file * @a editor->open_file * * passing @a tgt_root, the same path that would be passed to the * editor function in question, and @a authz_read_baton. If the * @a *allowed parameter comes back TRUE, then proceed with the planned * editor call; else if FALSE, then invoke @a editor->absent_file or * @a editor->absent_directory as appropriate, except if the planned * editor call was open_root, throw SVN_ERR_AUTHZ_ROOT_UNREADABLE. * * If @a text_deltas is @c FALSE, send a single @c NULL txdelta window to * the window handler returned by @a editor->apply_textdelta(). * * If @a depth is @c svn_depth_empty, invoke @a editor calls only on * @a src_entry (or @a src_parent_dir, if @a src_entry is empty). * If @a depth is @c svn_depth_files, also invoke the editor on file * children, if any; if @c svn_depth_immediates, invoke it on * immediate subdirectories as well as files; if @c svn_depth_infinity, * recurse fully. * * If @a entry_props is @c TRUE, accompany each opened/added entry with * propchange editor calls that relay special "entry props" (this * is typically used only for working copy updates). * * @a ignore_ancestry instructs the function to ignore node ancestry * when determining how to transmit differences. * * Before completing successfully, this function calls @a editor's * close_edit(), so the caller should expect its @a edit_baton to be * invalid after its use with this function. * * Do any allocation necessary for the delta computation in @a pool. * This function's maximum memory consumption is at most roughly * proportional to the greatest depth of the tree under @a tgt_root, not * the total size of the delta. * * ### svn_repos_dir_delta2 is mostly superceded by the reporter * ### functionality (svn_repos_begin_report2 and friends). * ### svn_repos_dir_delta2 does allow the roots to be transaction * ### roots rather than just revision roots, and it has the * ### entry_props flag. Almost all of Subversion's own code uses the * ### reporter instead; there are some stray references to the * ### svn_repos_dir_delta[2] in comments which should probably * ### actually refer to the reporter. */ svn_error_t * svn_repos_dir_delta2(svn_fs_root_t *src_root, const char *src_parent_dir, const char *src_entry, svn_fs_root_t *tgt_root, const char *tgt_path, const svn_delta_editor_t *editor, void *edit_baton, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, svn_boolean_t text_deltas, svn_depth_t depth, svn_boolean_t entry_props, svn_boolean_t ignore_ancestry, apr_pool_t *pool); /** * Similar to svn_repos_dir_delta2(), but if @a recurse is TRUE, pass * @c svn_depth_infinity for @a depth, and if @a recurse is FALSE, * pass @c svn_depth_files for @a depth. * * @deprecated Provided for backward compatibility with the 1.4 API. */ SVN_DEPRECATED svn_error_t * svn_repos_dir_delta(svn_fs_root_t *src_root, const char *src_parent_dir, const char *src_entry, svn_fs_root_t *tgt_root, const char *tgt_path, const svn_delta_editor_t *editor, void *edit_baton, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, svn_boolean_t text_deltas, svn_boolean_t recurse, svn_boolean_t entry_props, svn_boolean_t ignore_ancestry, apr_pool_t *pool); /** Use the provided @a editor and @a edit_baton to describe the * skeletal changes made in a particular filesystem @a root * (revision or transaction). * * Changes will be limited to those within @a base_dir, and if * @a low_water_mark is set to something other than @c SVN_INVALID_REVNUM * it is assumed that the client has no knowledge of revisions prior to * @a low_water_mark. Together, these two arguments define the portion of * the tree that the client is assumed to have knowledge of, and thus any * copies of data from outside that part of the tree will be sent in their * entirety, not as simple copies or deltas against a previous version. * * The @a editor passed to this function should be aware of the fact * that, if @a send_deltas is FALSE, calls to its change_dir_prop(), * change_file_prop(), and apply_textdelta() functions will not * contain meaningful data, and merely serve as indications that * properties or textual contents were changed. * * If @a send_deltas is @c TRUE, the text and property deltas for changes * will be sent, otherwise NULL text deltas and empty prop changes will be * used. * * If @a authz_read_func is non-NULL, it will be used to determine if the * user has read access to the data being accessed. Data that the user * cannot access will be skipped. * * @note This editor driver passes SVN_INVALID_REVNUM for all * revision parameters in the editor interface except the copyfrom * parameter of the add_file() and add_directory() editor functions. * * @since New in 1.4. */ svn_error_t * svn_repos_replay2(svn_fs_root_t *root, const char *base_dir, svn_revnum_t low_water_mark, svn_boolean_t send_deltas, const svn_delta_editor_t *editor, void *edit_baton, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, apr_pool_t *pool); /** * Similar to svn_repos_replay2(), but with @a base_dir set to @c "", * @a low_water_mark set to @c SVN_INVALID_REVNUM, @a send_deltas * set to @c FALSE, and @a authz_read_func and @a authz_read_baton * set to @c NULL. * * @deprecated Provided for backward compatibility with the 1.3 API. */ SVN_DEPRECATED svn_error_t * svn_repos_replay(svn_fs_root_t *root, const svn_delta_editor_t *editor, void *edit_baton, apr_pool_t *pool); /* ---------------------------------------------------------------*/ /* Making commits. */ /** * Return an @a editor and @a edit_baton to commit changes to the * filesystem of @a repos, beginning at location 'rev:@a base_path', * where "rev" is the argument given to open_root(). * * @a repos is a previously opened repository. @a repos_url is the * decoded URL to the base of the repository, and is used to check * copyfrom paths. @a txn is a filesystem transaction object to use * during the commit, or @c NULL to indicate that this function should * create (and fully manage) a new transaction. * * Store the contents of @a revprop_table, a hash mapping const * char * property names to @c svn_string_t values, as properties * of the commit transaction, including author and log message if * present. * * @note @c SVN_PROP_REVISION_DATE may be present in @a revprop_table, but * it will be overwritten when the transaction is committed. * * Iff @a authz_callback is provided, check read/write authorizations * on paths accessed by editor operations. An operation which fails * due to authz will return SVN_ERR_AUTHZ_UNREADABLE or * SVN_ERR_AUTHZ_UNWRITABLE. * * Calling @a (*editor)->close_edit completes the commit. * * If @a callback is non-NULL, then before @c close_edit returns (but * after the commit has succeeded) @c close_edit will invoke * @a callback with a filled-in @c svn_commit_info_t *, @a callback_baton, * and @a pool or some subpool thereof as arguments. If @a callback * returns an error, that error will be returned from @c close_edit, * otherwise if there was a post-commit hook failure, then that error * will be returned with code SVN_ERR_REPOS_POST_COMMIT_HOOK_FAILED. * (Note that prior to Subversion 1.6, @a callback cannot be NULL; if * you don't need a callback, pass a dummy function.) * * Calling @a (*editor)->abort_edit aborts the commit, and will also * abort the commit transaction unless @a txn was supplied (not @c * NULL). Callers who supply their own transactions are responsible * for cleaning them up (either by committing them, or aborting them). * * @since New in 1.5. */ svn_error_t * svn_repos_get_commit_editor5(const svn_delta_editor_t **editor, void **edit_baton, svn_repos_t *repos, svn_fs_txn_t *txn, const char *repos_url, const char *base_path, apr_hash_t *revprop_table, svn_commit_callback2_t callback, void *callback_baton, svn_repos_authz_callback_t authz_callback, void *authz_baton, apr_pool_t *pool); /** * Similar to svn_repos_get_commit_editor5(), but with @a revprop_table * set to a hash containing @a user and @a log_msg as the * @c SVN_PROP_REVISION_AUTHOR and @c SVN_PROP_REVISION_LOG properties, * respectively. @a user and @a log_msg may both be @c NULL. * * @since New in 1.4. * * @deprecated Provided for backward compatibility with the 1.4 API. */ SVN_DEPRECATED svn_error_t * svn_repos_get_commit_editor4(const svn_delta_editor_t **editor, void **edit_baton, svn_repos_t *repos, svn_fs_txn_t *txn, const char *repos_url, const char *base_path, const char *user, const char *log_msg, svn_commit_callback2_t callback, void *callback_baton, svn_repos_authz_callback_t authz_callback, void *authz_baton, apr_pool_t *pool); /** * Similar to svn_repos_get_commit_editor4(), but * uses the svn_commit_callback_t type. * * @since New in 1.3. * * @deprecated Provided for backward compatibility with the 1.3 API. */ SVN_DEPRECATED svn_error_t * svn_repos_get_commit_editor3(const svn_delta_editor_t **editor, void **edit_baton, svn_repos_t *repos, svn_fs_txn_t *txn, const char *repos_url, const char *base_path, const char *user, const char *log_msg, svn_commit_callback_t callback, void *callback_baton, svn_repos_authz_callback_t authz_callback, void *authz_baton, apr_pool_t *pool); /** * Similar to svn_repos_get_commit_editor3(), but with @a * authz_callback and @a authz_baton set to @c NULL. * * @deprecated Provided for backward compatibility with the 1.2 API. */ SVN_DEPRECATED svn_error_t * svn_repos_get_commit_editor2(const svn_delta_editor_t **editor, void **edit_baton, svn_repos_t *repos, svn_fs_txn_t *txn, const char *repos_url, const char *base_path, const char *user, const char *log_msg, svn_commit_callback_t callback, void *callback_baton, apr_pool_t *pool); /** * Similar to svn_repos_get_commit_editor2(), but with @a txn always * set to @c NULL. * * @deprecated Provided for backward compatibility with the 1.1 API. */ SVN_DEPRECATED svn_error_t * svn_repos_get_commit_editor(const svn_delta_editor_t **editor, void **edit_baton, svn_repos_t *repos, const char *repos_url, const char *base_path, const char *user, const char *log_msg, svn_commit_callback_t callback, void *callback_baton, apr_pool_t *pool); /* ---------------------------------------------------------------*/ /* Finding particular revisions. */ /** Set @a *revision to the revision number in @a repos's filesystem that was * youngest at time @a tm. */ svn_error_t * svn_repos_dated_revision(svn_revnum_t *revision, svn_repos_t *repos, apr_time_t tm, apr_pool_t *pool); /** Given a @a root/@a path within some filesystem, return three pieces of * information allocated in @a pool: * * - set @a *committed_rev to the revision in which the object was * last modified. (In fs parlance, this is the revision in which * the particular node-rev-id was 'created'.) * * - set @a *committed_date to the date of said revision, or @c NULL * if not available. * * - set @a *last_author to the author of said revision, or @c NULL * if not available. */ svn_error_t * svn_repos_get_committed_info(svn_revnum_t *committed_rev, const char **committed_date, const char **last_author, svn_fs_root_t *root, const char *path, apr_pool_t *pool); /** * Set @a *dirent to an @c svn_dirent_t associated with @a path in @a * root. If @a path does not exist in @a root, set @a *dirent to * NULL. Use @a pool for memory allocation. * * @since New in 1.2. */ svn_error_t * svn_repos_stat(svn_dirent_t **dirent, svn_fs_root_t *root, const char *path, apr_pool_t *pool); /** * Given @a path which exists at revision @a start in @a fs, set * @a *deleted to the revision @a path was first deleted, within the * inclusive revision range bounded by @a start and @a end. If @a path * does not exist at revision @a start or was not deleted within the * specified range, then set @a *deleted to SVN_INVALID_REVNUM. * Use @a pool for memory allocation. * * @since New in 1.5. */ svn_error_t * svn_repos_deleted_rev(svn_fs_t *fs, const char *path, svn_revnum_t start, svn_revnum_t end, svn_revnum_t *deleted, apr_pool_t *pool); /** Callback type for use with svn_repos_history(). @a path and @a * revision represent interesting history locations in the lifetime * of the path passed to svn_repos_history(). @a baton is the same * baton given to svn_repos_history(). @a pool is provided for the * convenience of the implementor, who should not expect it to live * longer than a single callback call. * * Signal to callback driver to stop processing/invoking this callback * by returning the @c SVN_ERR_CEASE_INVOCATION error code. * * @note SVN_ERR_CEASE_INVOCATION is new in 1.5. */ typedef svn_error_t *(*svn_repos_history_func_t)(void *baton, const char *path, svn_revnum_t revision, apr_pool_t *pool); /** * Call @a history_func (with @a history_baton) for each interesting * history location in the lifetime of @a path in @a fs, from the * youngest of @a end and @a start to the oldest. Stop processing if * @a history_func returns @c SVN_ERR_CEASE_INVOCATION. Only cross * filesystem copy history if @a cross_copies is @c TRUE. And do all * of this in @a pool. * * If @a authz_read_func is non-NULL, then use it (and @a * authz_read_baton) to verify that @a path in @a end is readable; if * not, return SVN_ERR_AUTHZ_UNREADABLE. Also verify the readability * of every ancestral path/revision pair before pushing them at @a * history_func. If a pair is deemed unreadable, then do not send * them; instead, immediately stop traversing history and return * SVN_NO_ERROR. * * @since New in 1.1. * * @note SVN_ERR_CEASE_INVOCATION is new in 1.5. */ svn_error_t * svn_repos_history2(svn_fs_t *fs, const char *path, svn_repos_history_func_t history_func, void *history_baton, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, svn_revnum_t start, svn_revnum_t end, svn_boolean_t cross_copies, apr_pool_t *pool); /** * Similar to svn_repos_history2(), but with @a authz_read_func * and @a authz_read_baton always set to NULL. * * @deprecated Provided for backward compatibility with the 1.0 API. */ SVN_DEPRECATED svn_error_t * svn_repos_history(svn_fs_t *fs, const char *path, svn_repos_history_func_t history_func, void *history_baton, svn_revnum_t start, svn_revnum_t end, svn_boolean_t cross_copies, apr_pool_t *pool); /** * Set @a *locations to be a mapping of the revisions to the paths of * the file @a fs_path present at the repository in revision * @a peg_revision, where the revisions are taken out of the array * @a location_revisions. * * @a location_revisions is an array of svn_revnum_t's and @a *locations * maps 'svn_revnum_t *' to 'const char *'. * * If optional @a authz_read_func is non-NULL, then use it (and @a * authz_read_baton) to verify that the peg-object is readable. If not, * return SVN_ERR_AUTHZ_UNREADABLE. Also use the @a authz_read_func * to check that every path returned in the hash is readable. If an * unreadable path is encountered, stop tracing and return * SVN_NO_ERROR. * * @a pool is used for all allocations. * * @since New in 1.1. */ svn_error_t * svn_repos_trace_node_locations(svn_fs_t *fs, apr_hash_t **locations, const char *fs_path, svn_revnum_t peg_revision, apr_array_header_t *location_revisions, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, apr_pool_t *pool); /** * Call @a receiver and @a receiver_baton to report successive * location segments in revisions between @a start_rev and @a end_rev * (inclusive) for the line of history identified by the peg-object @a * path in @a peg_revision (and in @a repos). * * @a end_rev may be @c SVN_INVALID_REVNUM to indicate that you want * to trace the history of the object to its origin. * * @a start_rev may be @c SVN_INVALID_REVNUM to indicate "the HEAD * revision". Otherwise, @a start_rev must be younger than @a end_rev * (unless @a end_rev is @c SVN_INVALID_REVNUM). * * @a peg_revision may be @c SVN_INVALID_REVNUM to indicate "the HEAD * revision", and must evaluate to be at least as young as @a start_rev. * * If optional @a authz_read_func is not @c NULL, then use it (and @a * authz_read_baton) to verify that the peg-object is readable. If * not, return @c SVN_ERR_AUTHZ_UNREADABLE. Also use the @a * authz_read_func to check that every path reported in a location * segment is readable. If an unreadable path is encountered, report * a final (possibly truncated) location segment (if any), stop * tracing history, and return @c SVN_NO_ERROR. * * @a pool is used for all allocations. * * @since New in 1.5. */ svn_error_t * svn_repos_node_location_segments(svn_repos_t *repos, const char *path, svn_revnum_t peg_revision, svn_revnum_t start_rev, svn_revnum_t end_rev, svn_location_segment_receiver_t receiver, void *receiver_baton, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, apr_pool_t *pool); /* ### other queries we can do someday -- * fetch the last revision created by (once usernames become revision properties!) * fetch the last revision where was modified */ /* ---------------------------------------------------------------*/ /* Retrieving log messages. */ /** * Invoke @a receiver with @a receiver_baton on each log message from * @a start to @a end in @a repos's filesystem. @a start may be greater * or less than @a end; this just controls whether the log messages are * processed in descending or ascending revision number order. * * If @a start or @a end is @c SVN_INVALID_REVNUM, it defaults to youngest. * * If @a paths is non-NULL and has one or more elements, then only show * revisions in which at least one of @a paths was changed (i.e., if * file, text or props changed; if dir, props or entries changed or any node * changed below it). Each path is a const char * representing * an absolute path in the repository. If @a paths is NULL or empty, * show all revisions regardless of what paths were changed in those * revisions. * * If @a limit is non-zero then only invoke @a receiver on the first * @a limit logs. * * If @a discover_changed_paths, then each call to @a receiver passes a * hash mapping paths committed in that revision to information about them * as the receiver's @a changed_paths argument. * Otherwise, each call to @a receiver passes NULL for @a changed_paths. * * If @a strict_node_history is set, copy history (if any exists) will * not be traversed while harvesting revision logs for each path. * * If @a include_merged_revisions is set, log information for revisions * which have been merged to @a targets will also be returned. * * If @a revprops is NULL, retrieve all revprops; else, retrieve only the * revprops named in the array (i.e. retrieve none if the array is empty). * * If any invocation of @a receiver returns error, return that error * immediately and without wrapping it. * * If @a start or @a end is a non-existent revision, return the error * @c SVN_ERR_FS_NO_SUCH_REVISION, without ever invoking @a receiver. * * If optional @a authz_read_func is non-NULL, then use this function * (along with optional @a authz_read_baton) to check the readability * of each changed-path in each revision about to be "pushed" at * @a receiver. If a revision has some changed-paths readable and * others unreadable, unreadable paths are omitted from the * changed_paths field and only svn:author and svn:date will be * available in the revprops field. If a revision has no * changed-paths readable at all, then all paths are omitted and no * revprops are available. * * See also the documentation for @c svn_log_entry_receiver_t. * * Use @a pool for temporary allocations. * * @since New in 1.5. */ svn_error_t * svn_repos_get_logs4(svn_repos_t *repos, const apr_array_header_t *paths, svn_revnum_t start, svn_revnum_t end, int limit, svn_boolean_t discover_changed_paths, svn_boolean_t strict_node_history, svn_boolean_t include_merged_revisions, const apr_array_header_t *revprops, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, svn_log_entry_receiver_t receiver, void *receiver_baton, apr_pool_t *pool); /** * Same as svn_repos_get_logs4(), but with @a receiver being @c * svn_log_message_receiver_t instead of @c svn_log_entry_receiver_t. * Also, @a include_merged_revisions is set to @c FALSE and @a revprops is * svn:author, svn:date, and svn:log. If @a paths is empty, nothing * is returned. * * @since New in 1.2. * @deprecated Provided for backward compatibility with the 1.4 API. */ SVN_DEPRECATED svn_error_t * svn_repos_get_logs3(svn_repos_t *repos, const apr_array_header_t *paths, svn_revnum_t start, svn_revnum_t end, int limit, svn_boolean_t discover_changed_paths, svn_boolean_t strict_node_history, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, svn_log_message_receiver_t receiver, void *receiver_baton, apr_pool_t *pool); /** * Same as svn_repos_get_logs3(), but with @a limit always set to 0. * * @deprecated Provided for backward compatibility with the 1.1 API. */ SVN_DEPRECATED svn_error_t * svn_repos_get_logs2(svn_repos_t *repos, const apr_array_header_t *paths, svn_revnum_t start, svn_revnum_t end, svn_boolean_t discover_changed_paths, svn_boolean_t strict_node_history, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, svn_log_message_receiver_t receiver, void *receiver_baton, apr_pool_t *pool); /** * Same as svn_repos_get_logs2(), but with @a authz_read_func and * @a authz_read_baton always set to NULL. * * @deprecated Provided for backward compatibility with the 1.0 API. */ SVN_DEPRECATED svn_error_t * svn_repos_get_logs(svn_repos_t *repos, const apr_array_header_t *paths, svn_revnum_t start, svn_revnum_t end, svn_boolean_t discover_changed_paths, svn_boolean_t strict_node_history, svn_log_message_receiver_t receiver, void *receiver_baton, apr_pool_t *pool); /* ---------------------------------------------------------------*/ /* Retrieving mergeinfo. */ /** * Fetch the mergeinfo for @a paths at @a revision in @a repos, and * set @a *catalog to a catalog of this mergeinfo. @a *catalog will * never be @c NULL but may be empty. * * @a inherit indicates whether explicit, explicit or inherited, or * only inherited mergeinfo for @a paths is fetched. * * If @a revision is @c SVN_INVALID_REVNUM, it defaults to youngest. * * If @a include_descendants is TRUE, then additionally return the * mergeinfo for any descendant of any element of @a paths which has * the @c SVN_PROP_MERGEINFO property explicitly set on it. (Note * that inheritance is only taken into account for the elements in @a * paths; descendants of the elements in @a paths which get their * mergeinfo via inheritance are not included in @a *catalog.) * * If optional @a authz_read_func is non-NULL, then use this function * (along with optional @a authz_read_baton) to check the readability * of each path which mergeinfo was requested for (from @a paths). * Silently omit unreadable paths from the request for mergeinfo. * * Use @a pool for all allocations. * * @since New in 1.5. */ svn_error_t * svn_repos_fs_get_mergeinfo(svn_mergeinfo_catalog_t *catalog, svn_repos_t *repos, const apr_array_header_t *paths, svn_revnum_t revision, svn_mergeinfo_inheritance_t inherit, svn_boolean_t include_descendants, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, apr_pool_t *pool); /* ---------------------------------------------------------------*/ /* Retrieving multiple revisions of a file. */ /** * Retrieve a subset of the interesting revisions of a file @a path in * @a repos as seen in revision @a end. Invoke @a handler with * @a handler_baton as its first argument for each such revision. * @a pool is used for all allocations. See svn_fs_history_prev() for * a discussion of interesting revisions. * * If optional @a authz_read_func is non-NULL, then use this function * (along with optional @a authz_read_baton) to check the readability * of the rev-path in each interesting revision encountered. * * Revision discovery happens from @a end to @a start, and if an * unreadable revision is encountered before @a start is reached, then * revision discovery stops and only the revisions from @a end to the * oldest readable revision are returned (So it will appear that @a * path was added without history in the latter revision). * * If there is an interesting revision of the file that is less than or * equal to start, the iteration will start at that revision. Else, the * iteration will start at the first revision of the file in the repository, * which has to be less than or equal to end. Note that if the function * succeeds, @a handler will have been called at least once. * * In a series of calls, the file contents for the first interesting revision * will be provided as a text delta against the empty file. In the following * calls, the delta will be against the contents for the previous call. * * If @a include_merged_revisions is TRUE, revisions which a included as a * result of a merge between @a start and @a end will be included. * * @since New in 1.5. */ svn_error_t * svn_repos_get_file_revs2(svn_repos_t *repos, const char *path, svn_revnum_t start, svn_revnum_t end, svn_boolean_t include_merged_revisions, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, svn_file_rev_handler_t handler, void *handler_baton, apr_pool_t *pool); /** * Similar to svn_repos_get_file_revs2(), with @a include_merged_revisions * set to FALSE. * * @deprecated Provided for backward compatibility with the 1.4 API. * @since New in 1.1. */ SVN_DEPRECATED svn_error_t * svn_repos_get_file_revs(svn_repos_t *repos, const char *path, svn_revnum_t start, svn_revnum_t end, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, svn_repos_file_rev_handler_t handler, void *handler_baton, apr_pool_t *pool); /* ---------------------------------------------------------------*/ /** * @defgroup svn_repos_hook_wrappers Hook-sensitive wrappers for libsvn_fs \ * routines. * @{ */ /** Like svn_fs_commit_txn(), but invoke the @a repos's pre- and * post-commit hooks around the commit. Use @a pool for any necessary * allocations. * * If the pre-commit hook or svn_fs_commit_txn() fails, throw the * original error to caller. If an error occurs when running the * post-commit hook, return the original error wrapped with * SVN_ERR_REPOS_POST_COMMIT_HOOK_FAILED. If the caller sees this * error, it knows that the commit succeeded anyway. * * @a conflict_p, @a new_rev, and @a txn are as in svn_fs_commit_txn(). */ svn_error_t * svn_repos_fs_commit_txn(const char **conflict_p, svn_repos_t *repos, svn_revnum_t *new_rev, svn_fs_txn_t *txn, apr_pool_t *pool); /** Like svn_fs_begin_txn(), but use @a revprop_table, a hash mapping * const char * property names to @c svn_string_t values, to * set the properties on transaction @a *txn_p. @a repos is the * repository object which contains the filesystem. @a rev, @a * *txn_p, and @a pool are as in svn_fs_begin_txn(). * * Before a txn is created, the repository's start-commit hooks are * run; if any of them fail, no txn is created, @a *txn_p is unaffected, * and @c SVN_ERR_REPOS_HOOK_FAILURE is returned. * * @note @a revprop_table may contain an @c SVN_PROP_REVISION_DATE property, * which will be set on the transaction, but that will be overwritten * when the transaction is committed. * * @since New in 1.5. */ svn_error_t * svn_repos_fs_begin_txn_for_commit2(svn_fs_txn_t **txn_p, svn_repos_t *repos, svn_revnum_t rev, apr_hash_t *revprop_table, apr_pool_t *pool); /** * Same as svn_repos_fs_begin_txn_for_commit2(), but with @a revprop_table * set to a hash containing @a author and @a log_msg as the * @c SVN_PROP_REVISION_AUTHOR and @c SVN_PROP_REVISION_LOG properties, * respectively. @a author and @a log_msg may both be @c NULL. * * @deprecated Provided for backward compatibility with the 1.4 API. */ SVN_DEPRECATED svn_error_t * svn_repos_fs_begin_txn_for_commit(svn_fs_txn_t **txn_p, svn_repos_t *repos, svn_revnum_t rev, const char *author, const char *log_msg, apr_pool_t *pool); /** Like svn_fs_begin_txn(), but use @a author to set the corresponding * property on transaction @a *txn_p. @a repos is the repository object * which contains the filesystem. @a rev, @a *txn_p, and @a pool are as in * svn_fs_begin_txn(). * * ### Someday: before a txn is created, some kind of read-hook could * be called here. */ svn_error_t * svn_repos_fs_begin_txn_for_update(svn_fs_txn_t **txn_p, svn_repos_t *repos, svn_revnum_t rev, const char *author, apr_pool_t *pool); /** @defgroup svn_repos_fs_locks Repository lock wrappers * @{ * @since New in 1.2. */ /** Like svn_fs_lock(), but invoke the @a repos's pre- and * post-lock hooks before and after the locking action. Use @a pool * for any necessary allocations. * * If the pre-lock hook or svn_fs_lock() fails, throw the original * error to caller. If an error occurs when running the post-lock * hook, return the original error wrapped with * SVN_ERR_REPOS_POST_LOCK_HOOK_FAILED. If the caller sees this * error, it knows that the lock succeeded anyway. * * The pre-lock hook may cause a different token to be used for the * lock, instead of @a token; see the pre-lock-hook documentation for * more. */ svn_error_t * svn_repos_fs_lock(svn_lock_t **lock, svn_repos_t *repos, const char *path, const char *token, const char *comment, svn_boolean_t is_dav_comment, apr_time_t expiration_date, svn_revnum_t current_rev, svn_boolean_t steal_lock, apr_pool_t *pool); /** Like svn_fs_unlock(), but invoke the @a repos's pre- and * post-unlock hooks before and after the unlocking action. Use @a * pool for any necessary allocations. * * If the pre-unlock hook or svn_fs_unlock() fails, throw the original * error to caller. If an error occurs when running the post-unlock * hook, return the original error wrapped with * SVN_ERR_REPOS_POST_UNLOCK_HOOK_FAILED. If the caller sees this * error, it knows that the unlock succeeded anyway. */ svn_error_t * svn_repos_fs_unlock(svn_repos_t *repos, const char *path, const char *token, svn_boolean_t break_lock, apr_pool_t *pool); /** Look up all the locks in and under @a path in @a repos, setting @a * *locks to a hash which maps const char * paths to the @c * svn_lock_t locks associated with those paths. Use @a * authz_read_func and @a authz_read_baton to "screen" all returned * locks. That is: do not return any locks on any paths that are * unreadable in HEAD, just silently omit them. */ svn_error_t * svn_repos_fs_get_locks(apr_hash_t **locks, svn_repos_t *repos, const char *path, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, apr_pool_t *pool); /** @} */ /** * Like svn_fs_change_rev_prop(), but validate the name and value of the * property and invoke the @a repos's pre- and post-revprop-change hooks * around the change as specified by @a use_pre_revprop_change_hook and * @a use_post_revprop_change_hook (respectively). * * @a rev is the revision whose property to change, @a name is the * name of the property, and @a new_value is the new value of the * property. @a author is the authenticated username of the person * changing the property value, or NULL if not available. * * If @a authz_read_func is non-NULL, then use it (with @a * authz_read_baton) to validate the changed-paths associated with @a * rev. If the revision contains any unreadable changed paths, then * return SVN_ERR_AUTHZ_UNREADABLE. * * Validate @a name and @a new_value like the same way * svn_repos_fs_change_node_prop() does. * * Use @a pool for temporary allocations. * * @since New in 1.5. */ svn_error_t * svn_repos_fs_change_rev_prop3(svn_repos_t *repos, svn_revnum_t rev, const char *author, const char *name, const svn_string_t *new_value, svn_boolean_t use_pre_revprop_change_hook, svn_boolean_t use_post_revprop_change_hook, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, apr_pool_t *pool); /** * Similar to svn_repos_fs_change_rev_prop3(), but with the @a * use_pre_revprop_change_hook and @a use_post_revprop_change_hook * always set to @c TRUE. * * @deprecated Provided for backward compatibility with the 1.4 API. */ SVN_DEPRECATED svn_error_t * svn_repos_fs_change_rev_prop2(svn_repos_t *repos, svn_revnum_t rev, const char *author, const char *name, const svn_string_t *new_value, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, apr_pool_t *pool); /** * Similar to svn_repos_fs_change_rev_prop2(), but with the * @a authz_read_func parameter always NULL. * * @deprecated Provided for backward compatibility with the 1.0 API. */ SVN_DEPRECATED svn_error_t * svn_repos_fs_change_rev_prop(svn_repos_t *repos, svn_revnum_t rev, const char *author, const char *name, const svn_string_t *new_value, apr_pool_t *pool); /** * Set @a *value_p to the value of the property named @a propname on * revision @a rev in the filesystem opened in @a repos. If @a rev * has no property by that name, set @a *value_p to zero. Allocate * the result in @a pool. * * If @a authz_read_func is non-NULL, then use it (with @a * authz_read_baton) to validate the changed-paths associated with @a * rev. If the changed-paths are all unreadable, then set @a *value_p * to zero unconditionally. If only some of the changed-paths are * unreadable, then allow 'svn:author' and 'svn:date' propvalues to be * fetched, but return 0 for any other property. * * @since New in 1.1. */ svn_error_t * svn_repos_fs_revision_prop(svn_string_t **value_p, svn_repos_t *repos, svn_revnum_t rev, const char *propname, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, apr_pool_t *pool); /** * Set @a *table_p to the entire property list of revision @a rev in * filesystem opened in @a repos, as a hash table allocated in @a * pool. The table maps char * property names to @c * svn_string_t * values; the names and values are allocated in @a * pool. * * If @a authz_read_func is non-NULL, then use it (with @a * authz_read_baton) to validate the changed-paths associated with @a * rev. If the changed-paths are all unreadable, then return an empty * hash. If only some of the changed-paths are unreadable, then return * an empty hash, except for 'svn:author' and 'svn:date' properties * (assuming those properties exist). * * @since New in 1.1. */ svn_error_t * svn_repos_fs_revision_proplist(apr_hash_t **table_p, svn_repos_t *repos, svn_revnum_t rev, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, apr_pool_t *pool); /* ---------------------------------------------------------------*/ /* Prop-changing wrappers for libsvn_fs routines. */ /* NOTE: svn_repos_fs_change_rev_prop() also exists, but is located above with the hook-related functions. */ /** Validating wrapper for svn_fs_change_node_prop() (which see for * argument descriptions). * * If @a name's kind is not @c svn_prop_regular_kind, return @c * SVN_ERR_REPOS_BAD_ARGS. If @a name is an "svn:" property, validate its * @a value and return SVN_ERR_BAD_PROPERTY_VALUE if it is invalid for the * property. * * @note Currently, the only properties validated are the "svn:" properties * @c SVN_PROP_REVISION_LOG and @c SVN_PROP_REVISION_DATE. This may change * in future releases. */ svn_error_t * svn_repos_fs_change_node_prop(svn_fs_root_t *root, const char *path, const char *name, const svn_string_t *value, apr_pool_t *pool); /** Validating wrapper for svn_fs_change_txn_prop() (which see for * argument descriptions). See svn_repos_fs_change_txn_props() for more * information. */ svn_error_t * svn_repos_fs_change_txn_prop(svn_fs_txn_t *txn, const char *name, const svn_string_t *value, apr_pool_t *pool); /** Validating wrapper for svn_fs_change_txn_props() (which see for * argument descriptions). Validate properties and their values the * same way svn_repos_fs_change_node_prop() does. * * @since New in 1.5. */ svn_error_t * svn_repos_fs_change_txn_props(svn_fs_txn_t *txn, apr_array_header_t *props, apr_pool_t *pool); /** @} */ /* ---------------------------------------------------------------*/ /** * @defgroup svn_repos_inspection Data structures and editor things for * repository inspection. * @{ * * As it turns out, the svn_repos_dir_delta2() interface can be * extremely useful for examining the repository, or more exactly, * changes to the repository. svn_repos_dir_delta2() allows for * differences between two trees to be described using an editor. * * By using the editor obtained from svn_repos_node_editor() with * svn_repos_dir_delta2(), the description of how to transform one tree * into another can be used to build an in-memory linked-list tree, * which each node representing a repository node that was changed as a * result of having svn_repos_dir_delta2() drive that editor. */ /** A node in the repository. */ typedef struct svn_repos_node_t { /** Node type (file, dir, etc.) */ svn_node_kind_t kind; /** How this node entered the node tree: 'A'dd, 'D'elete, 'R'eplace */ char action; /** Were there any textual mods? (files only) */ svn_boolean_t text_mod; /** Where there any property mods? */ svn_boolean_t prop_mod; /** The name of this node as it appears in its parent's entries list */ const char *name; /** The filesystem revision where this was copied from (if any) */ svn_revnum_t copyfrom_rev; /** The filesystem path where this was copied from (if any) */ const char *copyfrom_path; /** Pointer to the next sibling of this node */ struct svn_repos_node_t *sibling; /** Pointer to the first child of this node */ struct svn_repos_node_t *child; /** Pointer to the parent of this node */ struct svn_repos_node_t *parent; } svn_repos_node_t; /** Set @a *editor and @a *edit_baton to an editor that, when driven by * svn_repos_dir_delta2(), builds an svn_repos_node_t * tree * representing the delta from @a base_root to @a root in @a repos's * filesystem. * * Invoke svn_repos_node_from_baton() on @a edit_baton to obtain the root * node afterwards. * * Note that the delta includes "bubbled-up" directories; that is, * many of the directory nodes will have no prop_mods. * * Allocate the tree and its contents in @a node_pool; do all other * allocation in @a pool. */ svn_error_t * svn_repos_node_editor(const svn_delta_editor_t **editor, void **edit_baton, svn_repos_t *repos, svn_fs_root_t *base_root, svn_fs_root_t *root, apr_pool_t *node_pool, apr_pool_t *pool); /** Return the root node of the linked-list tree generated by driving * the editor created by svn_repos_node_editor() with * svn_repos_dir_delta2(), which is stored in @a edit_baton. This is * only really useful if used *after* the editor drive is completed. */ svn_repos_node_t * svn_repos_node_from_baton(void *edit_baton); /** @} */ /* ---------------------------------------------------------------*/ /** * @defgroup svn_repos_dump_load Dumping and loading filesystem data * @{ * * The filesystem 'dump' format contains nothing but the abstract * structure of the filesystem -- independent of any internal node-id * schema or database back-end. All of the data in the dumpfile is * acquired by public function calls into svn_fs.h. Similarly, the * parser which reads the dumpfile is able to reconstruct the * filesystem using only public svn_fs.h routines. * * Thus the dump/load feature's main purpose is for *migrating* data * from one svn filesystem to another -- presumably two filesystems * which have different internal implementations. * * If you simply want to backup your filesystem, you're probably * better off using the built-in facilities of the DB backend (using * Berkeley DB's hot-backup feature, for example.) * * For a description of the dumpfile format, see * /trunk/notes/fs_dumprestore.txt. */ /* The RFC822-style headers in our dumpfile format. */ #define SVN_REPOS_DUMPFILE_MAGIC_HEADER "SVN-fs-dump-format-version" #define SVN_REPOS_DUMPFILE_FORMAT_VERSION 3 #define SVN_REPOS_DUMPFILE_UUID "UUID" #define SVN_REPOS_DUMPFILE_CONTENT_LENGTH "Content-length" #define SVN_REPOS_DUMPFILE_REVISION_NUMBER "Revision-number" #define SVN_REPOS_DUMPFILE_NODE_PATH "Node-path" #define SVN_REPOS_DUMPFILE_NODE_KIND "Node-kind" #define SVN_REPOS_DUMPFILE_NODE_ACTION "Node-action" #define SVN_REPOS_DUMPFILE_NODE_COPYFROM_PATH "Node-copyfrom-path" #define SVN_REPOS_DUMPFILE_NODE_COPYFROM_REV "Node-copyfrom-rev" #define SVN_REPOS_DUMPFILE_TEXT_COPY_SOURCE_MD5 "Text-copy-source-md5" #define SVN_REPOS_DUMPFILE_TEXT_COPY_SOURCE_SHA1 "Text-copy-source-sha1" #define SVN_REPOS_DUMPFILE_TEXT_COPY_SOURCE_CHECKSUM \ SVN_REPOS_DUMPFILE_TEXT_COPY_SOURCE_MD5 #define SVN_REPOS_DUMPFILE_TEXT_CONTENT_MD5 "Text-content-md5" #define SVN_REPOS_DUMPFILE_TEXT_CONTENT_SHA1 "Text-content-sha1" #define SVN_REPOS_DUMPFILE_TEXT_CONTENT_CHECKSUM \ SVN_REPOS_DUMPFILE_TEXT_CONTENT_MD5 #define SVN_REPOS_DUMPFILE_PROP_CONTENT_LENGTH "Prop-content-length" #define SVN_REPOS_DUMPFILE_TEXT_CONTENT_LENGTH "Text-content-length" /** @since New in 1.1. */ #define SVN_REPOS_DUMPFILE_PROP_DELTA "Prop-delta" /** @since New in 1.1. */ #define SVN_REPOS_DUMPFILE_TEXT_DELTA "Text-delta" /** @since New in 1.5. */ #define SVN_REPOS_DUMPFILE_TEXT_DELTA_BASE_MD5 "Text-delta-base-md5" /** @since New in 1.6. */ #define SVN_REPOS_DUMPFILE_TEXT_DELTA_BASE_SHA1 "Text-delta-base-sha1" /** @since New in 1.6. */ #define SVN_REPOS_DUMPFILE_TEXT_DELTA_BASE_CHECKSUM \ SVN_REPOS_DUMPFILE_TEXT_DELTA_BASE_MD5 /** The different "actions" attached to nodes in the dumpfile. */ enum svn_node_action { svn_node_action_change, svn_node_action_add, svn_node_action_delete, svn_node_action_replace }; /** The different policies for processing the UUID in the dumpfile. */ enum svn_repos_load_uuid { svn_repos_load_uuid_default, svn_repos_load_uuid_ignore, svn_repos_load_uuid_force }; /** * Verify the contents of the file system in @a repos. * * If @a feedback_stream is not @c NULL, write feedback to it (lines of * the form "* Verified revision %ld\n"). * * If @a start_rev is @c SVN_INVALID_REVNUM, then start verifying at * revision 0. If @a end_rev is @c SVN_INVALID_REVNUM, then verify * through the @c HEAD revision. * * If @a cancel_func is not @c NULL, call it periodically with @a * cancel_baton as argument to see if the caller wishes to cancel the * verification. * * @since New in 1.5. */ svn_error_t * svn_repos_verify_fs(svn_repos_t *repos, svn_stream_t *feedback_stream, svn_revnum_t start_rev, svn_revnum_t end_rev, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool); /** * Dump the contents of the filesystem within already-open @a repos into * writable @a dumpstream. Begin at revision @a start_rev, and dump every * revision up through @a end_rev. Use @a pool for all allocation. If * non-@c NULL, send feedback to @a feedback_stream. If @a dumpstream is * @c NULL, this is effectively a primitive verify. It is not complete, * however; see svn_fs_verify instead. * * If @a start_rev is @c SVN_INVALID_REVNUM, then start dumping at revision * 0. If @a end_rev is @c SVN_INVALID_REVNUM, then dump through the @c HEAD * revision. * * If @a incremental is @c TRUE, the first revision dumped will be a diff * against the previous revision (usually it looks like a full dump of * the tree). * * If @a use_deltas is @c TRUE, output only node properties which have * changed relative to the previous contents, and output text contents * as svndiff data against the previous contents. Regardless of how * this flag is set, the first revision of a non-incremental dump will * be done with full plain text. A dump with @a use_deltas set cannot * be loaded by Subversion 1.0.x. * * If @a cancel_func is not @c NULL, it is called periodically with * @a cancel_baton as argument to see if the client wishes to cancel * the dump. * * @since New in 1.1. */ svn_error_t * svn_repos_dump_fs2(svn_repos_t *repos, svn_stream_t *dumpstream, svn_stream_t *feedback_stream, svn_revnum_t start_rev, svn_revnum_t end_rev, svn_boolean_t incremental, svn_boolean_t use_deltas, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool); /** * Similar to svn_repos_dump_fs2(), but with the @a use_deltas * parameter always set to @c FALSE. * * @deprecated Provided for backward compatibility with the 1.0 API. */ SVN_DEPRECATED svn_error_t * svn_repos_dump_fs(svn_repos_t *repos, svn_stream_t *dumpstream, svn_stream_t *feedback_stream, svn_revnum_t start_rev, svn_revnum_t end_rev, svn_boolean_t incremental, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool); /** * Read and parse dumpfile-formatted @a dumpstream, reconstructing * filesystem revisions in already-open @a repos, handling uuids * in accordance with @a uuid_action. * * Read and parse dumpfile-formatted @a dumpstream, reconstructing * filesystem revisions in already-open @a repos. Use @a pool for all * allocation. If non-@c NULL, send feedback to @a feedback_stream. * * If the dumpstream contains copy history that is unavailable in the * repository, an error will be thrown. * * The repository's UUID will be updated iff * the dumpstream contains a UUID and * @a uuid_action is not equal to @c svn_repos_load_uuid_ignore and * either the repository contains no revisions or * @a uuid_action is equal to @c svn_repos_load_uuid_force. * * If the dumpstream contains no UUID, then @a uuid_action is * ignored and the repository UUID is not touched. * * If @a parent_dir is not NULL, then the parser will reparent all the * loaded nodes, from root to @a parent_dir. The directory @a parent_dir * must be an existing directory in the repository. * * If @a use_pre_commit_hook is set, call the repository's pre-commit * hook before committing each loaded revision. * * If @a use_post_commit_hook is set, call the repository's * post-commit hook after committing each loaded revision. * * If @a cancel_func is not @c NULL, it is called periodically with * @a cancel_baton as argument to see if the client wishes to cancel * the load. * * @since New in 1.2. */ svn_error_t * svn_repos_load_fs2(svn_repos_t *repos, svn_stream_t *dumpstream, svn_stream_t *feedback_stream, enum svn_repos_load_uuid uuid_action, const char *parent_dir, svn_boolean_t use_pre_commit_hook, svn_boolean_t use_post_commit_hook, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool); /** * Similar to svn_repos_load_fs2(), but with @a use_pre_commit_hook and * @a use_post_commit_hook always @c FALSE. * * @deprecated Provided for backward compatibility with the 1.0 API. */ SVN_DEPRECATED svn_error_t * svn_repos_load_fs(svn_repos_t *repos, svn_stream_t *dumpstream, svn_stream_t *feedback_stream, enum svn_repos_load_uuid uuid_action, const char *parent_dir, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool); /** * A vtable that is driven by svn_repos_parse_dumpstream2(). * * @since New in 1.1. */ typedef struct svn_repos_parse_fns2_t { /** The parser has discovered a new revision record within the * parsing session represented by @a parse_baton. All the headers are * placed in @a headers (allocated in @a pool), which maps const * char * header-name ==> const char * header-value. * The @a revision_baton received back (also allocated in @a pool) * represents the revision. */ svn_error_t *(*new_revision_record)(void **revision_baton, apr_hash_t *headers, void *parse_baton, apr_pool_t *pool); /** The parser has discovered a new uuid record within the parsing * session represented by @a parse_baton. The uuid's value is * @a uuid, and it is allocated in @a pool. */ svn_error_t *(*uuid_record)(const char *uuid, void *parse_baton, apr_pool_t *pool); /** The parser has discovered a new node record within the current * revision represented by @a revision_baton. All the headers are * placed in @a headers (as with @c new_revision_record), allocated in * @a pool. The @a node_baton received back is allocated in @a pool * and represents the node. */ svn_error_t *(*new_node_record)(void **node_baton, apr_hash_t *headers, void *revision_baton, apr_pool_t *pool); /** For a given @a revision_baton, set a property @a name to @a value. */ svn_error_t *(*set_revision_property)(void *revision_baton, const char *name, const svn_string_t *value); /** For a given @a node_baton, set a property @a name to @a value. */ svn_error_t *(*set_node_property)(void *node_baton, const char *name, const svn_string_t *value); /** For a given @a node_baton, delete property @a name. */ svn_error_t *(*delete_node_property)(void *node_baton, const char *name); /** For a given @a node_baton, remove all properties. */ svn_error_t *(*remove_node_props)(void *node_baton); /** For a given @a node_baton, receive a writable @a stream capable of * receiving the node's fulltext. After writing the fulltext, call * the stream's close() function. * * If a @c NULL is returned instead of a stream, the vtable is * indicating that no text is desired, and the parser will not * attempt to send it. */ svn_error_t *(*set_fulltext)(svn_stream_t **stream, void *node_baton); /** For a given @a node_baton, set @a handler and @a handler_baton * to a window handler and baton capable of receiving a delta * against the node's previous contents. A NULL window will be * sent to the handler after all the windows are sent. * * If a @c NULL is returned instead of a handler, the vtable is * indicating that no delta is desired, and the parser will not * attempt to send it. */ svn_error_t *(*apply_textdelta)(svn_txdelta_window_handler_t *handler, void **handler_baton, void *node_baton); /** The parser has reached the end of the current node represented by * @a node_baton, it can be freed. */ svn_error_t *(*close_node)(void *node_baton); /** The parser has reached the end of the current revision * represented by @a revision_baton. In other words, there are no more * changed nodes within the revision. The baton can be freed. */ svn_error_t *(*close_revision)(void *revision_baton); } svn_repos_parse_fns2_t; /** @deprecated Provided for backward compatibility with the 1.2 API. */ typedef svn_repos_parse_fns2_t svn_repos_parser_fns2_t; /** * Read and parse dumpfile-formatted @a stream, calling callbacks in * @a parse_fns/@a parse_baton, and using @a pool for allocations. * * If @a cancel_func is not @c NULL, it is called periodically with * @a cancel_baton as argument to see if the client wishes to cancel * the dump. * * This parser has built-in knowledge of the dumpfile format, but only * in a general sense: * * * it recognizes revision and node records by looking for either * a REVISION_NUMBER or NODE_PATH headers. * * * it recognizes the CONTENT-LENGTH headers, so it knows if and * how to suck up the content body. * * * it knows how to parse a content body into two parts: props * and text, and pass the pieces to the vtable. * * This is enough knowledge to make it easy on vtable implementors, * but still allow expansion of the format: most headers are ignored. * * @since New in 1.1. */ svn_error_t * svn_repos_parse_dumpstream2(svn_stream_t *stream, const svn_repos_parse_fns2_t *parse_fns, void *parse_baton, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool); /** * Set @a *parser and @a *parse_baton to a vtable parser which commits new * revisions to the fs in @a repos. The constructed parser will treat * UUID records in a manner consistent with @a uuid_action. Use @a pool * to operate on the fs. * * If @a use_history is set, then the parser will require relative * 'copyfrom' history to exist in the repository when it encounters * nodes that are added-with-history. * * If @a parent_dir is not NULL, then the parser will reparent all the * loaded nodes, from root to @a parent_dir. The directory @a parent_dir * must be an existing directory in the repository. * * Print all parsing feedback to @a outstream (if non-@c NULL). * * * @since New in 1.1. */ svn_error_t * svn_repos_get_fs_build_parser2(const svn_repos_parse_fns2_t **parser, void **parse_baton, svn_repos_t *repos, svn_boolean_t use_history, enum svn_repos_load_uuid uuid_action, svn_stream_t *outstream, const char *parent_dir, apr_pool_t *pool); /** * A vtable that is driven by svn_repos_parse_dumpstream(). * Similar to @c svn_repos_parse_fns2_t except that it lacks * the delete_node_property and apply_textdelta callbacks. * * @deprecated Provided for backward compatibility with the 1.0 API. */ typedef struct svn_repos_parse_fns_t { /** Same as the corresponding field in @c svn_repos_parse_fns2_t. */ svn_error_t *(*new_revision_record)(void **revision_baton, apr_hash_t *headers, void *parse_baton, apr_pool_t *pool); /** Same as the corresponding field in @c svn_repos_parse_fns2_t. */ svn_error_t *(*uuid_record)(const char *uuid, void *parse_baton, apr_pool_t *pool); /** Same as the corresponding field in @c svn_repos_parse_fns2_t. */ svn_error_t *(*new_node_record)(void **node_baton, apr_hash_t *headers, void *revision_baton, apr_pool_t *pool); /** Same as the corresponding field in @c svn_repos_parse_fns2_t. */ svn_error_t *(*set_revision_property)(void *revision_baton, const char *name, const svn_string_t *value); /** Same as the corresponding field in @c svn_repos_parse_fns2_t. */ svn_error_t *(*set_node_property)(void *node_baton, const char *name, const svn_string_t *value); /** Same as the corresponding field in @c svn_repos_parse_fns2_t. */ svn_error_t *(*remove_node_props)(void *node_baton); /** Same as the corresponding field in @c svn_repos_parse_fns2_t. */ svn_error_t *(*set_fulltext)(svn_stream_t **stream, void *node_baton); /** Same as the corresponding field in @c svn_repos_parse_fns2_t. */ svn_error_t *(*close_node)(void *node_baton); /** Same as the corresponding field in @c svn_repos_parse_fns2_t. */ svn_error_t *(*close_revision)(void *revision_baton); } svn_repos_parser_fns_t; /** * Similar to svn_repos_parse_dumpstream2(), but uses the more limited * @c svn_repos_parser_fns_t vtable type. * * @deprecated Provided for backward compatibility with the 1.0 API. */ SVN_DEPRECATED svn_error_t * svn_repos_parse_dumpstream(svn_stream_t *stream, const svn_repos_parser_fns_t *parse_fns, void *parse_baton, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool); /** * Similar to svn_repos_get_fs_build_parser2(), but yields the more * limited svn_repos_parser_fns_t vtable type. * * @deprecated Provided for backward compatibility with the 1.0 API. */ SVN_DEPRECATED svn_error_t * svn_repos_get_fs_build_parser(const svn_repos_parser_fns_t **parser, void **parse_baton, svn_repos_t *repos, svn_boolean_t use_history, enum svn_repos_load_uuid uuid_action, svn_stream_t *outstream, const char *parent_dir, apr_pool_t *pool); /** @} */ /** A data type which stores the authz information. * * @since New in 1.3. */ typedef struct svn_authz_t svn_authz_t; /** Read authz configuration data from @a file (a file or registry * path) into @a *authz_p, allocated in @a pool. * * If @a file is not a valid authz rule file, then return * SVN_AUTHZ_INVALID_CONFIG. The contents of @a *authz_p is then * undefined. If @a must_exist is TRUE, a missing authz file is also * an error. * * @since New in 1.3. */ svn_error_t * svn_repos_authz_read(svn_authz_t **authz_p, const char *file, svn_boolean_t must_exist, apr_pool_t *pool); /** * Check whether @a user can access @a path in the repository @a * repos_name with the @a required_access. @a authz lists the ACLs to * check against. Set @a *access_granted to indicate if the requested * access is granted. * * If @a path is NULL, then check whether @a user has the @a * required_access anywhere in the repository. Set @a *access_granted * to TRUE if at least one path is accessible with the @a * required_access. * * @since New in 1.3. */ svn_error_t * svn_repos_authz_check_access(svn_authz_t *authz, const char *repos_name, const char *path, const char *user, svn_repos_authz_access_t required_access, svn_boolean_t *access_granted, apr_pool_t *pool); /** Revision Access Levels * * Like most version control systems, access to versioned objects in * Subversion is determined on primarily path-based system. Users either * do or don't have the ability to read a given path. * * However, unlike many version control systems where versioned objects * maintain their own distinct version information (revision numbers, * authors, log messages, change timestamps, etc.), Subversion binds * multiple paths changed as part of a single commit operation into a * set, calls the whole thing a revision, and hangs commit metadata * (author, date, log message, etc.) off of that revision. So, commit * metadata is shared across all the paths changed as part of a given * commit operation. * * It is common (or, at least, we hope it is) for log messages to give * detailed information about changes made in the commit to which the log * message is attached. Such information might include a mention of all * the files changed, what was changed in them, and so on. But this * causes a problem when presenting information to readers who aren't * authorized to read every path in the repository. Simply knowing that * a given path exists may be a security leak, even if the user can't see * the contents of the data located at that path. * * So Subversion does what it reasonably can to prevent the leak of this * information, and does so via a staged revision access policy. A * reader can be said to have one of three levels of access to a given * revision's metadata, based solely on the reader's access rights to the * paths changed or copied in that revision: * * 'full access' -- Granted when the reader has access to all paths * changed or copied in the revision, or when no paths were * changed in the revision at all, this access level permits * full visibility of all revision property names and values, * and the full changed-paths information. * * 'no access' -- Granted when the reader does not have access to any * paths changed or copied in the revision, this access level * denies the reader access to all revision properties and all * changed-paths information. * * 'partial access' -- Granted when the reader has access to at least * one, but not all, of the paths changed or copied in the revision, * this access level permits visibility of the svn:date and * svn:author revision properties and only the paths of the * changed-paths information to which the reader has access. * */ /** An enum defining levels of revision access. * * @since New in 1.5. */ typedef enum { svn_repos_revision_access_none, svn_repos_revision_access_partial, svn_repos_revision_access_full } svn_repos_revision_access_level_t; /** * Set @a access to the access level granted for @a revision in @a * repos, as determined by consulting the @a authz_read_func callback * function and its associated @a authz_read_baton. * * @a authz_read_func may be @c NULL, in which case @a access will be * set to @c svn_repos_revision_access_full. * * @since New in 1.5. */ svn_error_t * svn_repos_check_revision_access(svn_repos_revision_access_level_t *access_level, svn_repos_t *repos, svn_revnum_t revision, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, apr_pool_t *pool); /** Capabilities **/ /** * Store in @a repos the client-reported capabilities @a capabilities, * which must be allocated in memory at least as long-lived as @a repos. * * The elements of @a capabilities are 'const char *', a subset of * the constants beginning with @c SVN_RA_CAPABILITY_. * @a capabilities is not copied, so changing it later will affect * what is remembered by @a repos. * * @note The capabilities are passed along to the start-commit hook; * see that hook's template for details. * * @note As of Subversion 1.5, there are no error conditions defined, * so this always returns SVN_NO_ERROR. In future releases it may * return error, however, so callers should check. * * @since New in 1.5. */ svn_error_t * svn_repos_remember_client_capabilities(svn_repos_t *repos, apr_array_header_t *capabilities); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* SVN_REPOS_H */ 0707010002c661000081a40000000000000000000000014cb50d8e000051b60000010000010036ffffffffffffffff0000003000000000root/usr/local/include/subversion-1/svn_subst.h/** * @copyright * ==================================================================== * Copyright (c) 2000-2004 CollabNet. All rights reserved. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://subversion.tigris.org/license-1.html. * If newer versions of this license are posted there, you may use a * newer version instead, at your option. * * This software consists of voluntary contributions made by many * individuals. For exact contribution history, see the revision * history and logs, available at http://subversion.tigris.org/. * ==================================================================== * @endcopyright * * @file svn_subst.h * @brief Data substitution (keywords and EOL style) */ #ifndef SVN_SUBST_H #define SVN_SUBST_H #include #include #include #include "svn_types.h" #include "svn_string.h" #include "svn_io.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /* EOL conversion and keyword expansion. */ /** The EOL used in the Repository for "native" files */ #define SVN_SUBST_NATIVE_EOL_STR "\n" /** Valid states for 'svn:eol-style' property. * * Property nonexistence is equivalent to 'none'. */ typedef enum svn_subst_eol_style { /** An unrecognized style */ svn_subst_eol_style_unknown, /** EOL translation is "off" or ignored value */ svn_subst_eol_style_none, /** Translation is set to client's native eol */ svn_subst_eol_style_native, /** Translation is set to one of LF, CR, CRLF */ svn_subst_eol_style_fixed } svn_subst_eol_style_t; /** Set @a *style to the appropriate @c svn_subst_eol_style_t and @a *eol to * the appropriate cstring for a given svn:eol-style property value. * * Set @a *eol to * * - @c NULL for @c svn_subst_eol_style_none, or * * - a NULL-terminated C string containing the native eol marker * for this platform, for @c svn_subst_eol_style_native, or * * - a NULL-terminated C string containing the eol marker indicated * by the property value, for @c svn_subst_eol_style_fixed. * * If @a *style is NULL, it is ignored. */ void svn_subst_eol_style_from_value(svn_subst_eol_style_t *style, const char **eol, const char *value); /** Indicates whether the working copy and normalized versions of a file * with the given the parameters differ. If @a force_eol_check is TRUE, * the routine also accounts for all translations required due to repairing * fixed eol styles. * * @since New in 1.4 * */ svn_boolean_t svn_subst_translation_required(svn_subst_eol_style_t style, const char *eol, apr_hash_t *keywords, svn_boolean_t special, svn_boolean_t force_eol_check); /** Values used in keyword expansion. * * @deprecated Provided for backward compatibility with the 1.2 API. */ typedef struct svn_subst_keywords_t { /** * @name svn_subst_keywords_t fields * String expansion of the like-named keyword, or NULL if the keyword * was not selected in the svn:keywords property. * @{ */ const svn_string_t *revision; const svn_string_t *date; const svn_string_t *author; const svn_string_t *url; const svn_string_t *id; /** @} */ } svn_subst_keywords_t; /** * Set @a *kw to a new keywords hash filled with the appropriate contents * given a @a keywords_string (the contents of the svn:keywords * property for the file in question), the revision @a rev, the @a url, * the @a date the file was committed on, and the @a author of the last * commit. Any of these can be @c NULL to indicate that the information is * not present, or @c 0 for @a date. * * Hash keys are of type const char *. * Hash values are of type svn_string_t *. * * All memory is allocated out of @a pool. * * @since New in 1.3. */ svn_error_t * svn_subst_build_keywords2(apr_hash_t **kw, const char *keywords_string, const char *rev, const char *url, apr_time_t date, const char *author, apr_pool_t *pool); /** Similar to svn_subst_build_keywords2() except that it populates * an existing structure @a *kw instead of creating a keywords hash. * * @deprecated Provided for backward compatibility with the 1.2 API. */ SVN_DEPRECATED svn_error_t * svn_subst_build_keywords(svn_subst_keywords_t *kw, const char *keywords_string, const char *rev, const char *url, apr_time_t date, const char *author, apr_pool_t *pool); /** Return @c TRUE if @a a and @a b do not hold the same keywords. * * @a a and @a b are hashes of the form produced by * svn_subst_build_keywords2(). * * @since New in 1.3. * * If @a compare_values is @c TRUE, "same" means that the @a a and @a b * contain exactly the same set of keywords, and the values of corresponding * keywords match as well. Else if @a compare_values is @c FALSE, then * "same" merely means that @a a and @a b hold the same set of keywords, * although those keywords' values might differ. * * @a a and/or @a b may be @c NULL; for purposes of comparison, @c NULL is * equivalent to holding no keywords. */ svn_boolean_t svn_subst_keywords_differ2(apr_hash_t *a, apr_hash_t *b, svn_boolean_t compare_values, apr_pool_t *pool); /** Similar to svn_subst_keywords_differ2() except that it compares * two @c svn_subst_keywords_t structs instead of keyword hashes. * * @deprecated Provided for backward compatibility with the 1.2 API. */ SVN_DEPRECATED svn_boolean_t svn_subst_keywords_differ(const svn_subst_keywords_t *a, const svn_subst_keywords_t *b, svn_boolean_t compare_values); /** * Copy and translate the data in stream @a src into stream @a dst. It is * assumed that @a src is a readable stream and @a dst is a writable stream. * * If @a eol_str is non-@c NULL, replace whatever bytestring @a src uses to * denote line endings with @a eol_str in the output. If @a src has an * inconsistent line ending style, then: if @a repair is @c FALSE, return * @c SVN_ERR_IO_INCONSISTENT_EOL, else if @a repair is @c TRUE, convert any * line ending in @a src to @a eol_str in @a dst. Recognized line endings are: * "\n", "\r", and "\r\n". * * Expand and contract keywords using the contents of @a keywords as the * new values. If @a expand is @c TRUE, expand contracted keywords and * re-expand expanded keywords. If @a expand is @c FALSE, contract expanded * keywords and ignore contracted ones. Keywords not found in the hash are * ignored (not contracted or expanded). If the @a keywords hash * itself is @c NULL, keyword substitution will be altogether ignored. * * Detect only keywords that are no longer than @c SVN_KEYWORD_MAX_LEN * bytes, including the delimiters and the keyword itself. * * Note that a translation request is *required*: one of @a eol_str or * @a keywords must be non-@c NULL. * * Recommendation: if @a expand is FALSE, then you don't care about the * keyword values, so use empty strings as non-NULL signifiers when you * build the keywords hash. * * Notes: * * See svn_wc__get_keywords() and svn_wc__get_eol_style() for a * convenient way to get @a eol_str and @a keywords if in libsvn_wc. * * @since New in 1.3. * * @deprecated Provided for backward compatibility with the 1.5 API. * Callers should use svn_subst_stream_translated() instead. */ SVN_DEPRECATED svn_error_t * svn_subst_translate_stream3(svn_stream_t *src_stream, svn_stream_t *dst_stream, const char *eol_str, svn_boolean_t repair, apr_hash_t *keywords, svn_boolean_t expand, apr_pool_t *scratch_pool); /** Similar to svn_subst_translate_stream3() except relies upon a * @c svn_subst_keywords_t struct instead of a hash for the keywords. * * @deprecated Provided for backward compatibility with the 1.2 API. */ SVN_DEPRECATED svn_error_t * svn_subst_translate_stream2(svn_stream_t *src_stream, svn_stream_t *dst_stream, const char *eol_str, svn_boolean_t repair, const svn_subst_keywords_t *keywords, svn_boolean_t expand, apr_pool_t *scratch_pool); /** * Same as svn_subst_translate_stream2(), but does not take a @a pool * argument, instead creates a temporary subpool of the global pool, and * destroys it before returning. * * @deprecated Provided for backward compatibility with the 1.1 API. */ SVN_DEPRECATED svn_error_t * svn_subst_translate_stream(svn_stream_t *src_stream, svn_stream_t *dst_stream, const char *eol_str, svn_boolean_t repair, const svn_subst_keywords_t *keywords, svn_boolean_t expand); /** Return a stream which performs eol translation and keyword * expansion when read from or written to. The stream @a stream * is used to read and write all data. * * Make sure you call svn_stream_close() on the returned stream to * ensure all data is flushed and cleaned up (this will also close * the provided @a stream). * * Read operations from and write operations to the stream * perform the same operation: if @a expand is @c FALSE, both * contract keywords. One stream supports both read and write * operations. Reads and writes may be mixed. * * The stream returned is allocated in @a pool. * * @since New in 1.4. */ svn_stream_t * svn_subst_stream_translated(svn_stream_t *stream, const char *eol_str, svn_boolean_t repair, apr_hash_t *keywords, svn_boolean_t expand, apr_pool_t *pool); /** Return a stream which performs eol translation and keyword * expansion when read from or written to. The stream @a stream * is used to read and write all data. Make sure you call * svn_stream_close() on @a stream to make sure all data are flushed * and cleaned up. * * When @a stream is closed, then @a source will be closed. * * Read and write operations perform the same transformation: * all data is translated to normal form. * * @see svn_subst_translate_to_normal_form() * * @since New in 1.5. * @deprecated Provided for backward compatibility with the 1.5 API. */ SVN_DEPRECATED svn_error_t * svn_subst_stream_translated_to_normal_form(svn_stream_t **stream, svn_stream_t *source, svn_subst_eol_style_t eol_style, const char *eol_str, svn_boolean_t always_repair_eols, apr_hash_t *keywords, apr_pool_t *pool); /** Returns a readable stream in @a *stream containing the "normal form" * of the special file located at @a path. The stream will be allocated * in @a result_pool, and any temporary allocations will be made in * @a scratch_pool. * * @since New in 1.6. */ svn_error_t * svn_subst_read_specialfile(svn_stream_t **stream, const char *path, apr_pool_t *result_pool, apr_pool_t *scratch_pool); /** Returns a writeable stream in @a *stream that accepts content in * the "normal form" for a special file, to be located at @a path, and * will create that file when the stream is closed. The stream will be * allocated in @a result_pool, and any temporary allocations will be * made in @a scratch_pool. * * @since New in 1.6. */ svn_error_t * svn_subst_create_specialfile(svn_stream_t **stream, const char *path, apr_pool_t *result_pool, apr_pool_t *scratch_pool); /** Returns a stream which translates the special file at @a path to * the internal representation for special files when read from. When * written to, it does the reverse: creating a special file when the * stream is closed. * * @since New in 1.5. * * @deprecated Provided for backward compatibility with the 1.5 API. * Callers should use svn_subst_read_specialfile or * svn_subst_create_specialfile as appropriate. */ SVN_DEPRECATED svn_error_t * svn_subst_stream_from_specialfile(svn_stream_t **stream, const char *path, apr_pool_t *pool); /** * Translates the file at path @a src into a file at path @a dst. The * parameters @a *eol_str, @a repair, @a *keywords and @a expand are * defined the same as in svn_subst_translate_stream3(). * * In addition, it will create a special file from normal form or * translate one to normal form if @a special is @c TRUE. * * Copy the contents of file-path @a src to file-path @a dst atomically, * either creating @a dst (or overwriting @a dst if it exists), possibly * performing line ending and keyword translations. * * If anything goes wrong during the copy, attempt to delete @a dst (if * it exists). * * If @a eol_str and @a keywords are @c NULL, behavior is just a byte-for-byte * copy. * * @since New in 1.3. */ svn_error_t * svn_subst_copy_and_translate3(const char *src, const char *dst, const char *eol_str, svn_boolean_t repair, apr_hash_t *keywords, svn_boolean_t expand, svn_boolean_t special, apr_pool_t *pool); /** * Similar to svn_subst_copy_and_translate3() except that @a keywords is a * @c svn_subst_keywords_t struct instead of a keywords hash. * * @deprecated Provided for backward compatibility with the 1.2 API. * @since New in 1.1. */ SVN_DEPRECATED svn_error_t * svn_subst_copy_and_translate2(const char *src, const char *dst, const char *eol_str, svn_boolean_t repair, const svn_subst_keywords_t *keywords, svn_boolean_t expand, svn_boolean_t special, apr_pool_t *pool); /** * Similar to svn_subst_copy_and_translate2() except that @a special is * always set to @c FALSE. * * @deprecated Provided for backward compatibility with the 1.0 API. */ SVN_DEPRECATED svn_error_t * svn_subst_copy_and_translate(const char *src, const char *dst, const char *eol_str, svn_boolean_t repair, const svn_subst_keywords_t *keywords, svn_boolean_t expand, apr_pool_t *pool); /** * Convenience routine: a variant of svn_subst_translate_stream3() which * operates on cstrings. * * @since New in 1.3. * * Return a new string in @a *dst, allocated in @a pool, by copying the * contents of string @a src, possibly performing line ending and keyword * translations. * * If @a eol_str and @a keywords are @c NULL, behavior is just a byte-for-byte * copy. */ svn_error_t * svn_subst_translate_cstring2(const char *src, const char **dst, const char *eol_str, svn_boolean_t repair, apr_hash_t *keywords, svn_boolean_t expand, apr_pool_t *pool); /** * Similar to svn_subst_translate_cstring2() except that @a keywords is a * @c svn_subst_keywords_t struct instead of a keywords hash. * * @deprecated Provided for backward compatibility with the 1.2 API. */ SVN_DEPRECATED svn_error_t * svn_subst_translate_cstring(const char *src, const char **dst, const char *eol_str, svn_boolean_t repair, const svn_subst_keywords_t *keywords, svn_boolean_t expand, apr_pool_t *pool); /** * Translates a file @a src in working copy form to a file @a dst in * normal form. * * The values specified for @a eol_style, @a *eol_str, @a keywords and * @a special, should be the ones used to translate the file to its * working copy form. Usually, these are the values specified by the * user in the files' properties. * * Inconsistent line endings in the file will be automatically repaired * (made consistent) for some eol styles. For all others, an error is * returned. By setting @a always_repair_eols to @c TRUE, eols will be * made consistent even for those styles which don't have it by default. * * @note To translate a file FROM normal form, use * svn_subst_copy_and_translate3(). * * @since New in 1.4 * @deprecated Provided for backward compatibility with the 1.5 API */ SVN_DEPRECATED svn_error_t * svn_subst_translate_to_normal_form(const char *src, const char *dst, svn_subst_eol_style_t eol_style, const char *eol_str, svn_boolean_t always_repair_eols, apr_hash_t *keywords, svn_boolean_t special, apr_pool_t *pool); /** * Set @a *stream_p to a stream that detranslates the file @a src from * working copy form to normal form, allocated in @a pool. * * The values specified for @a eol_style, @a *eol_str, @a keywords and * @a special, should be the ones used to translate the file to its * working copy form. Usually, these are the values specified by the * user in the files' properties. * * Inconsistent line endings in the file will be automatically repaired * (made consistent) for some eol styles. For all others, an error is * returned. By setting @a always_repair_eols to @c TRUE, eols will be * made consistent even for those styles which don't have it by default. * * @since New in 1.4. * * @deprecated Provided for backward compatibility with the 1.5 API. * Use svn_subst_stream_from_specialfile if the source is special; * otherwise, use svn_subst_stream_translated_to_normal_form. */ SVN_DEPRECATED svn_error_t * svn_subst_stream_detranslated(svn_stream_t **stream_p, const char *src, svn_subst_eol_style_t eol_style, const char *eol_str, svn_boolean_t always_repair_eols, apr_hash_t *keywords, svn_boolean_t special, apr_pool_t *pool); /* EOL conversion and character encodings */ /** Translate the data in @a value (assumed to be in encoded in charset * @a encoding) to UTF8 and LF line-endings. If @a encoding is @c NULL, * then assume that @a value is in the system-default language encoding. * Return the translated data in @a *new_value, allocated in @a pool. */ svn_error_t *svn_subst_translate_string(svn_string_t **new_value, const svn_string_t *value, const char *encoding, apr_pool_t *pool); /** Translate the data in @a value from UTF8 and LF line-endings into * native locale and native line-endings, or to the output locale if * @a for_output is TRUE. Return the translated data in @a * *new_value, allocated in @a pool. */ svn_error_t *svn_subst_detranslate_string(svn_string_t **new_value, const svn_string_t *value, svn_boolean_t for_output, apr_pool_t *pool); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* SVN_SUBST_H */ 0707010002c651000081a40000000000000000000000014cb50d8e00001bb40000010000010036ffffffffffffffff0000002f00000000root/usr/local/include/subversion-1/svn_hash.h/** * @copyright * ==================================================================== * Copyright (c) 2000-2004, 2008 CollabNet. All rights reserved. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://subversion.tigris.org/license-1.html. * If newer versions of this license are posted there, you may use a * newer version instead, at your option. * * This software consists of voluntary contributions made by many * individuals. For exact contribution history, see the revision * history and logs, available at http://subversion.tigris.org/. * ==================================================================== * @endcopyright * * @file svn_hash.h * @brief Dumping and reading hash tables to/from files. */ #ifndef SVN_HASH_H #define SVN_HASH_H #include #include #include #include #include /* for apr_file_t */ #include "svn_types.h" #include "svn_io.h" /* for svn_stream_t */ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** The longest the "K " line can be in one of our hashdump files. */ #define SVN_KEYLINE_MAXLEN 100 /** * @defgroup svn_hash_support Hash table serialization support * @{ */ /*----------------------------------------------------*/ /** Reading/writing hashtables to disk * * @defgroup svn_hash_read_write Reading and writing hashtables to disk * @{ */ /** * The conventional terminator for hash dumps. * * @since New in 1.1. */ #define SVN_HASH_TERMINATOR "END" /** * Read a hash table from @a stream, storing the resultants names and * values in @a hash. Use a @a pool for all allocations. @a hash will * have const char * keys and svn_string_t * values. * If @a terminator is NULL, expect the hash to be terminated by the * end of the stream; otherwise, expect the hash to be terminated by a * line containing @a terminator. Pass @c SVN_HASH_TERMINATOR to use * the conventional terminator "END". * * @since New in 1.1. */ svn_error_t * svn_hash_read2(apr_hash_t *hash, svn_stream_t *stream, const char *terminator, apr_pool_t *pool); /** * Dump @a hash to @a stream. Use @a pool for all allocations. @a * hash has const char * keys and svn_string_t * * values. If @a terminator is not NULL, terminate the hash with a * line containing @a terminator. * * @since New in 1.1. */ svn_error_t * svn_hash_write2(apr_hash_t *hash, svn_stream_t *stream, const char *terminator, apr_pool_t *pool); /** * Similar to svn_hash_read2(), but allows @a stream to contain * deletion lines which remove entries from @a hash as well as adding * to it. * * @since New in 1.1. */ svn_error_t * svn_hash_read_incremental(apr_hash_t *hash, svn_stream_t *stream, const char *terminator, apr_pool_t *pool); /** * Similar to svn_hash_write2(), but only writes out entries for * keys which differ between @a hash and @a oldhash, and also writes * out deletion lines for keys which are present in @a oldhash but not * in @a hash. * * @since New in 1.1. */ svn_error_t * svn_hash_write_incremental(apr_hash_t *hash, apr_hash_t *oldhash, svn_stream_t *stream, const char *terminator, apr_pool_t *pool); /** * This function behaves like svn_hash_read2(), but it only works * on an apr_file_t input, empty files are accepted, and the hash is * expected to be terminated with a line containing "END" or * "PROPS-END". * * @deprecated Provided for backward compatibility with the 1.0 API. */ SVN_DEPRECATED svn_error_t * svn_hash_read(apr_hash_t *hash, apr_file_t *srcfile, apr_pool_t *pool); /** * This function behaves like svn_hash_write2(), but it only works * on an apr_file_t output, and the terminator is always "END". * * @deprecated Provided for backward compatibility with the 1.0 API. */ SVN_DEPRECATED svn_error_t * svn_hash_write(apr_hash_t *hash, apr_file_t *destfile, apr_pool_t *pool); /** @} */ /** Taking the "diff" of two hash tables. * * @defgroup svn_hash_diff Taking the diff of two hash tables. * @{ */ /** Hash key status indicator for svn_hash_diff_func_t. */ enum svn_hash_diff_key_status { /* Key is present in both hashes. */ svn_hash_diff_key_both, /* Key is present in first hash only. */ svn_hash_diff_key_a, /* Key is present in second hash only. */ svn_hash_diff_key_b }; /** Function type for expressing a key's status between two hash tables. */ typedef svn_error_t *(*svn_hash_diff_func_t) (const void *key, apr_ssize_t klen, enum svn_hash_diff_key_status status, void *baton); /** Take the diff of two hashtables. * * For each key in the union of @a hash_a's and @a hash_b's keys, invoke * @a diff_func exactly once, passing the key, the key's length, an enum * @c svn_hash_diff_key_status indicating which table(s) the key appears * in, and @a diff_func_baton. * * Process all keys of @a hash_a first, then all remaining keys of @a hash_b. * * If @a diff_func returns error, return that error immediately, without * applying @a diff_func to anything else. * * @a hash_a or @a hash_b or both may be NULL; treat a null table as though * empty. * * Use @a pool for temporary allocation. */ svn_error_t * svn_hash_diff(apr_hash_t *hash_a, apr_hash_t *hash_b, svn_hash_diff_func_t diff_func, void *diff_func_baton, apr_pool_t *pool); /** @} */ /** * @defgroup svn_hash_misc Miscellaneous hash APIs * @{ */ /** * Return the keys to @a hash in @a *array. The keys are assumed to be * (const char *). The keys are in no particular order. * * @a *array itself is allocated in @a pool; however, the keys are not * copied from the hash. * * @since New in 1.5. */ svn_error_t * svn_hash_keys(apr_array_header_t **array, apr_hash_t *hash, apr_pool_t *pool); /** * Set @a *hash to a new hash whose keys come from the items in @a keys * (an array of const char * items), and whose values are * match their corresponding key. Use @a pool for all allocations * (including @a *hash, its keys, and its values). * * @since New in 1.5. */ svn_error_t * svn_hash_from_cstring_keys(apr_hash_t **hash, const apr_array_header_t *keys, apr_pool_t *pool); /** * Clear any key/value pairs in the hash table. A wrapper for a * apr_hash_clear(), which isn't available until APR 1.3.0. * * @since New in 1.5. */ svn_error_t * svn_hash__clear(apr_hash_t *hash); /** @} */ /** @} */ #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* SVN_HASH_H */ 0707010002c644000081a40000000000000000000000014cb50d8e0002971d0000010000010036ffffffffffffffff0000003100000000root/usr/local/include/subversion-1/svn_client.h/** * @copyright * ==================================================================== * Copyright (c) 2000-2008 CollabNet. All rights reserved. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://subversion.tigris.org/license-1.html. * If newer versions of this license are posted there, you may use a * newer version instead, at your option. * * This software consists of voluntary contributions made by many * individuals. For exact contribution history, see the revision * history and logs, available at http://subversion.tigris.org/. * ==================================================================== * @endcopyright * * @file svn_client.h * @brief Subversion's client library * * Requires: The working copy library and repository access library. * Provides: Broad wrappers around working copy library functionality. * Used By: Client programs. */ #ifndef SVN_CLIENT_H #define SVN_CLIENT_H #include #include #include #include #include #include #include #include "svn_types.h" #include "svn_string.h" #include "svn_wc.h" #include "svn_opt.h" #include "svn_version.h" #include "svn_ra.h" #include "svn_diff.h" #include "svn_auth.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** ### @todo Multiple Targets - Up for debate: an update on multiple targets is *not* atomic. Right now, svn_client_update only takes one path. What's debatable is whether this should ever change. On the one hand, it's kind of losing to have the client application loop over targets and call svn_client_update() on each one; each call to update initializes a whole new repository session (network overhead, etc.) On the other hand, it's a very simple implementation, and allows for the possibility that different targets may come from different repositories. */ /** * Get libsvn_client version information. * * @since New in 1.1. */ const svn_version_t * svn_client_version(void); /** Client supporting functions * * @defgroup clnt_support Client supporting subsystem * * @{ */ /*** Authentication stuff ***/ /** The new authentication system allows the RA layer to "pull" * information as needed from libsvn_client. * * @deprecated Replaced by the svn_auth_* functions. * @see auth_fns * * @defgroup auth_fns_depr (deprecated) AuthZ client subsystem * * @{ */ /** Create and return @a *provider, an authentication provider of type * svn_auth_cred_simple_t that gets information by prompting the user * with @a prompt_func and @a prompt_baton. Allocate @a *provider in * @a pool. * * If both @c SVN_AUTH_PARAM_DEFAULT_USERNAME and * @c SVN_AUTH_PARAM_DEFAULT_PASSWORD are defined as runtime * parameters in the @c auth_baton, then @a *provider will return the * default arguments when svn_auth_first_credentials() is called. If * svn_auth_first_credentials() fails, then @a *provider will * re-prompt @a retry_limit times (via svn_auth_next_credentials()). * For infinite retries, set @a retry_limit to value less than 0. * * @deprecated Provided for backward compatibility with the 1.3 API. * Use svn_auth_get_simple_prompt_provider() instead. */ SVN_DEPRECATED void svn_client_get_simple_prompt_provider (svn_auth_provider_object_t **provider, svn_auth_simple_prompt_func_t prompt_func, void *prompt_baton, int retry_limit, apr_pool_t *pool); /** Create and return @a *provider, an authentication provider of type @c * svn_auth_cred_username_t that gets information by prompting the * user with @a prompt_func and @a prompt_baton. Allocate @a *provider * in @a pool. * * If @c SVN_AUTH_PARAM_DEFAULT_USERNAME is defined as a runtime * parameter in the @c auth_baton, then @a *provider will return the * default argument when svn_auth_first_credentials() is called. If * svn_auth_first_credentials() fails, then @a *provider will * re-prompt @a retry_limit times (via svn_auth_next_credentials()). * For infinite retries, set @a retry_limit to value less than 0. * * @deprecated Provided for backward compatibility with the 1.3 API. * Use svn_auth_get_username_prompt_provider() instead. */ SVN_DEPRECATED void svn_client_get_username_prompt_provider (svn_auth_provider_object_t **provider, svn_auth_username_prompt_func_t prompt_func, void *prompt_baton, int retry_limit, apr_pool_t *pool); /** Create and return @a *provider, an authentication provider of type @c * svn_auth_cred_simple_t that gets/sets information from the user's * ~/.subversion configuration directory. Allocate @a *provider in * @a pool. * * If a default username or password is available, @a *provider will * honor them as well, and return them when * svn_auth_first_credentials() is called. (see @c * SVN_AUTH_PARAM_DEFAULT_USERNAME and @c * SVN_AUTH_PARAM_DEFAULT_PASSWORD). * * @deprecated Provided for backward compatibility with the 1.3 API. * Use svn_auth_get_simple_provider2() instead. */ SVN_DEPRECATED void svn_client_get_simple_provider(svn_auth_provider_object_t **provider, apr_pool_t *pool); #if (defined(WIN32) && !defined(__MINGW32__)) || defined(DOXYGEN) || defined(CTYPESGEN) || defined(SWIG) /** * Create and return @a *provider, an authentication provider of type @c * svn_auth_cred_simple_t that gets/sets information from the user's * ~/.subversion configuration directory. Allocate @a *provider in * @a pool. * * This is like svn_client_get_simple_provider(), except that, when * running on Window 2000 or newer (or any other Windows version that * includes the CryptoAPI), the provider encrypts the password before * storing it to disk. On earlier versions of Windows, the provider * does nothing. * * @since New in 1.2. * @note This function is only available on Windows. * * @note An administrative password reset may invalidate the account's * secret key. This function will detect that situation and behave as * if the password were not cached at all. * * @deprecated Provided for backward compatibility with the 1.3 API. * Use svn_auth_get_windows_simple_provider() instead. */ SVN_DEPRECATED void svn_client_get_windows_simple_provider(svn_auth_provider_object_t **provider, apr_pool_t *pool); #endif /* WIN32 && !__MINGW32__ || DOXYGEN || CTYPESGEN || SWIG */ /** Create and return @a *provider, an authentication provider of type @c * svn_auth_cred_username_t that gets/sets information from a user's * ~/.subversion configuration directory. Allocate @a *provider in * @a pool. * * If a default username is available, @a *provider will honor it, * and return it when svn_auth_first_credentials() is called. (see * @c SVN_AUTH_PARAM_DEFAULT_USERNAME). * * @deprecated Provided for backward compatibility with the 1.3 API. * Use svn_auth_get_username_provider() instead. */ SVN_DEPRECATED void svn_client_get_username_provider(svn_auth_provider_object_t **provider, apr_pool_t *pool); /** Create and return @a *provider, an authentication provider of type @c * svn_auth_cred_ssl_server_trust_t, allocated in @a pool. * * @a *provider retrieves its credentials from the configuration * mechanism. The returned credential is used to override SSL * security on an error. * * @deprecated Provided for backward compatibility with the 1.3 API. * Use svn_auth_get_ssl_server_trust_file_provider() instead. */ SVN_DEPRECATED void svn_client_get_ssl_server_trust_file_provider (svn_auth_provider_object_t **provider, apr_pool_t *pool); /** Create and return @a *provider, an authentication provider of type @c * svn_auth_cred_ssl_client_cert_t, allocated in @a pool. * * @a *provider retrieves its credentials from the configuration * mechanism. The returned credential is used to load the appropriate * client certificate for authentication when requested by a server. * * @deprecated Provided for backward compatibility with the 1.3 API. * Use svn_auth_get_ssl_client_cert_file_provider() instead. */ SVN_DEPRECATED void svn_client_get_ssl_client_cert_file_provider (svn_auth_provider_object_t **provider, apr_pool_t *pool); /** Create and return @a *provider, an authentication provider of type @c * svn_auth_cred_ssl_client_cert_pw_t, allocated in @a pool. * * @a *provider retrieves its credentials from the configuration * mechanism. The returned credential is used when a loaded client * certificate is protected by a passphrase. * * @deprecated Provided for backward compatibility with the 1.3 API. * Use svn_auth_get_ssl_client_cert_pw_file_provider2() instead. */ SVN_DEPRECATED void svn_client_get_ssl_client_cert_pw_file_provider (svn_auth_provider_object_t **provider, apr_pool_t *pool); /** Create and return @a *provider, an authentication provider of type @c * svn_auth_cred_ssl_server_trust_t, allocated in @a pool. * * @a *provider retrieves its credentials by using the @a prompt_func * and @a prompt_baton. The returned credential is used to override * SSL security on an error. * * @deprecated Provided for backward compatibility with the 1.3 API. * Use svn_auth_get_ssl_server_trust_prompt_provider() instead. */ SVN_DEPRECATED void svn_client_get_ssl_server_trust_prompt_provider (svn_auth_provider_object_t **provider, svn_auth_ssl_server_trust_prompt_func_t prompt_func, void *prompt_baton, apr_pool_t *pool); /** Create and return @a *provider, an authentication provider of type @c * svn_auth_cred_ssl_client_cert_t, allocated in @a pool. * * @a *provider retrieves its credentials by using the @a prompt_func * and @a prompt_baton. The returned credential is used to load the * appropriate client certificate for authentication when requested by * a server. The prompt will be retried @a retry_limit times. * For infinite retries, set @a retry_limit to value less than 0. * * @deprecated Provided for backward compatibility with the 1.3 API. * Use svn_auth_get_ssl_client_cert_prompt_provider() instead. */ SVN_DEPRECATED void svn_client_get_ssl_client_cert_prompt_provider (svn_auth_provider_object_t **provider, svn_auth_ssl_client_cert_prompt_func_t prompt_func, void *prompt_baton, int retry_limit, apr_pool_t *pool); /** Create and return @a *provider, an authentication provider of type @c * svn_auth_cred_ssl_client_cert_pw_t, allocated in @a pool. * * @a *provider retrieves its credentials by using the @a prompt_func * and @a prompt_baton. The returned credential is used when a loaded * client certificate is protected by a passphrase. The prompt will * be retried @a retry_limit times. For infinite retries, set @a retry_limit * to value less than 0. * * @deprecated Provided for backward compatibility with the 1.3 API. * Use svn_auth_get_ssl_client_cert_pw_prompt_provider() instead. */ SVN_DEPRECATED void svn_client_get_ssl_client_cert_pw_prompt_provider (svn_auth_provider_object_t **provider, svn_auth_ssl_client_cert_pw_prompt_func_t prompt_func, void *prompt_baton, int retry_limit, apr_pool_t *pool); /** @} */ /** * Commit operations * * @defgroup clnt_commit Client commit subsystem * * @{ */ /** This is a structure which stores a filename and a hash of property * names and values. * * @deprecated Provided for backward compatibility with the 1.4 API. */ typedef struct svn_client_proplist_item_t { /** The name of the node on which these properties are set. */ svn_stringbuf_t *node_name; /** A hash of (const char *) property names, and (svn_string_t *) property * values. */ apr_hash_t *prop_hash; } svn_client_proplist_item_t; /** * The callback invoked by svn_client_proplist3(). Each invocation * describes the property specified by @a item. Use @a pool for all * temporary allocation. * * @since New in 1.5. */ typedef svn_error_t *(*svn_proplist_receiver_t) (void *baton, const char *path, apr_hash_t *prop_hash, apr_pool_t *pool); /** * Return a duplicate of @a item, allocated in @a pool. No part of the new * structure will be shared with @a item. * * @since New in 1.3. * * @deprecated Provided for backward compatibility with the 1.4 API. */ SVN_DEPRECATED svn_client_proplist_item_t * svn_client_proplist_item_dup(const svn_client_proplist_item_t *item, apr_pool_t *pool); /** Information about commits passed back to client from this module. * * @deprecated Provided for backward compatibility with the 1.2 API. */ typedef struct svn_client_commit_info_t { /** just-committed revision. */ svn_revnum_t revision; /** server-side date of the commit. */ const char *date; /** author of the commit. */ const char *author; } svn_client_commit_info_t; /** * @name Commit state flags * @brief State flags for use with the @c svn_client_commit_item3_t structure * (see the note about the namespace for that structure, which also * applies to these flags). * @{ */ #define SVN_CLIENT_COMMIT_ITEM_ADD 0x01 #define SVN_CLIENT_COMMIT_ITEM_DELETE 0x02 #define SVN_CLIENT_COMMIT_ITEM_TEXT_MODS 0x04 #define SVN_CLIENT_COMMIT_ITEM_PROP_MODS 0x08 #define SVN_CLIENT_COMMIT_ITEM_IS_COPY 0x10 /** @since New in 1.2. */ #define SVN_CLIENT_COMMIT_ITEM_LOCK_TOKEN 0x20 /** @} */ /** The commit candidate structure. In order to avoid backwards * compatibility problems clients should use * svn_client_commit_item3_create() to allocate and initialize this * structure instead of doing so themselves. * * @since New in 1.5. */ typedef struct svn_client_commit_item3_t { /** absolute working-copy path of item */ const char *path; /** node kind (dir, file) */ svn_node_kind_t kind; /** commit URL for this item */ const char *url; /** revision of textbase */ svn_revnum_t revision; /** copyfrom-url or NULL if not a copied item */ const char *copyfrom_url; /** copyfrom-rev, valid when copyfrom_url != NULL */ svn_revnum_t copyfrom_rev; /** state flags */ apr_byte_t state_flags; /** An array of @c svn_prop_t *'s, which are incoming changes from * the repository to WC properties. These changes are applied * post-commit. * * When adding to this array, allocate the @c svn_prop_t and its * contents in @c incoming_prop_changes->pool, so that it has the * same lifetime as this data structure. * * See http://subversion.tigris.org/issues/show_bug.cgi?id=806 for a * description of what would happen if the post-commit process * didn't group these changes together with all other changes to the * item. */ apr_array_header_t *incoming_prop_changes; /** An array of @c svn_prop_t *'s, which are outgoing changes to * make to properties in the repository. These extra property * changes are declared pre-commit, and applied to the repository as * part of a commit. * * When adding to this array, allocate the @c svn_prop_t and its * contents in @c outgoing_prop_changes->pool, so that it has the * same lifetime as this data structure. */ apr_array_header_t *outgoing_prop_changes; } svn_client_commit_item3_t; /** The commit candidate structure. * * @deprecated Provided for backward compatibility with the 1.3 API. */ typedef struct svn_client_commit_item2_t { /** absolute working-copy path of item */ const char *path; /** node kind (dir, file) */ svn_node_kind_t kind; /** commit URL for this item */ const char *url; /** revision of textbase */ svn_revnum_t revision; /** copyfrom-url or NULL if not a copied item */ const char *copyfrom_url; /** copyfrom-rev, valid when copyfrom_url != NULL */ svn_revnum_t copyfrom_rev; /** state flags */ apr_byte_t state_flags; /** Analogous to the @c svn_client_commit_item3_t.incoming_prop_changes * field. */ apr_array_header_t *wcprop_changes; } svn_client_commit_item2_t; /** The commit candidate structure. * * @deprecated Provided for backward compatibility with the 1.2 API. */ typedef struct svn_client_commit_item_t { /** absolute working-copy path of item */ const char *path; /** node kind (dir, file) */ svn_node_kind_t kind; /** commit URL for this item */ const char *url; /** revision (copyfrom-rev if _IS_COPY) */ svn_revnum_t revision; /** copyfrom-url */ const char *copyfrom_url; /** state flags */ apr_byte_t state_flags; /** Analogous to the @c svn_client_commit_item3_t.incoming_prop_changes * field. */ apr_array_header_t *wcprop_changes; } svn_client_commit_item_t; /** Return a new commit item object, allocated in @a pool. * * In order to avoid backwards compatibility problems, this function * is used to initialize and allocate the @c svn_client_commit_item3_t * structure rather than doing so explicitly, as the size of this * structure may change in the future. * * @since New in 1.6. */ svn_client_commit_item3_t * svn_client_commit_item3_create(apr_pool_t *pool); /** Like svn_client_commit_item_create2() but with a stupid "const" * qualifier on the returned structure, and it returns an error that * will never happen. * * @deprecated Provided for backward compatibility with the 1.5 API. */ svn_error_t * svn_client_commit_item_create(const svn_client_commit_item3_t **item, apr_pool_t *pool); /** * Return a duplicate of @a item, allocated in @a pool. No part of the new * structure will be shared with @a item. * * @since New in 1.5. */ svn_client_commit_item3_t * svn_client_commit_item3_dup(const svn_client_commit_item3_t *item, apr_pool_t *pool); /** * Return a duplicate of @a item, allocated in @a pool. No part of the new * structure will be shared with @a item. * * @deprecated Provided for backward compatibility with the 1.3 API. */ SVN_DEPRECATED svn_client_commit_item2_t * svn_client_commit_item2_dup(const svn_client_commit_item2_t *item, apr_pool_t *pool); /** Callback type used by commit-y operations to get a commit log message * from the caller. * * Set @a *log_msg to the log message for the commit, allocated in @a * pool, or @c NULL if wish to abort the commit process. Set @a *tmp_file * to the path of any temporary file which might be holding that log * message, or @c NULL if no such file exists (though, if @a *log_msg is * @c NULL, this value is undefined). The log message MUST be a UTF8 * string with LF line separators. * * @a commit_items is a read-only array of @c svn_client_commit_item3_t * structures, which may be fully or only partially filled-in, * depending on the type of commit operation. * * @a baton is provided along with the callback for use by the handler. * * All allocations should be performed in @a pool. * * @since New in 1.5. */ typedef svn_error_t *(*svn_client_get_commit_log3_t) (const char **log_msg, const char **tmp_file, const apr_array_header_t *commit_items, void *baton, apr_pool_t *pool); /** Callback type used by commit-y operations to get a commit log message * from the caller. * * Set @a *log_msg to the log message for the commit, allocated in @a * pool, or @c NULL if wish to abort the commit process. Set @a *tmp_file * to the path of any temporary file which might be holding that log * message, or @c NULL if no such file exists (though, if @a *log_msg is * @c NULL, this value is undefined). The log message MUST be a UTF8 * string with LF line separators. * * @a commit_items is a read-only array of @c svn_client_commit_item2_t * structures, which may be fully or only partially filled-in, * depending on the type of commit operation. * * @a baton is provided along with the callback for use by the handler. * * All allocations should be performed in @a pool. * * @deprecated Provided for backward compatibility with the 1.3 API. */ typedef svn_error_t *(*svn_client_get_commit_log2_t) (const char **log_msg, const char **tmp_file, const apr_array_header_t *commit_items, void *baton, apr_pool_t *pool); /** Callback type used by commit-y operations to get a commit log message * from the caller. * * Set @a *log_msg to the log message for the commit, allocated in @a * pool, or @c NULL if wish to abort the commit process. Set @a *tmp_file * to the path of any temporary file which might be holding that log * message, or @c NULL if no such file exists (though, if @a *log_msg is * @c NULL, this value is undefined). The log message MUST be a UTF8 * string with LF line separators. * * @a commit_items is a read-only array of @c svn_client_commit_item_t * structures, which may be fully or only partially filled-in, * depending on the type of commit operation. * * @a baton is provided along with the callback for use by the handler. * * All allocations should be performed in @a pool. * * @deprecated Provided for backward compatibility with the 1.2 API. */ typedef svn_error_t *(*svn_client_get_commit_log_t) (const char **log_msg, const char **tmp_file, apr_array_header_t *commit_items, void *baton, apr_pool_t *pool); /** @} */ /** * Client blame * * @defgroup clnt_blame Client blame functionality * * @{ */ /** Callback type used by svn_client_blame4() to notify the caller * that line @a line_no of the blamed file was last changed in * @a revision by @a author on @a date, and that the contents were * @a line. * * If svn_client_blame4() was called with @a include_merged_revisions set to * TRUE, @a merged_revision, @a merged_author, @a merged_date, and * @a merged_path will be set, otherwise they will be NULL. @a merged_path * will be set to the absolute repository path. * * All allocations should be performed in @a pool. * * @note If there is no blame information for this line, @a revision will be * invalid and @a author and @a date will be NULL. * * * @since New in 1.5. */ typedef svn_error_t *(*svn_client_blame_receiver2_t) (void *baton, apr_int64_t line_no, svn_revnum_t revision, const char *author, const char *date, svn_revnum_t merged_revision, const char *merged_author, const char *merged_date, const char *merged_path, const char *line, apr_pool_t *pool); /** * Similar to @c svn_client_blame_receiver2_t, but without @a merged_revision, * @a merged_author, @a merged_date, or @a merged_path members. * * @note New in 1.4 is that the line is defined to contain only the line * content (and no [partial] EOLs; which was undefined in older versions). * Using this callback with svn_client_blame() or svn_client_blame2() * will still give you the old behaviour. * * @deprecated Provided for backward compatibility with the 1.4 API. */ typedef svn_error_t *(*svn_client_blame_receiver_t) (void *baton, apr_int64_t line_no, svn_revnum_t revision, const char *author, const char *date, const char *line, apr_pool_t *pool); /** @} */ /** * Client diff * * @defgroup clnt_diff Client diff functionality * * @{ */ /** The difference type in an svn_diff_summarize_t structure. * * @since New in 1.4. */ typedef enum svn_client_diff_summarize_kind_t { /** An item with no text modifications */ svn_client_diff_summarize_kind_normal, /** An added item */ svn_client_diff_summarize_kind_added, /** An item with text modifications */ svn_client_diff_summarize_kind_modified, /** A deleted item */ svn_client_diff_summarize_kind_deleted } svn_client_diff_summarize_kind_t; /** A struct that describes the diff of an item. Passed to * @c svn_diff_summarize_func_t. * * @note Fields may be added to the end of this structure in future * versions. Therefore, users shouldn't allocate structures of this * type, to preserve binary compatibility. * * @since New in 1.4. */ typedef struct svn_client_diff_summarize_t { /** Path relative to the target. If the target is a file, path is * the empty string. */ const char *path; /** Change kind */ svn_client_diff_summarize_kind_t summarize_kind; /** Properties changed? */ svn_boolean_t prop_changed; /** File or dir */ svn_node_kind_t node_kind; } svn_client_diff_summarize_t; /** * Return a duplicate of @a diff, allocated in @a pool. No part of the new * structure will be shared with @a diff. * * @since New in 1.4. */ svn_client_diff_summarize_t * svn_client_diff_summarize_dup(const svn_client_diff_summarize_t *diff, apr_pool_t *pool); /** A callback used in svn_client_diff_summarize2() and * svn_client_diff_summarize_peg2() for reporting a @a diff summary. * * All allocations should be performed in @a pool. * * @a baton is a closure object; it should be provided by the implementation, * and passed by the caller. * * @since New in 1.4. */ typedef svn_error_t *(*svn_client_diff_summarize_func_t) (const svn_client_diff_summarize_t *diff, void *baton, apr_pool_t *pool); /** @} */ /** * Client context * * @defgroup clnt_ctx Client context management * * @{ */ /** A client context structure, which holds client specific callbacks, * batons, serves as a cache for configuration options, and other various * and sundry things. In order to avoid backwards compatibility problems * clients should use svn_client_create_context() to allocate and * initialize this structure instead of doing so themselves. */ typedef struct svn_client_ctx_t { /** main authentication baton. */ svn_auth_baton_t *auth_baton; /** notification callback function. * This will be called by notify_func2() by default. * @deprecated Provided for backward compatibility with the 1.1 API. * Use @c notify_func2 instead. */ svn_wc_notify_func_t notify_func; /** notification callback baton for notify_func() * @deprecated Provided for backward compatibility with the 1.1 API. * Use @c notify_baton2 instead */ void *notify_baton; /** Log message callback function. NULL means that Subversion * should try not attempt to fetch a log message. * @deprecated Provided for backward compatibility with the 1.2 API. * Use @c log_msg_func2 instead. */ svn_client_get_commit_log_t log_msg_func; /** log message callback baton * @deprecated Provided for backward compatibility with the 1.2 API. * Use @c log_msg_baton2 instead. */ void *log_msg_baton; /** a hash mapping of const char * configuration file names to * @c svn_config_t *'s. For example, the '~/.subversion/config' file's * contents should have the key "config". May be left unset (or set to * NULL) to use the built-in default settings and not use any configuration. */ apr_hash_t *config; /** a callback to be used to see if the client wishes to cancel the running * operation. */ svn_cancel_func_t cancel_func; /** a baton to pass to the cancellation callback. */ void *cancel_baton; /** notification function, defaulting to a function that forwards * to notify_func(). * @since New in 1.2. */ svn_wc_notify_func2_t notify_func2; /** notification baton for notify_func2(). * @since New in 1.2. */ void *notify_baton2; /** Log message callback function. NULL means that Subversion * should try log_msg_func. * @since New in 1.3. */ svn_client_get_commit_log2_t log_msg_func2; /** callback baton for log_msg_func2 * @since New in 1.3. */ void *log_msg_baton2; /** Notification callback for network progress information. * May be NULL if not used. * @since New in 1.3. */ svn_ra_progress_notify_func_t progress_func; /** Callback baton for progress_func. * @since New in 1.3. */ void *progress_baton; /** Log message callback function. NULL means that Subversion * should try @c log_msg_func2, then @c log_msg_func. * @since New in 1.5. */ svn_client_get_commit_log3_t log_msg_func3; /** The callback baton for @c log_msg_func3. * @since New in 1.5. */ void *log_msg_baton3; /** MIME types map. * @since New in 1.5. */ apr_hash_t *mimetypes_map; /** Conflict resolution callback and baton, if available. * @since New in 1.5. */ svn_wc_conflict_resolver_func_t conflict_func; void *conflict_baton; /** Custom client name string, or @c null. * @since New in 1.5. */ const char *client_name; } svn_client_ctx_t; /** Initialize a client context. * Set @a *ctx to a client context object, allocated in @a pool, that * represents a particular instance of an svn client. * * In order to avoid backwards compatibility problems, clients must * use this function to initialize and allocate the * @c svn_client_ctx_t structure rather than doing so themselves, as * the size of this structure may change in the future. * * The current implementation never returns error, but callers should * still check for error, for compatibility with future versions. */ svn_error_t * svn_client_create_context(svn_client_ctx_t **ctx, apr_pool_t *pool); /** @} end group: Client context management */ /** * @name Authentication information file names * * Names of files that contain authentication information. * * These filenames are decided by libsvn_client, since this library * implements all the auth-protocols; libsvn_wc does nothing but * blindly store and retrieve these files from protected areas. * * @defgroup clnt_auth_filenames Client authentication file names * @{ */ #define SVN_CLIENT_AUTH_USERNAME "username" #define SVN_CLIENT_AUTH_PASSWORD "password" /** @} group end: Authentication information file names */ /** Client argument processing * * @defgroup clnt_cmdline Client command-line processing * * @{ */ /** * Pull remaining target arguments from @a os into @a *targets_p, * converting them to UTF-8, followed by targets from @a known_targets * (which might come from, for example, the "--targets" command line option). * * On each URL target, do some IRI-to-URI encoding and some auto-escaping. * On each local path, canonicalize case and path separators. * * Allocate @a *targets_p and its elements in @a pool. * * @a ctx is required for possible repository authentication. * * If a path has the same name as a Subversion working copy * administrative directory, return SVN_ERR_RESERVED_FILENAME_SPECIFIED; * if multiple reserved paths are encountered, return a chain of * errors, all of which are SVN_ERR_RESERVED_FILENAME_SPECIFIED. Do * not return this type of error in a chain with any other type of * error, and if this is the only type of error encountered, complete * the operation before returning the error(s). * * @since New in 1.6 */ svn_error_t * svn_client_args_to_target_array(apr_array_header_t **targets_p, apr_getopt_t *os, const apr_array_header_t *known_targets, svn_client_ctx_t *ctx, apr_pool_t *pool); /** @} group end: Client command-line processing */ /** @} */ /** * Client working copy management functions * * @defgroup clnt_wc Client working copy management * * @{ */ /** * @defgroup clnt_wc_checkout Checkout * * @{ */ /** * Checkout a working copy of @a URL at @a revision, looked up at @a * peg_revision, using @a path as the root directory of the newly * checked out working copy, and authenticating with the * authentication baton cached in @a ctx. If @a result_rev is not @c * NULL, set @a *result_rev to the value of the revision actually * checked out from the repository. * * If @a peg_revision->kind is @c svn_opt_revision_unspecified, then it * defaults to @c svn_opt_revision_head. * * @a revision must be of kind @c svn_opt_revision_number, * @c svn_opt_revision_head, or @c svn_opt_revision_date. If * @a revision does not meet these requirements, return the error * @c SVN_ERR_CLIENT_BAD_REVISION. * * If @a depth is @c svn_depth_infinity, check out fully recursively. * Else if it is @c svn_depth_immediates, check out @a URL and its * immediate entries (subdirectories will be present, but will be at * depth @c svn_depth_empty themselves); else @c svn_depth_files, * check out @a URL and its file entries, but no subdirectories; else * if @c svn_depth_empty, check out @a URL as an empty directory at * that depth, with no entries present. * * If @a depth is @c svn_depth_unknown, then behave as if for * @c svn_depth_infinity, except in the case of resuming a previous * checkout of @a path (i.e., updating), in which case use the depth * of the existing working copy. * * If @a ignore_externals is set, don't process externals definitions * as part of this operation. * * If @a ctx->notify_func2 is non-NULL, invoke @a ctx->notify_func2 with * @a ctx->notify_baton2 as the checkout progresses. * * If @a allow_unver_obstructions is TRUE then the checkout tolerates * existing unversioned items that obstruct added paths from @a URL. Only * obstructions of the same type (file or dir) as the added item are * tolerated. The text of obstructing files is left as-is, effectively * treating it as a user modification after the checkout. Working * properties of obstructing items are set equal to the base properties. * If @a allow_unver_obstructions is FALSE then the checkout will abort * if there are any unversioned obstructing items. * * If @a URL refers to a file rather than a directory, return the * error @c SVN_ERR_UNSUPPORTED_FEATURE. If @a URL does not exist, * return the error @c SVN_ERR_RA_ILLEGAL_URL. * * Use @a pool for any temporary allocation. * * @since New in 1.5. */ svn_error_t * svn_client_checkout3(svn_revnum_t *result_rev, const char *URL, const char *path, const svn_opt_revision_t *peg_revision, const svn_opt_revision_t *revision, svn_depth_t depth, svn_boolean_t ignore_externals, svn_boolean_t allow_unver_obstructions, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_checkout3() but with @a allow_unver_obstructions * always set to FALSE, and @a depth set according to @a recurse: if * @a recurse is TRUE, @a depth is @c svn_depth_infinity, if @a recurse * is FALSE, @a depth is @c svn_depth_files. * * @deprecated Provided for backward compatibility with the 1.4 API. */ SVN_DEPRECATED svn_error_t * svn_client_checkout2(svn_revnum_t *result_rev, const char *URL, const char *path, const svn_opt_revision_t *peg_revision, const svn_opt_revision_t *revision, svn_boolean_t recurse, svn_boolean_t ignore_externals, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_checkout2(), but with @a peg_revision * always set to @c svn_opt_revision_unspecified and * @a ignore_externals always set to FALSE. * * @deprecated Provided for backward compatibility with the 1.1 API. */ SVN_DEPRECATED svn_error_t * svn_client_checkout(svn_revnum_t *result_rev, const char *URL, const char *path, const svn_opt_revision_t *revision, svn_boolean_t recurse, svn_client_ctx_t *ctx, apr_pool_t *pool); /** @} */ /** * @defgroup Update Bring a working copy up-to-date with a repository * * @{ * */ /** * Update working trees @a paths to @a revision, authenticating with the * authentication baton cached in @a ctx. @a paths is an array of const * char * paths to be updated. Unversioned paths that are direct children * of a versioned path will cause an update that attempts to add that path, * other unversioned paths are skipped. If @a result_revs is not * @c NULL an array of svn_revnum_t will be returned with each element set * to the revision to which @a revision was resolved. * * @a revision must be of kind @c svn_opt_revision_number, * @c svn_opt_revision_head, or @c svn_opt_revision_date. If @a * revision does not meet these requirements, return the error * @c SVN_ERR_CLIENT_BAD_REVISION. * * The paths in @a paths can be from multiple working copies from multiple * repositories, but even if they all come from the same repository there * is no guarantee that revision represented by @c svn_opt_revision_head * will remain the same as each path is updated. * * If @a ignore_externals is set, don't process externals definitions * as part of this operation. * * If @a depth is @c svn_depth_infinity, update fully recursively. * Else if it is @c svn_depth_immediates or @c svn_depth_files, update * each target and its file entries, but not its subdirectories. Else * if @c svn_depth_empty, update exactly each target, nonrecursively * (essentially, update the target's properties). * * If @a depth is @c svn_depth_unknown, take the working depth from * @a paths and then behave as described above. * * If @a depth_is_sticky is set and @a depth is not @c * svn_depth_unknown, then in addition to updating PATHS, also set * their sticky ambient depth value to @a depth. * * If @a allow_unver_obstructions is TRUE then the update tolerates * existing unversioned items that obstruct added paths. Only * obstructions of the same type (file or dir) as the added item are * tolerated. The text of obstructing files is left as-is, effectively * treating it as a user modification after the update. Working * properties of obstructing items are set equal to the base properties. * If @a allow_unver_obstructions is FALSE then the update will abort * if there are any unversioned obstructing items. * * If @a ctx->notify_func2 is non-NULL, invoke @a ctx->notify_func2 with * @a ctx->notify_baton2 for each item handled by the update, and also for * files restored from text-base. If @a ctx->cancel_func is non-NULL, invoke * it passing @a ctx->cancel_baton at various places during the update. * * Use @a pool for any temporary allocation. * * @since New in 1.5. */ svn_error_t * svn_client_update3(apr_array_header_t **result_revs, const apr_array_header_t *paths, const svn_opt_revision_t *revision, svn_depth_t depth, svn_boolean_t depth_is_sticky, svn_boolean_t ignore_externals, svn_boolean_t allow_unver_obstructions, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_update3() but with @a allow_unver_obstructions * always set to FALSE, @a depth_is_sticky to FALSE, and @a depth set * according to @a recurse: if @a recurse is TRUE, set @a depth to @c * svn_depth_infinity, if @a recurse is FALSE, set @a depth to @c * svn_depth_files. * * @deprecated Provided for backward compatibility with the 1.4 API. */ SVN_DEPRECATED svn_error_t * svn_client_update2(apr_array_header_t **result_revs, const apr_array_header_t *paths, const svn_opt_revision_t *revision, svn_boolean_t recurse, svn_boolean_t ignore_externals, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_update2() except that it accepts only a single * target in @a path, returns a single revision if @a result_rev is * not NULL, and @a ignore_externals is always set to FALSE. * * @deprecated Provided for backward compatibility with the 1.1 API. */ SVN_DEPRECATED svn_error_t * svn_client_update(svn_revnum_t *result_rev, const char *path, const svn_opt_revision_t *revision, svn_boolean_t recurse, svn_client_ctx_t *ctx, apr_pool_t *pool); /** @} */ /** * @defgroup Switch Switch a working copy to another location. * * @{ */ /** Switch working tree @a path to @a url\@peg_revision at @a revision, * authenticating with the authentication baton cached in @a ctx. If * @a result_rev is not @c NULL, set @a *result_rev to the value of * the revision to which the working copy was actually switched. * * Summary of purpose: this is normally used to switch a working * directory over to another line of development, such as a branch or * a tag. Switching an existing working directory is more efficient * than checking out @a url from scratch. * * @a revision must be of kind @c svn_opt_revision_number, * @c svn_opt_revision_head, or @c svn_opt_revision_date; otherwise, * return @c SVN_ERR_CLIENT_BAD_REVISION. * * If @a depth is @c svn_depth_infinity, switch fully recursively. * Else if it is @c svn_depth_immediates, switch @a path and its file * children (if any), and switch subdirectories but do not update * them. Else if @c svn_depth_files, switch just file children, * ignoring subdirectories completely. Else if @c svn_depth_empty, * switch just @a path and touch nothing underneath it. * * If @a depth_is_sticky is set and @a depth is not @c * svn_depth_unknown, then in addition to switching PATH, also set * its sticky ambient depth value to @a depth. * * If @a ignore_externals is set, don't process externals definitions * as part of this operation. * * If @a allow_unver_obstructions is TRUE then the switch tolerates * existing unversioned items that obstruct added paths. Only * obstructions of the same type (file or dir) as the added item are * tolerated. The text of obstructing files is left as-is, effectively * treating it as a user modification after the switch. Working * properties of obstructing items are set equal to the base properties. * If @a allow_unver_obstructions is FALSE then the switch will abort * if there are any unversioned obstructing items. * * If @a ctx->notify_func2 is non-NULL, invoke it with @a ctx->notify_baton2 * on paths affected by the switch. Also invoke it for files may be restored * from the text-base because they were removed from the working copy. * * Use @a pool for any temporary allocation. * * @since New in 1.5. */ svn_error_t * svn_client_switch2(svn_revnum_t *result_rev, const char *path, const char *url, const svn_opt_revision_t *peg_revision, const svn_opt_revision_t *revision, svn_depth_t depth, svn_boolean_t depth_is_sticky, svn_boolean_t ignore_externals, svn_boolean_t allow_unver_obstructions, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_switch2() but with @a allow_unver_obstructions, * @a ignore_externals, and @a depth_is_sticky always set to FALSE, * and @a depth set according to @a recurse: if @a recurse is TRUE, * set @a depth to @c svn_depth_infinity, if @a recurse is FALSE, set * @a depth to @c svn_depth_files. * * @deprecated Provided for backward compatibility with the 1.4 API. */ SVN_DEPRECATED svn_error_t * svn_client_switch(svn_revnum_t *result_rev, const char *path, const char *url, const svn_opt_revision_t *revision, svn_boolean_t recurse, svn_client_ctx_t *ctx, apr_pool_t *pool); /** @} */ /** * @defgroup Add Begin versioning files/directories in a working copy. * * @{ */ /** * Schedule a working copy @a path for addition to the repository. * * If @a depth is @c svn_depth_empty, add just @a path and nothing * below it. If @c svn_depth_files, add @a path and any file * children of @a path. If @c svn_depth_immediates, add @a path, any * file children, and any immediate subdirectories (but nothing * underneath those subdirectories). If @c svn_depth_infinity, add * @a path and everything under it fully recursively. * * @a path's parent must be under revision control already (unless * @a add_parents is TRUE), but @a path is not. If @a recursive is * set, then assuming @a path is a directory, all of its contents will * be scheduled for addition as well. * * If @a force is not set and @a path is already under version * control, return the error @c SVN_ERR_ENTRY_EXISTS. If @a force is * set, do not error on already-versioned items. When used on a * directory in conjunction with the @a recursive flag, this has the * effect of scheduling for addition unversioned files and directories * scattered deep within a versioned tree. * * If @a ctx->notify_func2 is non-NULL, then for each added item, call * @a ctx->notify_func2 with @a ctx->notify_baton2 and the path of the * added item. * * If @a no_ignore is FALSE, don't add files or directories that match * ignore patterns. * * If @a add_parents is TRUE, recurse up @a path's directory and look for * a versioned directory. If found, add all intermediate paths between it * and @a path. If not found, return @c SVN_ERR_CLIENT_NO_VERSIONED_PARENTS. * * @par Important: * This is a *scheduling* operation. No changes will * happen to the repository until a commit occurs. This scheduling * can be removed with svn_client_revert2(). * * @since New in 1.5. */ svn_error_t * svn_client_add4(const char *path, svn_depth_t depth, svn_boolean_t force, svn_boolean_t no_ignore, svn_boolean_t add_parents, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_add4(), but with @a add_parents always set to * FALSE and @a depth set according to @a recursive: if TRUE, then * @a depth is @c svn_depth_infinity, if FALSE, then @c svn_depth_empty. * * @deprecated Provided for backward compatibility with the 1.4 API. */ SVN_DEPRECATED svn_error_t * svn_client_add3(const char *path, svn_boolean_t recursive, svn_boolean_t force, svn_boolean_t no_ignore, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_add3(), but with @a no_ignore always set to * FALSE. * * @deprecated Provided for backward compatibility with the 1.2 API. */ SVN_DEPRECATED svn_error_t * svn_client_add2(const char *path, svn_boolean_t recursive, svn_boolean_t force, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_add2(), but with @a force always set to FALSE. * * @deprecated Provided for backward compatibility with the 1.0 API. */ SVN_DEPRECATED svn_error_t * svn_client_add(const char *path, svn_boolean_t recursive, svn_client_ctx_t *ctx, apr_pool_t *pool); /** @} */ /** * @defgroup Mkdir Create directories in a working copy or repository. * * @{ */ /** Create a directory, either in a repository or a working copy. * * If @a paths contains URLs, use the authentication baton in @a ctx * and @a message to immediately attempt to commit the creation of the * directories in @a paths in the repository. If the commit succeeds, * allocate (in @a pool) and populate @a *commit_info_p. * * Else, create the directories on disk, and attempt to schedule them * for addition (using svn_client_add(), whose docstring you should * read). * * If @a make_parents is TRUE, create any non-existent parent directories * also. * * If non-NULL, @a revprop_table is a hash table holding additional, * custom revision properties (const char * names mapped to * svn_string_t * values) to be set on the new revision in * the event that this is a committing operation. This table cannot * contain any standard Subversion properties. * * @a ctx->log_msg_func3/@a ctx->log_msg_baton3 are a callback/baton * combo that this function can use to query for a commit log message * when one is needed. * * If @a ctx->notify_func2 is non-NULL, when the directory has been created * (successfully) in the working copy, call @a ctx->notify_func2 with * @a ctx->notify_baton2 and the path of the new directory. Note that this is * only called for items added to the working copy. * * @since New in 1.5. */ svn_error_t * svn_client_mkdir3(svn_commit_info_t **commit_info_p, const apr_array_header_t *paths, svn_boolean_t make_parents, const apr_hash_t *revprop_table, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Same as svn_client_mkdir3(), but with @a make_parents always FALSE, * and @a revprop_table always NULL. * * @since New in 1.3. * @deprecated Provided for backward compatibility with the 1.4 API. */ SVN_DEPRECATED svn_error_t * svn_client_mkdir2(svn_commit_info_t **commit_info_p, const apr_array_header_t *paths, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Same as svn_client_mkdir2(), but takes the @c svn_client_commit_info_t * type for @a commit_info_p. * * @deprecated Provided for backward compatibility with the 1.2 API. */ SVN_DEPRECATED svn_error_t * svn_client_mkdir(svn_client_commit_info_t **commit_info_p, const apr_array_header_t *paths, svn_client_ctx_t *ctx, apr_pool_t *pool); /** @} */ /** * @defgroup Delete Remove files/directories from a working copy or repository. * * @{ */ /** Delete items from a repository or working copy. * * If the paths in @a paths are URLs, use the authentication baton in * @a ctx and @a ctx->log_msg_func3/@a ctx->log_msg_baton3 to * immediately attempt to commit a deletion of the URLs from the * repository. If the commit succeeds, allocate (in @a pool) and * populate @a *commit_info_p. Every path must belong to the same * repository. * * Else, schedule the working copy paths in @a paths for removal from * the repository. Each path's parent must be under revision control. * This is just a *scheduling* operation. No changes will happen to * the repository until a commit occurs. This scheduling can be * removed with svn_client_revert2(). If a path is a file it is * immediately removed from the working copy. If the path is a * directory it will remain in the working copy but all the files, and * all unversioned items, it contains will be removed. If @a force is * not set then this operation will fail if any path contains locally * modified and/or unversioned items. If @a force is set such items * will be deleted. * * If the paths are working copy paths and @a keep_local is TRUE then * the paths will not be removed from the working copy, only scheduled * for removal from the repository. Once the scheduled deletion is * committed, they will appear as unversioned paths in the working copy. * * If non-NULL, @a revprop_table is a hash table holding additional, * custom revision properties (const char * names mapped to * svn_string_t * values) to be set on the new revision in * the event that this is a committing operation. This table cannot * contain any standard Subversion properties. * * @a ctx->log_msg_func3/@a ctx->log_msg_baton3 are a callback/baton * combo that this function can use to query for a commit log message * when one is needed. * * If @a ctx->notify_func2 is non-NULL, then for each item deleted, call * @a ctx->notify_func2 with @a ctx->notify_baton2 and the path of the deleted * item. * * @since New in 1.5. */ svn_error_t * svn_client_delete3(svn_commit_info_t **commit_info_p, const apr_array_header_t *paths, svn_boolean_t force, svn_boolean_t keep_local, const apr_hash_t *revprop_table, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_delete3(), but with @a keep_local always set * to FALSE, and @a revprop_table passed as NULL. * * @deprecated Provided for backward compatibility with the 1.4 API. */ SVN_DEPRECATED svn_error_t * svn_client_delete2(svn_commit_info_t **commit_info_p, const apr_array_header_t *paths, svn_boolean_t force, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_delete2(), but takes the @c svn_client_commit_info_t * type for @a commit_info_p. * * @deprecated Provided for backward compatibility with the 1.2 API. */ SVN_DEPRECATED svn_error_t * svn_client_delete(svn_client_commit_info_t **commit_info_p, const apr_array_header_t *paths, svn_boolean_t force, svn_client_ctx_t *ctx, apr_pool_t *pool); /** @} */ /** * @defgroup Import Import files into the repository. * * @{ */ /** Import file or directory @a path into repository directory @a url at * head, authenticating with the authentication baton cached in @a ctx, * and using @a ctx->log_msg_func3/@a ctx->log_msg_baton3 to get a log message * for the (implied) commit. Set @a *commit_info_p to the results of the * commit, allocated in @a pool. If some components of @a url do not exist * then create parent directories as necessary. * * If @a path is a directory, the contents of that directory are * imported directly into the directory identified by @a url. Note that the * directory @a path itself is not imported -- that is, the basename of * @a path is not part of the import. * * If @a path is a file, then the dirname of @a url is the directory * receiving the import. The basename of @a url is the filename in the * repository. In this case if @a url already exists, return error. * * If @a ctx->notify_func2 is non-NULL, then call @a ctx->notify_func2 with * @a ctx->notify_baton2 as the import progresses, with any of the following * actions: @c svn_wc_notify_commit_added, * @c svn_wc_notify_commit_postfix_txdelta. * * Use @a pool for any temporary allocation. * * If non-NULL, @a revprop_table is a hash table holding additional, * custom revision properties (const char * names mapped to * svn_string_t * values) to be set on the new revision. * This table cannot contain any standard Subversion properties. * * @a ctx->log_msg_func3/@a ctx->log_msg_baton3 are a callback/baton * combo that this function can use to query for a commit log message * when one is needed. * * If @a depth is @c svn_depth_empty, import just @a path and nothing * below it. If @c svn_depth_files, import @a path and any file * children of @a path. If @c svn_depth_immediates, import @a path, any * file children, and any immediate subdirectories (but nothing * underneath those subdirectories). If @c svn_depth_infinity, import * @a path and everything under it fully recursively. * * If @a no_ignore is @c FALSE, don't add files or directories that match * ignore patterns. * * If @a ignore_unknown_node_types is @c FALSE, ignore files of which the * node type is unknown, such as device files and pipes. * * @since New in 1.5. */ svn_error_t * svn_client_import3(svn_commit_info_t **commit_info_p, const char *path, const char *url, svn_depth_t depth, svn_boolean_t no_ignore, svn_boolean_t ignore_unknown_node_types, const apr_hash_t *revprop_table, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_import3(), but with @a ignore_unknown_node_types * always set to @c FALSE, @a revprop_table passed as NULL, and @a * depth set according to @a nonrecursive: if TRUE, then @a depth is * @c svn_depth_files, else @c svn_depth_infinity. * * @since New in 1.3. * * @deprecated Provided for backward compatibility with the 1.4 API */ SVN_DEPRECATED svn_error_t * svn_client_import2(svn_commit_info_t **commit_info_p, const char *path, const char *url, svn_boolean_t nonrecursive, svn_boolean_t no_ignore, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_import2(), but with @a no_ignore always set * to FALSE and using the @c svn_client_commit_info_t type for * @a commit_info_p. * * @deprecated Provided for backward compatibility with the 1.2 API. */ SVN_DEPRECATED svn_error_t * svn_client_import(svn_client_commit_info_t **commit_info_p, const char *path, const char *url, svn_boolean_t nonrecursive, svn_client_ctx_t *ctx, apr_pool_t *pool); /** @} */ /** * @defgroup Commit Commit local modifications to the repository. * * @{ */ /** * Commit files or directories into repository, authenticating with * the authentication baton cached in @a ctx, and using * @a ctx->log_msg_func3/@a ctx->log_msg_baton3 to obtain the log message. * Set @a *commit_info_p to the results of the commit, allocated in @a pool. * * @a targets is an array of const char * paths to commit. They * need not be canonicalized nor condensed; this function will take care of * that. If @a targets has zero elements, then do nothing and return * immediately without error. * * If non-NULL, @a revprop_table is a hash table holding additional, * custom revision properties (const char * names mapped to * svn_string_t * values) to be set on the new revision. * This table cannot contain any standard Subversion properties. * * If @a ctx->notify_func2 is non-NULL, then call @a ctx->notify_func2 with * @a ctx->notify_baton2 as the commit progresses, with any of the following * actions: @c svn_wc_notify_commit_modified, @c svn_wc_notify_commit_added, * @c svn_wc_notify_commit_deleted, @c svn_wc_notify_commit_replaced, * @c svn_wc_notify_commit_postfix_txdelta. * * If @a depth is @c svn_depth_infinity, commit all changes to and * below named targets. If @a depth is @c svn_depth_empty, commit * only named targets (that is, only property changes on named * directory targets, and property and content changes for named file * targets). If @a depth is @c svn_depth_files, behave as above for * named file targets, and for named directory targets, commit * property changes on a named directory and all changes to files * directly inside that directory. If @c svn_depth_immediates, behave * as for @c svn_depth_files, and for subdirectories of any named * directory target commit as though for @c svn_depth_empty. * * Unlock paths in the repository, unless @a keep_locks is TRUE. * * @a changelists is an array of const char * changelist * names, used as a restrictive filter on items that are committed; * that is, don't commit anything unless it's a member of one of those * changelists. After the commit completes successfully, remove * changelist associations from the targets, unless @a * keep_changelists is set. If @a changelists is * empty (or altogether @c NULL), no changelist filtering occurs. * * Use @a pool for any temporary allocations. * * If no error is returned and @a (*commit_info_p)->revision is set to * @c SVN_INVALID_REVNUM, then the commit was a no-op; nothing needed to * be committed. * * @since New in 1.5. */ svn_error_t * svn_client_commit4(svn_commit_info_t **commit_info_p, const apr_array_header_t *targets, svn_depth_t depth, svn_boolean_t keep_locks, svn_boolean_t keep_changelists, const apr_array_header_t *changelists, const apr_hash_t *revprop_table, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_commit4(), but always with NULL for * @a changelist_name, FALSE for @a keep_changelist, NULL for @a * revprop_table, and @a depth set according to @a recurse: if @a * recurse is TRUE, use @c svn_depth_infinity, else @c * svn_depth_empty. * * @deprecated Provided for backward compatibility with the 1.4 API. * * @since New in 1.3. */ SVN_DEPRECATED svn_error_t * svn_client_commit3(svn_commit_info_t **commit_info_p, const apr_array_header_t *targets, svn_boolean_t recurse, svn_boolean_t keep_locks, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_commit3(), but uses @c svn_client_commit_info_t * for @a commit_info_p. * * @deprecated Provided for backward compatibility with the 1.2 API. * * @since New in 1.2. */ SVN_DEPRECATED svn_error_t * svn_client_commit2(svn_client_commit_info_t **commit_info_p, const apr_array_header_t *targets, svn_boolean_t recurse, svn_boolean_t keep_locks, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_commit2(), but with @a keep_locks set to * TRUE and @a nonrecursive instead of @a recurse. * * @deprecated Provided for backward compatibility with the 1.1 API. */ SVN_DEPRECATED svn_error_t * svn_client_commit(svn_client_commit_info_t **commit_info_p, const apr_array_header_t *targets, svn_boolean_t nonrecursive, svn_client_ctx_t *ctx, apr_pool_t *pool); /** @} */ /** * @defgroup Status Report interesting information about paths in the \ * working copy. * * @{ */ /** * Given @a path to a working copy directory (or single file), call * @a status_func/status_baton with a set of @c svn_wc_status_t * * structures which describe the status of @a path, and its children * (recursing according to @a depth). * * - If @a get_all is set, retrieve all entries; otherwise, * retrieve only "interesting" entries (local mods and/or * out of date). * * - If @a update is set, contact the repository and augment the * status structures with information about out-of-dateness (with * respect to @a revision). Also, if @a result_rev is not @c NULL, * set @a *result_rev to the actual revision against which the * working copy was compared (@a *result_rev is not meaningful unless * @a update is set). * * If @a ignore_externals is not set, then recurse into externals * definitions (if any exist) after handling the main target. This * calls the client notification function (in @a ctx) with the @c * svn_wc_notify_status_external action before handling each externals * definition, and with @c svn_wc_notify_status_completed * after each. * * @a changelists is an array of const char * changelist * names, used as a restrictive filter on items whose statuses are * reported; that is, don't report status about any item unless * it's a member of one of those changelists. If @a changelists is * empty (or altogether @c NULL), no changelist filtering occurs. * * @since New in 1.6. */ svn_error_t * svn_client_status4(svn_revnum_t *result_rev, const char *path, const svn_opt_revision_t *revision, svn_wc_status_func3_t status_func, void *status_baton, svn_depth_t depth, svn_boolean_t get_all, svn_boolean_t update, svn_boolean_t no_ignore, svn_boolean_t ignore_externals, const apr_array_header_t *changelists, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Same as svn_client_status4(), but using an @c svn_wc_status_func2_t * instead of an @c svn_wc_status_func3_t. * * @since New in 1.5. * @deprecated Provided for backward compatibility with the 1.5 API. */ SVN_DEPRECATED svn_error_t * svn_client_status3(svn_revnum_t *result_rev, const char *path, const svn_opt_revision_t *revision, svn_wc_status_func2_t status_func, void *status_baton, svn_depth_t depth, svn_boolean_t get_all, svn_boolean_t update, svn_boolean_t no_ignore, svn_boolean_t ignore_externals, const apr_array_header_t *changelists, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Like svn_client_status3(), except with @a changelists passed as @c * NULL, and with @a recurse instead of @a depth. If @a recurse is * TRUE, behave as if for @c svn_depth_infinity; else if @a recurse is * FALSE, behave as if for @c svn_depth_immediates. * * @since New in 1.2. * @deprecated Provided for backward compatibility with the 1.4 API. */ SVN_DEPRECATED svn_error_t * svn_client_status2(svn_revnum_t *result_rev, const char *path, const svn_opt_revision_t *revision, svn_wc_status_func2_t status_func, void *status_baton, svn_boolean_t recurse, svn_boolean_t get_all, svn_boolean_t update, svn_boolean_t no_ignore, svn_boolean_t ignore_externals, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_status2(), but with @a ignore_externals * always set to FALSE, taking the @c svn_wc_status_func_t type * instead of the @c svn_wc_status_func2_t type for @a status_func, * and requiring @a *revision to be non-const even though it is * treated as constant. * * @deprecated Provided for backward compatibility with the 1.1 API. */ SVN_DEPRECATED svn_error_t * svn_client_status(svn_revnum_t *result_rev, const char *path, svn_opt_revision_t *revision, svn_wc_status_func_t status_func, void *status_baton, svn_boolean_t recurse, svn_boolean_t get_all, svn_boolean_t update, svn_boolean_t no_ignore, svn_client_ctx_t *ctx, apr_pool_t *pool); /** @} */ /** * @defgroup Log View information about previous revisions of an object. * * @{ */ /** * Invoke @a receiver with @a receiver_baton on each log message from * each start/end revision pair in the @a revision_ranges in turn, * inclusive (but never invoke @a receiver on a given log message more * than once). * * @a targets contains either a URL followed by zero or more relative * paths, or 1 working copy path, as const char *, for which log * messages are desired. @a receiver is invoked only on messages whose * revisions involved a change to some path in @a targets. @a peg_revision * indicates in which revision @a targets are valid. If @a peg_revision is * @c svn_opt_revision_unspecified, it defaults to @c svn_opt_revision_head * for URLs or @c svn_opt_revision_working for WC paths. * * If @a limit is non-zero only invoke @a receiver on the first @a limit * logs. * * If @a discover_changed_paths is set, then the `@a changed_paths' argument * to @a receiver will be passed on each invocation. * * If @a strict_node_history is set, copy history (if any exists) will * not be traversed while harvesting revision logs for each target. * * If @a include_merged_revisions is set, log information for revisions * which have been merged to @a targets will also be returned. * * If @a revprops is NULL, retrieve all revprops; else, retrieve only the * revprops named in the array (i.e. retrieve none if the array is empty). * * If @a start->kind or @a end->kind is @c svn_opt_revision_unspecified, * return the error @c SVN_ERR_CLIENT_BAD_REVISION. * * Use @a pool for any temporary allocation. * * @par Important: * A special case for the revision range HEAD:1, which was present * in svn_client_log(), has been removed from svn_client_log2(). Instead, it * is expected that callers will specify the range HEAD:0, to avoid a * SVN_ERR_FS_NO_SUCH_REVISION error when invoked against an empty repository * (i.e. one not containing a revision 1). * * If @a ctx->notify_func2 is non-NULL, then call @a ctx->notify_func2/baton2 * with a 'skip' signal on any unversioned targets. * * @since New in 1.6. */ svn_error_t * svn_client_log5(const apr_array_header_t *targets, const svn_opt_revision_t *peg_revision, const apr_array_header_t *revision_ranges, int limit, svn_boolean_t discover_changed_paths, svn_boolean_t strict_node_history, svn_boolean_t include_merged_revisions, const apr_array_header_t *revprops, svn_log_entry_receiver_t receiver, void *receiver_baton, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_log5(), but takes explicit start and end parameters * instead of an array of revision ranges. * * @deprecated Provided for compatibility with the 1.5 API. * @since New in 1.5. */ SVN_DEPRECATED svn_error_t * svn_client_log4(const apr_array_header_t *targets, const svn_opt_revision_t *peg_revision, const svn_opt_revision_t *start, const svn_opt_revision_t *end, int limit, svn_boolean_t discover_changed_paths, svn_boolean_t strict_node_history, svn_boolean_t include_merged_revisions, const apr_array_header_t *revprops, svn_log_entry_receiver_t receiver, void *receiver_baton, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_log4(), but using @c svn_log_message_receiver_t * instead of @c svn_log_entry_receiver_t. Also, @a * include_merged_revisions is set to @c FALSE and @a revprops is * svn:author, svn:date, and svn:log. * * @deprecated Provided for compatibility with the 1.4 API. * @since New in 1.4. */ SVN_DEPRECATED svn_error_t * svn_client_log3(const apr_array_header_t *targets, const svn_opt_revision_t *peg_revision, const svn_opt_revision_t *start, const svn_opt_revision_t *end, int limit, svn_boolean_t discover_changed_paths, svn_boolean_t strict_node_history, svn_log_message_receiver_t receiver, void *receiver_baton, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_log3(), but with the @c kind field of * @a peg_revision set to @c svn_opt_revision_unspecified. * * @deprecated Provided for compatibility with the 1.3 API. * @since New in 1.2. */ SVN_DEPRECATED svn_error_t * svn_client_log2(const apr_array_header_t *targets, const svn_opt_revision_t *start, const svn_opt_revision_t *end, int limit, svn_boolean_t discover_changed_paths, svn_boolean_t strict_node_history, svn_log_message_receiver_t receiver, void *receiver_baton, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_log2(), but with @a limit set to 0, and the * following special case: * * Special case for repositories at revision 0: * * If @a start->kind is @c svn_opt_revision_head, and @a end->kind is * @c svn_opt_revision_number && @a end->number is @c 1, then handle an * empty (no revisions) repository specially: instead of erroring * because requested revision 1 when the highest revision is 0, just * invoke @a receiver on revision 0, passing @c NULL for changed paths and * empty strings for the author and date. This is because that * particular combination of @a start and @a end usually indicates the * common case of log invocation -- the user wants to see all log * messages from youngest to oldest, where the oldest commit is * revision 1. That works fine, except when there are no commits in * the repository, hence this special case. * * @deprecated Provided for backward compatibility with the 1.0 API. */ SVN_DEPRECATED svn_error_t * svn_client_log(const apr_array_header_t *targets, const svn_opt_revision_t *start, const svn_opt_revision_t *end, svn_boolean_t discover_changed_paths, svn_boolean_t strict_node_history, svn_log_message_receiver_t receiver, void *receiver_baton, svn_client_ctx_t *ctx, apr_pool_t *pool); /** @} */ /** * @defgroup Blame Show modification information about lines in a file. * * @{ */ /** * Invoke @a receiver with @a receiver_baton on each line-blame item * associated with revision @a end of @a path_or_url, using @a start * as the default source of all blame. @a peg_revision indicates in * which revision @a path_or_url is valid. If @a peg_revision->kind * is @c svn_opt_revision_unspecified, then it defaults to @c * svn_opt_revision_head for URLs or @c svn_opt_revision_working for * WC targets. * * If @a start->kind or @a end->kind is @c svn_opt_revision_unspecified, * return the error @c SVN_ERR_CLIENT_BAD_REVISION. If either are @c * svn_opt_revision_working, return the error @c * SVN_ERR_UNSUPPORTED_FEATURE. If any of the revisions of @a * path_or_url have a binary mime-type, return the error @c * SVN_ERR_CLIENT_IS_BINARY_FILE, unless @a ignore_mime_type is TRUE, * in which case blame information will be generated regardless of the * MIME types of the revisions. * * Use @a diff_options to determine how to compare different revisions of the * target. * * If @a include_merged_revisions is TRUE, also return data based upon * revisions which have been merged to @a path_or_url. * * Use @a pool for any temporary allocation. * * @since New in 1.5. */ svn_error_t * svn_client_blame4(const char *path_or_url, const svn_opt_revision_t *peg_revision, const svn_opt_revision_t *start, const svn_opt_revision_t *end, const svn_diff_file_options_t *diff_options, svn_boolean_t ignore_mime_type, svn_boolean_t include_merged_revisions, svn_client_blame_receiver2_t receiver, void *receiver_baton, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_blame4(), but with @a include_merged_revisions set * to FALSE, and using a @c svn_client_blame_receiver2_t as the receiver. * * @deprecated Provided for backwards compatibility with the 1.4 API. * * @since New in 1.4. */ SVN_DEPRECATED svn_error_t * svn_client_blame3(const char *path_or_url, const svn_opt_revision_t *peg_revision, const svn_opt_revision_t *start, const svn_opt_revision_t *end, const svn_diff_file_options_t *diff_options, svn_boolean_t ignore_mime_type, svn_client_blame_receiver_t receiver, void *receiver_baton, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_blame3(), but with @a diff_options set to * default options as returned by svn_diff_file_options_parse() and * @a ignore_mime_type set to FALSE. * * @deprecated Provided for backwards compatibility with the 1.3 API. * * @since New in 1.2. */ SVN_DEPRECATED svn_error_t * svn_client_blame2(const char *path_or_url, const svn_opt_revision_t *peg_revision, const svn_opt_revision_t *start, const svn_opt_revision_t *end, svn_client_blame_receiver_t receiver, void *receiver_baton, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_blame2() except that @a peg_revision is always * the same as @a end. * * @deprecated Provided for backward compatibility with the 1.1 API. */ SVN_DEPRECATED svn_error_t * svn_client_blame(const char *path_or_url, const svn_opt_revision_t *start, const svn_opt_revision_t *end, svn_client_blame_receiver_t receiver, void *receiver_baton, svn_client_ctx_t *ctx, apr_pool_t *pool); /** @} */ /** * @defgroup Diff Generate differences between paths. * * @{ */ /** * Produce diff output which describes the delta between * @a path1/@a revision1 and @a path2/@a revision2. Print the output * of the diff to @a outfile, and any errors to @a errfile. @a path1 * and @a path2 can be either working-copy paths or URLs. * * If @a relative_to_dir is not @c NULL, the @a original_path and * @a modified_path will have the @a relative_to_dir stripped from the * front of the respective paths. If @a relative_to_dir is @c NULL, * paths will not be modified. If @a relative_to_dir is not * @c NULL but @a relative_to_dir is not a parent path of the target, * an error is returned. Finally, if @a relative_to_dir is a URL, an * error will be returned. * * If either @a revision1 or @a revision2 has an `unspecified' or * unrecognized `kind', return @c SVN_ERR_CLIENT_BAD_REVISION. * * @a path1 and @a path2 must both represent the same node kind -- that * is, if @a path1 is a directory, @a path2 must also be, and if @a path1 * is a file, @a path2 must also be. * * If @a depth is @c svn_depth_infinity, diff fully recursively. * Else if it is @c svn_depth_immediates, diff the named paths and * their file children (if any), and diff properties of * subdirectories, but do not descend further into the subdirectories. * Else if @c svn_depth_files, behave as if for @c svn_depth_immediates * except don't diff properties of subdirectories. If @c * svn_depth_empty, diff exactly the named paths but nothing * underneath them. * * Use @a ignore_ancestry to control whether or not items being * diffed will be checked for relatedness first. Unrelated items * are typically transmitted to the editor as a deletion of one thing * and the addition of another, but if this flag is TRUE, unrelated * items will be diffed as if they were related. * * If @a no_diff_deleted is TRUE, then no diff output will be * generated on deleted files. * * Generated headers are encoded using @a header_encoding. * * Diff output will not be generated for binary files, unless @a * ignore_content_type is TRUE, in which case diffs will be shown * regardless of the content types. * * @a diff_options (an array of const char *) is used to pass * additional command line options to the diff processes invoked to compare * files. * * The authentication baton cached in @a ctx is used to communicate with * the repository. * * @a changelists is an array of const char * changelist * names, used as a restrictive filter on items whose differences are * reported; that is, don't generate diffs about any item unless * it's a member of one of those changelists. If @a changelists is * empty (or altogether @c NULL), no changelist filtering occurs. * * @note Changelist filtering only applies to diffs in which at least * one side of the diff represents working copy data. * * @note @a header_encoding doesn't affect headers generated by external * diff programs. * * @note @a relative_to_dir doesn't affect the path index generated by * external diff programs. * * @since New in 1.5. */ svn_error_t * svn_client_diff4(const apr_array_header_t *diff_options, const char *path1, const svn_opt_revision_t *revision1, const char *path2, const svn_opt_revision_t *revision2, const char *relative_to_dir, svn_depth_t depth, svn_boolean_t ignore_ancestry, svn_boolean_t no_diff_deleted, svn_boolean_t ignore_content_type, const char *header_encoding, apr_file_t *outfile, apr_file_t *errfile, const apr_array_header_t *changelists, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_diff4(), but with @a changelists passed as @c * NULL, and @a depth set according to @a recurse: if @a recurse is * TRUE, set @a depth to @c svn_depth_infinity, if @a recurse is * FALSE, set @a depth to @c svn_depth_empty. * * @deprecated Provided for backward compatibility with the 1.4 API. * * @since New in 1.3. */ SVN_DEPRECATED svn_error_t * svn_client_diff3(const apr_array_header_t *diff_options, const char *path1, const svn_opt_revision_t *revision1, const char *path2, const svn_opt_revision_t *revision2, svn_boolean_t recurse, svn_boolean_t ignore_ancestry, svn_boolean_t no_diff_deleted, svn_boolean_t ignore_content_type, const char *header_encoding, apr_file_t *outfile, apr_file_t *errfile, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_diff3(), but with @a header_encoding set to * @c APR_LOCALE_CHARSET. * * @deprecated Provided for backward compatibility with the 1.2 API. * * @since New in 1.2. */ SVN_DEPRECATED svn_error_t * svn_client_diff2(const apr_array_header_t *diff_options, const char *path1, const svn_opt_revision_t *revision1, const char *path2, const svn_opt_revision_t *revision2, svn_boolean_t recurse, svn_boolean_t ignore_ancestry, svn_boolean_t no_diff_deleted, svn_boolean_t ignore_content_type, apr_file_t *outfile, apr_file_t *errfile, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_diff2(), but with @a ignore_content_type * always set to FALSE. * * @deprecated Provided for backward compatibility with the 1.0 API. */ SVN_DEPRECATED svn_error_t * svn_client_diff(const apr_array_header_t *diff_options, const char *path1, const svn_opt_revision_t *revision1, const char *path2, const svn_opt_revision_t *revision2, svn_boolean_t recurse, svn_boolean_t ignore_ancestry, svn_boolean_t no_diff_deleted, apr_file_t *outfile, apr_file_t *errfile, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Produce diff output which describes the delta between the * filesystem object @a path in peg revision @a peg_revision, as it * changed between @a start_revision and @a end_revision. @a path can * be either a working-copy path or URL. * * If @a peg_revision is @c svn_opt_revision_unspecified, behave * identically to svn_client_diff4(), using @a path for both of that * function's @a path1 and @a path2 argments. * * All other options are handled identically to svn_client_diff4(). * * @since New in 1.5. */ svn_error_t * svn_client_diff_peg4(const apr_array_header_t *diff_options, const char *path, const svn_opt_revision_t *peg_revision, const svn_opt_revision_t *start_revision, const svn_opt_revision_t *end_revision, const char *relative_to_dir, svn_depth_t depth, svn_boolean_t ignore_ancestry, svn_boolean_t no_diff_deleted, svn_boolean_t ignore_content_type, const char *header_encoding, apr_file_t *outfile, apr_file_t *errfile, const apr_array_header_t *changelists, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_diff_peg4(), but with @a changelists passed * as @c NULL, and @a depth set according to @a recurse: if @a recurse * is TRUE, set @a depth to @c svn_depth_infinity, if @a recurse is * FALSE, set @a depth to @c svn_depth_files. * * @deprecated Provided for backward compatibility with the 1.4 API. * * @since New in 1.3. */ SVN_DEPRECATED svn_error_t * svn_client_diff_peg3(const apr_array_header_t *diff_options, const char *path, const svn_opt_revision_t *peg_revision, const svn_opt_revision_t *start_revision, const svn_opt_revision_t *end_revision, svn_boolean_t recurse, svn_boolean_t ignore_ancestry, svn_boolean_t no_diff_deleted, svn_boolean_t ignore_content_type, const char *header_encoding, apr_file_t *outfile, apr_file_t *errfile, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_diff_peg3(), but with @a header_encoding set to * @c APR_LOCALE_CHARSET. * * @deprecated Provided for backward compatibility with the 1.2 API. * * @since New in 1.2. */ SVN_DEPRECATED svn_error_t * svn_client_diff_peg2(const apr_array_header_t *diff_options, const char *path, const svn_opt_revision_t *peg_revision, const svn_opt_revision_t *start_revision, const svn_opt_revision_t *end_revision, svn_boolean_t recurse, svn_boolean_t ignore_ancestry, svn_boolean_t no_diff_deleted, svn_boolean_t ignore_content_type, apr_file_t *outfile, apr_file_t *errfile, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_diff_peg2(), but with @a ignore_content_type * always set to FALSE. * * @since New in 1.1. * @deprecated Provided for backward compatibility with the 1.1 API. */ SVN_DEPRECATED svn_error_t * svn_client_diff_peg(const apr_array_header_t *diff_options, const char *path, const svn_opt_revision_t *peg_revision, const svn_opt_revision_t *start_revision, const svn_opt_revision_t *end_revision, svn_boolean_t recurse, svn_boolean_t ignore_ancestry, svn_boolean_t no_diff_deleted, apr_file_t *outfile, apr_file_t *errfile, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Produce a diff summary which lists the changed items between * @a path1/@a revision1 and @a path2/@a revision2 without creating text * deltas. @a path1 and @a path2 can be either working-copy paths or URLs. * * The function may report false positives if @a ignore_ancestry is false, * since a file might have been modified between two revisions, but still * have the same contents. * * Calls @a summarize_func with @a summarize_baton for each difference * with a @c svn_client_diff_summarize_t structure describing the difference. * * See svn_client_diff4() for a description of the other parameters. * * @since New in 1.5. */ svn_error_t * svn_client_diff_summarize2(const char *path1, const svn_opt_revision_t *revision1, const char *path2, const svn_opt_revision_t *revision2, svn_depth_t depth, svn_boolean_t ignore_ancestry, const apr_array_header_t *changelists, svn_client_diff_summarize_func_t summarize_func, void *summarize_baton, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_diff_summarize2(), but with @a changelists * passed as @c NULL, and @a depth set according to @a recurse: if @a * recurse is TRUE, set @a depth to @c svn_depth_infinity, if @a * recurse is FALSE, set @a depth to @c svn_depth_files. * * @deprecated Provided for backward compatibility with the 1.4 API. * * @since New in 1.4. */ SVN_DEPRECATED svn_error_t * svn_client_diff_summarize(const char *path1, const svn_opt_revision_t *revision1, const char *path2, const svn_opt_revision_t *revision2, svn_boolean_t recurse, svn_boolean_t ignore_ancestry, svn_client_diff_summarize_func_t summarize_func, void *summarize_baton, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Produce a diff summary which lists the changed items between the * filesystem object @a path in peg revision @a peg_revision, as it * changed between @a start_revision and @a end_revision. @a path can * be either a working-copy path or URL. * * If @a peg_revision is @c svn_opt_revision_unspecified, behave * identically to svn_client_diff_summarize2(), using @a path for both * of that function's @a path1 and @a path2 argments. * * The function may report false positives if @a ignore_ancestry is false, * as described in the documentation for svn_client_diff_summarize2(). * * Call @a summarize_func with @a summarize_baton for each difference * with a @c svn_client_diff_summarize_t structure describing the difference. * * See svn_client_diff_peg4() for a description of the other parameters. * * @since New in 1.5. */ svn_error_t * svn_client_diff_summarize_peg2(const char *path, const svn_opt_revision_t *peg_revision, const svn_opt_revision_t *start_revision, const svn_opt_revision_t *end_revision, svn_depth_t depth, svn_boolean_t ignore_ancestry, const apr_array_header_t *changelists, svn_client_diff_summarize_func_t summarize_func, void *summarize_baton, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_diff_summarize_peg2(), but with @a * changelists passed as @c NULL, and @a depth set according to @a * recurse: if @a recurse is TRUE, set @a depth to @c * svn_depth_infinity, if @a recurse is FALSE, set @a depth to @c * svn_depth_files. * * @deprecated Provided for backward compatibility with the 1.4 API. * * @since New in 1.4. */ SVN_DEPRECATED svn_error_t * svn_client_diff_summarize_peg(const char *path, const svn_opt_revision_t *peg_revision, const svn_opt_revision_t *start_revision, const svn_opt_revision_t *end_revision, svn_boolean_t recurse, svn_boolean_t ignore_ancestry, svn_client_diff_summarize_func_t summarize_func, void *summarize_baton, svn_client_ctx_t *ctx, apr_pool_t *pool); /** @} */ /** * @defgroup Merge Merge changes between branches. * * @{ */ /** Merge changes from @a source1/@a revision1 to @a source2/@a revision2 into * the working-copy path @a target_wcpath. * * @a source1 and @a source2 are either URLs that refer to entries in the * repository, or paths to entries in the working copy. * * By "merging", we mean: apply file differences using * svn_wc_merge(), and schedule additions & deletions when appropriate. * * @a source1 and @a source2 must both represent the same node kind -- that * is, if @a source1 is a directory, @a source2 must also be, and if @a source1 * is a file, @a source2 must also be. * * If either @a revision1 or @a revision2 has an `unspecified' or * unrecognized `kind', return @c SVN_ERR_CLIENT_BAD_REVISION. * * If @a depth is @c svn_depth_infinity, merge fully recursively. * Else if @c svn_depth_immediates, merge changes at most to files * that are immediate children of @a target_wcpath and to directory * properties of @a target_wcpath and its immediate subdirectory children. * Else if @c svn_depth_files, merge at most to immediate file * children of @a target_wcpath and to @a target_wcpath itself. * Else if @c svn_depth_empty, apply changes only to @a target_wcpath * (i.e., directory property changes only) * * If @a depth is @c svn_depth_unknown, use the depth of @a target_wcpath. * * Use @a ignore_ancestry to control whether or not items being * diffed will be checked for relatedness first. Unrelated items * are typically transmitted to the editor as a deletion of one thing * and the addition of another, but if this flag is TRUE, unrelated * items will be diffed as if they were related. * * If @a force is false and the merge involves deleting a file whose * content differs from the source-left version, or a locally modified * directory, or an unversioned item, then the operation will fail. If * @a force is true then all such items will be deleted. * * @a merge_options (an array of const char *), if non-NULL, * is used to pass additional command line arguments to the merge * processes (internal or external). @see * svn_diff_file_options_parse(). * * If @a ctx->notify_func2 is non-NULL, then call @a ctx->notify_func2 with @a * ctx->notify_baton2 once for each merged target, passing the target's local * path. * * If @a record_only is TRUE, the merge isn't actually performed, but * the mergeinfo for the revisions which would've been merged is * recorded in the working copy (and must be subsequently committed * back to the repository). * * If @a dry_run is TRUE, the merge is carried out, and full notification * feedback is provided, but the working copy is not modified. * * The authentication baton cached in @a ctx is used to communicate with the * repository. * * @since New in 1.5. */ svn_error_t * svn_client_merge3(const char *source1, const svn_opt_revision_t *revision1, const char *source2, const svn_opt_revision_t *revision2, const char *target_wcpath, svn_depth_t depth, svn_boolean_t ignore_ancestry, svn_boolean_t force, svn_boolean_t record_only, svn_boolean_t dry_run, const apr_array_header_t *merge_options, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_merge3(), but with @a record_only set to @c * FALSE, and @a depth set according to @a recurse: if @a recurse is * TRUE, set @a depth to @c svn_depth_infinity, if @a recurse is * FALSE, set @a depth to @c svn_depth_files. * * @deprecated Provided for backward compatibility with the 1.4 API. * * @since New in 1.4. */ SVN_DEPRECATED svn_error_t * svn_client_merge2(const char *source1, const svn_opt_revision_t *revision1, const char *source2, const svn_opt_revision_t *revision2, const char *target_wcpath, svn_boolean_t recurse, svn_boolean_t ignore_ancestry, svn_boolean_t force, svn_boolean_t dry_run, const apr_array_header_t *merge_options, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_merge2(), but with @a merge_options set to NULL. * * @deprecated Provided for backwards compatibility with the 1.3 API. */ SVN_DEPRECATED svn_error_t * svn_client_merge(const char *source1, const svn_opt_revision_t *revision1, const char *source2, const svn_opt_revision_t *revision2, const char *target_wcpath, svn_boolean_t recurse, svn_boolean_t ignore_ancestry, svn_boolean_t force, svn_boolean_t dry_run, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Perform a reintegration merge of @a source at @a peg_revision * into @a target_wcpath. * @a target_wcpath must be a single-revision, @c svn_depth_infinity, * pristine, unswitched working copy -- in other words, it must * reflect a single revision tree, the "target". The mergeinfo on @a * source must reflect that all of the target has been merged into it. * Then this behaves like a merge with svn_client_merge3() from the * target's URL to the source. * * All other options are handled identically to svn_client_merge3(). * The depth of the merge is always @c svn_depth_infinity. * * @since New in 1.5. */ svn_error_t * svn_client_merge_reintegrate(const char *source, const svn_opt_revision_t *peg_revision, const char *target_wcpath, svn_boolean_t dry_run, const apr_array_header_t *merge_options, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Merge the changes between the filesystem object @a source in peg * revision @a peg_revision, as it changed between the ranges described * in @a ranges_to_merge. * * @a ranges_to_merge is an array of svn_opt_revision_range_t * * ranges. These ranges may describe additive and/or * subtractive merge ranges, they may overlap fully or partially, * and/or they may partially or fully negate each other. This * rangelist is not required to be sorted. If any revision in the * list of provided ranges has an `unspecified' or unrecognized * `kind', return @c SVN_ERR_CLIENT_BAD_REVISION. * * All other options are handled identically to svn_client_merge3(). * * @since New in 1.5. */ svn_error_t * svn_client_merge_peg3(const char *source, const apr_array_header_t *ranges_to_merge, const svn_opt_revision_t *peg_revision, const char *target_wcpath, svn_depth_t depth, svn_boolean_t ignore_ancestry, svn_boolean_t force, svn_boolean_t record_only, svn_boolean_t dry_run, const apr_array_header_t *merge_options, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_merge_peg3(), but with @a record_only set to * @c FALSE, and @a depth set according to @a recurse: if @a recurse * is TRUE, set @a depth to @c svn_depth_infinity, if @a recurse is * FALSE, set @a depth to @c svn_depth_files. * * @deprecated Provided for backwards compatibility with the 1.3 API. * * @since New in 1.4. */ SVN_DEPRECATED svn_error_t * svn_client_merge_peg2(const char *source, const svn_opt_revision_t *revision1, const svn_opt_revision_t *revision2, const svn_opt_revision_t *peg_revision, const char *target_wcpath, svn_boolean_t recurse, svn_boolean_t ignore_ancestry, svn_boolean_t force, svn_boolean_t dry_run, const apr_array_header_t *merge_options, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_merge_peg2(), but with @a merge_options set to * NULL. * * @deprecated Provided for backwards compatibility with the 1.3 API. * * @since New in 1.1. */ SVN_DEPRECATED svn_error_t * svn_client_merge_peg(const char *source, const svn_opt_revision_t *revision1, const svn_opt_revision_t *revision2, const svn_opt_revision_t *peg_revision, const char *target_wcpath, svn_boolean_t recurse, svn_boolean_t ignore_ancestry, svn_boolean_t force, svn_boolean_t dry_run, svn_client_ctx_t *ctx, apr_pool_t *pool); /** Set @a suggestions to an ordered array of @c const char * * potential merge sources (expressed as full repository URLs) for @a * path_or_url at @a peg_revision. @a path_or_url is a working copy * path or repository URL. @a ctx is a context used for * authentication in the repository case. Use @a pool for all * allocations. * * @since New in 1.5. */ svn_error_t * svn_client_suggest_merge_sources(apr_array_header_t **suggestions, const char *path_or_url, const svn_opt_revision_t *peg_revision, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Set @a *mergeinfo to a hash mapping const char * merge * source URLs to apr_array_header_t * rangelists (arrays of * svn_merge_range_t * ranges) describing the ranges which * have been merged into @a path_or_url as of @a peg_revision, or @c * NULL if there is no mergeinfo. * * Use @a pool for all necessary allocations. * * If the server doesn't support retrieval of mergeinfo (which will * never happen for file:// URLs), return an @c * SVN_ERR_UNSUPPORTED_FEATURE error. * * @note Unlike most APIs which deal with mergeinfo, this one returns * data where the keys of the hash are absolute repository URLs rather * than repository filesystem paths. * * @since New in 1.5. */ svn_error_t * svn_client_mergeinfo_get_merged(apr_hash_t **mergeinfo, const char *path_or_url, const svn_opt_revision_t *peg_revision, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Drive log entry callbacks @a receiver / @a receiver_baton with the * revisions merged from @a merge_source_path_or_url (as of @a * src_peg_revision) into @a path_or_url (as of @a peg_revision). @a * ctx is a context used for authentication. * * @a discover_changed_paths and @a revprops are the same as for * svn_client_log4(). Use @a pool for all necessary allocations. * * If the server doesn't support retrieval of mergeinfo, return an @c * SVN_ERR_UNSUPPORTED_FEATURE error. * * @since New in 1.5. */ svn_error_t * svn_client_mergeinfo_log_merged(const char *path_or_url, const svn_opt_revision_t *peg_revision, const char *merge_source_path_or_url, const svn_opt_revision_t *src_peg_revision, svn_log_entry_receiver_t receiver, void *receiver_baton, svn_boolean_t discover_changed_paths, const apr_array_header_t *revprops, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Drive log entry callbacks @a receiver / @a receiver_baton with the * revisions eligible for merge from @a merge_source_path_or_url (as * of @a src_peg_revision) into @a path_or_url (as of @a * peg_revision). @a ctx is a context used for authentication. * * @a discover_changed_paths and @a revprops are the same as for * svn_client_log4(). Use @a pool for all necessary allocations. * * If the server doesn't support retrieval of mergeinfo, return an @c * SVN_ERR_UNSUPPORTED_FEATURE error. * * @since New in 1.5. */ svn_error_t * svn_client_mergeinfo_log_eligible(const char *path_or_url, const svn_opt_revision_t *peg_revision, const char *merge_source_path_or_url, const svn_opt_revision_t *src_peg_revision, svn_log_entry_receiver_t receiver, void *receiver_baton, svn_boolean_t discover_changed_paths, const apr_array_header_t *revprops, svn_client_ctx_t *ctx, apr_pool_t *pool); /** @} */ /** * @defgroup Cleanup Cleanup an abnormally terminated working copy. * * @{ */ /** Recursively cleanup a working copy directory @a dir, finishing any * incomplete operations, removing lockfiles, etc. * * If @a ctx->cancel_func is non-NULL, invoke it with @a * ctx->cancel_baton at various points during the operation. If it * returns an error (typically SVN_ERR_CANCELLED), return that error * immediately. */ svn_error_t * svn_client_cleanup(const char *dir, svn_client_ctx_t *ctx, apr_pool_t *pool); /** @} */ /** * @defgroup Relocate Switch a working copy to a different repository. * * @{ */ /** * Modify a working copy directory @a dir, changing any * repository URLs that begin with @a from to begin with @a to instead, * recursing into subdirectories if @a recurse is TRUE. * * @param dir Working copy directory * @param from Original URL * @param to New URL * @param recurse Whether to recurse * @param ctx svn_client_ctx_t * @param pool The pool from which to perform memory allocations */ svn_error_t * svn_client_relocate(const char *dir, const char *from, const char *to, svn_boolean_t recurse, svn_client_ctx_t *ctx, apr_pool_t *pool); /** @} */ /** * @defgroup Revert Remove local changes in a repository. * * @{ */ /** * Restore the pristine version of a working copy @a paths, * effectively undoing any local mods. For each path in @a paths, * revert it if it is a file. Else if it is a directory, revert * according to @a depth: * * If @a depth is @c svn_depth_empty, revert just the properties on * the directory; else if @c svn_depth_files, revert the properties * and any files immediately under the directory; else if * @c svn_depth_immediates, revert all of the preceding plus * properties on immediate subdirectories; else if @c svn_depth_infinity, * revert path and everything under it fully recursively. * * @a changelists is an array of const char * changelist * names, used as a restrictive filter on items reverted; that is, * don't revert any item unless it's a member of one of those * changelists. If @a changelists is empty (or altogether @c NULL), * no changelist filtering occurs. * * If @a ctx->notify_func2 is non-NULL, then for each item reverted, * call @a ctx->notify_func2 with @a ctx->notify_baton2 and the path of * the reverted item. * * If an item specified for reversion is not under version control, * then do not error, just invoke @a ctx->notify_func2 with @a * ctx->notify_baton2, using notification code @c svn_wc_notify_skip. * * @since New in 1.5. */ svn_error_t * svn_client_revert2(const apr_array_header_t *paths, svn_depth_t depth, const apr_array_header_t *changelists, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_revert2(), but with @a changelists passed as * @c NULL, and @a depth set according to @a recurse: if @a recurse is * TRUE, @a depth is @c svn_depth_infinity, else if @a recurse is * FALSE, @a depth is @c svn_depth_empty. * * @note Most APIs map @a recurse==FALSE to @a depth==svn_depth_files; * revert is deliberately different. * * @deprecated Provided for backwards compatibility with the 1.0 API. */ SVN_DEPRECATED svn_error_t * svn_client_revert(const apr_array_header_t *paths, svn_boolean_t recursive, svn_client_ctx_t *ctx, apr_pool_t *pool); /** @} */ /** * @defgroup Resolved Mark conflicted paths as resolved. * * @{ */ /** * Similar to svn_client_resolve(), but without automatic conflict * resolution support. * * @deprecated Provided for backward compatibility with the 1.4 API. * Use svn_client_resolve() instead. */ SVN_DEPRECATED svn_error_t * svn_client_resolved(const char *path, svn_boolean_t recursive, svn_client_ctx_t *ctx, apr_pool_t *pool); /** Perform automatic conflict resolution on a working copy @a path. * * If @a depth is @c svn_depth_empty, act only on @a path; if * @c svn_depth_files, resolve @a path and its conflicted file * children (if any); if @c svn_depth_immediates, resolve @a path and * all its immediate conflicted children (both files and directories, * if any); if @c svn_depth_infinity, resolve @a path and every * conflicted file or directory anywhere beneath it. * Note that this operation will try to lock the parent directory of * @a path in order to be able to resolve tree-conflicts on @a path. * * If @a conflict_choice is @c svn_wc_conflict_choose_base, resolve the * conflict with the old file contents; if * @c svn_wc_conflict_choose_mine_full, use the original working contents; * if @c svn_wc_conflict_choose_theirs_full, the new contents; and if * @c svn_wc_conflict_choose_merged, don't change the contents at all, * just remove the conflict status, which is the pre-1.5 behavior. * * @c svn_wc_conflict_choose_theirs_conflict and @c * svn_wc_conflict_choose_mine_conflict are not legal for binary * files or properties. * * If @a path is not in a state of conflict to begin with, do nothing. * If @a path's conflict state is removed and @a ctx->notify_func2 is non-NULL, * call @a ctx->notify_func2 with @a ctx->notify_baton2 and @a path. * * @since New in 1.5. */ svn_error_t * svn_client_resolve(const char *path, svn_depth_t depth, svn_wc_conflict_choice_t conflict_choice, svn_client_ctx_t *ctx, apr_pool_t *pool); /** @} */ /** * @defgroup Copy Copy paths in the working copy and repository. * * @{ */ /** * A structure which describes the source of a copy operation--its path, * revision, and peg revision. * * @since New in 1.5. */ typedef struct svn_client_copy_source_t { /** The source path or URL. */ const char *path; /** The source operational revision. */ const svn_opt_revision_t *revision; /** The source peg revision. */ const svn_opt_revision_t *peg_revision; } svn_client_copy_source_t; /** Copy each @a src in @a sources to @a dst_path. * * If multiple @a sources are given, @a dst_path must be a directory, * and @a sources will be copied as children of @a dst_path. * * @a sources must be an array of elements of type * svn_client_copy_source_t *. * * Each @a src in @a sources must be files or directories under version control, * or URLs of a versioned item in the repository. If @a sources has multiple * items, the @a src members must be all repository URLs or all working copy * paths. * * The parent of @a dst_path must already exist. * * If @a sources has only one item, attempt to copy it to @a dst_path. If * @a copy_as_child is TRUE and @a dst_path already exists, attempt to copy the * item as a child of @a dst_path. If @a copy_as_child is FALSE and * @a dst_path already exists, fail with @c SVN_ERR_ENTRY_EXISTS if @a dst_path * is a working copy path and @c SVN_ERR_FS_ALREADY_EXISTS if @a dst_path is a * URL. * * If @a sources has multiple items, and @a copy_as_child is TRUE, all * @a sources are copied as children of @a dst_path. If any child of * @a dst_path already exists with the same name any item in @a sources, * fail with @c SVN_ERR_ENTRY_EXISTS if @a dst_path is a working copy path and * @c SVN_ERR_FS_ALREADY_EXISTS if @a dst_path is a URL. * * If @a sources has multiple items, and @a copy_as_child is FALSE, fail * with @c SVN_ERR_CLIENT_MULTIPLE_SOURCES_DISALLOWED. * * If @a dst_path is a URL, use the authentication baton * in @a ctx and @a ctx->log_msg_func3/@a ctx->log_msg_baton3 to immediately * attempt to commit the copy action in the repository. If the commit * succeeds, allocate (in @a pool) and populate @a *commit_info_p. If * @a dst_path is not a URL, and the copy succeeds, set @a * *commit_info_p to @c NULL. * * If @a dst_path is not a URL, then this is just a variant of * svn_client_add(), where the @a sources are scheduled for addition * as copies. No changes will happen to the repository until a commit occurs. * This scheduling can be removed with svn_client_revert2(). * * If @a make_parents is TRUE, create any non-existent parent directories * also. * * If @a ignore_externals is set, don't process externals definitions * as part of this operation. * * If non-NULL, @a revprop_table is a hash table holding additional, * custom revision properties (const char * names mapped to * svn_string_t * values) to be set on the new revision in * the event that this is a committing operation. This table cannot * contain any standard Subversion properties. * * @a ctx->log_msg_func3/@a ctx->log_msg_baton3 are a callback/baton combo * that this function can use to query for a commit log message when one is * needed. * * If @a ctx->notify_func2 is non-NULL, invoke it with @a ctx->notify_baton2 * for each item added at the new location, passing the new, relative path of * the added item. * * @since New in 1.6. */ svn_error_t * svn_client_copy5(svn_commit_info_t **commit_info_p, apr_array_header_t *sources, const char *dst_path, svn_boolean_t copy_as_child, svn_boolean_t make_parents, svn_boolean_t ignore_externals, const apr_hash_t *revprop_table, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_copy5(), with @a ignore_externals set to @c FALSE. * * @since New in 1.5. * * @deprecated Provided for backward compatibility with the 1.5 API. */ SVN_DEPRECATED svn_error_t * svn_client_copy4(svn_commit_info_t **commit_info_p, apr_array_header_t *sources, const char *dst_path, svn_boolean_t copy_as_child, svn_boolean_t make_parents, const apr_hash_t *revprop_table, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_copy4(), with only one @a src_path, @a * copy_as_child set to @c FALSE, @a revprop_table passed as NULL, and * @a make_parents set to @c FALSE. Also, use @a src_revision as both * the operational and peg revision. * * @since New in 1.4. * * @deprecated Provided for backward compatibility with the 1.4 API. */ SVN_DEPRECATED svn_error_t * svn_client_copy3(svn_commit_info_t **commit_info_p, const char *src_path, const svn_opt_revision_t *src_revision, const char *dst_path, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_copy3(), with the difference that if @a dst_path * already exists and is a directory, copy the item into that directory, * keeping its name (the last component of @a src_path). * * @since New in 1.3. * * @deprecated Provided for backward compatibility with the 1.3 API. */ SVN_DEPRECATED svn_error_t * svn_client_copy2(svn_commit_info_t **commit_info_p, const char *src_path, const svn_opt_revision_t *src_revision, const char *dst_path, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_copy2(), but uses @c svn_client_commit_info_t * for @a commit_info_p. * * @deprecated Provided for backward compatibility with the 1.2 API. */ SVN_DEPRECATED svn_error_t * svn_client_copy(svn_client_commit_info_t **commit_info_p, const char *src_path, const svn_opt_revision_t *src_revision, const char *dst_path, svn_client_ctx_t *ctx, apr_pool_t *pool); /** @} */ /** * @defgroup Move Move paths in the working copy or repository. * * @{ */ /** * Move @a src_paths to @a dst_path. * * @a src_paths must be files or directories under version control, or * URLs of versioned items in the repository. All @a src_paths must be of * the same type. If multiple @a src_paths are given, @a dst_path must be * a directory and @a src_paths will be moved as children of @a dst_path. * * If @a src_paths are repository URLs: * * - @a dst_path must also be a repository URL. * * - The authentication baton in @a ctx and @a ctx->log_msg_func/@a * ctx->log_msg_baton are used to commit the move. * * - The move operation will be immediately committed. If the * commit succeeds, allocate (in @a pool) and populate @a *commit_info_p. * * If @a src_paths are working copy paths: * * - @a dst_path must also be a working copy path. * * - @a ctx->log_msg_func3 and @a ctx->log_msg_baton3 are ignored. * * - This is a scheduling operation. No changes will happen to the * repository until a commit occurs. This scheduling can be removed * with svn_client_revert2(). If one of @a src_paths is a file it is * removed from the working copy immediately. If one of @a src_path * is a directory it will remain in the working copy but all the files, * and unversioned items, it contains will be removed. * * - If one of @a src_paths contains locally modified and/or unversioned * items and @a force is not set, the move will fail. If @a force is set * such items will be removed. * * - If the move succeeds, set @a *commit_info_p to @c NULL. * * The parent of @a dst_path must already exist. * * If @a src_paths has only one item, attempt to move it to @a dst_path. If * @a move_as_child is TRUE and @a dst_path already exists, attempt to move the * item as a child of @a dst_path. If @a move_as_child is FALSE and * @a dst_path already exists, fail with @c SVN_ERR_ENTRY_EXISTS if @a dst_path * is a working copy path and @c SVN_ERR_FS_ALREADY_EXISTS if @a dst_path is a * URL. * * If @a src_paths has multiple items, and @a move_as_child is TRUE, all * @a src_paths are moved as children of @a dst_path. If any child of * @a dst_path already exists with the same name any item in @a src_paths, * fail with @c SVN_ERR_ENTRY_EXISTS if @a dst_path is a working copy path and * @c SVN_ERR_FS_ALREADY_EXISTS if @a dst_path is a URL. * * If @a src_paths has multiple items, and @a move_as_child is FALSE, fail * with @c SVN_ERR_CLIENT_MULTIPLE_SOURCES_DISALLOWED. * * If @a make_parents is TRUE, create any non-existent parent directories * also. * * If non-NULL, @a revprop_table is a hash table holding additional, * custom revision properties (const char * names mapped to * svn_string_t * values) to be set on the new revision in * the event that this is a committing operation. This table cannot * contain any standard Subversion properties. * * @a ctx->log_msg_func3/@a ctx->log_msg_baton3 are a callback/baton combo that * this function can use to query for a commit log message when one is needed. * * If @a ctx->notify_func2 is non-NULL, then for each item moved, call * @a ctx->notify_func2 with the @a ctx->notify_baton2 twice, once to indicate * the deletion of the moved thing, and once to indicate the addition of * the new location of the thing. * * ### Is this really true? What about svn_wc_notify_commit_replaced()? ### * * @since New in 1.5. */ svn_error_t * svn_client_move5(svn_commit_info_t **commit_info_p, apr_array_header_t *src_paths, const char *dst_path, svn_boolean_t force, svn_boolean_t move_as_child, svn_boolean_t make_parents, const apr_hash_t *revprop_table, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_move5(), with only one @a src_path, @a * move_as_child set to @c FALSE, @a revprop_table passed as NULL, and * @a make_parents set to @c FALSE. * * @since New in 1.4. * * @deprecated Provided for backward compatibility with the 1.4 API. */ SVN_DEPRECATED svn_error_t * svn_client_move4(svn_commit_info_t **commit_info_p, const char *src_path, const char *dst_path, svn_boolean_t force, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_move4(), with the difference that if @a dst_path * already exists and is a directory, move the item into that directory, * keeping its name (the last component of @a src_path). * * @since New in 1.3. * * @deprecated Provided for backward compatibility with the 1.3 API. */ SVN_DEPRECATED svn_error_t * svn_client_move3(svn_commit_info_t **commit_info_p, const char *src_path, const char *dst_path, svn_boolean_t force, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_move3(), but uses @c svn_client_commit_info_t * for @a commit_info_p. * * @deprecated Provided for backward compatibility with the 1.2 API. * * @since New in 1.2. */ SVN_DEPRECATED svn_error_t * svn_client_move2(svn_client_commit_info_t **commit_info_p, const char *src_path, const char *dst_path, svn_boolean_t force, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_move2(), but an extra argument @a src_revision * must be passed. This has no effect, but must be of kind * @c svn_opt_revision_unspecified or @c svn_opt_revision_head, * otherwise error @c SVN_ERR_UNSUPPORTED_FEATURE is returned. * * @deprecated Provided for backward compatibility with the 1.1 API. */ SVN_DEPRECATED svn_error_t * svn_client_move(svn_client_commit_info_t **commit_info_p, const char *src_path, const svn_opt_revision_t *src_revision, const char *dst_path, svn_boolean_t force, svn_client_ctx_t *ctx, apr_pool_t *pool); /** @} */ /** Properties * * Note that certain svn-controlled properties must always have their * values set and stored in UTF8 with LF line endings. When * retrieving these properties, callers must convert the values back * to native locale and native line-endings before displaying them to * the user. For help with this task, see * svn_prop_needs_translation(), svn_subst_translate_string(), and * svn_subst_detranslate_string(). * * @defgroup svn_client_prop_funcs Property functions * @{ */ /** * Set @a propname to @a propval on @a target. * A @a propval of @c NULL will delete the property. * * If @a depth is @c svn_depth_empty, set the property on @a target * only; if @c svn_depth_files, set it on @a target and its file * children (if any); if @c svn_depth_immediates, on @a target and all * of its immediate children (both files and directories); if * @c svn_depth_infinity, on @a target and everything beneath it. * * The @a target may only be an URL if @a base_revision_for_url is not * @c SVN_INVALID_REVNUM; in this case, the property will only be set * if it has not changed since revision @a base_revision_for_url. * @a base_revision_for_url must be @c SVN_INVALID_REVNUM if @a target * is not an URL. @a depth deeper than @c svn_depth_empty is not * supported on URLs. The authentication baton in @a ctx and @a * ctx->log_msg_func3/@a ctx->log_msg_baton3 will be used to * immediately attempt to commit the property change in the * repository. If the commit succeeds, allocate (in @a pool) and * populate @a *commit_info_p. * * If @a propname is an svn-controlled property (i.e. prefixed with * @c SVN_PROP_PREFIX), then the caller is responsible for ensuring that * the value is UTF8-encoded and uses LF line-endings. * * If @a skip_checks is TRUE, do no validity checking. But if @a * skip_checks is FALSE, and @a propname is not a valid property for @a * target, return an error, either @c SVN_ERR_ILLEGAL_TARGET (if the * property is not appropriate for @a target), or @c * SVN_ERR_BAD_MIME_TYPE (if @a propname is "svn:mime-type", but @a * propval is not a valid mime-type). * * @a changelists is an array of const char * changelist * names, used as a restrictive filter on items whose properties are * set; that is, don't set properties on any item unless it's a member * of one of those changelists. If @a changelists is empty (or * altogether @c NULL), no changelist filtering occurs. * * If non-NULL, @a revprop_table is a hash table holding additional, * custom revision properties (const char * names mapped to * svn_string_t * values) to be set on the new revision in * the event that this is a committing operation. This table cannot * contain any standard Subversion properties. * * If @a ctx->cancel_func is non-NULL, invoke it passing @a * ctx->cancel_baton at various places during the operation. * * Use @a pool for all memory allocation. * * @since New in 1.5. */ svn_error_t * svn_client_propset3(svn_commit_info_t **commit_info_p, const char *propname, const svn_string_t *propval, const char *target, svn_depth_t depth, svn_boolean_t skip_checks, svn_revnum_t base_revision_for_url, const apr_array_header_t *changelists, const apr_hash_t *revprop_table, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Like svn_client_propset3(), but with @a base_revision_for_url * always @c SVN_INVALID_REVNUM; @a commit_info_p always @c NULL; @a * changelists always @c NULL; @a revprop_table always @c NULL; and @a * depth set according to @a recurse: if @a recurse is TRUE, @a depth * is @c svn_depth_infinity, else @c svn_depth_empty. * * @deprecated Provided for backward compatibility with the 1.4 API. */ SVN_DEPRECATED svn_error_t * svn_client_propset2(const char *propname, const svn_string_t *propval, const char *target, svn_boolean_t recurse, svn_boolean_t skip_checks, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Like svn_client_propset2(), but with @a skip_checks always FALSE and a * newly created @a ctx. * * @deprecated Provided for backward compatibility with the 1.1 API. */ SVN_DEPRECATED svn_error_t * svn_client_propset(const char *propname, const svn_string_t *propval, const char *target, svn_boolean_t recurse, apr_pool_t *pool); /** Set @a propname to @a propval on revision @a revision in the repository * represented by @a URL. Use the authentication baton in @a ctx for * authentication, and @a pool for all memory allocation. Return the actual * rev affected in @a *set_rev. A @a propval of @c NULL will delete the * property. * * If @a original_propval is non-NULL, then just before setting the * new value, check that the old value matches @a original_propval; * if they do not match, return the error @c SVN_ERR_RA_OUT_OF_DATE. * This is to help clients support interactive editing of revprops: * without this check, the window during which the property may change * underneath the user is as wide as the amount of time the user * spends editing the property. With this check, the window is * reduced to a small, constant amount of time right before we set the * new value. (To check that an old value is still non-existent, set * @a original_propval->data to NULL, and @a original_propval->len is * ignored.) * * If @a force is TRUE, allow newlines in the author property. * * If @a propname is an svn-controlled property (i.e. prefixed with * @c SVN_PROP_PREFIX), then the caller is responsible for ensuring that * the value UTF8-encoded and uses LF line-endings. * * Note that unlike its cousin svn_client_propset3(), this routine * doesn't affect the working copy at all; it's a pure network * operation that changes an *unversioned* property attached to a * revision. This can be used to tweak log messages, dates, authors, * and the like. Be careful: it's a lossy operation. * @a ctx->notify_func2 and @a ctx->notify_baton2 are the notification * functions and baton which are called upon successful setting of the * property. * * Also note that unless the administrator creates a * pre-revprop-change hook in the repository, this feature will fail. * * @since New in 1.6. */ svn_error_t * svn_client_revprop_set2(const char *propname, const svn_string_t *propval, const svn_string_t *original_propval, const char *URL, const svn_opt_revision_t *revision, svn_revnum_t *set_rev, svn_boolean_t force, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_revprop_set2(), but with @a original_propval * always @c NULL. * * @deprecated Provided for backward compatibility with the 1.0 API. */ SVN_DEPRECATED svn_error_t * svn_client_revprop_set(const char *propname, const svn_string_t *propval, const char *URL, const svn_opt_revision_t *revision, svn_revnum_t *set_rev, svn_boolean_t force, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Set @a *props to a hash table whose keys are `char *' paths, * prefixed by @a target (a working copy path or a URL), of items on * which property @a propname is set, and whose values are `@c svn_string_t * *' representing the property value for @a propname at that path. * * Allocate @a *props, its keys, and its values in @a pool. * * Don't store any path, not even @a target, if it does not have a * property named @a propname. * * If @a revision->kind is @c svn_opt_revision_unspecified, then: get * properties from the working copy if @a target is a working copy * path, or from the repository head if @a target is a URL. Else get * the properties as of @a revision. The actual node revision * selected is determined by the path as it exists in @a peg_revision. * If @a peg_revision->kind is @c svn_opt_revision_unspecified, then * it defaults to @c svn_opt_revision_head for URLs or @c * svn_opt_revision_working for WC targets. Use the authentication * baton in @a ctx for authentication if contacting the repository. * If @a actual_revnum is not @c NULL, the actual revision number used * for the fetch is stored in @a *actual_revnum. * * If @a depth is @c svn_depth_empty, fetch the property from * @a target only; if @c svn_depth_files, fetch from @a target and its * file children (if any); if @c svn_depth_immediates, from @a target * and all of its immediate children (both files and directories); if * @c svn_depth_infinity, from @a target and everything beneath it. * * @a changelists is an array of const char * changelist * names, used as a restrictive filter on items whose properties are * set; that is, don't set properties on any item unless it's a member * of one of those changelists. If @a changelists is empty (or * altogether @c NULL), no changelist filtering occurs. * * If error, don't touch @a *props, otherwise @a *props is a hash table * even if empty. * * @since New in 1.5. */ svn_error_t * svn_client_propget3(apr_hash_t **props, const char *propname, const char *target, const svn_opt_revision_t *peg_revision, const svn_opt_revision_t *revision, svn_revnum_t *actual_revnum, svn_depth_t depth, const apr_array_header_t *changelists, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_propget3(), except that @a actual_revnum and * @a changelists are always @c NULL, and @a depth is set according to * @a recurse: if @a recurse is TRUE, then @a depth is @c * svn_depth_infinity, else @c svn_depth_empty. * * @deprecated Provided for backward compatibility with the 1.2 API. */ SVN_DEPRECATED svn_error_t * svn_client_propget2(apr_hash_t **props, const char *propname, const char *target, const svn_opt_revision_t *peg_revision, const svn_opt_revision_t *revision, svn_boolean_t recurse, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_propget2(), except that @a peg_revision is * always the same as @a revision. * * @deprecated Provided for backward compatibility with the 1.1 API. */ SVN_DEPRECATED svn_error_t * svn_client_propget(apr_hash_t **props, const char *propname, const char *target, const svn_opt_revision_t *revision, svn_boolean_t recurse, svn_client_ctx_t *ctx, apr_pool_t *pool); /** Set @a *propval to the value of @a propname on revision @a revision * in the repository represented by @a URL. Use the authentication baton * in @a ctx for authentication, and @a pool for all memory allocation. * Return the actual rev queried in @a *set_rev. * * Note that unlike its cousin svn_client_propget(), this routine * doesn't affect the working copy at all; it's a pure network * operation that queries an *unversioned* property attached to a * revision. This can query log messages, dates, authors, and the * like. */ svn_error_t * svn_client_revprop_get(const char *propname, svn_string_t **propval, const char *URL, const svn_opt_revision_t *revision, svn_revnum_t *set_rev, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Invoke @a receiver with @a receiver_baton to return the regular properies * of @a target, a URL or working copy path. @a receiver will be called * for each path encountered. * * If @a revision->kind is @c svn_opt_revision_unspecified, then get * properties from the working copy, if @a target is a working copy * path, or from the repository head if @a target is a URL. Else get * the properties as of @a revision. The actual node revision * selected is determined by the path as it exists in @a peg_revision. * If @a peg_revision->kind is @c svn_opt_revision_unspecified, then it * defaults to @c svn_opt_revision_head for URLs or @c * svn_opt_revision_working for WC targets. Use the authentication * baton cached in @a ctx for authentication if contacting the * repository. * * If @a depth is @c svn_depth_empty, list only the properties of * @a target itself. If @a depth is @c svn_depth_files, and * @a target is a directory, list the properties of @a target * and its file entries. If @c svn_depth_immediates, list the properties * of its immediate file and directory entries. If @c svn_depth_infinity, * list the properties of its file entries and recurse (with * @c svn_depth_infinity) on directory entries. @c svn_depth_unknown is * equivalent to @c svn_depth_empty. All other values produce undefined * results. * * @a changelists is an array of const char * changelist * names, used as a restrictive filter on items whose properties are * set; that is, don't set properties on any item unless it's a member * of one of those changelists. If @a changelists is empty (or * altogether @c NULL), no changelist filtering occurs. * * If @a target is not found, return the error @c SVN_ERR_ENTRY_NOT_FOUND. * * @since New in 1.5. */ svn_error_t * svn_client_proplist3(const char *target, const svn_opt_revision_t *peg_revision, const svn_opt_revision_t *revision, svn_depth_t depth, const apr_array_header_t *changelists, svn_proplist_receiver_t receiver, void *receiver_baton, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_proplist3(), except the properties are * returned as an array of @c svn_client_proplist_item_t * structures * instead of by invoking the receiver function, there's no support * for @a changelists filtering, and @a recurse is used instead of a * @c svn_depth_t parameter (FALSE corresponds to @c svn_depth_empty, * and TRUE to @c svn_depth_infinity). * * @since New in 1.2. * * @deprecated Provided for backward compatiblility with the 1.2 API. */ SVN_DEPRECATED svn_error_t * svn_client_proplist2(apr_array_header_t **props, const char *target, const svn_opt_revision_t *peg_revision, const svn_opt_revision_t *revision, svn_boolean_t recurse, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_proplist2(), except that @a peg_revision is * always the same as @a revision. * * @deprecated Provided for backward compatibility with the 1.1 API. */ SVN_DEPRECATED svn_error_t * svn_client_proplist(apr_array_header_t **props, const char *target, const svn_opt_revision_t *revision, svn_boolean_t recurse, svn_client_ctx_t *ctx, apr_pool_t *pool); /** Set @a *props to a hash of the revision props attached to @a revision in * the repository represented by @a URL. Use the authentication baton cached * in @a ctx for authentication, and @a pool for all memory allocation. * Return the actual rev queried in @a *set_rev. * * The allocated hash maps (const char *) property names to * (@c svn_string_t *) property values. * * Note that unlike its cousin svn_client_proplist(), this routine * doesn't read a working copy at all; it's a pure network operation * that reads *unversioned* properties attached to a revision. */ svn_error_t * svn_client_revprop_list(apr_hash_t **props, const char *URL, const svn_opt_revision_t *revision, svn_revnum_t *set_rev, svn_client_ctx_t *ctx, apr_pool_t *pool); /** @} */ /** * @defgroup Export Export a tree from version control. * * @{ */ /** * Export the contents of either a subversion repository or a * subversion working copy into a 'clean' directory (meaning a * directory with no administrative directories). If @a result_rev * is not @c NULL and the path being exported is a repository URL, set * @a *result_rev to the value of the revision actually exported (set * it to @c SVN_INVALID_REVNUM for local exports). * * @a from is either the path the working copy on disk, or a URL to the * repository you wish to export. * * @a to is the path to the directory where you wish to create the exported * tree. * * @a peg_revision is the revision where the path is first looked up * when exporting from a repository. If @a peg_revision->kind is @c * svn_opt_revision_unspecified, then it defaults to @c svn_opt_revision_head * for URLs or @c svn_opt_revision_working for WC targets. * * @a revision is the revision that should be exported, which is only used * when exporting from a repository. * * @a peg_revision and @a revision must not be @c NULL. * * @a ctx->notify_func2 and @a ctx->notify_baton2 are the notification * functions and baton which are passed to svn_client_checkout() when * exporting from a repository. * * @a ctx is a context used for authentication in the repository case. * * @a overwrite if TRUE will cause the export to overwrite files or directories. * * If @a ignore_externals is set, don't process externals definitions * as part of this operation. * * @a native_eol allows you to override the standard eol marker on the platform * you are running on. Can be either "LF", "CR" or "CRLF" or NULL. If NULL * will use the standard eol marker. Any other value will cause the * SVN_ERR_IO_UNKNOWN_EOL error to be returned. * * If @a depth is @c svn_depth_infinity, export fully recursively. * Else if it is @c svn_depth_immediates, export @a from and its immediate * children (if any), but with subdirectories empty and at * @c svn_depth_empty. Else if @c svn_depth_files, export @a from and * its immediate file children (if any) only. If @a depth is @c * svn_depth_empty, then export exactly @a from and none of its children. * * All allocations are done in @a pool. * * @since New in 1.5. */ svn_error_t * svn_client_export4(svn_revnum_t *result_rev, const char *from, const char *to, const svn_opt_revision_t *peg_revision, const svn_opt_revision_t *revision, svn_boolean_t overwrite, svn_boolean_t ignore_externals, svn_depth_t depth, const char *native_eol, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_export4(), but with @a depth set according to * @a recurse: if @a recurse is TRUE, set @a depth to * @c svn_depth_infinity, if @a recurse is FALSE, set @a depth to * @c svn_depth_files. * * @deprecated Provided for backward compatibility with the 1.4 API. * * @since New in 1.2. */ SVN_DEPRECATED svn_error_t * svn_client_export3(svn_revnum_t *result_rev, const char *from, const char *to, const svn_opt_revision_t *peg_revision, const svn_opt_revision_t *revision, svn_boolean_t overwrite, svn_boolean_t ignore_externals, svn_boolean_t recurse, const char *native_eol, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_export3(), but with @a peg_revision * always set to @c svn_opt_revision_unspecified, @a overwrite set to * the value of @a force, @a ignore_externals always FALSE, and * @a recurse always TRUE. * * @since New in 1.1. * @deprecated Provided for backward compatibility with the 1.1 API. */ SVN_DEPRECATED svn_error_t * svn_client_export2(svn_revnum_t *result_rev, const char *from, const char *to, svn_opt_revision_t *revision, svn_boolean_t force, const char *native_eol, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_export2(), but with @a native_eol always set * to NULL. * * @deprecated Provided for backward compatibility with the 1.0 API. */ SVN_DEPRECATED svn_error_t * svn_client_export(svn_revnum_t *result_rev, const char *from, const char *to, svn_opt_revision_t *revision, svn_boolean_t force, svn_client_ctx_t *ctx, apr_pool_t *pool); /** @} */ /** * @defgroup List List / ls * * @{ */ /** Invoked by svn_client_list2() for each @a path with its @a dirent and, * if @a path is locked, its @a lock. @a abs_path is the filesystem path * to which @a path is relative. @a baton is the baton passed to the * caller. @a pool may be used for temporary allocations. * * @since New in 1.4. */ typedef svn_error_t *(*svn_client_list_func_t)(void *baton, const char *path, const svn_dirent_t *dirent, const svn_lock_t *lock, const char *abs_path, apr_pool_t *pool); /** * Report the directory entry, and possibly children, for @a * path_or_url at @a revision. The actual node revision selected is * determined by the path as it exists in @a peg_revision. If @a * peg_revision->kind is @c svn_opt_revision_unspecified, then it defaults * to @c svn_opt_revision_head for URLs or @c svn_opt_revision_working * for WC targets. * * Report directory entries by invoking @a list_func/@a baton with @a path * relative to @a path_or_url. The dirent for @a path_or_url is reported * using an empty @a path. If @a path_or_url is a directory, also report * its children. If @a path_or_url is non-existent, return * @c SVN_ERR_FS_NOT_FOUND. * * If @a fetch_locks is TRUE, include locks when reporting directory entries. * * Use @a pool for temporary allocations. * * Use authentication baton cached in @a ctx to authenticate against the * repository. * * If @a depth is @c svn_depth_empty, list just @a path_or_url itself. * If @a depth is @c svn_depth_files, list @a path_or_url and its file * entries. If @c svn_depth_immediates, list its immediate file and * directory entries. If @c svn_depth_infinity, list file entries and * recurse (with @c svn_depth_infinity) on directory entries. * * @a dirent_fields controls which fields in the @c svn_dirent_t's are * filled in. To have them totally filled in use @c SVN_DIRENT_ALL, * otherwise simply bitwise OR together the combination of @c SVN_DIRENT_ * fields you care about. * * @since New in 1.5. */ svn_error_t * svn_client_list2(const char *path_or_url, const svn_opt_revision_t *peg_revision, const svn_opt_revision_t *revision, svn_depth_t depth, apr_uint32_t dirent_fields, svn_boolean_t fetch_locks, svn_client_list_func_t list_func, void *baton, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_list2(), but with @a recurse instead of @a depth. * If @a recurse is TRUE, pass @c svn_depth_files for @a depth; else * pass @c svn_depth_infinity. * * @since New in 1.4. * * @deprecated Provided for backward compatibility with the 1.4 API. */ SVN_DEPRECATED svn_error_t * svn_client_list(const char *path_or_url, const svn_opt_revision_t *peg_revision, const svn_opt_revision_t *revision, svn_boolean_t recurse, apr_uint32_t dirent_fields, svn_boolean_t fetch_locks, svn_client_list_func_t list_func, void *baton, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Same as svn_client_list(), but always passes @c SVN_DIRENT_ALL for * the @a dirent_fields argument and returns all information in two * hash tables instead of invoking a callback. * * Set @a *dirents to a newly allocated hash of directory entries. * The @a dirents hash maps entry names (const char *) to * @c svn_dirent_t *'s. * * If @a locks is not @c NULL, set @a *locks to a hash table mapping * entry names (const char *) to @c svn_lock_t *'s. * * @since New in 1.3. * * @deprecated Provided for backward compatibility with the 1.3 API. * Use svn_client_list2() instead. */ SVN_DEPRECATED svn_error_t * svn_client_ls3(apr_hash_t **dirents, apr_hash_t **locks, const char *path_or_url, const svn_opt_revision_t *peg_revision, const svn_opt_revision_t *revision, svn_boolean_t recurse, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Same as svn_client_ls3(), but without the ability to get locks. * * @since New in 1.2. * * @deprecated Provided for backward compatibility with the 1.2 API. * Use svn_client_list2() instead. */ SVN_DEPRECATED svn_error_t * svn_client_ls2(apr_hash_t **dirents, const char *path_or_url, const svn_opt_revision_t *peg_revision, const svn_opt_revision_t *revision, svn_boolean_t recurse, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_ls2() except that @a peg_revision is always * the same as @a revision. * * @deprecated Provided for backward compatibility with the 1.1 API. * Use svn_client_list2() instead. */ SVN_DEPRECATED svn_error_t * svn_client_ls(apr_hash_t **dirents, const char *path_or_url, svn_opt_revision_t *revision, svn_boolean_t recurse, svn_client_ctx_t *ctx, apr_pool_t *pool); /** @} */ /** * @defgroup Cat View the contents of a file in the repository. * * @{ */ /** * Output the content of file identified by @a path_or_url and @a * revision to the stream @a out. The actual node revision selected * is determined by the path as it exists in @a peg_revision. If @a * peg_revision->kind is @c svn_opt_revision_unspecified, then it defaults * to @c svn_opt_revision_head for URLs or @c svn_opt_revision_working * for WC targets. * * If @a path_or_url is not a local path, then if @a revision is of * kind @c svn_opt_revision_previous (or some other kind that requires * a local path), an error will be returned, because the desired * revision cannot be determined. * * Use the authentication baton cached in @a ctx to authenticate against the * repository. * * Perform all allocations from @a pool. * * ### @todo Add an expansion/translation flag? * * @since New in 1.2. */ svn_error_t * svn_client_cat2(svn_stream_t *out, const char *path_or_url, const svn_opt_revision_t *peg_revision, const svn_opt_revision_t *revision, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_cat2() except that the peg revision is always * the same as @a revision. * * @deprecated Provided for backward compatibility with the 1.1 API. */ SVN_DEPRECATED svn_error_t * svn_client_cat(svn_stream_t *out, const char *path_or_url, const svn_opt_revision_t *revision, svn_client_ctx_t *ctx, apr_pool_t *pool); /** @} end group: cat */ /** Changelist commands * * @defgroup svn_client_changelist_funcs Client Changelist Functions * @{ */ /** Implementation note: * * For now, changelists are implemented by scattering the * associations across multiple .svn/entries files in a working copy. * However, this client API was written so that we have the option of * changing the underlying implementation -- we may someday want to * store changelist definitions in a centralized database. */ /** * Add each path in @a paths (recursing to @a depth as necessary) to * @a changelist. If a path is already a member of another * changelist, then remove it from the other changelist and add it to * @a changelist. (For now, a path cannot belong to two changelists * at once.) * * @a changelists is an array of const char * changelist * names, used as a restrictive filter on items whose changelist * assignments are adjusted; that is, don't tweak the changeset of any * item unless it's currently a member of one of those changelists. * If @a changelists is empty (or altogether @c NULL), no changelist * filtering occurs. * * @note This metadata is purely a client-side "bookkeeping" * convenience, and is entirely managed by the working copy. * * @since New in 1.5. */ svn_error_t * svn_client_add_to_changelist(const apr_array_header_t *paths, const char *changelist, svn_depth_t depth, const apr_array_header_t *changelists, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Remove each path in @a paths (recursing to @a depth as necessary) * from changelists to which they are currently assigned. * * @a changelists is an array of const char * changelist * names, used as a restrictive filter on items whose changelist * assignments are removed; that is, don't remove from a changeset any * item unless it's currently a member of one of those changelists. * If @a changelists is empty (or altogether @c NULL), all changelist * assignments in and under each path in @a paths (to @a depth) will * be removed. * * @note This metadata is purely a client-side "bookkeeping" * convenience, and is entirely managed by the working copy. * * @since New in 1.5. */ svn_error_t * svn_client_remove_from_changelists(const apr_array_header_t *paths, svn_depth_t depth, const apr_array_header_t *changelists, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * The callback type used by svn_client_get_changelists(). * * On each invocation, @a path is a newly discovered member of the * changelist, and @a baton is a private function closure. * * @since New in 1.5. */ typedef svn_error_t *(*svn_changelist_receiver_t) (void *baton, const char *path, const char *changelist, apr_pool_t *pool); /** * Beginning at @a path, crawl to @a depth to discover every path in * or under @a path which belongs to one of the changelists in @a * changelists (an array of const char * changelist names). * If @a changelists is @c null, discover paths with any changelist. * Call @a callback_func (with @a callback_baton) each time a * changelist-having path is discovered. * * If @a ctx->cancel_func is not @c null, invoke it passing @a * ctx->cancel_baton during the recursive walk. * * @since New in 1.5. */ svn_error_t * svn_client_get_changelists(const char *path, const apr_array_header_t *changelists, svn_depth_t depth, svn_changelist_receiver_t callback_func, void *callback_baton, svn_client_ctx_t *ctx, apr_pool_t *pool); /** @} */ /** Locking commands * * @defgroup svn_client_locking_funcs Client Locking Functions * @{ */ /** * Lock @a targets in the repository. @a targets is an array of * const char * paths - either all working copy paths or URLs. All * @a targets must be in the same repository. * * If a target is already locked in the repository, no lock will be * acquired unless @a steal_lock is TRUE, in which case the locks are * stolen. @a comment, if non-NULL, is an xml-escapable description * stored with each lock in the repository. Each acquired lock will * be stored in the working copy if the targets are WC paths. * * For each target @a ctx->notify_func2/notify_baton2 will be used to indicate * whether it was locked. An action of @c svn_wc_notify_state_locked * means that the path was locked. If the path was not locked because * it was out of date or there was already a lock in the repository, * the notification function will be called with @c * svn_wc_notify_failed_lock, and the error passed in the notification * structure. * * Use @a pool for temporary allocations. * * @since New in 1.2. */ svn_error_t * svn_client_lock(const apr_array_header_t *targets, const char *comment, svn_boolean_t steal_lock, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Unlock @a targets in the repository. @a targets is an array of * const char * paths - either all working copy paths or all URLs. * All @a targets must be in the same repository. * * If the targets are WC paths, and @a break_lock is FALSE, the working * copy must contain a locks for each target. * If this is not the case, or the working copy lock doesn't match the * lock token in the repository, an error will be signaled. * * If the targets are URLs, the locks may be broken even if @a break_lock * is FALSE, but only if the lock owner is the same as the * authenticated user. * * If @a break_lock is TRUE, the locks will be broken in the * repository. In both cases, the locks, if any, will be removed from * the working copy if the targets are WC paths. * * The notification functions in @a ctx will be called for each * target. If the target was successfully unlocked, @c * svn_wc_notify_unlocked will be used. Else, if the error is * directly related to unlocking the path (see @c * SVN_ERR_IS_UNLOCK_ERROR), @c svn_wc_notify_failed_unlock will be * used and the error will be passed in the notification structure. * Use @a pool for temporary allocations. * * @since New in 1.2. */ svn_error_t * svn_client_unlock(const apr_array_header_t *targets, svn_boolean_t break_lock, svn_client_ctx_t *ctx, apr_pool_t *pool); /** @} */ /** * @defgroup Info Show repository information about a working copy. * * @{ */ /** The size of the file is unknown. * Used as value in fields of type @c apr_size_t. * * @since New in 1.5 */ #define SVN_INFO_SIZE_UNKNOWN ((apr_size_t) -1) /** * A structure which describes various system-generated metadata about * a working-copy path or URL. * * @note Fields may be added to the end of this structure in future * versions. Therefore, users shouldn't allocate structures of this * type, to preserve binary compatibility. * * @since New in 1.2. */ typedef struct svn_info_t { /** Where the item lives in the repository. */ const char *URL; /** The revision of the object. If path_or_url is a working-copy * path, then this is its current working revnum. If path_or_url * is a URL, then this is the repos revision that path_or_url lives in. */ svn_revnum_t rev; /** The node's kind. */ svn_node_kind_t kind; /** The root URL of the repository. */ const char *repos_root_URL; /** The repository's UUID. */ const char *repos_UUID; /** The last revision in which this object changed. */ svn_revnum_t last_changed_rev; /** The date of the last_changed_rev. */ apr_time_t last_changed_date; /** The author of the last_changed_rev. */ const char *last_changed_author; /** An exclusive lock, if present. Could be either local or remote. */ svn_lock_t *lock; /** Whether or not to ignore the next 10 wc-specific fields. */ svn_boolean_t has_wc_info; /** * @name Working-copy path fields * These things only apply to a working-copy path. * See svn_wc_entry_t for explanations. * @{ */ svn_wc_schedule_t schedule; const char *copyfrom_url; svn_revnum_t copyfrom_rev; apr_time_t text_time; apr_time_t prop_time; /* will always be 0 for svn 1.4 and later */ const char *checksum; const char *conflict_old; const char *conflict_new; const char *conflict_wrk; const char *prejfile; /** @since New in 1.5. */ const char *changelist; /** @since New in 1.5. */ svn_depth_t depth; /** * Similar to working_size64, but will be @c SVN_INFO_SIZE_UNKNOWN when * its value would overflow apr_size_t (so when size >= 4 GB - 1 byte). * * @deprecated Provided for backward compatibility with the 1.5 API. */ apr_size_t working_size; /** @} */ /** * Similar to size64, but size will be @c SVN_INFO_SIZE_UNKNOWN when * its value would overflow apr_size_t (so when size >= 4 GB - 1 byte). * * @deprecated Provided for backward compatibility with the 1.5 API. */ apr_size_t size; /** * The size of the file in the repository (untranslated, * e.g. without adjustment of line endings and keyword * expansion). Only applicable for file -- not directory -- URLs. * For working copy paths, size64 will be @c SVN_INVALID_FILESIZE. * @since New in 1.6. */ svn_filesize_t size64; /** * The size of the file after being translated into its local * representation, or @c SVN_INVALID_FILESIZE if unknown. * Not applicable for directories. * @since New in 1.6. * @name Working-copy path fields * @{ */ svn_filesize_t working_size64; /** * Info on any tree conflict of which this node is a victim. Otherwise NULL. * @since New in 1.6. */ svn_wc_conflict_description_t *tree_conflict; /** @} */ } svn_info_t; /** * The callback invoked by svn_client_info2(). Each invocation * describes @a path with the information present in @a info. Note * that any fields within @a info may be NULL if information is * unavailable. Use @a pool for all temporary allocation. * * @since New in 1.2. */ typedef svn_error_t *(*svn_info_receiver_t) (void *baton, const char *path, const svn_info_t *info, apr_pool_t *pool); /** * Return a duplicate of @a info, allocated in @a pool. No part of the new * structure will be shared with @a info. * * @since New in 1.3. */ svn_info_t * svn_info_dup(const svn_info_t *info, apr_pool_t *pool); /** * Invoke @a receiver with @a receiver_baton to return information * about @a path_or_url in @a revision. The information returned is * system-generated metadata, not the sort of "property" metadata * created by users. See @c svn_info_t. * * If both revision arguments are either @c * svn_opt_revision_unspecified or NULL, then information will be * pulled solely from the working copy; no network connections will be * made. * * Otherwise, information will be pulled from a repository. The * actual node revision selected is determined by the @a path_or_url * as it exists in @a peg_revision. If @a peg_revision->kind is @c * svn_opt_revision_unspecified, then it defaults to @c * svn_opt_revision_head for URLs or @c svn_opt_revision_working for * WC targets. * * If @a path_or_url is not a local path, then if @a revision is of * kind @c svn_opt_revision_previous (or some other kind that requires * a local path), an error will be returned, because the desired * revision cannot be determined. * * Use the authentication baton cached in @a ctx to authenticate * against the repository. * * If @a path_or_url is a file, just invoke @a receiver on it. If it * is a directory, then descend according to @a depth. If @a depth is * @c svn_depth_empty, invoke @a receiver on @a path_or_url and * nothing else; if @c svn_depth_files, on @a path_or_url and its * immediate file children; if @c svn_depth_immediates, the preceding * plus on each immediate subdirectory; if @c svn_depth_infinity, then * recurse fully, invoking @a receiver on @a path_or_url and * everything beneath it. * * @a changelists is an array of const char * changelist * names, used as a restrictive filter on items whose info is * reported; that is, don't report info about any item unless * it's a member of one of those changelists. If @a changelists is * empty (or altogether @c NULL), no changelist filtering occurs. * * @since New in 1.5. */ svn_error_t * svn_client_info2(const char *path_or_url, const svn_opt_revision_t *peg_revision, const svn_opt_revision_t *revision, svn_info_receiver_t receiver, void *receiver_baton, svn_depth_t depth, const apr_array_header_t *changelists, svn_client_ctx_t *ctx, apr_pool_t *pool); /** * Similar to svn_client_info2() but with @a changelists passed as @c * NULL, and @a depth set according to @a recurse: if @a recurse is * TRUE, @a depth is @c svn_depth_infinity, else @c svn_depth_empty. * * @deprecated Provided for backward compatibility with the 1.2 API. */ SVN_DEPRECATED svn_error_t * svn_client_info(const char *path_or_url, const svn_opt_revision_t *peg_revision, const svn_opt_revision_t *revision, svn_info_receiver_t receiver, void *receiver_baton, svn_boolean_t recurse, svn_client_ctx_t *ctx, apr_pool_t *pool); /** @} */ /** @} end group: Client working copy management */ /** * * @defgroup clnt_sessions Client session related functions * * @{ * */ /* Converting paths to URLs. */ /** Set @a *url to the URL for @a path_or_url. * * If @a path_or_url is already a URL, set @a *url to @a path_or_url. * * If @a path_or_url is a versioned item, set @a *url to @a * path_or_url's entry URL. If @a path_or_url is unversioned (has * no entry), set @a *url to NULL. */ svn_error_t * svn_client_url_from_path(const char **url, const char *path_or_url, apr_pool_t *pool); /** Set @a *url to the repository root URL of the repository in which * @a path_or_url is versioned (or scheduled to be versioned), * allocated in @a pool. @a ctx is required for possible repository * authentication. * * @since New in 1.5. */ svn_error_t * svn_client_root_url_from_path(const char **url, const char *path_or_url, svn_client_ctx_t *ctx, apr_pool_t *pool); /* Fetching repository UUIDs. */ /** Get repository @a uuid for @a url. * * Use a @a pool to open a temporary RA session to @a url, discover the * repository uuid, and free the session. Return the uuid in @a uuid, * allocated in @a pool. @a ctx is required for possible repository * authentication. */ svn_error_t * svn_client_uuid_from_url(const char **uuid, const char *url, svn_client_ctx_t *ctx, apr_pool_t *pool); /** Return the repository @a uuid for working-copy @a path, allocated * in @a pool. Use @a adm_access to retrieve the uuid from @a path's * entry; if not present in the entry, then look in its parents. If not * present in the workingcopy call svn_client_uuid_from_url() to * retrieve, using the entry's URL. @a ctx is required for possible * repository authentication. * * @note The only reason this function falls back on * svn_client_uuid_from_url() is for compatibility purposes. Old and * detached working copies may not have uuids in the entries file. */ svn_error_t * svn_client_uuid_from_path(const char **uuid, const char *path, svn_wc_adm_access_t *adm_access, svn_client_ctx_t *ctx, apr_pool_t *pool); /* Opening RA sessions. */ /** Open an RA session rooted at @a url, and return it in @a *session. * * Use the authentication baton stored in @a ctx for authentication. * @a *session is allocated in @a pool. * * @since New in 1.3. * * @note This function is similar to svn_ra_open3(), but the caller avoids * having to providing its own callback functions. */ svn_error_t * svn_client_open_ra_session(svn_ra_session_t **session, const char *url, svn_client_ctx_t *ctx, apr_pool_t *pool); /** @} end group: Client session related functions */ /** @} */ #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* SVN_CLIENT_H */ 0707010002c640000081a40000000000000000000000014cb50d9b000000090000010000010036ffffffffffffffff0000003500000000root/usr/local/include/subversion-1/svn-revision.txtexported 0707010002c648000081a40000000000000000000000014cb50d8e000018420000010000010036ffffffffffffffff0000003000000000root/usr/local/include/subversion-1/svn_ctype.h/** * @copyright * ==================================================================== * Copyright (c) 2000-2004, 2008 CollabNet. All rights reserved. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://subversion.tigris.org/license-1.html. * If newer versions of this license are posted there, you may use a * newer version instead, at your option. * * This software consists of voluntary contributions made by many * individuals. For exact contribution history, see the revision * history and logs, available at http://subversion.tigris.org/. * ==================================================================== * @endcopyright * * @file svn_ctype.h * @brief Character classification routines * @since New in 1.2. */ #ifndef SVN_CTYPE_H #define SVN_CTYPE_H #include #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** Table of flags for character classification. */ extern const apr_uint32_t *const svn_ctype_table; /** Check if @a c is in the character class described by @a flags. * The @a flags is a bitwise-or combination of @c SVN_CTYPE_* * constants. Uses #svn_ctype_table. */ #define svn_ctype_test(c, flags) \ (0 != (svn_ctype_table[(unsigned char)(c)] & (flags))) /** * @defgroup ctype_basic Basic character classification - 7-bit ASCII only * @{ */ /* Basic character classes */ #define SVN_CTYPE_CNTRL 0x0001 /**< Control character */ #define SVN_CTYPE_SPACE 0x0002 /**< Whitespace */ #define SVN_CTYPE_DIGIT 0x0004 /**< Decimal digit */ #define SVN_CTYPE_UPPER 0x0008 /**< Uppercase letter */ #define SVN_CTYPE_LOWER 0x0010 /**< Lowercase letter */ #define SVN_CTYPE_PUNCT 0x0020 /**< Punctuation mark */ #define SVN_CTYPE_XALPHA 0x0040 /**< Hexadecimal digits A to F */ #define SVN_CTYPE_ASCII 0x0080 /**< ASCII subset*/ /* Derived character classes */ /** ASCII letter */ #define SVN_CTYPE_ALPHA (SVN_CTYPE_LOWER | SVN_CTYPE_UPPER) /** ASCII letter or decimal digit */ #define SVN_CTYPE_ALNUM (SVN_CTYPE_ALPHA | SVN_CTYPE_DIGIT) /** ASCII hexadecimal digit */ #define SVN_CTYPE_XDIGIT (SVN_CTYPE_DIGIT | SVN_CTYPE_XALPHA) /** Printable ASCII except space */ #define SVN_CTYPE_GRAPH (SVN_CTYPE_PUNCT | SVN_CTYPE_ALNUM) /** All printable ASCII */ #define SVN_CTYPE_PRINT (SVN_CTYPE_GRAPH | SVN_CTYPE_SPACE) /** Check if @a c is an ASCII control character. */ #define svn_ctype_iscntrl(c) svn_ctype_test((c), SVN_CTYPE_CNTRL) /** Check if @a c is an ASCII whitespace character. */ #define svn_ctype_isspace(c) svn_ctype_test((c), SVN_CTYPE_SPACE) /** Check if @a c is an ASCII digit. */ #define svn_ctype_isdigit(c) svn_ctype_test((c), SVN_CTYPE_DIGIT) /** Check if @a c is an ASCII uppercase letter. */ #define svn_ctype_isupper(c) svn_ctype_test((c), SVN_CTYPE_UPPER) /** Check if @a c is an ASCII lowercase letter. */ #define svn_ctype_islower(c) svn_ctype_test((c), SVN_CTYPE_LOWER) /** Check if @a c is an ASCII punctuation mark. */ #define svn_ctype_ispunct(c) svn_ctype_test((c), SVN_CTYPE_PUNCT) /** Check if @a c is an ASCII character. */ #define svn_ctype_isascii(c) svn_ctype_test((c), SVN_CTYPE_ASCII) /** Check if @a c is an ASCII letter. */ #define svn_ctype_isalpha(c) svn_ctype_test((c), SVN_CTYPE_ALPHA) /** Check if @a c is an ASCII letter or decimal digit. */ #define svn_ctype_isalnum(c) svn_ctype_test((c), SVN_CTYPE_ALNUM) /** Check if @a c is an ASCII hexadecimal digit. */ #define svn_ctype_isxdigit(c) svn_ctype_test((c), SVN_CTYPE_XDIGIT) /** Check if @a c is an ASCII graphical (visible printable) character. */ #define svn_ctype_isgraph(c) svn_ctype_test((c), SVN_CTYPE_GRAPH) /** Check if @a c is an ASCII printable character. */ #define svn_ctype_isprint(c) svn_ctype_test((c), SVN_CTYPE_PRINT) /** @} */ /** * @defgroup ctype_extra Extended character classification * @{ */ /* Basic extended character classes */ #define SVN_CTYPE_UTF8LEAD 0x0100 /**< UTF-8 multibyte lead byte */ #define SVN_CTYPE_UTF8CONT 0x0200 /**< UTF-8 multibyte non-lead byte */ /* ### TBD #define SVN_CTYPE_XMLNAME 0x0400 #define SVN_CTYPE_URISAFE 0x0800 */ /* Derived extended character classes */ /** Part of a UTF-8 multibyte character. */ #define SVN_CTYPE_UTF8MBC (SVN_CTYPE_UTF8LEAD | SVN_CTYPE_UTF8CONT) /** All valid UTF-8 bytes. */ #define SVN_CTYPE_UTF8 (SVN_CTYPE_ASCII | SVN_CTYPE_UTF8MBC) /** Check if @a c is a UTF-8 multibyte lead byte. */ #define svn_ctype_isutf8lead(c) svn_ctype_test((c), SVN_CTYPE_UTF8LEAD) /** Check if @a c is a UTF-8 multibyte continuation (non-lead) byte. */ #define svn_ctype_isutf8cont(c) svn_ctype_test((c), SVN_CTYLE_UTF8CONT) /** Check if @a c is part of a UTF-8 multibyte character. */ #define svn_ctype_isutf8mbc(c) svn_ctype_test((c), SVN_CTYPE_UTF8MBC) /** Check if @a c is valid in UTF-8. */ #define svn_ctype_isutf8(c) svn_ctype_test((c), SVN_CTYPE_UTF8) /** @} */ /** * @defgroup ctype_ascii ASCII character value constants * @{ */ #define SVN_CTYPE_ASCII_MINUS 45 /**< ASCII value of '-' */ #define SVN_CTYPE_ASCII_DOT 46 /**< ASCII value of '.' */ #define SVN_CTYPE_ASCII_COLON 58 /**< ASCII value of ':' */ #define SVN_CTYPE_ASCII_UNDERSCORE 95 /**< ASCII value of '_' */ #define SVN_CTYPE_ASCII_TAB 9 /**< ASCII value of a tab */ #define SVN_CTYPE_ASCII_LINEFEED 10 /**< ASCII value of a line feed */ #define SVN_CTYPE_ASCII_CARRIAGERETURN 13 /**< ASCII value of a carriage return */ #define SVN_CTYPE_ASCII_DELETE 127 /**< ASCII value of a delete character */ /** @} */ /** * @defgroup ctype_case ASCII-subset case folding * @{ */ /** * Compare two characters @a a and @a b, treating case-equivalent * unaccented Latin (ASCII subset) letters as equal. * * Returns in integer greater than, equal to, or less than 0, * according to whether @a a is considered greater than, equal to, * or less than @a b. * * @since New in 1.5. */ int svn_ctype_casecmp(int a, int b); /** @} */ #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* SVN_CTYPE_H */ 0707010002c657000081a40000000000000000000000014cb50d8e000063f50000010000010036ffffffffffffffff0000002e00000000root/usr/local/include/subversion-1/svn_opt.h/** * @copyright * ==================================================================== * Copyright (c) 2000-2008 CollabNet. All rights reserved. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://subversion.tigris.org/license-1.html. * If newer versions of this license are posted there, you may use a * newer version instead, at your option. * * This software consists of voluntary contributions made by many * individuals. For exact contribution history, see the revision * history and logs, available at http://subversion.tigris.org/. * ==================================================================== * @endcopyright * * @file svn_opt.h * @brief Option and argument parsing for Subversion command lines */ #ifndef SVN_OPTS_H #define SVN_OPTS_H #include #include #include #include #include #ifndef DOXYGEN_SHOULD_SKIP_THIS #define APR_WANT_STDIO #endif #include /* for FILE* */ #include "svn_types.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * All subcommand procedures in Subversion conform to this prototype. * * @a os is the apr option state after getopt processing has been run; in * other words, it still contains the non-option arguments following * the subcommand. See @a os->argv and @a os->ind. * * @a baton is anything you need it to be. * * @a pool is used for allocating errors, and for any other allocation * unless the instance is explicitly documented to allocate from a * pool in @a baton. */ typedef svn_error_t *(svn_opt_subcommand_t) (apr_getopt_t *os, void *baton, apr_pool_t *pool); /** The maximum number of aliases a subcommand can have. */ #define SVN_OPT_MAX_ALIASES 3 /** The maximum number of options that can be accepted by a subcommand. */ #define SVN_OPT_MAX_OPTIONS 50 /** Options that have no short option char should use an identifying * integer equal to or greater than this. */ #define SVN_OPT_FIRST_LONGOPT_ID 256 /** One element of a subcommand dispatch table. * * @since New in 1.4. */ typedef struct svn_opt_subcommand_desc2_t { /** The full name of this command. */ const char *name; /** The function this command invokes. */ svn_opt_subcommand_t *cmd_func; /** A list of alias names for this command (e.g., 'up' for 'update'). */ const char *aliases[SVN_OPT_MAX_ALIASES]; /** A brief string describing this command, for usage messages. */ const char *help; /** A list of options accepted by this command. Each value in the * array is a unique enum (the 2nd field in apr_getopt_option_t) */ int valid_options[SVN_OPT_MAX_OPTIONS]; /** A list of option help descriptions, keyed by the option unique enum * (the 2nd field in apr_getopt_option_t), which override the generic * descriptions given in an apr_getopt_option_t on a per-subcommand basis. */ struct { int optch; const char *desc; } desc_overrides[SVN_OPT_MAX_OPTIONS]; } svn_opt_subcommand_desc2_t; /** One element of a subcommand dispatch table. * * @deprecated Provided for backward compatibility with the 1.3 API. * * Like #svn_opt_subcommand_desc2_t but lacking the @c desc_overrides * member. */ typedef struct svn_opt_subcommand_desc_t { /** The full name of this command. */ const char *name; /** The function this command invokes. */ svn_opt_subcommand_t *cmd_func; /** A list of alias names for this command (e.g., 'up' for 'update'). */ const char *aliases[SVN_OPT_MAX_ALIASES]; /** A brief string describing this command, for usage messages. */ const char *help; /** A list of options accepted by this command. Each value in the * array is a unique enum (the 2nd field in apr_getopt_option_t) */ int valid_options[SVN_OPT_MAX_OPTIONS]; } svn_opt_subcommand_desc_t; /** * Return the entry in @a table whose name matches @a cmd_name, or @c NULL if * none. @a cmd_name may be an alias. * * @since New in 1.4. */ const svn_opt_subcommand_desc2_t * svn_opt_get_canonical_subcommand2(const svn_opt_subcommand_desc2_t *table, const char *cmd_name); /** * Return the entry in @a table whose name matches @a cmd_name, or @c NULL if * none. @a cmd_name may be an alias. * * Same as svn_opt_get_canonical_subcommand2(), but acts on * #svn_opt_subcommand_desc_t. * * @deprecated Provided for backward compatibility with the 1.3 API. */ SVN_DEPRECATED const svn_opt_subcommand_desc_t * svn_opt_get_canonical_subcommand(const svn_opt_subcommand_desc_t *table, const char *cmd_name); /** * Return pointer to an @c apr_getopt_option_t for the option whose * option code is @a code, or @c NULL if no match. @a option_table must end * with an element whose every field is zero. If @c command is non-NULL, * then return the subcommand-specific option description instead of the * generic one, if a specific description is defined. * * The returned value may be statically allocated, or allocated in @a pool. * * @since New in 1.4. */ const apr_getopt_option_t * svn_opt_get_option_from_code2(int code, const apr_getopt_option_t *option_table, const svn_opt_subcommand_desc2_t *command, apr_pool_t *pool); /** * Return the first entry from @a option_table whose option code is @a code, * or @c NULL if no match. @a option_table must end with an element whose * every field is zero. * * @deprecated Provided for backward compatibility with the 1.3 API. */ SVN_DEPRECATED const apr_getopt_option_t * svn_opt_get_option_from_code(int code, const apr_getopt_option_t *option_table); /** * Return @c TRUE iff subcommand @a command supports option @a * option_code, else return @c FALSE. If @a global_options is * non-NULL, it is a zero-terminated array, and all subcommands take * the options listed in it. * * @since New in 1.5. */ svn_boolean_t svn_opt_subcommand_takes_option3(const svn_opt_subcommand_desc2_t *command, int option_code, const int *global_options); /** * Same as svn_opt_subcommand_takes_option3(), but with @c NULL for @a * global_options. * * @deprecated Provided for backward compatibility with the 1.4 API. */ SVN_DEPRECATED svn_boolean_t svn_opt_subcommand_takes_option2(const svn_opt_subcommand_desc2_t *command, int option_code); /** * Return @c TRUE iff subcommand @a command supports option @a option_code, * else return @c FALSE. * * Same as svn_opt_subcommand_takes_option2(), but acts on * #svn_opt_subcommand_desc_t. * * @deprecated Provided for backward compatibility with the 1.3 API. */ SVN_DEPRECATED svn_boolean_t svn_opt_subcommand_takes_option(const svn_opt_subcommand_desc_t *command, int option_code); /** * Print a generic (not command-specific) usage message to @a stream. * * ### @todo Why is @a stream a stdio file instead of an svn stream? * * If @a header is non-NULL, print @a header followed by a newline. Then * loop over @a cmd_table printing the usage for each command (getting * option usages from @a opt_table). Then if @a footer is non-NULL, print * @a footer followed by a newline. * * Use @a pool for temporary allocation. * * @since New in 1.4. */ void svn_opt_print_generic_help2(const char *header, const svn_opt_subcommand_desc2_t *cmd_table, const apr_getopt_option_t *opt_table, const char *footer, apr_pool_t *pool, FILE *stream); /** * Same as svn_opt_print_generic_help2(), but acts on * #svn_opt_subcommand_desc_t. * * @deprecated Provided for backward compatibility with the 1.3 API. */ SVN_DEPRECATED void svn_opt_print_generic_help(const char *header, const svn_opt_subcommand_desc_t *cmd_table, const apr_getopt_option_t *opt_table, const char *footer, apr_pool_t *pool, FILE *stream); /** * Print an option @a opt nicely into a @a string allocated in @a pool. * If @a doc is set, include the generic documentation string of @a opt, * localized to the current locale if a translation is available. */ void svn_opt_format_option(const char **string, const apr_getopt_option_t *opt, svn_boolean_t doc, apr_pool_t *pool); /** * Get @a subcommand's usage from @a table, and print it to @c stdout. * Obtain option usage from @a options_table. If not @c NULL, @a * global_options is a zero-terminated list of global options. Use @a * pool for temporary allocation. @a subcommand may be a canonical * command name or an alias. ### @todo Why does this only print to * @c stdout, whereas svn_opt_print_generic_help() gives us a choice? * * @since New in 1.5. */ void svn_opt_subcommand_help3(const char *subcommand, const svn_opt_subcommand_desc2_t *table, const apr_getopt_option_t *options_table, const int *global_options, apr_pool_t *pool); /** * Same as svn_opt_subcommand_help3(), but with @a global_options * always NULL. * * @deprecated Provided for backward compatibility with the 1.4 API. */ SVN_DEPRECATED void svn_opt_subcommand_help2(const char *subcommand, const svn_opt_subcommand_desc2_t *table, const apr_getopt_option_t *options_table, apr_pool_t *pool); /** * Same as svn_opt_subcommand_help2(), but acts on * #svn_opt_subcommand_desc_t. * * @deprecated Provided for backward compatibility with the 1.3 API. */ SVN_DEPRECATED void svn_opt_subcommand_help(const char *subcommand, const svn_opt_subcommand_desc_t *table, const apr_getopt_option_t *options_table, apr_pool_t *pool); /* Parsing revision and date options. */ /** * Various ways of specifying revisions. * * @note * In contexts where local mods are relevant, the `working' kind * refers to the uncommitted "working" revision, which may be modified * with respect to its base revision. In other contexts, `working' * should behave the same as `committed' or `current'. */ enum svn_opt_revision_kind { /** No revision information given. */ svn_opt_revision_unspecified, /** revision given as number */ svn_opt_revision_number, /** revision given as date */ svn_opt_revision_date, /** rev of most recent change */ svn_opt_revision_committed, /** (rev of most recent change) - 1 */ svn_opt_revision_previous, /** .svn/entries current revision */ svn_opt_revision_base, /** current, plus local mods */ svn_opt_revision_working, /** repository youngest */ svn_opt_revision_head }; /** * A revision value, which can be specified as a number or a date. * * @note This union was formerly an anonymous inline type in * @c svn_opt_revision_t, and was converted to a named type just to * make things easier for SWIG. * * @since New in 1.3. */ typedef union svn_opt_revision_value_t { /** The revision number */ svn_revnum_t number; /** the date of the revision */ apr_time_t date; } svn_opt_revision_value_t; /** A revision, specified in one of @c svn_opt_revision_kind ways. */ typedef struct svn_opt_revision_t { enum svn_opt_revision_kind kind; /**< See svn_opt_revision_kind */ svn_opt_revision_value_t value; /**< Extra data qualifying the @c kind */ } svn_opt_revision_t; /** A revision range, specified in one of @c svn_opt_revision_kind ways. */ typedef struct svn_opt_revision_range_t { /** The first revision in the range */ svn_opt_revision_t start; /** The last revision in the range */ svn_opt_revision_t end; } svn_opt_revision_range_t; /** * Set @a *start_revision and/or @a *end_revision according to @a arg, * where @a arg is "N" or "N:M", like so: * * - If @a arg is "N", set @a *start_revision to represent N, and * leave @a *end_revision untouched. * * - If @a arg is "N:M", set @a *start_revision and @a *end_revision * to represent N and M respectively. * * N and/or M may be one of the special revision descriptors * recognized by revision_from_word(), or a date in curly braces. * * If @a arg is invalid, return -1; else return 0. * It is invalid to omit a revision (as in, ":", "N:" or ":M"). * * @note It is typical, though not required, for @a *start_revision and * @a *end_revision to be @c svn_opt_revision_unspecified kind on entry. * * Use @a pool for temporary allocations. */ int svn_opt_parse_revision(svn_opt_revision_t *start_revision, svn_opt_revision_t *end_revision, const char *arg, apr_pool_t *pool); /** * Parse @a arg, where @a arg is "N" or "N:M", into a * @c svn_opt_revision_range_t and push that onto @a opt_ranges. * * - If @a arg is "N", set the @c start field of the * @c svn_opt_revision_range_t to represent N and the @c end field * to @c svn_opt_revision_unspecified. * * - If @a arg is "N:M", set the @c start field of the * @c svn_opt_revision_range_t to represent N and the @c end field * to represent M. * * If @a arg is invalid, return -1; else return 0. It is invalid to omit * a revision (as in, ":", "N:" or ":M"). * * Use @a pool to allocate @c svn_opt_revision_range_t pushed to the array. * * @since New in 1.5. */ int svn_opt_parse_revision_to_range(apr_array_header_t *opt_ranges, const char *arg, apr_pool_t *pool); /** * Resolve peg revisions and operational revisions in the following way: * * - If @a is_url is set and @a peg_rev->kind is * @c svn_opt_revision_unspecified, @a peg_rev->kind defaults to * @c svn_opt_revision_head. * * - If @a is_url is not set, and @a peg_rev->kind is * @c svn_opt_revision_unspecified, @a peg_rev->kind defaults to * @c svn_opt_revision_base. * * - If @a op_rev->kind is @c svn_opt_revision_unspecified, @a op_rev * defaults to @a peg_rev. * * Both @a peg_rev and @a op_rev may be modified as a result of this * function. @a is_url should be set if the path the revisions refer to is * a url, and unset otherwise. * * If @a notice_local_mods is set, @c svn_opt_revision_working is used, * instead of @c svn_opt_revision_base. * * Use @a pool for allocations. * * @since New in 1.5. */ svn_error_t * svn_opt_resolve_revisions(svn_opt_revision_t *peg_rev, svn_opt_revision_t *op_rev, svn_boolean_t is_url, svn_boolean_t notice_local_mods, apr_pool_t *pool); /* Parsing arguments. */ /** * Pull remaining target arguments from @a os into @a *targets_p, * converting them to UTF-8, followed by targets from @a known_targets * (which might come from, for example, the "--targets" command line * option), which are already in UTF-8. * * On each URL target, do some IRI-to-URI encoding and some * auto-escaping. On each local path, canonicalize case and path * separators. * * Allocate @a *targets_p and its elements in @a pool. * * If a path has the same name as a Subversion working copy * administrative directory, return SVN_ERR_RESERVED_FILENAME_SPECIFIED; * if multiple reserved paths are encountered, return a chain of * errors, all of which are SVN_ERR_RESERVED_FILENAME_SPECIFIED. Do * not return this type of error in a chain with any other type of * error, and if this is the only type of error encountered, complete * the operation before returning the error(s). * * @deprecated Provided for backward compatibility with the 1.5 API. * @see svn_client_args_to_target_array() */ SVN_DEPRECATED svn_error_t * svn_opt_args_to_target_array3(apr_array_header_t **targets_p, apr_getopt_t *os, apr_array_header_t *known_targets, apr_pool_t *pool); /** * This is the same as svn_opt_args_to_target_array3() except that it * silently ignores paths that have the same name as a working copy * administrative directory. * * @since New in 1.2. * * @deprecated Provided for backward compatibility with the 1.4 API. */ SVN_DEPRECATED svn_error_t * svn_opt_args_to_target_array2(apr_array_header_t **targets_p, apr_getopt_t *os, apr_array_header_t *known_targets, apr_pool_t *pool); /** * The same as svn_opt_args_to_target_array2() except that, in * addition, if @a extract_revisions is set, then look for trailing * "@rev" syntax on the first two paths. If the first target in @a * *targets_p ends in "@rev", replace it with a canonicalized version of * the part before "@rev" and replace @a *start_revision with the value * of "rev". If the second target in @a *targets_p ends in "@rev", * replace it with a canonicalized version of the part before "@rev" * and replace @a *end_revision with the value of "rev". Ignore * revision specifiers on any further paths. "rev" can be any form of * single revision specifier, as accepted by svn_opt_parse_revision(). * * @deprecated Provided for backward compatibility with the 1.1 API. */ SVN_DEPRECATED svn_error_t * svn_opt_args_to_target_array(apr_array_header_t **targets_p, apr_getopt_t *os, apr_array_header_t *known_targets, svn_opt_revision_t *start_revision, svn_opt_revision_t *end_revision, svn_boolean_t extract_revisions, apr_pool_t *pool); /** * Parse revprop key/value pair from @a revprop_spec (name[=value]) into * @a revprops, making copies of both with @a pool. If @a revprops is * @c NULL, allocate a new apr_hash_t in it. @a revprops maps * const char * revprop names to svn_string_t * revprop values for use * with svn_repos_get_commit_editor5 and other get_commit_editor APIs. * * @since New in 1.6. */ svn_error_t * svn_opt_parse_revprop(apr_hash_t **revprops, const char *revprop_spec, apr_pool_t *pool); /** * If no targets exist in @a *targets, add `.' as the lone target. * * (Some commands take an implicit "." string argument when invoked * with no arguments. Those commands make use of this function to * add "." to the target array if the user passes no args.) */ void svn_opt_push_implicit_dot_target(apr_array_header_t *targets, apr_pool_t *pool); /** * Parse @a num_args non-target arguments from the list of arguments in * @a os->argv, return them as const char * in @a *args_p, without * doing any UTF-8 conversion. Allocate @a *args_p and its values in @a pool. */ svn_error_t * svn_opt_parse_num_args(apr_array_header_t **args_p, apr_getopt_t *os, int num_args, apr_pool_t *pool); /** * Parse all remaining arguments from @a os->argv, return them as * const char * in @a *args_p, without doing any UTF-8 conversion. * Allocate @a *args_p and its values in @a pool. */ svn_error_t * svn_opt_parse_all_args(apr_array_header_t **args_p, apr_getopt_t *os, apr_pool_t *pool); /** * Parse a working-copy or URL in @a path, extracting any trailing * revision specifier of the form "@rev" from the last component of * the path. * * Some examples would be: * * "foo/bar" -> "foo/bar", (unspecified) * "foo/bar@13" -> "foo/bar", (number, 13) * "foo/bar@HEAD" -> "foo/bar", (head) * "foo/bar@{1999-12-31}" -> "foo/bar", (date, 1999-12-31) * "http://a/b@27" -> "http://a/b", (number, 27) * "http://a/b@COMMITTED" -> "http://a/b", (committed) [*] * "http://a/b@{1999-12-31} -> "http://a/b", (date, 1999-12-31) * "http://a/b@%7B1999-12-31%7D -> "http://a/b", (date, 1999-12-31) * "foo/bar@1:2" -> error * "foo/bar@baz" -> error * "foo/bar@" -> "foo/bar", (base) * "foo/@bar@" -> "foo/@bar", (base) * "foo/bar/@13" -> "foo/bar/", (number, 13) * "foo/bar@@13" -> "foo/bar@", (number, 13) * "foo/@bar@HEAD" -> "foo/@bar", (head) * "foo@/bar" -> "foo@/bar", (unspecified) * "foo@HEAD/bar" -> "foo@HEAD/bar", (unspecified) * "@foo/bar" -> error * "@foo/bar@" -> "@foo/bar", (unspecified) * * [*] Syntactically valid but probably not semantically useful. * * If a trailing revision specifier is found, parse it into @a *rev and * put the rest of the path into @a *truepath, allocating from @a pool; * or return an @c SVN_ERR_CL_ARG_PARSING_ERROR (with the effect on * @a *truepath undefined) if the revision specifier is invalid. * If no trailing revision specifier is found, set @a *truepath to * @a path and @a rev->kind to @c svn_opt_revision_unspecified. * * This function does not require that @a path be in canonical form. * No canonicalization is done and @a *truepath will only be in * canonical form if @a path is in canonical form. * * @since New in 1.1. */ svn_error_t * svn_opt_parse_path(svn_opt_revision_t *rev, const char **truepath, const char *path, apr_pool_t *pool); /** * Central dispatcher function for various kinds of help message. * Prints one of: * * subcommand-specific help (svn_opt_subcommand_help) * * generic help (svn_opt_print_generic_help) * * version info * * simple usage complaint: "Type '@a pgm_name help' for usage." * * If @a os is not @c NULL and it contains arguments, then try * printing help for them as though they are subcommands, using @a * cmd_table and @a option_table for option information. If not @c * NULL, @a global_options is a zero-terminated array of options taken * by all subcommands. * * Else, if @a print_version is TRUE, then print version info, in * brief form if @a quiet is also TRUE; if @a quiet is FALSE, then if * @a version_footer is non-NULL, print it following the version * information. * * Else, if @a os is not @c NULL and does not contain arguments, print * generic help, via svn_opt_print_generic_help2() with the @a header, * @a cmd_table, @a option_table, and @a footer arguments. * * Else, when @a os is @c NULL, print the simple usage complaint. * * Use @a pool for temporary allocations. * * Notes: The reason this function handles both version printing and * general usage help is that a confused user might put both the * --version flag *and* subcommand arguments on a help command line. * The logic for handling such a situation should be in one place. * * @since New in 1.5. */ svn_error_t * svn_opt_print_help3(apr_getopt_t *os, const char *pgm_name, svn_boolean_t print_version, svn_boolean_t quiet, const char *version_footer, const char *header, const svn_opt_subcommand_desc2_t *cmd_table, const apr_getopt_option_t *option_table, const int *global_options, const char *footer, apr_pool_t *pool); /** * Same as svn_opt_print_help3(), but with @a global_options always @c * NULL. * * @deprecated Provided for backward compatibility with the 1.4 API. */ SVN_DEPRECATED svn_error_t * svn_opt_print_help2(apr_getopt_t *os, const char *pgm_name, svn_boolean_t print_version, svn_boolean_t quiet, const char *version_footer, const char *header, const svn_opt_subcommand_desc2_t *cmd_table, const apr_getopt_option_t *option_table, const char *footer, apr_pool_t *pool); /** * Same as svn_opt_print_help2(), but acts on #svn_opt_subcommand_desc_t. * * @deprecated Provided for backward compatibility with the 1.3 API. */ SVN_DEPRECATED svn_error_t * svn_opt_print_help(apr_getopt_t *os, const char *pgm_name, svn_boolean_t print_version, svn_boolean_t quiet, const char *version_footer, const char *header, const svn_opt_subcommand_desc_t *cmd_table, const apr_getopt_option_t *option_table, const char *footer, apr_pool_t *pool); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* SVN_OPTS_H */ 0707010002c647000081a40000000000000000000000014cb50d8e000058f70000010000010036ffffffffffffffff0000003100000000root/usr/local/include/subversion-1/svn_config.h/** * @copyright * ==================================================================== * Copyright (c) 2000-2008 CollabNet. All rights reserved. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://subversion.tigris.org/license-1.html. * If newer versions of this license are posted there, you may use a * newer version instead, at your option. * * This software consists of voluntary contributions made by many * individuals. For exact contribution history, see the revision * history and logs, available at http://subversion.tigris.org/. * ==================================================================== * @endcopyright * * @file svn_config.h * @brief Accessing SVN configuration files. */ #ifndef SVN_CONFIG_H #define SVN_CONFIG_H #include /* for apr_int64_t */ #include /* for apr_pool_t */ #include /* for apr_hash_t */ #include "svn_types.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /************************************************************************** *** *** *** For a description of the SVN configuration file syntax, see *** *** your ~/.subversion/README, which is written out automatically by *** *** svn_config_ensure(). *** *** *** **************************************************************************/ /** Opaque structure describing a set of configuration options. */ typedef struct svn_config_t svn_config_t; /*** Configuration Defines ***/ /** * @name Client configuration files strings * Strings for the names of files, sections, and options in the * client configuration files. * @{ */ #define SVN_CONFIG_CATEGORY_SERVERS "servers" #define SVN_CONFIG_SECTION_GROUPS "groups" #define SVN_CONFIG_SECTION_GLOBAL "global" #define SVN_CONFIG_OPTION_HTTP_PROXY_HOST "http-proxy-host" #define SVN_CONFIG_OPTION_HTTP_PROXY_PORT "http-proxy-port" #define SVN_CONFIG_OPTION_HTTP_PROXY_USERNAME "http-proxy-username" #define SVN_CONFIG_OPTION_HTTP_PROXY_PASSWORD "http-proxy-password" #define SVN_CONFIG_OPTION_HTTP_PROXY_EXCEPTIONS "http-proxy-exceptions" #define SVN_CONFIG_OPTION_HTTP_TIMEOUT "http-timeout" #define SVN_CONFIG_OPTION_HTTP_COMPRESSION "http-compression" #define SVN_CONFIG_OPTION_NEON_DEBUG_MASK "neon-debug-mask" #define SVN_CONFIG_OPTION_HTTP_AUTH_TYPES "http-auth-types" #define SVN_CONFIG_OPTION_SSL_AUTHORITY_FILES "ssl-authority-files" #define SVN_CONFIG_OPTION_SSL_TRUST_DEFAULT_CA "ssl-trust-default-ca" #define SVN_CONFIG_OPTION_SSL_CLIENT_CERT_FILE "ssl-client-cert-file" #define SVN_CONFIG_OPTION_SSL_CLIENT_CERT_PASSWORD "ssl-client-cert-password" #define SVN_CONFIG_OPTION_SSL_PKCS11_PROVIDER "ssl-pkcs11-provider" #define SVN_CONFIG_OPTION_HTTP_LIBRARY "http-library" #define SVN_CONFIG_OPTION_STORE_PASSWORDS "store-passwords" #define SVN_CONFIG_OPTION_STORE_PLAINTEXT_PASSWORDS "store-plaintext-passwords" #define SVN_CONFIG_OPTION_STORE_AUTH_CREDS "store-auth-creds" #define SVN_CONFIG_OPTION_STORE_SSL_CLIENT_CERT_PP "store-ssl-client-cert-pp" #define SVN_CONFIG_OPTION_STORE_SSL_CLIENT_CERT_PP_PLAINTEXT \ "store-ssl-client-cert-pp-plaintext" #define SVN_CONFIG_OPTION_USERNAME "username" #define SVN_CONFIG_CATEGORY_CONFIG "config" #define SVN_CONFIG_SECTION_AUTH "auth" #define SVN_CONFIG_OPTION_PASSWORD_STORES "password-stores" #define SVN_CONFIG_OPTION_KWALLET_WALLET "kwallet-wallet" #define SVN_CONFIG_OPTION_KWALLET_SVN_APPLICATION_NAME_WITH_PID "kwallet-svn-application-name-with-pid" /* The majority of options of the "auth" section * has been moved to SVN_CONFIG_CATEGORY_SERVERS. */ #define SVN_CONFIG_SECTION_HELPERS "helpers" #define SVN_CONFIG_OPTION_EDITOR_CMD "editor-cmd" #define SVN_CONFIG_OPTION_DIFF_CMD "diff-cmd" #define SVN_CONFIG_OPTION_DIFF3_CMD "diff3-cmd" #define SVN_CONFIG_OPTION_DIFF3_HAS_PROGRAM_ARG "diff3-has-program-arg" #define SVN_CONFIG_OPTION_MERGE_TOOL_CMD "merge-tool-cmd" #define SVN_CONFIG_SECTION_MISCELLANY "miscellany" #define SVN_CONFIG_OPTION_GLOBAL_IGNORES "global-ignores" #define SVN_CONFIG_OPTION_LOG_ENCODING "log-encoding" #define SVN_CONFIG_OPTION_USE_COMMIT_TIMES "use-commit-times" #define SVN_CONFIG_OPTION_TEMPLATE_ROOT "template-root" #define SVN_CONFIG_OPTION_ENABLE_AUTO_PROPS "enable-auto-props" #define SVN_CONFIG_OPTION_NO_UNLOCK "no-unlock" #define SVN_CONFIG_OPTION_MIMETYPES_FILE "mime-types-file" #define SVN_CONFIG_OPTION_PRESERVED_CF_EXTS "preserved-conflict-file-exts" #define SVN_CONFIG_OPTION_INTERACTIVE_CONFLICTS "interactive-conflicts" #define SVN_CONFIG_SECTION_TUNNELS "tunnels" #define SVN_CONFIG_SECTION_AUTO_PROPS "auto-props" /** @} */ /** @name Repository conf directory configuration files strings * Strings for the names of sections and options in the * repository conf directory configuration files. * @{ */ /* For repository svnserve.conf files */ #define SVN_CONFIG_SECTION_GENERAL "general" #define SVN_CONFIG_OPTION_ANON_ACCESS "anon-access" #define SVN_CONFIG_OPTION_AUTH_ACCESS "auth-access" #define SVN_CONFIG_OPTION_PASSWORD_DB "password-db" #define SVN_CONFIG_OPTION_REALM "realm" #define SVN_CONFIG_OPTION_AUTHZ_DB "authz-db" #define SVN_CONFIG_SECTION_SASL "sasl" #define SVN_CONFIG_OPTION_USE_SASL "use-sasl" #define SVN_CONFIG_OPTION_MIN_SSF "min-encryption" #define SVN_CONFIG_OPTION_MAX_SSF "max-encryption" /* For repository password database */ #define SVN_CONFIG_SECTION_USERS "users" /** @} */ /*** Configuration Default Values ***/ /* '*' matches leading dots, e.g. '*.rej' matches '.foo.rej'. */ /* We want this to be printed on two lines in the generated config file, * but we don't want the # character to end up in the variable. */ #define SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_1 \ "*.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo" #define SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_2 \ "*.rej *~ #*# .#* .*.swp .DS_Store" #define SVN_CONFIG_DEFAULT_GLOBAL_IGNORES \ SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_1 " " \ SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_2 #define SVN_CONFIG_TRUE "TRUE" #define SVN_CONFIG_FALSE "FALSE" #define SVN_CONFIG_ASK "ASK" /* Default values for some options. Should be passed as default values * to svn_config_get and friends, instead of hard-coding the defaults in * multiple places. */ #define SVN_CONFIG_DEFAULT_OPTION_STORE_PASSWORDS TRUE #define SVN_CONFIG_DEFAULT_OPTION_STORE_PLAINTEXT_PASSWORDS SVN_CONFIG_ASK #define SVN_CONFIG_DEFAULT_OPTION_STORE_AUTH_CREDS TRUE #define SVN_CONFIG_DEFAULT_OPTION_STORE_SSL_CLIENT_CERT_PP TRUE #define SVN_CONFIG_DEFAULT_OPTION_STORE_SSL_CLIENT_CERT_PP_PLAINTEXT \ SVN_CONFIG_ASK /** Read configuration information from the standard sources and merge it * into the hash @a *cfg_hash. If @a config_dir is not NULL it specifies a * directory from which to read the configuration files, overriding all * other sources. Otherwise, first read any system-wide configurations * (from a file or from the registry), then merge in personal * configurations (again from file or registry). The hash and all its data * are allocated in @a pool. * * @a *cfg_hash is a hash whose keys are @c const char * configuration * categories (@c SVN_CONFIG_CATEGORY_SERVERS, * @c SVN_CONFIG_CATEGORY_CONFIG, etc.) and whose values are the @c * svn_config_t * items representing the configuration values for that * category. */ svn_error_t * svn_config_get_config(apr_hash_t **cfg_hash, const char *config_dir, apr_pool_t *pool); /** Read configuration data from @a file (a file or registry path) into * @a *cfgp, allocated in @a pool. * * If @a file does not exist, then if @a must_exist, return an error, * otherwise return an empty @c svn_config_t. */ svn_error_t * svn_config_read(svn_config_t **cfgp, const char *file, svn_boolean_t must_exist, apr_pool_t *pool); /** Like svn_config_read(), but merges the configuration data from @a file * (a file or registry path) into @a *cfg, which was previously returned * from svn_config_read(). This function invalidates all value * expansions in @a cfg, so that the next svn_config_get() takes the * modifications into account. */ svn_error_t * svn_config_merge(svn_config_t *cfg, const char *file, svn_boolean_t must_exist); /** Find the value of a (@a section, @a option) pair in @a cfg, set @a * *valuep to the value. * * If @a cfg is @c NULL, just sets @a *valuep to @a default_value. If * the value does not exist, expand and return @a default_value. @a * default_value can be NULL. * * The returned value will be valid at least until the next call to * svn_config_get(), or for the lifetime of @a default_value. It is * safest to consume the returned value immediately. * * This function may change @a cfg by expanding option values. */ void svn_config_get(svn_config_t *cfg, const char **valuep, const char *section, const char *option, const char *default_value); /** Add or replace the value of a (@a section, @a option) pair in @a cfg with * @a value. * * This function invalidates all value expansions in @a cfg. * * To remove an option, pass NULL for the @c value. */ void svn_config_set(svn_config_t *cfg, const char *section, const char *option, const char *value); /** Like svn_config_get(), but for boolean values. * * Parses the option as a boolean value. The recognized representations * are 'TRUE'/'FALSE', 'yes'/'no', 'on'/'off', '1'/'0'; case does not * matter. Returns an error if the option doesn't contain a known string. */ svn_error_t * svn_config_get_bool(svn_config_t *cfg, svn_boolean_t *valuep, const char *section, const char *option, svn_boolean_t default_value); /** Like svn_config_set(), but for boolean values. * * Sets the option to 'TRUE'/'FALSE', depending on @a value. */ void svn_config_set_bool(svn_config_t *cfg, const char *section, const char *option, svn_boolean_t value); /** Like svn_config_get(), but only for yes/no/ask values. * * Parse @a option in @a section and set @a *valuep to one of * SVN_CONFIG_TRUE, SVN_CONFIG_FALSE, or SVN_CONFIG_ASK. If there is * no setting for @a option, then parse @a default_value and set * @a *valuep accordingly. If @a default_value is NULL, the result is * undefined, and may be an error; we recommend that you pass one of * SVN_CONFIG_TRUE, SVN_CONFIG_FALSE, or SVN_CONFIG_ASK for @a default value. * * Valid representations are (at least) "true"/"false", "yes"/"no", * "on"/"off", "1"/"0", and "ask"; they are case-insensitive. Return * an SVN_ERR_BAD_CONFIG_VALUE error if either @a default_value or * @a option's value is not a valid representation. * * @since New in 1.6. */ svn_error_t * svn_config_get_yes_no_ask(svn_config_t *cfg, const char **valuep, const char *section, const char *option, const char* default_value); /** Similar to @c svn_config_section_enumerator2_t, but is not * provided with a memory pool argument. * * See svn_config_enumerate_sections() for the details of this type. * * @deprecated Provided for backwards compatibility with the 1.2 API. */ typedef svn_boolean_t (*svn_config_section_enumerator_t)(const char *name, void *baton); /** Similar to svn_config_enumerate_sections2(), but uses a memory pool of * @a cfg instead of one that is explicitely provided. * * @deprecated Provided for backwards compatibility with the 1.2 API. */ SVN_DEPRECATED int svn_config_enumerate_sections(svn_config_t *cfg, svn_config_section_enumerator_t callback, void *baton); /** A callback function used in enumerating config sections. * * See svn_config_enumerate_sections2() for the details of this type. * * @since New in 1.3. */ typedef svn_boolean_t (*svn_config_section_enumerator2_t)(const char *name, void *baton, apr_pool_t *pool); /** Enumerate the sections, passing @a baton and the current section's name * to @a callback. Continue the enumeration if @a callback returns @c TRUE. * Return the number of times @a callback was called. * * ### See kff's comment to svn_config_enumerate2(). It applies to this * function, too. ### * * @a callback's @a name parameter is only valid for the duration of the call. * * @since New in 1.3. */ int svn_config_enumerate_sections2(svn_config_t *cfg, svn_config_section_enumerator2_t callback, void *baton, apr_pool_t *pool); /** Similar to @c svn_config_enumerator2_t, but is not * provided with a memory pool argument. * See svn_config_enumerate() for the details of this type. * * @deprecated Provided for backwards compatibility with the 1.2 API. */ typedef svn_boolean_t (*svn_config_enumerator_t)(const char *name, const char *value, void *baton); /** Similar to svn_config_enumerate2(), but uses a memory pool of * @a cfg instead of one that is explicitely provided. * * @deprecated Provided for backwards compatibility with the 1.2 API. */ SVN_DEPRECATED int svn_config_enumerate(svn_config_t *cfg, const char *section, svn_config_enumerator_t callback, void *baton); /** A callback function used in enumerating config options. * * See svn_config_enumerate2() for the details of this type. * * @since New in 1.3. */ typedef svn_boolean_t (*svn_config_enumerator2_t)(const char *name, const char *value, void *baton, apr_pool_t *pool); /** Enumerate the options in @a section, passing @a baton and the current * option's name and value to @a callback. Continue the enumeration if * @a callback returns @c TRUE. Return the number of times @a callback * was called. * * ### kff asks: A more usual interface is to continue enumerating * while @a callback does not return error, and if @a callback does * return error, to return the same error (or a wrapping of it) * from svn_config_enumerate(). What's the use case for * svn_config_enumerate()? Is it more likely to need to break out * of an enumeration early, with no error, than an invocation of * @a callback is likely to need to return an error? ### * * @a callback's @a name and @a value parameters are only valid for the * duration of the call. * * @since New in 1.3. */ int svn_config_enumerate2(svn_config_t *cfg, const char *section, svn_config_enumerator2_t callback, void *baton, apr_pool_t *pool); /** * Return @c TRUE if @a section exists in @a cfg, @c FALSE otherwise. * * @since New in 1.4. */ svn_boolean_t svn_config_has_section(svn_config_t *cfg, const char *section); /** Enumerate the group @a master_section in @a cfg. Each variable * value is interpreted as a list of glob patterns (separated by comma * and optional whitespace). Return the name of the first variable * whose value matches @a key, or @c NULL if no variable matches. */ const char * svn_config_find_group(svn_config_t *cfg, const char *key, const char *master_section, apr_pool_t *pool); /** Retrieve value corresponding to @a option_name in @a cfg, or * return @a default_value if none is found. * * The config will first be checked for a default. * If @a server_group is not @c NULL, the config will also be checked * for an override in a server group, * */ const char * svn_config_get_server_setting(svn_config_t *cfg, const char* server_group, const char* option_name, const char* default_value); /** Retrieve value into @a result_value corresponding to @a option_name for a * given @a server_group in @a cfg, or return @a default_value if none is * found. * * The config will first be checked for a default, then will be checked for * an override in a server group. If the value found is not a valid integer, * a @c svn_error_t* will be returned. */ svn_error_t * svn_config_get_server_setting_int(svn_config_t *cfg, const char *server_group, const char *option_name, apr_int64_t default_value, apr_int64_t *result_value, apr_pool_t *pool); /** Set @a *valuep according to @a option_name for a given * @a server_group in @a cfg, or set to @a default_value if no value is * specified. * * Check first a default, then for an override in a server group. If * a value is found but is not a valid boolean, return an * SVN_ERR_BAD_CONFIG_VALUE error. * * @since New in 1.6. */ svn_error_t * svn_config_get_server_setting_bool(svn_config_t *cfg, svn_boolean_t *valuep, const char *server_group, const char *option_name, svn_boolean_t default_value); /** Try to ensure that the user's ~/.subversion/ area exists, and create * no-op template files for any absent config files. Use @a pool for any * temporary allocation. If @a config_dir is not @c NULL it specifies a * directory from which to read the config overriding all other sources. * * Don't error if something exists but is the wrong kind (for example, * ~/.subversion exists but is a file, or ~/.subversion/servers exists * but is a directory). * * Also don't error if trying to create something and failing -- it's * okay for the config area or its contents not to be created. * However, if creating a config template file succeeds, return an * error if unable to initialize its contents. */ svn_error_t * svn_config_ensure(const char *config_dir, apr_pool_t *pool); /** Accessing cached authentication data in the user config area. * * @defgroup cached_authentication_data Cached authentication data * @{ */ /** A hash-key pointing to a realmstring. Every file containing * authentication data should have this key. */ #define SVN_CONFIG_REALMSTRING_KEY "svn:realmstring" /** Use @a cred_kind and @a realmstring to locate a file within the * ~/.subversion/auth/ area. If the file exists, initialize @a *hash * and load the file contents into the hash, using @a pool. If the * file doesn't exist, set @a *hash to NULL. * * If @a config_dir is not NULL it specifies a directory from which to * read the config overriding all other sources. * * Besides containing the original credential fields, the hash will * also contain @c SVN_CONFIG_REALMSTRING_KEY. The caller can examine * this value as a sanity-check that the correct file was loaded. * * The hashtable will contain const char * keys and * svn_string_t * values. */ svn_error_t * svn_config_read_auth_data(apr_hash_t **hash, const char *cred_kind, const char *realmstring, const char *config_dir, apr_pool_t *pool); /** Use @a cred_kind and @a realmstring to create or overwrite a file * within the ~/.subversion/auth/ area. Write the contents of @a hash into * the file. If @a config_dir is not NULL it specifies a directory to read * the config overriding all other sources. * * Also, add @a realmstring to the file, with key @c * SVN_CONFIG_REALMSTRING_KEY. This allows programs (or users) to * verify exactly which set credentials live within the file. * * The hashtable must contain const char * keys and * svn_string_t * values. */ svn_error_t * svn_config_write_auth_data(apr_hash_t *hash, const char *cred_kind, const char *realmstring, const char *config_dir, apr_pool_t *pool); /** Put the absolute path to the user's configuration directory, * or to a file within that directory, into @a *path. * * If @a config_dir is not NULL, it must point to an alternative * config directory location. If it is NULL, the default location * is used. If @a fname is not NULL, it must specify the last * component of the path to be returned. This can be used to create * a path to any file in the configuration directory. * * Do all allocations in @a pool. * * Hint: * To get the user configuration file, pass @c SVN_CONFIG_CATEGORY_CONFIG * for @a fname. To get the servers configuration file, pass * @c SVN_CONFIG_CATEGORY_SERVERS for @a fname. * * @since New in 1.6. */ svn_error_t * svn_config_get_user_config_path(const char **path, const char *config_dir, const char *fname, apr_pool_t *pool); /** @} */ #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* SVN_CONFIG_H */ 0707010002c65d000081a40000000000000000000000014cb50d8e000045300000010000010036ffffffffffffffff0000003100000000root/usr/local/include/subversion-1/svn_ra_svn.h/** * @copyright * ==================================================================== * Copyright (c) 2000-2006, 2008 CollabNet. All rights reserved. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://subversion.tigris.org/license-1.html. * If newer versions of this license are posted there, you may use a * newer version instead, at your option. * * This software consists of voluntary contributions made by many * individuals. For exact contribution history, see the revision * history and logs, available at http://subversion.tigris.org/. * ==================================================================== * @endcopyright * * @file svn_ra_svn.h * @brief libsvn_ra_svn functions used by the server */ #ifndef SVN_RA_SVN_H #define SVN_RA_SVN_H #include #include #include #include #include /* for apr_file_t */ #include /* for apr_socket_t */ #include "svn_types.h" #include "svn_string.h" #include "svn_config.h" #include "svn_delta.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** The well-known svn port number. */ #define SVN_RA_SVN_PORT 3690 /** Currently-defined capabilities. */ #define SVN_RA_SVN_CAP_EDIT_PIPELINE "edit-pipeline" #define SVN_RA_SVN_CAP_SVNDIFF1 "svndiff1" #define SVN_RA_SVN_CAP_ABSENT_ENTRIES "absent-entries" /* maps to SVN_RA_CAPABILITY_COMMIT_REVPROPS: */ #define SVN_RA_SVN_CAP_COMMIT_REVPROPS "commit-revprops" /* maps to SVN_RA_CAPABILITY_MERGEINFO: */ #define SVN_RA_SVN_CAP_MERGEINFO "mergeinfo" /* maps to SVN_RA_CAPABILITY_DEPTH: */ #define SVN_RA_SVN_CAP_DEPTH "depth" /* maps to SVN_RA_CAPABILITY_LOG_REVPROPS */ #define SVN_RA_SVN_CAP_LOG_REVPROPS "log-revprops" /* maps to SVN_RA_CAPABILITY_PARTIAL_REPLAY */ #define SVN_RA_SVN_CAP_PARTIAL_REPLAY "partial-replay" /** ra_svn passes @c svn_dirent_t fields over the wire as a list of * words, these are the values used to represent each field. * * @defgroup ra_svn_dirent_fields Definitions of ra_svn dirent fields * @{ */ /** The ra_svn way of saying @c SVN_DIRENT_KIND. */ #define SVN_RA_SVN_DIRENT_KIND "kind" /** The ra_svn way of saying @c SVN_DIRENT_SIZE. */ #define SVN_RA_SVN_DIRENT_SIZE "size" /** The ra_svn way of saying @c SVN_DIRENT_HAS_PROPS. */ #define SVN_RA_SVN_DIRENT_HAS_PROPS "has-props" /** The ra_svn way of saying @c SVN_DIRENT_CREATED_REV. */ #define SVN_RA_SVN_DIRENT_CREATED_REV "created-rev" /** The ra_svn way of saying @c SVN_DIRENT_TIME. */ #define SVN_RA_SVN_DIRENT_TIME "time" /** The ra_svn way of saying @c SVN_DIRENT_LAST_AUTHOR. */ #define SVN_RA_SVN_DIRENT_LAST_AUTHOR "last-author" /** @} */ /** A value used to indicate an optional number element in a tuple that was * not received. */ #define SVN_RA_SVN_UNSPECIFIED_NUMBER ~((apr_uint64_t) 0) /** A specialized form of @c SVN_ERR to deal with errors which occur in an * svn_ra_svn_command_handler(). * * An error returned with this macro will be passed back to the other side * of the connection. Use this macro when performing the requested operation; * use the regular @c SVN_ERR when performing I/O with the client. */ #define SVN_CMD_ERR(expr) \ do { \ svn_error_t *svn_err__temp = (expr); \ if (svn_err__temp) \ return svn_error_create(SVN_ERR_RA_SVN_CMD_ERR, \ svn_err__temp, NULL); \ } while (0) /** an ra_svn connection. */ typedef struct svn_ra_svn_conn_st svn_ra_svn_conn_t; /** Command handler, used by svn_ra_svn_handle_commands(). */ typedef svn_error_t *(*svn_ra_svn_command_handler)(svn_ra_svn_conn_t *conn, apr_pool_t *pool, apr_array_header_t *params, void *baton); /** Command table, used by svn_ra_svn_handle_commands(). */ typedef struct svn_ra_svn_cmd_entry_t { /** Name of the command */ const char *cmdname; /** Handler for the command */ svn_ra_svn_command_handler handler; /** Termination flag. If set, command-handling will cease after * command is processed. */ svn_boolean_t terminate; } svn_ra_svn_cmd_entry_t; /** Memory representation of an on-the-wire data item. */ typedef struct svn_ra_svn_item_t { /** Variant indicator. */ enum { SVN_RA_SVN_NUMBER, SVN_RA_SVN_STRING, SVN_RA_SVN_WORD, SVN_RA_SVN_LIST } kind; /** Variant data. */ union { apr_uint64_t number; svn_string_t *string; const char *word; /** Contains @c svn_ra_svn_item_t's. */ apr_array_header_t *list; } u; } svn_ra_svn_item_t; typedef svn_error_t *(*svn_ra_svn_edit_callback)(void *baton); /** Initialize a connection structure for the given socket or * input/output files. * * Either @a sock or @a in_file/@a out_file must be set, not both. */ svn_ra_svn_conn_t * svn_ra_svn_create_conn(apr_socket_t *sock, apr_file_t *in_file, apr_file_t *out_file, apr_pool_t *pool); /** Add the capabilities in @a list to @a conn's capabilities. * @a list contains svn_ra_svn_item_t entries (which should be of type * SVN_RA_SVN_WORD; a malformed data error will result if any are not). * * This is idempotent: if a given capability was already set for * @a conn, it remains set. */ svn_error_t * svn_ra_svn_set_capabilities(svn_ra_svn_conn_t *conn, apr_array_header_t *list); /** Return @c TRUE if @a conn has the capability @a capability, or * @c FALSE if it does not. */ svn_boolean_t svn_ra_svn_has_capability(svn_ra_svn_conn_t *conn, const char *capability); /** Returns the remote address of the connection as a string, if known, * or NULL if inapplicable. */ const char * svn_ra_svn_conn_remote_host(svn_ra_svn_conn_t *conn); /** Write a number over the net. * * Writes will be buffered until the next read or flush. */ svn_error_t * svn_ra_svn_write_number(svn_ra_svn_conn_t *conn, apr_pool_t *pool, apr_uint64_t number); /** Write a string over the net. * * Writes will be buffered until the next read or flush. */ svn_error_t * svn_ra_svn_write_string(svn_ra_svn_conn_t *conn, apr_pool_t *pool, const svn_string_t *str); /** Write a cstring over the net. * * Writes will be buffered until the next read or flush. */ svn_error_t * svn_ra_svn_write_cstring(svn_ra_svn_conn_t *conn, apr_pool_t *pool, const char *s); /** Write a word over the net. * * Writes will be buffered until the next read or flush. */ svn_error_t * svn_ra_svn_write_word(svn_ra_svn_conn_t *conn, apr_pool_t *pool, const char *word); /** Write a list of properties over the net. @a props is allowed to be NULL, * in which case an empty list will be written out. * * @since New in 1.5. */ svn_error_t * svn_ra_svn_write_proplist(svn_ra_svn_conn_t *conn, apr_pool_t *pool, apr_hash_t *props); /** Begin a list. Writes will be buffered until the next read or flush. */ svn_error_t * svn_ra_svn_start_list(svn_ra_svn_conn_t *conn, apr_pool_t *pool); /** End a list. Writes will be buffered until the next read or flush. */ svn_error_t * svn_ra_svn_end_list(svn_ra_svn_conn_t *conn, apr_pool_t *pool); /** Flush the write buffer. * * Normally this shouldn't be necessary, since the write buffer is flushed * when a read is attempted. */ svn_error_t * svn_ra_svn_flush(svn_ra_svn_conn_t *conn, apr_pool_t *pool); /** Write a tuple, using a printf-like interface. * * The format string @a fmt may contain: * *@verbatim Spec Argument type Item type ---- -------------------- --------- n apr_uint64_t Number r svn_revnum_t Number s const svn_string_t * String c const char * String w const char * Word b svn_boolean_t Word ("true" or "false") ( Begin tuple ) End tuple ? Remaining elements optional ! (at beginning or end) Suppress opening or closing of tuple @endverbatim * * Inside the optional part of a tuple, 'r' values may be @c * SVN_INVALID_REVNUM, 'n' values may be * SVN_RA_SVN_UNSPECIFIED_NUMBER, and 's', 'c', and 'w' values may be * @c NULL; in these cases no data will be written. 'b' and '(' may * not appear in the optional part of a tuple. Either all or none of * the optional values should be valid. * * (If we ever have a need for an optional boolean value, we should * invent a 'B' specifier which stores a boolean into an int, using -1 * for unspecified. Right now there is no need for such a thing.) * * Use the '!' format specifier to write partial tuples when you have * to transmit an array or other unusual data. For example, to write * a tuple containing a revision, an array of words, and a boolean: * @verbatim SVN_ERR(svn_ra_svn_write_tuple(conn, pool, "r(!", rev)); for (i = 0; i < n; i++) SVN_ERR(svn_ra_svn_write_word(conn, pool, words[i])); SVN_ERR(svn_ra_svn_write_tuple(conn, pool, "!)b", flag)); @endverbatim */ svn_error_t * svn_ra_svn_write_tuple(svn_ra_svn_conn_t *conn, apr_pool_t *pool, const char *fmt, ...); /** Read an item from the network into @a *item. */ svn_error_t * svn_ra_svn_read_item(svn_ra_svn_conn_t *conn, apr_pool_t *pool, svn_ra_svn_item_t **item); /** Scan data on @a conn until we find something which looks like the * beginning of an svn server greeting (an open paren followed by a * whitespace character). This function is appropriate for beginning * a client connection opened in tunnel mode, since people's dotfiles * sometimes write output to stdout. It may only be called at the * beginning of a client connection. */ svn_error_t * svn_ra_svn_skip_leading_garbage(svn_ra_svn_conn_t *conn, apr_pool_t *pool); /** Parse an array of @c svn_sort__item_t structures as a tuple, using a * printf-like interface. The format string @a fmt may contain: * *@verbatim Spec Argument type Item type ---- -------------------- --------- n apr_uint64_t * Number r svn_revnum_t * Number s svn_string_t ** String c const char ** String w const char ** Word b svn_boolean_t * Word ("true" or "false") B apr_uint64_t * Word ("true" or "false") l apr_array_header_t ** List ( Begin tuple ) End tuple ? Tuple is allowed to end here @endverbatim * * Note that a tuple is only allowed to end precisely at a '?', or at * the end of the specification. So if @a fmt is "c?cc" and @a list * contains two elements, an error will result. * * 'B' is similar to 'b', but may be used in the optional tuple specification. * It returns TRUE, FALSE, or SVN_RA_SVN_UNSPECIFIED_NUMBER. * * If an optional part of a tuple contains no data, 'r' values will be * set to @c SVN_INVALID_REVNUM, 'n' and 'B' values will be set to * SVN_RA_SVN_UNSPECIFIED_NUMBER, and 's', 'c', 'w', and 'l' values * will be set to @c NULL. 'b' may not appear inside an optional * tuple specification; use 'B' instead. */ svn_error_t * svn_ra_svn_parse_tuple(apr_array_header_t *list, apr_pool_t *pool, const char *fmt, ...); /** Read a tuple from the network and parse it as a tuple, using the * format string notation from svn_ra_svn_parse_tuple(). */ svn_error_t * svn_ra_svn_read_tuple(svn_ra_svn_conn_t *conn, apr_pool_t *pool, const char *fmt, ...); /** Parse an array of @c svn_ra_svn_item_t structures as a list of * properties, storing the properties in a hash table. * * @since New in 1.5. */ svn_error_t * svn_ra_svn_parse_proplist(apr_array_header_t *list, apr_pool_t *pool, apr_hash_t **props); /** Read a command response from the network and parse it as a tuple, using * the format string notation from svn_ra_svn_parse_tuple(). */ svn_error_t * svn_ra_svn_read_cmd_response(svn_ra_svn_conn_t *conn, apr_pool_t *pool, const char *fmt, ...); /** Accept commands over the network and handle them according to @a * commands. Command handlers will be passed @a conn, a subpool of @a * pool (cleared after each command is handled), the parameters of the * command, and @a baton. Commands will be accepted until a * terminating command is received (a command with "terminate" set in * the command table). If a command handler returns an error wrapped * in SVN_RA_SVN_CMD_ERR (see the @c SVN_CMD_ERR macro), the error * will be reported to the other side of the connection and the * command loop will continue; any other kind of error (typically a * network or protocol error) is passed through to the caller. * * @since New in 1.6. * */ svn_error_t * svn_ra_svn_handle_commands2(svn_ra_svn_conn_t *conn, apr_pool_t *pool, const svn_ra_svn_cmd_entry_t *commands, void *baton, svn_boolean_t error_on_disconnect); /** Similar to svn_ra_svn_handle_commands2 but @a error_on_disconnect * is always @c FALSE. * * @deprecated Provided for backward compatibility with the 1.5 API. */ SVN_DEPRECATED svn_error_t * svn_ra_svn_handle_commands(svn_ra_svn_conn_t *conn, apr_pool_t *pool, const svn_ra_svn_cmd_entry_t *commands, void *baton); /** Write a command over the network, using the same format string notation * as svn_ra_svn_write_tuple(). */ svn_error_t * svn_ra_svn_write_cmd(svn_ra_svn_conn_t *conn, apr_pool_t *pool, const char *cmdname, const char *fmt, ...); /** Write a successful command response over the network, using the * same format string notation as svn_ra_svn_write_tuple(). Do not use * partial tuples with this function; if you need to use partial * tuples, just write out the "success" and argument tuple by hand. */ svn_error_t * svn_ra_svn_write_cmd_response(svn_ra_svn_conn_t *conn, apr_pool_t *pool, const char *fmt, ...); /** Write an unsuccessful command response over the network. */ svn_error_t * svn_ra_svn_write_cmd_failure(svn_ra_svn_conn_t *conn, apr_pool_t *pool, svn_error_t *err); /** Set @a *editor and @a *edit_baton to an editor which will pass editing * operations over the network, using @a conn and @a pool. * * Upon successful completion of the edit, the editor will invoke @a callback * with @a callback_baton as an argument. */ void svn_ra_svn_get_editor(const svn_delta_editor_t **editor, void **edit_baton, svn_ra_svn_conn_t *conn, apr_pool_t *pool, svn_ra_svn_edit_callback callback, void *callback_baton); /** Receive edit commands over the network and use them to drive @a editor * with @a edit_baton. On return, @a *aborted will be set if the edit was * aborted. The drive can be terminated with a finish-replay command only * if @a for_replay is TRUE. */ svn_error_t * svn_ra_svn_drive_editor2(svn_ra_svn_conn_t *conn, apr_pool_t *pool, const svn_delta_editor_t *editor, void *edit_baton, svn_boolean_t *aborted, svn_boolean_t for_replay); /** Like svn_ra_svn_drive_editor2, but with @a for_replay always FALSE. */ svn_error_t * svn_ra_svn_drive_editor(svn_ra_svn_conn_t *conn, apr_pool_t *pool, const svn_delta_editor_t *editor, void *edit_baton, svn_boolean_t *aborted); /** This function is only intended for use by svnserve. * * Perform CRAM-MD5 password authentication. On success, return * SVN_NO_ERROR with *user set to the username and *success set to * TRUE. On an error which can be reported to the client, report the * error and return SVN_NO_ERROR with *success set to FALSE. On * communications failure, return an error. */ svn_error_t * svn_ra_svn_cram_server(svn_ra_svn_conn_t *conn, apr_pool_t *pool, svn_config_t *pwdb, const char **user, svn_boolean_t *success); /** * Get libsvn_ra_svn version information. * @since New in 1.1. */ const svn_version_t * svn_ra_svn_version(void); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* SVN_RA_SVN_H */ 0707010002c65f000081a40000000000000000000000014cb50d8e0000184a0000010000010036ffffffffffffffff0000003000000000root/usr/local/include/subversion-1/svn_sorts.h/** * @copyright * ==================================================================== * Copyright (c) 2000-2004, 2008 CollabNet. All rights reserved. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://subversion.tigris.org/license-1.html. * If newer versions of this license are posted there, you may use a * newer version instead, at your option. * * This software consists of voluntary contributions made by many * individuals. For exact contribution history, see the revision * history and logs, available at http://subversion.tigris.org/. * ==================================================================== * @endcopyright * * @file svn_sorts.h * @brief all sorts of sorts. */ #ifndef SVN_SORTS_H #define SVN_SORTS_H #include /* for apr_ssize_t */ #include /* for apr_pool_t */ #include /* for apr_array_header_t */ #include /* for apr_hash_t */ /* Define a MAX macro if we don't already have one */ #ifndef MAX #define MAX(a, b) ((a) < (b) ? (b) : (a)) #endif /* Define a MIN macro if we don't already have one */ #ifndef MIN #define MIN(a, b) ((a) < (b) ? (a) : (b)) #endif #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** This structure is used to hold a key/value from a hash table. * @note Private. For use by Subversion's own code only. See issue #1644. */ typedef struct svn_sort__item_t { /** pointer to the key */ const void *key; /** size of the key */ apr_ssize_t klen; /** pointer to the value */ void *value; } svn_sort__item_t; /** Compare two @c svn_sort__item_t's, returning an integer greater than, * equal to, or less than 0, according to whether the key of @a a is * greater than, equal to, or less than the key of @a b as determined * by comparing them with svn_path_compare_paths(). * * The key strings must be NULL-terminated, even though klen does not * include the terminator. * * This is useful for converting a hash into a sorted * @c apr_array_header_t. For example, to convert hash @a hsh to a sorted * array, do this: * * @verbatim apr_array_header_t *hdr; hdr = svn_sort__hash (hsh, @c svn_sort_compare_items_as_paths, pool); @endverbatim */ int svn_sort_compare_items_as_paths(const svn_sort__item_t *a, const svn_sort__item_t *b); /** Compare two @c svn_sort__item_t's, returning an integer greater than, * equal to, or less than 0, according as @a a is greater than, equal to, * or less than @a b according to a lexical key comparison. The keys are * not required to be zero-terminated. */ int svn_sort_compare_items_lexically(const svn_sort__item_t *a, const svn_sort__item_t *b); /** Compare two @c svn_revnum_t's, returning an integer greater than, equal * to, or less than 0, according as @a b is greater than, equal to, or less * than @a a. Note that this sorts newest revision to oldest (IOW, descending * order). * * This function is compatible for use with qsort(). * * This is useful for converting an array of revisions into a sorted * @c apr_array_header_t. You are responsible for detecting, preventing or * removing duplicates. */ int svn_sort_compare_revisions(const void *a, const void *b); /** * Compare two @c const char * paths, returning an integer greater * than, equal to, or less than 0, using the same comparison rules as * are used by svn_path_compare_paths(). * * This function is compatible for use with qsort(). * * @since New in 1.1. */ int svn_sort_compare_paths(const void *a, const void *b); /** * Compare two @c svn_merge_range_t *'s, returning an integer greater * than, equal to, or less than 0 if the first range is greater than, * equal to, or less than, the second range. * * Both @c svn_merge_range_t *'s must describe forward merge ranges. * * If @a a and @a b intersect then the range with the lower start revision * is considered the lesser range. If the ranges' start revisions are * equal then the range with the lower end revision is considered the * lesser range. * * @since New in 1.5 */ int svn_sort_compare_ranges(const void *a, const void *b); /** Sort @a ht according to its keys, return an @c apr_array_header_t * containing @c svn_sort__item_t structures holding those keys and values * (i.e. for each @c svn_sort__item_t @a item in the returned array, * @a item->key and @a item->size are the hash key, and @a item->data points to * the hash value). * * Storage is shared with the original hash, not copied. * * @a comparison_func should take two @c svn_sort__item_t's and return an * integer greater than, equal to, or less than 0, according as the first item * is greater than, equal to, or less than the second. * * @note Private. For use by Subversion's own code only. See issue #1644. * * @note This function and the @c svn_sort__item_t should go over to APR. */ apr_array_header_t * svn_sort__hash(apr_hash_t *ht, int (*comparison_func)(const svn_sort__item_t *, const svn_sort__item_t *), apr_pool_t *pool); /* Return the lowest index at which the element *KEY should be inserted into the array ARRAY, according to the ordering defined by COMPARE_FUNC. The array must already be sorted in the ordering defined by COMPARE_FUNC. COMPARE_FUNC is defined as for the C stdlib function bsearch(). */ int svn_sort__bsearch_lower_bound(const void *key, apr_array_header_t *array, int (*compare_func)(const void *, const void *)); /* Insert a shallow copy of *NEW_ELEMENT into the array ARRAY at the index INSERT_INDEX, growing the array and shuffling existing elements along to make room. */ void svn_sort__array_insert(const void *new_element, apr_array_header_t *array, int insert_index); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* SVN_SORTS_H */ 0707010002c666000081a40000000000000000000000014cb50d8e00001b220000010000010036ffffffffffffffff0000003200000000root/usr/local/include/subversion-1/svn_version.h/** * @copyright * ==================================================================== * Copyright (c) 2001-2008 CollabNet. All rights reserved. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://subversion.tigris.org/license-1.html. * If newer versions of this license are posted there, you may use a * newer version instead, at your option. * * This software consists of voluntary contributions made by many * individuals. For exact contribution history, see the revision * history and logs, available at http://subversion.tigris.org/. * ==================================================================== * @endcopyright * * @file svn_version.h * @brief Version information. */ #ifndef SVN_VERSION_H #define SVN_VERSION_H /* Hack to prevent the resource compiler from including apr_general.h. It doesn't resolve the include paths correctly and blows up without this. */ #ifndef APR_STRINGIFY #include #endif #include "svn_types.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /* Symbols that define the version number. */ /* Version numbers: .. * * The version numbers in this file follow the rules established by: * * http://apr.apache.org/versioning.html */ /** Major version number. * * Modify when incompatible changes are made to published interfaces. */ #define SVN_VER_MAJOR 1 /** Minor version number. * * Modify when new functionality is added or new interfaces are * defined, but all changes are backward compatible. */ #define SVN_VER_MINOR 6 /** * Patch number. * * Modify for every released patch. * * @since New in 1.1. */ #define SVN_VER_PATCH 13 /** @deprecated Provided for backward compatibility with the 1.0 API. */ #define SVN_VER_MICRO SVN_VER_PATCH /** @deprecated Provided for backward compatibility with the 1.0 API. */ #define SVN_VER_LIBRARY SVN_VER_MAJOR /** Version tag: a string describing the version. * * This tag remains " (dev build)" in the repository so that we can * always see from "svn --version" that the software has been built * from the repository rather than a "blessed" distribution. * * When rolling a tarball, we automatically replace this text with " (r1234)" * (where 1234 is the last revision on the branch prior to the release) * for final releases; in prereleases, it becomes " (Alpha 1)", * " (Beta 1)", etc., as appropriate. * * Always change this at the same time as SVN_VER_NUMTAG. */ #define SVN_VER_TAG " (r1002816)" /** Number tag: a string describing the version. * * This tag is used to generate a version number string to identify * the client and server in HTTP requests, for example. It must not * contain any spaces. This value remains "-dev" in the repository. * * When rolling a tarball, we automatically replace this text with "" * for final releases; in prereleases, it becomes "-alpha1, "-beta1", * etc., as appropriate. * * Always change this at the same time as SVN_VER_TAG. */ #define SVN_VER_NUMTAG "" /** Revision number: The repository revision number of this release. * * This constant is used to generate the build number part of the Windows * file version. Its value remains 0 in the repository. * * When rolling a tarball, we automatically replace it with what we * guess to be the correct revision number. */ #define SVN_VER_REVISION 1002816 /* Version strings composed from the above definitions. */ /** Version number */ #define SVN_VER_NUM APR_STRINGIFY(SVN_VER_MAJOR) \ "." APR_STRINGIFY(SVN_VER_MINOR) \ "." APR_STRINGIFY(SVN_VER_PATCH) /** Version number with tag (contains no whitespace) */ #define SVN_VER_NUMBER SVN_VER_NUM SVN_VER_NUMTAG /** Complete version string */ #define SVN_VERSION SVN_VER_NUM SVN_VER_TAG /* Version queries and compatibility checks */ /** * Version information. Each library contains a function called * svn_libname_version() that returns a pointer to a statically * allocated object of this type. * * @since New in 1.1. */ typedef struct svn_version_t { int major; /**< Major version number */ int minor; /**< Minor version number */ int patch; /**< Patch number */ /** * The version tag (#SVN_VER_NUMTAG).\ Must always point to a * statically allocated string. */ const char *tag; } svn_version_t; /** * Define a static svn_version_t object. * * @since New in 1.1. */ #define SVN_VERSION_DEFINE(name) \ static const svn_version_t name = \ { \ SVN_VER_MAJOR, \ SVN_VER_MINOR, \ SVN_VER_PATCH, \ SVN_VER_NUMTAG \ } \ /** * Generate the implementation of a version query function. * * @since New in 1.1. */ #define SVN_VERSION_BODY \ SVN_VERSION_DEFINE(versioninfo); \ return &versioninfo /** * Check library version compatibility. Return #TRUE if the client's * version, given in @a my_version, is compatible with the library * version, provided in @a lib_version. * * This function checks for version compatibility as per our * guarantees, but requires an exact match when linking to an * unreleased library. A development client is always compatible with * a previous released library. * * @since New in 1.1. */ svn_boolean_t svn_ver_compatible(const svn_version_t *my_version, const svn_version_t *lib_version); /** * Check if @a my_version and @a lib_version encode the same version number. * * @since New in 1.2. */ svn_boolean_t svn_ver_equal(const svn_version_t *my_version, const svn_version_t *lib_version); /** * An entry in the compatibility checklist. * @see svn_ver_check_list() * * @since New in 1.1. */ typedef struct svn_version_checklist_t { const char *label; /**< Entry label */ /** Version query function for this entry */ const svn_version_t *(*version_query)(void); } svn_version_checklist_t; /** * Perform a series of version compatibility checks. Checks if @a * my_version is compatible with each entry in @a checklist. @a * checklist must end with an entry whose label is @c NULL. * * @see svn_ver_compatible() * * @since New in 1.1. */ svn_error_t * svn_ver_check_list(const svn_version_t *my_version, const svn_version_checklist_t *checklist); /** * Type of function returning library version. * * @since New in 1.6. */ typedef const svn_version_t *(*svn_version_func_t)(void); /* libsvn_subr doesn't have an svn_subr header, so put the prototype here. */ /** * Get libsvn_subr version information. * * @since New in 1.1. */ const svn_version_t * svn_subr_version(void); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* SVN_VERSION_H */ 0707010002c668000081a40000000000000000000000014cb50d8e00002cdb0000010000010036ffffffffffffffff0000002e00000000root/usr/local/include/subversion-1/svn_xml.h/** * @copyright * ==================================================================== * Copyright (c) 2000-2006, 2008 CollabNet. All rights reserved. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://subversion.tigris.org/license-1.html. * If newer versions of this license are posted there, you may use a * newer version instead, at your option. * * This software consists of voluntary contributions made by many * individuals. For exact contribution history, see the revision * history and logs, available at http://subversion.tigris.org/. * ==================================================================== * @endcopyright * * @file svn_xml.h * @brief XML code shared by various Subversion libraries. */ #ifndef SVN_XML_H #define SVN_XML_H #include #include #include #include "svn_types.h" #include "svn_string.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** The namespace all Subversion XML uses. */ #define SVN_XML_NAMESPACE "svn:" /** Used as style argument to svn_xml_make_open_tag() and friends. */ enum svn_xml_open_tag_style { /** */ svn_xml_normal = 1, /** , no cosmetic newline */ svn_xml_protect_pcdata, /** */ svn_xml_self_closing }; /** Determine if a string of character @a data of length @a len is a * safe bet for use with the svn_xml_escape_* functions found in this * header. * * Return @c TRUE if it is, @c FALSE otherwise. * * Essentially, this function exists to determine whether or not * simply running a string of bytes through the Subversion XML escape * routines will produce legitimate XML. It should only be necessary * for data which might contain bytes that cannot be safely encoded * into XML (certain control characters, for example). */ svn_boolean_t svn_xml_is_xml_safe(const char *data, apr_size_t len); /** Create or append in @a *outstr an xml-escaped version of @a string, * suitable for output as character data. * * If @a *outstr is @c NULL, set @a *outstr to a new stringbuf allocated * in @a pool, else append to the existing stringbuf there. */ void svn_xml_escape_cdata_stringbuf(svn_stringbuf_t **outstr, const svn_stringbuf_t *string, apr_pool_t *pool); /** Same as svn_xml_escape_cdata_stringbuf(), but @a string is an * @c svn_string_t. */ void svn_xml_escape_cdata_string(svn_stringbuf_t **outstr, const svn_string_t *string, apr_pool_t *pool); /** Same as svn_xml_escape_cdata_stringbuf(), but @a string is a * NULL-terminated C string. */ void svn_xml_escape_cdata_cstring(svn_stringbuf_t **outstr, const char *string, apr_pool_t *pool); /** Create or append in @a *outstr an xml-escaped version of @a string, * suitable for output as an attribute value. * * If @a *outstr is @c NULL, set @a *outstr to a new stringbuf allocated * in @a pool, else append to the existing stringbuf there. */ void svn_xml_escape_attr_stringbuf(svn_stringbuf_t **outstr, const svn_stringbuf_t *string, apr_pool_t *pool); /** Same as svn_xml_escape_attr_stringbuf(), but @a string is an * @c svn_string_t. */ void svn_xml_escape_attr_string(svn_stringbuf_t **outstr, const svn_string_t *string, apr_pool_t *pool); /** Same as svn_xml_escape_attr_stringbuf(), but @a string is a * NULL-terminated C string. */ void svn_xml_escape_attr_cstring(svn_stringbuf_t **outstr, const char *string, apr_pool_t *pool); /** * Return UTF-8 string @a string if it contains no characters that are * unrepresentable in XML. Else, return a copy of @a string, * allocated in @a pool, with each unrepresentable character replaced * by "?\uuu", where "uuu" is the three-digit unsigned decimal value * of that character. * * Neither the input nor the output need be valid XML; however, the * output can always be safely XML-escaped. * * @note The current implementation treats all Unicode characters as * representable, except for most ASCII control characters (the * exceptions being CR, LF, and TAB, which are valid in XML). There * may be other UTF-8 characters that are invalid in XML; see * http://subversion.tigris.org/servlets/ReadMsg?list=dev&msgNo=90591 * and its thread for details. * * @since New in 1.2. */ const char * svn_xml_fuzzy_escape(const char *string, apr_pool_t *pool); /*---------------------------------------------------------------*/ /* Generalized Subversion XML Parsing */ /** A generalized Subversion XML parser object */ typedef struct svn_xml_parser_t svn_xml_parser_t; typedef void (*svn_xml_start_elem)(void *baton, const char *name, const char **atts); typedef void (*svn_xml_end_elem)(void *baton, const char *name); /* data is not NULL-terminated. */ typedef void (*svn_xml_char_data)(void *baton, const char *data, apr_size_t len); /** Create a general Subversion XML parser */ svn_xml_parser_t * svn_xml_make_parser(void *baton, svn_xml_start_elem start_handler, svn_xml_end_elem end_handler, svn_xml_char_data data_handler, apr_pool_t *pool); /** Free a general Subversion XML parser */ void svn_xml_free_parser(svn_xml_parser_t *svn_parser); /** Push @a len bytes of xml data in @a buf at @a svn_parser. * * If this is the final push, @a is_final must be set. * * An error will be returned if there was a syntax problem in the XML, * or if any of the callbacks set an error using * svn_xml_signal_bailout(). * * If an error is returned, the @c svn_xml_parser_t will have been freed * automatically, so the caller should not call svn_xml_free_parser(). */ svn_error_t * svn_xml_parse(svn_xml_parser_t *svn_parser, const char *buf, apr_size_t len, svn_boolean_t is_final); /** The way to officially bail out of xml parsing. * * Store @a error in @a svn_parser and set all expat callbacks to @c NULL. */ void svn_xml_signal_bailout(svn_error_t *error, svn_xml_parser_t *svn_parser); /*** Helpers for dealing with the data Expat gives us. ***/ /** Return the value associated with @a name in expat attribute array @a atts, * else return @c NULL. * * (There could never be a @c NULL attribute value in the XML, * although the empty string is possible.) * * @a atts is an array of c-strings: even-numbered indexes are names, * odd-numbers hold values. If all is right, it should end on an * even-numbered index pointing to @c NULL. */ const char * svn_xml_get_attr_value(const char *name, const char **atts); /* Converting between Expat attribute lists and APR hash tables. */ /** Create an attribute hash from @c va_list @a ap. * * The contents of @a ap are alternating char * keys and * char * vals, terminated by a final @c NULL falling on an * even index (zero-based). */ apr_hash_t * svn_xml_ap_to_hash(va_list ap, apr_pool_t *pool); /** Create a hash that corresponds to Expat xml attribute list @a atts. * * The hash's keys and values are char *'s. * * @a atts may be NULL, in which case you just get an empty hash back * (this makes life more convenient for some callers). */ apr_hash_t * svn_xml_make_att_hash(const char **atts, apr_pool_t *pool); /** Like svn_xml_make_att_hash(), but takes a hash and preserves any * key/value pairs already in it. */ void svn_xml_hash_atts_preserving(const char **atts, apr_hash_t *ht, apr_pool_t *pool); /** Like svn_xml_make_att_hash(), but takes a hash and overwrites * key/value pairs already in it that also appear in @a atts. */ void svn_xml_hash_atts_overlaying(const char **atts, apr_hash_t *ht, apr_pool_t *pool); /* Printing XML */ /** Create an XML header and return it in @a *str. * * Fully-formed XML documents should start out with a header, * something like * \ * * This function returns such a header. @a *str must either be @c NULL, in * which case a new string is created, or it must point to an existing * string to be appended to. */ void svn_xml_make_header(svn_stringbuf_t **str, apr_pool_t *pool); /** Store a new xml tag @a tagname in @a *str. * * If @a *str is @c NULL, set @a *str to a new stringbuf allocated * in @a pool, else append to the existing stringbuf there. * * Take the tag's attributes from varargs, a NULL-terminated list of * alternating char * key and char * val. Do xml-escaping * on each val. * * @a style is one of the enumerated styles in @c svn_xml_open_tag_style. */ void svn_xml_make_open_tag(svn_stringbuf_t **str, apr_pool_t *pool, enum svn_xml_open_tag_style style, const char *tagname, ...); /** Like svn_xml_make_open_tag(), but takes a @c va_list instead of being * variadic. */ void svn_xml_make_open_tag_v(svn_stringbuf_t **str, apr_pool_t *pool, enum svn_xml_open_tag_style style, const char *tagname, va_list ap); /** Like svn_xml_make_open_tag(), but takes a hash table of attributes * (char * keys mapping to char * values). * * You might ask, why not just provide svn_xml_make_tag_atts()? * * The reason is that a hash table is the most natural interface to an * attribute list; the fact that Expat uses char ** atts instead is * certainly a defensible implementation decision, but since we'd have * to have special code to support such lists throughout Subversion * anyway, we might as well write that code for the natural interface * (hashes) and then convert in the few cases where conversion is * needed. Someday it might even be nice to change expat-lite to work * with apr hashes. * * See conversion functions svn_xml_make_att_hash() and * svn_xml_make_att_hash_overlaying(). Callers should use those to * convert Expat attr lists into hashes when necessary. */ void svn_xml_make_open_tag_hash(svn_stringbuf_t **str, apr_pool_t *pool, enum svn_xml_open_tag_style style, const char *tagname, apr_hash_t *attributes); /** Store an xml close tag @a tagname in @a str. * * If @a *str is @c NULL, set @a *str to a new stringbuf allocated * in @a pool, else append to the existing stringbuf there. */ void svn_xml_make_close_tag(svn_stringbuf_t **str, apr_pool_t *pool, const char *tagname); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* SVN_XML_H */ 0707010002c646000081a40000000000000000000000014cb50d8e00000cdb0000010000010036ffffffffffffffff0000003100000000root/usr/local/include/subversion-1/svn_compat.h/** * @copyright * ==================================================================== * Copyright (c) 2006-2008 CollabNet. All rights reserved. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://subversion.tigris.org/license-1.html. * If newer versions of this license are posted there, you may use a * newer version instead, at your option. * * This software consists of voluntary contributions made by many * individuals. For exact contribution history, see the revision * history and logs, available at http://subversion.tigris.org/. * ==================================================================== * @endcopyright * * @file svn_compat.h * @brief Utilities to help applications provide backwards-compatibility */ #ifndef SVN_COMPAT_H #define SVN_COMPAT_H #include #include #include #include "svn_types.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** Return, in @a *callback2 and @a *callback2_baton a function/baton that * will call @a callback/@a callback_baton, allocating the @a *callback2_baton * in @a pool. * * @note This is used by compatibility wrappers, which exist in more than * Subversion core library. * * @since New in 1.4. */ void svn_compat_wrap_commit_callback(svn_commit_callback2_t *callback2, void **callback2_baton, svn_commit_callback_t callback, void *callback_baton, apr_pool_t *pool); /** Clear svn:author, svn:date, and svn:log from @a revprops if not NULL. * Use this if you must handle these three properties separately for * compatibility reasons. * * @since New in 1.5. */ void svn_compat_log_revprops_clear(apr_hash_t *revprops); /** Return a list to pass to post-1.5 log-retrieval functions in order to * retrieve the pre-1.5 set of revprops: svn:author, svn:date, and svn:log. * * @since New in 1.5. */ apr_array_header_t * svn_compat_log_revprops_in(apr_pool_t *pool); /** Return, in @a **author, @a **date, and @a **message, the values of the * svn:author, svn:date, and svn:log revprops from @a revprops. If @a * revprops is NULL, all return values are NULL. Any return value may be * NULL if the corresponding property is not set in @a revprops. * * @since New in 1.5. */ void svn_compat_log_revprops_out(const char **author, const char **date, const char **message, apr_hash_t *revprops); /** Return, in @a *receiver2 and @a *receiver2_baton a function/baton that * will call @a receiver/@a receiver_baton, allocating the @a *receiver2_baton * in @a pool. * * @note This is used by compatibility wrappers, which exist in more than * Subversion core library. * * @since New in 1.5. */ void svn_compat_wrap_log_receiver(svn_log_entry_receiver_t *receiver2, void **receiver2_baton, svn_log_message_receiver_t receiver, void *receiver_baton, apr_pool_t *pool); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* SVN_COMPAT_H */ 0707010002c64c000081a40000000000000000000000014cb50d8e00001b110000010000010036ffffffffffffffff0000003500000000root/usr/local/include/subversion-1/svn_dirent_uri.h/** * @copyright * ==================================================================== * Copyright (c) 2008 CollabNet. All rights reserved. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://subversion.tigris.org/license-1.html. * If newer versions of this license are posted there, you may use a * newer version instead, at your option. * * This software consists of voluntary contributions made by many * individuals. For exact contribution history, see the revision * history and logs, available at http://subversion.tigris.org/. * ==================================================================== * @endcopyright * * @file svn_dirent_uri.h * @brief A library to manipulate URIs and directory entries. * * This library makes a clear distinction between directory entries (dirents) * and URIs where: * - a dirent is a path on (local) disc or a UNC path (Windows) * examples: "/foo/bar", "X:/temp", "//server/share" * - a URI is a path in a repository or a URL * examples: "/trunk/README", "http://hostname/svn/repos" * * This distinction is needed because on Windows we have to handle some * dirents and URIs differently. Since it's not possible to determine from * the path string if it's a dirent or a URI, it's up to the API user to * make this choice. See also issue #2028. * * Nearly all the @c svn_dirent_xxx functions expect paths passed into them * to be in canonical form. The only functions which do *not* have such * expectations are: * * - @c svn_dirent_canonicalize() * - @c svn_dirent_is_canonical() * - @c svn_dirent_internal_style() * - @c svn_dirent_local_style() * * ### TODO: add description in line with svn_path.h, once more functions * are moved. * ### END TODO */ #ifndef SVN_DIRENT_URI_H #define SVN_DIRENT_URI_H #include #include #include #include "svn_types.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** Convert @a dirent from the local style to the canonical internal style. * * @since New in 1.6. */ const char * svn_dirent_internal_style(const char *dirent, apr_pool_t *pool); /** Convert @a dirent from the canonical internal style to the local style. * * @since New in 1.6. */ const char * svn_dirent_local_style(const char *dirent, apr_pool_t *pool); /** Join a base dirent (@a base) with a component (@a component), allocated in * @a pool. * * If either @a base or @a component is the empty string, then the other * argument will be copied and returned. If both are the empty string then * empty string is returned. * * If the @a component is an absolute dirent, then it is copied and returned. * The platform specific rules for joining paths are used to join the components. * * This function is NOT appropriate for native (local) file * dirents. Only for "internal" canonicalized dirents, since it uses '/' * for the separator. * * @since New in 1.6. */ char * svn_dirent_join(const char *base, const char *component, apr_pool_t *pool); /** Join multiple components onto a @a base dirent, allocated in @a pool. The * components are terminated by a @c NULL. * * If any component is the empty string, it will be ignored. * * If any component is an absolute dirent, then it resets the base and * further components will be appended to it. * * See svn_dirent_join() for further notes about joining dirents. * * @since New in 1.6. */ char * svn_dirent_join_many(apr_pool_t *pool, const char *base, ...); /** Get the dirname of the specified canonicalized @a dirent, defined as * the dirent with its basename removed. * * If @a dirent is root ("/", "X:/", "//server/share/"), it is returned * unchanged. * * The returned dirname will be allocated in @a pool. * * @since New in 1.6. */ char * svn_dirent_dirname(const char *dirent, apr_pool_t *pool); /** Return TRUE if @a dirent is considered absolute on the platform at * hand. E.g. '/foo' on posix or 'X:/foo', '//server/share/foo' * on Windows. * * @since New in 1.6. */ svn_boolean_t svn_dirent_is_absolute(const char *dirent); /** Return TRUE if @a dirent is considered a root directory on the platform * at hand. E.g. '/' on posix platforms or 'X:/', '//server/share' * on Windows. * * @since New in 1.5. */ svn_boolean_t svn_dirent_is_root(const char *dirent, apr_size_t len); /** Return a new dirent like @a dirent, but transformed such that some types * of dirent specification redundancies are removed. * * This involves collapsing redundant "/./" elements, removing * multiple adjacent separator characters, removing trailing * separator characters, and possibly other semantically inoperative * transformations. * * Convert the server name of UNC paths lowercase on Windows. * * The returned dirent may be statically allocated, equal to @a dirent, or * allocated from @a pool. * * @since New in 1.6. */ const char * svn_dirent_canonicalize(const char *dirent, apr_pool_t *pool); /** Return @c TRUE iff @a dirent is canonical. Use @a pool for temporary * allocations. * * @note The test for canonicalization is currently defined as * "looks exactly the same as @c svn_dirent_canonicalize() would make * it look". * * @since New in 1.6. */ svn_boolean_t svn_dirent_is_canonical(const char *dirent, apr_pool_t *pool); /** Return the longest common dirent shared by two canonicalized dirents, * @a dirent1 and @a dirent2. If there's no common ancestor, return the * empty path. * * @since New in 1.6. */ char * svn_dirent_get_longest_ancestor(const char *dirent1, const char *dirent2, apr_pool_t *pool); /** Convert @a relative canonicalized dirent to an absolute dirent and * return the results in @a *pabsolute, allocated in @a pool. * * @since New in 1.6. */ svn_error_t * svn_dirent_get_absolute(const char **pabsolute, const char *relative, apr_pool_t *pool); /** * This function is similar as @c svn_path_is_child, except that it supports * Windows dirents and UNC paths on Windows. * * @since New in 1.6. */ const char * svn_dirent_is_child(const char *dirent1, const char *dirent2, apr_pool_t *pool); /** Return TRUE if @a dirent1 is an ancestor of @a dirent2 or the dirents are * equal and FALSE otherwise. * * @since New in 1.6. */ svn_boolean_t svn_dirent_is_ancestor(const char *path1, const char *path2); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* SVN_DIRENT_URI_H */ 0707010002c652000081a40000000000000000000000014cb50d8e0000e0ab0000010000010036ffffffffffffffff0000002d00000000root/usr/local/include/subversion-1/svn_io.h/** * @copyright * ==================================================================== * Copyright (c) 2000-2008 CollabNet. All rights reserved. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://subversion.tigris.org/license-1.html. * If newer versions of this license are posted there, you may use a * newer version instead, at your option. * * This software consists of voluntary contributions made by many * individuals. For exact contribution history, see the revision * history and logs, available at http://subversion.tigris.org/. * ==================================================================== * @endcopyright * * @file svn_io.h * @brief General file I/O for Subversion */ /* ==================================================================== */ #ifndef SVN_IO_H #define SVN_IO_H #include #include #include #include #include #include #include #include /* for apr_proc_t, apr_exit_why_e */ #include "svn_types.h" #include "svn_string.h" #include "svn_checksum.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** Used as an argument when creating temporary files to indicate * when a file should be removed. * * @since New in 1.4. * * Not specifying any of these means no removal at all. */ typedef enum svn_io_file_del_t { /** No deletion ever */ svn_io_file_del_none = 0, /** Remove when the file is closed */ svn_io_file_del_on_close, /** Remove when the associated pool is cleared */ svn_io_file_del_on_pool_cleanup } svn_io_file_del_t; /** Represents the kind and special status of a directory entry. * * @since New in 1.3. */ typedef struct svn_io_dirent_t { /** The kind of this entry. */ svn_node_kind_t kind; /** If @c kind is @c svn_node_file, whether this entry is a special file; * else FALSE. * * @see svn_io_check_special_path(). */ svn_boolean_t special; } svn_io_dirent_t; /** Determine the @a kind of @a path. @a path should be UTF-8 encoded. * * If @a path is a file, set @a *kind to @c svn_node_file. * * If @a path is a directory, set @a *kind to @c svn_node_dir. * * If @a path does not exist, set @a *kind to @c svn_node_none. * * If @a path exists but is none of the above, set @a *kind to @c * svn_node_unknown. * * If @a path is not a valid pathname, set @a *kind to #svn_node_none. If * unable to determine @a path's kind for any other reason, return an error, * with @a *kind's value undefined. * * Use @a pool for temporary allocations. * * @see svn_node_kind_t */ svn_error_t * svn_io_check_path(const char *path, svn_node_kind_t *kind, apr_pool_t *pool); /** * Like svn_io_check_path(), but also set *is_special to @c TRUE if * the path is not a normal file. * * @since New in 1.1. */ svn_error_t * svn_io_check_special_path(const char *path, svn_node_kind_t *kind, svn_boolean_t *is_special, apr_pool_t *pool); /** Like svn_io_check_path(), but resolve symlinks. This returns the same varieties of @a kind as svn_io_check_path(). */ svn_error_t * svn_io_check_resolved_path(const char *path, svn_node_kind_t *kind, apr_pool_t *pool); /** Open a new file (for reading and writing) with a unique name based on * utf-8 encoded @a filename, in the directory @a dirpath. The file handle is * returned in @a *file, and the name, which ends with @a suffix, is returned * in @a *unique_name, also utf8-encoded. Either @a file or @a unique_name * may be @c NULL. * * If @a delete_when is @c svn_io_file_del_on_close, then the @c APR_DELONCLOSE * flag will be used when opening the file. The @c APR_BUFFERED flag will * always be used. * * The first attempt will just append @a suffix. If the result is not * a unique name, then subsequent attempts will append a dot, * followed by an iteration number ("2", then "3", and so on), * followed by the suffix. For example, successive calls to * * svn_io_open_uniquely_named(&f, &u, "tests/t1/A/D/G", "pi", ".tmp", ...) * * will open * * tests/t1/A/D/G/pi.tmp * tests/t1/A/D/G/pi.2.tmp * tests/t1/A/D/G/pi.3.tmp * tests/t1/A/D/G/pi.4.tmp * tests/t1/A/D/G/pi.5.tmp * ... * * Assuming @a suffix is non-empty, @a *unique_name will never be exactly * the same as @a filename, even if @a filename does not exist. * * If @a dirpath is NULL, then the directory returned by svn_io_temp_dir() * will be used. * * If @a filename is NULL, then "tempfile" will be used. * * If @a suffix is NULL, then ".tmp" will be used. * * Allocates @a *file and @a *unique_name in @a result_pool. All * intermediate allocations will be performed in @a scratch_pool. * * If no unique name can be found, @c SVN_ERR_IO_UNIQUE_NAMES_EXHAUSTED is * the error returned. * * Claim of Historical Inevitability: this function was written * because * * - tmpnam() is not thread-safe. * - tempname() tries standard system tmp areas first. * * @since New in 1.6 */ svn_error_t * svn_io_open_uniquely_named(apr_file_t **file, const char **unique_name, const char *dirpath, const char *filename, const char *suffix, svn_io_file_del_t delete_when, apr_pool_t *result_pool, apr_pool_t *scratch_pool); /** Create a writable file in the directory @a dirpath. The file will have * an arbitrary and unique name, and the full path will be returned in * @a temp_path. The file will be returned in @a file. Both will be * allocated from @a result_pool. * * If @a dirpath is @c NULL, use the path returned from svn_io_temp_dir(). * (Note that when using the system-provided temp directory, it may not * be possibly to atomically rename the resulting file due to cross-device * issues.) * * The file will be deleted according to @a delete_when. * * Temporary allocations will be performed in @a scratch_pool. * * @since New in 1.6 * @see svn_stream_open_unique() */ svn_error_t * svn_io_open_unique_file3(apr_file_t **file, const char **temp_path, const char *dirpath, svn_io_file_del_t delete_when, apr_pool_t *result_pool, apr_pool_t *scratch_pool); /** Like svn_io_open_uniquely_named(), but takes a joined dirpath and * filename, and a single pool. * * @since New in 1.4 * * @deprecated Provided for backward compatibility with the 1.5 API */ SVN_DEPRECATED svn_error_t * svn_io_open_unique_file2(apr_file_t **f, const char **unique_name_p, const char *path, const char *suffix, svn_io_file_del_t delete_when, apr_pool_t *pool); /** Like svn_io_open_unique_file2, but can't delete on pool cleanup. * * @deprecated Provided for backward compatibility with the 1.0 API * * @note In 1.4 the API was extended to require either @a f or * @a unique_name_p (the other can be NULL). Before that, both were * required. */ SVN_DEPRECATED svn_error_t * svn_io_open_unique_file(apr_file_t **f, const char **unique_name_p, const char *path, const char *suffix, svn_boolean_t delete_on_close, apr_pool_t *pool); /** * Like svn_io_open_unique_file(), except that instead of creating a * file, a symlink is generated that references the path @a dest. * * @since New in 1.1. */ svn_error_t * svn_io_create_unique_link(const char **unique_name_p, const char *path, const char *dest, const char *suffix, apr_pool_t *pool); /** * Set @a *dest to the path that the symlink at @a path references. * Allocate the string from @a pool. * * @since New in 1.1. */ svn_error_t * svn_io_read_link(svn_string_t **dest, const char *path, apr_pool_t *pool); /** Set @a *dir to a directory path (allocated in @a pool) deemed * usable for the creation of temporary files and subdirectories. */ svn_error_t * svn_io_temp_dir(const char **dir, apr_pool_t *pool); /** Copy @a src to @a dst atomically, in a "byte-for-byte" manner. * Overwrite @a dst if it exists, else create it. Both @a src and @a dst * are utf8-encoded filenames. If @a copy_perms is TRUE, set @a dst's * permissions to match those of @a src. */ svn_error_t * svn_io_copy_file(const char *src, const char *dst, svn_boolean_t copy_perms, apr_pool_t *pool); /** Copy permission flags from @a src onto the file at @a dst. Both * filenames are utf8-encoded filenames. */ svn_error_t * svn_io_copy_perms(const char *src, const char *dst, apr_pool_t *pool); /** * Copy symbolic link @a src to @a dst atomically. Overwrite @a dst * if it exists, else create it. Both @a src and @a dst are * utf8-encoded filenames. After copying, the @a dst link will point * to the same thing @a src does. * * @since New in 1.1. */ svn_error_t * svn_io_copy_link(const char *src, const char *dst, apr_pool_t *pool); /** Recursively copy directory @a src into @a dst_parent, as a new entry named * @a dst_basename. If @a dst_basename already exists in @a dst_parent, * return error. @a copy_perms will be passed through to svn_io_copy_file() * when any files are copied. @a src, @a dst_parent, and @a dst_basename are * all utf8-encoded. * * If @a cancel_func is non-NULL, invoke it with @a cancel_baton at * various points during the operation. If it returns any error * (typically @c SVN_ERR_CANCELLED), return that error immediately. */ svn_error_t * svn_io_copy_dir_recursively(const char *src, const char *dst_parent, const char *dst_basename, svn_boolean_t copy_perms, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool); /** Create directory @a path on the file system, creating intermediate * directories as required, like mkdir -p. Report no error if @a * path already exists. @a path is utf8-encoded. * * This is essentially a wrapper for apr_dir_make_recursive(), passing * @c APR_OS_DEFAULT as the permissions. */ svn_error_t * svn_io_make_dir_recursively(const char *path, apr_pool_t *pool); /** Set @a *is_empty_p to @c TRUE if directory @a path is empty, else to * @c FALSE if it is not empty. @a path must be a directory, and is * utf8-encoded. Use @a pool for temporary allocation. */ svn_error_t * svn_io_dir_empty(svn_boolean_t *is_empty_p, const char *path, apr_pool_t *pool); /** Append @a src to @a dst. @a dst will be appended to if it exists, else it * will be created. Both @a src and @a dst are utf8-encoded. */ svn_error_t * svn_io_append_file(const char *src, const char *dst, apr_pool_t *pool); /** Make a file as read-only as the operating system allows. * @a path is the utf8-encoded path to the file. If @a ignore_enoent is * @c TRUE, don't fail if the target file doesn't exist. * * If @a path is a symlink, do nothing. * * @note If @a path is a directory, act on it as though it were a * file, as described above, but note that you probably don't want to * call this function on directories. We have left it effective on * directories for compatibility reasons, but as its name implies, it * should be used only for files. */ svn_error_t * svn_io_set_file_read_only(const char *path, svn_boolean_t ignore_enoent, apr_pool_t *pool); /** Make a file as writable as the operating system allows. * @a path is the utf8-encoded path to the file. If @a ignore_enoent is * @c TRUE, don't fail if the target file doesn't exist. * @warning On Unix this function will do the equivalent of chmod a+w path. * If this is not what you want you should not use this function, but rather * use apr_file_perms_set(). * * If @a path is a symlink, do nothing. * * @note If @a path is a directory, act on it as though it were a * file, as described above, but note that you probably don't want to * call this function on directories. We have left it effective on * directories for compatibility reasons, but as its name implies, it * should be used only for files. */ svn_error_t * svn_io_set_file_read_write(const char *path, svn_boolean_t ignore_enoent, apr_pool_t *pool); /** Similar to svn_io_set_file_read_* functions. * Change the read-write permissions of a file. * @since New in 1.1. * * When making @a path read-write on operating systems with unix style * permissions, set the permissions on @a path to the permissions that * are set when a new file is created (effectively honoring the user's * umask). * * When making the file read-only on operating systems with unix style * permissions, remove all write permissions. * * On other operating systems, toggle the file's "writability" as much as * the operating system allows. * * @a path is the utf8-encoded path to the file. If @a enable_write * is @c TRUE, then make the file read-write. If @c FALSE, make it * read-only. If @a ignore_enoent is @c TRUE, don't fail if the target * file doesn't exist. * * @deprecated Provided for backward compatibility with the 1.3 API. */ SVN_DEPRECATED svn_error_t * svn_io_set_file_read_write_carefully(const char *path, svn_boolean_t enable_write, svn_boolean_t ignore_enoent, apr_pool_t *pool); /** Set @a path's "executability" (but do nothing if it is a symlink). * * @a path is the utf8-encoded path to the file. If @a executable * is @c TRUE, then make the file executable. If @c FALSE, make it * non-executable. If @a ignore_enoent is @c TRUE, don't fail if the target * file doesn't exist. * * When making the file executable on operating systems with unix style * permissions, never add an execute permission where there is not * already a read permission: that is, only make the file executable * for the user, group or world if the corresponding read permission * is already set for user, group or world. * * When making the file non-executable on operating systems with unix style * permissions, remove all execute permissions. * * On other operating systems, toggle the file's "executability" as much as * the operating system allows. * * @note If @a path is a directory, act on it as though it were a * file, as described above, but note that you probably don't want to * call this function on directories. We have left it effective on * directories for compatibility reasons, but as its name implies, it * should be used only for files. */ svn_error_t * svn_io_set_file_executable(const char *path, svn_boolean_t executable, svn_boolean_t ignore_enoent, apr_pool_t *pool); /** Determine whether a file is executable by the current user. * Set @a *executable to @c TRUE if the file @a path is executable by the * current user, otherwise set it to @c FALSE. * * On Windows and on platforms without userids, always returns @c FALSE. */ svn_error_t * svn_io_is_file_executable(svn_boolean_t *executable, const char *path, apr_pool_t *pool); /** Read a line from @a file into @a buf, but not exceeding @a *limit bytes. * Does not include newline, instead '\\0' is put there. * Length (as in strlen) is returned in @a *limit. * @a buf should be pre-allocated. * @a file should be already opened. * * When the file is out of lines, @c APR_EOF will be returned. */ svn_error_t * svn_io_read_length_line(apr_file_t *file, char *buf, apr_size_t *limit, apr_pool_t *pool); /** Set @a *apr_time to the time of last modification of the contents of the * file @a path. @a path is utf8-encoded. * * @note This is the APR mtime which corresponds to the traditional mtime * on Unix, and the last write time on Windows. */ svn_error_t * svn_io_file_affected_time(apr_time_t *apr_time, const char *path, apr_pool_t *pool); /** Set the timestamp of file @a path to @a apr_time. @a path is * utf8-encoded. * * @note This is the APR mtime which corresponds to the traditional mtime * on Unix, and the last write time on Windows. */ svn_error_t * svn_io_set_file_affected_time(apr_time_t apr_time, const char *path, apr_pool_t *pool); /** Sleep to ensure that any files modified after we exit have a different * timestamp than the one we recorded. If @a path is not NULL, check if we * can determine how long we should wait for a new timestamp on the filesystem * containing @a path, an existing file or directory. If @a path is NULL or we * can't determine the timestamp resolution, sleep until the next second. * * Use @a pool for any necessary allocations. @a pool can be null if @a path * is NULL. * * Errors while retrieving the timestamp resolution will result in sleeping * to the next second, to keep the working copy stable in error conditions. * * @since New in 1.6. */ void svn_io_sleep_for_timestamps(const char *path, apr_pool_t *pool); /** Set @a *different_p to non-zero if @a file1 and @a file2 have different * sizes, else set to zero. Both @a file1 and @a file2 are utf8-encoded. * * Setting @a *different_p to zero does not mean the files definitely * have the same size, it merely means that the sizes are not * definitely different. That is, if the size of one or both files * cannot be determined, then the sizes are not known to be different, * so @a *different_p is set to 0. */ svn_error_t * svn_io_filesizes_different_p(svn_boolean_t *different_p, const char *file1, const char *file2, apr_pool_t *pool); /** Return in @a *checksum the checksum of type @a kind of @a file * Use @a pool for temporary allocations and to allocate @a *checksum. * * @since New in 1.6. */ svn_error_t * svn_io_file_checksum2(svn_checksum_t **checksum, const char *file, svn_checksum_kind_t kind, apr_pool_t *pool); /** Put the md5 checksum of @a file into @a digest. * @a digest points to @c APR_MD5_DIGESTSIZE bytes of storage. * Use @a pool only for temporary allocations. * * @deprecated Provided for backward compatibility with the 1.5 API. */ SVN_DEPRECATED svn_error_t * svn_io_file_checksum(unsigned char digest[], const char *file, apr_pool_t *pool); /** Set @a *same to TRUE if @a file1 and @a file2 have the same * contents, else set it to FALSE. Use @a pool for temporary allocations. */ svn_error_t * svn_io_files_contents_same_p(svn_boolean_t *same, const char *file1, const char *file2, apr_pool_t *pool); /** Create file at utf8-encoded @a file with contents @a contents. * @a file must not already exist. * Use @a pool for memory allocations. */ svn_error_t * svn_io_file_create(const char *file, const char *contents, apr_pool_t *pool); /** * Lock file at @a lock_file. If @a exclusive is TRUE, * obtain exclusive lock, otherwise obtain shared lock. * Lock will be automatically released when @a pool is cleared or destroyed. * Use @a pool for memory allocations. * * @deprecated Provided for backward compatibility with the 1.0 API. */ SVN_DEPRECATED svn_error_t * svn_io_file_lock(const char *lock_file, svn_boolean_t exclusive, apr_pool_t *pool); /** * Lock file at @a lock_file. If @a exclusive is TRUE, * obtain exclusive lock, otherwise obtain shared lock. * * If @a nonblocking is TRUE, do not wait for the lock if it * is not available: throw an error instead. * * Lock will be automatically released when @a pool is cleared or destroyed. * Use @a pool for memory allocations. * * @since New in 1.1. */ svn_error_t * svn_io_file_lock2(const char *lock_file, svn_boolean_t exclusive, svn_boolean_t nonblocking, apr_pool_t *pool); /** * Flush any unwritten data from @a file to disk. Use @a pool for * memory allocations. * * @since New in 1.1. */ svn_error_t * svn_io_file_flush_to_disk(apr_file_t *file, apr_pool_t *pool); /** Copy file @a file from location @a src_path to location @a dest_path. * Use @a pool for memory allocations. */ svn_error_t * svn_io_dir_file_copy(const char *src_path, const char *dest_path, const char *file, apr_pool_t *pool); /** Generic byte-streams * * @defgroup svn_io_byte_streams Generic byte streams * @{ */ /** An abstract stream of bytes--either incoming or outgoing or both. * * The creator of a stream sets functions to handle read and write. * Both of these handlers accept a baton whose value is determined at * stream creation time; this baton can point to a structure * containing data associated with the stream. If a caller attempts * to invoke a handler which has not been set, it will generate a * runtime assertion failure. The creator can also set a handler for * close requests so that it can flush buffered data or whatever; * if a close handler is not specified, a close request on the stream * will simply be ignored. Note that svn_stream_close() does not * deallocate the memory used to allocate the stream structure; free * the pool you created the stream in to free that memory. * * The read and write handlers accept length arguments via pointer. * On entry to the handler, the pointed-to value should be the amount * of data which can be read or the amount of data to write. When the * handler returns, the value is reset to the amount of data actually * read or written. Handlers are obliged to complete a read or write * to the maximum extent possible; thus, a short read with no * associated error implies the end of the input stream, and a short * write should never occur without an associated error. */ typedef struct svn_stream_t svn_stream_t; /** Read handler function for a generic stream. @see svn_stream_t. */ typedef svn_error_t *(*svn_read_fn_t)(void *baton, char *buffer, apr_size_t *len); /** Write handler function for a generic stream. @see svn_stream_t. */ typedef svn_error_t *(*svn_write_fn_t)(void *baton, const char *data, apr_size_t *len); /** Close handler function for a generic stream. @see svn_stream_t. */ typedef svn_error_t *(*svn_close_fn_t)(void *baton); /** Create a generic stream. @see svn_stream_t. */ svn_stream_t * svn_stream_create(void *baton, apr_pool_t *pool); /** Set @a stream's baton to @a baton */ void svn_stream_set_baton(svn_stream_t *stream, void *baton); /** Set @a stream's read function to @a read_fn */ void svn_stream_set_read(svn_stream_t *stream, svn_read_fn_t read_fn); /** Set @a stream's write function to @a write_fn */ void svn_stream_set_write(svn_stream_t *stream, svn_write_fn_t write_fn); /** Set @a stream's close function to @a close_fn */ void svn_stream_set_close(svn_stream_t *stream, svn_close_fn_t close_fn); /** Create a stream that is empty for reading and infinite for writing. */ svn_stream_t * svn_stream_empty(apr_pool_t *pool); /** Return a stream allocated in @a pool which forwards all requests * to @a stream. Destruction is explicitly excluded from forwarding. * * @see notes/destruction-of-stacked-resources * * @since New in 1.4. */ svn_stream_t * svn_stream_disown(svn_stream_t *stream, apr_pool_t *pool); /** Create a stream to read the file at @a path. It will be opened using * the APR_BUFFERED and APR_BINARY flag, and APR_OS_DEFAULT for the perms. * If you'd like to use different values, then open the file yourself, and * use the svn_stream_from_aprfile2() interface. * * The stream will be returned in @a stream, and allocated from @a result_pool. * Temporary allocations will be performed in @a scratch_pool. * * @since New in 1.6 */ svn_error_t * svn_stream_open_readonly(svn_stream_t **stream, const char *path, apr_pool_t *result_pool, apr_pool_t *scratch_pool); /** Create a stream to write a file at @a path. The file will be *created* * using the APR_BUFFERED and APR_BINARY flag, and APR_OS_DEFAULT for the * perms. The file will be created "exclusively", so if it already exists, * then an error will be thrown. If you'd like to use different values, or * open an existing file, then open the file yourself, and use the * svn_stream_from_aprfile2() interface. * * The stream will be returned in @a stream, and allocated from @a result_pool. * Temporary allocations will be performed in @a scratch_pool. * * @since New in 1.6 */ svn_error_t * svn_stream_open_writable(svn_stream_t **stream, const char *path, apr_pool_t *result_pool, apr_pool_t *scratch_pool); /** Create a writable stream to a file in the directory @a dirpath. * The file will have an arbitrary and unique name, and the full path * will be returned in @a temp_path. The stream will be returned in * @a stream. Both will be allocated from @a result_pool. * * If @a dirpath is @c NULL, use the path returned from svn_io_temp_dir(). * (Note that when using the system-provided temp directory, it may not * be possibly to atomically rename the resulting file due to cross-device * issues.) * * The file will be deleted according to @a delete_when. * * Temporary allocations will be performed in @a scratch_pool. * * @since New in 1.6 * @see svn_io_open_unique_file3() */ svn_error_t * svn_stream_open_unique(svn_stream_t **stream, const char **temp_path, const char *dirpath, svn_io_file_del_t delete_when, apr_pool_t *result_pool, apr_pool_t *scratch_pool); /** Create a stream from an APR file. For convenience, if @a file is * @c NULL, an empty stream created by svn_stream_empty() is returned. * * This function should normally be called with @a disown set to FALSE, * in which case closing the stream will also close the underlying file. * * If @a disown is TRUE, the stream will disown the underlying file, * meaning that svn_stream_close() will not close the file. * * @since New in 1.4. */ svn_stream_t * svn_stream_from_aprfile2(apr_file_t *file, svn_boolean_t disown, apr_pool_t *pool); /** Similar to svn_stream_from_aprfile2(), except that the file will * always be disowned. * * @note The stream returned is not considered to "own" the underlying * file, meaning that svn_stream_close() on the stream will not * close the file. * * @deprecated Provided for backward compatibility with the 1.3 API. */ SVN_DEPRECATED svn_stream_t * svn_stream_from_aprfile(apr_file_t *file, apr_pool_t *pool); /** Set @a *out to a generic stream connected to stdout, allocated in * @a pool. The stream and its underlying APR handle will be closed * when @a pool is cleared or destroyed. */ svn_error_t * svn_stream_for_stdout(svn_stream_t **out, apr_pool_t *pool); /** Return a generic stream connected to stringbuf @a str. Allocate the * stream in @a pool. */ svn_stream_t * svn_stream_from_stringbuf(svn_stringbuf_t *str, apr_pool_t *pool); /** Return a generic read-only stream connected to string @a str. * Allocate the stream in @a pool. */ svn_stream_t * svn_stream_from_string(const svn_string_t *str, apr_pool_t *pool); /** Return a stream that decompresses all data read and compresses all * data written. The stream @a stream is used to read and write all * compressed data. All compression data structures are allocated on * @a pool. If compression support is not compiled in then * svn_stream_compressed() returns @a stream unmodified. Make sure you * call svn_stream_close() on the stream returned by this function, * so that all data are flushed and cleaned up. * * @note From 1.4, compression support is always compiled in. */ svn_stream_t * svn_stream_compressed(svn_stream_t *stream, apr_pool_t *pool); /** Return a stream that calculates checksums for all data read * and written. The stream @a stream is used to read and write all data. * The stream and the resulting digests are allocated in @a pool. * * When the stream is closed, @a *read_checksum and @a *write_checksum * are set to point to the resulting checksums, of type @a read_checksum_kind * and @a write_checksum_kind, respectively. * * Both @a read_checksum and @a write_checksum can be @c NULL, in which case * the respective checksum isn't calculated. * * If @a read_all is TRUE, make sure that all data available on @a * stream is read (and checksummed) when the stream is closed. * * Read and write operations can be mixed without interfering. * * The @a stream passed into this function is closed when the created * stream is closed. * * @since New in 1.6. */ svn_stream_t * svn_stream_checksummed2(svn_stream_t *stream, svn_checksum_t **read_checksum, svn_checksum_t **write_checksum, svn_checksum_kind_t checksum_kind, svn_boolean_t read_all, apr_pool_t *pool); /** * Similar to svn_stream_checksummed2(), but always returning the MD5 * checksum in @a read_digest and @a write_digest. * * @since New in 1.4. * @deprecated Provided for backward compatibility with the 1.5 API. */ SVN_DEPRECATED svn_stream_t * svn_stream_checksummed(svn_stream_t *stream, const unsigned char **read_digest, const unsigned char **write_digest, svn_boolean_t read_all, apr_pool_t *pool); /** Read from a generic stream. @see svn_stream_t. */ svn_error_t * svn_stream_read(svn_stream_t *stream, char *buffer, apr_size_t *len); /** Write to a generic stream. @see svn_stream_t. */ svn_error_t * svn_stream_write(svn_stream_t *stream, const char *data, apr_size_t *len); /** Close a generic stream. @see svn_stream_t. */ svn_error_t * svn_stream_close(svn_stream_t *stream); /** Write to @a stream using a printf-style @a fmt specifier, passed through * apr_psprintf() using memory from @a pool. */ svn_error_t * svn_stream_printf(svn_stream_t *stream, apr_pool_t *pool, const char *fmt, ...) __attribute__((format(printf, 3, 4))); /** Write to @a stream using a printf-style @a fmt specifier, passed through * apr_psprintf() using memory from @a pool. The resulting string * will be translated to @a encoding before it is sent to @a stream. * * @note Use @c APR_LOCALE_CHARSET to translate to the encoding of the * current locale. * * @since New in 1.3. */ svn_error_t * svn_stream_printf_from_utf8(svn_stream_t *stream, const char *encoding, apr_pool_t *pool, const char *fmt, ...) __attribute__((format(printf, 4, 5))); /** Allocate @a *stringbuf in @a pool, and read into it one line (terminated * by @a eol) from @a stream. The line-terminator is read from the stream, * but is not added to the end of the stringbuf. Instead, the stringbuf * ends with a usual '\\0'. * * If @a stream runs out of bytes before encountering a line-terminator, * then set @a *eof to @c TRUE, otherwise set @a *eof to FALSE. */ svn_error_t * svn_stream_readline(svn_stream_t *stream, svn_stringbuf_t **stringbuf, const char *eol, svn_boolean_t *eof, apr_pool_t *pool); /** * Read the contents of the readable stream @a from and write them to the * writable stream @a to calling @a cancel_func before copying each chunk. * * @a cancel_func may be @c NULL. * * @note both @a from and @a to will be closed upon successful completion of * the copy (but an error may still be returned, based on trying to close * the two streams). If the closure is not desired, then you can use * svn_stream_disown() to protect either or both of the streams from * being closed. * ### TODO: should close the streams ALWAYS, even on error exit * * @since New in 1.6. */ svn_error_t * svn_stream_copy3(svn_stream_t *from, svn_stream_t *to, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool); /** * Same as svn_stream_copy3() but the streams are not closed. * * @since New in 1.5. * @deprecated Provided for backward compatibility with the 1.5 API. */ SVN_DEPRECATED svn_error_t * svn_stream_copy2(svn_stream_t *from, svn_stream_t *to, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool); /** * Same as svn_stream_copy3(), but without the cancellation function * or stream closing. * * @since New in 1.1. * @deprecated Provided for backward compatibility with the 1.4 API. */ SVN_DEPRECATED svn_error_t * svn_stream_copy(svn_stream_t *from, svn_stream_t *to, apr_pool_t *pool); /** Set @a *same to TRUE if @a stream1 and @a stream2 have the same * contents, else set it to FALSE. Use @a pool for temporary allocations. * * @since New in 1.4. */ svn_error_t * svn_stream_contents_same(svn_boolean_t *same, svn_stream_t *stream1, svn_stream_t *stream2, apr_pool_t *pool); /** Read the contents of @a stream into memory, returning the data in * @a result. The stream will be closed when it has been successfully and * completely read. * * The returned memory is allocated in @a result_pool, and any temporary * allocations are performed in @a scratch_pool. * * @note due to memory pseudo-reallocation behavior (due to pools), this * can be a memory-intensive operation for large files. * * @since New in 1.6 */ svn_error_t * svn_string_from_stream(svn_string_t **result, svn_stream_t *stream, apr_pool_t *result_pool, apr_pool_t *scratch_pool); /** @} */ /** Set @a *result to a string containing the contents of @a * filename, which is either "-" (indicating that stdin should be * read) or the utf8-encoded path of a real file. * * @warning Callers should be aware of possible unexpected results * when using this function to read from stdin where additional * stdin-reading processes abound. For example, if a program tries * both to invoke an external editor and to read from stdin, stdin * could be trashed and the editor might act funky or die outright. * * @note due to memory pseudo-reallocation behavior (due to pools), this * can be a memory-intensive operation for large files. * * @since New in 1.5. */ svn_error_t * svn_stringbuf_from_file2(svn_stringbuf_t **result, const char *filename, apr_pool_t *pool); /** Similar to svn_stringbuf_from_file2(), except that if @a filename * is "-", return the error @c SVN_ERR_UNSUPPORTED_FEATURE and don't * touch @a *result. * * @deprecated Provided for backwards compatibility with the 1.4 API. */ SVN_DEPRECATED svn_error_t * svn_stringbuf_from_file(svn_stringbuf_t **result, const char *filename, apr_pool_t *pool); /** Sets @a *result to a string containing the contents of the already opened * @a file. Reads from the current position in file to the end. Does not * close the file or reset the cursor position. * * @note due to memory pseudo-reallocation behavior (due to pools), this * can be a memory-intensive operation for large files. */ svn_error_t * svn_stringbuf_from_aprfile(svn_stringbuf_t **result, apr_file_t *file, apr_pool_t *pool); /** Remove file @a path, a utf8-encoded path. This wraps apr_file_remove(), * converting any error to a Subversion error. */ svn_error_t * svn_io_remove_file(const char *path, apr_pool_t *pool); /** Recursively remove directory @a path. @a path is utf8-encoded. * If @a ignore_enoent is @c TRUE, don't fail if the target directory * doesn't exist. Use @a pool for temporary allocations. * * Because recursive delete of a directory tree can be a lengthy operation, * provide @a cancel_func and @a cancel_baton for interruptability. * * @since New in 1.5. */ svn_error_t * svn_io_remove_dir2(const char *path, svn_boolean_t ignore_enoent, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool); /** Similar to svn_io_remove_dir2(), but with @a ignore_enoent set to * @c FALSE and @a cancel_func and @a cancel_baton set to @c NULL. * * @deprecated Provided for backward compatibility with the 1.4 API */ SVN_DEPRECATED svn_error_t * svn_io_remove_dir(const char *path, apr_pool_t *pool); /** Read all of the disk entries in directory @a path, a utf8-encoded * path. Set @a *dirents to a hash mapping dirent names (char *) to * undefined non-NULL values, allocated in @a pool. * * @note The `.' and `..' directories normally returned by * apr_dir_read() are NOT returned in the hash. * * @since New in 1.4. */ svn_error_t * svn_io_get_dir_filenames(apr_hash_t **dirents, const char *path, apr_pool_t *pool); /** Read all of the disk entries in directory @a path, a utf8-encoded * path. Set @a *dirents to a hash mapping dirent names (char *) to * @c svn_io_dirent_t structures, allocated in @a pool. * * @note The `.' and `..' directories normally returned by * apr_dir_read() are NOT returned in the hash. * * @note The kind field in the @a dirents is set according to the mapping * as documented for svn_io_check_path() * * @since New in 1.3. */ svn_error_t * svn_io_get_dirents2(apr_hash_t **dirents, const char *path, apr_pool_t *pool); /** Similar to svn_io_get_dirents2(), but @a *dirents is a hash table * with @c svn_node_kind_t values. * * @deprecated Provided for backwards compatibility with the 1.2 API. */ SVN_DEPRECATED svn_error_t * svn_io_get_dirents(apr_hash_t **dirents, const char *path, apr_pool_t *pool); /** Callback function type for svn_io_dir_walk() */ typedef svn_error_t * (*svn_io_walk_func_t)(void *baton, const char *path, const apr_finfo_t *finfo, apr_pool_t *pool); /** This function will recursively walk over the files and directories * rooted at @a dirname, a utf8-encoded path. For each file or directory, * @a walk_func is invoked, passing in the @a walk_baton, the utf8-encoded * full path to the entry, an @c apr_finfo_t structure, and a temporary * pool for allocations. For any directory, @a walk_func will be invoked * on the directory itself before being invoked on any subdirectories or * files within the directory. * * The set of information passed to @a walk_func is specified by @a wanted, * and the items specified by @c APR_FINFO_TYPE and @c APR_FINFO_NAME. * * All allocations will be performed in @a pool. */ svn_error_t * svn_io_dir_walk(const char *dirname, apr_int32_t wanted, svn_io_walk_func_t walk_func, void *walk_baton, apr_pool_t *pool); /** * Start @a cmd with @a args, using utf8-encoded @a path as working * directory. Connect @a cmd's stdin, stdout, and stderr to @a infile, * @a outfile, and @a errfile, except where they are NULL. Return the * process handle for the invoked program in @a *cmd_proc. * * @a args is a list of utf8-encoded const char * arguments, * terminated by @c NULL. @a args[0] is the name of the program, though it * need not be the same as @a cmd. * * If @a inherit is TRUE, the invoked program inherits its environment from * the caller and @a cmd, if not absolute, is searched for in PATH. * Otherwise, the invoked program runs with an empty environment and @a cmd * must be an absolute path. * * @note On some platforms, failure to execute @a cmd in the child process * will result in error output being written to @a errfile, if non-NULL, and * a non-zero exit status being returned to the parent process. * * @since New in 1.3. */ svn_error_t * svn_io_start_cmd(apr_proc_t *cmd_proc, const char *path, const char *cmd, const char *const *args, svn_boolean_t inherit, apr_file_t *infile, apr_file_t *outfile, apr_file_t *errfile, apr_pool_t *pool); /** * Wait for the process @a *cmd_proc to complete and optionally retrieve * its exit code. @a cmd is used only in error messages. * * If @a exitcode is not NULL, and SVN_NO_ERROR is returned, @a *exitcode * will contain the exit code of the process. If @a exitcode is NULL and * the exit code is non-zero, then an @c SVN_ERR_EXTERNAL_PROGRAM error * will be returned. * * If @a exitwhy is not NULL, and SVN_NO_ERROR is returned, @a *exitwhy * will indicate why the process terminated. If @a exitwhy is NULL, * and the exit reason is not @c APR_PROC_CHECK_EXIT(), then an * @c SVN_ERR_EXTERNAL_PROGRAM error will be returned. * * @since New in 1.3. */ svn_error_t * svn_io_wait_for_cmd(apr_proc_t *cmd_proc, const char *cmd, int *exitcode, apr_exit_why_e *exitwhy, apr_pool_t *pool); /** Run a command to completion, by first calling svn_io_start_cmd() and * then calling svn_io_wait_for_cmd(). The parameters correspond to * the same-named parameters of those two functions. */ svn_error_t * svn_io_run_cmd(const char *path, const char *cmd, const char *const *args, int *exitcode, apr_exit_why_e *exitwhy, svn_boolean_t inherit, apr_file_t *infile, apr_file_t *outfile, apr_file_t *errfile, apr_pool_t *pool); /** Invoke the configured @c diff program, with @a user_args (an array * of utf8-encoded @a num_user_args arguments) if they are specified * (that is, if @a user_args is non-NULL), or "-u" if they are not. * If @a user_args is NULL, the value of @a num_user_args is ignored. * * Diff runs in utf8-encoded @a dir, and its exit status is stored in * @a exitcode, if it is not @c NULL. * * If @a label1 and/or @a label2 are not NULL they will be passed to the diff * process as the arguments of "-L" options. @a label1 and @a label2 are also * in utf8, and will be converted to native charset along with the other args. * * @a from is the first file passed to diff, and @a to is the second. The * stdout of diff will be sent to @a outfile, and the stderr to @a errfile. * * @a diff_cmd must be non-NULL. * * Do all allocation in @a pool. * @since New in 1.6.0. */ svn_error_t * svn_io_run_diff2(const char *dir, const char *const *user_args, int num_user_args, const char *label1, const char *label2, const char *from, const char *to, int *exitcode, apr_file_t *outfile, apr_file_t *errfile, const char *diff_cmd, apr_pool_t *pool); /** Similar to svn_io_run_diff2() but with @diff_cmd encoded in internal * encoding used by APR. * * @deprecated Provided for backwards compatibility with the 1.5 API. */ SVN_DEPRECATED svn_error_t * svn_io_run_diff(const char *dir, const char *const *user_args, int num_user_args, const char *label1, const char *label2, const char *from, const char *to, int *exitcode, apr_file_t *outfile, apr_file_t *errfile, const char *diff_cmd, apr_pool_t *pool); /** Invoke the configured @c diff3 program, in utf8-encoded @a dir * like this: * * diff3 -E -m @a mine @a older @a yours > @a merged * * (See the diff3 documentation for details.) * * If @a user_args is non-NULL, replace "-E" with the const char* * elements that @a user_args contains. * * @a mine, @a older and @a yours are utf8-encoded paths (relative to * @a dir or absolute) to three files that already exist. * * @a merged is an open file handle, and is left open after the merge * result is written to it. (@a merged should *not* be the same file * as @a mine, or nondeterministic things may happen!) * * @a mine_label, @a older_label, @a yours_label are utf8-encoded label * parameters for diff3's -L option. Any of them may be @c NULL, in * which case the corresponding @a mine, @a older, or @a yours parameter is * used instead. * * Set @a *exitcode to diff3's exit status. If @a *exitcode is anything * other than 0 or 1, then return @c SVN_ERR_EXTERNAL_PROGRAM. (Note the * following from the diff3 info pages: "An exit status of 0 means * `diff3' was successful, 1 means some conflicts were found, and 2 * means trouble.") * * @a diff3_cmd must be non-NULL. * * Do all allocation in @a pool. * * @since New in 1.4. */ svn_error_t * svn_io_run_diff3_3(int *exitcode, const char *dir, const char *mine, const char *older, const char *yours, const char *mine_label, const char *older_label, const char *yours_label, apr_file_t *merged, const char *diff3_cmd, const apr_array_header_t *user_args, apr_pool_t *pool); /** Similar to svn_io_run_diff3_3(), but with @a diff3_cmd encoded in * internal encoding used by APR. * * @deprecated Provided for backwards compatibility with the 1.5 API. * @since New in 1.4. */ SVN_DEPRECATED svn_error_t * svn_io_run_diff3_2(int *exitcode, const char *dir, const char *mine, const char *older, const char *yours, const char *mine_label, const char *older_label, const char *yours_label, apr_file_t *merged, const char *diff3_cmd, const apr_array_header_t *user_args, apr_pool_t *pool); /** Similar to svn_io_run_diff3_2(), but with @a user_args set to @c NULL. * * @deprecated Provided for backwards compatibility with the 1.3 API. */ SVN_DEPRECATED svn_error_t * svn_io_run_diff3(const char *dir, const char *mine, const char *older, const char *yours, const char *mine_label, const char *older_label, const char *yours_label, apr_file_t *merged, int *exitcode, const char *diff3_cmd, apr_pool_t *pool); /** Parse utf8-encoded @a mimetypes_file as a MIME types file (such as * is provided with Apache HTTP Server), and set @a *type_map to a * hash mapping const char * filename extensions to * const char * MIME types. * * @since New in 1.5. */ svn_error_t * svn_io_parse_mimetypes_file(apr_hash_t **type_map, const char *mimetypes_file, apr_pool_t *pool); /** Examine utf8-encoded @a file to determine if it can be described by a * known (as in, known by this function) Multipurpose Internet Mail * Extension (MIME) type. If so, set @a *mimetype to a character string * describing the MIME type, else set it to @c NULL. * * If not @c NULL, @a mimetype_map is a hash mapping const char * * filename extensions to const char * MIME types, and is the * first source consulted regarding @a file's MIME type. * * Use @a pool for any necessary allocations. * * @since New in 1.5. */ svn_error_t * svn_io_detect_mimetype2(const char **mimetype, const char *file, apr_hash_t *mimetype_map, apr_pool_t *pool); /** Like svn_io_detect_mimetype2, but with @a mimetypes_map set to * @c NULL. * * @deprecated Provided for backward compatibility with the 1.4 API */ SVN_DEPRECATED svn_error_t * svn_io_detect_mimetype(const char **mimetype, const char *file, apr_pool_t *pool); /** Wrapper for apr_file_open(). @a fname is utf8-encoded. */ svn_error_t * svn_io_file_open(apr_file_t **new_file, const char *fname, apr_int32_t flag, apr_fileperms_t perm, apr_pool_t *pool); /** Wrapper for apr_file_close(). */ svn_error_t * svn_io_file_close(apr_file_t *file, apr_pool_t *pool); /** Wrapper for apr_file_getc(). */ svn_error_t * svn_io_file_getc(char *ch, apr_file_t *file, apr_pool_t *pool); /** Wrapper for apr_file_info_get(). */ svn_error_t * svn_io_file_info_get(apr_finfo_t *finfo, apr_int32_t wanted, apr_file_t *file, apr_pool_t *pool); /** Wrapper for apr_file_read(). */ svn_error_t * svn_io_file_read(apr_file_t *file, void *buf, apr_size_t *nbytes, apr_pool_t *pool); /** Wrapper for apr_file_read_full(). */ svn_error_t * svn_io_file_read_full(apr_file_t *file, void *buf, apr_size_t nbytes, apr_size_t *bytes_read, apr_pool_t *pool); /** Wrapper for apr_file_seek(). */ svn_error_t * svn_io_file_seek(apr_file_t *file, apr_seek_where_t where, apr_off_t *offset, apr_pool_t *pool); /** Wrapper for apr_file_write(). */ svn_error_t * svn_io_file_write(apr_file_t *file, const void *buf, apr_size_t *nbytes, apr_pool_t *pool); /** Wrapper for apr_file_write_full(). */ svn_error_t * svn_io_file_write_full(apr_file_t *file, const void *buf, apr_size_t nbytes, apr_size_t *bytes_written, apr_pool_t *pool); /** * Open a unique file in @a dirpath, and write @a nbytes from @a buf to * the file before closing it. Return the name of the newly created file * in @a *tmp_path, allocated in @a pool. * * If @a dirpath is @c NULL, use the path returned from svn_io_temp_dir(). * (Note that when using the system-provided temp directory, it may not * be possibly to atomically rename the resulting file due to cross-device * issues.) * * The file will be deleted according to @a delete_when. * * @since New in 1.6. */ svn_error_t * svn_io_write_unique(const char **tmp_path, const char *dirpath, const void *buf, apr_size_t nbytes, svn_io_file_del_t delete_when, apr_pool_t *pool); /** Wrapper for apr_file_trunc(). * @since New in 1.6. */ svn_error_t * svn_io_file_trunc(apr_file_t *file, apr_off_t offset, apr_pool_t *pool); /** Wrapper for apr_stat(). @a fname is utf8-encoded. */ svn_error_t * svn_io_stat(apr_finfo_t *finfo, const char *fname, apr_int32_t wanted, apr_pool_t *pool); /** Wrapper for apr_file_rename(). @a from_path and @a to_path are * utf8-encoded. */ svn_error_t * svn_io_file_rename(const char *from_path, const char *to_path, apr_pool_t *pool); /** Move the file from @a from_path to @a to_path, even across device * boundaries. Overwrite @a to_path if it exists. * * @note This function is different from svn_io_file_rename in that the * latter fails in the 'across device boundaries' case. * * @since New in 1.3. */ svn_error_t * svn_io_file_move(const char *from_path, const char *to_path, apr_pool_t *pool); /** Wrapper for apr_dir_make(). @a path is utf8-encoded. */ svn_error_t * svn_io_dir_make(const char *path, apr_fileperms_t perm, apr_pool_t *pool); /** Same as svn_io_dir_make(), but sets the hidden attribute on the directory on systems that support it. */ svn_error_t * svn_io_dir_make_hidden(const char *path, apr_fileperms_t perm, apr_pool_t *pool); /** * Same as svn_io_dir_make(), but attempts to set the sgid on the * directory on systems that support it. Does not return an error if * the attempt to set the sgid bit fails. On Unix filesystems, * setting the sgid bit on a directory ensures that files and * subdirectories created within inherit group ownership from the * parent instead of from the primary gid. * * @since New in 1.1. */ svn_error_t * svn_io_dir_make_sgid(const char *path, apr_fileperms_t perm, apr_pool_t *pool); /** Wrapper for apr_dir_open(). @a dirname is utf8-encoded. */ svn_error_t * svn_io_dir_open(apr_dir_t **new_dir, const char *dirname, apr_pool_t *pool); /** Wrapper for apr_dir_remove(). @a dirname is utf8-encoded. * @note This function has this name to avoid confusion with * svn_io_remove_dir2(), which is recursive. */ svn_error_t * svn_io_dir_remove_nonrecursive(const char *dirname, apr_pool_t *pool); /** Wrapper for apr_dir_read(). Ensures that @a finfo->name is * utf8-encoded, which means allocating @a finfo->name in @a pool, * which may or may not be the same as @a finfo's pool. Use @a pool * for error allocation as well. */ svn_error_t * svn_io_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, apr_dir_t *thedir, apr_pool_t *pool); /** Version/format files. * * @defgroup svn_io_format_files Version/format files * @{ */ /** Set @a *version to the integer that starts the file at @a path. If the * file does not begin with a series of digits followed by a newline, * return the error @c SVN_ERR_BAD_VERSION_FILE_FORMAT. Use @a pool for * all allocations. */ svn_error_t * svn_io_read_version_file(int *version, const char *path, apr_pool_t *pool); /** Create (or overwrite) the file at @a path with new contents, * formatted as a non-negative integer @a version followed by a single * newline. On successful completion the file will be read-only. Use * @a pool for all allocations. */ svn_error_t * svn_io_write_version_file(const char *path, int version, apr_pool_t *pool); /** @} */ #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* SVN_IO_H */ 0707010002c643000081a40000000000000000000000014cb50d8e000016790000010000010036ffffffffffffffff0000003300000000root/usr/local/include/subversion-1/svn_checksum.h/** * @copyright * ==================================================================== * Copyright (c) 2008 CollabNet. All rights reserved. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://subversion.tigris.org/license-1.html. * If newer versions of this license are posted there, you may use a * newer version instead, at your option. * * This software consists of voluntary contributions made by many * individuals. For exact contribution history, see the revision * history and logs, available at http://subversion.tigris.org/. * ==================================================================== * @endcopyright * * @file svn_checksum.h * @brief Subversion checksum routines */ #ifndef SVN_CHECKSUM_H #define SVN_CHECKSUM_H #include /* for apr_size_t */ #include /* for apr_pool_t */ #include "svn_types.h" /* for svn_boolean_t, svn_error_t */ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * Various types of checksums. * * @since New in 1.6. */ typedef enum { /** The checksum is (or should be set to) an MD5 checksum. */ svn_checksum_md5, /** The checksum is (or should be set to) a SHA1 checksum. */ svn_checksum_sha1 } svn_checksum_kind_t; /** * A generic checksum representation. * * @since New in 1.6. */ typedef struct svn_checksum_t { /** The bytes of the checksum. */ const unsigned char *digest; /** The type of the checksum. This should never be changed by consumers of the APIs. */ svn_checksum_kind_t kind; } svn_checksum_t; /** * Opaque type for creating checksums of data. */ typedef struct svn_checksum_ctx_t svn_checksum_ctx_t; /** Return a new checksum structure of type @a kind, initialized to the all- * zeros value, allocated in @a pool. * * @since New in 1.6. */ svn_checksum_t * svn_checksum_create(svn_checksum_kind_t kind, apr_pool_t *pool); /** Set @c checksum->digest to all zeros, which, by convention, matches * all other checksums. * * @since New in 1.6. */ svn_error_t * svn_checksum_clear(svn_checksum_t *checksum); /** Compare checksums @a checksum1 and @a checksum2. If their kinds do not * match or if neither is all zeros, and their content does not match, then * return FALSE; else return TRUE. * * @since New in 1.6. */ svn_boolean_t svn_checksum_match(const svn_checksum_t *checksum1, const svn_checksum_t *checksum2); /** * Return a deep copy of @a checksum, allocated in @a pool. * * @since New in 1.6. */ svn_checksum_t * svn_checksum_dup(const svn_checksum_t *checksum, apr_pool_t *pool); /** Return the hex representation of @a checksum, allocating the string * in @a pool. * * @since New in 1.6. */ const char * svn_checksum_to_cstring_display(const svn_checksum_t *checksum, apr_pool_t *pool); /** Return the hex representation of @a checksum, allocating the * string in @a pool. If @a checksum->digest is all zeros (that is, * 0, not '0'), then return NULL. * * @since New in 1.6. */ const char * svn_checksum_to_cstring(const svn_checksum_t *checksum, apr_pool_t *pool); /** Parse the hex representation @a hex of a checksum of kind @a kind and * set @a *checksum to the result, allocating in @a pool. * * If @a hex is @c NULL or is the all-zeros checksum, then set @a *checksum * to @c NULL. * * @since New in 1.6. */ svn_error_t * svn_checksum_parse_hex(svn_checksum_t **checksum, svn_checksum_kind_t kind, const char *hex, apr_pool_t *pool); /** * Return in @a *checksum the checksum of type @a kind for the bytes beginning * at @a data, and going for @a len. @a *checksum is allocated in @a pool. * * @since New in 1.6. */ svn_error_t * svn_checksum(svn_checksum_t **checksum, svn_checksum_kind_t kind, const void *data, apr_size_t len, apr_pool_t *pool); /** * Return in @a pool a newly allocated checksum populated with the checksum * of type @a kind for the empty string. * * @since New in 1.6. */ svn_checksum_t * svn_checksum_empty_checksum(svn_checksum_kind_t kind, apr_pool_t *pool); /** * Create a new @c svn_checksum_ctx_t structure, allocated from @a pool for * calculating checksums of type @a kind. @see svn_checksum_final() * * @since New in 1.6. */ svn_checksum_ctx_t * svn_checksum_ctx_create(svn_checksum_kind_t kind, apr_pool_t *pool); /** * Update the checksum represented by @a ctx, with @a len bytes starting at * @a data. * * @since New in 1.6. */ svn_error_t * svn_checksum_update(svn_checksum_ctx_t *ctx, const void *data, apr_size_t len); /** * Finalize the checksum used when creating @a ctx, and put the resultant * checksum in @a *checksum, allocated in @a pool. * * @since New in 1.6. */ svn_error_t * svn_checksum_final(svn_checksum_t **checksum, const svn_checksum_ctx_t *ctx, apr_pool_t *pool); /** * Return the digest size of @a checksum. * * @since New in 1.6. */ apr_size_t svn_checksum_size(const svn_checksum_t *checksum); /** * Internal function for creating a checksum from a binary digest. * * @since New in 1.6 */ svn_checksum_t * svn_checksum__from_digest(const unsigned char *digest, svn_checksum_kind_t kind, apr_pool_t *result_pool); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* SVN_CHECKSUM_H */ 0707010002c654000081a40000000000000000000000014cb50d8e0000097a0000010000010036ffffffffffffffff0000002e00000000root/usr/local/include/subversion-1/svn_md5.h/** * @copyright * ==================================================================== * Copyright (c) 2000-2004, 2008 CollabNet. All rights reserved. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://subversion.tigris.org/license-1.html. * If newer versions of this license are posted there, you may use a * newer version instead, at your option. * * This software consists of voluntary contributions made by many * individuals. For exact contribution history, see the revision * history and logs, available at http://subversion.tigris.org/. * ==================================================================== * @endcopyright * * @file svn_md5.h * @brief Converting and comparing MD5 checksums. */ #ifndef SVN_MD5_H #define SVN_MD5_H #include /* for apr_pool_t */ #include "svn_types.h" /* for svn_boolean_t */ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * The MD5 digest for the empty string. * * @deprecated Provided for backward compatibility with the 1.5 API. * */ SVN_DEPRECATED const unsigned char * svn_md5_empty_string_digest(void); /** * Return the hex representation of @a digest, which must be * @c APR_MD5_DIGESTSIZE bytes long, allocating the string in @a pool. * * @deprecated Provided for backward compatibility with the 1.5 API. */ SVN_DEPRECATED const char * svn_md5_digest_to_cstring_display(const unsigned char digest[], apr_pool_t *pool); /** * Return the hex representation of @a digest, which must be * @c APR_MD5_DIGESTSIZE bytes long, allocating the string in @a pool. * If @a digest is all zeros, then return NULL. * * @deprecated Provided for backward compatibility with the 1.5 API. */ SVN_DEPRECATED const char * svn_md5_digest_to_cstring(const unsigned char digest[], apr_pool_t *pool); /** * Compare digests @a d1 and @a d2, each @c APR_MD5_DIGESTSIZE bytes long. * If neither is all zeros, and they do not match, then return FALSE; * else return TRUE. * * @deprecated Provided for backward compatibility with the 1.5 API. */ SVN_DEPRECATED svn_boolean_t svn_md5_digests_match(const unsigned char d1[], const unsigned char d2[]); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* SVN_MD5_H */ 0707010002c664000081a40000000000000000000000014cb50d8d000005ad0000010000010036ffffffffffffffff0000002f00000000root/usr/local/include/subversion-1/svn_user.h/** * @copyright * ==================================================================== * Copyright (c) 2000-2004 CollabNet. All rights reserved. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://subversion.tigris.org/license-1.html. * If newer versions of this license are posted there, you may use a * newer version instead, at your option. * * This software consists of voluntary contributions made by many * individuals. For exact contribution history, see the revision * history and logs, available at http://subversion.tigris.org/. * ==================================================================== * @endcopyright * * @file svn_user.h * @brief Subversion's wrapper around APR's user information interface. */ #ifndef SVN_USER_H #define SVN_USER_H #include #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** Get the name of the current user, using @a pool for any necessary * allocation, returning NULL on error. * * @since New in 1.4. */ const char * svn_user_get_name(apr_pool_t *pool); /** Get the path of the current user's home directory, using @a pool for * any necessary allocation, returning NULL on error. * * @since New in 1.4. */ const char * svn_user_get_homedir(apr_pool_t *pool); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* SVN_USER_H */ 0707010002c64b000081a40000000000000000000000014cb50d8e000070bf0000010000010036ffffffffffffffff0000002f00000000root/usr/local/include/subversion-1/svn_diff.h/** * @copyright * ==================================================================== * Copyright (c) 2000-2008 CollabNet. All rights reserved. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://subversion.tigris.org/license-1.html. * If newer versions of this license are posted there, you may use a * newer version instead, at your option. * * This software consists of voluntary contributions made by many * individuals. For exact contribution history, see the revision * history and logs, available at http://subversion.tigris.org/. * ==================================================================== * @endcopyright * * @file svn_diff.h * @brief Contextual diffing. * * This is an internalized library for performing contextual diffs * between sources of data. * * @note This is different than Subversion's binary-diffing engine. * That API lives in @c svn_delta.h -- see the "text deltas" section. A * "text delta" is way of representing precise binary diffs between * strings of data. The Subversion client and server send text deltas * to one another during updates and commits. * * This API, however, is (or will be) used for performing *contextual* * merges between files in the working copy. During an update or * merge, 3-way file merging is needed. And 'svn diff' needs to show * the differences between 2 files. * * The nice thing about this API is that it's very general. It * operates on any source of data (a "datasource") and calculates * contextual differences on "tokens" within the data. In our * particular usage, the datasources are files and the tokens are * lines. But the possibilities are endless. */ #ifndef SVN_DIFF_H #define SVN_DIFF_H #include #include #include /* for apr_array_header_t */ #include "svn_types.h" #include "svn_io.h" /* for svn_stream_t */ #include "svn_version.h" #include "svn_string.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * Get libsvn_diff version information. * * @since New in 1.1. */ const svn_version_t * svn_diff_version(void); /* Diffs. */ /** An opaque type that represents a difference between either two or * three datasources. This object is returned by svn_diff_diff(), * svn_diff_diff3() and svn_diff_diff4(), and consumed by a number of * other routines. */ typedef struct svn_diff_t svn_diff_t; /** * There are four types of datasources. In GNU diff3 terminology, * the first three types correspond to the phrases "older", "mine", * and "yours". */ typedef enum svn_diff_datasource_e { /** The oldest form of the data. */ svn_diff_datasource_original, /** The same data, but potentially changed by the user. */ svn_diff_datasource_modified, /** The latest version of the data, possibly different than the * user's modified version. */ svn_diff_datasource_latest, /** The common ancestor of original and modified. */ svn_diff_datasource_ancestor } svn_diff_datasource_e; /** A vtable for reading data from the three datasources. */ typedef struct svn_diff_fns_t { /** Open the datasource of type @a datasource. */ svn_error_t *(*datasource_open)(void *diff_baton, svn_diff_datasource_e datasource); /** Close the datasource of type @a datasource. */ svn_error_t *(*datasource_close)(void *diff_baton, svn_diff_datasource_e datasource); /** Get the next "token" from the datasource of type @a datasource. * Return a "token" in @a *token. Return a hash of "token" in @a *hash. * Leave @a token and @a hash untouched when the datasource is exhausted. */ svn_error_t *(*datasource_get_next_token)(apr_uint32_t *hash, void **token, void *diff_baton, svn_diff_datasource_e datasource); /** A function for ordering the tokens, resembling 'strcmp' in functionality. * @a compare should contain the return value of the comparison: * If @a ltoken and @a rtoken are "equal", return 0. If @a ltoken is * "less than" @a rtoken, return a number < 0. If @a ltoken is * "greater than" @a rtoken, return a number > 0. */ svn_error_t *(*token_compare)(void *diff_baton, void *ltoken, void *rtoken, int *compare); /** Free @a token from memory, the diff algorithm is done with it. */ void (*token_discard)(void *diff_baton, void *token); /** Free *all* tokens from memory, they're no longer needed. */ void (*token_discard_all)(void *diff_baton); } svn_diff_fns_t; /* The Main Events */ /** Given a vtable of @a diff_fns/@a diff_baton for reading datasources, * return a diff object in @a *diff that represents a difference between * an "original" and "modified" datasource. Do all allocation in @a pool. */ svn_error_t * svn_diff_diff(svn_diff_t **diff, void *diff_baton, const svn_diff_fns_t *diff_fns, apr_pool_t *pool); /** Given a vtable of @a diff_fns/@a diff_baton for reading datasources, * return a diff object in @a *diff that represents a difference between * three datasources: "original", "modified", and "latest". Do all * allocation in @a pool. */ svn_error_t * svn_diff_diff3(svn_diff_t **diff, void *diff_baton, const svn_diff_fns_t *diff_fns, apr_pool_t *pool); /** Given a vtable of @a diff_fns/@a diff_baton for reading datasources, * return a diff object in @a *diff that represents a difference between * two datasources: "original" and "latest", adjusted to become a full * difference between "original", "modified" and "latest" using "ancestor". * Do all allocation in @a pool. */ svn_error_t * svn_diff_diff4(svn_diff_t **diff, void *diff_baton, const svn_diff_fns_t *diff_fns, apr_pool_t *pool); /* Utility functions */ /** Determine if a diff object contains conflicts. If it does, return * @c TRUE, else return @c FALSE. */ svn_boolean_t svn_diff_contains_conflicts(svn_diff_t *diff); /** Determine if a diff object contains actual differences between the * datasources. If so, return @c TRUE, else return @c FALSE. */ svn_boolean_t svn_diff_contains_diffs(svn_diff_t *diff); /* Displaying Diffs */ /** A vtable for displaying (or consuming) differences between datasources. * * Differences, similarities, and conflicts are described by lining up * "ranges" of data. * * @note These callbacks describe data ranges in units of "tokens". * A "token" is whatever you've defined it to be in your datasource * @c svn_diff_fns_t vtable. */ typedef struct svn_diff_output_fns_t { /* Two-way and three-way diffs both call the first two output functions: */ /** * If doing a two-way diff, then an *identical* data range was found * between the "original" and "modified" datasources. Specifically, * the match starts at @a original_start and goes for @a original_length * tokens in the original data, and at @a modified_start for * @a modified_length tokens in the modified data. * * If doing a three-way diff, then all three datasources have * matching data ranges. The range @a latest_start, @a latest_length in * the "latest" datasource is identical to the range @a original_start, * @a original_length in the original data, and is also identical to * the range @a modified_start, @a modified_length in the modified data. */ svn_error_t *(*output_common)(void *output_baton, apr_off_t original_start, apr_off_t original_length, apr_off_t modified_start, apr_off_t modified_length, apr_off_t latest_start, apr_off_t latest_length); /** * If doing a two-way diff, then an *conflicting* data range was found * between the "original" and "modified" datasources. Specifically, * the conflict starts at @a original_start and goes for @a original_length * tokens in the original data, and at @a modified_start for * @a modified_length tokens in the modified data. * * If doing a three-way diff, then an identical data range was discovered * between the "original" and "latest" datasources, but this conflicts with * a range in the "modified" datasource. */ svn_error_t *(*output_diff_modified)(void *output_baton, apr_off_t original_start, apr_off_t original_length, apr_off_t modified_start, apr_off_t modified_length, apr_off_t latest_start, apr_off_t latest_length); /* ------ The following callbacks are used by three-way diffs only --- */ /** An identical data range was discovered between the "original" and * "modified" datasources, but this conflicts with a range in the * "latest" datasource. */ svn_error_t *(*output_diff_latest)(void *output_baton, apr_off_t original_start, apr_off_t original_length, apr_off_t modified_start, apr_off_t modified_length, apr_off_t latest_start, apr_off_t latest_length); /** An identical data range was discovered between the "modified" and * "latest" datasources, but this conflicts with a range in the * "original" datasource. */ svn_error_t *(*output_diff_common)(void *output_baton, apr_off_t original_start, apr_off_t original_length, apr_off_t modified_start, apr_off_t modified_length, apr_off_t latest_start, apr_off_t latest_length); /** All three datasources have conflicting data ranges. The range * @a latest_start, @a latest_length in the "latest" datasource conflicts * with the range @a original_start, @a original_length in the "original" * datasource, and also conflicts with the range @a modified_start, * @a modified_length in the "modified" datasource. * If there are common ranges in the "modified" and "latest" datasources * in this conflicting range, @a resolved_diff will contain a diff * which can be used to retrieve the common and conflicting ranges. */ svn_error_t *(*output_conflict)(void *output_baton, apr_off_t original_start, apr_off_t original_length, apr_off_t modified_start, apr_off_t modified_length, apr_off_t latest_start, apr_off_t latest_length, svn_diff_t *resolved_diff); } svn_diff_output_fns_t; /** Style for displaying conflicts during diff3 output. * * @since New in 1.6. */ typedef enum svn_diff_conflict_display_style_t { /** Display modified and latest, with conflict markers. */ svn_diff_conflict_display_modified_latest, /** Like svn_diff_conflict_display_modified_latest, but with an extra effort to identify common sequences between modified and latest. */ svn_diff_conflict_display_resolved_modified_latest, /** Display modified, original, and latest, with conflict markers. */ svn_diff_conflict_display_modified_original_latest, /** Just display modified, with no markers. */ svn_diff_conflict_display_modified, /** Just display latest, with no markers. */ svn_diff_conflict_display_latest, /** Like svn_diff_conflict_display_modified_original_latest, but *only* showing conflicts. */ svn_diff_conflict_display_only_conflicts } svn_diff_conflict_display_style_t; /** Given a vtable of @a output_fns/@a output_baton for consuming * differences, output the differences in @a diff. */ svn_error_t * svn_diff_output(svn_diff_t *diff, void *output_baton, const svn_diff_output_fns_t *output_fns); /* Diffs on files */ /** To what extent whitespace should be ignored when comparing lines. * * @since New in 1.4. */ typedef enum svn_diff_file_ignore_space_t { /** Ignore no whitespace. */ svn_diff_file_ignore_space_none, /** Ignore changes in sequences of whitespace characters, treating each * sequence of whitespace characters as a single space. */ svn_diff_file_ignore_space_change, /** Ignore all whitespace characters. */ svn_diff_file_ignore_space_all } svn_diff_file_ignore_space_t; /** Options to control the behaviour of the file diff routines. * * @since New in 1.4. * * @note This structure may be extended in the future, so to preserve binary * compatibility, users must not allocate structs of this type themselves. * @see svn_diff_file_options_create(). * * @note Although its name suggests otherwise, this structure is used to * pass options to file as well as in-memory diff functions. */ typedef struct svn_diff_file_options_t { /** To what extent whitespace should be ignored when comparing lines. * The default is @c svn_diff_file_ignore_space_none. */ svn_diff_file_ignore_space_t ignore_space; /** Whether to treat all end-of-line markers the same when comparing lines. * The default is @c FALSE. */ svn_boolean_t ignore_eol_style; /** Whether the '@@' lines of the unified diff output should include a prefix * of the nearest preceding line that starts with a character that might be * the initial character of a C language identifier. The default is * @c FALSE. */ svn_boolean_t show_c_function; } svn_diff_file_options_t; /** Allocate a @c svn_diff_file_options_t structure in @a pool, initializing * it with default values. * * @since New in 1.4. */ svn_diff_file_options_t * svn_diff_file_options_create(apr_pool_t *pool); /** * Parse @a args, an array of const char * command line switches * and adjust @a options accordingly. @a options is assumed to be initialized * with default values. @a pool is used for temporary allocation. * * @since New in 1.4. * * The following options are supported: * - --ignore-space-change, -b * - --ignore-all-space, -w * - --ignore-eol-style * - --unified, -u (for compatibility, does nothing). */ svn_error_t * svn_diff_file_options_parse(svn_diff_file_options_t *options, const apr_array_header_t *args, apr_pool_t *pool); /** A convenience function to produce a diff between two files. * * @since New in 1.4. * * Return a diff object in @a *diff (allocated from @a pool) that represents * the difference between an @a original file and @a modified file. * (The file arguments must be full paths to the files.) * * Compare lines according to the relevant fields of @a options. */ svn_error_t * svn_diff_file_diff_2(svn_diff_t **diff, const char *original, const char *modified, const svn_diff_file_options_t *options, apr_pool_t *pool); /** Similar to svn_file_diff_2(), but with @a options set to a struct with * default options. * * @deprecated Provided for backwards compatibility with the 1.3 API. */ SVN_DEPRECATED svn_error_t * svn_diff_file_diff(svn_diff_t **diff, const char *original, const char *modified, apr_pool_t *pool); /** A convenience function to produce a diff between three files. * * @since New in 1.4. * * Return a diff object in @a *diff (allocated from @a pool) that represents * the difference between an @a original file, @a modified file, and @a latest * file. * * Compare lines according to the relevant fields of @a options. */ svn_error_t * svn_diff_file_diff3_2(svn_diff_t **diff, const char *original, const char *modified, const char *latest, const svn_diff_file_options_t *options, apr_pool_t *pool); /** Similar to svn_diff_file_diff3_2(), but with @a options set to a struct * with default options. * * @deprecated Provided for backwards compatibility with the 1.3 API. */ SVN_DEPRECATED svn_error_t * svn_diff_file_diff3(svn_diff_t **diff, const char *original, const char *modified, const char *latest, apr_pool_t *pool); /** A convenience function to produce a diff between four files. * * @since New in 1.4. * * Return a diff object in @a *diff (allocated from @a pool) that represents * the difference between an @a original file, @a modified file, @a latest * and @a ancestor file. (The file arguments must be full paths to the files.) * * Compare lines according to the relevant fields of @a options. */ svn_error_t * svn_diff_file_diff4_2(svn_diff_t **diff, const char *original, const char *modified, const char *latest, const char *ancestor, const svn_diff_file_options_t *options, apr_pool_t *pool); /** Simliar to svn_file_diff4_2(), but with @a options set to a struct with * default options. * * @deprecated Provided for backwards compatibility with the 1.3 API. */ SVN_DEPRECATED svn_error_t * svn_diff_file_diff4(svn_diff_t **diff, const char *original, const char *modified, const char *latest, const char *ancestor, apr_pool_t *pool); /** A convenience function to produce unified diff output from the * diff generated by svn_diff_file_diff(). * * @since New in 1.5. * * Output a @a diff between @a original_path and @a modified_path in unified * context diff format to @a output_stream. Optionally supply * @a original_header and/or @a modified_header to be displayed in the header * of the output. If @a original_header or @a modified_header is @c NULL, a * default header will be displayed, consisting of path and last modified time. * Output all headers and markers in @a header_encoding. If @a relative_to_dir * is not @c NULL, the @a original_path and @a modified_path will have the * @a relative_to_dir stripped from the front of the respective paths. If * @a relative_to_dir is @c NULL, paths will be not be modified. If * @a relative_to_dir is not @c NULL but @a relative_to_dir is not a parent * path of the target, an error is returned. Finally, if @a relative_to_dir * is a URL, an error will be returned. */ svn_error_t * svn_diff_file_output_unified3(svn_stream_t *output_stream, svn_diff_t *diff, const char *original_path, const char *modified_path, const char *original_header, const char *modified_header, const char *header_encoding, const char *relative_to_dir, svn_boolean_t show_c_function, apr_pool_t *pool); /** Similar to svn_diff_file_output_unified3(), but with @a relative_to_dir * set to NULL and @a show_c_function to false. * * @deprecated Provided for backwards compatibility with the 1.3 API. */ SVN_DEPRECATED svn_error_t * svn_diff_file_output_unified2(svn_stream_t *output_stream, svn_diff_t *diff, const char *original_path, const char *modified_path, const char *original_header, const char *modified_header, const char *header_encoding, apr_pool_t *pool); /** Similar to svn_diff_file_output_unified2(), but with @a header_encoding * set to @c APR_LOCALE_CHARSET. * * @deprecated Provided for backward compatibility with the 1.2 API. */ SVN_DEPRECATED svn_error_t * svn_diff_file_output_unified(svn_stream_t *output_stream, svn_diff_t *diff, const char *original_path, const char *modified_path, const char *original_header, const char *modified_header, apr_pool_t *pool); /** A convenience function to produce diff3 output from the * diff generated by svn_diff_file_diff3(). * * Output a @a diff between @a original_path, @a modified_path and * @a latest_path in merged format to @a output_stream. Optionally supply * @a conflict_modified, @a conflict_original, @a conflict_separator and/or * @a conflict_latest to be displayed as conflict markers in the output. * If @a conflict_original, @a conflict_modified, @a conflict_latest and/or * @a conflict_separator is @c NULL, a default marker will be displayed. * @a conflict_style dictates how conflicts are displayed. * * @since New in 1.6. */ svn_error_t * svn_diff_file_output_merge2(svn_stream_t *output_stream, svn_diff_t *diff, const char *original_path, const char *modified_path, const char *latest_path, const char *conflict_original, const char *conflict_modified, const char *conflict_latest, const char *conflict_separator, svn_diff_conflict_display_style_t conflict_style, apr_pool_t *pool); /** Similar to svn_diff_file_output_merge2, but with @a * display_original_in_conflict and @a display_resolved_conflicts * booleans instead of the @a conflict_style enum. * * If both booleans are false, acts like * svn_diff_conflict_display_modified_latest; if @a * display_original_in_conflict is true, acts like * svn_diff_conflict_display_modified_original_latest; if @a * display_resolved_conflicts is true, acts like * svn_diff_conflict_display_resolved_modified_latest. The booleans * may not both be true. * * @deprecated Provided for backward compatibility with the 1.5 API. */ SVN_DEPRECATED svn_error_t * svn_diff_file_output_merge(svn_stream_t *output_stream, svn_diff_t *diff, const char *original_path, const char *modified_path, const char *latest_path, const char *conflict_original, const char *conflict_modified, const char *conflict_latest, const char *conflict_separator, svn_boolean_t display_original_in_conflict, svn_boolean_t display_resolved_conflicts, apr_pool_t *pool); /* Diffs on in-memory structures */ /** Generate @a diff output from the @a original and @a modified * in-memory strings. @a diff will be allocated from @a pool. * * @since New in 1.5. */ svn_error_t * svn_diff_mem_string_diff(svn_diff_t **diff, const svn_string_t *original, const svn_string_t *modified, const svn_diff_file_options_t *options, apr_pool_t *pool); /** Generate @a diff output from the @a orginal, @a modified and @a latest * in-memory strings. @a diff will be allocated in @a pool. * * @since New in 1.5. */ svn_error_t * svn_diff_mem_string_diff3(svn_diff_t **diff, const svn_string_t *original, const svn_string_t *modified, const svn_string_t *latest, const svn_diff_file_options_t *options, apr_pool_t *pool); /** Generate @a diff output from the @a original, @a modified and @a latest * in-memory strings, using @a ancestor. @a diff will be allocated in @a pool. * * @since New in 1.5. */ svn_error_t * svn_diff_mem_string_diff4(svn_diff_t **diff, const svn_string_t *original, const svn_string_t *modified, const svn_string_t *latest, const svn_string_t *ancestor, const svn_diff_file_options_t *options, apr_pool_t *pool); /** Outputs the @a diff object generated by svn_diff_mem_string_diff() * in unified diff format on @a output_stream, using @a original * and @a modified for the text in the output. * Outputs the header and markers in @a header_encoding. * * @a original_header and @a modified header are * used to fill the field after the "---" and "+++" header markers. * * @since New in 1.5. */ svn_error_t * svn_diff_mem_string_output_unified(svn_stream_t *output_stream, svn_diff_t *diff, const char *original_header, const char *modified_header, const char *header_encoding, const svn_string_t *original, const svn_string_t *modified, apr_pool_t *pool); /** Output the @a diff generated by svn_diff_mem_string_diff3() in diff3 * format on @a output_stream, using @a original, @a modified and @a latest * for content changes. * * Use the conflict markers @a conflict_original, @a conflict_modified, * @a conflict_latest and @a conflict_separator or the default one for * each of these if @c NULL is passed. * * @a conflict_style dictates how conflicts are displayed. * * @since New in 1.6. */ svn_error_t * svn_diff_mem_string_output_merge2(svn_stream_t *output_stream, svn_diff_t *diff, const svn_string_t *original, const svn_string_t *modified, const svn_string_t *latest, const char *conflict_original, const char *conflict_modified, const char *conflict_latest, const char *conflict_separator, svn_diff_conflict_display_style_t style, apr_pool_t *pool); /** Similar to svn_diff_mem_string_output_merge2, but with @a * display_original_in_conflict and @a display_resolved_conflicts * booleans instead of the @a conflict_style enum. * * If both booleans are false, acts like * svn_diff_conflict_display_modified_latest; if @a * display_original_in_conflict is true, acts like * svn_diff_conflict_display_modified_original_latest; if @a * display_resolved_conflicts is true, acts like * svn_diff_conflict_display_resolved_modified_latest. The booleans * may not both be true. * * @deprecated Provided for backward compatibility with the 1.5 API. */ SVN_DEPRECATED svn_error_t * svn_diff_mem_string_output_merge(svn_stream_t *output_stream, svn_diff_t *diff, const svn_string_t *original, const svn_string_t *modified, const svn_string_t *latest, const char *conflict_original, const char *conflict_modified, const char *conflict_latest, const char *conflict_separator, svn_boolean_t display_original_in_conflict, svn_boolean_t display_resolved_conflicts, apr_pool_t *pool); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* SVN_DIFF_H */ 0707010002c64f000081a40000000000000000000000014cb50d8e0000b2b20000010000010036ffffffffffffffff0000003600000000root/usr/local/include/subversion-1/svn_error_codes.h/** * @copyright * ==================================================================== * Copyright (c) 2000-2009 CollabNet. All rights reserved. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://subversion.tigris.org/license-1.html. * If newer versions of this license are posted there, you may use a * newer version instead, at your option. * * This software consists of voluntary contributions made by many * individuals. For exact contribution history, see the revision * history and logs, available at http://subversion.tigris.org/. * ==================================================================== * @endcopyright * * @file svn_error_codes.h * @brief Subversion error codes. */ /* What's going on here? In order to define error codes and their associated description strings in the same place, we overload the SVN_ERRDEF() macro with two definitions below. Both take two arguments, an error code name and a description string. One definition of the macro just throws away the string and defines enumeration constants using the error code names -- that definition is used by the header file that exports error codes to the rest of Subversion. The other definition creates a static table mapping the enum codes to their corresponding strings -- that definition is used by the C file that implements svn_strerror(). The header and C files both include this file, using #defines to control which version of the macro they get. */ /* Process this file if we're building an error array, or if we have not defined the enumerated constants yet. */ #if defined(SVN_ERROR_BUILD_ARRAY) || !defined(SVN_ERROR_ENUM_DEFINED) #include /* APR's error system */ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #ifndef DOXYGEN_SHOULD_SKIP_THIS #if defined(SVN_ERROR_BUILD_ARRAY) #define SVN_ERROR_START \ static const err_defn error_table[] = { \ { SVN_WARNING, "Warning" }, #define SVN_ERRDEF(num, offset, str) { num, str }, #define SVN_ERROR_END { 0, NULL } }; #elif !defined(SVN_ERROR_ENUM_DEFINED) #define SVN_ERROR_START \ typedef enum svn_errno_t { \ SVN_WARNING = APR_OS_START_USERERR + 1, #define SVN_ERRDEF(num, offset, str) /** str */ num = offset, #define SVN_ERROR_END SVN_ERR_LAST } svn_errno_t; #define SVN_ERROR_ENUM_DEFINED #endif /* Define custom Subversion error numbers, in the range reserved for that in APR: from APR_OS_START_USERERR to APR_OS_START_SYSERR (see apr_errno.h). Error numbers are divided into categories of up to 5000 errors each. Since we're dividing up the APR user error space, which has room for 500,000 errors, we can have up to 100 categories. Categories are fixed-size; if a category has fewer than 5000 errors, then it just ends with a range of unused numbers. To maintain binary compatibility, please observe these guidelines: - When adding a new error, always add on the end of the appropriate category, so that the real values of existing errors are not changed. - When deleting an error, leave a placeholder comment indicating the offset, again so that the values of other errors are not perturbed. */ #define SVN_ERR_CATEGORY_SIZE 5000 /* Leave one category of room at the beginning, for SVN_WARNING and any other such beasts we might create in the future. */ #define SVN_ERR_BAD_CATEGORY_START (APR_OS_START_USERERR \ + ( 1 * SVN_ERR_CATEGORY_SIZE)) #define SVN_ERR_XML_CATEGORY_START (APR_OS_START_USERERR \ + ( 2 * SVN_ERR_CATEGORY_SIZE)) #define SVN_ERR_IO_CATEGORY_START (APR_OS_START_USERERR \ + ( 3 * SVN_ERR_CATEGORY_SIZE)) #define SVN_ERR_STREAM_CATEGORY_START (APR_OS_START_USERERR \ + ( 4 * SVN_ERR_CATEGORY_SIZE)) #define SVN_ERR_NODE_CATEGORY_START (APR_OS_START_USERERR \ + ( 5 * SVN_ERR_CATEGORY_SIZE)) #define SVN_ERR_ENTRY_CATEGORY_START (APR_OS_START_USERERR \ + ( 6 * SVN_ERR_CATEGORY_SIZE)) #define SVN_ERR_WC_CATEGORY_START (APR_OS_START_USERERR \ + ( 7 * SVN_ERR_CATEGORY_SIZE)) #define SVN_ERR_FS_CATEGORY_START (APR_OS_START_USERERR \ + ( 8 * SVN_ERR_CATEGORY_SIZE)) #define SVN_ERR_REPOS_CATEGORY_START (APR_OS_START_USERERR \ + ( 9 * SVN_ERR_CATEGORY_SIZE)) #define SVN_ERR_RA_CATEGORY_START (APR_OS_START_USERERR \ + (10 * SVN_ERR_CATEGORY_SIZE)) #define SVN_ERR_RA_DAV_CATEGORY_START (APR_OS_START_USERERR \ + (11 * SVN_ERR_CATEGORY_SIZE)) #define SVN_ERR_RA_LOCAL_CATEGORY_START (APR_OS_START_USERERR \ + (12 * SVN_ERR_CATEGORY_SIZE)) #define SVN_ERR_SVNDIFF_CATEGORY_START (APR_OS_START_USERERR \ + (13 * SVN_ERR_CATEGORY_SIZE)) #define SVN_ERR_APMOD_CATEGORY_START (APR_OS_START_USERERR \ + (14 * SVN_ERR_CATEGORY_SIZE)) #define SVN_ERR_CLIENT_CATEGORY_START (APR_OS_START_USERERR \ + (15 * SVN_ERR_CATEGORY_SIZE)) #define SVN_ERR_MISC_CATEGORY_START (APR_OS_START_USERERR \ + (16 * SVN_ERR_CATEGORY_SIZE)) #define SVN_ERR_CL_CATEGORY_START (APR_OS_START_USERERR \ + (17 * SVN_ERR_CATEGORY_SIZE)) #define SVN_ERR_RA_SVN_CATEGORY_START (APR_OS_START_USERERR \ + (18 * SVN_ERR_CATEGORY_SIZE)) #define SVN_ERR_AUTHN_CATEGORY_START (APR_OS_START_USERERR \ + (19 * SVN_ERR_CATEGORY_SIZE)) #define SVN_ERR_AUTHZ_CATEGORY_START (APR_OS_START_USERERR \ + (20 * SVN_ERR_CATEGORY_SIZE)) #define SVN_ERR_DIFF_CATEGORY_START (APR_OS_START_USERERR \ + (21 * SVN_ERR_CATEGORY_SIZE)) #define SVN_ERR_RA_SERF_CATEGORY_START (APR_OS_START_USERERR \ + (22 * SVN_ERR_CATEGORY_SIZE)) #define SVN_ERR_MALFUNC_CATEGORY_START (APR_OS_START_USERERR \ + (23 * SVN_ERR_CATEGORY_SIZE)) #endif /* DOXYGEN_SHOULD_SKIP_THIS */ /** Collection of Subversion error code values, located within the * APR user error space. */ SVN_ERROR_START /* validation ("BAD_FOO") errors */ SVN_ERRDEF(SVN_ERR_BAD_CONTAINING_POOL, SVN_ERR_BAD_CATEGORY_START + 0, "Bad parent pool passed to svn_make_pool()") SVN_ERRDEF(SVN_ERR_BAD_FILENAME, SVN_ERR_BAD_CATEGORY_START + 1, "Bogus filename") SVN_ERRDEF(SVN_ERR_BAD_URL, SVN_ERR_BAD_CATEGORY_START + 2, "Bogus URL") SVN_ERRDEF(SVN_ERR_BAD_DATE, SVN_ERR_BAD_CATEGORY_START + 3, "Bogus date") SVN_ERRDEF(SVN_ERR_BAD_MIME_TYPE, SVN_ERR_BAD_CATEGORY_START + 4, "Bogus mime-type") /** @since New in 1.5. * * Note that there was an unused slot sitting here at * SVN_ERR_BAD_CATEGORY_START + 5, so error codes after this aren't * necessarily "New in 1.5" just because they come later. */ SVN_ERRDEF(SVN_ERR_BAD_PROPERTY_VALUE, SVN_ERR_BAD_CATEGORY_START + 5, "Wrong or unexpected property value") SVN_ERRDEF(SVN_ERR_BAD_VERSION_FILE_FORMAT, SVN_ERR_BAD_CATEGORY_START + 6, "Version file format not correct") SVN_ERRDEF(SVN_ERR_BAD_RELATIVE_PATH, SVN_ERR_BAD_CATEGORY_START + 7, "Path is not an immediate child of the specified directory") SVN_ERRDEF(SVN_ERR_BAD_UUID, SVN_ERR_BAD_CATEGORY_START + 8, "Bogus UUID") /** @since New in 1.6. */ SVN_ERRDEF(SVN_ERR_BAD_CONFIG_VALUE, SVN_ERR_BAD_CATEGORY_START + 9, "Invalid configuration value") SVN_ERRDEF(SVN_ERR_BAD_SERVER_SPECIFICATION, SVN_ERR_BAD_CATEGORY_START + 10, "Bogus server specification") SVN_ERRDEF(SVN_ERR_BAD_CHECKSUM_KIND, SVN_ERR_BAD_CATEGORY_START + 11, "Unsupported checksum type") SVN_ERRDEF(SVN_ERR_BAD_CHECKSUM_PARSE, SVN_ERR_BAD_CATEGORY_START + 12, "Invalid character in hex checksum") /* xml errors */ SVN_ERRDEF(SVN_ERR_XML_ATTRIB_NOT_FOUND, SVN_ERR_XML_CATEGORY_START + 0, "No such XML tag attribute") SVN_ERRDEF(SVN_ERR_XML_MISSING_ANCESTRY, SVN_ERR_XML_CATEGORY_START + 1, " is missing ancestry") SVN_ERRDEF(SVN_ERR_XML_UNKNOWN_ENCODING, SVN_ERR_XML_CATEGORY_START + 2, "Unrecognized binary data encoding; can't decode") SVN_ERRDEF(SVN_ERR_XML_MALFORMED, SVN_ERR_XML_CATEGORY_START + 3, "XML data was not well-formed") SVN_ERRDEF(SVN_ERR_XML_UNESCAPABLE_DATA, SVN_ERR_XML_CATEGORY_START + 4, "Data cannot be safely XML-escaped") /* io errors */ SVN_ERRDEF(SVN_ERR_IO_INCONSISTENT_EOL, SVN_ERR_IO_CATEGORY_START + 0, "Inconsistent line ending style") SVN_ERRDEF(SVN_ERR_IO_UNKNOWN_EOL, SVN_ERR_IO_CATEGORY_START + 1, "Unrecognized line ending style") /** @deprecated Unused, slated for removal in the next major release. */ SVN_ERRDEF(SVN_ERR_IO_CORRUPT_EOL, SVN_ERR_IO_CATEGORY_START + 2, "Line endings other than expected") SVN_ERRDEF(SVN_ERR_IO_UNIQUE_NAMES_EXHAUSTED, SVN_ERR_IO_CATEGORY_START + 3, "Ran out of unique names") /** @deprecated Unused, slated for removal in the next major release. */ SVN_ERRDEF(SVN_ERR_IO_PIPE_FRAME_ERROR, SVN_ERR_IO_CATEGORY_START + 4, "Framing error in pipe protocol") /** @deprecated Unused, slated for removal in the next major release. */ SVN_ERRDEF(SVN_ERR_IO_PIPE_READ_ERROR, SVN_ERR_IO_CATEGORY_START + 5, "Read error in pipe") SVN_ERRDEF(SVN_ERR_IO_WRITE_ERROR, SVN_ERR_IO_CATEGORY_START + 6, "Write error") /* stream errors */ SVN_ERRDEF(SVN_ERR_STREAM_UNEXPECTED_EOF, SVN_ERR_STREAM_CATEGORY_START + 0, "Unexpected EOF on stream") SVN_ERRDEF(SVN_ERR_STREAM_MALFORMED_DATA, SVN_ERR_STREAM_CATEGORY_START + 1, "Malformed stream data") SVN_ERRDEF(SVN_ERR_STREAM_UNRECOGNIZED_DATA, SVN_ERR_STREAM_CATEGORY_START + 2, "Unrecognized stream data") /* node errors */ SVN_ERRDEF(SVN_ERR_NODE_UNKNOWN_KIND, SVN_ERR_NODE_CATEGORY_START + 0, "Unknown svn_node_kind") SVN_ERRDEF(SVN_ERR_NODE_UNEXPECTED_KIND, SVN_ERR_NODE_CATEGORY_START + 1, "Unexpected node kind found") /* entry errors */ SVN_ERRDEF(SVN_ERR_ENTRY_NOT_FOUND, SVN_ERR_ENTRY_CATEGORY_START + 0, "Can't find an entry") /* UNUSED error slot: + 1 */ SVN_ERRDEF(SVN_ERR_ENTRY_EXISTS, SVN_ERR_ENTRY_CATEGORY_START + 2, "Entry already exists") SVN_ERRDEF(SVN_ERR_ENTRY_MISSING_REVISION, SVN_ERR_ENTRY_CATEGORY_START + 3, "Entry has no revision") SVN_ERRDEF(SVN_ERR_ENTRY_MISSING_URL, SVN_ERR_ENTRY_CATEGORY_START + 4, "Entry has no URL") SVN_ERRDEF(SVN_ERR_ENTRY_ATTRIBUTE_INVALID, SVN_ERR_ENTRY_CATEGORY_START + 5, "Entry has an invalid attribute") SVN_ERRDEF(SVN_ERR_ENTRY_FORBIDDEN, SVN_ERR_ENTRY_CATEGORY_START + 6, "Can't create an entry for a forbidden name") /* wc errors */ SVN_ERRDEF(SVN_ERR_WC_OBSTRUCTED_UPDATE, SVN_ERR_WC_CATEGORY_START + 0, "Obstructed update") /** @deprecated Unused, slated for removal in the next major release. */ SVN_ERRDEF(SVN_ERR_WC_UNWIND_MISMATCH, SVN_ERR_WC_CATEGORY_START + 1, "Mismatch popping the WC unwind stack") /** @deprecated Unused, slated for removal in the next major release. */ SVN_ERRDEF(SVN_ERR_WC_UNWIND_EMPTY, SVN_ERR_WC_CATEGORY_START + 2, "Attempt to pop empty WC unwind stack") /** @deprecated Unused, slated for removal in the next major release. */ SVN_ERRDEF(SVN_ERR_WC_UNWIND_NOT_EMPTY, SVN_ERR_WC_CATEGORY_START + 3, "Attempt to unlock with non-empty unwind stack") SVN_ERRDEF(SVN_ERR_WC_LOCKED, SVN_ERR_WC_CATEGORY_START + 4, "Attempted to lock an already-locked dir") SVN_ERRDEF(SVN_ERR_WC_NOT_LOCKED, SVN_ERR_WC_CATEGORY_START + 5, "Working copy not locked; this is probably a bug, please report") /** @deprecated Unused, slated for removal in the next major release. */ SVN_ERRDEF(SVN_ERR_WC_INVALID_LOCK, SVN_ERR_WC_CATEGORY_START + 6, "Invalid lock") SVN_ERRDEF(SVN_ERR_WC_NOT_DIRECTORY, SVN_ERR_WC_CATEGORY_START + 7, "Path is not a working copy directory") SVN_ERRDEF(SVN_ERR_WC_NOT_FILE, SVN_ERR_WC_CATEGORY_START + 8, "Path is not a working copy file") SVN_ERRDEF(SVN_ERR_WC_BAD_ADM_LOG, SVN_ERR_WC_CATEGORY_START + 9, "Problem running log") SVN_ERRDEF(SVN_ERR_WC_PATH_NOT_FOUND, SVN_ERR_WC_CATEGORY_START + 10, "Can't find a working copy path") SVN_ERRDEF(SVN_ERR_WC_NOT_UP_TO_DATE, SVN_ERR_WC_CATEGORY_START + 11, "Working copy is not up-to-date") SVN_ERRDEF(SVN_ERR_WC_LEFT_LOCAL_MOD, SVN_ERR_WC_CATEGORY_START + 12, "Left locally modified or unversioned files") SVN_ERRDEF(SVN_ERR_WC_SCHEDULE_CONFLICT, SVN_ERR_WC_CATEGORY_START + 13, "Unmergeable scheduling requested on an entry") SVN_ERRDEF(SVN_ERR_WC_PATH_FOUND, SVN_ERR_WC_CATEGORY_START + 14, "Found a working copy path") SVN_ERRDEF(SVN_ERR_WC_FOUND_CONFLICT, SVN_ERR_WC_CATEGORY_START + 15, "A conflict in the working copy obstructs the current operation") SVN_ERRDEF(SVN_ERR_WC_CORRUPT, SVN_ERR_WC_CATEGORY_START + 16, "Working copy is corrupt") SVN_ERRDEF(SVN_ERR_WC_CORRUPT_TEXT_BASE, SVN_ERR_WC_CATEGORY_START + 17, "Working copy text base is corrupt") SVN_ERRDEF(SVN_ERR_WC_NODE_KIND_CHANGE, SVN_ERR_WC_CATEGORY_START + 18, "Cannot change node kind") SVN_ERRDEF(SVN_ERR_WC_INVALID_OP_ON_CWD, SVN_ERR_WC_CATEGORY_START + 19, "Invalid operation on the current working directory") SVN_ERRDEF(SVN_ERR_WC_BAD_ADM_LOG_START, SVN_ERR_WC_CATEGORY_START + 20, "Problem on first log entry in a working copy") SVN_ERRDEF(SVN_ERR_WC_UNSUPPORTED_FORMAT, SVN_ERR_WC_CATEGORY_START + 21, "Unsupported working copy format") SVN_ERRDEF(SVN_ERR_WC_BAD_PATH, SVN_ERR_WC_CATEGORY_START + 22, "Path syntax not supported in this context") /** @since New in 1.2. */ SVN_ERRDEF(SVN_ERR_WC_INVALID_SCHEDULE, SVN_ERR_WC_CATEGORY_START + 23, "Invalid schedule") /** @since New in 1.3. */ SVN_ERRDEF(SVN_ERR_WC_INVALID_RELOCATION, SVN_ERR_WC_CATEGORY_START + 24, "Invalid relocation") /** @since New in 1.3. */ SVN_ERRDEF(SVN_ERR_WC_INVALID_SWITCH, SVN_ERR_WC_CATEGORY_START + 25, "Invalid switch") /** @since New in 1.5. */ SVN_ERRDEF(SVN_ERR_WC_MISMATCHED_CHANGELIST, SVN_ERR_WC_CATEGORY_START + 26, "Changelist doesn't match") /** @since New in 1.5. */ SVN_ERRDEF(SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE, SVN_ERR_WC_CATEGORY_START + 27, "Conflict resolution failed") SVN_ERRDEF(SVN_ERR_WC_COPYFROM_PATH_NOT_FOUND, SVN_ERR_WC_CATEGORY_START + 28, "Failed to locate 'copyfrom' path in working copy") /** @since New in 1.5. */ SVN_ERRDEF(SVN_ERR_WC_CHANGELIST_MOVE, SVN_ERR_WC_CATEGORY_START + 29, "Moving a path from one changelist to another") /** @since New in 1.6. */ SVN_ERRDEF(SVN_ERR_WC_CANNOT_DELETE_FILE_EXTERNAL, SVN_ERR_WC_CATEGORY_START + 30, "Cannot delete a file external") /** @since New in 1.6. */ SVN_ERRDEF(SVN_ERR_WC_CANNOT_MOVE_FILE_EXTERNAL, SVN_ERR_WC_CATEGORY_START + 31, "Cannot move a file external") /* fs errors */ SVN_ERRDEF(SVN_ERR_FS_GENERAL, SVN_ERR_FS_CATEGORY_START + 0, "General filesystem error") SVN_ERRDEF(SVN_ERR_FS_CLEANUP, SVN_ERR_FS_CATEGORY_START + 1, "Error closing filesystem") SVN_ERRDEF(SVN_ERR_FS_ALREADY_OPEN, SVN_ERR_FS_CATEGORY_START + 2, "Filesystem is already open") SVN_ERRDEF(SVN_ERR_FS_NOT_OPEN, SVN_ERR_FS_CATEGORY_START + 3, "Filesystem is not open") SVN_ERRDEF(SVN_ERR_FS_CORRUPT, SVN_ERR_FS_CATEGORY_START + 4, "Filesystem is corrupt") SVN_ERRDEF(SVN_ERR_FS_PATH_SYNTAX, SVN_ERR_FS_CATEGORY_START + 5, "Invalid filesystem path syntax") SVN_ERRDEF(SVN_ERR_FS_NO_SUCH_REVISION, SVN_ERR_FS_CATEGORY_START + 6, "Invalid filesystem revision number") SVN_ERRDEF(SVN_ERR_FS_NO_SUCH_TRANSACTION, SVN_ERR_FS_CATEGORY_START + 7, "Invalid filesystem transaction name") SVN_ERRDEF(SVN_ERR_FS_NO_SUCH_ENTRY, SVN_ERR_FS_CATEGORY_START + 8, "Filesystem directory has no such entry") SVN_ERRDEF(SVN_ERR_FS_NO_SUCH_REPRESENTATION, SVN_ERR_FS_CATEGORY_START + 9, "Filesystem has no such representation") SVN_ERRDEF(SVN_ERR_FS_NO_SUCH_STRING, SVN_ERR_FS_CATEGORY_START + 10, "Filesystem has no such string") SVN_ERRDEF(SVN_ERR_FS_NO_SUCH_COPY, SVN_ERR_FS_CATEGORY_START + 11, "Filesystem has no such copy") SVN_ERRDEF(SVN_ERR_FS_TRANSACTION_NOT_MUTABLE, SVN_ERR_FS_CATEGORY_START + 12, "The specified transaction is not mutable") SVN_ERRDEF(SVN_ERR_FS_NOT_FOUND, SVN_ERR_FS_CATEGORY_START + 13, "Filesystem has no item") SVN_ERRDEF(SVN_ERR_FS_ID_NOT_FOUND, SVN_ERR_FS_CATEGORY_START + 14, "Filesystem has no such node-rev-id") SVN_ERRDEF(SVN_ERR_FS_NOT_ID, SVN_ERR_FS_CATEGORY_START + 15, "String does not represent a node or node-rev-id") SVN_ERRDEF(SVN_ERR_FS_NOT_DIRECTORY, SVN_ERR_FS_CATEGORY_START + 16, "Name does not refer to a filesystem directory") SVN_ERRDEF(SVN_ERR_FS_NOT_FILE, SVN_ERR_FS_CATEGORY_START + 17, "Name does not refer to a filesystem file") SVN_ERRDEF(SVN_ERR_FS_NOT_SINGLE_PATH_COMPONENT, SVN_ERR_FS_CATEGORY_START + 18, "Name is not a single path component") SVN_ERRDEF(SVN_ERR_FS_NOT_MUTABLE, SVN_ERR_FS_CATEGORY_START + 19, "Attempt to change immutable filesystem node") SVN_ERRDEF(SVN_ERR_FS_ALREADY_EXISTS, SVN_ERR_FS_CATEGORY_START + 20, "Item already exists in filesystem") SVN_ERRDEF(SVN_ERR_FS_ROOT_DIR, SVN_ERR_FS_CATEGORY_START + 21, "Attempt to remove or recreate fs root dir") SVN_ERRDEF(SVN_ERR_FS_NOT_TXN_ROOT, SVN_ERR_FS_CATEGORY_START + 22, "Object is not a transaction root") SVN_ERRDEF(SVN_ERR_FS_NOT_REVISION_ROOT, SVN_ERR_FS_CATEGORY_START + 23, "Object is not a revision root") SVN_ERRDEF(SVN_ERR_FS_CONFLICT, SVN_ERR_FS_CATEGORY_START + 24, "Merge conflict during commit") SVN_ERRDEF(SVN_ERR_FS_REP_CHANGED, SVN_ERR_FS_CATEGORY_START + 25, "A representation vanished or changed between reads") SVN_ERRDEF(SVN_ERR_FS_REP_NOT_MUTABLE, SVN_ERR_FS_CATEGORY_START + 26, "Tried to change an immutable representation") SVN_ERRDEF(SVN_ERR_FS_MALFORMED_SKEL, SVN_ERR_FS_CATEGORY_START + 27, "Malformed skeleton data") SVN_ERRDEF(SVN_ERR_FS_TXN_OUT_OF_DATE, SVN_ERR_FS_CATEGORY_START + 28, "Transaction is out of date") SVN_ERRDEF(SVN_ERR_FS_BERKELEY_DB, SVN_ERR_FS_CATEGORY_START + 29, "Berkeley DB error") SVN_ERRDEF(SVN_ERR_FS_BERKELEY_DB_DEADLOCK, SVN_ERR_FS_CATEGORY_START + 30, "Berkeley DB deadlock error") SVN_ERRDEF(SVN_ERR_FS_TRANSACTION_DEAD, SVN_ERR_FS_CATEGORY_START + 31, "Transaction is dead") SVN_ERRDEF(SVN_ERR_FS_TRANSACTION_NOT_DEAD, SVN_ERR_FS_CATEGORY_START + 32, "Transaction is not dead") /** @since New in 1.1. */ SVN_ERRDEF(SVN_ERR_FS_UNKNOWN_FS_TYPE, SVN_ERR_FS_CATEGORY_START + 33, "Unknown FS type") /** @since New in 1.2. */ SVN_ERRDEF(SVN_ERR_FS_NO_USER, SVN_ERR_FS_CATEGORY_START + 34, "No user associated with filesystem") /** @since New in 1.2. */ SVN_ERRDEF(SVN_ERR_FS_PATH_ALREADY_LOCKED, SVN_ERR_FS_CATEGORY_START + 35, "Path is already locked") /** @since New in 1.2. */ SVN_ERRDEF(SVN_ERR_FS_PATH_NOT_LOCKED, SVN_ERR_FS_CATEGORY_START + 36, "Path is not locked") /** @since New in 1.2. */ SVN_ERRDEF(SVN_ERR_FS_BAD_LOCK_TOKEN, SVN_ERR_FS_CATEGORY_START + 37, "Lock token is incorrect") /** @since New in 1.2. */ SVN_ERRDEF(SVN_ERR_FS_NO_LOCK_TOKEN, SVN_ERR_FS_CATEGORY_START + 38, "No lock token provided") /** @since New in 1.2. */ SVN_ERRDEF(SVN_ERR_FS_LOCK_OWNER_MISMATCH, SVN_ERR_FS_CATEGORY_START + 39, "Username does not match lock owner") /** @since New in 1.2. */ SVN_ERRDEF(SVN_ERR_FS_NO_SUCH_LOCK, SVN_ERR_FS_CATEGORY_START + 40, "Filesystem has no such lock") /** @since New in 1.2. */ SVN_ERRDEF(SVN_ERR_FS_LOCK_EXPIRED, SVN_ERR_FS_CATEGORY_START + 41, "Lock has expired") /** @since New in 1.2. */ SVN_ERRDEF(SVN_ERR_FS_OUT_OF_DATE, SVN_ERR_FS_CATEGORY_START + 42, "Item is out of date") /**@since New in 1.2. * * This is analogous to SVN_ERR_REPOS_UNSUPPORTED_VERSION. To avoid * confusion with "versions" (i.e., releases) of Subversion, we've * started calling this the "format" number instead. The old * SVN_ERR_REPOS_UNSUPPORTED_VERSION error predates this and so * retains its name. */ SVN_ERRDEF(SVN_ERR_FS_UNSUPPORTED_FORMAT, SVN_ERR_FS_CATEGORY_START + 43, "Unsupported FS format") /** @since New in 1.5. */ SVN_ERRDEF(SVN_ERR_FS_REP_BEING_WRITTEN, SVN_ERR_FS_CATEGORY_START + 44, "Representation is being written") /** @since New in 1.5. */ SVN_ERRDEF(SVN_ERR_FS_TXN_NAME_TOO_LONG, SVN_ERR_FS_CATEGORY_START + 45, "The generated transaction name is too long") /** @since New in 1.5. */ SVN_ERRDEF(SVN_ERR_FS_NO_SUCH_NODE_ORIGIN, SVN_ERR_FS_CATEGORY_START + 46, "Filesystem has no such node origin record") /** @since New in 1.5. */ SVN_ERRDEF(SVN_ERR_FS_UNSUPPORTED_UPGRADE, SVN_ERR_FS_CATEGORY_START + 47, "Filesystem upgrade is not supported") /** @since New in 1.6. */ SVN_ERRDEF(SVN_ERR_FS_NO_SUCH_CHECKSUM_REP, SVN_ERR_FS_CATEGORY_START + 48, "Filesystem has no such checksum-representation index record") /* repos errors */ SVN_ERRDEF(SVN_ERR_REPOS_LOCKED, SVN_ERR_REPOS_CATEGORY_START + 0, "The repository is locked, perhaps for db recovery") SVN_ERRDEF(SVN_ERR_REPOS_HOOK_FAILURE, SVN_ERR_REPOS_CATEGORY_START + 1, "A repository hook failed") SVN_ERRDEF(SVN_ERR_REPOS_BAD_ARGS, SVN_ERR_REPOS_CATEGORY_START + 2, "Incorrect arguments supplied") SVN_ERRDEF(SVN_ERR_REPOS_NO_DATA_FOR_REPORT, SVN_ERR_REPOS_CATEGORY_START + 3, "A report cannot be generated because no data was supplied") SVN_ERRDEF(SVN_ERR_REPOS_BAD_REVISION_REPORT, SVN_ERR_REPOS_CATEGORY_START + 4, "Bogus revision report") /* This is analogous to SVN_ERR_FS_UNSUPPORTED_FORMAT. To avoid * confusion with "versions" (i.e., releases) of Subversion, we * started using the word "format" instead of "version". However, * this error code's name predates that decision. */ SVN_ERRDEF(SVN_ERR_REPOS_UNSUPPORTED_VERSION, SVN_ERR_REPOS_CATEGORY_START + 5, "Unsupported repository version") SVN_ERRDEF(SVN_ERR_REPOS_DISABLED_FEATURE, SVN_ERR_REPOS_CATEGORY_START + 6, "Disabled repository feature") SVN_ERRDEF(SVN_ERR_REPOS_POST_COMMIT_HOOK_FAILED, SVN_ERR_REPOS_CATEGORY_START + 7, "Error running post-commit hook") /** @since New in 1.2. */ SVN_ERRDEF(SVN_ERR_REPOS_POST_LOCK_HOOK_FAILED, SVN_ERR_REPOS_CATEGORY_START + 8, "Error running post-lock hook") /** @since New in 1.2. */ SVN_ERRDEF(SVN_ERR_REPOS_POST_UNLOCK_HOOK_FAILED, SVN_ERR_REPOS_CATEGORY_START + 9, "Error running post-unlock hook") /** @since New in 1.5. */ SVN_ERRDEF(SVN_ERR_REPOS_UNSUPPORTED_UPGRADE, SVN_ERR_REPOS_CATEGORY_START + 10, "Repository upgrade is not supported") /* generic RA errors */ SVN_ERRDEF(SVN_ERR_RA_ILLEGAL_URL, SVN_ERR_RA_CATEGORY_START + 0, "Bad URL passed to RA layer") SVN_ERRDEF(SVN_ERR_RA_NOT_AUTHORIZED, SVN_ERR_RA_CATEGORY_START + 1, "Authorization failed") SVN_ERRDEF(SVN_ERR_RA_UNKNOWN_AUTH, SVN_ERR_RA_CATEGORY_START + 2, "Unknown authorization method") SVN_ERRDEF(SVN_ERR_RA_NOT_IMPLEMENTED, SVN_ERR_RA_CATEGORY_START + 3, "Repository access method not implemented") SVN_ERRDEF(SVN_ERR_RA_OUT_OF_DATE, SVN_ERR_RA_CATEGORY_START + 4, "Item is out of date") SVN_ERRDEF(SVN_ERR_RA_NO_REPOS_UUID, SVN_ERR_RA_CATEGORY_START + 5, "Repository has no UUID") SVN_ERRDEF(SVN_ERR_RA_UNSUPPORTED_ABI_VERSION, SVN_ERR_RA_CATEGORY_START + 6, "Unsupported RA plugin ABI version") /** @since New in 1.2. */ SVN_ERRDEF(SVN_ERR_RA_NOT_LOCKED, SVN_ERR_RA_CATEGORY_START + 7, "Path is not locked") /** @since New in 1.5. */ SVN_ERRDEF(SVN_ERR_RA_PARTIAL_REPLAY_NOT_SUPPORTED, SVN_ERR_RA_CATEGORY_START + 8, "Server can only replay from the root of a repository") /** @since New in 1.5. */ SVN_ERRDEF(SVN_ERR_RA_UUID_MISMATCH, SVN_ERR_RA_CATEGORY_START + 9, "Repository UUID does not match expected UUID") /** @since New in 1.6. */ SVN_ERRDEF(SVN_ERR_RA_REPOS_ROOT_URL_MISMATCH, SVN_ERR_RA_CATEGORY_START + 10, "Repository root URL does not match expected root URL") /* ra_dav errors */ SVN_ERRDEF(SVN_ERR_RA_DAV_SOCK_INIT, SVN_ERR_RA_DAV_CATEGORY_START + 0, "RA layer failed to init socket layer") SVN_ERRDEF(SVN_ERR_RA_DAV_CREATING_REQUEST, SVN_ERR_RA_DAV_CATEGORY_START + 1, "RA layer failed to create HTTP request") SVN_ERRDEF(SVN_ERR_RA_DAV_REQUEST_FAILED, SVN_ERR_RA_DAV_CATEGORY_START + 2, "RA layer request failed") SVN_ERRDEF(SVN_ERR_RA_DAV_OPTIONS_REQ_FAILED, SVN_ERR_RA_DAV_CATEGORY_START + 3, "RA layer didn't receive requested OPTIONS info") SVN_ERRDEF(SVN_ERR_RA_DAV_PROPS_NOT_FOUND, SVN_ERR_RA_DAV_CATEGORY_START + 4, "RA layer failed to fetch properties") SVN_ERRDEF(SVN_ERR_RA_DAV_ALREADY_EXISTS, SVN_ERR_RA_DAV_CATEGORY_START + 5, "RA layer file already exists") /** @deprecated To improve consistency between ra layers, this error code is replaced by SVN_ERR_BAD_CONFIG_VALUE. Slated for removal in the next major release. */ SVN_ERRDEF(SVN_ERR_RA_DAV_INVALID_CONFIG_VALUE, SVN_ERR_RA_DAV_CATEGORY_START + 6, "Invalid configuration value") /** @deprecated To improve consistency between ra layers, this error code is replaced in ra_{neon|serf} by SVN_ERR_FS_NOT_FOUND. Slated for removal in the next major release. */ SVN_ERRDEF(SVN_ERR_RA_DAV_PATH_NOT_FOUND, SVN_ERR_RA_DAV_CATEGORY_START + 7, "HTTP Path Not Found") SVN_ERRDEF(SVN_ERR_RA_DAV_PROPPATCH_FAILED, SVN_ERR_RA_DAV_CATEGORY_START + 8, "Failed to execute WebDAV PROPPATCH") /** @since New in 1.2. */ SVN_ERRDEF(SVN_ERR_RA_DAV_MALFORMED_DATA, SVN_ERR_RA_DAV_CATEGORY_START + 9, "Malformed network data") /** @since New in 1.3 */ SVN_ERRDEF(SVN_ERR_RA_DAV_RESPONSE_HEADER_BADNESS, SVN_ERR_RA_DAV_CATEGORY_START + 10, "Unable to extract data from response header") /** @since New in 1.5 */ SVN_ERRDEF(SVN_ERR_RA_DAV_RELOCATED, SVN_ERR_RA_DAV_CATEGORY_START + 11, "Repository has been moved") /* SVN_ERR_RA_DAV_CATEGORY_START + 12 is reserved for use in 1.7. */ /** @since New in 1.6 */ SVN_ERRDEF(SVN_ERR_RA_DAV_FORBIDDEN, SVN_ERR_RA_DAV_CATEGORY_START + 13, "URL access forbidden for unknown reason") /* ra_local errors */ SVN_ERRDEF(SVN_ERR_RA_LOCAL_REPOS_NOT_FOUND, SVN_ERR_RA_LOCAL_CATEGORY_START + 0, "Couldn't find a repository") SVN_ERRDEF(SVN_ERR_RA_LOCAL_REPOS_OPEN_FAILED, SVN_ERR_RA_LOCAL_CATEGORY_START + 1, "Couldn't open a repository") /* ra_svn errors */ SVN_ERRDEF(SVN_ERR_RA_SVN_CMD_ERR, SVN_ERR_RA_SVN_CATEGORY_START + 0, "Special code for wrapping server errors to report to client") SVN_ERRDEF(SVN_ERR_RA_SVN_UNKNOWN_CMD, SVN_ERR_RA_SVN_CATEGORY_START + 1, "Unknown svn protocol command") SVN_ERRDEF(SVN_ERR_RA_SVN_CONNECTION_CLOSED, SVN_ERR_RA_SVN_CATEGORY_START + 2, "Network connection closed unexpectedly") SVN_ERRDEF(SVN_ERR_RA_SVN_IO_ERROR, SVN_ERR_RA_SVN_CATEGORY_START + 3, "Network read/write error") SVN_ERRDEF(SVN_ERR_RA_SVN_MALFORMED_DATA, SVN_ERR_RA_SVN_CATEGORY_START + 4, "Malformed network data") SVN_ERRDEF(SVN_ERR_RA_SVN_REPOS_NOT_FOUND, SVN_ERR_RA_SVN_CATEGORY_START + 5, "Couldn't find a repository") SVN_ERRDEF(SVN_ERR_RA_SVN_BAD_VERSION, SVN_ERR_RA_SVN_CATEGORY_START + 6, "Client/server version mismatch") /** @since New in 1.5. */ SVN_ERRDEF(SVN_ERR_RA_SVN_NO_MECHANISMS, SVN_ERR_RA_SVN_CATEGORY_START + 7, "Cannot negotiate authentication mechanism") /* libsvn_ra_serf errors */ /** @since New in 1.5. */ SVN_ERRDEF(SVN_ERR_RA_SERF_SSPI_INITIALISATION_FAILED, SVN_ERR_RA_SERF_CATEGORY_START + 0, "Initialization of SSPI library failed") /** @since New in 1.5. */ SVN_ERRDEF(SVN_ERR_RA_SERF_SSL_CERT_UNTRUSTED, SVN_ERR_RA_SERF_CATEGORY_START + 1, "Server SSL certificate untrusted") /* libsvn_auth errors */ /* this error can be used when an auth provider doesn't have the creds, but no other "real" error occurred. */ SVN_ERRDEF(SVN_ERR_AUTHN_CREDS_UNAVAILABLE, SVN_ERR_AUTHN_CATEGORY_START + 0, "Credential data unavailable") SVN_ERRDEF(SVN_ERR_AUTHN_NO_PROVIDER, SVN_ERR_AUTHN_CATEGORY_START + 1, "No authentication provider available") SVN_ERRDEF(SVN_ERR_AUTHN_PROVIDERS_EXHAUSTED, SVN_ERR_AUTHN_CATEGORY_START + 2, "All authentication providers exhausted") SVN_ERRDEF(SVN_ERR_AUTHN_CREDS_NOT_SAVED, SVN_ERR_AUTHN_CATEGORY_START + 3, "Credentials not saved") /** @since New in 1.5. */ SVN_ERRDEF(SVN_ERR_AUTHN_FAILED, SVN_ERR_AUTHN_CATEGORY_START + 4, "Authentication failed") /* authorization errors */ SVN_ERRDEF(SVN_ERR_AUTHZ_ROOT_UNREADABLE, SVN_ERR_AUTHZ_CATEGORY_START + 0, "Read access denied for root of edit") /** @since New in 1.1. */ SVN_ERRDEF(SVN_ERR_AUTHZ_UNREADABLE, SVN_ERR_AUTHZ_CATEGORY_START + 1, "Item is not readable") /** @since New in 1.1. */ SVN_ERRDEF(SVN_ERR_AUTHZ_PARTIALLY_READABLE, SVN_ERR_AUTHZ_CATEGORY_START + 2, "Item is partially readable") SVN_ERRDEF(SVN_ERR_AUTHZ_INVALID_CONFIG, SVN_ERR_AUTHZ_CATEGORY_START + 3, "Invalid authz configuration") /** @since New in 1.3 */ SVN_ERRDEF(SVN_ERR_AUTHZ_UNWRITABLE, SVN_ERR_AUTHZ_CATEGORY_START + 4, "Item is not writable") /* svndiff errors */ SVN_ERRDEF(SVN_ERR_SVNDIFF_INVALID_HEADER, SVN_ERR_SVNDIFF_CATEGORY_START + 0, "Svndiff data has invalid header") SVN_ERRDEF(SVN_ERR_SVNDIFF_CORRUPT_WINDOW, SVN_ERR_SVNDIFF_CATEGORY_START + 1, "Svndiff data contains corrupt window") SVN_ERRDEF(SVN_ERR_SVNDIFF_BACKWARD_VIEW, SVN_ERR_SVNDIFF_CATEGORY_START + 2, "Svndiff data contains backward-sliding source view") SVN_ERRDEF(SVN_ERR_SVNDIFF_INVALID_OPS, SVN_ERR_SVNDIFF_CATEGORY_START + 3, "Svndiff data contains invalid instruction") SVN_ERRDEF(SVN_ERR_SVNDIFF_UNEXPECTED_END, SVN_ERR_SVNDIFF_CATEGORY_START + 4, "Svndiff data ends unexpectedly") SVN_ERRDEF(SVN_ERR_SVNDIFF_INVALID_COMPRESSED_DATA, SVN_ERR_SVNDIFF_CATEGORY_START + 5, "Svndiff compressed data is invalid") /* libsvn_diff errors */ SVN_ERRDEF(SVN_ERR_DIFF_DATASOURCE_MODIFIED, SVN_ERR_DIFF_CATEGORY_START + 0, "Diff data source modified unexpectedly") /* mod_dav_svn errors */ SVN_ERRDEF(SVN_ERR_APMOD_MISSING_PATH_TO_FS, SVN_ERR_APMOD_CATEGORY_START + 0, "Apache has no path to an SVN filesystem") SVN_ERRDEF(SVN_ERR_APMOD_MALFORMED_URI, SVN_ERR_APMOD_CATEGORY_START + 1, "Apache got a malformed URI") SVN_ERRDEF(SVN_ERR_APMOD_ACTIVITY_NOT_FOUND, SVN_ERR_APMOD_CATEGORY_START + 2, "Activity not found") SVN_ERRDEF(SVN_ERR_APMOD_BAD_BASELINE, SVN_ERR_APMOD_CATEGORY_START + 3, "Baseline incorrect") SVN_ERRDEF(SVN_ERR_APMOD_CONNECTION_ABORTED, SVN_ERR_APMOD_CATEGORY_START + 4, "Input/output error") /* libsvn_client errors */ SVN_ERRDEF(SVN_ERR_CLIENT_VERSIONED_PATH_REQUIRED, SVN_ERR_CLIENT_CATEGORY_START + 0, "A path under version control is needed for this operation") SVN_ERRDEF(SVN_ERR_CLIENT_RA_ACCESS_REQUIRED, SVN_ERR_CLIENT_CATEGORY_START + 1, "Repository access is needed for this operation") SVN_ERRDEF(SVN_ERR_CLIENT_BAD_REVISION, SVN_ERR_CLIENT_CATEGORY_START + 2, "Bogus revision information given") SVN_ERRDEF(SVN_ERR_CLIENT_DUPLICATE_COMMIT_URL, SVN_ERR_CLIENT_CATEGORY_START + 3, "Attempting to commit to a URL more than once") SVN_ERRDEF(SVN_ERR_CLIENT_IS_BINARY_FILE, SVN_ERR_CLIENT_CATEGORY_START + 4, "Operation does not apply to binary file") /*### SVN_PROP_EXTERNALS needed to be replaced with "svn:externals" in order to get gettext translatable strings */ SVN_ERRDEF(SVN_ERR_CLIENT_INVALID_EXTERNALS_DESCRIPTION, SVN_ERR_CLIENT_CATEGORY_START + 5, "Format of an svn:externals property was invalid") SVN_ERRDEF(SVN_ERR_CLIENT_MODIFIED, SVN_ERR_CLIENT_CATEGORY_START + 6, "Attempting restricted operation for modified resource") SVN_ERRDEF(SVN_ERR_CLIENT_IS_DIRECTORY, SVN_ERR_CLIENT_CATEGORY_START + 7, "Operation does not apply to directory") SVN_ERRDEF(SVN_ERR_CLIENT_REVISION_RANGE, SVN_ERR_CLIENT_CATEGORY_START + 8, "Revision range is not allowed") SVN_ERRDEF(SVN_ERR_CLIENT_INVALID_RELOCATION, SVN_ERR_CLIENT_CATEGORY_START + 9, "Inter-repository relocation not allowed") SVN_ERRDEF(SVN_ERR_CLIENT_REVISION_AUTHOR_CONTAINS_NEWLINE, SVN_ERR_CLIENT_CATEGORY_START + 10, "Author name cannot contain a newline") SVN_ERRDEF(SVN_ERR_CLIENT_PROPERTY_NAME, SVN_ERR_CLIENT_CATEGORY_START + 11, "Bad property name") /** @since New in 1.1. */ SVN_ERRDEF(SVN_ERR_CLIENT_UNRELATED_RESOURCES, SVN_ERR_CLIENT_CATEGORY_START + 12, "Two versioned resources are unrelated") /** @since New in 1.2. */ SVN_ERRDEF(SVN_ERR_CLIENT_MISSING_LOCK_TOKEN, SVN_ERR_CLIENT_CATEGORY_START + 13, "Path has no lock token") /** @since New in 1.5. */ SVN_ERRDEF(SVN_ERR_CLIENT_MULTIPLE_SOURCES_DISALLOWED, SVN_ERR_CLIENT_CATEGORY_START + 14, "Operation does not support multiple sources") /** @since New in 1.5. */ SVN_ERRDEF(SVN_ERR_CLIENT_NO_VERSIONED_PARENT, SVN_ERR_CLIENT_CATEGORY_START + 15, "No versioned parent directories") /** @since New in 1.5. */ SVN_ERRDEF(SVN_ERR_CLIENT_NOT_READY_TO_MERGE, SVN_ERR_CLIENT_CATEGORY_START + 16, "Working copy and merge source not ready for reintegration") /** @since New in 1.6. */ SVN_ERRDEF(SVN_ERR_CLIENT_FILE_EXTERNAL_OVERWRITE_VERSIONED, SVN_ERR_CLIENT_CATEGORY_START + 17, "A file external cannot overwrite an existing versioned item") /* misc errors */ SVN_ERRDEF(SVN_ERR_BASE, SVN_ERR_MISC_CATEGORY_START + 0, "A problem occurred; see other errors for details") SVN_ERRDEF(SVN_ERR_PLUGIN_LOAD_FAILURE, SVN_ERR_MISC_CATEGORY_START + 1, "Failure loading plugin") SVN_ERRDEF(SVN_ERR_MALFORMED_FILE, SVN_ERR_MISC_CATEGORY_START + 2, "Malformed file") SVN_ERRDEF(SVN_ERR_INCOMPLETE_DATA, SVN_ERR_MISC_CATEGORY_START + 3, "Incomplete data") SVN_ERRDEF(SVN_ERR_INCORRECT_PARAMS, SVN_ERR_MISC_CATEGORY_START + 4, "Incorrect parameters given") SVN_ERRDEF(SVN_ERR_UNVERSIONED_RESOURCE, SVN_ERR_MISC_CATEGORY_START + 5, "Tried a versioning operation on an unversioned resource") SVN_ERRDEF(SVN_ERR_TEST_FAILED, SVN_ERR_MISC_CATEGORY_START + 6, "Test failed") SVN_ERRDEF(SVN_ERR_UNSUPPORTED_FEATURE, SVN_ERR_MISC_CATEGORY_START + 7, "Trying to use an unsupported feature") SVN_ERRDEF(SVN_ERR_BAD_PROP_KIND, SVN_ERR_MISC_CATEGORY_START + 8, "Unexpected or unknown property kind") SVN_ERRDEF(SVN_ERR_ILLEGAL_TARGET, SVN_ERR_MISC_CATEGORY_START + 9, "Illegal target for the requested operation") SVN_ERRDEF(SVN_ERR_DELTA_MD5_CHECKSUM_ABSENT, SVN_ERR_MISC_CATEGORY_START + 10, "MD5 checksum is missing") SVN_ERRDEF(SVN_ERR_DIR_NOT_EMPTY, SVN_ERR_MISC_CATEGORY_START + 11, "Directory needs to be empty but is not") SVN_ERRDEF(SVN_ERR_EXTERNAL_PROGRAM, SVN_ERR_MISC_CATEGORY_START + 12, "Error calling external program") SVN_ERRDEF(SVN_ERR_SWIG_PY_EXCEPTION_SET, SVN_ERR_MISC_CATEGORY_START + 13, "Python exception has been set with the error") SVN_ERRDEF(SVN_ERR_CHECKSUM_MISMATCH, SVN_ERR_MISC_CATEGORY_START + 14, "A checksum mismatch occurred") SVN_ERRDEF(SVN_ERR_CANCELLED, SVN_ERR_MISC_CATEGORY_START + 15, "The operation was interrupted") SVN_ERRDEF(SVN_ERR_INVALID_DIFF_OPTION, SVN_ERR_MISC_CATEGORY_START + 16, "The specified diff option is not supported") SVN_ERRDEF(SVN_ERR_PROPERTY_NOT_FOUND, SVN_ERR_MISC_CATEGORY_START + 17, "Property not found") SVN_ERRDEF(SVN_ERR_NO_AUTH_FILE_PATH, SVN_ERR_MISC_CATEGORY_START + 18, "No auth file path available") /** @since New in 1.1. */ SVN_ERRDEF(SVN_ERR_VERSION_MISMATCH, SVN_ERR_MISC_CATEGORY_START + 19, "Incompatible library version") /** @since New in 1.5. */ SVN_ERRDEF(SVN_ERR_MERGEINFO_PARSE_ERROR, SVN_ERR_MISC_CATEGORY_START + 20, "Mergeinfo parse error") /** @since New in 1.5. */ SVN_ERRDEF(SVN_ERR_CEASE_INVOCATION, SVN_ERR_MISC_CATEGORY_START + 21, "Cease invocation of this API") /** @since New in 1.5. */ SVN_ERRDEF(SVN_ERR_REVNUM_PARSE_FAILURE, SVN_ERR_MISC_CATEGORY_START + 22, "Error parsing revision number") /** @since New in 1.5. */ SVN_ERRDEF(SVN_ERR_ITER_BREAK, SVN_ERR_MISC_CATEGORY_START + 23, "Iteration terminated before completion") /** @since New in 1.5. */ SVN_ERRDEF(SVN_ERR_UNKNOWN_CHANGELIST, SVN_ERR_MISC_CATEGORY_START + 24, "Unknown changelist") /** @since New in 1.5. */ SVN_ERRDEF(SVN_ERR_RESERVED_FILENAME_SPECIFIED, SVN_ERR_MISC_CATEGORY_START + 25, "Reserved directory name in command line arguments") /** @since New in 1.5. */ SVN_ERRDEF(SVN_ERR_UNKNOWN_CAPABILITY, SVN_ERR_MISC_CATEGORY_START + 26, "Inquiry about unknown capability") /** @since New in 1.6. */ SVN_ERRDEF(SVN_ERR_TEST_SKIPPED, SVN_ERR_MISC_CATEGORY_START + 27, "Test skipped") /** @since New in 1.6. */ SVN_ERRDEF(SVN_ERR_NO_APR_MEMCACHE, SVN_ERR_MISC_CATEGORY_START + 28, "apr memcache library not available") /** @since New in 1.6. */ SVN_ERRDEF(SVN_ERR_ATOMIC_INIT_FAILURE, SVN_ERR_MISC_CATEGORY_START + 29, "Couldn't perform atomic initialization") /** @since New in 1.6. */ SVN_ERRDEF(SVN_ERR_SQLITE_ERROR, SVN_ERR_MISC_CATEGORY_START + 30, "SQLite error") /** @since New in 1.6. */ SVN_ERRDEF(SVN_ERR_SQLITE_READONLY, SVN_ERR_MISC_CATEGORY_START + 31, "Attempted to write to readonly SQLite db") /** @since New in 1.6. */ SVN_ERRDEF(SVN_ERR_SQLITE_UNSUPPORTED_SCHEMA, SVN_ERR_MISC_CATEGORY_START + 32, "Unsupported schema found in SQLite db") /* command-line client errors */ SVN_ERRDEF(SVN_ERR_CL_ARG_PARSING_ERROR, SVN_ERR_CL_CATEGORY_START + 0, "Error parsing arguments") SVN_ERRDEF(SVN_ERR_CL_INSUFFICIENT_ARGS, SVN_ERR_CL_CATEGORY_START + 1, "Not enough arguments provided") SVN_ERRDEF(SVN_ERR_CL_MUTUALLY_EXCLUSIVE_ARGS, SVN_ERR_CL_CATEGORY_START + 2, "Mutually exclusive arguments specified") SVN_ERRDEF(SVN_ERR_CL_ADM_DIR_RESERVED, SVN_ERR_CL_CATEGORY_START + 3, "Attempted command in administrative dir") SVN_ERRDEF(SVN_ERR_CL_LOG_MESSAGE_IS_VERSIONED_FILE, SVN_ERR_CL_CATEGORY_START + 4, "The log message file is under version control") SVN_ERRDEF(SVN_ERR_CL_LOG_MESSAGE_IS_PATHNAME, SVN_ERR_CL_CATEGORY_START + 5, "The log message is a pathname") SVN_ERRDEF(SVN_ERR_CL_COMMIT_IN_ADDED_DIR, SVN_ERR_CL_CATEGORY_START + 6, "Committing in directory scheduled for addition") SVN_ERRDEF(SVN_ERR_CL_NO_EXTERNAL_EDITOR, SVN_ERR_CL_CATEGORY_START + 7, "No external editor available") SVN_ERRDEF(SVN_ERR_CL_BAD_LOG_MESSAGE, SVN_ERR_CL_CATEGORY_START + 8, "Something is wrong with the log message's contents") SVN_ERRDEF(SVN_ERR_CL_UNNECESSARY_LOG_MESSAGE, SVN_ERR_CL_CATEGORY_START + 9, "A log message was given where none was necessary") SVN_ERRDEF(SVN_ERR_CL_NO_EXTERNAL_MERGE_TOOL, SVN_ERR_CL_CATEGORY_START + 10, "No external merge tool available") /* malfunctions such as assertion failures */ SVN_ERRDEF(SVN_ERR_ASSERTION_FAIL, SVN_ERR_MALFUNC_CATEGORY_START + 0, "Assertion failure") SVN_ERROR_END #undef SVN_ERROR_START #undef SVN_ERRDEF #undef SVN_ERROR_END #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* defined(SVN_ERROR_BUILD_ARRAY) || !defined(SVN_ERROR_ENUM_DEFINED) */ 0707010002c667000081a40000000000000000000000014cb50d8e000342320000010000010036ffffffffffffffff0000002d00000000root/usr/local/include/subversion-1/svn_wc.h/** * @copyright * ==================================================================== * Copyright (c) 2000-2008 CollabNet. All rights reserved. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://subversion.tigris.org/license-1.html. * If newer versions of this license are posted there, you may use a * newer version instead, at your option. * * This software consists of voluntary contributions made by many * individuals. For exact contribution history, see the revision * history and logs, available at http://subversion.tigris.org/. * ==================================================================== * @endcopyright * * @file svn_wc.h * @brief Subversion's working copy library * * Requires: * - A working copy * * Provides: * - Ability to manipulate working copy's versioned data. * - Ability to manipulate working copy's administrative files. * * Used By: * - Clients. * * Notes: * The 'path' parameters to most of these functions can be * absolute or relative (relative to current working * directory). If there are any cases where they are * relative to the path associated with the * 'svn_wc_adm_access_t *adm_access' baton passed along * with the path, those cases should be explicitly * documented, and if they are not, please fix it. */ #ifndef SVN_WC_H #define SVN_WC_H #include #include #include #include #include #include #include "svn_types.h" #include "svn_string.h" #include "svn_checksum.h" #include "svn_io.h" #include "svn_delta.h" /* for svn_stream_t */ #include "svn_opt.h" #include "svn_ra.h" /* for svn_ra_reporter_t type */ #include "svn_version.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * Get libsvn_wc version information. * * @since New in 1.1. */ const svn_version_t * svn_wc_version(void); /** * @defgroup svn_wc Working copy management * @{ */ /** Flags for use with svn_wc_translated_file2 * * @defgroup translate_flags Translation flags * * @{ */ /** Translate from Normal Form. * * The working copy text bases and repository files are stored * in normal form. Some files' contents - or ever representation - * differs between the working copy and the normal form. This flag * specifies to take the latter form as input and transform it * to the former. * * Either this flag or @c SVN_WC_TRANSLATE_TO_NF should be specified, * but not both. */ #define SVN_WC_TRANSLATE_FROM_NF 0x00000000 /** Translate to Normal Form. * * Either this flag or @c SVN_WC_TRANSLATE_FROM_NF should be specified, * but not both. */ #define SVN_WC_TRANSLATE_TO_NF 0x00000001 /** Force repair of eol styles, making sure the output file consistently * contains the one eol style as specified by the svn:eol-style * property and the required translation direction. * */ #define SVN_WC_TRANSLATE_FORCE_EOL_REPAIR 0x00000002 /** Don't register a pool cleanup to delete the output file */ #define SVN_WC_TRANSLATE_NO_OUTPUT_CLEANUP 0x00000004 /** Guarantee a new file is created on successful return. * The default shortcuts translation by returning the path * of the untranslated file when no translation is required. */ #define SVN_WC_TRANSLATE_FORCE_COPY 0x00000008 /** Use a non-wc-local tmp directory for creating output files, * instead of in the working copy admin tmp area which is the default. * * @since New in 1.4. */ #define SVN_WC_TRANSLATE_USE_GLOBAL_TMP 0x00000010 /** @} */ /* Locking/Opening/Closing */ /** Baton for access to a working copy administrative area. * * One day all such access will require a baton, we're not there yet. * * Access batons can be grouped into sets, by passing an existing open * baton when opening a new baton. Given one baton in a set, other batons * may be retrieved. This allows an entire hierarchy to be locked, and * then the set of batons can be passed around by passing a single baton. */ typedef struct svn_wc_adm_access_t svn_wc_adm_access_t; /** * Return, in @a *adm_access, a pointer to a new access baton for the working * copy administrative area associated with the directory @a path. If * @a write_lock is TRUE the baton will include a write lock, otherwise the * baton can only be used for read access. If @a path refers to a directory * that is already write locked then the error @c SVN_ERR_WC_LOCKED will be * returned. The error @c SVN_ERR_WC_NOT_DIRECTORY will be returned if * @a path is not a versioned directory. * * If @a associated is an open access baton then @a adm_access will be added * to the set containing @a associated. @a associated can be @c NULL, in * which case @a adm_access is the start of a new set. * * @a levels_to_lock specifies how far to lock. Zero means just the specified * directory. Any negative value means to lock the entire working copy * directory hierarchy under @a path. A positive value indicates the number of * levels of directories to lock -- 1 means just immediate subdirectories, 2 * means immediate subdirectories and their subdirectories, etc. All the * access batons will become part of the set containing @a adm_access. This * is an all-or-nothing option, if it is not possible to lock all the * requested directories then an error will be returned and @a adm_access will * be invalid, with the exception that subdirectories of @a path that are * missing from the physical filesystem will not be locked and will not cause * an error. The error @c SVN_ERR_WC_LOCKED will be returned if a * subdirectory of @a path is already write locked. * * If @a cancel_func is non-NULL, call it with @a cancel_baton to determine * if the client has cancelled the operation. * * @a pool will be used to allocate memory for the baton and any subsequently * cached items. If @a adm_access has not been closed when the pool is * cleared, it will be closed automatically at that point, and removed from * its set. A baton closed in this way will not remove physical locks from * the working copy if cleanup is required. * * The first baton in a set, with @a associated passed as @c NULL, must have * the longest lifetime of all the batons in the set. This implies it must be * the root of the hierarchy. * * @since New in 1.2. */ svn_error_t * svn_wc_adm_open3(svn_wc_adm_access_t **adm_access, svn_wc_adm_access_t *associated, const char *path, svn_boolean_t write_lock, int levels_to_lock, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool); /** * Similar to svn_wc_adm_open3(), but without cancellation support. * * @deprecated Provided for backward compatibility with the 1.1 API. */ SVN_DEPRECATED svn_error_t * svn_wc_adm_open2(svn_wc_adm_access_t **adm_access, svn_wc_adm_access_t *associated, const char *path, svn_boolean_t write_lock, int levels_to_lock, apr_pool_t *pool); /** * Similar to svn_wc_adm_open2(), but with @a tree_lock instead of * @a levels_to_lock. @a levels_to_lock is set to -1 if @a tree_lock * is @c TRUE, else 0. * * @deprecated Provided for backward compatibility with the 1.0 API. */ SVN_DEPRECATED svn_error_t * svn_wc_adm_open(svn_wc_adm_access_t **adm_access, svn_wc_adm_access_t *associated, const char *path, svn_boolean_t write_lock, svn_boolean_t tree_lock, apr_pool_t *pool); /** * Checks the working copy to determine the node type of @a path. If * @a path is a versioned directory then the behaviour is like that of * svn_wc_adm_open3(), otherwise, if @a path is a file or does not * exist, then the behaviour is like that of svn_wc_adm_open3() with * @a path replaced by the parent directory of @a path. If @a path is * an unversioned directory, the behaviour is also like that of * svn_wc_adm_open3() on the parent, except that if the open fails, * then the returned SVN_ERR_WC_NOT_DIRECTORY error refers to @a path, * not to @a path's parent. * * @since New in 1.2. */ svn_error_t * svn_wc_adm_probe_open3(svn_wc_adm_access_t **adm_access, svn_wc_adm_access_t *associated, const char *path, svn_boolean_t write_lock, int levels_to_lock, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool); /** * Similar to svn_wc_adm_probe_open3() without the cancel * functionality. * * @deprecated Provided for backward compatibility with the 1.1 API. */ SVN_DEPRECATED svn_error_t * svn_wc_adm_probe_open2(svn_wc_adm_access_t **adm_access, svn_wc_adm_access_t *associated, const char *path, svn_boolean_t write_lock, int levels_to_lock, apr_pool_t *pool); /** * Similar to svn_wc_adm_probe_open2(), but with @a tree_lock instead of * @a levels_to_lock. @a levels_to_lock is set to -1 if @a tree_lock * is @c TRUE, else 0. * * @deprecated Provided for backward compatibility with the 1.0 API. */ SVN_DEPRECATED svn_error_t * svn_wc_adm_probe_open(svn_wc_adm_access_t **adm_access, svn_wc_adm_access_t *associated, const char *path, svn_boolean_t write_lock, svn_boolean_t tree_lock, apr_pool_t *pool); /** * Open access batons for @a path and return in @a *anchor_access and * @a *target the anchor and target required to drive an editor. Return * in @a *target_access the access baton for the target, which may be the * same as @a *anchor_access (in which case @a *target is the empty * string, never NULL). All the access batons will be in the * @a *anchor_access set. * * @a levels_to_lock determines the levels_to_lock used when opening * @a path if @a path is a versioned directory, @a levels_to_lock is * ignored otherwise. If @a write_lock is @c TRUE the access batons * will hold write locks. * * If @a cancel_func is non-NULL, call it with @a cancel_baton to determine * if the client has cancelled the operation. * * This function is essentially a combination of svn_wc_adm_open3() and * svn_wc_get_actual_target(), with the emphasis on reducing physical IO. * * @since New in 1.2. */ svn_error_t * svn_wc_adm_open_anchor(svn_wc_adm_access_t **anchor_access, svn_wc_adm_access_t **target_access, const char **target, const char *path, svn_boolean_t write_lock, int levels_to_lock, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool); /** Return, in @a *adm_access, a pointer to an existing access baton associated * with @a path. @a path must be a directory that is locked as part of the * set containing the @a associated access baton. * * If the requested access baton is marked as missing in, or is simply * absent from, @a associated, return SVN_ERR_WC_NOT_LOCKED. * * @a pool is used only for local processing, it is not used for the batons. */ svn_error_t * svn_wc_adm_retrieve(svn_wc_adm_access_t **adm_access, svn_wc_adm_access_t *associated, const char *path, apr_pool_t *pool); /** Check the working copy to determine the node type of @a path. If * @a path is a versioned directory then the behaviour is like that of * svn_wc_adm_retrieve(), otherwise, if @a path is a file, an unversioned * directory, or does not exist, then the behaviour is like that of * svn_wc_adm_retrieve() with @a path replaced by the parent directory of * @a path. */ svn_error_t * svn_wc_adm_probe_retrieve(svn_wc_adm_access_t **adm_access, svn_wc_adm_access_t *associated, const char *path, apr_pool_t *pool); /** * Try various ways to obtain an access baton for @a path. * * First, try to obtain @a *adm_access via svn_wc_adm_probe_retrieve(), * but if this fails because @a associated can't give a baton for * @a path or @a path's parent, then try svn_wc_adm_probe_open3(), * this time passing @a write_lock and @a levels_to_lock. If there is * still no access because @a path is not a versioned directory, then * just set @a *adm_access to NULL and return success. But if it is * because @a path is locked, then return the error @c SVN_ERR_WC_LOCKED, * and the effect on @a *adm_access is undefined. (Or if the attempt * fails for any other reason, return the corresponding error, and the * effect on @a *adm_access is also undefined.) * * If svn_wc_adm_probe_open3() succeeds, then add @a *adm_access to * @a associated. * * If @a cancel_func is non-NULL, call it with @a cancel_baton to determine * if the client has cancelled the operation. * * Use @a pool only for local processing, not to allocate @a *adm_access. * * @since New in 1.2. */ svn_error_t * svn_wc_adm_probe_try3(svn_wc_adm_access_t **adm_access, svn_wc_adm_access_t *associated, const char *path, svn_boolean_t write_lock, int levels_to_lock, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool); /** * Similar to svn_wc_adm_probe_try3() without the cancel * functionality. * * @deprecated Provided for backward compatibility with the 1.1 API. */ SVN_DEPRECATED svn_error_t * svn_wc_adm_probe_try2(svn_wc_adm_access_t **adm_access, svn_wc_adm_access_t *associated, const char *path, svn_boolean_t write_lock, int levels_to_lock, apr_pool_t *pool); /** * Similar to svn_wc_adm_probe_try2(), but with @a tree_lock instead of * @a levels_to_lock. @a levels_to_lock is set to -1 if @a tree_lock * is @c TRUE, else 0. * * @deprecated Provided for backward compatibility with the 1.0 API. */ SVN_DEPRECATED svn_error_t * svn_wc_adm_probe_try(svn_wc_adm_access_t **adm_access, svn_wc_adm_access_t *associated, const char *path, svn_boolean_t write_lock, svn_boolean_t tree_lock, apr_pool_t *pool); /** Give up the access baton @a adm_access, and its lock if any. This will * recursively close any batons in the same set that are direct * subdirectories of @a adm_access. Any physical locks will be removed from * the working copy. Lock removal is unconditional, there is no check to * determine if cleanup is required. * * Any temporary allocations are performed using @a scratch_pool. * * @since New in 1.6 */ svn_error_t * svn_wc_adm_close2(svn_wc_adm_access_t *adm_access, apr_pool_t *scratch_pool); /* @deprecated Provided for backward compabibility with the 1.5 API. */ SVN_DEPRECATED svn_error_t * svn_wc_adm_close(svn_wc_adm_access_t *adm_access); /** Return the path used to open the access baton @a adm_access */ const char * svn_wc_adm_access_path(const svn_wc_adm_access_t *adm_access); /** Return the pool used by access baton @a adm_access */ apr_pool_t * svn_wc_adm_access_pool(const svn_wc_adm_access_t *adm_access); /** Return @c TRUE is the access baton @a adm_access has a write lock, * @c FALSE otherwise. Compared to svn_wc_locked() this is a cheap, fast * function that doesn't access the filesystem. */ svn_boolean_t svn_wc_adm_locked(const svn_wc_adm_access_t *adm_access); /** Set @a *locked to non-zero if @a path is locked, else set it to zero. */ svn_error_t * svn_wc_locked(svn_boolean_t *locked, const char *path, apr_pool_t *pool); /** * Return @c TRUE if @a name is the name of the WC administrative * directory. Use @a pool for any temporary allocations. Only works * with base directory names, not paths or URIs. * * For compatibility, the default name (.svn) will always be treated * as an admin dir name, even if the working copy is actually using an * alternative name. * * @since New in 1.3. */ svn_boolean_t svn_wc_is_adm_dir(const char *name, apr_pool_t *pool); /** * Return the name of the administrative directory. * Use @a pool for any temporary allocations. * * The returned pointer will refer to either a statically allocated * string, or to a string allocated in @a pool. * * @since New in 1.3. */ const char * svn_wc_get_adm_dir(apr_pool_t *pool); /** * Use @a name for the administrative directory in the working copy. * Use @a pool for any temporary allocations. * * The list of valid names is limited. Currently only ".svn" (the * default) and "_svn" are allowed. * * @note This function changes global (per-process) state and must be * called in a single-threaded context during the initialization of a * Subversion client. * * @since New in 1.3. */ svn_error_t * svn_wc_set_adm_dir(const char *name, apr_pool_t *pool); /** Traversal information is information gathered by a working copy * crawl or update. For example, the before and after values of the * svn:externals property are important after an update, and since * we're traversing the working tree anyway (a complete traversal * during the initial crawl, and a traversal of changed paths during * the checkout/update/switch), it makes sense to gather the * property's values then instead of making a second pass. */ typedef struct svn_wc_traversal_info_t svn_wc_traversal_info_t; /** Return a new, empty traversal info object, allocated in @a pool. */ svn_wc_traversal_info_t * svn_wc_init_traversal_info(apr_pool_t *pool); /** Set @a *externals_old and @a *externals_new to hash tables representing * changes to values of the svn:externals property on directories * traversed by @a traversal_info. * * @a traversal_info is obtained from svn_wc_init_traversal_info(), but is * only useful after it has been passed through another function, such * as svn_wc_crawl_revisions(), svn_wc_get_update_editor(), * svn_wc_get_switch_editor(), etc. * * Each hash maps const char * directory names onto * const char * values of the externals property for that directory. * The dir names are full paths -- that is, anchor plus target, not target * alone. The values are not parsed, they are simply copied raw, and are * never NULL: directories that acquired or lost the property are * simply omitted from the appropriate table. Directories whose value * of the property did not change show the same value in each hash. * * The hashes, keys, and values have the same lifetime as @a traversal_info. */ void svn_wc_edited_externals(apr_hash_t **externals_old, apr_hash_t **externals_new, svn_wc_traversal_info_t *traversal_info); /** Set @a *depths to a hash table mapping const char * * directory names (directories traversed by @a traversal_info) to * const char * values (the depths of those directories, as * converted by svn_depth_to_word()). * * @a traversal_info is obtained from svn_wc_init_traversal_info(), but is * only useful after it has been passed through another function, such * as svn_wc_crawl_revisions(), svn_wc_get_update_editor(), * svn_wc_get_switch_editor(), etc. * * The dir names are full paths -- that is, anchor plus target, not target * alone. The values are not allocated, they are static constant strings. * Although the values are never NULL, not all directories traversed * are necessarily listed. For example, directories which did not * have an svn:externals property set or modified are not included. * * The hashes and keys have the same lifetime as @a traversal_info. * * @since New in 1.5. */ void svn_wc_traversed_depths(apr_hash_t **depths, svn_wc_traversal_info_t *traversal_info); /** One external item. This usually represents one line from an * svn:externals description but with the path and URL * canonicalized. * * In order to avoid backwards compatibility problems clients should use * svn_wc_external_item_create() to allocate and initialize this structure * instead of doing so themselves. * * @since New in 1.5. */ typedef struct svn_wc_external_item2_t { /** The name of the subdirectory into which this external should be checked out. This is relative to the parent directory that holds this external item. (Note that these structs are often stored in hash tables with the target dirs as keys, so this field will often be redundant.) */ const char *target_dir; /** Where to check out from. */ const char *url; /** What revision to check out. The only valid kinds for this are svn_opt_revision_number, svn_opt_revision_date, and svn_opt_revision_head. */ svn_opt_revision_t revision; /** The peg revision to use when checking out. The only valid kinds are svn_opt_revision_number, svn_opt_revision_date, and svn_opt_revision_head. */ svn_opt_revision_t peg_revision; } svn_wc_external_item2_t; /** * Initialize an external item. * Set @a *item to an external item object, allocated in @a pool. * * In order to avoid backwards compatibility problems, this function * is used to initialize and allocate the @c svn_wc_external_item2_t * structure rather than doing so explicitly, as the size of this * structure may change in the future. * * The current implementation never returns error, but callers should * still check for error, for compatibility with future versions. * * @since New in 1.5. */ svn_error_t * svn_wc_external_item_create(const svn_wc_external_item2_t **item, apr_pool_t *pool); /** * Return a duplicate of @a item, allocated in @a pool. No part of the new * item will be shared with @a item. * * @since New in 1.5. */ svn_wc_external_item2_t * svn_wc_external_item2_dup(const svn_wc_external_item2_t *item, apr_pool_t *pool); /** * One external item. Similar to svn_wc_external_item2_t, except * @a revision is interpreted as both the operational revision and the * peg revision. * * @deprecated Provided for backward compatibility with the 1.4 API. */ typedef struct svn_wc_external_item_t { /** Same as @c svn_wc_external_item2_t.target_dir */ const char *target_dir; /** Same as @c svn_wc_external_item2_t.url */ const char *url; /** Same as @c svn_wc_external_item2_t.revision */ svn_opt_revision_t revision; } svn_wc_external_item_t; /** * Return a duplicate of @a item, allocated in @a pool. No part of the new * item will be shared with @a item. * * @since New in 1.3. * * @deprecated Provided for backward compatibility with the 1.4 API. */ SVN_DEPRECATED svn_wc_external_item_t * svn_wc_external_item_dup(const svn_wc_external_item_t *item, apr_pool_t *pool); /** * If @a externals_p is non-NULL, set @a *externals_p to an array of * @c svn_wc_external_item2_t * objects based on @a desc. The @a url * member of the objects will be canonicalized if @a canonicalize_url * is @c TRUE. * * If the format of @a desc is invalid, don't touch @a *externals_p and * return @c SVN_ERR_CLIENT_INVALID_EXTERNALS_DESCRIPTION. Thus, if * you just want to check the validity of an externals description, * and don't care about the parsed result, pass NULL for @a externals_p. * * The format of @a desc is the same as for values of the directory * property @c SVN_PROP_EXTERNALS, which see. * * Allocate the table, keys, and values in @a pool. * * Use @a parent_directory only in constructing error strings. * * @since New in 1.5. */ svn_error_t * svn_wc_parse_externals_description3(apr_array_header_t **externals_p, const char *parent_directory, const char *desc, svn_boolean_t canonicalize_url, apr_pool_t *pool); /** * Similar to svn_wc_parse_externals_description3() with @a * canonicalize_url set to @c TRUE, but returns an array of @c * svn_wc_external_item_t * objects instead of @c * svn_wc_external_item2_t * objects * * @since New in 1.1. * * @deprecated Provided for backward compatibility with the 1.4 API. */ SVN_DEPRECATED svn_error_t * svn_wc_parse_externals_description2(apr_array_header_t **externals_p, const char *parent_directory, const char *desc, apr_pool_t *pool); /** * Similar to svn_wc_parse_externals_description2(), but returns the * parsed externals in a hash instead of an array. This function * should not be used, as storing the externals in a hash causes their * order of evaluation to be not easily identifiable. * * @deprecated Provided for backward compatibility with the 1.0 API. */ SVN_DEPRECATED svn_error_t * svn_wc_parse_externals_description(apr_hash_t **externals_p, const char *parent_directory, const char *desc, apr_pool_t *pool); /* Notification/callback handling. */ /** * @defgroup svn_wc_notifications Notification callback handling * @{ * * In many cases, the WC library will scan a working copy and make * changes. The caller usually wants to know when each of these changes * has been made, so that it can display some kind of notification to * the user. * * These notifications have a standard callback function type, which * takes the path of the file that was affected, and a caller- * supplied baton. * * Note that the callback is a 'void' return -- this is a simple * reporting mechanism, rather than an opportunity for the caller to * alter the operation of the WC library. * * Note also that some of the actions are used across several * different Subversion commands. For example, the update actions are * also used for checkouts, switches, and merges. */ /** The type of action occurring. */ typedef enum svn_wc_notify_action_t { /** Adding a path to revision control. */ svn_wc_notify_add = 0, /** Copying a versioned path. */ svn_wc_notify_copy, /** Deleting a versioned path. */ svn_wc_notify_delete, /** Restoring a missing path from the pristine text-base. */ svn_wc_notify_restore, /** Reverting a modified path. */ svn_wc_notify_revert, /** A revert operation has failed. */ svn_wc_notify_failed_revert, /** Resolving a conflict. */ svn_wc_notify_resolved, /** Skipping a path. */ svn_wc_notify_skip, /** Got a delete in an update. */ svn_wc_notify_update_delete, /** Got an add in an update. */ svn_wc_notify_update_add, /** Got any other action in an update. */ svn_wc_notify_update_update, /** The last notification in an update (including updates of externals). */ svn_wc_notify_update_completed, /** Updating an external module. */ svn_wc_notify_update_external, /** The last notification in a status (including status on externals). */ svn_wc_notify_status_completed, /** Running status on an external module. */ svn_wc_notify_status_external, /** Committing a modification. */ svn_wc_notify_commit_modified, /** Committing an addition. */ svn_wc_notify_commit_added, /** Committing a deletion. */ svn_wc_notify_commit_deleted, /** Committing a replacement. */ svn_wc_notify_commit_replaced, /** Transmitting post-fix text-delta data for a file. */ svn_wc_notify_commit_postfix_txdelta, /** Processed a single revision's blame. */ svn_wc_notify_blame_revision, /** Locking a path. @since New in 1.2. */ svn_wc_notify_locked, /** Unlocking a path. @since New in 1.2. */ svn_wc_notify_unlocked, /** Failed to lock a path. @since New in 1.2. */ svn_wc_notify_failed_lock, /** Failed to unlock a path. @since New in 1.2. */ svn_wc_notify_failed_unlock, /** Tried adding a path that already exists. @since New in 1.5. */ svn_wc_notify_exists, /** Changelist name set. @since New in 1.5. */ svn_wc_notify_changelist_set, /** Changelist name cleared. @since New in 1.5. */ svn_wc_notify_changelist_clear, /** Warn user that a path has moved from one changelist to another. @since New in 1.5. */ svn_wc_notify_changelist_moved, /** A merge operation (to path) has begun. See @c merge_range in @c svn_wc_notify_t. @since New in 1.5. */ svn_wc_notify_merge_begin, /** A merge operation (to path) from a foreign repository has begun. See @c merge_range in @c svn_wc_notify_t. @since New in 1.5. */ svn_wc_notify_foreign_merge_begin, /** Replace notification. @since New in 1.5. */ svn_wc_notify_update_replace, /** Property added. @since New in 1.6. */ svn_wc_notify_property_added, /** Property updated. @since New in 1.6. */ svn_wc_notify_property_modified, /** Property deleted. @since New in 1.6. */ svn_wc_notify_property_deleted, /** Nonexistent property deleted. @since New in 1.6. */ svn_wc_notify_property_deleted_nonexistent, /** Revprop set. @since New in 1.6. */ svn_wc_notify_revprop_set, /** Revprop deleted. @since New in 1.6. */ svn_wc_notify_revprop_deleted, /** The last notification in a merge. @since New in 1.6. */ svn_wc_notify_merge_completed, /** The path is a tree-conflict victim of the intended action (*not* * a persistent tree-conflict from an earlier operation, but *this* * operation caused the tree-conflict). @since New in 1.6. */ svn_wc_notify_tree_conflict, /** The path is a subdirectory referenced in an externals definition * which is unable to be operated on. @since New in 1.6. */ svn_wc_notify_failed_external } svn_wc_notify_action_t; /** The type of notification that is occurring. */ typedef enum svn_wc_notify_state_t { svn_wc_notify_state_inapplicable = 0, /** Notifier doesn't know or isn't saying. */ svn_wc_notify_state_unknown, /** The state did not change. */ svn_wc_notify_state_unchanged, /** The item wasn't present. */ svn_wc_notify_state_missing, /** An unversioned item obstructed work. */ svn_wc_notify_state_obstructed, /** Pristine state was modified. */ svn_wc_notify_state_changed, /** Modified state had mods merged in. */ svn_wc_notify_state_merged, /** Modified state got conflicting mods. */ svn_wc_notify_state_conflicted } svn_wc_notify_state_t; /** * What happened to a lock during an operation. * * @since New in 1.2. */ typedef enum svn_wc_notify_lock_state_t { svn_wc_notify_lock_state_inapplicable = 0, svn_wc_notify_lock_state_unknown, /** The lock wasn't changed. */ svn_wc_notify_lock_state_unchanged, /** The item was locked. */ svn_wc_notify_lock_state_locked, /** The item was unlocked. */ svn_wc_notify_lock_state_unlocked } svn_wc_notify_lock_state_t; /** * Structure used in the @c svn_wc_notify_func2_t function. * * @c kind, @c content_state, @c prop_state and @c lock_state are from * after @c action, not before. * * @note If @c action is @c svn_wc_notify_update, then @c path has * already been installed, so it is legitimate for an implementation of * @c svn_wc_notify_func2_t to examine @c path in the working copy. * * @note The purpose of the @c kind, @c mime_type, @c content_state, and * @c prop_state fields is to provide "for free" information that an * implementation is likely to want, and which it would otherwise be * forced to deduce via expensive operations such as reading entries * and properties. However, if the caller does not have this * information, it will simply pass the corresponding `*_unknown' * values, and it is up to the implementation how to handle that * (i.e., whether to attempt deduction, or just to punt and * give a less informative notification). * * @note Callers of notification functions should use svn_wc_create_notify() * or svn_wc_create_notify_url() to create structures of this type to allow * for extensibility. * * @since New in 1.2. */ typedef struct svn_wc_notify_t { /** Path, either absolute or relative to the current working directory * (i.e., not relative to an anchor).@c path is "." or another valid path * value for compatibilty reasons when the real target is an url that * is available in @c url. */ const char *path; /** Action that describes what happened to @c path. */ svn_wc_notify_action_t action; /** Node kind of @c path. */ svn_node_kind_t kind; /** If non-NULL, indicates the mime-type of @c path. * It is always @c NULL for directories. */ const char *mime_type; /** Points to the lock structure received from the repository when * @c action is @c svn_wc_notify_locked. For other actions, it is * @c NULL. */ const svn_lock_t *lock; /** Points to an error describing the reason for the failure when @c * action is one of the following: @c svn_wc_notify_failed_lock, @c * svn_wc_notify_failed_unlock, @c svn_wc_notify_failed_external. * Is @c NULL otherwise. */ svn_error_t *err; /** The type of notification that is occurring about node content. */ svn_wc_notify_state_t content_state; /** The type of notification that is occurring about node properties. */ svn_wc_notify_state_t prop_state; /** Reflects the addition or removal of a lock token in the working copy. */ svn_wc_notify_lock_state_t lock_state; /** When @c action is @c svn_wc_notify_update_completed, target revision * of the update, or @c SVN_INVALID_REVNUM if not available; when @c * action is @c svn_wc_notify_blame_revision, processed revision. * In all other cases, it is @c SVN_INVALID_REVNUM. */ svn_revnum_t revision; /** When @c action is @c svn_wc_notify_changelist_add or name. In all other * cases, it is @c NULL. @since New in 1.5 */ const char *changelist_name; /** When @c action is @c svn_wc_notify_merge_begin, and both the * left and right sides of the merge are from the same URL. In all * other cases, it is @c NULL. @since New in 1.5 */ svn_merge_range_t *merge_range; /** Similar to @c path, but if non-NULL the notification is about a url. * @since New in 1.6 */ const char *url; /** If non-NULL, specifies an absolute path prefix that can be subtracted * from the start of the absolute path in @c path or @c url. Its purpose * is to allow notification to remove a common prefix from all the paths * displayed for an operation. @since New in 1.6 */ const char *path_prefix; /** If @c action relates to properties, specifies the name of the property. * @since New in 1.6 */ const char *prop_name; /** If @c action is @c svn_wc_notify_blame_revision, contains a list of * revision properties for the specified revision */ apr_hash_t *rev_props; /* NOTE: Add new fields at the end to preserve binary compatibility. Also, if you add fields here, you have to update svn_wc_create_notify and svn_wc_dup_notify. */ } svn_wc_notify_t; /** * Allocate an @c svn_wc_notify_t structure in @a pool, initialize and return * it. * * Set the @c path field of the created struct to @a path, and @c action to * @a action. Set all other fields to their @c _unknown, @c NULL or * invalid value, respectively. Make only a shallow copy of the pointer * @a path. * * @since New in 1.2. */ svn_wc_notify_t * svn_wc_create_notify(const char *path, svn_wc_notify_action_t action, apr_pool_t *pool); /** * Allocate an @c svn_wc_notify_t structure in @a pool, initialize and return * it. * * Set the @c url field of the created struct to @a url, @c action to, @c path * to "." and @a action. Set all other fields to their @c _unknown, @c NULL or * invalid value, respectively. Make only a shallow copy of the pointer * @a url. * * @since New in 1.6. */ svn_wc_notify_t * svn_wc_create_notify_url(const char *url, svn_wc_notify_action_t action, apr_pool_t *pool); /** * Return a deep copy of @a notify, allocated in @a pool. * * @since New in 1.2. */ svn_wc_notify_t * svn_wc_dup_notify(const svn_wc_notify_t *notify, apr_pool_t *pool); /** * Notify the world that @a notify->action has happened to @a notify->path. * * Recommendation: callers of @c svn_wc_notify_func2_t should avoid * invoking it multiple times on the same path within a given * operation, and implementations should not bother checking for such * duplicate calls. For example, in an update, the caller should not * invoke the notify func on receiving a prop change and then again * on receiving a text change. Instead, wait until all changes have * been received, and then invoke the notify func once (from within * an @c svn_delta_editor_t's close_file(), for example), passing * the appropriate @a notify->content_state and @a notify->prop_state flags. * * @since New in 1.2. */ typedef void (*svn_wc_notify_func2_t)(void *baton, const svn_wc_notify_t *notify, apr_pool_t *pool); /** * Similar to @c svn_wc_notify_func2_t, but takes the information as arguments * instead of struct fields. * * @deprecated Provided for backward compatibility with the 1.1 API. */ typedef void (*svn_wc_notify_func_t)(void *baton, const char *path, svn_wc_notify_action_t action, svn_node_kind_t kind, const char *mime_type, svn_wc_notify_state_t content_state, svn_wc_notify_state_t prop_state, svn_revnum_t revision); /** @} */ /** * A simple callback type to wrap svn_ra_get_file(); see that * docstring for more information. * * This technique allows libsvn_client to 'wrap' svn_ra_get_file() and * pass it down into libsvn_wc functions, thus allowing the WC layer * to legally call the RA function via (blind) callback. * * @since New in 1.5 */ typedef svn_error_t *(*svn_wc_get_file_t)(void *baton, const char *path, svn_revnum_t revision, svn_stream_t *stream, svn_revnum_t *fetched_rev, apr_hash_t **props, apr_pool_t *pool); /** * Interactive conflict handling * * @defgroup svn_wc_conflict Conflict callback functionality * * @{ * * This API gives a Subversion client application the opportunity to * define a callback that allows the user to resolve conflicts * interactively during updates and merges. * * If a conflict is discovered, libsvn_wc invokes the callback with an * @c svn_wc_conflict_description_t. This structure describes the * path in conflict, whether it's a text or property conflict, and may * also present up to three files that can be used to resolve the * conflict (perhaps by launching an editor or 3rd-party merging * tool). The structure also provides a possible fourth file (@c * merged_file) which, if not NULL, represents libsvn_wc's attempt to * contextually merge the first three files. (Note that libsvn_wc * will not attempt to merge a file that it believes is binary, and it * will only attempt to merge property values it believes to be a * series of multi-line text.) * * When the callback is finished interacting with the user, it * responds by returning a @c svn_wc_conflict_result_t. This * structure indicates whether the user wants to postpone the conflict * for later (allowing libsvn_wc to mark the path "conflicted" as * usual), or whether the user wants libsvn_wc to use one of the four * files as the "final" state for resolving the conflict immediately. * * Note that the callback is at liberty (and encouraged) to merge the * three files itself. If it does so, it signals this to libsvn_wc by * returning a choice of @c svn_wc_conflict_choose_merged. To return * the 'final' merged file to libsvn_wc, the callback has the option of * either: * * - editing the original @c merged_file in-place * * or, if libsvn_wc never supplied a merged_file in the * description structure (i.e. passed NULL for that field), * * - return the merged file in the @c svn_wc_conflict_result_t. * */ /** The type of action being attempted on an object. * * @since New in 1.5. */ typedef enum svn_wc_conflict_action_t { svn_wc_conflict_action_edit, /* attempting to change text or props */ svn_wc_conflict_action_add, /* attempting to add object */ svn_wc_conflict_action_delete /* attempting to delete object */ } svn_wc_conflict_action_t; /** The pre-existing condition which is causing a state of conflict. * * @since New in 1.5. */ typedef enum svn_wc_conflict_reason_t { /** Local edits are already present */ svn_wc_conflict_reason_edited, /** Another object is in the way */ svn_wc_conflict_reason_obstructed, /** Object is already schedule-delete */ svn_wc_conflict_reason_deleted, /** Object is unknown or missing */ svn_wc_conflict_reason_missing, /** Object is unversioned */ svn_wc_conflict_reason_unversioned, /** Object is already added or schedule-add. @since New in 1.6. */ svn_wc_conflict_reason_added } svn_wc_conflict_reason_t; /** The type of conflict being described by an @c * svn_wc_conflict_description_t (see below). * * @since New in 1.5. */ typedef enum svn_wc_conflict_kind_t { /** textual conflict (on a file) */ svn_wc_conflict_kind_text, /** property conflict (on a file or dir) */ svn_wc_conflict_kind_property, /** tree conflict (on a dir) @since New in 1.6. */ svn_wc_conflict_kind_tree } svn_wc_conflict_kind_t; /** The user operation that exposed a conflict. * * @since New in 1.6. */ typedef enum svn_wc_operation_t { svn_wc_operation_none = 0, svn_wc_operation_update, svn_wc_operation_switch, svn_wc_operation_merge } svn_wc_operation_t; /** Info about one of the conflicting versions of a node. Each field may * have its respective null/invalid/unknown value if the corresponding * information is not relevant or not available. * * @todo Consider making some or all of the info mandatory, to reduce * complexity. * * @note Fields may be added to the end of this structure in future * versions. Therefore, to preserve binary compatibility, users * should not directly allocate structures of this type. * * @see svn_wc_conflict_version_create() * @see svn_wc_conflict_version_dup() * * @since New in 1.6. */ typedef struct svn_wc_conflict_version_t { /** @name Where to find this node version in a repository */ /**@{*/ /** URL of repository root */ const char *repos_url; /** revision at which to look up path_in_repos */ svn_revnum_t peg_rev; /** path within repos; must not start with '/' */ const char *path_in_repos; /* @todo We may decide to add the repository UUID, to handle conflicts * properly during a repository move. */ /** @} */ /** Info about this node */ svn_node_kind_t node_kind; /* note that 'none' is a legitimate value */ /* @todo Add metadata about a local copy of the node, if and when * we store one. */ /* Remember to update svn_wc_conflict_version_create() and * svn_wc_conflict_version_dup() in case you add fields to this struct. */ } svn_wc_conflict_version_t; /** * Allocate an @c svn_wc_conflict_version_t structure in @a pool, * initialize to contain a conflict origin, and return it. * * Set the @c repos_url field of the created struct to @a repos_url, the * @c path_in_repos field to @a path_in_repos, the @c peg_rev field to * @a peg_rev and the the @c node_kind to @c node_kind. Make only shallow * copies of the pointer arguments. * * @since New in 1.6. */ svn_wc_conflict_version_t * svn_wc_conflict_version_create(const char *repos_url, const char* path_in_repos, svn_revnum_t peg_rev, svn_node_kind_t node_kind, apr_pool_t *pool); /** Return a duplicate of @a version, allocated in @a pool. * No part of the new version will be shared with @a version. * * @since New in 1.6. */ svn_wc_conflict_version_t * svn_wc_conflict_version_dup(const svn_wc_conflict_version_t *version, apr_pool_t *pool); /** A struct that describes a conflict that has occurred in the * working copy. Passed to @c svn_wc_conflict_resolver_func_t. * * The conflict described by this structure is one of: * - a conflict on the content of the file node @a path * - a conflict on the property @a property_name of @a path * * @note Fields may be added to the end of this structure in future * versions. Therefore, to preserve binary compatibility, users * should not directly allocate structures of this type but should use * svn_wc_create_conflict_description_text() or * svn_wc_create_conflict_description_prop() or * svn_wc_create_conflict_description_tree() instead. * * @since New in 1.5. */ typedef struct svn_wc_conflict_description_t { /** The path that is in conflict (for a tree conflict, it is the victim) */ const char *path; /** The node type of the path being operated on (for a tree conflict, * ### which version?) */ svn_node_kind_t node_kind; /** What sort of conflict are we describing? */ svn_wc_conflict_kind_t kind; /** The name of the property whose conflict is being described. * (Only if @a kind is 'property'; else undefined.) */ const char *property_name; /** Whether svn thinks ('my' version of) @c path is a 'binary' file. * (Only if @c kind is 'text', else undefined.) */ svn_boolean_t is_binary; /** The svn:mime-type property of ('my' version of) @c path, if available, * else NULL. * (Only if @c kind is 'text', else undefined.) */ const char *mime_type; /** If not NULL, an open working copy access baton to either the * path itself (if @c path is a directory), or to the parent * directory (if @c path is a file.) * For a tree conflict, this will always be an access baton * to the parent directory of the path, even if the path is * a directory. */ svn_wc_adm_access_t *access; /** The action being attempted on the conflicted node or property. * (When @c kind is 'text', this action must be 'edit'.) */ svn_wc_conflict_action_t action; /** The state of the target node or property, relative to its merge-left * source, that is the reason for the conflict. * (When @c kind is 'text', this reason must be 'edited'.) */ svn_wc_conflict_reason_t reason; /** If this is text-conflict and involves the merging of two files * descended from a common ancestor, here are the paths of up to * four fulltext files that can be used to interactively resolve the * conflict. All four files will be in repository-normal form -- LF * line endings and contracted keywords. (If any of these files are * not available, they default to NULL.) * * On the other hand, if this is a property-conflict, then these * paths represent temporary files that contain the three different * property-values in conflict. The fourth path (@c merged_file) * may or may not be NULL; if set, it represents libsvn_wc's * attempt to merge the property values together. (Remember that * property values are technically binary values, and thus can't * always be merged.) */ const char *base_file; /* common ancestor of the two files being merged */ /** their version of the file */ const char *their_file; /** my locally-edited version of the file */ const char *my_file; /** merged version; may contain conflict markers */ const char *merged_file; /** The operation that exposed the conflict. * Used only for tree conflicts. * * @since New in 1.6. */ svn_wc_operation_t operation; /** Info on the "merge-left source" or "older" version of incoming change. * @since New in 1.6. */ svn_wc_conflict_version_t *src_left_version; /** Info on the "merge-right source" or "their" version of incoming change. * @since New in 1.6. */ svn_wc_conflict_version_t *src_right_version; /* Remember to adjust svn_wc__conflict_description_dup() * if you add new fields to this struct. */ } svn_wc_conflict_description_t; /** * Allocate an @c svn_wc_conflict_description_t structure in @a pool, * initialize to represent a text conflict, and return it. * * Set the @c path field of the created struct to @a path, the @c access * field to @a adm_access, the @c kind field to @c * svn_wc_conflict_kind_text, the @c node_kind to @c svn_node_file, the @c * action to @c svn_wc_conflict_action_edit, and the @c reason to @c * svn_wc_conflict_reason_edited. Make only shallow copies of the pointer * arguments. * * @note: It is the caller's responsibility to set the other required fields * (such as the four file names and @c mime_type and @c is_binary). * * @since New in 1.6. */ svn_wc_conflict_description_t * svn_wc_conflict_description_create_text(const char *path, svn_wc_adm_access_t *adm_access, apr_pool_t *pool); /** * Allocate an @c svn_wc_conflict_description_t structure in @a pool, * initialize to represent a property conflict, and return it. * * Set the @c path field of the created struct to @a path, the @c access * field to @a adm_access, the @c kind field to @c * svn_wc_conflict_kind_prop, the @c node_kind to @a node_kind, and the @c * property_name to @a property_name. Make only shallow copies of the pointer * arguments. * * @note: It is the caller's responsibility to set the other required fields * (such as the four file names and @c action and @c reason). * * @since New in 1.6. */ svn_wc_conflict_description_t * svn_wc_conflict_description_create_prop(const char *path, svn_wc_adm_access_t *adm_access, svn_node_kind_t node_kind, const char *property_name, apr_pool_t *pool); /** * Allocate an @c svn_wc_conflict_description_t structure in @a pool, * initialize to represent a tree conflict, and return it. * * Set the @c path field of the created struct to @a path, the @c access * field to @a adm_access, the @c kind field to @c * svn_wc_conflict_kind_tree, the @c node_kind to @a node_kind, the @c * operation to @a operation, the @c src_left_version field to * @a src_left_version, and the @c src_right_version field to * @a src_right_version. * Make only shallow copies of the pointer arguments. * * @note: It is the caller's responsibility to set the other required fields * (such as the four file names and @c action and @c reason). * * @since New in 1.6. */ svn_wc_conflict_description_t * svn_wc_conflict_description_create_tree(const char *path, svn_wc_adm_access_t *adm_access, svn_node_kind_t node_kind, svn_wc_operation_t operation, svn_wc_conflict_version_t *src_left_version, svn_wc_conflict_version_t *src_right_version, apr_pool_t *pool); /** The way in which the conflict callback chooses a course of action. * * @since New in 1.5. */ typedef enum svn_wc_conflict_choice_t { /* Don't resolve the conflict now. Let libsvn_wc mark the path 'conflicted', so user can run 'svn resolved' later. */ svn_wc_conflict_choose_postpone, /* If their were files to choose from, select one as a way of resolving the conflict here and now. libsvn_wc will then do the work of "installing" the chosen file. */ svn_wc_conflict_choose_base, /* original version */ svn_wc_conflict_choose_theirs_full, /* incoming version */ svn_wc_conflict_choose_mine_full, /* own version */ svn_wc_conflict_choose_theirs_conflict, /* incoming (for conflicted hunks) */ svn_wc_conflict_choose_mine_conflict, /* own (for conflicted hunks) */ svn_wc_conflict_choose_merged /* merged version */ } svn_wc_conflict_choice_t; /** The final result returned by @c svn_wc_conflict_resolver_func_t. * * @note Fields may be added to the end of this structure in future * versions. Therefore, to preserve binary compatibility, users * should not directly allocate structures of this type. Instead, * construct this structure using @c svn_wc_create_conflict_result() * below. * * @since New in 1.5. */ typedef struct svn_wc_conflict_result_t { /** A choice to either delay the conflict resolution or select a particular file to resolve the conflict. */ svn_wc_conflict_choice_t choice; /** If not NULL, this is a path to a file which contains the client's (or more likely, the user's) merging of the three values in conflict. libsvn_wc accepts this file if (and only if) @c choice is set to @c svn_wc_conflict_choose_merged.*/ const char *merged_file; /** If true, save a backup copy of merged_file (or the original merged_file from the conflict description, if merged_file is NULL) in the user's working copy. */ svn_boolean_t save_merged; } svn_wc_conflict_result_t; /** * Allocate an @c svn_wc_conflict_result_t structure in @a pool, * initialize and return it. * * Set the @c choice field of the structure to @a choice, and @c * merged_file to @a merged_file. Set all other fields to their @c * _unknown, @c NULL or invalid value, respectively. Make only a shallow * copy of the pointer argument @a merged_file. * * @since New in 1.5. */ svn_wc_conflict_result_t * svn_wc_create_conflict_result(svn_wc_conflict_choice_t choice, const char *merged_file, apr_pool_t *pool); /** A callback used in svn_client_merge3(), svn_client_update3(), and * svn_client_switch2() for resolving conflicts during the application * of a tree delta to a working copy. * * @a description describes the exact nature of the conflict, and * provides information to help resolve it. @a baton is a closure * object; it should be provided by the implementation, and passed by * the caller. All allocations should be performed in @a pool. When * finished, the callback signals its resolution by returning a * structure in @a *result. (See @c svn_wc_conflict_result_t.) * * The values @c svn_wc_conflict_choose_mine_conflict and @c * svn_wc_conflict_choose_theirs_conflict are not legal for conflicts * in binary files or properties. * * Implementations of this callback are free to present the conflict * using any user interface. This may include simple contextual * conflicts in a file's text or properties, or more complex * 'tree'-based conflcts related to obstructed additions, deletions, * and edits. The callback implementation is free to decide which * sorts of conflicts to handle; it's also free to decide which types * of conflicts are automatically resolvable and which require user * interaction. * * @since New in 1.5. */ typedef svn_error_t *(*svn_wc_conflict_resolver_func_t) (svn_wc_conflict_result_t **result, const svn_wc_conflict_description_t *description, void *baton, apr_pool_t *pool); /** @} */ /** * A callback vtable invoked by our diff-editors, as they receive * diffs from the server. 'svn diff' and 'svn merge' both implement * their own versions of this table. * * Common parameters: * * @a adm_access will be an access baton for the directory containing * @a path, or @c NULL if the diff editor is not using access batons. * * If @a state is non-NULL, set @a *state to the state of the item * after the operation has been performed. (In practice, this is only * useful with merge, not diff; diff callbacks will probably set * @a *state to @c svn_wc_notify_state_unknown, since they do not change * the state and therefore do not bother to know the state after the * operation.) By default, @a state refers to the item's content * state. Functions concerned with property state have separate * @a contentstate and @a propstate arguments. * * If @a tree_conflicted is non-NULL, set @a *tree_conflicted to true if * this operation caused a tree conflict, else to false. (Like with @a * state, this is only useful with merge, not diff; diff callbacks * should set this to false.) * * @since New in 1.6. */ typedef struct svn_wc_diff_callbacks3_t { /** * A file @a path has changed. If @a tmpfile2 is non-NULL, the * contents have changed and those changes can be seen by comparing * @a tmpfile1 and @a tmpfile2, which represent @a rev1 and @a rev2 of * the file, respectively. * * If known, the @c svn:mime-type value of each file is passed into * @a mimetype1 and @a mimetype2; either or both of the values can * be NULL. The implementor can use this information to decide if * (or how) to generate differences. * * @a propchanges is an array of (@c svn_prop_t) structures. If it contains * any elements, the original list of properties is provided in * @a originalprops, which is a hash of @c svn_string_t values, keyed on the * property name. * */ svn_error_t *(*file_changed)(svn_wc_adm_access_t *adm_access, svn_wc_notify_state_t *contentstate, svn_wc_notify_state_t *propstate, svn_boolean_t *tree_conflicted, const char *path, const char *tmpfile1, const char *tmpfile2, svn_revnum_t rev1, svn_revnum_t rev2, const char *mimetype1, const char *mimetype2, const apr_array_header_t *propchanges, apr_hash_t *originalprops, void *diff_baton); /** * A file @a path was added. The contents can be seen by comparing * @a tmpfile1 and @a tmpfile2, which represent @a rev1 and @a rev2 * of the file, respectively. (If either file is empty, the rev * will be 0.) * * If known, the @c svn:mime-type value of each file is passed into * @a mimetype1 and @a mimetype2; either or both of the values can * be NULL. The implementor can use this information to decide if * (or how) to generate differences. * * @a propchanges is an array of (@c svn_prop_t) structures. If it contains * any elements, the original list of properties is provided in * @a originalprops, which is a hash of @c svn_string_t values, keyed on the * property name. */ svn_error_t *(*file_added)(svn_wc_adm_access_t *adm_access, svn_wc_notify_state_t *contentstate, svn_wc_notify_state_t *propstate, svn_boolean_t *tree_conflicted, const char *path, const char *tmpfile1, const char *tmpfile2, svn_revnum_t rev1, svn_revnum_t rev2, const char *mimetype1, const char *mimetype2, const apr_array_header_t *propchanges, apr_hash_t *originalprops, void *diff_baton); /** * A file @a path was deleted. The [loss of] contents can be seen by * comparing @a tmpfile1 and @a tmpfile2. @a originalprops provides * the properties of the file. * ### Some existing callers include WC "entry props" in @a originalprops. * * If known, the @c svn:mime-type value of each file is passed into * @a mimetype1 and @a mimetype2; either or both of the values can * be NULL. The implementor can use this information to decide if * (or how) to generate differences. */ svn_error_t *(*file_deleted)(svn_wc_adm_access_t *adm_access, svn_wc_notify_state_t *state, svn_boolean_t *tree_conflicted, const char *path, const char *tmpfile1, const char *tmpfile2, const char *mimetype1, const char *mimetype2, apr_hash_t *originalprops, void *diff_baton); /** * A directory @a path was added. @a rev is the revision that the * directory came from. */ svn_error_t *(*dir_added)(svn_wc_adm_access_t *adm_access, svn_wc_notify_state_t *state, svn_boolean_t *tree_conflicted, const char *path, svn_revnum_t rev, void *diff_baton); /** * A directory @a path was deleted. */ svn_error_t *(*dir_deleted)(svn_wc_adm_access_t *adm_access, svn_wc_notify_state_t *state, svn_boolean_t *tree_conflicted, const char *path, void *diff_baton); /** * A list of property changes (@a propchanges) was applied to the * directory @a path. * * The array is a list of (@c svn_prop_t) structures. * * The original list of properties is provided in @a original_props, * which is a hash of @c svn_string_t values, keyed on the property * name. */ svn_error_t *(*dir_props_changed)(svn_wc_adm_access_t *adm_access, svn_wc_notify_state_t *propstate, svn_boolean_t *tree_conflicted, const char *path, const apr_array_header_t *propchanges, apr_hash_t *original_props, void *diff_baton); /** * A directory @a path has been opened. @a rev is the revision that the * directory came from. * * This function is called for @a path before any of the callbacks are * called for a child of @a path. */ svn_error_t *(*dir_opened)(svn_wc_adm_access_t *adm_access, svn_boolean_t *tree_conflicted, const char *path, svn_revnum_t rev, void *diff_baton); /** * A directory @a path has been closed. */ svn_error_t *(*dir_closed)(svn_wc_adm_access_t *adm_access, svn_wc_notify_state_t *contentstate, svn_wc_notify_state_t *propstate, svn_boolean_t *tree_conflicted, const char *path, void *diff_baton); } svn_wc_diff_callbacks3_t; /** * Similar to @c svn_wc_diff_callbacks3_t, but without the dir_opened() * function, and without the 'tree_conflicted' argument to the functions. * * @deprecated Provided for backward compatibility with the 1.2 API. */ typedef struct svn_wc_diff_callbacks2_t { /** The same as @c file_changed in @c svn_wc_diff_callbacks3_t. */ svn_error_t *(*file_changed)(svn_wc_adm_access_t *adm_access, svn_wc_notify_state_t *contentstate, svn_wc_notify_state_t *propstate, const char *path, const char *tmpfile1, const char *tmpfile2, svn_revnum_t rev1, svn_revnum_t rev2, const char *mimetype1, const char *mimetype2, const apr_array_header_t *propchanges, apr_hash_t *originalprops, void *diff_baton); /** The same as @c file_added in @c svn_wc_diff_callbacks3_t. */ svn_error_t *(*file_added)(svn_wc_adm_access_t *adm_access, svn_wc_notify_state_t *contentstate, svn_wc_notify_state_t *propstate, const char *path, const char *tmpfile1, const char *tmpfile2, svn_revnum_t rev1, svn_revnum_t rev2, const char *mimetype1, const char *mimetype2, const apr_array_header_t *propchanges, apr_hash_t *originalprops, void *diff_baton); /** The same as @c file_deleted in @c svn_wc_diff_callbacks3_t. */ svn_error_t *(*file_deleted)(svn_wc_adm_access_t *adm_access, svn_wc_notify_state_t *state, const char *path, const char *tmpfile1, const char *tmpfile2, const char *mimetype1, const char *mimetype2, apr_hash_t *originalprops, void *diff_baton); /** The same as @c dir_added in @c svn_wc_diff_callbacks3_t. */ svn_error_t *(*dir_added)(svn_wc_adm_access_t *adm_access, svn_wc_notify_state_t *state, const char *path, svn_revnum_t rev, void *diff_baton); /** The same as @c dir_deleted in @c svn_wc_diff_callbacks3_t. */ svn_error_t *(*dir_deleted)(svn_wc_adm_access_t *adm_access, svn_wc_notify_state_t *state, const char *path, void *diff_baton); /** The same as @c dir_props_changed in @c svn_wc_diff_callbacks3_t. */ svn_error_t *(*dir_props_changed)(svn_wc_adm_access_t *adm_access, svn_wc_notify_state_t *state, const char *path, const apr_array_header_t *propchanges, apr_hash_t *original_props, void *diff_baton); } svn_wc_diff_callbacks2_t; /** * Similar to @c svn_wc_diff_callbacks2_t, but with file additions/content * changes and property changes split into different functions. * * @deprecated Provided for backward compatibility with the 1.1 API. */ typedef struct svn_wc_diff_callbacks_t { /** Similar to @c file_changed in @c svn_wc_diff_callbacks2_t, but without * property change information. @a tmpfile2 is never NULL. @a state applies * to the file contents. */ svn_error_t *(*file_changed)(svn_wc_adm_access_t *adm_access, svn_wc_notify_state_t *state, const char *path, const char *tmpfile1, const char *tmpfile2, svn_revnum_t rev1, svn_revnum_t rev2, const char *mimetype1, const char *mimetype2, void *diff_baton); /** Similar to @c file_added in @c svn_wc_diff_callbacks2_t, but without * property change information. @a *state applies to the file contents. */ svn_error_t *(*file_added)(svn_wc_adm_access_t *adm_access, svn_wc_notify_state_t *state, const char *path, const char *tmpfile1, const char *tmpfile2, svn_revnum_t rev1, svn_revnum_t rev2, const char *mimetype1, const char *mimetype2, void *diff_baton); /** Similar to @c file_deleted in @c svn_wc_diff_callbacks2_t, but without * the properties. */ svn_error_t *(*file_deleted)(svn_wc_adm_access_t *adm_access, svn_wc_notify_state_t *state, const char *path, const char *tmpfile1, const char *tmpfile2, const char *mimetype1, const char *mimetype2, void *diff_baton); /** The same as @c dir_added in @c svn_wc_diff_callbacks2_t. */ svn_error_t *(*dir_added)(svn_wc_adm_access_t *adm_access, svn_wc_notify_state_t *state, const char *path, svn_revnum_t rev, void *diff_baton); /** The same as @c dir_deleted in @c svn_wc_diff_callbacks2_t. */ svn_error_t *(*dir_deleted)(svn_wc_adm_access_t *adm_access, svn_wc_notify_state_t *state, const char *path, void *diff_baton); /** Similar to @c dir_props_changed in @c svn_wc_diff_callbacks2_t, but this * function is called for files as well as directories. */ svn_error_t *(*props_changed)(svn_wc_adm_access_t *adm_access, svn_wc_notify_state_t *state, const char *path, const apr_array_header_t *propchanges, apr_hash_t *original_props, void *diff_baton); } svn_wc_diff_callbacks_t; /* Asking questions about a working copy. */ /** Set @a *wc_format to @a path's working copy format version number if * @a path is a valid working copy directory, else set it to 0. * Return error @c APR_ENOENT if @a path does not exist at all. */ svn_error_t * svn_wc_check_wc(const char *path, int *wc_format, apr_pool_t *pool); /** Set @a *has_binary_prop to @c TRUE iff @a path has been marked * with a property indicating that it is non-text (in other words, binary). * @a adm_access is an access baton set that contains @a path. */ svn_error_t * svn_wc_has_binary_prop(svn_boolean_t *has_binary_prop, const char *path, svn_wc_adm_access_t *adm_access, apr_pool_t *pool); /* Detecting modification. */ /** Set @a *modified_p to non-zero if @a filename's text is modified * with regard to the base revision, else set @a *modified_p to zero. * @a filename is a path to the file, not just a basename. @a adm_access * must be an access baton for @a filename. * * If @a force_comparison is @c TRUE, this function will not allow * early return mechanisms that avoid actual content comparison. * Instead, if there is a text base, a full byte-by-byte comparison * will be done, and the entry checksum verified as well. (This means * that if the text base is much longer than the working file, every * byte of the text base will still be examined.) * * If @a filename does not exist, consider it unmodified. If it exists * but is not under revision control (not even scheduled for * addition), return the error @c SVN_ERR_ENTRY_NOT_FOUND. * * If @a filename is unmodified but has a timestamp variation then this * function may "repair" @a filename's text-time by setting it to * @a filename's last modification time. */ svn_error_t * svn_wc_text_modified_p(svn_boolean_t *modified_p, const char *filename, svn_boolean_t force_comparison, svn_wc_adm_access_t *adm_access, apr_pool_t *pool); /** Set @a *modified_p to non-zero if @a path's properties are modified * with regard to the base revision, else set @a modified_p to zero. * @a adm_access must be an access baton for @a path. */ svn_error_t * svn_wc_props_modified_p(svn_boolean_t *modified_p, const char *path, svn_wc_adm_access_t *adm_access, apr_pool_t *pool); /** Administrative subdir. * * Ideally, this would be completely private to wc internals (in fact, * it used to be that adm_subdir() in adm_files.c was the only function * who knew the adm subdir's name). However, import wants to protect * against importing administrative subdirs, so now the name is a * matter of public record. * * @deprecated Provided for backward compatibility with the 1.2 API. */ #define SVN_WC_ADM_DIR_NAME ".svn" /* Entries and status. */ /** The schedule states an entry can be in. */ typedef enum svn_wc_schedule_t { /** Nothing special here */ svn_wc_schedule_normal, /** Slated for addition */ svn_wc_schedule_add, /** Slated for deletion */ svn_wc_schedule_delete, /** Slated for replacement (delete + add) */ svn_wc_schedule_replace } svn_wc_schedule_t; /** * Values for the working_size field in svn_wc_entry_t * when it isn't set to the actual size value of the unchanged * working file. * * @defgroup svn_wc_entry_working_size_constants Working size constants * * @{ */ /** The value of the working size is unknown (hasn't been * calculated and stored in the past for whatever reason). * * @since New in 1.5 */ #define SVN_WC_ENTRY_WORKING_SIZE_UNKNOWN (-1) /** @} */ /** A working copy entry -- that is, revision control information about * one versioned entity. */ typedef struct svn_wc_entry_t { /* IMPORTANT: If you extend this structure, add new fields to the end. */ /* General Attributes */ /** entry's name */ const char *name; /** base revision */ svn_revnum_t revision; /** url in repository */ const char *url; /** canonical repository URL or NULL if not known */ const char *repos; /** repository uuid */ const char *uuid; /** node kind (file, dir, ...) */ svn_node_kind_t kind; /* State information */ /** scheduling (add, delete, replace ...) */ svn_wc_schedule_t schedule; /** in a copied state (possibly because the entry is a child of a * path that is @c svn_wc_schedule_add or @c svn_wc_schedule_replace, * when the entry itself is @c svn_wc_schedule_normal). * COPIED is true for nodes under a directory that was copied, but * COPYFROM_URL is null there. They are both set for the root * destination of the copy. */ svn_boolean_t copied; /** The directory containing this entry had a versioned child of this * name, but this entry represents a different revision or a switched * path at which no item exists in the repository. This typically * arises from committing or updating to a deletion of this entry * without committing or updating the parent directory. * * The schedule can be 'normal' or 'add'. */ svn_boolean_t deleted; /** absent -- we know an entry of this name exists, but that's all (usually this happens because of authz restrictions) */ svn_boolean_t absent; /** for THIS_DIR entry, implies whole entries file is incomplete */ svn_boolean_t incomplete; /** copyfrom location */ const char *copyfrom_url; /** copyfrom revision */ svn_revnum_t copyfrom_rev; /** old version of conflicted file. A file basename, relative to the * user's directory that the THIS_DIR entry refers to. */ const char *conflict_old; /** new version of conflicted file. A file basename, relative to the * user's directory that the THIS_DIR entry refers to. */ const char *conflict_new; /** working version of conflicted file. A file basename, relative to the * user's directory that the THIS_DIR entry refers to. */ const char *conflict_wrk; /** property reject file. A file basename, relative to the user's * directory that the THIS_DIR entry refers to. */ const char *prejfile; /** last up-to-date time for text contents (0 means no information available) */ apr_time_t text_time; /** last up-to-date time for properties (0 means no information available) * * @deprecated This value will always be 0 in version 1.4 and later. */ apr_time_t prop_time; /** Hex MD5 checksum for the untranslated text base file, * can be @c NULL for backwards compatibility. */ const char *checksum; /* "Entry props" */ /** last revision this was changed */ svn_revnum_t cmt_rev; /** last date this was changed */ apr_time_t cmt_date; /** last commit author of this item */ const char *cmt_author; /** lock token or NULL if path not locked in this WC * @since New in 1.2. */ const char *lock_token; /** lock owner, or NULL if not locked in this WC * @since New in 1.2. */ const char *lock_owner; /** lock comment or NULL if not locked in this WC or no comment * @since New in 1.2. */ const char *lock_comment; /** Lock creation date or 0 if not locked in this WC * @since New in 1.2. */ apr_time_t lock_creation_date; /** Whether this entry has any working properties. * False if this information is not stored in the entry. * * @since New in 1.4. */ svn_boolean_t has_props; /** Whether this entry has property modifications. * * @note For working copies in older formats, this flag is not valid. * * @see svn_wc_props_modified_p(). * * @since New in 1.4. */ svn_boolean_t has_prop_mods; /** A space-separated list of all properties whose presence/absence is cached * in this entry. * * @see @c present_props. * * @since New in 1.4. * @deprecated This value will always be "" in version 1.7 and later. */ const char *cachable_props; /** Cached property existence for this entry. * This is a space-separated list of property names. If a name exists in * @c cachable_props but not in this list, this entry does not have that * property. If a name exists in both lists, the property is present on this * entry. * * @since New in 1.4. * @deprecated This value will always be "" in version 1.7 and later. */ const char *present_props; /** which changelist this item is part of, or NULL if not part of any. * @since New in 1.5. */ const char *changelist; /** Size of the file after being translated into local * representation, or @c SVN_WC_ENTRY_WORKING_SIZE_UNKNOWN if * unknown. * * @since New in 1.5. */ apr_off_t working_size; /** Whether a local copy of this entry should be kept in the working copy * after a deletion has been committed, Only valid for the this-dir entry * when it is scheduled for deletion. * * @since New in 1.5. */ svn_boolean_t keep_local; /** The depth of this entry. * * ### It's a bit annoying that we only use this on this_dir * ### entries, yet it will exist (with value svn_depth_infinity) on * ### all entries. Maybe some future extensibility would make this * ### field meaningful on entries besides this_dir. * * @since New in 1.5. */ svn_depth_t depth; /** Serialized data for all of the tree conflicts detected in this_dir. * * @since New in 1.6. */ const char *tree_conflict_data; /** The entry is a intra-repository file external and this is the * repository root relative path to the file specified in the * externals definition, otherwise NULL if the entry is not a file * external. * * @since New in 1.6. */ const char *file_external_path; /** The entry is a intra-repository file external and this is the * peg revision number specified in the externals definition. This * field is only valid when the file_external_path field is * non-NULL. The only permissible values are * svn_opt_revision_unspecified if the entry is not an external, * svn_opt_revision_head if the external revision is unspecified or * specified with -r HEAD or svn_opt_revision_number for a specific * revision number. * * @since New in 1.6. */ svn_opt_revision_t file_external_peg_rev; /** The entry is a intra-repository file external and this is the * operative revision number specified in the externals definition. * This field is only valid when the file_external_path field is * non-NULL. The only permissible values are * svn_opt_revision_unspecified if the entry is not an external, * svn_opt_revision_head if the external revision is unspecified or * specified with -r HEAD or svn_opt_revision_number for a specific * revision number. * * @since New in 1.6. */ svn_opt_revision_t file_external_rev; /* IMPORTANT: If you extend this structure, check the following functions in * subversion/libsvn_wc/entries.c, to see if you need to extend them as well. * * svn_wc__atts_to_entry() * svn_wc_entry_dup() * alloc_entry() * read_entry() * write_entry() * fold_entry() */ } svn_wc_entry_t; /** How an entries file's owner dir is named in the entries file. */ #define SVN_WC_ENTRY_THIS_DIR "" /** Set @a *entry to an entry for @a path, allocated in the access baton pool. * If @a show_hidden is TRUE, return the entry even if it's in 'excluded', * 'deleted' or 'absent' state. Excluded entries are those with their depth * set to @c svn_depth_exclude. If @a path is not under revision control, or * if entry is hidden, not scheduled for re-addition, and @a show_hidden is @c * FALSE, then set @a *entry to @c NULL. * * @a *entry should not be modified, since doing so modifies the entries * cache in @a adm_access without changing the entries file on disk. * * If @a path is not a directory then @a adm_access must be an access baton * for the parent directory of @a path. To avoid needing to know whether * @a path is a directory or not, if @a path is a directory @a adm_access * can still be an access baton for the parent of @a path so long as the * access baton for @a path itself is in the same access baton set. * * @a path can be relative or absolute but must share the same base used * to open @a adm_access. * * Note that it is possible for @a path to be absent from disk but still * under revision control; and conversely, it is possible for @a path to * be present, but not under revision control. * * Use @a pool only for local processing. */ svn_error_t * svn_wc_entry(const svn_wc_entry_t **entry, const char *path, svn_wc_adm_access_t *adm_access, svn_boolean_t show_hidden, apr_pool_t *pool); /** Parse the `entries' file for @a adm_access and return a hash @a entries, * whose keys are (const char *) entry names and values are * (svn_wc_entry_t *). The hash @a entries, and its keys and * values, are allocated from the pool used to open the @a adm_access * baton (that's how the entries caching works). @a pool is used for * transient allocations. * * Entries that are in a 'excluded', 'deleted' or 'absent' state (and not * scheduled for re-addition) are not returned in the hash, unless * @a show_hidden is TRUE. Excluded entries are those with their depth set to * @c svn_depth_exclude. * * @par Important: * The @a entries hash is the entries cache in @a adm_access * and so usually the hash itself, the keys and the values should be treated * as read-only. If any of these are modified then it is the caller's * responsibility to ensure that the entries file on disk is updated. Treat * the hash values as type (const svn_wc_entry_t *) if you wish to * avoid accidental modification. Modifying the schedule member is a * particularly bad idea, as the entries writing process relies on having * access to the original schedule. Use a duplicate entry to modify the * schedule. * * @par Important: * Only the entry structures representing files and * @c SVN_WC_ENTRY_THIS_DIR contain complete information. The entry * structures representing subdirs have only the `kind' and `state' * fields filled in. If you want info on a subdir, you must use this * routine to open its @a path and read the @c SVN_WC_ENTRY_THIS_DIR * structure, or call svn_wc_entry() on its @a path. */ svn_error_t * svn_wc_entries_read(apr_hash_t **entries, svn_wc_adm_access_t *adm_access, svn_boolean_t show_hidden, apr_pool_t *pool); /** Return a duplicate of @a entry, allocated in @a pool. No part of the new * entry will be shared with @a entry. */ svn_wc_entry_t * svn_wc_entry_dup(const svn_wc_entry_t *entry, apr_pool_t *pool); /** Given a @a path in a dir under version control, decide if it is in a * state of conflict; return the answers in @a *text_conflicted_p, @a * *prop_conflicted_p, and @a *tree_conflicted_p. If one or two of the * answers are uninteresting, simply pass @c NULL pointers for those. * * If @a path is unversioned or does not exist, @a *text_conflicted_p and * @a *prop_conflicted_p will be @c FALSE if non-NULL. * * @a adm_access is the admin access baton of the parent directory. * * If the @a path has corresponding text conflict files (with suffix .mine, * .theirs, etc.) that cannot be found, assume that the text conflict has * been resolved by the user and return @c FALSE in @a *text_conflicted_p. * * Similarly, if a property conflicts file (.prej suffix) is said to exist, * but it cannot be found, assume that the property conflicts have been * resolved by the user and return @c FALSE in @a *prop_conflicted_p. * * @a *tree_conflicted_p can't be auto-resolved in this fashion. An * explicit `resolved' is needed. * * @since New in 1.6. */ svn_error_t * svn_wc_conflicted_p2(svn_boolean_t *text_conflicted_p, svn_boolean_t *prop_conflicted_p, svn_boolean_t *tree_conflicted_p, const char *path, svn_wc_adm_access_t *adm_access, apr_pool_t *pool); /** Given a @a dir_path under version control, decide if one of its entries * (@a entry) is in a state of conflict; return the answers in @a * text_conflicted_p and @a prop_conflicted_p. These pointers must not be * null. * * If the @a entry mentions that text conflict files (with suffix .mine, * .theirs, etc.) exist, but they cannot be found, assume the text conflict * has been resolved by the user and return FALSE in @a *text_conflicted_p. * * Similarly, if the @a entry mentions that a property conflicts file (.prej * suffix) exists, but it cannot be found, assume the property conflicts * have been resolved by the user and return FALSE in @a *prop_conflicted_p. * * The @a entry is not updated. * * @deprecated Provided for backward compatibility with the 1.5 API. */ SVN_DEPRECATED svn_error_t * svn_wc_conflicted_p(svn_boolean_t *text_conflicted_p, svn_boolean_t *prop_conflicted_p, const char *dir_path, const svn_wc_entry_t *entry, apr_pool_t *pool); /** Set @a *url and @a *rev to the ancestor URL and revision for @a path, * allocating in @a pool. @a adm_access must be an access baton for @a path. * * If @a url or @a rev is NULL, then ignore it (just don't return the * corresponding information). */ svn_error_t * svn_wc_get_ancestry(char **url, svn_revnum_t *rev, const char *path, svn_wc_adm_access_t *adm_access, apr_pool_t *pool); /** A callback vtable invoked by the generic entry-walker function. * @since New in 1.5. */ typedef struct svn_wc_entry_callbacks2_t { /** An @a entry was found at @a path. */ svn_error_t *(*found_entry)(const char *path, const svn_wc_entry_t *entry, void *walk_baton, apr_pool_t *pool); /** Handle the error @a err encountered while processing @a path. * Wrap or squelch @a err as desired, and return an @c svn_error_t * *, or @c SVN_NO_ERROR. */ svn_error_t *(*handle_error)(const char *path, svn_error_t *err, void *walk_baton, apr_pool_t *pool); } svn_wc_entry_callbacks2_t; /** @deprecated Provided for backward compatibility with the 1.4 API. */ typedef struct svn_wc_entry_callbacks_t { /** An @a entry was found at @a path. */ svn_error_t *(*found_entry)(const char *path, const svn_wc_entry_t *entry, void *walk_baton, apr_pool_t *pool); } svn_wc_entry_callbacks_t; /** * A generic entry-walker. * * Do a potentially recursive depth-first entry-walk beginning on * @a path, which can be a file or dir. Call callbacks in * @a walk_callbacks, passing @a walk_baton to each. Use @a pool for * looping, recursion, and to allocate all entries returned. * @a adm_access must be an access baton for @a path. * * If @a depth is @c svn_depth_empty, invoke the callbacks on @a path * and return without recursing further. If @c svn_depth_files, do * the same and invoke the callbacks on file children (if any) of * @a path, then return. If @c svn_depth_immediates, do the preceding * but also invoke callbacks on immediate subdirectories, then return. * If @c svn_depth_infinity, recurse fully starting from @a path. * * If @a cancel_func is non-NULL, call it with @a cancel_baton to determine * if the client has cancelled the operation. * * Like our other entries interfaces, entries that are in a 'excluded', * 'deleted' or 'absent' state (and not scheduled for re-addition) are not * discovered, unless @a show_hidden is TRUE. Excluded entries are those with * their depth set to @c svn_depth_exclude. * * When a new directory is entered, @c SVN_WC_ENTRY_THIS_DIR will always * be returned first. * * @note Callers should be aware that each directory will be * returned *twice*: first as an entry within its parent, and * subsequently as the '.' entry within itself. The two calls can be * distinguished by looking for @c SVN_WC_ENTRY_THIS_DIR in the 'name' * field of the entry. * * @since New in 1.5. */ svn_error_t * svn_wc_walk_entries3(const char *path, svn_wc_adm_access_t *adm_access, const svn_wc_entry_callbacks2_t *walk_callbacks, void *walk_baton, svn_depth_t depth, svn_boolean_t show_hidden, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool); /** * Similar to svn_wc_walk_entries3(), but without cancellation support * or error handling from @a walk_callbacks, and with @a depth always * set to @c svn_depth_infinity. * * @deprecated Provided for backward compatibility with the 1.4 API. */ SVN_DEPRECATED svn_error_t * svn_wc_walk_entries2(const char *path, svn_wc_adm_access_t *adm_access, const svn_wc_entry_callbacks_t *walk_callbacks, void *walk_baton, svn_boolean_t show_hidden, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool); /** * Similar to svn_wc_walk_entries2(), but without cancellation support. * * @deprecated Provided for backward compatibility with the 1.0 API. */ SVN_DEPRECATED svn_error_t * svn_wc_walk_entries(const char *path, svn_wc_adm_access_t *adm_access, const svn_wc_entry_callbacks_t *walk_callbacks, void *walk_baton, svn_boolean_t show_hidden, apr_pool_t *pool); /** Mark missing @a path as 'deleted' in its @a parent's list of entries. * * Return @c SVN_ERR_WC_PATH_FOUND if @a path isn't actually missing. */ svn_error_t * svn_wc_mark_missing_deleted(const char *path, svn_wc_adm_access_t *parent, apr_pool_t *pool); /** Ensure that an administrative area exists for @a path, so that @a * path is a working copy subdir based on @a url at @a revision, with * depth @a depth, and with repository UUID @a uuid and repository * root URL @a repos. * * @a depth must be a definite depth, it cannot be @c svn_depth_unknown. * @a uuid and @a repos may be @c NULL. If non-@c NULL, @a repos must * be a prefix of @a url. * * If the administrative area does not exist, then create it and * initialize it to an unlocked state. * * If the administrative area already exists then the given @a url * must match the URL in the administrative area and the given * @a revision must match the BASE of the working copy dir unless * the admin directory is scheduled for deletion or the * SVN_ERR_WC_OBSTRUCTED_UPDATE error will be returned. * * Do not ensure existence of @a path itself; if @a path does not * exist, return error. * * @since New in 1.5. */ svn_error_t * svn_wc_ensure_adm3(const char *path, const char *uuid, const char *url, const char *repos, svn_revnum_t revision, svn_depth_t depth, apr_pool_t *pool); /** * Similar to svn_wc_ensure_adm3(), but with @a depth set to * @c svn_depth_infinity. * * @deprecated Provided for backwards compatibility with the 1.4 API. * * @since New in 1.3. */ SVN_DEPRECATED svn_error_t * svn_wc_ensure_adm2(const char *path, const char *uuid, const char *url, const char *repos, svn_revnum_t revision, apr_pool_t *pool); /** * Similar to svn_wc_ensure_adm2(), but with @a repos set to @c NULL. * * @deprecated Provided for backwards compatibility with the 1.2 API. */ SVN_DEPRECATED svn_error_t * svn_wc_ensure_adm(const char *path, const char *uuid, const char *url, svn_revnum_t revision, apr_pool_t *pool); /** Set the repository root URL of @a path to @a repos, if possible. * * @a adm_access must contain @a path and be write-locked, if @a path * is versioned. Return no error if path is missing or unversioned. * Use @a pool for temporary allocations. * * @note In some circumstances, the repository root can't be set * without making the working copy corrupt. In such cases, this * function just returns no error, without modifying the @a path entry. * * @note This function exists to make it possible to try to set the repository * root in old working copies; new working copies normally get this set at * creation time. * * @since New in 1.3. */ svn_error_t * svn_wc_maybe_set_repos_root(svn_wc_adm_access_t *adm_access, const char *path, const char *repos, apr_pool_t *pool); /** * @defgroup svn_wc_status Working copy status. * @{ * * We have two functions for getting working copy status: one function * for getting the status of exactly one thing, and another for * getting the statuses of (potentially) multiple things. * * The concept of depth, as explained in the documentation for * svn_depth_t, may be useful in understanding this. Suppose we're * getting the status of directory D: * * To offer all three levels, we could have one unified function, * taking a `depth' parameter. Unfortunately, because this function * would have to handle multiple return values as well as the single * return value case, getting the status of just one entity would * become cumbersome: you'd have to roll through a hash to find one * lone status. * * So we have svn_wc_status() for depth-empty (just D itself), and * svn_wc_get_status_editor() for depth-immediates and depth-infinity, * since the latter two involve multiple return values. * * @note The status structures may contain a @c NULL ->entry field. * This indicates an item that is not versioned in the working copy. */ /** The type of status for the working copy. */ enum svn_wc_status_kind { /** does not exist */ svn_wc_status_none = 1, /** is not a versioned thing in this wc */ svn_wc_status_unversioned, /** exists, but uninteresting */ svn_wc_status_normal, /** is scheduled for addition */ svn_wc_status_added, /** under v.c., but is missing */ svn_wc_status_missing, /** scheduled for deletion */ svn_wc_status_deleted, /** was deleted and then re-added */ svn_wc_status_replaced, /** text or props have been modified */ svn_wc_status_modified, /** local mods received repos mods */ svn_wc_status_merged, /** local mods received conflicting repos mods */ svn_wc_status_conflicted, /** is unversioned but configured to be ignored */ svn_wc_status_ignored, /** an unversioned resource is in the way of the versioned resource */ svn_wc_status_obstructed, /** an unversioned directory path populated by an svn:externals property; this status is not used for file externals */ svn_wc_status_external, /** a directory doesn't contain a complete entries list */ svn_wc_status_incomplete }; /** * Structure for holding the "status" of a working copy item. * * The item's entry data is in @a entry, augmented and possibly shadowed * by the other fields. @a entry is @c NULL if this item is not under * version control. * * @note Fields may be added to the end of this structure in future * versions. Therefore, to preserve binary compatibility, users * should not directly allocate structures of this type. * * @since New in 1.2. */ typedef struct svn_wc_status2_t { /** Can be @c NULL if not under version control. */ svn_wc_entry_t *entry; /** The status of the entries text. */ enum svn_wc_status_kind text_status; /** The status of the entries properties. */ enum svn_wc_status_kind prop_status; /** a directory can be 'locked' if a working copy update was interrupted. */ svn_boolean_t locked; /** a file or directory can be 'copied' if it's scheduled for * addition-with-history (or part of a subtree that is scheduled as such.). */ svn_boolean_t copied; /** a file or directory can be 'switched' if the switch command has been * used. If this is TRUE, then file_external will be FALSE. */ svn_boolean_t switched; /** The entry's text status in the repository. */ enum svn_wc_status_kind repos_text_status; /** The entry's property status in the repository. */ enum svn_wc_status_kind repos_prop_status; /** The entry's lock in the repository, if any. */ svn_lock_t *repos_lock; /** Set to the URI (actual or expected) of the item. * @since New in 1.3 */ const char *url; /** * @defgroup svn_wc_status_ood WC out-of-date info from the repository * @{ * * When the working copy item is out-of-date compared to the * repository, the following fields represent the state of the * youngest revision of the item in the repository. If the working * copy is not out of date, the fields are initialized as described * below. */ /** Set to the youngest committed revision, or @c SVN_INVALID_REVNUM * if not out of date. * @since New in 1.3 */ svn_revnum_t ood_last_cmt_rev; /** Set to the most recent commit date, or @c 0 if not out of date. * @since New in 1.3 */ apr_time_t ood_last_cmt_date; /** Set to the node kind of the youngest commit, or @c svn_node_none * if not out of date. * @since New in 1.3 */ svn_node_kind_t ood_kind; /** Set to the user name of the youngest commit, or @c NULL if not * out of date or non-existent. Because a non-existent @c * svn:author property has the same behavior as an out-of-date * working copy, examine @c ood_last_cmt_rev to determine whether * the working copy is out of date. * @since New in 1.3 */ const char *ood_last_cmt_author; /** @} */ /** Non-NULL if the entry is the victim of a tree conflict. * @since New in 1.6 */ svn_wc_conflict_description_t *tree_conflict; /** If the item is a file that was added to the working copy with an * svn:externals; if file_external is TRUE, then switched is always * FALSE. * @since New in 1.6 */ svn_boolean_t file_external; /** The actual status of the text compared to the pristine base of the * file. This value isn't masked by other working copy statuses. * @c pristine_text_status is @c svn_wc_status_none if this value was * not calculated during the status walk. * @since New in 1.6 */ enum svn_wc_status_kind pristine_text_status; /** The actual status of the properties compared to the pristine base of * the node. This value isn't masked by other working copy statuses. * @c pristine_prop_status is @c svn_wc_status_none if this value was * not calculated during the status walk. * @since New in 1.6 */ enum svn_wc_status_kind pristine_prop_status; /* NOTE! Please update svn_wc_dup_status2() when adding new fields here. */ } svn_wc_status2_t; /** * Same as @c svn_wc_status2_t, but without the svn_lock_t 'repos_lock' field. * * @deprecated Provided for backward compatibility with the 1.1 API. */ typedef struct svn_wc_status_t { /** Can be @c NULL if not under version control. */ svn_wc_entry_t *entry; /** The status of the entries text. */ enum svn_wc_status_kind text_status; /** The status of the entries properties. */ enum svn_wc_status_kind prop_status; /** a directory can be 'locked' if a working copy update was interrupted. */ svn_boolean_t locked; /** a file or directory can be 'copied' if it's scheduled for * addition-with-history (or part of a subtree that is scheduled as such.). */ svn_boolean_t copied; /** a file or directory can be 'switched' if the switch command has been * used. */ svn_boolean_t switched; /** The entry's text status in the repository. */ enum svn_wc_status_kind repos_text_status; /** The entry's property status in the repository. */ enum svn_wc_status_kind repos_prop_status; } svn_wc_status_t; /** * Return a deep copy of the @a orig_stat status structure, allocated * in @a pool. * * @since New in 1.2. */ svn_wc_status2_t * svn_wc_dup_status2(const svn_wc_status2_t *orig_stat, apr_pool_t *pool); /** * Same as svn_wc_dup_status2(), but for older svn_wc_status_t structures. * * @deprecated Provided for backward compatibility with the 1.1 API. */ SVN_DEPRECATED svn_wc_status_t * svn_wc_dup_status(const svn_wc_status_t *orig_stat, apr_pool_t *pool); /** * Fill @a *status for @a path, allocating in @a pool. * @a adm_access must be an access baton for @a path. * * Here are some things to note about the returned structure. A quick * examination of the @c status->text_status after a successful return of * this function can reveal the following things: * * - @c svn_wc_status_none : @a path is not versioned, and is either not * present on disk, or is ignored by svn's * default ignore regular expressions or the * svn:ignore property setting for @a path's * parent directory. * * - @c svn_wc_status_missing : @a path is versioned, but is missing from * the working copy. * * - @c svn_wc_status_unversioned : @a path is not versioned, but is * present on disk and not being * ignored (see above). * * The other available results for the @c text_status field are more * straightforward in their meanings. See the comments on the * @c svn_wc_status_kind structure for some hints. * * @since New in 1.2. */ svn_error_t * svn_wc_status2(svn_wc_status2_t **status, const char *path, svn_wc_adm_access_t *adm_access, apr_pool_t *pool); /** * Same as svn_wc_status2(), but for older svn_wc_status_t structures. * * @deprecated Provided for backward compatibility with the 1.1 API. */ SVN_DEPRECATED svn_error_t * svn_wc_status(svn_wc_status_t **status, const char *path, svn_wc_adm_access_t *adm_access, apr_pool_t *pool); /** * A callback for reporting a @a status about @a path. * * @a baton is a closure object; it should be provided by the * implementation, and passed by the caller. * * @a pool will be cleared between invocations to the callback. * * @since New in 1.6. */ typedef svn_error_t *(*svn_wc_status_func3_t)(void *baton, const char *path, svn_wc_status2_t *status, apr_pool_t *pool); /** * Same as svn_wc_status_func3_t(), but without a provided pool or * the ability to propagate errors. * * @since New in 1.2. * @deprecated Provided for backward compatibility with the 1.5 API. */ typedef void (*svn_wc_status_func2_t)(void *baton, const char *path, svn_wc_status2_t *status); /** * Same as svn_wc_status_func2_t(), but for older svn_wc_status_t structures. * * @deprecated Provided for backward compatibility with the 1.1 API. */ typedef void (*svn_wc_status_func_t)(void *baton, const char *path, svn_wc_status_t *status); /** * Set @a *editor and @a *edit_baton to an editor that generates @c * svn_wc_status2_t structures and sends them through @a status_func / * @a status_baton. @a anchor is an access baton, with a tree lock, * for the local path to the working copy which will be used as the * root of our editor. If @a target is not empty, it represents an * entry in the @a anchor path which is the subject of the editor * drive (otherwise, the @a anchor is the subject). * * If @a set_locks_baton is non-@c NULL, it will be set to a baton that can * be used in a call to the svn_wc_status_set_repos_locks() function. * * Callers drive this editor to describe working copy out-of-dateness * with respect to the repository. If this information is not * available or not desired, callers should simply call the * close_edit() function of the @a editor vtable. * * If the editor driver calls @a editor's set_target_revision() vtable * function, then when the edit drive is completed, @a *edit_revision * will contain the revision delivered via that interface. * * Assuming the target is a directory, then: * * - If @a get_all is FALSE, then only locally-modified entries will be * returned. If TRUE, then all entries will be returned. * * - If @a depth is @c svn_depth_empty, a status structure will * be returned for the target only; if @c svn_depth_files, for the * target and its immediate file children; if * @c svn_depth_immediates, for the target and its immediate * children; if @c svn_depth_infinity, for the target and * everything underneath it, fully recursively. * * If @a depth is @c svn_depth_unknown, take depths from the * working copy and behave as above in each directory's case. * * If the given @a depth is incompatible with the depth found in a * working copy directory, the found depth always governs. * * If @a no_ignore is set, statuses that would typically be ignored * will instead be reported. * * @a ignore_patterns is an array of file patterns matching * unversioned files to ignore for the purposes of status reporting, * or @c NULL if the default set of ignorable file patterns should be used. * * If @a cancel_func is non-NULL, call it with @a cancel_baton while building * the @a statushash to determine if the client has cancelled the operation. * * If @a traversal_info is non-NULL, then record pre-update traversal * state in it. (Caller should obtain @a traversal_info from * svn_wc_init_traversal_info().) * * Allocate the editor itself in @a pool, but the editor does temporary * allocations in a subpool of @a pool. * * @since New in 1.6. */ svn_error_t * svn_wc_get_status_editor4(const svn_delta_editor_t **editor, void **edit_baton, void **set_locks_baton, svn_revnum_t *edit_revision, svn_wc_adm_access_t *anchor, const char *target, svn_depth_t depth, svn_boolean_t get_all, svn_boolean_t no_ignore, const apr_array_header_t *ignore_patterns, svn_wc_status_func3_t status_func, void *status_baton, svn_cancel_func_t cancel_func, void *cancel_baton, svn_wc_traversal_info_t *traversal_info, apr_pool_t *pool); /** * Same as svn_wc_get_status_editor4(), but using @c svn_wc_status_func2_t * instead of @c svn_wc_status_func3_t. * * @since New in 1.5. * @deprecated Provided for backward compatibility with the 1.4 API. */ SVN_DEPRECATED svn_error_t * svn_wc_get_status_editor3(const svn_delta_editor_t **editor, void **edit_baton, void **set_locks_baton, svn_revnum_t *edit_revision, svn_wc_adm_access_t *anchor, const char *target, svn_depth_t depth, svn_boolean_t get_all, svn_boolean_t no_ignore, apr_array_header_t *ignore_patterns, svn_wc_status_func2_t status_func, void *status_baton, svn_cancel_func_t cancel_func, void *cancel_baton, svn_wc_traversal_info_t *traversal_info, apr_pool_t *pool); /** * Like svn_wc_get_status_editor3(), but with @a ignore_patterns * provided from the corresponding value in @a config, and @a recurse * instead of @a depth. If @a recurse is TRUE, behave as if for @c * svn_depth_infinity; else if @a recurse is FALSE, behave as if for * @c svn_depth_immediates. * * @since New in 1.2. * @deprecated Provided for backward compatibility with the 1.4 API. */ SVN_DEPRECATED svn_error_t * svn_wc_get_status_editor2(const svn_delta_editor_t **editor, void **edit_baton, void **set_locks_baton, svn_revnum_t *edit_revision, svn_wc_adm_access_t *anchor, const char *target, apr_hash_t *config, svn_boolean_t recurse, svn_boolean_t get_all, svn_boolean_t no_ignore, svn_wc_status_func2_t status_func, void *status_baton, svn_cancel_func_t cancel_func, void *cancel_baton, svn_wc_traversal_info_t *traversal_info, apr_pool_t *pool); /** * Same as svn_wc_get_status_editor2(), but with @a set_locks_baton set * to @c NULL, and taking a deprecated svn_wc_status_func_t argument. * * @deprecated Provided for backward compatibility with the 1.1 API. */ SVN_DEPRECATED svn_error_t * svn_wc_get_status_editor(const svn_delta_editor_t **editor, void **edit_baton, svn_revnum_t *edit_revision, svn_wc_adm_access_t *anchor, const char *target, apr_hash_t *config, svn_boolean_t recurse, svn_boolean_t get_all, svn_boolean_t no_ignore, svn_wc_status_func_t status_func, void *status_baton, svn_cancel_func_t cancel_func, void *cancel_baton, svn_wc_traversal_info_t *traversal_info, apr_pool_t *pool); /** * Associate @a locks, a hash table mapping const char* * absolute repository paths to svn_lock_t objects, with a * @a set_locks_baton returned by an earlier call to * svn_wc_get_status_editor3(). @a repos_root is the repository root URL. * Perform all allocations in @a pool. * * @note @a locks will not be copied, so it must be valid throughout the * edit. @a pool must also not be destroyed or cleared before the edit is * finished. * * @since New in 1.2. */ svn_error_t * svn_wc_status_set_repos_locks(void *set_locks_baton, apr_hash_t *locks, const char *repos_root, apr_pool_t *pool); /** @} */ /** * Copy @a src to @a dst_basename in @a dst_parent, and schedule * @a dst_basename for addition to the repository, remembering the copy * history. * * @a src must be a file or directory under version control; @a dst_parent * must be a directory under version control in the same working copy; * @a dst_basename will be the name of the copied item, and it must not * exist already. * * If @a cancel_func is non-NULL, call it with @a cancel_baton at * various points during the operation. If it returns an error * (typically @c SVN_ERR_CANCELLED), return that error immediately. * * For each file or directory copied, @a notify_func will be called * with its path and the @a notify_baton. @a notify_func may be @c NULL * if you are not interested in this information. * * @par Important: * This is a variant of svn_wc_add(). No changes will happen * to the repository until a commit occurs. This scheduling can be * removed with svn_client_revert2(). * * @since New in 1.2. */ svn_error_t * svn_wc_copy2(const char *src, svn_wc_adm_access_t *dst_parent, const char *dst_basename, svn_cancel_func_t cancel_func, void *cancel_baton, svn_wc_notify_func2_t notify_func, void *notify_baton, apr_pool_t *pool); /** * Similar to svn_wc_copy2(), but takes an @c svn_wc_notify_func_t instead. * * @deprecated Provided for backward compatibility with the 1.1 API. */ SVN_DEPRECATED svn_error_t * svn_wc_copy(const char *src, svn_wc_adm_access_t *dst_parent, const char *dst_basename, svn_cancel_func_t cancel_func, void *cancel_baton, svn_wc_notify_func_t notify_func, void *notify_baton, apr_pool_t *pool); /** * Schedule @a path for deletion, it will be deleted from the repository on * the next commit. If @a path refers to a directory, then a recursive * deletion will occur. @a adm_access must hold a write lock for the parent * of @a path. * * If @a keep_local is FALSE, this function immediately deletes all files, * modified and unmodified, versioned and unversioned from the working copy. * It also immediately deletes unversioned directories and directories that * are scheduled to be added. Only versioned directories will remain in the * working copy, these get deleted by the update following the commit. * * If @a keep_local is TRUE, all files and directories will be kept in the * working copy (and will become unversioned on the next commit). * * If @a cancel_func is non-NULL, call it with @a cancel_baton at * various points during the operation. If it returns an error * (typically @c SVN_ERR_CANCELLED), return that error immediately. * * For each path marked for deletion, @a notify_func will be called with * the @a notify_baton and that path. The @a notify_func callback may be * @c NULL if notification is not needed. * * @since New in 1.5. */ svn_error_t * svn_wc_delete3(const char *path, svn_wc_adm_access_t *adm_access, svn_cancel_func_t cancel_func, void *cancel_baton, svn_wc_notify_func2_t notify_func, void *notify_baton, svn_boolean_t keep_local, apr_pool_t *pool); /** * Similar to svn_wc_delete3(), but with @a keep_local always set to FALSE. * * @deprecated Provided for backward compatibility with the 1.4 API. */ SVN_DEPRECATED svn_error_t * svn_wc_delete2(const char *path, svn_wc_adm_access_t *adm_access, svn_cancel_func_t cancel_func, void *cancel_baton, svn_wc_notify_func2_t notify_func, void *notify_baton, apr_pool_t *pool); /** * Similar to svn_wc_delete2(), but takes an @c svn_wc_notify_func_t instead. * * @deprecated Provided for backward compatibility with the 1.1 API. */ SVN_DEPRECATED svn_error_t * svn_wc_delete(const char *path, svn_wc_adm_access_t *adm_access, svn_cancel_func_t cancel_func, void *cancel_baton, svn_wc_notify_func_t notify_func, void *notify_baton, apr_pool_t *pool); /** * Put @a path under version control by adding an entry in its parent, * and, if @a path is a directory, adding an administrative area. The * new entry and anything under it is scheduled for addition to the * repository. @a parent_access should hold a write lock for the parent * directory of @a path. If @a path is a directory then an access baton * for @a path will be added to the set containing @a parent_access. * * If @a path does not exist, return @c SVN_ERR_WC_PATH_NOT_FOUND. * * If @a path is a directory, add it at @a depth; otherwise, ignore * @a depth. * * If @a copyfrom_url is non-NULL, it and @a copyfrom_rev are used as * `copyfrom' args. This is for copy operations, where one wants * to schedule @a path for addition with a particular history. * * If @a cancel_func is non-NULL, call it with @a cancel_baton at * various points during the operation. If it returns an error * (typically @c SVN_ERR_CANCELLED), return that error immediately. * * When the @a path has been added, then @a notify_func will be called * (if it is not @c NULL) with the @a notify_baton and the path. * * Return @c SVN_ERR_WC_NODE_KIND_CHANGE if @a path is both an unversioned * directory and a file that is scheduled for deletion or in state deleted. * *
 ### This function currently does double duty -- it is also
 * ### responsible for "switching" a working copy directory over to a
 * ### new copyfrom ancestry and scheduling it for addition.  Here is
 * ### the old doc string from Ben, lightly edited to bring it
 * ### up-to-date, explaining the TRUE, secret life of this function:
* * Given a @a path within a working copy of type KIND, follow this algorithm: * * - if @a path is not under version control: * - Place it under version control and schedule for addition; * if @a copyfrom_url is non-NULL, use it and @a copyfrom_rev as * 'copyfrom' history * * - if @a path is already under version control: * (This can only happen when a directory is copied, in which * case ancestry must have been supplied as well.) * * - Schedule the directory itself for addition with copyfrom history. * - Mark all its children with a 'copied' flag * - Rewrite all the URLs to what they will be after a commit. * - ### @todo Remove old wcprops too, see the '###' below. * *
 ### I think possibly the "switchover" functionality should be
 * ### broken out into a separate function, but its all intertwined in
 * ### the code right now.  Ben, thoughts?  Hard?  Easy?  Mauve?
* * ### Update: see "###" comment in svn_wc_add_repos_file3()'s doc * string about this. * * @since New in 1.6. */ svn_error_t * svn_wc_add3(const char *path, svn_wc_adm_access_t *parent_access, svn_depth_t depth, const char *copyfrom_url, svn_revnum_t copyfrom_rev, svn_cancel_func_t cancel_func, void *cancel_baton, svn_wc_notify_func2_t notify_func, void *notify_baton, apr_pool_t *pool); /** * Similar to svn_wc_add3(), but with the @a depth parameter always * @c svn_depth_infinity. * * @since New in 1.2. * @deprecated Provided for backward compatibility with the 1.5 API. */ SVN_DEPRECATED svn_error_t * svn_wc_add2(const char *path, svn_wc_adm_access_t *parent_access, const char *copyfrom_url, svn_revnum_t copyfrom_rev, svn_cancel_func_t cancel_func, void *cancel_baton, svn_wc_notify_func2_t notify_func, void *notify_baton, apr_pool_t *pool); /** * Similar to svn_wc_add2(), but takes an @c svn_wc_notify_func_t instead. * * @deprecated Provided for backward compatibility with the 1.1 API. */ SVN_DEPRECATED svn_error_t * svn_wc_add(const char *path, svn_wc_adm_access_t *parent_access, const char *copyfrom_url, svn_revnum_t copyfrom_rev, svn_cancel_func_t cancel_func, void *cancel_baton, svn_wc_notify_func_t notify_func, void *notify_baton, apr_pool_t *pool); /** Add a file to a working copy at @a dst_path, obtaining the text-base's * contents from @a new_base_contents, the wc file's content from * @a new_contents, its base properties from @a new_base_props and * wc properties from @a new_props. * * The base text and props normally come from the repository file * represented by the copyfrom args, see below. The new file will * be scheduled for addition with history. * * @a new_contents and @a new_props may be NULL, in which case * the working copy text and props are taken from the base files with * appropriate translation of the file's content. * * @a new_contents must be provided in Normal Form. This is required * in order to pass both special and non-special files through a stream. * * @a adm_access, or an access baton in its associated set, must * contain a write lock for the parent of @a dst_path. * * If @a copyfrom_url is non-NULL, then @a copyfrom_rev must be a * valid revision number, and together they are the copyfrom history * for the new file. * * The @a cancel_func and @a cancel_baton are a standard cancellation * callback, or NULL if no callback is needed. @a notify_func and * @a notify_baton are a notification callback, and will be notified * of the addition of this file. * * Use @a scratch_pool for temporary allocations. * * ### NOTE: the notification callback/baton is not yet used. * * ### This function is very redundant with svn_wc_add(). Ideally, * we'd merge them, so that svn_wc_add() would just take optional * new_props and optional copyfrom information. That way it could be * used for both 'svn add somefilesittingonmydisk' and for adding * files from repositories, with or without copyfrom history. * * The problem with this Ideal Plan is that svn_wc_add() also takes * care of recursive URL-rewriting. There's a whole comment in its * doc string about how that's really weird, outside its core mission, * etc, etc. So another part of the Ideal Plan is that that * functionality of svn_wc_add() would move into a separate function. * * @since New in 1.6 */ svn_error_t * svn_wc_add_repos_file3(const char *dst_path, svn_wc_adm_access_t *adm_access, svn_stream_t *new_base_contents, svn_stream_t *new_contents, apr_hash_t *new_base_props, apr_hash_t *new_props, const char *copyfrom_url, svn_revnum_t copyfrom_rev, svn_cancel_func_t cancel_func, void *cancel_baton, svn_wc_notify_func2_t notify_func, void *notify_baton, apr_pool_t *scratch_pool); /** Same as svn_wc_add_repos_file3(), except that it has pathnames rather * than streams for the text base, and actual text, and has no cancellation. * * @since New in 1.4. * @deprecated Provided for compatibility with the 1.5 API */ SVN_DEPRECATED svn_error_t * svn_wc_add_repos_file2(const char *dst_path, svn_wc_adm_access_t *adm_access, const char *new_text_base_path, const char *new_text_path, apr_hash_t *new_base_props, apr_hash_t *new_props, const char *copyfrom_url, svn_revnum_t copyfrom_rev, apr_pool_t *pool); /** Same as svn_wc_add_repos_file3(), except that it doesn't have the * BASE arguments or cancellation. * * @deprecated Provided for compatibility with the 1.3 API */ SVN_DEPRECATED svn_error_t * svn_wc_add_repos_file(const char *dst_path, svn_wc_adm_access_t *adm_access, const char *new_text_path, apr_hash_t *new_props, const char *copyfrom_url, svn_revnum_t copyfrom_rev, apr_pool_t *pool); /** Remove entry @a name in @a adm_access from revision control. @a name * must be either a file or @c SVN_WC_ENTRY_THIS_DIR. @a adm_access must * hold a write lock. * * If @a name is a file, all its info will be removed from @a adm_access's * administrative directory. If @a name is @c SVN_WC_ENTRY_THIS_DIR, then * @a adm_access's entire administrative area will be deleted, along with * *all* the administrative areas anywhere in the tree below @a adm_access. * * Normally, only administrative data is removed. However, if * @a destroy_wf is TRUE, then all working file(s) and dirs are deleted * from disk as well. When called with @a destroy_wf, any locally * modified files will *not* be deleted, and the special error * @c SVN_ERR_WC_LEFT_LOCAL_MOD might be returned. (Callers only need to * check for this special return value if @a destroy_wf is TRUE.) * * If @a instant_error is TRUE, then return @c * SVN_ERR_WC_LEFT_LOCAL_MOD the instant a locally modified file is * encountered. Otherwise, leave locally modified files in place and * return the error only after all the recursion is complete. * * If @a cancel_func is non-NULL, call it with @a cancel_baton at * various points during the removal. If it returns an error * (typically @c SVN_ERR_CANCELLED), return that error immediately. * * WARNING: This routine is exported for careful, measured use by * libsvn_client. Do *not* call this routine unless you really * understand what the heck you're doing. */ svn_error_t * svn_wc_remove_from_revision_control(svn_wc_adm_access_t *adm_access, const char *name, svn_boolean_t destroy_wf, svn_boolean_t instant_error, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool); /** * Assuming @a path is under version control and in a state of conflict, * then take @a path *out* of this state. If @a resolve_text is TRUE then * any text conflict is resolved, if @a resolve_props is TRUE then any * property conflicts are resolved, if @a resolve_tree is TRUE then any * tree conflicts are resolved. * * If @a depth is @c svn_depth_empty, act only on @a path; if * @c svn_depth_files, resolve @a path and its conflicted file * children (if any); if @c svn_depth_immediates, resolve @a path and * all its immediate conflicted children (both files and directories, * if any); if @c svn_depth_infinity, resolve @a path and every * conflicted file or directory anywhere beneath it. * * If @a conflict_choice is @c svn_wc_conflict_choose_base, resolve the * conflict with the old file contents; if * @c svn_wc_conflict_choose_mine_full, use the original working contents; * if @c svn_wc_conflict_choose_theirs_full, the new contents; and if * @c svn_wc_conflict_choose_merged, don't change the contents at all, * just remove the conflict status, which is the pre-1.5 behavior. * * @c svn_wc_conflict_choose_theirs_conflict and @c * svn_wc_conflict_choose_mine_conflict are not legal for binary * files or properties. * * @a adm_access is an access baton, with a write lock, for @a path. * * Needless to say, this function doesn't touch conflict markers or * anything of that sort -- only a human can semantically resolve a * conflict. Instead, this function simply marks a file as "having * been resolved", clearing the way for a commit. * * The implementation details are opaque, as our "conflicted" criteria * might change over time. (At the moment, this routine removes the * three fulltext 'backup' files and any .prej file created in a conflict, * and modifies @a path's entry.) * * If @a path is not under version control, return @c SVN_ERR_ENTRY_NOT_FOUND. * If @a path isn't in a state of conflict to begin with, do nothing, and * return @c SVN_NO_ERROR. * * If @c path was successfully taken out of a state of conflict, report this * information to @c notify_func (if non-@c NULL.) If only text, only * property, or only tree conflict resolution was requested, and it was * successful, then success gets reported. * * @since New in 1.6. */ svn_error_t * svn_wc_resolved_conflict4(const char *path, svn_wc_adm_access_t *adm_access, svn_boolean_t resolve_text, svn_boolean_t resolve_props, svn_boolean_t resolve_tree, svn_depth_t depth, svn_wc_conflict_choice_t conflict_choice, svn_wc_notify_func2_t notify_func, void *notify_baton, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool); /** * Similar to svn_wc_resolved_conflict4(), but without tree-conflict * resolution support. * * @deprecated Provided for backward compatibility with the 1.5 API. */ SVN_DEPRECATED svn_error_t * svn_wc_resolved_conflict3(const char *path, svn_wc_adm_access_t *adm_access, svn_boolean_t resolve_text, svn_boolean_t resolve_props, svn_depth_t depth, svn_wc_conflict_choice_t conflict_choice, svn_wc_notify_func2_t notify_func, void *notify_baton, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool); /** * Similar to svn_wc_resolved_conflict3(), but without automatic conflict * resolution support, and with @a depth set according to @a recurse: * if @a recurse is TRUE, @a depth is @c svn_depth_infinity, else it is * @c svn_depth_files. * * @deprecated Provided for backward compatibility with the 1.4 API. */ SVN_DEPRECATED svn_error_t * svn_wc_resolved_conflict2(const char *path, svn_wc_adm_access_t *adm_access, svn_boolean_t resolve_text, svn_boolean_t resolve_props, svn_boolean_t recurse, svn_wc_notify_func2_t notify_func, void *notify_baton, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool); /** * Similar to svn_wc_resolved_conflict2(), but takes an * svn_wc_notify_func_t and doesn't have cancellation support. * * @deprecated Provided for backward compatibility with the 1.0 API. */ SVN_DEPRECATED svn_error_t * svn_wc_resolved_conflict(const char *path, svn_wc_adm_access_t *adm_access, svn_boolean_t resolve_text, svn_boolean_t resolve_props, svn_boolean_t recurse, svn_wc_notify_func_t notify_func, void *notify_baton, apr_pool_t *pool); /* Commits. */ /** * Storage type for queued post-commit data. * * @since New in 1.5. */ typedef struct svn_wc_committed_queue_t svn_wc_committed_queue_t; /** * Create a queue for use with svn_wc_queue_committed() and * svn_wc_process_committed_queue(). * * The returned queue and all further allocations required for queueing * new items will also be done from @a pool. * * @since New in 1.5. */ svn_wc_committed_queue_t * svn_wc_committed_queue_create(apr_pool_t *pool); /** * Queue committed items to be processed later by * svn_wc_process_committed_queue(). * * All pointer data passed to this function (@a path, @a adm_access, * @a wcprop_changes and @a checksum) should remain valid until the queue * has been processed by svn_wc_process_committed_queue(). * * Record in @a queue that @a path will need to be bumped after a commit * succeeds. @a adm_access must hold a write lock appropriate for @a path. * * If non-NULL, @a wcprop_changes is an array of svn_prop_t * * changes to wc properties; if an @c svn_prop_t->value is NULL, then * that property is deleted. * * If @a remove_lock is @c TRUE, any entryprops related to a repository * lock will be removed. * * If @a remove_changelist is @c TRUE, any association with a * changelist will be removed. * * If @a path is a file and @a checksum is non-NULL, use @a checksum as * the checksum for the new text base. Otherwise, calculate the checksum * if needed. * * If @a recurse is TRUE and @a path is a directory, then bump every * versioned object at or under @a path. This is usually done for * copied trees. * * Temporary allocations will be performed in @a scratch_pool, and persistent * allocations will use the same pool as @a queue used when it was created. * * @note the @a recurse parameter should be used with extreme care since * it will bump ALL nodes under the directory, regardless of their * actual inclusion in the new revision. * * @since New in 1.6. */ svn_error_t * svn_wc_queue_committed2(svn_wc_committed_queue_t *queue, const char *path, svn_wc_adm_access_t *adm_access, svn_boolean_t recurse, apr_array_header_t *wcprop_changes, svn_boolean_t remove_lock, svn_boolean_t remove_changelist, svn_checksum_t *checksum, apr_pool_t *scratch_pool); /** Same as svn_wc_queue_committed2() but the @a queue parameter has an * extra indirection and @a digest is supplied instead of a checksum type. * * @note despite the extra indirection, this function does NOT allocate * the queue for you. svn_wc_committed_queue_create() must be called. * * @since New in 1.5 * * @deprecated Provided for backwards compatibility with 1.5 */ svn_error_t * svn_wc_queue_committed(svn_wc_committed_queue_t **queue, const char *path, svn_wc_adm_access_t *adm_access, svn_boolean_t recurse, apr_array_header_t *wcprop_changes, svn_boolean_t remove_lock, svn_boolean_t remove_changelist, const unsigned char *digest, apr_pool_t *pool); /** * Bump all items in @a queue to @a new_revnum after a commit succeeds. * @a rev_date and @a rev_author are the (server-side) date and author * of the new revision; one or both may be @c NULL. * * @a adm_access must be associated with all affected directories, and * must hold a write lock in each one. * * @since New in 1.5. */ svn_error_t * svn_wc_process_committed_queue(svn_wc_committed_queue_t *queue, svn_wc_adm_access_t *adm_access, svn_revnum_t new_revnum, const char *rev_date, const char *rev_author, apr_pool_t *pool); /** * @note this function has improper expectations around the operation and * execution of other parts of the Subversion WC library. The resulting * coupling makes this interface near-impossible to support. Documentation * has been removed, as a result. * * @deprecated Use the svn_wc_committed_queue_* functions instead. Provided * for backwards compatibility with the 1.5 API. */ SVN_DEPRECATED svn_error_t * svn_wc_process_committed4(const char *path, svn_wc_adm_access_t *adm_access, svn_boolean_t recurse, svn_revnum_t new_revnum, const char *rev_date, const char *rev_author, apr_array_header_t *wcprop_changes, svn_boolean_t remove_lock, svn_boolean_t remove_changelist, const unsigned char *digest, apr_pool_t *pool); /** @see svn_wc_process_committed4() * * @deprecated Use the svn_wc_committed_queue_* functions instead. Provided * for backwards compatibility with the 1.4 API. */ SVN_DEPRECATED svn_error_t * svn_wc_process_committed3(const char *path, svn_wc_adm_access_t *adm_access, svn_boolean_t recurse, svn_revnum_t new_revnum, const char *rev_date, const char *rev_author, apr_array_header_t *wcprop_changes, svn_boolean_t remove_lock, const unsigned char *digest, apr_pool_t *pool); /** @see svn_wc_process_committed4() * * @deprecated Use the svn_wc_committed_queue_* functions instead. Provided * for backwards compatibility with the 1.3 API. */ SVN_DEPRECATED svn_error_t * svn_wc_process_committed2(const char *path, svn_wc_adm_access_t *adm_access, svn_boolean_t recurse, svn_revnum_t new_revnum, const char *rev_date, const char *rev_author, apr_array_header_t *wcprop_changes, svn_boolean_t remove_lock, apr_pool_t *pool); /** @see svn_wc_process_committed4() * * @deprecated Use the svn_wc_committed_queue_* functions instead. Provided * for backward compatibility with the 1.1 API. */ SVN_DEPRECATED svn_error_t * svn_wc_process_committed(const char *path, svn_wc_adm_access_t *adm_access, svn_boolean_t recurse, svn_revnum_t new_revnum, const char *rev_date, const char *rev_author, apr_array_header_t *wcprop_changes, apr_pool_t *pool); /** * Do a depth-first crawl in a working copy, beginning at @a path. * * Communicate the `state' of the working copy's revisions and depths * to @a reporter/@a report_baton. Obviously, if @a path is a file * instead of a directory, this depth-first crawl will be a short one. * * No locks are or logs are created, nor are any animals harmed in the * process. No cleanup is necessary. @a adm_access must be an access * baton for the @a path hierarchy, it does not require a write lock. * * After all revisions are reported, @a reporter->finish_report() is * called, which immediately causes the RA layer to update the working * copy. Thus the return value may very well reflect the result of * the update! * * If @a depth is @c svn_depth_empty, then report state only for * @a path itself. If @c svn_depth_files, do the same and include * immediate file children of @a path. If @c svn_depth_immediates, * then behave as if for @c svn_depth_files but also report the * property states of immediate subdirectories. If @a depth is * @c svn_depth_infinity, then report state fully recursively. All * descents are only as deep as @a path's own depth permits, of * course. If @a depth is @c svn_depth_unknown, then just use * @c svn_depth_infinity, which in practice means depth of @a path. * * Iff @a honor_depth_exclude is TRUE, the crawler will report paths * whose ambient depth is @c svn_depth_exclude as being excluded, and * thus prevent the server from pushing update data for those paths; * therefore, don't set this flag if you wish to pull in excluded paths. * Note that @c svn_depth_exclude on the target @a path is never * honored, even if @a honor_depth_exclude is TRUE, because we need to * be able to explicitly pull in a target. For example, if this is * the working copy... * * svn co greek_tree_repos wc_dir * svn up --set-depth exclude wc_dir/A/B/E # now A/B/E is excluded * * ...then 'svn up wc_dir/A/B' would report E as excluded (assuming * @a honor_depth_exclude is TRUE), but 'svn up wc_dir/A/B/E' would * not, because the latter is trying to explicitly pull in E. In * general, we never report the update target as excluded. * * Iff @a depth_compatibility_trick is TRUE, then set the @c start_empty * flag on @a reporter->set_path() and @a reporter->link_path() calls * as necessary to trick a pre-1.5 (i.e., depth-unaware) server into * sending back all the items the client might need to upgrade a * working copy from a shallower depth to a deeper one. * * If @a restore_files is TRUE, then unexpectedly missing working files * will be restored from the administrative directory's cache. For each * file restored, the @a notify_func function will be called with the * @a notify_baton and the path of the restored file. @a notify_func may * be @c NULL if this notification is not required. If @a * use_commit_times is TRUE, then set restored files' timestamps to * their last-commit-times. * * If @a traversal_info is non-NULL, then record pre-update traversal * state in it. (Caller should obtain @a traversal_info from * svn_wc_init_traversal_info().) * * @since New in 1.6. */ svn_error_t * svn_wc_crawl_revisions4(const char *path, svn_wc_adm_access_t *adm_access, const svn_ra_reporter3_t *reporter, void *report_baton, svn_boolean_t restore_files, svn_depth_t depth, svn_boolean_t honor_depth_exclude, svn_boolean_t depth_compatibility_trick, svn_boolean_t use_commit_times, svn_wc_notify_func2_t notify_func, void *notify_baton, svn_wc_traversal_info_t *traversal_info, apr_pool_t *pool); /** * Similar to svn_wc_crawl_revisions4, but with @a honor_depth_exclude always * set to false. * * @deprecated Provided for compatibility with the 1.5 API. */ svn_error_t * svn_wc_crawl_revisions3(const char *path, svn_wc_adm_access_t *adm_access, const svn_ra_reporter3_t *reporter, void *report_baton, svn_boolean_t restore_files, svn_depth_t depth, svn_boolean_t depth_compatibility_trick, svn_boolean_t use_commit_times, svn_wc_notify_func2_t notify_func, void *notify_baton, svn_wc_traversal_info_t *traversal_info, apr_pool_t *pool); /** * Similar to svn_wc_crawl_revisions3, but taking svn_ra_reporter2_t * instead of svn_ra_reporter3_t, and therefore only able to report @c * svn_depth_infinity for depths; and taking @a recurse instead of @a * depth; and with @a depth_compatibility_trick always false. * * @deprecated Provided for compatibility with the 1.4 API. */ SVN_DEPRECATED svn_error_t * svn_wc_crawl_revisions2(const char *path, svn_wc_adm_access_t *adm_access, const svn_ra_reporter2_t *reporter, void *report_baton, svn_boolean_t restore_files, svn_boolean_t recurse, svn_boolean_t use_commit_times, svn_wc_notify_func2_t notify_func, void *notify_baton, svn_wc_traversal_info_t *traversal_info, apr_pool_t *pool); /** * Similar to svn_wc_crawl_revisions2(), but takes an svn_wc_notify_func_t * and a @c svn_reporter_t instead. * * @deprecated Provided for backward compatibility with the 1.1 API. */ SVN_DEPRECATED svn_error_t * svn_wc_crawl_revisions(const char *path, svn_wc_adm_access_t *adm_access, const svn_ra_reporter_t *reporter, void *report_baton, svn_boolean_t restore_files, svn_boolean_t recurse, svn_boolean_t use_commit_times, svn_wc_notify_func_t notify_func, void *notify_baton, svn_wc_traversal_info_t *traversal_info, apr_pool_t *pool); /* Updates. */ /** Set @a *wc_root to @c TRUE if @a path represents a "working copy root", * @c FALSE otherwise. Here, @a path is a "working copy root" if its parent * directory is not a WC or if its parent directory's repository URL is not * the parent of its own repository URL. Thus, a switched subtree is * considered to be a working copy root. Also, a deleted tree-conflict * victim is considered a "working copy root" because it has no URL. * * If @a path is not found, return the error @c SVN_ERR_ENTRY_NOT_FOUND. * * Use @a pool for any intermediate allocations. * * @note Due to the way in which "WC-root-ness" is calculated, passing * a @a path of `.' to this function will always return @c TRUE. */ svn_error_t * svn_wc_is_wc_root(svn_boolean_t *wc_root, const char *path, svn_wc_adm_access_t *adm_access, apr_pool_t *pool); /** Conditionally split @a path into an @a anchor and @a target for the * purpose of updating and committing. * * @a anchor is the directory at which the update or commit editor * should be rooted. * * @a target is the actual subject (relative to the @a anchor) of the * update/commit, or "" if the @a anchor itself is the subject. * * Allocate @a anchor and @a target in @a pool. */ svn_error_t * svn_wc_get_actual_target(const char *path, const char **anchor, const char **target, apr_pool_t *pool); /* Update and update-like functionality. */ /** * Set @a *editor and @a *edit_baton to an editor and baton for updating a * working copy. * * If @a ti is non-NULL, record traversal info in @a ti, for use by * post-traversal accessors such as svn_wc_edited_externals(). * * @a anchor is an access baton, with a write lock, for the local path to the * working copy which will be used as the root of our editor. Further * locks will be acquired if the update creates new directories. All * locks, both those in @a anchor and newly acquired ones, will be released * when the editor driver calls @c close_edit. * * @a target is the entry in @a anchor that will actually be updated, or * the empty string if all of @a anchor should be updated. * * The editor invokes @a notify_func with @a notify_baton as the update * progresses, if @a notify_func is non-NULL. * * If @a cancel_func is non-NULL, the editor will invoke @a cancel_func with * @a cancel_baton as the update progresses to see if it should continue. * * If @a conflict_func is non-NULL, then invoke it with @a * conflict_baton whenever a conflict is encountered, giving the * callback a chance to resolve the conflict before the editor takes * more drastic measures (such as marking a file conflicted, or * bailing out of the update). * * If @a fetch_func is non-NULL, then use it (with @a fetch_baton) as * a fallback for retrieving repository files whenever 'copyfrom' args * are sent into editor->add_file(). * * If @a diff3_cmd is non-NULL, then use it as the diff3 command for * any merging; otherwise, use the built-in merge code. * * @a preserved_exts is an array of filename patterns which, when * matched against the extensions of versioned files, determine for * which such files any related generated conflict files will preserve * the original file's extension as their own. If a file's extension * does not match any of the patterns in @a preserved_exts (which is * certainly the case if @a preserved_exts is @c NULL or empty), * generated conflict files will carry Subversion's custom extensions. * * @a target_revision is a pointer to a revision location which, after * successful completion of the drive of this editor, will be * populated with the revision to which the working copy was updated. * * If @a use_commit_times is TRUE, then all edited/added files will * have their working timestamp set to the last-committed-time. If * FALSE, the working files will be touched with the 'now' time. * * If @a allow_unver_obstructions is TRUE, then allow unversioned * obstructions when adding a path. * * If @a depth is @c svn_depth_infinity, update fully recursively. * Else if it is @c svn_depth_immediates, update the uppermost * directory, its file entries, and the presence or absence of * subdirectories (but do not descend into the subdirectories). * Else if it is @c svn_depth_files, update the uppermost directory * and its immediate file entries, but not subdirectories. * Else if it is @c svn_depth_empty, update exactly the uppermost * target, and don't touch its entries. * * If @a depth_is_sticky is set and @a depth is not @c * svn_depth_unknown, then in addition to updating PATHS, also set * their sticky ambient depth value to @a depth. * * @since New in 1.5. */ svn_error_t * svn_wc_get_update_editor3(svn_revnum_t *target_revision, svn_wc_adm_access_t *anchor, const char *target, svn_boolean_t use_commit_times, svn_depth_t depth, svn_boolean_t depth_is_sticky, svn_boolean_t allow_unver_obstructions, svn_wc_notify_func2_t notify_func, void *notify_baton, svn_cancel_func_t cancel_func, void *cancel_baton, svn_wc_conflict_resolver_func_t conflict_func, void *conflict_baton, svn_wc_get_file_t fetch_func, void *fetch_baton, const char *diff3_cmd, apr_array_header_t *preserved_exts, const svn_delta_editor_t **editor, void **edit_baton, svn_wc_traversal_info_t *ti, apr_pool_t *pool); /** * Similar to svn_wc_get_update_editor3() but with the @a * allow_unver_obstructions parameter always set to FALSE, @a * conflict_func and baton set to NULL, @a fetch_func and baton set to * NULL, @a preserved_exts set to NULL, @a depth_is_sticky set to * FALSE, and @a depth set according to @a recurse: if @a recurse is * TRUE, pass @c svn_depth_infinity, if FALSE, pass @c * svn_depth_files. * * @deprecated Provided for backward compatibility with the 1.4 API. */ SVN_DEPRECATED svn_error_t * svn_wc_get_update_editor2(svn_revnum_t *target_revision, svn_wc_adm_access_t *anchor, const char *target, svn_boolean_t use_commit_times, svn_boolean_t recurse, svn_wc_notify_func2_t notify_func, void *notify_baton, svn_cancel_func_t cancel_func, void *cancel_baton, const char *diff3_cmd, const svn_delta_editor_t **editor, void **edit_baton, svn_wc_traversal_info_t *ti, apr_pool_t *pool); /** * Similar to svn_wc_get_update_editor2(), but takes an svn_wc_notify_func_t * instead. * * @deprecated Provided for backward compatibility with the 1.1 API. */ SVN_DEPRECATED svn_error_t * svn_wc_get_update_editor(svn_revnum_t *target_revision, svn_wc_adm_access_t *anchor, const char *target, svn_boolean_t use_commit_times, svn_boolean_t recurse, svn_wc_notify_func_t notify_func, void *notify_baton, svn_cancel_func_t cancel_func, void *cancel_baton, const char *diff3_cmd, const svn_delta_editor_t **editor, void **edit_baton, svn_wc_traversal_info_t *ti, apr_pool_t *pool); /** * A variant of svn_wc_get_update_editor(). * * Set @a *editor and @a *edit_baton to an editor and baton for "switching" * a working copy to a new @a switch_url. (Right now, this URL must be * within the same repository that the working copy already comes * from.) @a switch_url must not be @c NULL. * * If @a ti is non-NULL, record traversal info in @a ti, for use by * post-traversal accessors such as svn_wc_edited_externals(). * * @a anchor is an access baton, with a write lock, for the local path to the * working copy which will be used as the root of our editor. Further * locks will be acquired if the switch creates new directories. All * locks, both those in @a anchor and newly acquired ones, will be released * when the editor driver calls @c close_edit. * * @a target is the entry in @a anchor that will actually be updated, or * empty if all of @a anchor should be updated. * * The editor invokes @a notify_func with @a notify_baton as the switch * progresses, if @a notify_func is non-NULL. * * If @a cancel_func is non-NULL, it will be called with @a cancel_baton as * the switch progresses to determine if it should continue. * * If @a conflict_func is non-NULL, then invoke it with @a * conflict_baton whenever a conflict is encountered, giving the * callback a chance to resolve the conflict before the editor takes * more drastic measures (such as marking a file conflicted, or * bailing out of the switch). * * If @a diff3_cmd is non-NULL, then use it as the diff3 command for * any merging; otherwise, use the built-in merge code. * * @a preserved_exts is an array of filename patterns which, when * matched against the extensions of versioned files, determine for * which such files any related generated conflict files will preserve * the original file's extension as their own. If a file's extension * does not match any of the patterns in @a preserved_exts (which is * certainly the case if @a preserved_exts is @c NULL or empty), * generated conflict files will carry Subversion's custom extensions. * * @a target_revision is a pointer to a revision location which, after * successful completion of the drive of this editor, will be * populated with the revision to which the working copy was updated. * * If @a use_commit_times is TRUE, then all edited/added files will * have their working timestamp set to the last-committed-time. If * FALSE, the working files will be touched with the 'now' time. * * @a depth and @a depth_is_sticky behave as for svn_wc_get_update_editor3(). * * If @a allow_unver_obstructions is TRUE, then allow unversioned * obstructions when adding a path. * * @since New in 1.5. */ svn_error_t * svn_wc_get_switch_editor3(svn_revnum_t *target_revision, svn_wc_adm_access_t *anchor, const char *target, const char *switch_url, svn_boolean_t use_commit_times, svn_depth_t depth, svn_boolean_t depth_is_sticky, svn_boolean_t allow_unver_obstructions, svn_wc_notify_func2_t notify_func, void *notify_baton, svn_cancel_func_t cancel_func, void *cancel_baton, svn_wc_conflict_resolver_func_t conflict_func, void *conflict_baton, const char *diff3_cmd, apr_array_header_t *preserved_exts, const svn_delta_editor_t **editor, void **edit_b