monotone

monotone Mtn Source Tree

Root/platform.hh

1#ifndef __PLATFORM_HH__
2#define __PLATFORM_HH__
3
4// copyright (C) 2002, 2003, 2004 graydon hoare <graydon@pobox.com>
5// all rights reserved.
6// licensed to the public under the terms of the GNU GPL (>= 2)
7// see the file COPYING for details
8
9// this describes functions to be found, alternatively, in win32/* or unix/*
10// directories.
11
12#include <string>
13
14#include "vocab.hh"
15#include "config.h"
16#include "paths.hh"
17
18void read_password(std::string const & prompt, char * buf, size_t bufsz);
19void get_system_flavour(std::string & ident);
20bool is_executable(const char *path);
21
22// For LUA
23int existsonpath(const char *exe);
24int make_executable(const char *path);
25pid_t process_spawn(const char * const argv[]);
26int process_wait(pid_t pid, int *res);
27int process_kill(pid_t pid, int signal);
28int process_sleep(unsigned int seconds);
29
30// for term selection
31bool have_smart_terminal();
32// this function cannot call W/P/L, because it is called by the tick printing
33// code.
34// return value of 0 means "unlimited"
35unsigned int terminal_width();
36
37// for netsync
38void start_platform_netsync();
39void end_platform_netsync();
40
41// for "reckless mode" working copy change detection.
42// returns 'true' if it has generated a valid inodeprint; returns 'false' if
43// there was a problem, in which case we should act as if the inodeprint has
44// changed.
45bool inodeprint_file(file_path const & file, hexenc<inodeprint> & ip);
46
47// for netsync 'serve' pidfile support
48pid_t get_process_id();
49
50// filesystem stuff
51// FIXME: BUG: this returns a string in the filesystem charset/encoding
52std::string get_current_working_dir();
53// calls N() if fails
54void change_current_working_dir(any_path const & to);
55utf8 tilde_expand(utf8 const & path);
56utf8 get_homedir();
57namespace path
58{
59 typedef enum { nonexistent, directory, file } status;
60};
61path::status get_path_status(any_path const & path);
62
63#endif // __PLATFORM_HH__

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status