suggestions.c revision bcde4861cca9caf5cab2b710a3241b038fec477c
/*
* Copyright 2008, Intel Corporation
* Copyright 2008, Sun Microsystems, Inc
*
* This file is part of PowerTOP
*
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; version 2 of the License.
*
* 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 in a file named COPYING; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*
* Authors:
* Arjan van de Ven <arjan@linux.intel.com>
* Eric C Saxe <eric.saxe@sun.com>
* Aubrey Li <aubrey.li@intel.com>
*/
/*
* GPL Disclaimer
*
* For the avoidance of doubt, except that if any license choice other
* than GPL or LGPL is available it will apply instead, Sun elects to
* use only the General Public License version 2 (GPLv2) at this time
* for any software where a choice of GPL license versions is made
* available with the language indicating that GPLv2 or any later
* version may be used, or where a choice of which version of the GPL
* is applied is otherwise unspecified.
*/
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "powertop.h"
char suggestion_key;
struct suggestion;
struct suggestion {
struct suggestion *next;
char *string;
int weight;
char key;
char *keystring;
};
static struct suggestion *suggestions;
static int total_weight;
static char previous[1024];
void
reset_suggestions(void)
{
struct suggestion *ptr;
ptr = suggestions;
while (ptr) {
struct suggestion *next;
}
suggestions = NULL;
suggestion_key = -1;
total_weight = 0;
}
void
{
struct suggestion *new;
if (!text)
return;
if (!new)
return;
if (keystring)
suggestions = new;
total_weight += weight;
}
void
pick_suggestion(void)
{
struct suggestion *ptr;
suggestion_key = -1;
show_suggestion("");
return;
}
weight += 50;
ptr = suggestions;
while (ptr) {
running += 50;
displaytime = 30.0;
}
return;
}
}
show_suggestion("");
displaytime = -1.0;
}
void
print_all_suggestions(void)
{
struct suggestion *ptr;
}