.pa
:h4.Multi-CodePage Message Intra-Component Interfaces
:h4.***** MSG.DLL - RAMFIND  *****
.fo off
/****************************************************************************/
/*  SUBROUTINE NAME: RAMFIND                                                */
/*                                                                          */
/*  DESCRIPTION NAME: Search for a message in ram                           */
/*                                                                          */
/*  FUNCTION: Searches for a give message , messagefile and codepage in the */
/*            bound message data segment.                                   */
/*                                                                          */
/*  NOTE: The filename must be stripped of path info before ramfind is      */
/*        called. Also ramfind looks for a perfect match of Language ID,    */
/*        Language Family and codepage.  If it can't find a perfect match   */
/*        then it fails so that a better match will be looked for on disk.  */
/*                                                                          */
/*  ENTRY POINT: RAMFIND                                                    */
/*                                                                          */
/*  INPUT: ARGVAR COMPID,DWORD    -ptr to asciiz component id string        */
/*         ARGVAR FILENAME,DWORD  -ptr to asciiz filename                   */
/*         ARGVAR MSGNUMBER,WORD  -message id requested                     */
/*         ARGVAR MSGSEGMENT,DWORD-ptr to start of message segment          */
/* |       ARGVAR CPPTR     ,DWORD-ptr to code page info                    */
/*                                                                          */
/*  EXIT-NORMAL: CFL = 1   --> message not in ram                           */
/*               CFL = 0   --> message file found                           */
/*               DS : SI   --> message                                      */
/*               CX        --> message length                               */
/*                                                                          */
/*                                                                          */
/*  EXIT-ERROR:  CFL = 1                                                    */
/*                                                                          */
/*  SIDE EFFECTS: None.                                                     */
/*                                                                          */
/*  INTERNAL REFERENCES: FNSRCH  -- search for filename                     */
/*                       TABLSRCH -- search for message within file         */
/*                                                                          */
/*                                                                          */
/*  EXTERNAL REFERENCES:                                                    */
/*                                                                          */
/*                                                                          */
/*  PSEUDO CODE:                                                            */
/*                                                                          */
/*  BEGIN                                                                   */
/*                                                                          */
/* create mask for parameters passed on the stack                           */
/* setup registers                                                          */
/*  Get number of file names in segment                                     */
/*  point to first file name                                                */
/*  save pointer to first file name                                         */
/*  compare file names                                                      */
/*  if no match then increment pointer to next filename                     */
/*  else                                                                    */
/*  if this is a version 1 header then                                      */
/*     CALL FNSRCH                                                          */
/*     CALL TBLSRCH                                                         */
/*     rc = result of TBLSRCH                                               */
/*  else                                                                    */
/*    move pointer to file header extension record.pnext (inc by 3)         */
/*    indirect pointer (this will point it to the roots Message file        */
/*       definition. )                                                      */
/*    repeat                                                                */
/*      save the value at pointer in pnext                                  */
/*      increment pointer past language family and Id to cp_count (+ 6)     */
/*      get code page count from value at pointer                           */
/*      While CP_COUNT > 0 do                                               */
/*        Increment pointer      ; to first CP data field                   */
/*        if process's CP equals the value at (pointer) then                */
/*           ;we have found a matching code page                            */
/*           add cp_count to the pointer   ; tmove it to the filename       */
/*           call fnsrch to look for filename in list of bound files        */
/*           if found then then move pointer to the correct msgtablestruct  */
/*              CALL TBLSRCH  ;  if the message exists this will get it     */
/*                if carry flag clear ; we found it                         */
/*                   return success                                         */
/*      enddo                                                               */
/*      move the pointer to the value in pnext  ; try next defintion rec    */
/*    until pointer = null                                                  */
/*    rc  = message not found                                               */
/*                                                                          */
/****************************************************************************/
.fo on
