53 lines
1.5 KiB
C
53 lines
1.5 KiB
C
/*
|
|
* Copyright (C) 2003 Andrew Cameron
|
|
*
|
|
* This library is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Lesser General Public License
|
|
* as published by the Free Software Foundation; either version 2.1,
|
|
* or (at your option) any later version.
|
|
*
|
|
* This library is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
* License along with this library; see the file COPYING.LIB. If
|
|
* not, write to the Free Software Foundation, Inc., 59 Temple Place,
|
|
* Suite 330, Boston, MA 02111-1307 USA
|
|
*/
|
|
|
|
#ifdef USE_LOCKSERVER
|
|
|
|
#ifndef __MINGW32__
|
|
#include <sys/socket.h>
|
|
#include <netinet/in.h>
|
|
#include <netdb.h>
|
|
#else
|
|
#include <winsock2.h>
|
|
#include <wininet.h>
|
|
#include <windows.h>
|
|
#include <process.h>
|
|
WORD wVersionRequested;
|
|
WSADATA wsaData;
|
|
int err;
|
|
#endif
|
|
|
|
#define SERVER_PORT 8675
|
|
|
|
struct fd_filename
|
|
{
|
|
int fd;
|
|
char filesname[TCOB_MAX_PATHLN];
|
|
};
|
|
|
|
int set_lockserver_lock( char *filename, char *key);
|
|
int get_lockserver_lock_owner( char *filename, char *key);
|
|
int lockserver_release_specific_lock( char *filename, char *key);
|
|
int lockserver_release_all_locks();
|
|
void insert_filename( int fdb , char *filename );
|
|
char *fd_filename( int fdb );
|
|
void remove_filename( int fdb );
|
|
|
|
#endif
|