Browse Source

Compilation repairs


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/dependencies/arts@1212131 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
tags/v3.5.13
tpearson 8 years ago
parent
commit
6637c74227
66 changed files with 192 additions and 180 deletions
  1. 1
    1
      artsc/artsc.h
  2. 4
    2
      artsc/artsdsp.c
  3. 2
    2
      doc/TODO
  4. 1
    1
      examples/testdhandle.cc
  5. 1
    1
      flow/asyncschedule.h
  6. 1
    1
      flow/audioio.h
  7. 1
    1
      flow/audiomanager_impl.cc
  8. 1
    1
      flow/audiosubsys.h
  9. 1
    1
      flow/bufferqueue.h
  10. 1
    1
      flow/bus.h
  11. 1
    1
      flow/cache.h
  12. 2
    2
      flow/cachedwav.h
  13. 2
    2
      flow/convert.h
  14. 1
    1
      flow/cpuinfo.h
  15. 1
    1
      flow/fft.h
  16. 1
    1
      flow/gslschedule.h
  17. 1
    1
      flow/pipebuffer.h
  18. 1
    1
      flow/resample.h
  19. 1
    1
      flow/stdsynthmodule.h
  20. 0
    2
      flow/synthschedule.h
  21. 1
    1
      flow/virtualports.h
  22. 1
    1
      gmcop/giomanager.h
  23. 1
    1
      mcop/anyref.h
  24. 1
    1
      mcop/asyncstream.h
  25. 1
    1
      mcop/buffer.h
  26. 1
    1
      mcop/common.h
  27. 1
    1
      mcop/connect.h
  28. 1
    1
      mcop/connection.h
  29. 1
    1
      mcop/datapacket.h
  30. 1
    1
      mcop/debug.h
  31. 1
    1
      mcop/delayedreturn.h
  32. 1
    1
      mcop/dispatcher.h
  33. 1
    1
      mcop/dynamicrequest.h
  34. 1
    1
      mcop/dynamicskeleton.h
  35. 1
    1
      mcop/extensionloader.h
  36. 1
    1
      mcop/factory.h
  37. 1
    1
      mcop/flowsystem.h
  38. 1
    1
      mcop/idlfilereg.h
  39. 1
    1
      mcop/ifacerepo_impl.h
  40. 1
    1
      mcop/iomanager.h
  41. 1
    1
      mcop/loopback.h
  42. 1
    1
      mcop/mcopconfig.h
  43. 108
    103
      mcop/mcoputils.cc
  44. 1
    1
      mcop/mcoputils.h
  45. 1
    1
      mcop/md5.h
  46. 1
    1
      mcop/md5auth.h
  47. 1
    1
      mcop/namedstore.h
  48. 1
    1
      mcop/notification.h
  49. 1
    1
      mcop/object.h
  50. 1
    1
      mcop/objectmanager.h
  51. 1
    1
      mcop/pool.h
  52. 1
    1
      mcop/reference.h
  53. 1
    1
      mcop/referenceclean.h
  54. 1
    1
      mcop/socketconnection.h
  55. 1
    1
      mcop/startupmanager.h
  56. 1
    1
      mcop/tcpconnection.h
  57. 1
    1
      mcop/tcpserver.h
  58. 1
    1
      mcop/thread.h
  59. 1
    1
      mcop/type.h
  60. 1
    1
      mcop/unixconnection.h
  61. 1
    1
      mcop/unixserver.h
  62. 1
    1
      mcop/weakreference.h
  63. 1
    1
      qtmcop/qiomanager.h
  64. 1
    1
      qtmcop/qiomanager_p.h
  65. 4
    3
      soundserver/artsd.cc
  66. 12
    6
      soundserver/artsplay.cc

+ 1
- 1
artsc/artsc.h View File

@@ -35,7 +35,7 @@ extern "C" {
* The aRts plain C API aims at easily writing/porting plain C apps to the
* arts sound server. What is provided is streaming functionality, in a
* blocking way. So for most apps, you simply remove the few system calls
* that deal with your audio device, and tqreplace them with the appropriate
* that deal with your audio device, and replace them with the appropriate
* arts calls.
*/


+ 4
- 2
artsc/artsdsp.c View File

@@ -37,7 +37,9 @@
#include <sys/ioctl.h>
#include <sys/stat.h>
/* #include <sys/mman.h> */
#define open ignore_system_open
#include <fcntl.h>
#undef open

#include <artsc.h>
#include <dlfcn.h>
@@ -58,10 +60,10 @@
* which points to /dev/null, to ensure compatibility with more weird
* operations on streams
*
* settings tqcontains what has already been set (speed, bits, channels), and
* settings contains what has already been set (speed, bits, channels), and
* is 7 when all of these are true
*
* stream tqcontains an aRts stream or 0
* stream contains an aRts stream or 0
*/
static int sndfd = -1;
static int settings;

+ 2
- 2
doc/TODO View File

@@ -4,7 +4,7 @@
dynamically loaded modules
- get rid of all error handling done by assert ; thus, one by one review
each assert if it can happen under any circumstances if yes, it needs
to be tqreplaced by some other mechanism
to be replaced by some other mechanism
- report errors properly if some component could not be loaded ; right
now, it fails within assert(skel) in generated code, which doesn't
help users much to debug the problem
@@ -128,7 +128,7 @@
can be restored on next login (or per song or something like that)
- edit .arts-map files visually

## Optimization (this section tqcontains various optimization ideas)
## Optimization (this section contains various optimization ideas)

- use no floats for adressing the fractional part in resampling but integers
(that will be MUCH faster)

+ 1
- 1
examples/testdhandle.cc View File

@@ -58,7 +58,7 @@ int main(int argc, char **argv)
" (" << gsl_strerror(info.error()) << ") while loading info.\n";
exit(1);
}
cout << "file tqcontains " << info.waveCount() << " waves:\n";
cout << "file contains " << info.waveCount() << " waves:\n";
for(int i=0; i<info.waveCount(); i++)
{
GSL::WaveDescription desc= info.waveDescription(i);

+ 1
- 1
flow/asyncschedule.h View File

@@ -30,7 +30,7 @@
#include <queue>

/*
* BC - tqStatus (2002-03-08): ASyncNetSend, ASyncNetReceive, ASyncPort.
* BC - Status (2002-03-08): ASyncNetSend, ASyncNetReceive, ASyncPort.
*
* None of these classes is considered part of the public API. Do NOT use it
* in your apps. These are part of the implementation of libartsflow's

+ 1
- 1
flow/audioio.h View File

@@ -27,7 +27,7 @@
#include <string>
#include "arts_export.h"
/*
* BC - tqStatus (2002-03-08): AudioIO, AudioIOFactory
* BC - Status (2002-03-08): AudioIO, AudioIOFactory
*
* Right now, these classes are considered an implementation detail. No binary
* compatibility guaranteed, its safe to add virtual methods when required.

+ 1
- 1
flow/audiomanager_impl.cc View File

@@ -45,7 +45,7 @@ public:
a typedef in between, which makes it magically work.
We could also use an explicit instantiation, but this is not allowed
on all C++ compilers in this scope. Note also, that we don't need
to tqreplace _all_ occurrences of list<xxx*> below, only the two in the
to replace _all_ occurrences of list<xxx*> below, only the two in the
member declaration. What a mess. */
typedef list<AudioManagerClient_impl *> L_AMC;
typedef list<AudioManagerAssignable *> L_AMA;

+ 1
- 1
flow/audiosubsys.h View File

@@ -29,7 +29,7 @@
#include "startupmanager.h"

/*
* BC - tqStatus (2002-03-08): AudioSubSystem, ASProducer, ASConsumer.
* BC - Status (2002-03-08): AudioSubSystem, ASProducer, ASConsumer.
*
* These classes are kept binary compatible. You can rely on them.
* AudioSubSystem has a private data pointer to do so. Even if ports to

+ 1
- 1
flow/bufferqueue.h View File

@@ -1,5 +1,5 @@
/*
* BC - tqStatus (2002-03-08): ByteBuffer, BufferQueue
* BC - Status (2002-03-08): ByteBuffer, BufferQueue
*
* None of these classes is considered part of the public API. Do NOT use it
* in your apps. These are part of the implementation of libartsflow's

+ 1
- 1
flow/bus.h View File

@@ -27,7 +27,7 @@
#include "artsflow.h"

/*
* BC - tqStatus (2002-03-08): BusClient, BusManager
* BC - Status (2002-03-08): BusClient, BusManager
*
* None of these classes is considered part of the public API. Do NOT use it
* in your apps. These are part of the implementation of libartsflow's

+ 1
- 1
flow/cache.h View File

@@ -30,7 +30,7 @@
#include "arts_export.h"

/*
* BC - tqStatus (2002-03-08): Cache, CachedObject
* BC - Status (2002-03-08): Cache, CachedObject
*
* At the current point in time, there are NO GUARANTEES, so only use this
* in apps part of official KDE releases (such as kdemultimedia apps), which

+ 2
- 2
flow/cachedwav.h View File

@@ -23,15 +23,15 @@
#ifndef CACHEDWAV_H
#define CACHEDWAV_H

#include "config.h"
#include "arts_export.h"

#ifdef HAVE_LIBAUDIOFILE
#include "cache.h"
#include <sys/stat.h>
#include <unistd.h>

/*
* BC - tqStatus (2002-03-08): CachedWav.
* BC - Status (2002-03-08): CachedWav.
*
* At the current point in time, there are NO GUARANTEES, so only use this
* in apps part of official KDE releases (such as kdemultimedia apps), which

+ 2
- 2
flow/convert.h View File

@@ -26,7 +26,7 @@
#include "arts_export.h"

/*
* BC - tqStatus (2002-03-08): conversion functions
* BC - Status (2002-03-08): conversion functions
*
* None of them will be removed or changed, so it is safe to use them in
* your apps. It is *recommended* (though not necessary) to use the new
@@ -48,7 +48,7 @@ namespace Arts {
* float for float data between -1 and 1
*
* and may be prefixed by 2 to indicate that stereo is done with two seperate
* buffers or i to indicate interleaved stereo (one buffer which tqcontains
* buffers or i to indicate interleaved stereo (one buffer which contains
* one sample left, one sample right, one sample left etc.)
*
* The parameter speed (for interpolations) is *not* the samplingrate, but

+ 1
- 1
flow/cpuinfo.h View File

@@ -24,7 +24,7 @@

#include "arts_export.h"
/*
* BC - tqStatus (2002-03-08): CpuInfo
* BC - Status (2002-03-08): CpuInfo
*
* This class will be kept binary compatible - it just exports the static
* CpuInfo::flags() function as only functionality.

+ 1
- 1
flow/fft.h View File

@@ -2,7 +2,7 @@
#define ARTS_FFT_H

/*
* BC - tqStatus (2002-03-08): arts_fft_float
* BC - Status (2002-03-08): arts_fft_float
*
* This fft interface should be obsoleted in the future in favour of one
* exploiting the capabilities of gsl fully. However, it will be kept binary

+ 1
- 1
flow/gslschedule.h View File

@@ -30,7 +30,7 @@
#include <list>

/*
* BC - tqStatus (2002-03-08): Port, AudioPort, MultiPort, StdFlowSystem,
* BC - Status (2002-03-08): Port, AudioPort, MultiPort, StdFlowSystem,
* StdScheduleNode
*
* None of these classes is considered part of the public API. Do NOT use it

+ 1
- 1
flow/pipebuffer.h View File

@@ -24,7 +24,7 @@
#define __PIPEBUFFER_H__

/*
* BC - tqStatus (2002-03-08): PipeSegment, PipeBuffer
* BC - Status (2002-03-08): PipeSegment, PipeBuffer
*
* None of these classes is considered part of the public API. Do NOT use it
* in your apps. These are part of the implementation of libartsflow's

+ 1
- 1
flow/resample.h View File

@@ -27,7 +27,7 @@
#include "arts_export.h"

/*
* BC - tqStatus (2002-03-08): Resampler / Refiller.
* BC - Status (2002-03-08): Resampler / Refiller.
*
* These classes will be kept binary compatible. Resampler has a private
* data pointer for this purpose.

+ 1
- 1
flow/stdsynthmodule.h View File

@@ -27,7 +27,7 @@
#include "artsflow.h"

/*
* BC - tqStatus (2002-03-08): StdSynthModule
* BC - Status (2002-03-08): StdSynthModule
*
* This class is intended for public use (inheritance) as it supplies a base
* for all objects using streams. It will be kept binary compatible.

+ 0
- 2
flow/synthschedule.h View File

@@ -23,8 +23,6 @@
#ifndef SYNTHSCHEDULE_H
#define SYNTHSCHEDULE_H

#include "config.h"

#ifdef __GNUC__
#warning " * <synthschedule.h> included! *"
#warning " * include <gslschedule.h> instead *"

+ 1
- 1
flow/virtualports.h View File

@@ -28,7 +28,7 @@
#include <list>

/*
* BC - tqStatus (2002-03-08): VPortConnection, VPort.
* BC - Status (2002-03-08): VPortConnection, VPort.
*
* None of these classes is considered part of the public API. Do NOT use it
* in your apps. These are part of the implementation of libartsflow's

+ 1
- 1
gmcop/giomanager.h View File

@@ -30,7 +30,7 @@
#include <map>
#include "arts_export.h"
/*
* BC - tqStatus (2002-03-08): GIOManager
* BC - Status (2002-03-08): GIOManager
*
* This class will be kept binary compatible (d ptr for extensions).
*/

+ 1
- 1
mcop/anyref.h View File

@@ -27,7 +27,7 @@
#include <string>
#include "arts_export.h"
/*
* BC - tqStatus (2002-03-08): AnyRefBase, AnyRef, AnyConstRef
* BC - Status (2002-03-08): AnyRefBase, AnyRef, AnyConstRef
*
* These classes will be kept binary compatibile. To change it, adding a new
* representation is necessary. No private d pointer for this reason.

+ 1
- 1
mcop/asyncstream.h View File

@@ -28,7 +28,7 @@
#include "datapacket.h"

/*
* BC - tqStatus (2002-03-08): GenericAsyncStream, AsyncStream,
* BC - Status (2002-03-08): GenericAsyncStream, AsyncStream,
* FloatAsyncStream/ByteAsyncStream
*
* These classes are to be treated with extreme care, as they are used in

+ 1
- 1
mcop/buffer.h View File

@@ -27,7 +27,7 @@
#include <vector>
#include "arts_export.h"
/*
* BC - tqStatus (2002-03-08): Buffer.
* BC - Status (2002-03-08): Buffer.
*
* Has to be kept binary compatible. As buffer is speed relevant, currently
* there are no private d ptrs, and the idea is to keep this as possible.

+ 1
- 1
mcop/common.h View File

@@ -36,7 +36,7 @@
#include "connect.h"

/*
* BC - tqStatus (2002-03-08): Read/WriteObject(Seq)
* BC - Status (2002-03-08): Read/WriteObject(Seq)
*
* Will be kept binary compatible by NOT TOUCHING AT ALL. Do not change this.
* (Interaction with generated code).

+ 1
- 1
mcop/connect.h View File

@@ -22,7 +22,7 @@
#define MCOP_CONNECT_H

/*
* BC - tqStatus (2002-03-08): connect / setValue functions
* BC - Status (2002-03-08): connect / setValue functions
*
* Will be kept as they are (binary compatible).
*/

+ 1
- 1
mcop/connection.h View File

@@ -27,7 +27,7 @@
#include "buffer.h"

/*
* BC - tqStatus (2002-03-08): Connection.
* BC - Status (2002-03-08): Connection.
*
* None of these classes is considered part of the public API. However, they
* NEED to be kept binary compatible as the DO interact with generated code.

+ 1
- 1
mcop/datapacket.h View File

@@ -27,7 +27,7 @@
#include "buffer.h"

/*
* BC - tqStatus (2002-03-08): GenericDataChannel, DataPacket types
* BC - Status (2002-03-08): GenericDataChannel, DataPacket types
*
* These classes must be kept binary compatible, as the do interact with
* generated code. So you MUST KNOW WHAT YOU ARE DOING, once you start

+ 1
- 1
mcop/debug.h View File

@@ -31,7 +31,7 @@
#include "arts_export.h"

/*
* BC - tqStatus (2002-03-08): Debug.
* BC - Status (2002-03-08): Debug.
*
* Collection class, no instance, no members. Thus binary compatible (will
* be kept).

+ 1
- 1
mcop/delayedreturn.h View File

@@ -26,7 +26,7 @@
#include "arts_export.h"

/*
* BC - tqStatus (2002-03-08): DelayedReturn
* BC - Status (2002-03-08): DelayedReturn
*
* This class will be kept binary compatible. It has a private d-pointer for
* further extensions.

+ 1
- 1
mcop/dispatcher.h View File

@@ -38,7 +38,7 @@
#include "arts_export.h"

/*
* BC - tqStatus (2002-03-08): Dispatcher
* BC - Status (2002-03-08): Dispatcher
*
* This is part of the public API (and interacts with generated code) and
* has to be kept binary compatible.

+ 1
- 1
mcop/dynamicrequest.h View File

@@ -31,7 +31,7 @@
#include "arts_export.h"

/*
* BC - tqStatus (2002-03-08): DynamicRequest
* BC - Status (2002-03-08): DynamicRequest
*
* Has to be kept binary compatible (use d ptr).
*/

+ 1
- 1
mcop/dynamicskeleton.h View File

@@ -28,7 +28,7 @@
#include "object.h"

/*
* BC - tqStatus (2002-03-08): DynamicSkeletonBase, DynamicSkeleton
* BC - Status (2002-03-08): DynamicSkeletonBase, DynamicSkeleton
*
* Will be kept binary compatible (using d ptr).
*/

+ 1
- 1
mcop/extensionloader.h View File

@@ -30,7 +30,7 @@
#include "arts_export.h"

/*
* BC - tqStatus (2002-03-08): ExtensionLoader
* BC - Status (2002-03-08): ExtensionLoader
*
* None of these classes is considered part of the public API. Do NOT use it
* in your apps. No binary compatibility guaranteed. (Interactions:

+ 1
- 1
mcop/factory.h View File

@@ -31,7 +31,7 @@
#include "startupmanager.h"

/*
* BC - tqStatus (2002-03-08): Factory
* BC - Status (2002-03-08): Factory
*
* Will need to remain binary compatible (REGISTER_IMPLEMENTATION), d ptr
* provided for convenience, watch out for interactions with generated

+ 1
- 1
mcop/flowsystem.h View File

@@ -28,7 +28,7 @@
#include "common.h"

/*
* BC - tqStatus (2002-03-08): ScheduleNode, FlowSystem, FlowSystem_impl,
* BC - Status (2002-03-08): ScheduleNode, FlowSystem, FlowSystem_impl,
* RemoteScheduleNode
*
* Heavy interactions with generated and hand-written code, flowsystem binding

+ 1
- 1
mcop/idlfilereg.h View File

@@ -29,7 +29,7 @@
#include "arts_export.h"

/*
* BC - tqStatus (2002-03-08): IDLFileReg
* BC - Status (2002-03-08): IDLFileReg
*
* Will be kept binary compatible by NOT TOUCHING AT ALL. Do not change this.
* (Interaction with generated code). Add a new class if you need something

+ 1
- 1
mcop/ifacerepo_impl.h View File

@@ -21,7 +21,7 @@
*/

/*
* BC - tqStatus (2002-03-08): InterfaceRepo_impl
* BC - Status (2002-03-08): InterfaceRepo_impl
*
* This is an implementation class, and not kept binary compatible. It's
* only here since the REGISTER_IMPLEMENTATION bootstrapping may not yet

+ 1
- 1
mcop/iomanager.h View File

@@ -21,7 +21,7 @@
*/

/*
* BC - tqStatus (2002-03-08):
* BC - Status (2002-03-08):
* BINARY COMPATIBLE: IONotify, TimeNotify, IOManager
* NO BC FOR: StdIOManager
*

+ 1
- 1
mcop/loopback.h View File

@@ -28,7 +28,7 @@
#include "arts_export.h"

/*
* BC - tqStatus (2002-03-08): LoopbackConnection
* BC - Status (2002-03-08): LoopbackConnection
*
* Not part of the public API. Do NOT use it in your apps. No binary
* compatibility guaranteed.

+ 1
- 1
mcop/mcopconfig.h View File

@@ -21,7 +21,7 @@
*/

/*
* BC - tqStatus (2002-03-08): MCOPConfig
* BC - Status (2002-03-08): MCOPConfig
*
* Is guaranteed to stay binary compatible. d ptr provided.
*/

+ 108
- 103
mcop/mcoputils.cc View File

@@ -79,8 +79,8 @@ if ((result == -1) && (errno == ENOENT))
static char *locate_mcop_dir()
{
struct passwd *pw_ent;
char kde_tmp_dir[PATH_MAX+1];
char user_tmp_dir[PATH_MAX+1];
string kde_tmp_dir;
string user_tmp_dir;
int uid = getuid();
const char *home_dir = getenv("HOME");
const char *kde_home = uid ? getenv("KDEHOME") : getenv("KDEROOTHOME");
@@ -96,7 +96,7 @@ static char *locate_mcop_dir()
if (!tmp || !tmp[0])
tmp = "/tmp";
kde_tmp_dir[0] = 0;
kde_tmp_dir = "";

pw_ent = getpwuid(uid);
if (!pw_ent)
@@ -105,12 +105,7 @@ static char *locate_mcop_dir()
return 0;
}

strncpy(user_tmp_dir, tmp, PATH_MAX );
user_tmp_dir[ PATH_MAX ] = '\0';
strncat(user_tmp_dir, "/ksocket-", PATH_MAX - strlen(user_tmp_dir) );
user_tmp_dir[ PATH_MAX ] = '\0';
strncat(user_tmp_dir, pw_ent->pw_name, PATH_MAX - strlen(user_tmp_dir));
user_tmp_dir[ PATH_MAX ] = '\0';
user_tmp_dir = string(tmp) + "/ksocket-" + string(pw_ent->pw_name);

if (!kde_home || !kde_home[0])
{
@@ -127,44 +122,37 @@ static char *locate_mcop_dir()
{
arts_fatal("Aborting. $HOME not set!");
}
if (strlen(home_dir) > (PATH_MAX-100))
{
arts_fatal("Aborting. Home directory path too long!");
}
kde_home++;
strncpy(kde_tmp_dir, home_dir, PATH_MAX);
kde_tmp_dir[ PATH_MAX ] = '\0';
kde_tmp_dir = string(home_dir);
}
strncat(kde_tmp_dir, kde_home, PATH_MAX - strlen(kde_tmp_dir));
kde_tmp_dir += kde_home;

/** Strip trailing '/' **/
if ( kde_tmp_dir[strlen(kde_tmp_dir)-1] == '/')
kde_tmp_dir[strlen(kde_tmp_dir)-1] = 0;
if ( kde_tmp_dir[kde_tmp_dir.length()-1] == '/')
kde_tmp_dir.resize(kde_tmp_dir.length()-1);

result = stat(kde_tmp_dir, &stat_buf);
result = stat(kde_tmp_dir.c_str(), &stat_buf);
if (result == -1)
{
return 0;
}

strncat(kde_tmp_dir, kde_prefix, PATH_MAX - strlen(kde_tmp_dir));
if (gethostname(kde_tmp_dir+strlen(kde_tmp_dir), PATH_MAX - strlen(kde_tmp_dir) - 1) != 0)
kde_tmp_dir += kde_prefix;
{
arts_fatal("Aborting. Could not determine hostname or hostname too long.");
char buf[1024];
if (gethostname(buf, sizeof(buf)-1) != 0)
{
arts_fatal("Aborting. Could not determine hostname or hostname too long.");
}
buf[sizeof(buf)-1] = '\0';
kde_tmp_dir += buf;
}
kde_tmp_dir[sizeof(kde_tmp_dir)-1] = '\0';

result = lstat(kde_tmp_dir, &stat_buf);
result = lstat(kde_tmp_dir.c_str(), &stat_buf);
if ((result == 0) && (S_ISDIR(stat_buf.st_mode)))
{
/* $KDEHOME/socket-$HOSTNAME is a normal directory. Do nothing. */
tmp_buf = (char *) malloc(PATH_MAX+1);
if (!tmp_buf)
return 0;

strncpy(tmp_buf, kde_tmp_dir, PATH_MAX);
tmp_buf[ PATH_MAX ] = '\0';
tmp_buf = strdup(kde_tmp_dir.c_str());
return tmp_buf;
}
@@ -175,26 +163,32 @@ static char *locate_mcop_dir()
}
if ((result == -1) || (!S_ISLNK(stat_buf.st_mode)))
{
arts_warning("Error: \"%s\" is not a link or a directory.\n", kde_tmp_dir);
arts_warning("Error: \"%s\" is not a link or a directory.\n", kde_tmp_dir.c_str());
return 0;
}
tmp_buf = (char *) malloc(PATH_MAX+1);
if (!tmp_buf)
return 0;

/* kde_tmp_dir is a link. Check whether it points to a valid directory. */
result = readlink(kde_tmp_dir, tmp_buf, PATH_MAX);
if (result == -1)
{
arts_warning("Error: \"%s\" could not be read.\n", kde_tmp_dir);
free(tmp_buf);
return 0;
}
ssize_t size = 2048;
tmp_buf = NULL;
do {
size *= 2;
tmp_buf = (char *) realloc(tmp_buf, size);
if (!tmp_buf)
return 0;
result = readlink(kde_tmp_dir.c_str(), tmp_buf, size - 1);
if (result == -1)
{
arts_warning("Error: \"%s\" could not be read.\n", kde_tmp_dir.c_str());
free(tmp_buf);
return 0;
}
} while(result == size - 1);
tmp_buf[result] = '\0';

// printf("Link points to \"%s\"\n", tmp_buf);
if (strncmp(tmp_buf, user_tmp_dir, strlen(user_tmp_dir)) != 0)
if (strncmp(tmp_buf, user_tmp_dir.c_str(), user_tmp_dir.length()) != 0)
{
arts_warning("Error: \"%s\" points to \"%s\" instead of \"%s\".\n", kde_tmp_dir, tmp_buf, user_tmp_dir);
arts_warning("Error: \"%s\" points to \"%s\" instead of \"%s\".\n", kde_tmp_dir.c_str(), tmp_buf, user_tmp_dir.c_str());
free(tmp_buf);
return 0;
}
@@ -229,19 +223,19 @@ int create_link(const char *file, const char *tmp_dir)


static
int build_link(const char *tmp_prefix, const char *kde_prefix)
int build_link(string tmp_prefix, const char *kde_prefix)
{
struct passwd *pw_ent;
char kde_tmp_dir[PATH_MAX+1];
char user_tmp_dir[PATH_MAX+1];
char tmp_buf[PATH_MAX+1];
string kde_tmp_dir;
string user_tmp_dir;
char *tmp_buf;
int uid = getuid();
const char *home_dir = getenv("HOME");
const char *kde_home = uid ? getenv("KDEHOME") : getenv("KDEROOTHOME");
int result;
struct stat stat_buf;

kde_tmp_dir[0] = 0;
kde_tmp_dir = "";

pw_ent = getpwuid(uid);
if (!pw_ent)
@@ -250,9 +244,7 @@ int build_link(const char *tmp_prefix, const char *kde_prefix)
return 1;
}

strncpy(user_tmp_dir, tmp_prefix, PATH_MAX);
user_tmp_dir[ PATH_MAX ] = '\0';
strncat(user_tmp_dir, pw_ent->pw_name, PATH_MAX - strlen(tmp_prefix));
user_tmp_dir = tmp_prefix + string(pw_ent->pw_name);

if (!kde_home || !kde_home[0])
{
@@ -270,89 +262,106 @@ int build_link(const char *tmp_prefix, const char *kde_prefix)
fprintf(stderr, "Aborting. $HOME not set!");
exit(255);
}
if (strlen(home_dir) > (PATH_MAX-100))
{
fprintf(stderr, "Aborting. Home directory path too long!");
exit(255);
}
kde_home++;
strncpy(kde_tmp_dir, home_dir, PATH_MAX);
kde_tmp_dir[ PATH_MAX ] = '\0';
kde_tmp_dir = string(home_dir);
}
strncat(kde_tmp_dir, kde_home, PATH_MAX - strlen(kde_tmp_dir));
kde_tmp_dir += kde_home;

/** Strip trailing '/' **/
if ( kde_tmp_dir[strlen(kde_tmp_dir)-1] == '/')
kde_tmp_dir[strlen(kde_tmp_dir)-1] = 0;
if ( kde_tmp_dir[kde_tmp_dir.length()-1] == '/')
kde_tmp_dir.resize(kde_tmp_dir.length()-1);

result = stat(kde_tmp_dir, &stat_buf);
result = stat(kde_tmp_dir.c_str(), &stat_buf);
if ((result == -1) && (errno == ENOENT))
{
result = mkdir(kde_tmp_dir, 0700);
result = mkdir(kde_tmp_dir.c_str(), 0700);
}
if (result == -1)
{
return 1;
}

strncat(kde_tmp_dir, kde_prefix, PATH_MAX - strlen(kde_tmp_dir));
if (gethostname(kde_tmp_dir+strlen(kde_tmp_dir), PATH_MAX - strlen(kde_tmp_dir) - 1) != 0)
kde_tmp_dir += kde_prefix;
{
perror("Aborting. Could not determine hostname: ");
exit(255);
char buf[1024];
if (gethostname(buf, sizeof(buf)-1) != 0)
{
arts_fatal("Aborting. Could not determine hostname or hostname too long.");
}
buf[sizeof(buf)-1] = '\0';
kde_tmp_dir += buf;
}
kde_tmp_dir[sizeof(kde_tmp_dir)-1] = '\0';

result = lstat(kde_tmp_dir, &stat_buf);
result = lstat(kde_tmp_dir.c_str(), &stat_buf);
if ((result == 0) && (S_ISDIR(stat_buf.st_mode)))
{
/* $KDEHOME/tmp is a normal directory. Do nothing. */
printf("Directory \"%s\" already exists.\n", kde_tmp_dir);
printf("Directory \"%s\" already exists.\n", kde_tmp_dir.c_str());
return 0;
}
if ((result == -1) && (errno == ENOENT))
{
printf("Creating link %s.\n", kde_tmp_dir);
result = create_link(kde_tmp_dir, user_tmp_dir);
printf("Creating link %s.\n", kde_tmp_dir.c_str());
result = create_link(kde_tmp_dir.c_str(), user_tmp_dir.c_str());
if (result == 0) return 0; /* Success */
unlink(kde_tmp_dir);
strncat(user_tmp_dir, "XXXXXX", PATH_MAX - strlen(user_tmp_dir));
mktemp(user_tmp_dir); /* We want a directory, not a file, so using mkstemp makes no sense and is wrong */
return create_link(kde_tmp_dir, user_tmp_dir);
unlink(kde_tmp_dir.c_str());
user_tmp_dir += "XXXXXX";
tmp_buf = strdup(user_tmp_dir.c_str());
mktemp(tmp_buf); /* We want a directory, not a file, so using mkstemp makes no sense and is wrong */
result = create_link(kde_tmp_dir.c_str(), tmp_buf);
free(tmp_buf);
return result;
}
if ((result == -1) || (!S_ISLNK(stat_buf.st_mode)))
{
fprintf(stderr, "Error: \"%s\" is not a link or a directory.\n", kde_tmp_dir);
fprintf(stderr, "Error: \"%s\" is not a link or a directory.\n", kde_tmp_dir.c_str());
return 1;
}
/* kde_tmp_dir is a link. Check whether it points to a valid directory. */
result = readlink(kde_tmp_dir, tmp_buf, PATH_MAX);
if (result == -1)
{
fprintf(stderr, "Error: \"%s\" could not be read.\n", kde_tmp_dir);
return 1;
}
ssize_t size = 2048;
tmp_buf = NULL;
do {
size *= 2;
tmp_buf = (char *) realloc(tmp_buf, size);
if (!tmp_buf)
return 0;
result = readlink(kde_tmp_dir.c_str(), tmp_buf, size - 1);
if (result == -1)
{
arts_warning("Error: \"%s\" could not be read.\n", kde_tmp_dir.c_str());
free(tmp_buf);
return 0;
}
} while(result == size - 1);
tmp_buf[result] = '\0';

printf("Link points to \"%s\"\n", tmp_buf);
if (strncmp(tmp_buf, user_tmp_dir, strlen(user_tmp_dir)) != 0)
if (strncmp(tmp_buf, user_tmp_dir.c_str(), user_tmp_dir.length()) != 0)
{
fprintf(stderr, "Error: \"%s\" points to \"%s\" instead of \"%s\".\n", kde_tmp_dir, tmp_buf, user_tmp_dir);
unlink(kde_tmp_dir);
printf("Creating link %s.\n", kde_tmp_dir);
result = create_link(kde_tmp_dir, user_tmp_dir);
fprintf(stderr, "Error: \"%s\" points to \"%s\" instead of \"%s\".\n", kde_tmp_dir.c_str(), tmp_buf, user_tmp_dir.c_str());
free(tmp_buf);
unlink(kde_tmp_dir.c_str());
printf("Creating link %s.\n", kde_tmp_dir.c_str());
result = create_link(kde_tmp_dir.c_str(), user_tmp_dir.c_str());
if (result == 0) return 0; /* Success */
unlink(kde_tmp_dir);
strncat(user_tmp_dir, "XXXXXX", PATH_MAX - strlen(user_tmp_dir));
mktemp(user_tmp_dir); /* We want a directory, not a file, so using mkstemp makes no sense and is wrong */
return create_link(kde_tmp_dir, user_tmp_dir);
return 1;
unlink(kde_tmp_dir.c_str());
user_tmp_dir += "XXXXXX";
tmp_buf = strdup(user_tmp_dir.c_str());
mktemp(tmp_buf); /* We want a directory, not a file, so using mkstemp makes no sense and is wrong */
result = create_link(kde_tmp_dir.c_str(), tmp_buf);
free(tmp_buf);
return result;
}
result = check_tmp_dir(tmp_buf);
free(tmp_buf);
if (result == 0) return 0; /* Success */
unlink(kde_tmp_dir);
strncat(user_tmp_dir, "XXXXXX", PATH_MAX - strlen(user_tmp_dir));
mktemp(user_tmp_dir); /* We want a directory, not a file, so using mkstemp makes no sense and is wrong */
return create_link(kde_tmp_dir, user_tmp_dir);
unlink(kde_tmp_dir.c_str());
user_tmp_dir += "XXXXXX";
tmp_buf = strdup(user_tmp_dir.c_str());
mktemp(tmp_buf); /* We want a directory, not a file, so using mkstemp makes no sense and is wrong */
result = create_link(kde_tmp_dir.c_str(), tmp_buf);
free(tmp_buf);
return result;
}

string MCOPUtils::createFilePath(string name)
@@ -372,11 +381,7 @@ string MCOPUtils::createFilePath(string name)
if (!tmp || !tmp[0])
tmp = "/tmp";

char tmp_prefix[PATH_MAX+1];
strcpy(tmp_prefix, tmp);
strcat(tmp_prefix, "/ksocket-");

build_link(tmp_prefix, "/socket-");
build_link(string(tmp) + "/ksocket-", "/socket-");
mcop_dir = locate_mcop_dir();
}
if (!mcop_dir)

+ 1
- 1
mcop/mcoputils.h View File

@@ -21,7 +21,7 @@
*/

/*
* BC - tqStatus (2002-03-08): MCOPUtils
* BC - Status (2002-03-08): MCOPUtils
*
* Collection class for all kinds of utility functions. BC, since never
* instanciated.

+ 1
- 1
mcop/md5.h View File

@@ -21,7 +21,7 @@
*/

/*
* BC - tqStatus (2002-03-08): arts_md5sum
* BC - Status (2002-03-08): arts_md5sum
*
* No binary compatibility guaranteed (part of Dispatcher's security model).
*/

+ 1
- 1
mcop/md5auth.h View File

@@ -21,7 +21,7 @@
*/

/*
* BC - tqStatus (2002-03-08): arts_md5_*
* BC - Status (2002-03-08): arts_md5_*
*
* No guarantees - do not use.
*/

+ 1
- 1
mcop/namedstore.h View File

@@ -29,7 +29,7 @@
#include "stdio.h"

/*
* BC - tqStatus (2002-03-08): NamedStore
* BC - Status (2002-03-08): NamedStore
*
* None of these classes is considered part of the public API. Do NOT use it
* in your apps. These are part of the implementation of object.cc and not

+ 1
- 1
mcop/notification.h View File

@@ -29,7 +29,7 @@
namespace Arts {

/*
* BC - tqStatus (2002-03-08): Notification, NotificationClient,
* BC - Status (2002-03-08): Notification, NotificationClient,
* NotificationManager
*
* All need to be kept BC, NotificationManager with usual d ptr.

+ 1
- 1
mcop/object.h View File

@@ -34,7 +34,7 @@
#include "arts_export.h"

/*
* BC - tqStatus (2002-03-08): Object_base, Object_skel, Object_stub
* BC - Status (2002-03-08): Object_base, Object_skel, Object_stub
*
* All of them have to be kept binary compatible carefully, due to interaction
* with generated code. There are d ptrs in _skel and _stub, NOT TO BE USED

+ 1
- 1
mcop/objectmanager.h View File

@@ -30,7 +30,7 @@
#include "arts_export.h"

/*
* BC - tqStatus (2002-03-08): ObjectManager
* BC - Status (2002-03-08): ObjectManager
*
* Keep binary compatible (since accessible via ::the()), use d ptr when
* changing it.

+ 1
- 1
mcop/pool.h View File

@@ -25,7 +25,7 @@


/*
* BC - tqStatus (2002-03-08): Pool<type>
* BC - Status (2002-03-08): Pool<type>
*
* Needs to be kept binary compatible by NOT TOUCHING. When you want something
* else, write a fresh one (used as part of Arts::Dispatcher, thus changing

+ 1
- 1
mcop/reference.h View File

@@ -19,7 +19,7 @@
*/

/*
* BC - tqStatus (2002-03-08): Reference, SubClass, Object, DynamicCast.
* BC - Status (2002-03-08): Reference, SubClass, Object, DynamicCast.
*
* Part of the public API. Must be kept binary compatible by NOT TOUCHING
* AT ALL. Interaction with generated and written code.

+ 1
- 1
mcop/referenceclean.h View File

@@ -21,7 +21,7 @@
*/

/*
* BC - tqStatus (2002-03-08): ReferenceClean
* BC - Status (2002-03-08): ReferenceClean
*
* None of these classes is considered part of the public API. Do NOT use it
* in your apps. Can be changed arbitrarily even non BC.

+ 1
- 1
mcop/socketconnection.h View File

@@ -21,7 +21,7 @@
*/

/*
* BC - tqStatus (2002-03-08): SocketConnection
* BC - Status (2002-03-08): SocketConnection
*
* None of these classes is considered part of the public API. Do NOT use it
* in your apps. No BC guaranteed.

+ 1
- 1
mcop/startupmanager.h View File

@@ -28,7 +28,7 @@
#include <list>

/*
* BC - tqStatus (2002-03-08): StartupClass, StartupManager.
* BC - Status (2002-03-08): StartupClass, StartupManager.
*
* The class needs to be kept BC, as the startup system bases on inheritance
* and virtual functions. Do not change.

+ 1
- 1
mcop/tcpconnection.h View File

@@ -21,7 +21,7 @@
*/

/*
* BC - tqStatus (2002-03-08): TCPConnection
* BC - Status (2002-03-08): TCPConnection
*
* Not part of the public API. Do NOT use it in your apps. Binary incompatible
* changes allowed.

+ 1
- 1
mcop/tcpserver.h View File

@@ -27,7 +27,7 @@
#include "arts_export.h"
#include "iomanager.h"
/*
* BC - tqStatus (2002-03-08): TCPServer
* BC - Status (2002-03-08): TCPServer
*
* Not part of the public API. Do NOT use it in your apps. Binary incompatible
* changes allowed.

+ 1
- 1
mcop/thread.h View File

@@ -26,7 +26,7 @@
#include "arts_export.h"

/*
* BC - tqStatus (2002-03-08): SystemThreads, Thread, Mutex, ThreadCondition,
* BC - Status (2002-03-08): SystemThreads, Thread, Mutex, ThreadCondition,
* Semaphore
*
* These classes are kept binary compatible. As the threading implementation

+ 1
- 1
mcop/type.h View File

@@ -27,7 +27,7 @@
#include "buffer.h"

/*
* BC - tqStatus (2002-03-08): Type
* BC - Status (2002-03-08): Type
*
* Keep binary compatible. DO NOT TOUCH, DO NOT CHANGE.
*/

+ 1
- 1
mcop/unixconnection.h View File

@@ -21,7 +21,7 @@
*/

/*
* BC - tqStatus (2002-03-08): UnixConnection
* BC - Status (2002-03-08): UnixConnection
*
* Not part of the public API. Do NOT use it in your apps. Can change, even
* binary incompatible.

+ 1
- 1
mcop/unixserver.h View File

@@ -21,7 +21,7 @@
*/

/*
* BC - tqStatus (2002-03-08): UnixServer
* BC - Status (2002-03-08): UnixServer
*
* Not part of the public API. Do NOT use it in your apps. Can change, even
* binary incompatible.

+ 1
- 1
mcop/weakreference.h View File

@@ -21,7 +21,7 @@
*/

/*
* BC - tqStatus (2002-03-08): WeakReference(Base)
* BC - Status (2002-03-08): WeakReference(Base)
*
* Has to be kept binary compatible by not touching it. Add a new class if
* you need something else.

+ 1
- 1
qtmcop/qiomanager.h View File

@@ -21,7 +21,7 @@
*/

/*
* BC - tqStatus (2002-03-08): QIOManager.
* BC - Status (2002-03-08): QIOManager.
*
* QIOManager is kept binary compatible.
*/

+ 1
- 1
qtmcop/qiomanager_p.h View File

@@ -21,7 +21,7 @@
*/

/*
* BC - tqStatus (2002-03-08): QIOWatch, QTimeWatch.
* BC - Status (2002-03-08): QIOWatch, QTimeWatch.
*
* These classes provide implementation details and not meant to be used
* in any way.

+ 4
- 3
soundserver/artsd.cc View File

@@ -296,9 +296,10 @@ int main(int argc, char **argv)

if(cfgForceStart && !AudioSubSystem::the()->check())
{
warnNullDevice = "Error while initializing the sound driver:\n";
warnNullDevice += AudioSubSystem::the()->error();
warnNullDevice += "\n\nThe sound server will continue, using the null output device.";
//Don't show an error (this looks bad and may confuse users without sound cards), kmix makes it obvious if sound isn't working
//warnNullDevice = "Error while initializing the sound driver:\n";
//warnNullDevice += AudioSubSystem::the()->error();
//warnNullDevice += "\n\nThe sound server will continue, using the null output device.";
AudioSubSystem::the()->audioIO("null");
}

+ 12
- 6
soundserver/artsplay.cc View File

@@ -42,13 +42,19 @@ static string absolutePath(const string& path)
{
if(path[0] == '/') return path;

char buffer[PATH_MAX];
getcwd(buffer,PATH_MAX);
int size = 4096;

if(buffer[strlen(buffer)-1] == '/')
return buffer + path;
else
return string(buffer) + '/' + path;
while (1) {
char buffer[size];
if (getcwd(buffer,size))
{
if(buffer[strlen(buffer)-1] == '/')
return buffer + path;
else
return string(buffer) + '/' + path;
}
size *= 2;
}
}

int main(int argc, char **argv)

Loading…
Cancel
Save