[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: Review Request 115878: File: Add a thin wrapper around different xattr implementations.
From:       Thomas_Lübking <thomas.luebking () gmail ! com>
Date:       2014-02-18 23:48:05
Message-ID: 20140218234805.5175.17740 () probe ! kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/115878/#review50183
-----------------------------------------------------------



src/file/lib/baloo_xattr_p.h
<https://git.reviewboard.kde.org/r/115878/#comment35288>

    I've to admit that i'm not sure how various compilers or the xattr headers will \
react to this, but you might want to try:  
    namespace BalooXattrInternal {
    #if defined(Q_OS_LINUX)
    #include <sys/xattr.h>
    ...
    #endif
    }
    
    namespace Baloo {
    
    inline ssize_t getxattr(const char* path, const char* name, void* value, size_t \
size)  {
    #if defined(Q_OS_LINUX)
        return BalooXattrInternal::getxattr(path, name, value, size);
    ....
    }
    
    using namespace BalooXattrInternal;
    using Baloo::getxattr;
    using Baloo::setxattr;
    
    -----------
    
    getxattr & setxattr should then always be in scope and refer to the Baloo \
variants (ie. the wrappers)


- Thomas Lübking


On Feb. 18, 2014, 10:51 p.m., Raphael Kubo da Costa wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/115878/
> -----------------------------------------------------------
> 
> (Updated Feb. 18, 2014, 10:51 p.m.)
> 
> 
> Review request for Baloo and Vishesh Handa.
> 
> 
> Repository: baloo
> 
> 
> Description
> -------
> 
> File: Add a thin wrapper around different xattr implementations.
> 
> OS X, Linux and some BSDs all support extended file attributes in a way or
> another, but the API differs among the operating systems.
> 
> Introduce baloo_getxattr() and baloo_setxattr(), named after the OS X and
> Linux APIs for getting and setting extended attributes, to perform the right
> calls depending on the operating system.
> 
> These functions accept as parameters the arguments that are common across
> all xattr implementations -- this means one cannot pass custom |flags| on
> Linux or |options| on OS X, but that should be fine for now as the code was
> not doing that anyway.
> 
> 
> Diffs
> -----
> 
> src/file/lib/autotests/filefetchjobtest.cpp \
> a738c62a58d29ca092e53702d4852a48634d4315  \
> src/file/lib/autotests/filemodifyjobtest.cpp \
> 4ad1a6d2138d9754356a573eaf5f2487fcbe220f  src/file/lib/baloo_xattr_p.h PRE-CREATION \
>  src/file/lib/filecustommetadata.cpp 3a01520947a324dc1674f304e44eca1ae4a19ed7 
> src/file/lib/xattrdetector.cpp e05984e611e8582d0e18d08f93b325381222d280 
> 
> Diff: https://git.reviewboard.kde.org/r/115878/diff/
> 
> 
> Testing
> -------
> 
> baloo finally builds on FreeBSD. filefetchjobtest and filemodifyjobtest fail just \
> like they do on Linux :-) 
> 
> Thanks,
> 
> Raphael Kubo da Costa
> 
> 


[Attachment #5 (text/html)]

<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 \
solid;">  <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://git.reviewboard.kde.org/r/115878/">https://git.reviewboard.kde.org/r/115878/</a>
  </td>
    </tr>
   </table>
   <br />











<div>




<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;">  <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;">  <a \
href="https://git.reviewboard.kde.org/r/115878/diff/1/?file=244875#file244875line26" \
style="color: black; font-weight: bold; text-decoration: \
underline;">src/file/lib/baloo_xattr_p.h</a>  <span style="font-weight: normal;">

     (Diff revision 1)

    </span>
   </th>
  </tr>
 </thead>



 
 

 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th>  <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>  <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">26</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span \
class="cp">#if defined(Q_OS_LINUX)</span></pre></td>  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I&#39;ve to \
admit that i&#39;m not sure how various compilers or the xattr headers will react to \
this, but you might want to try:

namespace BalooXattrInternal {
#if defined(Q_OS_LINUX)
#include &lt;sys/xattr.h&gt;
...
#endif
}

namespace Baloo {

inline ssize_t getxattr(const char* path, const char* name, void* value, size_t size)
{
#if defined(Q_OS_LINUX)
    return BalooXattrInternal::getxattr(path, name, value, size);
....
}

using namespace BalooXattrInternal;
using Baloo::getxattr;
using Baloo::setxattr;

-----------

getxattr &amp; setxattr should then always be in scope and refer to the Baloo \
variants (ie. the wrappers)</pre> </div>
<br />



<p>- Thomas Lübking</p>


<br />
<p>On February 18th, 2014, 10:51 p.m. UTC, Raphael Kubo da Costa wrote:</p>








<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('https://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;">  <tr>
  <td>

<div>Review request for Baloo and Vishesh Handa.</div>
<div>By Raphael Kubo da Costa.</div>


<p style="color: grey;"><i>Updated Feb. 18, 2014, 10:51 p.m.</i></p>









<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
baloo
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" \
style="border: 1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">File: Add a thin wrapper around different xattr implementations.

OS X, Linux and some BSDs all support extended file attributes in a way or
another, but the API differs among the operating systems.

Introduce baloo_getxattr() and baloo_setxattr(), named after the OS X and
Linux APIs for getting and setting extended attributes, to perform the right
calls depending on the operating system.

These functions accept as parameters the arguments that are common across
all xattr implementations -- this means one cannot pass custom |flags| on
Linux or |options| on OS X, but that should be fine for now as the code was
not doing that anyway.</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">baloo finally builds on FreeBSD. filefetchjobtest and filemodifyjobtest \
fail just like they do on Linux :-)</pre>  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>src/file/lib/autotests/filefetchjobtest.cpp <span style="color: \
grey">(a738c62a58d29ca092e53702d4852a48634d4315)</span></li>

 <li>src/file/lib/autotests/filemodifyjobtest.cpp <span style="color: \
grey">(4ad1a6d2138d9754356a573eaf5f2487fcbe220f)</span></li>

 <li>src/file/lib/baloo_xattr_p.h <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>src/file/lib/filecustommetadata.cpp <span style="color: \
grey">(3a01520947a324dc1674f304e44eca1ae4a19ed7)</span></li>

 <li>src/file/lib/xattrdetector.cpp <span style="color: \
grey">(e05984e611e8582d0e18d08f93b325381222d280)</span></li>

</ul>

<p><a href="https://git.reviewboard.kde.org/r/115878/diff/" style="margin-left: \
3em;">View Diff</a></p>







  </td>
 </tr>
</table>








  </div>
 </body>
</html>



>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic