1997年12月1日にRed Hat Linux 5.0(カーネル:2.0.32)がリリースされました。
日本語版ではありませんが日本でも「Linux 6-CD Set」(RedHat5.0, S.u.S.E. 5.1他の組み合わせCDパック)や「Official Red Hat Linux 5.0」として入手可能です。
今回のメジャーバージョンアップの最大の特徴は本格的RDBMSであるPostgreSQL(Postgres95の後継)の標準搭載です。
PostgreSQL付属のAPIを利用することでApache環境で動作するDBアクセスCGIをC言語で開発することができるようになります(サンプルは後述)。
Red Hat Linux 5.0での主な変更点は以下の通りです。
Arrow keys: Up and Down to move. Right to follow a link; Left to go back. H)elp O)ptions P)rint G)o M)ain screen Q)uit /=search [delete]=history list |
Options Menu (Lynx Version 2.7.1)
E)ditor : NONE
D)ISPLAY variable : :0.0
mu(L)ti-bookmarks: OFF B)ookmark file: lynx_bookmarks.html
F)TP sort criteria : By Filename
P)ersonal mail address : NONE
S)earching type : CASE INSENSITIVE
display (C)haracter set : Japanese (EUC)
Raw 8-bit or CJK m(O)de : ON
preferred document lan(G)uage: en
preferred document c(H)arset : NONE
V)I keys: OFF e(M)acs keys: OFF sho(W) dot files: OFF
popups for selec(T) fields : ON
K)eypad mode : Numbers act as arrows
li(N)e edit style : Default Binding
l(I)st directory style : Mixed style
U)ser mode : Novice
user (A)gent : Lynx/2.7.1 libwww-FM/2.14
Select capital letter of option line, '>' to save, or 'r' to return to Lynx.
Command:
Hit any key to change value; RETURN to accept:
|
#include <stdio.h>
#include "libpq-fe.h" /* PQxxx functions */
int main()
{
PGconn *conn;
PGresult *result;
char *fld1,*fld2,*fld3;
int i;
conn = PQconnectdb("host=localhost user=postgres dbname=testdb");
result = PQexec(conn,"select kind, item, memo from ordertbl");
printf("-- This is a tiny program for PostgreSQL 6.2 --\n");
printf("Kind Item Memo \n");
printf("-----------+------------------------------+------\n");
for (i = 0; i < PQntuples(result) ;i++)
{
fld1 = PQgetvalue(result,i,0); // Kind field
fld2 = PQgetvalue(result,i,1); // Item field
fld3 = PQgetvalue(result,i,2); // Memo field
printf("%s %s %s\n",fld1,fld2,fld3);
}
PQclear(result);
PQfinish(conn);
return 0;
}
#include <stdio.h>
#include "libpq-fe.h" /* PQxxx functions */
int main()
{
PGconn *conn;
PGresult *result;
char *fld1,*fld2,*fld3;
int i;
puts ("Content-type: text/html\n\n");
puts("<html>");
puts("<head><title>a tiny program for PostgreSQL 6.2</title></head>\n");
puts("<body>");
puts("<h2>-- This is a tiny program for PostgreSQL 6.2 --</h2>\n");
conn = PQconnectdb("host=localhost user=postgres dbname=testdb");
result = PQexec(conn,"select kind, item, memo from ordertbl");
puts("<table border=1>\n");
puts("<tr><th>Kind</th><th>Item</th><th>Memo</th></tr>\n");
for (i = 0; i < PQntuples(result) ;i++)
{
fld1 = PQgetvalue(result,i,0); // Kind field
fld2 = PQgetvalue(result,i,1); // Item field
fld3 = PQgetvalue(result,i,2); // Memo field
printf("<tr><td>%s</td><td>%s</td><td>%s</td></tr>\n",fld1,fld2,fld3);
}
PQclear(result);
PQfinish(conn);
puts("</table>\n");
puts("</body>\n");
puts("</html>\n");
return 0;
}