Aegis  4.25.D505
/home/archives/aegis/branch.4/branch.25/delta28933.505/libaegis/lock.h
Go to the documentation of this file.
00001 //
00002 // aegis - project change supervisor
00003 // Copyright (C) 1991-1993, 1996, 2001, 2002, 2004-2008, 2012 Peter Miller
00004 //
00005 // This program is free software; you can redistribute it and/or modify
00006 // it under the terms of the GNU General Public License as published by
00007 // the Free Software Foundation; either version 3 of the License, or (at
00008 // your option) any later version.
00009 //
00010 // This program is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 // General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU General Public License
00016 // along with this program. If not, see <http://www.gnu.org/licenses/>.
00017 //
00018 
00019 #ifndef LOCK_H
00020 #define LOCK_H
00021 
00022 struct string_ty;
00023 
00024 typedef void (*lock_callback_ty)(void *);
00025 
00026 void lock_prepare_gstate(lock_callback_ty, void *);
00027 void lock_prepare_pstate(struct string_ty *project_name,
00028     lock_callback_ty, void *);
00029 void lock_prepare_ustate(int uid, lock_callback_ty, void *);
00030 void lock_prepare_ustate_all(lock_callback_ty, void *);
00031 void lock_prepare_cstate(struct string_ty *project_name, long change_number,
00032     lock_callback_ty, void *);
00033 void lock_take(void);
00034 void lock_release(void);
00035 long lock_magic(void);
00036 void lock_prepare_baseline_read(struct string_ty *project_name,
00037     lock_callback_ty, void *);
00038 void lock_prepare_baseline_write(struct string_ty *project_name,
00039     lock_callback_ty, void *);
00040 void lock_prepare_history(struct string_ty *project_name, lock_callback_ty,
00041     void *);
00042 
00043 enum lock_walk_name
00044 {
00045     lock_walk_name_master,
00046     lock_walk_name_gstate,
00047     lock_walk_name_pstate,
00048     lock_walk_name_cstate,
00049     lock_walk_name_baseline,
00050     lock_walk_name_baseline_priority,
00051     lock_walk_name_history,
00052     lock_walk_name_ustate,
00053     lock_walk_name_unknown
00054 };
00055 
00056 enum lock_walk_type
00057 {
00058     lock_walk_type_shared,
00059     lock_walk_type_exclusive,
00060     lock_walk_type_unknown
00061 };
00062 
00063 struct lock_walk_found
00064 {
00065     lock_walk_name  name;
00066     lock_walk_type  type;
00067     long            subset;
00068     long            address;
00069     int             pid;
00070     int             pid_is_local;
00071 };
00072 
00073 typedef void (*lock_walk_callback)(lock_walk_found *);
00074 
00075 void lock_walk(lock_walk_callback);
00076 void lock_release_child(void);
00077 
00082 void lock_quitter(void);
00083 
00092 bool lock_active(void);
00093 
00094 
00095 #endif // LOCK_H
00096 // vim: set ts=8 sw=4 et :