Commits

Sébastien Ferré committed 28dfe5f

Completed .gitignore for a clean status

Comments (0)

Files changed (5)

 *.exe
 *.bat
 _build/*
+*~
+*/*~
+*/*/*~
+*/old/*
+gdbm/*
+*/RCS/*
+old/*
+ocaml-exif/*
+cis
+diet.ps
+intmap
+logdag.todo
+style.css
+
+x and "je
+  vais au
+    bois" .
+x or
+  (y and z).
+ not x.  
+

gdbm/dbm.ml

-(***********************************************************************)
-(*                                                                     *)
-(*                           Objective Caml                            *)
-(*                                                                     *)
-(*          Francois Rouaix, projet Cristal, INRIA Rocquencourt        *)
-(*                                                                     *)
-(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
-(*  en Automatique.  All rights reserved.  This file is distributed    *)
-(*  under the terms of the GNU Library General Public License, with    *)
-(*  the special exception on linking described in file ../../LICENSE.  *)
-(*                                                                     *)
-(***********************************************************************)
-
-(* $Id: dbm.ml,v 1.10 2001/12/07 13:39:51 xleroy Exp $ *)
-
-type t
-
-type open_flag =
-   Dbm_rdonly | Dbm_wronly | Dbm_rdwr | Dbm_create
-
-type dbm_flag =
-   DBM_INSERT
- | DBM_REPLACE
-
-exception Dbm_error of string
-
-external raw_opendbm : string -> open_flag list -> int -> t 
-              = "caml_dbm_open"
-
-let opendbm file flags mode =
-  try
-    raw_opendbm file flags mode
-  with Dbm_error msg ->
-    raise(Dbm_error("Can't open file " ^ file))
-
- (* By exporting opendbm as val, we are sure to link in this
-    file (we must register the exception). Since t is abstract, programs
-    have to call it in order to do anything *)
-
-external close : t -> unit = "caml_dbm_close"
-external find : t -> string -> string = "caml_dbm_fetch"
-external add : t -> string -> string -> unit = "caml_dbm_insert"
-external replace : t -> string -> string -> unit = "caml_dbm_replace"
-external remove : t -> string -> unit = "caml_dbm_delete"
-external firstkey : t -> string = "caml_dbm_firstkey"
-external nextkey : t -> string = "caml_dbm_nextkey"
-
-let _ = Callback.register_exception "dbmerror" (Dbm_error "")
-
-(* Usual iterator *)
-let iter f t =
-  let rec walk = function
-      None -> ()
-    | Some k ->
-        f k (find t k); 
-        walk (try Some(nextkey t) with Not_found -> None)
-  in
-  walk (try Some(firstkey t) with Not_found -> None)

gdbm/dbm.mli

-(***********************************************************************)
-(*                                                                     *)
-(*                           Objective Caml                            *)
-(*                                                                     *)
-(*          Francois Rouaix, projet Cristal, INRIA Rocquencourt        *)
-(*                                                                     *)
-(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
-(*  en Automatique.  All rights reserved.  This file is distributed    *)
-(*  under the terms of the GNU Library General Public License, with    *)
-(*  the special exception on linking described in file ../../LICENSE.  *)
-(*                                                                     *)
-(***********************************************************************)
-
-(* $Id: dbm.mli,v 1.15 2001/12/07 13:39:51 xleroy Exp $ *)
-
-(** Interface to the NDBM database. *)
-
-type t
-(** The type of file descriptors opened on NDBM databases. *)
-
-
-type open_flag = 
-    Dbm_rdonly
-  | Dbm_wronly
-  | Dbm_rdwr
-  | Dbm_create
-(** Flags for opening a database (see {!Dbm.opendbm}). *)
-
-
-exception Dbm_error of string
-(** Raised by the following functions when an error is encountered. *)
-
-val opendbm : string -> open_flag list -> int -> t
-(** Open a descriptor on an NDBM database. The first argument is
-   the name of the database (without the [.dir] and [.pag] suffixes).
-   The second argument is a list of flags: [Dbm_rdonly] opens
-   the database for reading only, [Dbm_wronly] for writing only,
-   [Dbm_rdwr] for reading and writing; [Dbm_create] causes the
-   database to be created if it does not already exist.
-   The third argument is the permissions to give to the database
-   files, if the database is created. *)
-
-external close : t -> unit = "caml_dbm_close"
-(** Close the given descriptor. *)
-
-external find : t -> string -> string = "caml_dbm_fetch"
-(** [find db key] returns the data associated with the given
-   [key] in the database opened for the descriptor [db].
-   Raise [Not_found] if the [key] has no associated data. *)
-
-external add : t -> string -> string -> unit = "caml_dbm_insert"
-(** [add db key data] inserts the pair ([key], [data]) in
-   the database [db]. If the database already contains data
-   associated with [key], raise [Dbm_error "Entry already exists"]. *)
-
-external replace : t -> string -> string -> unit = "caml_dbm_replace"
-(** [replace db key data] inserts the pair ([key], [data]) in
-   the database [db]. If the database already contains data
-   associated with [key], that data is discarded and silently
-   replaced by the new [data]. *)
-
-external remove : t -> string -> unit = "caml_dbm_delete"
-(** [remove db key data] removes the data associated with [key]
-   in [db]. If [key] has no associated data, raise
-   [Dbm_error "dbm_delete"]. *)
-
-external firstkey : t -> string = "caml_dbm_firstkey"
-(** See {!Dbm.nextkey}.*)
-
-external nextkey : t -> string = "caml_dbm_nextkey"
-(** Enumerate all keys in the given database, in an unspecified order.
-   [firstkey db] returns the first key, and repeated calls
-   to [nextkey db] return the remaining keys. [Not_found] is raised
-   when all keys have been enumerated. *)
-
-val iter : (string -> string -> 'a) -> t -> unit
-(** [iter f db] applies [f] to each ([key], [data]) pair in
-   the database [db]. [f] receives [key] as first argument
-   and [data] as second argument. *)
-

gdbm/essai.ml

-open Dbm
-
-let db = opendbm "dbessai.db" [Dbm_create; Dbm_rdwr] 0o660
-
-let _ =
-  print_endline "dbessai has been opened";
-  let s = String.make (1024*1024) 'a' in
-  for i = 1 to 3000 do
-    add db (string_of_int i) s;
-    if i mod 30 = 0 then begin print_int (i/30); print_endline "%"; flush stdout end
-  done;
-(*
-  for i = 1 to 100000 do
-    ignore (find db (string_of_int i))
-  done;
-*)
-  close db;
-  print_endline "dbessai has been closed"
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.