File:  [Coherent Logic Development] / freem / src / locktab.h
Revision 1.2: download - view: text, annotated - select for diffs
Sun Mar 9 15:20:18 2025 UTC (12 months, 3 weeks ago) by snw
Branches: MAIN
CVS tags: HEAD
Begin formatting overhaul and REUSE compliance

    1: /*
    2:  *                            *
    3:  *                           * *
    4:  *                          *   *
    5:  *                     ***************
    6:  *                      * *       * *
    7:  *                       *  MUMPS  *
    8:  *                      * *       * *
    9:  *                     ***************
   10:  *                          *   *
   11:  *                           * *
   12:  *                            *
   13:  *
   14:  *   locktab.h
   15:  *    lock table data structures
   16:  *
   17:  *  
   18:  *   Author: Serena Willis <snw@coherent-logic.com>
   19:  *    Copyright (C) 1998 MUG Deutschland
   20:  *    Copyright (C) 2021 Coherent Logic Development LLC
   21:  *
   22:  *
   23:  *   This file is part of FreeM.
   24:  *
   25:  *   FreeM is free software: you can redistribute it and/or modify
   26:  *   it under the terms of the GNU Affero Public License as published by
   27:  *   the Free Software Foundation, either version 3 of the License, or
   28:  *   (at your option) any later version.
   29:  *
   30:  *   FreeM is distributed in the hope that it will be useful,
   31:  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
   32:  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   33:  *   GNU Affero Public License for more details.
   34:  *
   35:  *   You should have received a copy of the GNU Affero Public License
   36:  *   along with FreeM.  If not, see <https://www.gnu.org/licenses/>.
   37:  *
   38:  **/
   39: 
   40: #if !defined(__FREEM_LOCKTAB_H)
   41: # define __FREEM_LOCKTAB_H
   42: 
   43: #define NREF_MAXLEN 800
   44: 
   45: typedef struct locktab_ent_t {
   46: 
   47:     char namespace[255];
   48:     char nref[NREF_MAXLEN];
   49: 
   50:     int tp_level;
   51:     pid_t owner_job;
   52:     int ct;
   53:     
   54:     struct locktab_ent_t *next;
   55:     
   56: } locktab_ent_t;
   57: 
   58: /* function prototypes */
   59: extern void locktab_init(void);
   60: extern void lock(char *lockarg, long time_out, char type);
   61: extern void locktab_increment(char *key, long lck_timeout, short old_lock);
   62: extern void locktab_decrement(char *key, long lck_timeout);
   63: extern void locktab_unlock_all(void);
   64: extern locktab_ent_t *locktab_find(char *key);
   65: extern locktab_ent_t *locktab_insert(char *key);
   66: extern int locktab_count(char *key);
   67: extern unsigned long locktab_pages(void);
   68: extern unsigned long locktab_bytes(void);
   69: extern short locktab_get_sem(void);
   70: extern void locktab_release_sem(void);
   71: extern void locktab_dump(void);
   72: 
   73: #endif

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>