ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/cf.schmorp.de/dclient/src/backend/ndk/align.cpp
Revision: 1.2
Committed: Sun Oct 24 20:31:50 2010 UTC (15 years, 11 months ago) by sf-pippijn
Branch: MAIN
Changes since 1.1: +2 -2 lines
Log Message:
use EV and plain sockets instead of asio

File Contents

# User Rev Content
1 sf-pippijn 1.1 /* align.cc
2     * This file is part of NDK++ library
3     * Copyright (c) 2003 by Stanislav Ievlev
4     *
5     * This file is covered by the GNU Library General Public License,
6 sf-pippijn 1.2 * which should be included with libndk as the file COPYING.
7 sf-pippijn 1.1 */
8 sf-pippijn 1.2 #include <ndk/align.hh>
9 sf-pippijn 1.1
10     int
11     ndk::align::pos (int internal_size, int external_size, align::type align)
12     {
13     switch (align)
14     {
15     case left:
16     return 0;
17     case right:
18     return external_size - internal_size;
19     case center:
20     return (external_size - internal_size) / 2;
21     default:
22     throw "unknown align type";
23     }
24     }