linux/drivers/accessibility/speakup/kobjects.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Speakup kobject implementation
 *
 * Copyright (C) 2009 William Hubbs
 *
 * This code is based on kobject-example.c, which came with linux 2.6.x.
 *
 * Copyright (C) 2004-2007 Greg Kroah-Hartman <[email protected]>
 * Copyright (C) 2007 Novell Inc.
 *
 * Released under the GPL version 2 only.
 *
 */
#include <linux/slab.h>		/* For kmalloc. */
#include <linux/kernel.h>
#include <linux/kobject.h>
#include <linux/string.h>
#include <linux/string_helpers.h>
#include <linux/sysfs.h>
#include <linux/ctype.h>

#include "speakup.h"
#include "spk_priv.h"

/*
 * This is called when a user reads the characters or chartab sys file.
 */
static ssize_t chars_chartab_show(struct kobject *kobj,
				  struct kobj_attribute *attr, char *buf)
{}

/*
 * Print informational messages or warnings after updating
 * character descriptions or chartab entries.
 */
static void report_char_chartab_status(int reset, int received, int used,
				       int rejected, int do_characters)
{}

/*
 * This is called when a user changes the characters or chartab parameters.
 */
static ssize_t chars_chartab_store(struct kobject *kobj,
				   struct kobj_attribute *attr,
				   const char *buf, size_t count)
{}

/*
 * This is called when a user reads the keymap parameter.
 */
static ssize_t keymap_show(struct kobject *kobj, struct kobj_attribute *attr,
			   char *buf)
{}

/*
 * This is called when a user changes the keymap parameter.
 */
static ssize_t keymap_store(struct kobject *kobj, struct kobj_attribute *attr,
			    const char *buf, size_t count)
{}

/*
 * This is called when a user changes the value of the silent parameter.
 */
static ssize_t silent_store(struct kobject *kobj, struct kobj_attribute *attr,
			    const char *buf, size_t count)
{}

/*
 * This is called when a user reads the synth setting.
 */
static ssize_t synth_show(struct kobject *kobj, struct kobj_attribute *attr,
			  char *buf)
{}

/*
 * This is called when a user requests to change synthesizers.
 */
static ssize_t synth_store(struct kobject *kobj, struct kobj_attribute *attr,
			   const char *buf, size_t count)
{}

/*
 * This is called when text is sent to the synth via the synth_direct file.
 */
static ssize_t synth_direct_store(struct kobject *kobj,
				  struct kobj_attribute *attr,
				  const char *buf, size_t count)
{}

/*
 * This function is called when a user reads the version.
 */
static ssize_t version_show(struct kobject *kobj, struct kobj_attribute *attr,
			    char *buf)
{}

/*
 * This is called when a user reads the punctuation settings.
 */
static ssize_t punc_show(struct kobject *kobj, struct kobj_attribute *attr,
			 char *buf)
{}

/*
 * This is called when a user changes the punctuation settings.
 */
static ssize_t punc_store(struct kobject *kobj, struct kobj_attribute *attr,
			  const char *buf, size_t count)
{}

/*
 * This function is called when a user reads one of the variable parameters.
 */
ssize_t spk_var_show(struct kobject *kobj, struct kobj_attribute *attr,
		     char *buf)
{}
EXPORT_SYMBOL_GPL();

/*
 * Used to reset either default_pitch or default_vol.
 */
static inline void spk_reset_default_value(char *header_name,
					   int *synth_default_value, int idx)
{}

/*
 * This function is called when a user echos a value to one of the
 * variable parameters.
 */
ssize_t spk_var_store(struct kobject *kobj, struct kobj_attribute *attr,
		      const char *buf, size_t count)
{}
EXPORT_SYMBOL_GPL();

/*
 * Functions for reading and writing lists of i18n messages.  Incomplete.
 */

static ssize_t message_show_helper(char *buf, enum msg_index_t first,
				   enum msg_index_t last)
{}

static void report_msg_status(int reset, int received, int used,
			      int rejected, char *groupname)
{}

static ssize_t message_store_helper(const char *buf, size_t count,
				    struct msg_group_t *group)
{}

static ssize_t message_show(struct kobject *kobj,
			    struct kobj_attribute *attr, char *buf)
{}

static ssize_t message_store(struct kobject *kobj, struct kobj_attribute *attr,
			     const char *buf, size_t count)
{}

/*
 * Declare the attributes.
 */
static struct kobj_attribute keymap_attribute =;
static struct kobj_attribute silent_attribute =;
static struct kobj_attribute synth_attribute =;
static struct kobj_attribute synth_direct_attribute =;
static struct kobj_attribute version_attribute =;

static struct kobj_attribute delimiters_attribute =;
static struct kobj_attribute ex_num_attribute =;
static struct kobj_attribute punc_all_attribute =;
static struct kobj_attribute punc_most_attribute =;
static struct kobj_attribute punc_some_attribute =;
static struct kobj_attribute repeats_attribute =;

static struct kobj_attribute attrib_bleep_attribute =;
static struct kobj_attribute bell_pos_attribute =;
static struct kobj_attribute bleep_time_attribute =;
static struct kobj_attribute bleeps_attribute =;
static struct kobj_attribute cursor_time_attribute =;
static struct kobj_attribute key_echo_attribute =;
static struct kobj_attribute no_interrupt_attribute =;
static struct kobj_attribute punc_level_attribute =;
static struct kobj_attribute reading_punc_attribute =;
static struct kobj_attribute say_control_attribute =;
static struct kobj_attribute say_word_ctl_attribute =;
static struct kobj_attribute spell_delay_attribute =;
static struct kobj_attribute cur_phonetic_attribute =;

/*
 * These attributes are i18n related.
 */
static struct kobj_attribute announcements_attribute =;
static struct kobj_attribute characters_attribute =;
static struct kobj_attribute chartab_attribute =;
static struct kobj_attribute ctl_keys_attribute =;
static struct kobj_attribute colors_attribute =;
static struct kobj_attribute formatted_attribute =;
static struct kobj_attribute function_names_attribute =;
static struct kobj_attribute key_names_attribute =;
static struct kobj_attribute states_attribute =;

/*
 * Create groups of attributes so that we can create and destroy them all
 * at once.
 */
static struct attribute *main_attrs[] =;

static struct attribute *i18n_attrs[] =;

/*
 * An unnamed attribute group will put all of the attributes directly in
 * the kobject directory.  If we specify a name, a subdirectory will be
 * created for the attributes with the directory being the name of the
 * attribute group.
 */
static const struct attribute_group main_attr_group =;

static const struct attribute_group i18n_attr_group =;

static struct kobject *accessibility_kobj;
struct kobject *speakup_kobj;

int speakup_kobj_init(void)
{}

void speakup_kobj_exit(void)
{}