KNF, SPDX and some other cleanups
Signed-off-by: Masanori Ogino <mogino@acm.org>
This commit is contained in:
parent
f7a724a077
commit
6fa42826a9
4 changed files with 152 additions and 175 deletions
22
.gitmodules
vendored
22
.gitmodules
vendored
|
|
@ -1,3 +1,25 @@
|
|||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
# Copyright (c) 2023 Masanori Ogino
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in all
|
||||
# copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
[submodule "dict"]
|
||||
path = dict
|
||||
url = ../sj3-dict
|
||||
|
|
|
|||
34
Const.h
34
Const.h
|
|
@ -1,4 +1,6 @@
|
|||
/*
|
||||
/*-
|
||||
* SPDX-License-Identifier: MIT-open-group
|
||||
*
|
||||
* Copyright (c) 1991-1994 Sony Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
|
|
@ -24,24 +26,10 @@
|
|||
* shall not be used in advertising or otherwise to promote the sale, use
|
||||
* or other dealings in this Software without prior written authorization
|
||||
* from Sony Corporation.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $SonyRCSfile: Const.h,v $
|
||||
* $SonyRevision: 1.4 $
|
||||
* $SonyDate: 1997/01/23 11:20:52 $
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Change some default values.
|
||||
* Patched by Hidekazu Kuroki(hidekazu@cs.titech.ac.jp) 1996/8/10
|
||||
*/
|
||||
|
||||
#ifndef _Const_H_
|
||||
#define _Const_H_ 1
|
||||
#ifndef SJ3_CONST_H_
|
||||
#define SJ3_CONST_H_
|
||||
|
||||
#include "Paths.h"
|
||||
|
||||
|
|
@ -70,17 +58,7 @@
|
|||
#define MaxClientNum 512
|
||||
#define LogOutFile ErrorOutFile
|
||||
#define PortName "sj3"
|
||||
#ifdef TLI
|
||||
#define LocalHost "localhost"
|
||||
#define ProtoName "tcp"
|
||||
#define PortNumber "3000"
|
||||
#else
|
||||
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
|
||||
#define PortNumber 3086
|
||||
#else /* ! __FreeBSD__ __NetBSD__ __OpenBSD__ __DragonFly__ */
|
||||
#define PortNumber 3000
|
||||
#endif /* ! __FreeBSD__ __NetBSD__ __OpenBSD__ __DragonFly__ */
|
||||
#endif
|
||||
#define DirectryMode 0755
|
||||
#define DictFileMode 0644
|
||||
#define MODE_MASK 0777
|
||||
|
|
@ -101,4 +79,4 @@
|
|||
# define FALSE (!TRUE)
|
||||
#endif
|
||||
|
||||
#endif /* _Const_H_ */
|
||||
#endif /* SJ3_Const_H_ */
|
||||
|
|
|
|||
21
Dict.h
21
Dict.h
|
|
@ -1,4 +1,6 @@
|
|||
/*
|
||||
/*-
|
||||
* SPDX-License-Identifier: MIT-open-group
|
||||
*
|
||||
* Copyright (c) 1991-1994 Sony Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
|
|
@ -24,24 +26,16 @@
|
|||
* shall not be used in advertising or otherwise to promote the sale, use
|
||||
* or other dealings in this Software without prior written authorization
|
||||
* from Sony Corporation.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $SonyRCSfile: Dict.h,v $
|
||||
* $SonyRevision: 1.1 $
|
||||
* $SonyDate: 1994/06/03 08:00:55 $
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#ifndef SJ3_DICT_H_
|
||||
#define SJ3_DICT_H_
|
||||
|
||||
#define VersionPos 0
|
||||
|
||||
#define PasswdPos 16
|
||||
#define PasswdLen 16
|
||||
|
||||
|
||||
#define StdyNormPos 32
|
||||
#define StdyNormLen 36
|
||||
#define StdyNormNum 40
|
||||
|
|
@ -54,7 +48,6 @@
|
|||
#define StdyClSegPos 64
|
||||
#define StdyClSegLen 68
|
||||
|
||||
|
||||
#define DictIdxPos 32
|
||||
#define DictIdxLen 36
|
||||
|
||||
|
|
@ -69,14 +62,14 @@
|
|||
#define DictASegPos 80
|
||||
#define DictASegLen 84
|
||||
|
||||
|
||||
#define HeaderPos 0
|
||||
#define HeaderLength 128
|
||||
#define CommentPos 128
|
||||
#define CommentLength 128
|
||||
|
||||
|
||||
#define Byte2Long(c3,c2,c1,c0) (((c3) << (8*3)) | ((c2) << (8*2)) | \
|
||||
((c1) << (8*1)) | ((c0) << (8*0)))
|
||||
#define StdyVersion Byte2Long('S', 2, 0, 0)
|
||||
#define DictVersion Byte2Long('D', 2, 0, 0)
|
||||
|
||||
#endif /* SJ3_DICT_H_ */
|
||||
|
|
|
|||
32
Struct.h
32
Struct.h
|
|
@ -1,4 +1,6 @@
|
|||
/*
|
||||
/*-
|
||||
* SPDX-License-Identifier: MIT-open-group
|
||||
*
|
||||
* Copyright (c) 1991-1994 Sony Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
|
|
@ -24,19 +26,10 @@
|
|||
* shall not be used in advertising or otherwise to promote the sale, use
|
||||
* or other dealings in this Software without prior written authorization
|
||||
* from Sony Corporation.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $SonyRCSfile: Struct.h,v $
|
||||
* $SonyRevision: 1.3 $
|
||||
* $SonyDate: 1994/10/21 05:13:34 $
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef _Struct_H_
|
||||
#define _Struct_H_ 1
|
||||
#ifndef SJ3_STRUCT_H_
|
||||
#define SJ3_STRUCT_H_
|
||||
|
||||
#include <sys/select.h>
|
||||
#include <sys/types.h>
|
||||
|
|
@ -64,8 +57,8 @@ typedef struct global {
|
|||
u_char *Jcnvstart;
|
||||
short Jcnvlen;
|
||||
u_char *Jystart;
|
||||
u_char Jhyomi[MaxPhInputLen+1];
|
||||
u_char Jorgyomi[MaxClInputLen*2+1];
|
||||
u_char Jhyomi[MaxPhInputLen + 1];
|
||||
u_char Jorgyomi[MaxClInputLen*2 + 1];
|
||||
|
||||
u_char Jkanjibuf[MinPhOutputLen];
|
||||
u_char *Jkanjipos;
|
||||
|
|
@ -122,10 +115,8 @@ typedef struct global {
|
|||
u_char *Jpeephptr;
|
||||
u_char *Jpeepkptr;
|
||||
TypeDicSeg Jpeepidx;
|
||||
|
||||
} Global;
|
||||
|
||||
|
||||
typedef struct dictfile {
|
||||
DICT dict;
|
||||
int refcnt;
|
||||
|
|
@ -144,7 +135,6 @@ typedef struct dictfile {
|
|||
struct dictfile *link;
|
||||
} DictFile;
|
||||
|
||||
|
||||
typedef struct stdyfile {
|
||||
STDY stdy;
|
||||
int refcnt;
|
||||
|
|
@ -157,7 +147,6 @@ typedef struct stdyfile {
|
|||
struct stdyfile *link;
|
||||
} StdyFile;
|
||||
|
||||
|
||||
typedef struct workarea {
|
||||
int refcnt;
|
||||
int lock;
|
||||
|
|
@ -167,7 +156,6 @@ typedef struct workarea {
|
|||
Global global;
|
||||
} WorkArea;
|
||||
|
||||
|
||||
typedef struct client {
|
||||
int fd;
|
||||
char host[HostNameLen];
|
||||
|
|
@ -178,12 +166,8 @@ typedef struct client {
|
|||
StdyFile *stdy;
|
||||
short version;
|
||||
u_char def_char[2];
|
||||
#if (defined(TLI) && defined(SOCK_UNIX))
|
||||
int unix_flag;
|
||||
#endif
|
||||
uid_t uid;
|
||||
struct client *next;
|
||||
} Client;
|
||||
|
||||
#endif /* _Struct_H_ */
|
||||
|
||||
#endif /* SJ3_STRUCT_H_ */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue