Trusted Solaris 開発ガイド

プリンタバナーの情報

bcltobanner(3) ルーチンは、バイナリ CMW ラベルを、プリンタから出力されるバナーページ、トレーラページ、および印刷ジョブの文書ページに表示される ASCII コードのラベルと文字列に変換します。ラベルと文字列は、label_encodings(4) ファイル内の情報から計算されます。このルーチンは、Trusted Solaris 7 の印刷システムにより内部的に使用されるので、ほとんどのアプリケーションはこの変換ルーチンを必要としませんが、印刷サーバーアプリケーションや、印刷システムが使用している外部文字列表示を必要とするアプリケーションなどで使用する場合があります。

次の例では、CMW ラベルは ADMIN_LOW [TS] です。banner_fields (バナーフィールド) の最初の 5 つのフィールドは、文字ポインタです。文字ポインタに事前に記憶領域を割り当てると、次の 5 つのフィールドには、割り当てられた記憶領域長を示すショート整数 (short integer) 値が入ります。この例のように、最初の 5 つの文字ポインタを(char *)0 に初期化する際には、ショート整数値が入るフィールドは初期化する必要はありません。

#include <tsol/label.h>
 main()
 {
 	int				retval;
 	bclabel_t 				cmwlabel;

 	static struct banner_fields banner = {							(char *)0, (char *)0, (char *)0,
 												(char *)0, (char *)0};

 	getcmwplabel(&cmwlabel);

 	retval = bcltobanner(&cmwlabel, &banner, SHORT_WORDS);

 	printf("Top and bottom banner/trailer header = %s¥n", banner.header);
 	printf("Protect as section of banner page = %s¥n", banner.protect_as);
 	printf("Inf. label/top and bottom body pages = %s¥n", banner.ilabel);
 	printf("Caveats section of printer banner page = %s¥n", banner.caveats);
 	printf("Handling channels section of banner page = %s¥n", banner.channels);
 }

printf(1) 文内のテキストは、バナー、トレーラ、文書ページのどこにそれぞれの文字列が現れるかを示します。label_encodings(4) ファイルの printer banner セクションに警告が指定されていないため、警告文字は空です。文字列の計算方法は、『Trusted Solaris のラベル管理』と『コンパートメントモードワークステーションのラベル作成: エンコード形式』を参照してください。


Top and bottom banner/trailer header = TOP SECRET

Protect as section of banner page = TOP SECRET A B

Inf. label/top and bottom body pages = UNCLASSIFIED

Caveats section of printer banner page = 

Handling channels section of banner page = HANDLE VIA (CH B)/(CH A) CHANNELS JOINTLY