File: profiles.h

package info (click to toggle)
alsa-tools 1.0.28-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 12,464 kB
  • ctags: 5,787
  • sloc: ansic: 23,609; cpp: 15,057; sh: 12,305; pascal: 1,140; asm: 1,053; xml: 814; makefile: 733; python: 250
file content (84 lines) | stat: -rw-r--r-- 2,112 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#ifndef __PROFILES_H__
#define __PROFILES_H__

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include <sys/stat.h>
#include <errno.h>
#include <assert.h>
#include <time.h>

#ifndef PROGRAM_NAME
#define PROGRAM_NAME "envy24control"
#endif

#ifndef MAX_PROFILES
#define MAX_PROFILES 4
#endif

#ifndef MAX_PROFILE_NAME_LENGTH
#define MAX_PROFILE_NAME_LENGTH 20
#endif

#ifndef DEFAULT_PROFILERC
#define DEFAULT_PROFILERC "~/."PROGRAM_NAME"/profiles.conf"
#endif

#ifndef SYS_PROFILERC
#define SYS_PROFILERC "/etc/"PROGRAM_NAME"/profiles.conf"
#endif

#define PROFILE_NAME_FIELD_LENGTH MAX_PROFILE_NAME_LENGTH + 1

#define PROFILE_HEADER_TEMPL "[ Profile # ]"
#define CARD_HEADER_TEMPL "< Card # >"
#define CARD_FOOTER_TEMPL "< /CARD # >"
#define PROFILE_NAME_TEMPL "{ /$/ }"

#define PLACE_HOLDER_NUM '#'
#define PLACE_HOLDER_STR '$'

/* max 32k for every profile */
#define MAX_PROFILE_SIZE 32768
#define MAX_SEARCH_FIELD_LENGTH 1024
#define MAX_FILE_NAME_LENGTH 1024
#define MAX_NUM_STR_LENGTH 10
#define TOKEN_SEP "|"
#define SEP_CHAR ' '

#ifndef NOTFOUND
#define NOTFOUND -1
#endif

#define ALSACTL_OP_STORE "store"
#define ALSACTL_OP_RESTORE "restore"

#define DIR_CREA_MODE "0755"	// this must be a string
#define FILE_CREA_MODE 0644	// this must be a octal number

/* max count of parameters for new_process
 * !first parameter will be the name of the external programm
 * - last parameter will be NULL
 */
#define MAX_PARAM 10

/* the place from mkdir */
#ifndef MKDIR
#define MKDIR "/bin/mkdir"
#endif

/* the place from alsactl */
#ifndef ALSACTL
#define ALSACTL "/usr/sbin/alsactl"
#endif

#ifndef __PROFILES_C__
extern int save_restore(const char * const operation, const int profile_number, const int card_number, char * cfgfile, const char * const profile_name);
extern char *get_profile_name(const int profile_number, const int card_number, char * cfgfile);
extern int get_profile_number(const char * const profile_name, const int card_number, char * cfgfile);
extern int delete_card(const int card_number, char * const cfgfile);
#endif

#endif /* __PROFILES_H__ */