17
17
* along with this program; if not, write to the Free Software
18
18
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
20
* $Id: main.c,v 1.318 2006/07/09 11:37:17 valtri Exp $
20
* $Id: main.c,v 1.328 2006/10/24 23:12:07 fsck-p Exp $
22
22
* xine main for X11
470
470
len = strlen(buffer);
472
472
if((len + (strlen(plugin) + 3)) < 80) {
473
sprintf(buffer+strlen(buffer), "%s%s", (strlen(buffer) == strlen(blanks)) ? "" : ", ", plugin);
473
snprintf(buffer+len, sizeof(buffer)-len, "%s%s", (len == sizeof(blanks)-1) ? "" : ", ", plugin);
476
printf("%s", buffer);
476
printf("%s,\n", buffer);
478
477
snprintf(buffer, sizeof(buffer), "%s%s", blanks, plugin);
481
480
plugin = *plugins++;
485
printf("%s", buffer);
483
printf("%s.\n\n", buffer);
489
485
static void list_plugins(char *type) {
1075
1071
char buffer[8192];
1076
1072
void (*report)(char *message, ...)
1077
1073
#if __GNUC__ >= 3
1078
__attribute__ ((format (printf, 1, 2)));
1074
__attribute__ ((format (printf, 1, 2)))
1081
1078
report = xine_error_with_more;
1121
1118
"%s:", _("*drum roll*, xine lib wants to take your attention "
1122
1119
"to deliver an important message to you ;-):"));
1123
1120
if(data->explanation)
1124
sprintf(buffer+strlen(buffer), " %s %s", (char *) data + data->explanation, (char *) data + data->parameters);
1121
snprintf(buffer+strlen(buffer), sizeof(buffer)-strlen(buffer), " %s %s", (char *) data + data->explanation, (char *) data + data->parameters);
1126
sprintf(buffer+strlen(buffer), " %s", _("No Information available."));
1123
snprintf(buffer+strlen(buffer), sizeof(buffer)-strlen(buffer), " %s", _("No Information available."));
1132
1129
snprintf(buffer, sizeof(buffer), "%s", _("The host you're trying to connect is unknown.\n"
1133
1130
"Check the validity of the specified hostname."));
1134
1131
if(data->explanation)
1135
sprintf(buffer+strlen(buffer), " (%s)", (char *) data + data->parameters);
1132
snprintf(buffer+strlen(buffer), sizeof(buffer)-strlen(buffer), " (%s)", (char *) data + data->parameters);
1138
1135
/* (device name) */
1139
1136
case XINE_MSG_UNKNOWN_DEVICE:
1140
1137
snprintf(buffer, sizeof(buffer), "%s", _("The device name you specified seems invalid."));
1141
1138
if(data->explanation)
1142
sprintf(buffer+strlen(buffer), " (%s)", (char *) data + data->parameters);
1139
snprintf(buffer+strlen(buffer), sizeof(buffer)-strlen(buffer), " (%s)", (char *) data + data->parameters);
1147
1144
snprintf(buffer, sizeof(buffer), "%s", _("The network looks unreachable.\nCheck your network "
1148
1145
"setup and/or the server name."));
1149
1146
if(data->explanation)
1150
sprintf(buffer+strlen(buffer), " (%s)", (char *) data + data->parameters);
1147
snprintf(buffer+strlen(buffer), sizeof(buffer)-strlen(buffer), " (%s)", (char *) data + data->parameters);
1153
1150
/* (host name) */
1154
1151
case XINE_MSG_CONNECTION_REFUSED:
1155
1152
snprintf(buffer, sizeof(buffer), "%s", _("The connection was refused.\nCheck the host name."));
1156
1153
if(data->explanation)
1157
sprintf(buffer+strlen(buffer), " (%s)", (char *) data + data->parameters);
1154
snprintf(buffer+strlen(buffer), sizeof(buffer)-strlen(buffer), " (%s)", (char *) data + data->parameters);
1160
1157
/* (file name or mrl) */
1161
1158
case XINE_MSG_FILE_NOT_FOUND:
1162
1159
snprintf(buffer, sizeof(buffer), "%s", _("The specified file or mrl is not found. Please check it twice."));
1163
1160
if(data->explanation)
1164
sprintf(buffer+strlen(buffer), " (%s)", (char *) data + data->parameters);
1161
snprintf(buffer+strlen(buffer), sizeof(buffer)-strlen(buffer), " (%s)", (char *) data + data->parameters);
1167
1164
/* (device/file/mrl) */
1170
1167
"rights for this, or source doesn't contain data "
1171
1168
"(e.g: not disc in drive)."));
1172
1169
if(data->explanation)
1173
sprintf(buffer+strlen(buffer), " (%s)", (char *) data + data->parameters);
1170
snprintf(buffer+strlen(buffer), sizeof(buffer)-strlen(buffer), " (%s)", (char *) data + data->parameters);
1176
1173
/* (library/decoder) */
1177
1174
case XINE_MSG_LIBRARY_LOAD_ERROR:
1178
1175
snprintf(buffer, sizeof(buffer), "%s", _("A problem occur while loading a library or a decoder"));
1179
1176
if(data->explanation)
1180
sprintf(buffer+strlen(buffer), ": %s", (char *) data + data->parameters);
1177
snprintf(buffer+strlen(buffer), sizeof(buffer)-strlen(buffer), ": %s", (char *) data + data->parameters);
1184
1181
case XINE_MSG_ENCRYPTED_SOURCE:
1185
1182
snprintf(buffer, sizeof(buffer), "%s", _("The source seems encrypted, and can't be read."));
1186
1183
if(!strncasecmp(gGui->mmk.mrl, "dvd:/", 5)) {
1187
strcat(buffer, _("\nYour DVD is probably crypted. "
1184
strlcat(buffer, _("\nYour DVD is probably crypted. "
1188
1185
"According to your country laws, you can or can't "
1189
1186
"install/use libdvdcss to be able to read this disc, "
1190
"which you bought."));
1187
"which you bought."), sizeof(buffer));
1192
1189
if(data->explanation)
1193
sprintf(buffer+strlen(buffer), " (%s)", (char *) data + data->parameters);
1190
snprintf(buffer+strlen(buffer), sizeof(buffer)-strlen(buffer), " (%s)", (char *) data + data->parameters);
1196
1193
/* (warning message) */
1212
1209
snprintf(buffer, sizeof(buffer), "%s", _("*sight*, unkown error."));
1213
1210
if(data->explanation)
1214
sprintf(buffer+strlen(buffer), " (%s %s)", (char *) data + data->explanation, (char *) data + data->parameters);
1211
snprintf(buffer+strlen(buffer), sizeof(buffer)-strlen(buffer), " (%s %s)", (char *) data + data->explanation, (char *) data + data->parameters);
1218
1215
if(gGui->verbosity >= XINE_VERBOSITY_DEBUG) {
1219
strcat(buffer, "\n\n[");
1216
strlcat(buffer, "\n\n[", sizeof(buffer));
1221
1218
if(data->explanation)
1222
sprintf(buffer+strlen(buffer), "'%s' '%s'", (char *) data + data->explanation, (char *) data + data->parameters);
1219
snprintf(buffer+strlen(buffer), sizeof(buffer)-strlen(buffer), "'%s' '%s'", (char *) data + data->explanation, (char *) data + data->parameters);
1224
strcat(buffer, "]");
1221
strlcat(buffer, "]", sizeof(buffer));
1227
1224
if(strlen(buffer))
1863
1860
for(i = optind; i < _argc; i++) {
1864
1861
char enqueue_mrl[strlen(_argv[i]) + 256];
1866
sprintf(enqueue_mrl, "session=%d,mrl=%s", session, atoa(_argv[i]));
1863
snprintf(enqueue_mrl, sizeof(enqueue_mrl), "session=%d,mrl=%s", session, atoa(_argv[i]));
1867
1864
(void) session_handle_subopt(enqueue_mrl, &session);