Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

log.h File Reference

Logging API. More...

#include <stdio.h>
#include "account.h"
#include "conversation.h"

Include dependency graph for log.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Data Structures

struct  _GaimLog
 A log. More...

struct  _GaimLogLogger
 A log logger. More...


Typedefs

typedef _GaimLog GaimLog
typedef _GaimLogLogger GaimLogLogger

Enumerations

enum  GaimLogType { GAIM_LOG_IM, GAIM_LOG_CHAT, GAIM_LOG_SYSTEM }
enum  GaimLogReadFlags { GAIM_LOG_READ_NO_NEWLINE = 1 }

Functions

GaimLoggaim_log_new (GaimLogType type, const char *name, GaimAccount *account, time_t time)
 Creates a new log.

void gaim_log_free (GaimLog *log)
 Frees a log.

void gaim_log_write (GaimLog *log, GaimMessageFlags type, const char *from, time_t time, const char *message)
 Writes to a log file.

char * gaim_log_read (GaimLog *log, GaimLogReadFlags *flags)
 Reads from a log.

GList * gaim_log_get_logs (const char *name, GaimAccount *account)
 Returns a list of all available logs.

GList * gaim_log_get_system_logs (GaimAccount *account)
 Returns a list of all available system logs.

int gaim_log_get_size (GaimLog *log)
 Returns the size of a log.

int gaim_log_get_total_size (const char *name, GaimAccount *account)
 Returns the size, in bytes, of all available logs in this conversation.

gint gaim_log_compare (gconstpointer y, gconstpointer z)
 Implements GCompareFunc.

GaimLogLoggergaim_log_logger_new (void(*create)(GaimLog *), void(*write)(GaimLog *, GaimMessageFlags, const char *, time_t, const char *), void(*finalize)(GaimLog *), GList *(*list)(const char *, GaimAccount *), char *(*read)(GaimLog *, GaimLogReadFlags *), int(*size)(GaimLog *))
 Creates a new logger.

void gaim_log_logger_free (GaimLogLogger *logger)
 Frees a logger.

void gaim_log_logger_add (GaimLogLogger *logger)
 Adds a new logger.

void gaim_log_logger_remove (GaimLogLogger *logger)
 Removes a logger.

void gaim_log_logger_set (GaimLogLogger *logger)
 Sets the current logger.

GaimLogLoggergaim_log_logger_get (void)
 Returns the current logger.

GList * gaim_log_logger_get_options (void)
 Returns a GList containing the IDs and Names of the registered log loggers.

void gaim_log_init (void)


Detailed Description

Logging API.

gaim

Gaim is the legal property of its developers, whose names are too numerous to list here. Please refer to the COPYRIGHT file distributed with this source distribution.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA


Function Documentation

gint gaim_log_compare gconstpointer  y,
gconstpointer  z
 

Implements GCompareFunc.

Parameters:
y A GaimLog
z Another GaimLog
Returns:
A value as specified by GCompareFunc

void gaim_log_free GaimLog log  ) 
 

Frees a log.

Parameters:
log The log to destroy

GList* gaim_log_get_logs const char *  name,
GaimAccount *  account
 

Returns a list of all available logs.

Parameters:
name The name of the log
account The account
Returns:
A sorted list of GaimLogs

int gaim_log_get_size GaimLog log  ) 
 

Returns the size of a log.

Parameters:
log The log
Returns:
The size of the log, in bytes

GList* gaim_log_get_system_logs GaimAccount *  account  ) 
 

Returns a list of all available system logs.

Parameters:
account The account
Returns:
A sorted list of GaimLogs

int gaim_log_get_total_size const char *  name,
GaimAccount *  account
 

Returns the size, in bytes, of all available logs in this conversation.

Parameters:
name The name of the log
account The account
Returns:
The size in bytes

void gaim_log_logger_add GaimLogLogger logger  ) 
 

Adds a new logger.

Parameters:
logger The new logger to add

void gaim_log_logger_free GaimLogLogger logger  ) 
 

Frees a logger.

Parameters:
logger The logger to free

GaimLogLogger* gaim_log_logger_get void   ) 
 

Returns the current logger.

Returns:
logger The current logger

GList* gaim_log_logger_get_options void   ) 
 

Returns a GList containing the IDs and Names of the registered log loggers.

Returns:
The list of IDs and names.

GaimLogLogger* gaim_log_logger_new void(*  create)(GaimLog *),
void(*  write)(GaimLog *, GaimMessageFlags, const char *, time_t, const char *),
void(*  finalize)(GaimLog *),
GList *(*  list)(const char *, GaimAccount *),
char *(*  read)(GaimLog *, GaimLogReadFlags *),
int(*  size)(GaimLog *)
 

Creates a new logger.

Parameters:
create The logger's new function.
write The logger's write function.
finalize The logger's finalize function.
list The logger's list function.
read The logger's read function.
size The logger's size function.
Returns:
The new logger

void gaim_log_logger_remove GaimLogLogger logger  ) 
 

Removes a logger.

Parameters:
logger The logger to remove

void gaim_log_logger_set GaimLogLogger logger  ) 
 

Sets the current logger.

Parameters:
logger The logger to set

GaimLog* gaim_log_new GaimLogType  type,
const char *  name,
GaimAccount *  account,
time_t  time
 

Creates a new log.

Parameters:
type The type of log this is.
name The name of this conversation (Screenname, chat name, etc.)
account The account the conversation is occurring on
time The time this conversation started
Returns:
The new log

char* gaim_log_read GaimLog log,
GaimLogReadFlags *  flags
 

Reads from a log.

Parameters:
log The log to read from
flags The returned logging flags.
Returns:
The contents of this log in Gaim Markup.

void gaim_log_write GaimLog log,
GaimMessageFlags  type,
const char *  from,
time_t  time,
const char *  message
 

Writes to a log file.

Parameters:
log The log to write to
type The type of message being logged
from Whom this message is coming from, or NULL for system messages
time A timestamp in UNIX time
message The message to log


Generated on Sun Aug 29 03:45:11 2004 for gaim by doxygen 1.3.4