.ad 8
.bm 8
.fm 4
.bt $Copyright by   SAP AG, 1998$$Page %$
.tm 12
.hm 6
.hs 3
.tt 1 $SQL$Project Distributed Database System$VSP99$
.tt 2 $$$
.tt 3 $$link check msg$1998-05-25$
***********************************************************
.nf


    ========== licence begin LGPL
    Copyright (C) 2000 SAP AG

    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 of the License, 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; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    ========== licence end

.fo
.nf
.sp
Module  : link_check_msg
=========
.sp
Purpose : This module generates a 64 char long msg line
          for the linkcheck errors.
.CM *-END-* purpose -------------------------------------
.sp
.cp 3
Define  :
 
        FUNCTION
              s99check_copyright
                    (cpr1 : tsp_copyright;
                    cpr2  : tsp_copyright) : boolean;
 
        PROCEDURE
              s99linkcheckmsg (
                    VAR msg      : tsp_c64;
                    check_module : tsp_int4;
                    stamp_date   : tsp_int4;
                    module_name  : tsp_c4);
 
.CM *-END-* define --------------------------------------
.sp;.cp 3
Use     :
 
.CM *-END-* use -----------------------------------------
.sp;.cp 3
Synonym :
 
.CM *-END-* synonym -------------------------------------
.sp;.cp 3
Author  : 
.sp
.cp 3
Created : 1990-07-25
.sp
.cp 3
Version : 1998-05-25
.sp
.cp 3
Release :      Date : 1998-05-25
.sp
***********************************************************
.sp
.cp 10
.fo
.oc _/1
Specification:
.CM *-END-* specification -------------------------------
.sp 2
***********************************************************
.sp
.cp 10
.fo
.oc _/1
Description:
.CM *-END-* description ---------------------------------
.sp 2
***********************************************************
.sp
.cp 10
.nf
.oc _/1
Structure:
 
.CM *-END-* structure -----------------------------------
.sp 2
**********************************************************
.sp
.cp 10
.nf
.oc _/1
.CM -lll-
Code    :
 
 
(*------------------------------*) 
 
PROCEDURE
      s99linkcheckmsg (
            VAR msg      : tsp_c64;
            check_module : tsp_int4;
            stamp_date   : tsp_int4;
            module_name  : tsp_c4);
 
VAR
      date_in_module : tsp_int4;
      i              : integer;
      retcode        : integer;
      helpname       : tsp_name;
 
BEGIN
(*         10        20        30        40        50        60    *)
(* 123456789-123456789-123456789-123456789-123456789-123456789-1234*)
(*                        module_name                              *)
(*               check_module      check_module         stamp_date *)
(* linkcheck value '1234' in VAK36 (1990-07-25) differs from '1234'*)
(*  *)
&ifndef nocheck
date_in_module := check_module DIV 100000;
IF  NOT (date_in_module = stamp_date)
THEN
    BEGIN
    retcode   := -9876;
    helpname  := 'linkcheck value ..';
    FOR i := 1 TO mxsp_c64 DO
        msg [ i ] := '*';
    (*ENDFOR*) 
    FOR i := 1 TO 16 DO
        msg [ i ] := helpname[ i ];
    (*ENDFOR*) 
    msg[ 17 ] := '''';
    sp99int (date_in_module, 4, 18, msg);
    msg[ 22 ] := '''';
    msg[ 23 ] := ' ';
    msg[ 24 ] := 'i';
    msg[ 25 ] := 'n';
    msg[ 26 ] := ' ';
    msg[ 27 ] := 'V';
    FOR i := 1 TO 4 DO
        msg [ 27+i ] := module_name[ i ];
    (*ENDFOR*) 
    msg[ 32 ] := ' ';
    msg[ 33 ] := '(';
    msg[ 34 ] := '1';
    msg[ 35 ] := '9';
    (* ----- jahr ----- *)
    i := ((check_module DIV 10000) - ((check_module DIV 100000) * 10));
    IF  (i <= 9) AND (i > 5)
    THEN
        (* 1986..89 *)
        msg[ 36 ] := '8'
    ELSE
        (* 1990..95 *)
        msg[ 36 ] := '9';
    (*ENDIF*) 
    sp99int (i, 1, 37, msg);
    msg[ 38 ] := '-';
    (* ----- monat ----- *)
    i := ((check_module DIV 100) - ((check_module DIV 10000) * 100));
    IF  i < 10
    THEN
        BEGIN
        msg[ 39 ] := '0';
        sp99int (i, 1, 40, msg);
        END
    ELSE
        sp99int (i, 2, 39, msg);
    (*ENDIF*) 
    msg[ 41 ] := '-';
    (* ----- tag ----- *)
    i := (check_module MOD (check_module DIV 100));
    IF  i < 10
    THEN
        BEGIN
        msg[ 42 ] := '0';
        sp99int (i, 1, 43, msg);
        END
    ELSE
        sp99int (i, 2, 42, msg);
    (*ENDIF*) 
    helpname := ') differs from ...';
    FOR i := 1 TO 15 DO
        msg [ 43+i ] := helpname[ i ];
    (*ENDFOR*) 
    msg[ 59 ] := '''';
    sp99int (stamp_date, 4, 60, msg);
    msg[ 64 ] := '''';
    END
&endif
(*ENDIF*) 
END;
 
(*------------------------------*) 
 
FUNCTION
      s99check_copyright
            (cpr1 : tsp_copyright;
            cpr2  : tsp_copyright) : boolean;
 
BEGIN
(*        '123456789-123456789-123456789-123456789-12345678'; *)
(* cpr1 = ' *** copyright by SAP AG, 1998 - all rights     '; *)
(* cpr2 = ' reserved - program property of SAP AG ***      '; *)
(* ================================================================= *)
(* Der Text des Copyright-Vermerkes wird hier in wild durcheinander- *)
(* gewuerfelter Reihenfolge abgefragt. Bei einer Veraenderung des    *)
(* Textes (z. B. durch Hacker, .. ] erfolgt durch die aufrufende     *)
(* Procedur ein (slq/v)abort.                                        *)
(* ================================================================= *)
IF     (cpr1[ 27 ] <> '1') OR (cpr2[ 41 ] <> '*') OR (cpr1[  1 ] <> ' ')
    OR (cpr1[  5 ] <> ' ') OR (cpr2[ 48 ] <> ' ') OR (cpr1[ 19 ] <> 'S')
    OR (cpr2[ 33 ] <> 'S') OR (cpr1[  3 ] <> '*') OR (cpr2[ 46 ] <> ' ')
    OR (cpr1[  4 ] <> '*') OR (cpr2[ 47 ] <> ' ') OR (cpr1[ 24 ] <> 'G')
    OR (cpr2[ 38 ] <> 'G') OR (cpr1[ 28 ] <> '9') OR (cpr2[ 42 ] <> '*')
    OR (cpr2[ 44 ] <> ' ') OR (cpr1[ 26 ] <> ' ') OR (cpr2[ 40 ] <> '*')
    OR (cpr1[  2 ] <> '*') OR (cpr2[ 45 ] <> ' ') OR (cpr1[ 22 ] <> ' ')
    OR (cpr1[ 21 ] <> 'P') OR (cpr2[ 35 ] <> 'P') OR (cpr1[ 29 ] <> '9')
    OR (cpr2[ 43 ] <> ' ') OR (cpr1[ 25 ] <> ',') OR (cpr2[ 39 ] <> ' ')
    OR (cpr2[ 36 ] <> ' ') OR (cpr1[ 23 ] <> 'A') OR (cpr2[ 37 ] <> 'A')
    OR (cpr1[ 20 ] <> 'A') OR (cpr2[ 34 ] <> 'A') OR (cpr1[ 34 ] <> 'a')
    OR (cpr2[ 31 ] <> 'f') OR (cpr2[ 30 ] <> 'o') OR (cpr1[ 33 ] <> ' ')
    OR (cpr1[ 16 ] <> 'b') OR (cpr1[ 35 ] <> 'l') OR (cpr1[ 32 ] <> '-')
    OR (cpr1[ 35 ] <> 'l')
    OR NOT (cpr2[ 33 ] = cpr1[ 19 ])
    OR NOT (cpr1[ 21 ] = cpr2[ 35 ])
    OR NOT (cpr1[ 24 ] = cpr2[ 38 ])
THEN
    s99check_copyright := false
ELSE
    s99check_copyright := true
(*ENDIF*) 
END;
 
&ifndef nocheck
(*------------------------------*) 
 
PROCEDURE
      sp99int (int : tsp_int4;
            int_len     : integer;
            ln_pos      : integer;
            VAR ln      : tsp_c64);
 
VAR
      rem : tsp_int4;
      i   : integer;
 
BEGIN
IF  int < 0
THEN
    rem := -int
ELSE
    rem := int;
(*ENDIF*) 
FOR i := int_len DOWNTO 1 DO
    BEGIN
    ln[ ln_pos+i-1 ] := chr((rem MOD 10) + ord('0'));
    rem := rem DIV 10
    END;
(*ENDFOR*) 
IF  rem > 0
THEN (* overflow *)
    ln[ ln_pos ] := '*'
ELSE
    BEGIN
    i := ln_pos;
    WHILE (i < ln_pos + int_len - 1) AND (ln[ i ] = '0') DO
        BEGIN
        ln[ i ] := ' ';
        i := i + 1
        END;
    (*ENDWHILE*) 
    IF  int < 0
    THEN
        BEGIN
        IF  i > ln_pos
        THEN
            ln[ i-1 ] := '-'
        ELSE (* underflow *)
            ln[ ln_pos ] := '*'
        (*ENDIF*) 
        END
    (*ENDIF*) 
    END
(*ENDIF*) 
END;
 
&endif
 
.CM *-END-* code ----------------------------------------
.SP 2 
***********************************************************
*-PRETTY-*  statements    :         64
*-PRETTY-*  lines of code :        192        PRETTYX 3.10 
*-PRETTY-*  lines in file :        290         1997-12-10 
.PA 
