|
@@ -26,6 +26,9 @@
|
|
|
of the library.
|
|
|
14 Jan 2003.
|
|
|
|
|
|
+ Changed the start code for unit.
|
|
|
+ 01 Feb 2003.
|
|
|
+
|
|
|
[email protected]
|
|
|
}
|
|
|
|
|
@@ -290,10 +293,23 @@ FUNCTION ParseDate(locale : pLocale; date : pDateStamp; fmtTemplate : pCHAR; get
|
|
|
FUNCTION StrConvert(locale : pLocale; string1 : pCHAR; buffer : POINTER; bufferSize : ULONG; typ : ULONG) : ULONG;
|
|
|
FUNCTION StrnCmp(locale : pLocale; string1 : pCHAR; string2 : pCHAR; length : LONGINT; typ : ULONG) : LONGINT;
|
|
|
|
|
|
+{Here we read how to compile this unit}
|
|
|
+{You can remove this include and use a define instead}
|
|
|
+{$I useautoopenlib.inc}
|
|
|
+{$ifdef use_init_openlib}
|
|
|
+procedure InitLOCALELibrary;
|
|
|
+{$endif use_init_openlib}
|
|
|
+
|
|
|
+{This is a variable that knows how the unit is compiled}
|
|
|
+var
|
|
|
+ LOCALEIsCompiledHow : longint;
|
|
|
|
|
|
IMPLEMENTATION
|
|
|
|
|
|
-uses msgbox;
|
|
|
+uses
|
|
|
+{$ifndef dont_use_openlib}
|
|
|
+msgbox;
|
|
|
+{$endif dont_use_openlib}
|
|
|
|
|
|
PROCEDURE CloseCatalog(catalog : pCatalog);
|
|
|
BEGIN
|
|
@@ -651,9 +667,15 @@ BEGIN
|
|
|
END;
|
|
|
END;
|
|
|
|
|
|
-{$I useautoopenlib.inc}
|
|
|
-{$ifdef use_auto_openlib}
|
|
|
- {$Info Compiling autoopening of locale.library}
|
|
|
+const
|
|
|
+ { Change VERSION and LIBVERSION to proper values }
|
|
|
+
|
|
|
+ VERSION : string[2] = '0';
|
|
|
+ LIBVERSION : Cardinal = 0;
|
|
|
+
|
|
|
+{$ifdef use_init_openlib}
|
|
|
+ {$Info Compiling initopening of locale.library}
|
|
|
+ {$Info don't forget to use InitLOCALELibrary in the beginning of your program}
|
|
|
|
|
|
var
|
|
|
locale_exit : Pointer;
|
|
@@ -662,23 +684,53 @@ procedure CloselocaleLibrary;
|
|
|
begin
|
|
|
ExitProc := locale_exit;
|
|
|
if LocaleBase <> nil then begin
|
|
|
- CloseLibrary(plibrary(LocaleBase));
|
|
|
+ CloseLibrary(pLibrary(LocaleBase));
|
|
|
LocaleBase := nil;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
-const
|
|
|
- { Change VERSION and LIBVERSION to proper values }
|
|
|
+procedure InitLOCALELibrary;
|
|
|
+begin
|
|
|
+ LocaleBase := nil;
|
|
|
+ LocaleBase := pLocaleBase(OpenLibrary(LOCALENAME,LIBVERSION));
|
|
|
+ if LocaleBase <> nil then begin
|
|
|
+ locale_exit := ExitProc;
|
|
|
+ ExitProc := @CloselocaleLibrary;
|
|
|
+ end else begin
|
|
|
+ MessageBox('FPC Pascal Error',
|
|
|
+ 'Can''t open locale.library version ' + VERSION + #10 +
|
|
|
+ 'Deallocating resources and closing down',
|
|
|
+ 'Oops');
|
|
|
+ halt(20);
|
|
|
+ end;
|
|
|
+end;
|
|
|
|
|
|
- VERSION : string[2] = '0';
|
|
|
- LIBVERSION : Cardinal = 0;
|
|
|
+begin
|
|
|
+ LOCALEIsCompiledHow := 2;
|
|
|
+{$endif use_init_openlib}
|
|
|
+
|
|
|
+{$ifdef use_auto_openlib}
|
|
|
+ {$Info Compiling autoopening of locale.library}
|
|
|
+
|
|
|
+var
|
|
|
+ locale_exit : Pointer;
|
|
|
+
|
|
|
+procedure CloselocaleLibrary;
|
|
|
+begin
|
|
|
+ ExitProc := locale_exit;
|
|
|
+ if LocaleBase <> nil then begin
|
|
|
+ CloseLibrary(pLibrary(LocaleBase));
|
|
|
+ LocaleBase := nil;
|
|
|
+ end;
|
|
|
+end;
|
|
|
|
|
|
begin
|
|
|
LocaleBase := nil;
|
|
|
LocaleBase := pLocaleBase(OpenLibrary(LOCALENAME,LIBVERSION));
|
|
|
if LocaleBase <> nil then begin
|
|
|
locale_exit := ExitProc;
|
|
|
- ExitProc := @CloselocaleLibrary
|
|
|
+ ExitProc := @CloselocaleLibrary;
|
|
|
+ LOCALEIsCompiledHow := 1;
|
|
|
end else begin
|
|
|
MessageBox('FPC Pascal Error',
|
|
|
'Can''t open locale.library version ' + VERSION + #10 +
|
|
@@ -687,17 +739,24 @@ begin
|
|
|
halt(20);
|
|
|
end;
|
|
|
|
|
|
-{$else}
|
|
|
- {$Warning No autoopening of locale.library compiled}
|
|
|
- {$Info Make sure you open locale.library yourself}
|
|
|
{$endif use_auto_openlib}
|
|
|
|
|
|
+{$ifdef dont_use_openlib}
|
|
|
+begin
|
|
|
+ LOCALEIsCompiledHow := 3;
|
|
|
+ {$Warning No autoopening of locale.library compiled}
|
|
|
+ {$Warning Make sure you open locale.library yourself}
|
|
|
+{$endif dont_use_openlib}
|
|
|
+
|
|
|
|
|
|
END. (* UNIT LOCALE *)
|
|
|
|
|
|
{
|
|
|
$Log$
|
|
|
- Revision 1.3 2003-01-14 18:46:04 nils
|
|
|
+ Revision 1.4 2003-02-07 20:49:54 nils
|
|
|
+ * changed startcode for library
|
|
|
+
|
|
|
+ Revision 1.3 2003/01/14 18:46:04 nils
|
|
|
* added defines use_amia_smartlink and use_auto_openlib
|
|
|
|
|
|
* implemented autoopening of library
|
|
@@ -707,4 +766,4 @@ END. (* UNIT LOCALE *)
|
|
|
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|