aboutsummaryrefslogtreecommitdiffstats
path: root/libibex
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-02-26 03:36:51 +0800
committerDan Winship <danw@src.gnome.org>2000-02-26 03:36:51 +0800
commitc45670272a6b6e65dbeeecac041db003a6d8d8e8 (patch)
treea51680ffd1041fe70057df8103633cc40a91aa96 /libibex
parentd59b6744845a963af6048d43e668e58ccfa10158 (diff)
downloadgsoc2013-evolution-c45670272a6b6e65dbeeecac041db003a6d8d8e8.tar.gz
gsoc2013-evolution-c45670272a6b6e65dbeeecac041db003a6d8d8e8.tar.zst
gsoc2013-evolution-c45670272a6b6e65dbeeecac041db003a6d8d8e8.zip
add gtk-doc-style comments
svn path=/trunk/; revision=1936
Diffstat (limited to 'libibex')
-rw-r--r--libibex/ChangeLog9
-rw-r--r--libibex/file.c35
-rw-r--r--libibex/find.c33
-rw-r--r--libibex/index.c54
-rw-r--r--libibex/words.c21
5 files changed, 144 insertions, 8 deletions
diff --git a/libibex/ChangeLog b/libibex/ChangeLog
index a4a15182e2..ba785db21a 100644
--- a/libibex/ChangeLog
+++ b/libibex/ChangeLog
@@ -1,11 +1,16 @@
+2000-02-25 Dan Winship <danw@helixcode.com>
+
+ * *.c: add gtk-doc-style comments
+
2000-02-21 Matt Loper <matt@helixcode.com>
* .cvsignore: Added mkindex.
2000-02-21 NotZed <NotZed@HelixCode.com>
- * Makefile.am: change noinst_LIBRARIES to noinst_LTLIBRARIES, and supply -static to
- LDFLAGS. Duh, and changed LDADD back to libibex.la.
+ * Makefile.am: change noinst_LIBRARIES to noinst_LTLIBRARIES, and
+ supply -static to LDFLAGS. Duh, and changed LDADD back to
+ libibex.la.
2000-02-20 Matt Loper <matt@helixcode.com>
diff --git a/libibex/file.c b/libibex/file.c
index 57b31af89f..0cf637764e 100644
--- a/libibex/file.c
+++ b/libibex/file.c
@@ -52,6 +52,16 @@ static void free_word (gpointer key, gpointer value, gpointer data);
* line has in common with the line before it, followed by the rest of
* the string. Obviously this only really works if the lists are sorted.
*/
+
+/**
+ * ibex_open: open (or possibly create) an ibex index
+ * @file: the name of the file
+ * @create: whether or not to create the file if it doesn't exist.
+ *
+ * Open and/or create the named ibex file and return a handle to it.
+ *
+ * Return value: an ibex handle, or NULL if an error occurred.
+ **/
ibex *
ibex_open (char *file, gboolean create)
{
@@ -151,6 +161,9 @@ struct ibex_write_data {
char *lastname;
};
+/* This is an internal function to find the longest common initial
+ * prefix between the last-written word and the current word.
+ */
static int
get_prefix (struct ibex_write_data *iwd, char *name)
{
@@ -219,6 +232,15 @@ write_word (gpointer key, gpointer value, gpointer data)
return FALSE;
}
+/**
+ * ibex_write: Write an ibex out to disk.
+ * @ib: the ibex
+ *
+ * This writes an ibex to disk.
+ *
+ * Return value: 0 for success, -1 for failure (in which case errno
+ * is set).
+ **/
int
ibex_write (ibex *ib)
{
@@ -271,6 +293,19 @@ lose:
return -1;
}
+/**
+ * ibex_close: Write out the ibex file (if it has changed) and free
+ * the data associated with it.
+ * @ib: the ibex
+ *
+ * If this ibex file has been modified since it was opened, this will
+ * call ibex_write() to write it out to disk. It will then free all data
+ * associated with the ibex. After calling ibex_close(), @ib will no
+ * longer be a valid ibex.
+ *
+ * Return value: 0 on success, -1 on an ibex_write() failure (in which
+ * case @ib will not be destroyed).
+ **/
int
ibex_close (ibex *ib)
{
diff --git a/libibex/find.c b/libibex/find.c
index f449144e61..91e611401c 100644
--- a/libibex/find.c
+++ b/libibex/find.c
@@ -24,6 +24,19 @@
#include "ibex_internal.h"
+/**
+ * ibex_find: search an ibex for a word
+ * @ib: an ibex
+ * @word: the word
+ *
+ * This routine searches an ibex for a word and returns a GPtrArray
+ * containing the names of the files in the ibex that contain the word.
+ * If no matches are found, it will return an empty array (not NULL).
+ * The caller must free the array, but MUST NOT free or alter its
+ * elements.
+ *
+ * Return value: the array of filenames containing @word
+ **/
GPtrArray *
ibex_find (ibex *ib, char *word)
{
@@ -42,6 +55,16 @@ ibex_find (ibex *ib, char *word)
return ret;
}
+/**
+ * ibex_find_name: Check if a word occurs in a given file
+ * @ib: an ibex
+ * @name: a filename
+ * @word: a word
+ *
+ * This checks if the given word occurs in the given file.
+ *
+ * Return value: TRUE or FALSE
+ **/
gboolean
ibex_find_name (ibex *ib, char *name, char *word)
{
@@ -72,6 +95,16 @@ build_array (gpointer key, gpointer value, gpointer data)
return FALSE;
}
+/**
+ * ibex_find_all: Find files containing multiple words
+ * @ib: an ibex
+ * @words: a GPtrArray of words
+ *
+ * This works like ibex_find(), but returns an array of filenames
+ * which contain all of the words in @words.
+ *
+ * Return value: an array of matches
+ **/
GPtrArray *
ibex_find_all (ibex *ib, GPtrArray *words)
{
diff --git a/libibex/index.c b/libibex/index.c
index 895cbf50be..5e3e9cf588 100644
--- a/libibex/index.c
+++ b/libibex/index.c
@@ -28,9 +28,17 @@
#include "ibex_internal.h"
-/* Index a file, given its name. (Replace any previously indexed contents
- * of this file with the new contents.)
- */
+/**
+ * ibex_index_file: Index a file by name
+ * @ib: an ibex
+ * @filename: name of the file to index
+ *
+ * This indexes the given file into @ib. If @filename is already in
+ * the ibex, the existing index entries for it are discarded and the
+ * file is indexed anew.
+ *
+ * Return value: 0 on success, -1 on failure.
+ **/
int
ibex_index_file (ibex *ib, char *filename)
{
@@ -58,9 +66,27 @@ ibex_index_file (ibex *ib, char *filename)
return status;
}
-/* Given a file descriptor and a name to refer to it by, index LEN
- * bytes of data from it.
- */
+/**
+ * ibex_index_fd: Index a file given a file descriptor
+ * @ib: an ibex
+ * @name: the name of the file being indexed
+ * @fd: a file descriptor, open for reading
+ * @len: the number of bytes to read from the file
+ *
+ * This indexes a file, or a part of a file, given an open file
+ * descriptor and a size. There is no requirement that @name
+ * actually correspond to @fd in any particular way.
+ *
+ * If the function returns successfully, the file descriptor offset of
+ * @fd will be exactly @len bytes beyond where it was when the
+ * function was called. The indexer assumes that this point is a word
+ * boundary.
+ *
+ * The behavior of this function is not defined if it is not
+ * possible to read @len bytes off @fd.
+ *
+ * Return value: 0 on success, -1 on failure.
+ **/
int
ibex_index_fd (ibex *ib, char *name, int fd, size_t len)
{
@@ -83,6 +109,14 @@ ibex_index_fd (ibex *ib, char *name, int fd, size_t len)
return status;
}
+/**
+ * ibex_unindex: Remove a file from the ibex
+ * @ib: an ibex
+ * @name: name of the file to remove
+ *
+ * This removes all references to @name from @ib. No memory is freed
+ * right away, but further searches on @ib will never return @name.
+ **/
void
ibex_unindex (ibex *ib, char *name)
{
@@ -96,6 +130,14 @@ ibex_unindex (ibex *ib, char *name)
}
}
+/**
+ * ibex_rename: Rename a file in the ibex
+ * @ib: an ibex
+ * @oldname: the old name of the file
+ * @newname: the new name of the file
+ *
+ * This renames a file in the ibex.
+ **/
void
ibex_rename (ibex *ib, char *oldname, char *newname)
{
diff --git a/libibex/words.c b/libibex/words.c
index 1a5a4d5680..40e0452403 100644
--- a/libibex/words.c
+++ b/libibex/words.c
@@ -184,6 +184,27 @@ ref_word (ibex *ib, ibex_file *ibf, char *word)
}
}
+/**
+ * ibex_index_buffer: the lowest-level ibex indexing interface
+ * @ib: an ibex
+ * @name: the name of the file being indexed
+ * @buffer: a buffer containing data from the file
+ * @len: the length of @buffer
+ * @unread: an output argument containing the number of unread bytes
+ *
+ * This routine indexes up to @len bytes from @buffer into @ib.
+ * If @unread is NULL, the indexer assumes that the buffer ends on a
+ * word boundary, and will index all the way to the end of the
+ * buffer. If @unread is not NULL, and the buffer ends with an
+ * alphabetic character, the indexer will assume that the buffer has
+ * been cut off in the middle of a word, and return the number of
+ * un-indexed bytes at the end of the buffer in *@unread. The caller
+ * should then read in more data through whatever means it has
+ * and pass in the unread bytes from the original buffer, followed
+ * by the new data, on its next call.
+ *
+ * Return value: 0 on success, -1 on failure.
+ **/
int
ibex_index_buffer (ibex *ib, char *name, char *buffer,
size_t len, size_t *unread)
Cleaned this up. Removed some #if 0 and replaced others with #ifdefs.Christopher James Lahey2001-04-151-59/+4 * Set "bold" argument on created tooltip. Adjusted position of displayedChristopher James Lahey2001-04-154-31/+32 * Added "bold" argument.Christopher James Lahey2001-04-152-37/+58 * Added widget/e-hsv-utils.lo.Christopher James Lahey2001-04-151-14/+13 * Added widget/e-hsv-utils.lo.Christopher James Lahey2001-04-152-0/+197 * Fix memory leakDan Winship2001-04-141-1/+2 * Always emit the cursor changed signal. Even if it's changed to the sameChristopher James Lahey2001-04-131-8/+5 * New cell for floats.Mikael Hallendal2001-04-134-0/+906 * Upped the version number to 0.6.99.0. Upped the so number to 6.Christopher James Lahey2001-04-1310-114/+396 * Fix a memory leak.Dan Winship2001-04-132-4/+9 * svn path=/trunk/; revision=9267Federico Mena Quintero2001-04-132-1/+6 * Return TRUE for left and right arrows.Christopher James Lahey2001-04-111-0/+2 * Put debugging stuff in d().Christopher James Lahey2001-04-111-3/+5 * #include "gal/widgets/e-unicode.h".Christopher James Lahey2001-04-111-0/+1 * Translate the title as we read it.Christopher James Lahey2001-04-111-1/+5 * New function to translate a string and then convert it to utf8. Acts justChristopher James Lahey2001-04-112-1/+37 * i18n fixes, added missing includes.Gediminas Paulauskas2001-04-114-7/+12 * i18n fixes.Gediminas Paulauskas2001-04-112-1/+5 * Changed resizeable to resizable in ETableCol for consistency.Christopher James Lahey2001-04-106-21/+25 * add a missing \Dan Winship2001-04-081-0/+1 * make parent_class staticDan Winship2001-04-081-1/+1 * add "break;" to otherwise-empty "default:" cases to make them ANSI.Dan Winship2001-04-081-0/+2 * Here goes my additional simple include fixes.Gediminas Paulauskas2001-04-052-6/+8 * Some small header cleanups & fixes, and fix to translate all popup menusGediminas Paulauskas2001-04-056-11/+32 * Fix headers.Kjartan Maraas2001-04-052-0/+6 * Fix headers. Same here. Same here. Same here.Kjartan Maraas2001-04-056-0/+22 * More header fixes. Same. Same. Same here. More header fixes. Same here.Kjartan Maraas2001-04-057-8/+47 * Added e_selection_model_cursor_activated.Christopher James Lahey2001-04-042-0/+12 * Call cursor_activated as well.Christopher James Lahey2001-04-041-1/+6 * Fixed headers. Moved the .h associated with each .c to the top of the listChristopher James Lahey2001-04-046-7/+19 * Fixed headers.Christopher James Lahey2001-04-046-12/+26 * Made this work properly for models with 0 rows in the tree table adapter.Christopher James Lahey2001-04-041-1/+14 * Added this function.Christopher James Lahey2001-04-043-0/+11 * Make it so you can switch checking around the last access on and off forChristopher James Lahey2001-04-042-0/+8 * Added e_tree_selection_model_select_single_path and made selection_startChristopher James Lahey2001-04-045-47/+150 * Fix headers. Ditto. Ditto. Ditto. Ditto. Ditto. Ditto. Same. Ditto. SameKjartan Maraas2001-04-0425-23/+51 * Fixed this to not call the callback with a row of -1.Christopher James Lahey2001-04-041-1/+2 * Fix headers. Ditto. Ditto. Ditto. Ditto.Kjartan Maraas2001-04-045-6/+8 * Turn on E_TREE_USE_TREE_SELECTION.Christopher James Lahey2001-04-041-1/+1 * Fix headers. Ditto. Ditto. Ditto. Ditto. Ditto. Ditto. Ditto. Ditto.Kjartan Maraas2001-04-0435-52/+352 * Fixed an off by one error.Richard Hult2001-04-041-1/+1 * Add argument to get the table adapter. (et_set_arg): Add arguments forRichard Hult2001-04-043-1/+117 * forgot last timeGediminas Paulauskas2001-04-041-50/+0 * Typo fix; call e_cell_unrealize(), not e_cell_realize().Federico Mena Quintero2001-04-034-7/+9 * Ahem, free the xmlDoc. (load_single_dir): Free the filename if we returnFederico Mena Quintero2001-04-031-1/+3 * Don't draw the button if it's less than 1 pixel wide.Christopher James Lahey2001-04-032-1/+7 * Ahem, free the xmlDoc.Federico Mena Quintero2001-04-031-0/+1 * Ahem, the ETableItem argument is now "selection_model", notFederico Mena Quintero2001-04-031-2/+2 * Removed glade.h files -- xml-i18n-tools generates them itself.Gediminas Paulauskas2001-04-027-32/+0 * My previous commit was incomplete.Gediminas Paulauskas2001-04-021-1/+2 * No one responds on IRC, explained everything in bugzilla and these changelogs.Gediminas Paulauskas2001-04-024-8/+10 * Monitor the sorted model and send selection and cursor changed signals.Christopher James Lahey2001-04-021-1/+111 * Made this traverse the source model instead of the sorted model since theChristopher James Lahey2001-04-021-10/+9 * Fixed some bugs with the privitization of ETreeSelectionModel.Christopher James Lahey2001-04-012-8/+7 * Added e-tree-selection-model.c. (libetableinclude_HEADERS): AddedChristopher James Lahey2001-04-012-0/+35 * Initialize all necessary fields here.Christopher James Lahey2001-04-011-0/+18 * Roll back another part of the change.Christopher James Lahey2001-04-011-1/+5 * Accidently committed this with using the tree selection model turned on.Christopher James Lahey2001-04-012-19/+2 * Include <gal/util/e-util.h> here.Christopher James Lahey2001-04-015-639/+796 * Set orig_position properly on inserted nodes.Christopher James Lahey2001-04-011-2/+3 * Made e_tree_selection_model_foreach work. (etsm_select_all): MadeChristopher James Lahey2001-03-311-8/+15 * Removed this since it's out of date. Replaced by tests/test-table-1.c.Christopher James Lahey2001-03-311-287/+0 * New implementation based on a tree instead of a hash table.Christopher James Lahey2001-03-314-58/+433 * Fixed little bug, add adjustments.Tambet Ingo2001-03-311-1/+4 * Fixed removing the last child of a node.Christopher James Lahey2001-03-311-4/+29 * removed #include <gal/e-table/e-tree-selection-model.h>Radek Doulik2001-03-301-1/+0 * Made these use GTK_TYPE_GDK_EVENT whenever sending an event through theChristopher James Lahey2001-03-305-17/+23 * Changed the signal "table_selection_model" to just be "selection_model"Christopher James Lahey2001-03-3010-55/+69 * Updated to set the width of the header canvas to be equal to the width ofChristopher James Lahey2001-03-303-25/+73 * s/#include/#ifdef/ to fix Kjartan's commit.Larry Ewing2001-03-302-1/+6 * Replace #include <gtk/gtk.h> Remove #include <gnome.h> Replace #includeKjartan Maraas2001-03-3013-16/+68 * #ifdef HAVE_CONFIG_H Same here. Same here. And here.Kjartan Maraas2001-03-305-1/+19 * Don't print the xml tree here.Christopher James Lahey2001-03-292-1/+8 * New class implementing a tree model. Not finished yet or in use, but IChristopher James Lahey2001-03-282-0/+563 * Added util/e-bit-array.lo.Christopher James Lahey2001-03-274-224/+92 * Updated these to match the new e_tree_model_node_removed signal.Christopher James Lahey2001-03-275-45/+95 * un Mar 25 22:31:19 2001 George Lebl <jirka@5z.com>George Lebl2001-03-261-4/+4 * ref the sort_info taken from the state object. Ditto. Fixes the last ETreeDan Winship2001-03-262-0/+2 * Added e-selection-model-array.lo.Christopher James Lahey2001-03-258-560/+975 * Added '=' and '-' as tree node expand and collapseChristopher James Lahey2001-03-251-3/+11 * Properly remove old items from the ETableExtras if they are replaced byChristopher James Lahey2001-03-241-0/+3 * Made this only up the insert_count if it actually had to do any nonChristopher James Lahey2001-03-241-3/+4 * Ignore these signals if we aren't realized yet.Christopher James Lahey2001-03-231-4/+19 * Made this not create the new font until realize instead of at new_viewChristopher James Lahey2001-03-232-15/+28 * Validate the filter rule.Jeffrey Stedfast2001-03-232-1/+8 * Fixed the g_return_if_fail here to allow for appending.Christopher James Lahey2001-03-221-1/+1 * Make `ETableSortInfo' non-floating and use _unref, not _destroy, toEttore Perazzoli2001-03-222-1/+3 * Fixed the parity on all the g_return_ifs and g_return_val_ifs.Christopher James Lahey2001-03-221-8/+8 * Made this able to take -1 to denote appending to the table. Also, removedChristopher James Lahey2001-03-222-23/+48 * Changed this to derefence the pointers passed in from qsort as we shouldChristopher James Lahey2001-03-221-2/+7 * New function to allow you to do non live sorts with weird rules.Christopher James Lahey2001-03-222-12/+102 * Make `ETableState' a non-`GTK_FLOATING' object. Otherwise theEttore Perazzoli2001-03-211-0/+4 * Added these classes.Christopher James Lahey2001-03-214-0/+641 * Fixed a typo in the word horiztonal.Christopher James Lahey2001-03-211-1/+1 * Bumped the version number to 05.99.9.Christopher James Lahey2001-03-2114-48/+109 * Upped the version number to 0.5.99.4.Christopher James Lahey2001-03-204-49/+78 * Deal with proxy_node_changed being called on a different root node thanChristopher James Lahey2001-03-2036-2461/+7007 * use gnome_dialog_run() to make the warning dialog modal. Also created aDamon Chaplin2001-03-192-38/+37 * Removed extra printfsMiguel de Icaza2001-03-19