pocketgames-devel Mailing List for pocketgames
Status: Beta
Brought to you by:
idominguez
You can subscribe to this list here.
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(48) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
(168) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2009 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <ido...@us...> - 2009-01-12 03:46:15
|
Revision: 230
http://pocketgames.svn.sourceforge.net/pocketgames/?rev=230&view=rev
Author: idominguez
Date: 2009-01-12 03:45:27 +0000 (Mon, 12 Jan 2009)
Log Message:
-----------
Game written in haskell. Uses gtk2hs, buttons use 0 and 1 to represent the lights when off and on respectively
Added Paths:
-----------
games/lightsoff/
games/lightsoff/Game.hs
games/lightsoff/Main.hs
games/lightsoff/Makefile
Added: games/lightsoff/Game.hs
===================================================================
--- games/lightsoff/Game.hs (rev 0)
+++ games/lightsoff/Game.hs 2009-01-12 03:45:27 UTC (rev 230)
@@ -0,0 +1,35 @@
+module Game (
+ -- Exported stuff comes here
+ Game
+ , exampleGame1
+ , toogle
+ , isGameFinished
+ ) where
+
+type Game = [Bool]
+
+isGameFinished :: Game -> Bool
+isGameFinished = all (== False)
+
+exampleGame1 :: Game
+exampleGame1 = [ False, True, False, False, False
+ , False, False, False, False, False
+ , False, True, False, False, False
+ , False, False, False, False, False
+ , False, False, False, False, False]
+
+toogle :: Game -> Int -> Int -> Game
+toogle g i j = foldl toogleSimple g ls
+ where ls = getAllToogled i j
+
+getAllToogled :: Int -> Int -> [(Int,Int)]
+getAllToogled i j = filter (\(x,y) -> x > -1 && x < 5 && y > -1 && y < 5)
+ [(i,j), ((i-1),j), ((i+1), j), (i,(j-1)), (i, (j+1))]
+
+
+-- FIXME: generalise for any board size
+toogleSimple :: Game -> (Int,Int) -> Game
+toogleSimple [] (i,j) = error ("Coodinates out of bounds: " ++ (show (i,j)))
+toogleSimple (x:xs) (0, 0) = (not x:xs)
+toogleSimple (x:xs) (n, 0) = (x:toogleSimple xs ((n-1), 4))
+toogleSimple (x:xs) (n, m) = (x:toogleSimple xs (n, (m-1)))
Added: games/lightsoff/Main.hs
===================================================================
--- games/lightsoff/Main.hs (rev 0)
+++ games/lightsoff/Main.hs 2009-01-12 03:45:27 UTC (rev 230)
@@ -0,0 +1,87 @@
+import Graphics.UI.Gtk
+import Graphics.UI.Gtk.ModelView.TreeView as TV
+import Graphics.UI.Gtk.ModelView as MV
+import System.IO
+import Data.IORef
+import Game
+
+main :: IO ()
+main = do
+ startGUI
+
+startGUI :: IO()
+startGUI = do
+ initGUI
+ window <- windowNew
+ windowSetDefaultSize window 400 600 -- Default window size, fits in FR
+
+ buttonAdd <- buttonNew
+
+ table <- tableNew 5 5 True
+ containerAdd window table
+
+ let lista = [1..25] in do
+ buttons' <- mapM (\_ -> buttonNewWithLabel "0") lista
+
+ -- Create the state that will be passed to all event handling functions
+ state <- newIORef (Environment exampleGame1 buttons')
+
+ -- Set all buttons to the appropriate appearance
+ representGame exampleGame1 buttons'
+
+ -- Set event handlers
+ setActions buttons' state
+ attachToTable table buttons'
+
+ onDestroy window mainQuit
+ widgetShowAll window
+ mainGUI
+
+-- State that will be used for all elements in the program. It's not
+-- just the view, it's also the internal datatypes (ie. tasks.)
+data Environment = Environment Game [Button]
+
+action :: IORef Environment -> Int -> Int -> IO()
+action state i j = do
+ env@(Environment game buttons) <- readIORef state
+ let g' = toogle game i j in do
+ if (isGameFinished g')
+ then putStrLn "Game finished"
+ else return()
+ representGame g' buttons
+ writeIORef state (Environment g' buttons)
+
+representGame :: [Bool] -> [Button] -> IO()
+representGame (True:xs) (b:bs) = do
+ set b [ buttonLabel := "1" ]
+ representGame xs bs
+representGame (False:xs) (b:bs) = do
+ set b [ buttonLabel := "0" ]
+ representGame xs bs
+representGame [] _ = return ()
+
+setActions :: [Button] -> IORef Environment -> IO()
+setActions bs state = setActions' bs state 0 0
+
+setActions' :: [Button] -> IORef Environment
+ -> Int -> Int -> IO()
+setActions' (b:[]) state 4 4 = do onClicked b (action state 4 4)
+ return ()
+setActions' (b:bs) state n 4 = do onClicked b (action state n 4)
+ setActions' bs state (n+1) 0
+ return ()
+setActions' (b:bs) state n m = do onClicked b (action state n m)
+ setActions' bs state n (m+1)
+ return ()
+
+attachToTable :: Table -> [Button] -> IO()
+attachToTable table bs = attachToTable' table bs 0 0
+
+attachToTable' table (b:[]) 4 4 = tableAttachDefaults table b 4 5 4 5
+attachToTable' table (b:bs) n 4 = do
+ tableAttachDefaults table b 4 5 n (n+1)
+ attachToTable' table bs (n+1) 0
+attachToTable' table (b:bs) n m = do
+ tableAttachDefaults table b m (m+1) n (n+1)
+ attachToTable' table bs n (m+1)
+
Added: games/lightsoff/Makefile
===================================================================
--- games/lightsoff/Makefile (rev 0)
+++ games/lightsoff/Makefile 2009-01-12 03:45:27 UTC (rev 230)
@@ -0,0 +1,5 @@
+all:
+ ghc --make Main.hs -o main
+
+clean:
+ rm -f *.hi *.o main
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ido...@us...> - 2008-03-07 23:57:50
|
Revision: 229
http://pocketgames.svn.sourceforge.net/pocketgames/?rev=229&view=rev
Author: idominguez
Date: 2008-03-07 15:57:55 -0800 (Fri, 07 Mar 2008)
Log Message:
-----------
Specific example added to README file
Modified Paths:
--------------
libraries/cab/doc/examples/README
libraries/cab/src/org/pocketgames/cab/installdata/CabInstallDataReader.java
libraries/cab/src/org/pocketgames/cab/installdata/Word.java
libraries/cab/src/org/pocketgames/cab/installdata/backend/CabInstallDataPrinter.java
libraries/cab/src/org/pocketgames/cab/installdata/frontend/CabInstallDataParser.java
Modified: libraries/cab/doc/examples/README
===================================================================
--- libraries/cab/doc/examples/README 2008-01-12 12:59:15 UTC (rev 228)
+++ libraries/cab/doc/examples/README 2008-03-07 23:57:55 UTC (rev 229)
@@ -1,3 +1,3 @@
To parse cab header files, use the script in bin/:
-./bin/cabheader.sh < doc/examples/sample1.000
+./bin/cabheader.sh < doc/examples/tkcreate.000
Modified: libraries/cab/src/org/pocketgames/cab/installdata/CabInstallDataReader.java
===================================================================
--- libraries/cab/src/org/pocketgames/cab/installdata/CabInstallDataReader.java 2008-01-12 12:59:15 UTC (rev 228)
+++ libraries/cab/src/org/pocketgames/cab/installdata/CabInstallDataReader.java 2008-03-07 23:57:55 UTC (rev 229)
@@ -1,12 +1,17 @@
package org.pocketgames.cab.installdata;
+import org.pocketgames.cab.installdata.backend.CabInstallDataPrinter;
import org.pocketgames.cab.installdata.frontend.CabInstallDataParser;
+import org.pocketgames.cab.installdata.data.CabInstallData;
public class CabInstallDataReader
{
public static void main (String args[]) throws Exception
{
CabInstallDataParser parser = new CabInstallDataParser();
- parser.parseCabInstallDataFile (System.in);
+ CabInstallData data = parser.parseCabInstallDataFile (System.in);
+ CabInstallDataPrinter printer = new CabInstallDataPrinter();
+ byte[] bytes = printer.getBytes(data);
+ System.out.write(bytes);
}
}
Modified: libraries/cab/src/org/pocketgames/cab/installdata/Word.java
===================================================================
--- libraries/cab/src/org/pocketgames/cab/installdata/Word.java 2008-01-12 12:59:15 UTC (rev 228)
+++ libraries/cab/src/org/pocketgames/cab/installdata/Word.java 2008-03-07 23:57:55 UTC (rev 229)
@@ -48,7 +48,7 @@
public static byte[] toWord32 (int i)
{
- byte[] ret = new byte[2];
+ byte[] ret = new byte[4];
ret[0] = (byte)(i & 0xFF);
ret[1] = (byte)((i >>> 8) & 0xFF);
ret[2] = (byte)((i >>> 16) & 0xFF);
Modified: libraries/cab/src/org/pocketgames/cab/installdata/backend/CabInstallDataPrinter.java
===================================================================
--- libraries/cab/src/org/pocketgames/cab/installdata/backend/CabInstallDataPrinter.java 2008-01-12 12:59:15 UTC (rev 228)
+++ libraries/cab/src/org/pocketgames/cab/installdata/backend/CabInstallDataPrinter.java 2008-03-07 23:57:55 UTC (rev 229)
@@ -38,6 +38,7 @@
int numberOfRegHives = this.head.reghives.size();
byte[] regkeys = this.getRegKeysBytes();
int numberOfRegKeys = this.head.regkeys.size();
+ System.err.println (numberOfRegKeys);
byte[] links = this.getLinksBytes();
int numberOfLinks = this.head.links.size();
int offsetStrings = 100;
@@ -71,12 +72,12 @@
this.setUnknownBytes();
this.setArchitecture();
this.setCompatibility();
- this.copyToMain (toWord32(total_length), 8);
+ this.copyToMain (toWord32(this.head.totalLength), 8);
this.copyToMain (toWord16(numberOfStrings), 48);
this.copyToMain (toWord16(numberOfDirs), 50);
this.copyToMain (toWord16(numberOfFiles), 52);
this.copyToMain (toWord16(numberOfRegHives), 54);
- this.copyToMain (toWord16(0), 56); // Number of regkeys
+ this.copyToMain (toWord16(numberOfRegKeys), 56); // Number of regkeys
this.copyToMain (toWord16(numberOfLinks), 58);
this.copyToMain (toWord32(offsetStrings), 60);
this.copyToMain (toWord32(offsetDirs), 64);
@@ -121,12 +122,12 @@
private void setCompatibility ()
{
- this.copyToMain (toWord32 (this.head.minimalVersion.getMinor()), 24);
- this.copyToMain (toWord32 (this.head.minimalVersion.getMajor()), 28);
- this.copyToMain (toWord32 (this.head.maximalVersion.getMinor()), 32);
- this.copyToMain (toWord32 (this.head.maximalVersion.getMajor()), 36);
- this.copyToMain (toWord32 (this.head.minimalBuildNumber), 40);
- this.copyToMain (toWord32 (this.head.maximalBuildNumber), 44);
+ this.copyToMain (toWord32 (this.head.minimalVersion.getMajor()), 24);
+ this.copyToMain (toWord32 (this.head.minimalVersion.getMinor()), 28);
+ this.copyToMain (toWord32 (this.head.maximalVersion.getMajor()), 32);
+ this.copyToMain (toWord32 (this.head.maximalVersion.getMinor()), 36);
+ this.copyToMain (toWord32 (this.head.maximalBuildNumber), 40);
+ this.copyToMain (toWord32 (this.head.minimalBuildNumber), 44);
}
private byte[] getAppName ()
Modified: libraries/cab/src/org/pocketgames/cab/installdata/frontend/CabInstallDataParser.java
===================================================================
--- libraries/cab/src/org/pocketgames/cab/installdata/frontend/CabInstallDataParser.java 2008-01-12 12:59:15 UTC (rev 228)
+++ libraries/cab/src/org/pocketgames/cab/installdata/frontend/CabInstallDataParser.java 2008-03-07 23:57:55 UTC (rev 229)
@@ -74,7 +74,7 @@
dirs,
files,
regHives,
- new HashSet<REGKEY>(),
+ regKeys,
links,
appname,
provider,
@@ -233,6 +233,7 @@
Pair<Integer,REGKEY> res = ParserREGKEY.parseRegKey (content, offsetRK);
offsetRK = res.getLeft();
this.regKeys.add (res.getRight());
+ System.err.println("One regkey added");
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ido...@us...> - 2008-01-12 12:59:10
|
Revision: 228
http://pocketgames.svn.sourceforge.net/pocketgames/?rev=228&view=rev
Author: idominguez
Date: 2008-01-12 04:59:15 -0800 (Sat, 12 Jan 2008)
Log Message:
-----------
Style changes
Modified Paths:
--------------
libraries/unsigned/src/org/pocketgames/unsigned/UnsignedByte.java
Modified: libraries/unsigned/src/org/pocketgames/unsigned/UnsignedByte.java
===================================================================
--- libraries/unsigned/src/org/pocketgames/unsigned/UnsignedByte.java 2008-01-12 12:58:50 UTC (rev 227)
+++ libraries/unsigned/src/org/pocketgames/unsigned/UnsignedByte.java 2008-01-12 12:59:15 UTC (rev 228)
@@ -34,19 +34,19 @@
* A constant holding the maximum value an <code>unsigned byte</code> can
* have, 2^8.
*/
- public static int MAX_VALUE = 256;
+ public static final int MAX_VALUE = 256;
/**
* A constant holding the minimum value an <code>unsigned byte</code> can
* have, 0.
*/
- public static int MIN_VALUE = 0;
+ public static final int MIN_VALUE = 0;
/**
* The number of bits used to represent an <code>UnsignedByte</code> value
* in two's complement binary form.
*/
- public static int SIZE = Short.SIZE;
+ public static final int SIZE = Short.SIZE;
/**
* The value stored in this UnsignedByte.
@@ -63,11 +63,13 @@
public UnsignedByte (byte b)
{
if (b >= 0)
+ {
this.val = (short) b;
+ }
else
{
short l = (short) b;
- short max = (short)(Math.pow(2,8));
+ short max = (short) (Math.pow(2, 8));
this.val = (short) (l + max);
}
}
@@ -80,7 +82,7 @@
public UnsignedByte (short s)
throws IllegalArgumentException
{
- if (s < MIN_VALUE || s >= MAX_VALUE)
+ if ((s < MIN_VALUE) || (s >= MAX_VALUE))
throw new IllegalArgumentException();
else
this.val = s;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ido...@us...> - 2008-01-12 12:58:47
|
Revision: 227
http://pocketgames.svn.sourceforge.net/pocketgames/?rev=227&view=rev
Author: idominguez
Date: 2008-01-12 04:58:50 -0800 (Sat, 12 Jan 2008)
Log Message:
-----------
Style changes
Modified Paths:
--------------
libraries/unsigned/src/org/pocketgames/unsigned/UnsignedByte.java
Modified: libraries/unsigned/src/org/pocketgames/unsigned/UnsignedByte.java
===================================================================
--- libraries/unsigned/src/org/pocketgames/unsigned/UnsignedByte.java 2008-01-12 12:58:27 UTC (rev 226)
+++ libraries/unsigned/src/org/pocketgames/unsigned/UnsignedByte.java 2008-01-12 12:58:50 UTC (rev 227)
@@ -31,12 +31,14 @@
implements Comparable<UnsignedByte>
{
/**
- * A constant holding the maximum value an <code>unsigned byte</code> can have, 2^8.
+ * A constant holding the maximum value an <code>unsigned byte</code> can
+ * have, 2^8.
*/
public static int MAX_VALUE = 256;
/**
- * A constant holding the minimum value an <code>unsigned byte</code> can have, 0.
+ * A constant holding the minimum value an <code>unsigned byte</code> can
+ * have, 0.
*/
public static int MIN_VALUE = 0;
@@ -53,8 +55,9 @@
/**
* Creates an unsigned byte from a <code>byte</code>.
- * Note that negative values are treated as positive values (ie., if <code>b</code> is negative,
- * then the real value stored is <code>UnsignedByte.MAX_VALUE + b</code>).
+ * Note that negative values are treated as positive values (if
+ * <code>b</code> is negative, then the real value stored is
+ * <code>UnsignedByte.MAX_VALUE + b</code>).
* @param b the value to be stored, in signed format.
*/
public UnsignedByte (byte b)
@@ -98,8 +101,10 @@
}
/**
- * Returns the value of this <code>UnsignedByte</code> as a <code>double</code>.
- * @return the numeric value represented by this object after conversion to type <code>double</code>.
+ * Returns the value of this <code>UnsignedByte</code> as a
+ * <code>double</code>.
+ * @return the numeric value represented by this object after conversion to
+ * type <code>double</code>.
*/
public double doubleValue ()
{
@@ -107,8 +112,10 @@
}
/**
- * Returns the value of this <code>UnsignedByte</code> as a <code>float</code>.
- * @return the numeric value represented by this object after conversion to type <code>float</code>.
+ * Returns the value of this <code>UnsignedByte</code> as a
+ * <code>float</code>.
+ * @return the numeric value represented by this object after conversion to
+ * type <code>float</code>.
*/
public float floatValue ()
{
@@ -116,8 +123,10 @@
}
/**
- * Returns the value of this <code>UnsignedByte</code> as a <code>long</code>.
- * @return the numeric value represented by this object after conversion to type <code>long</code>.
+ * Returns the value of this <code>UnsignedByte</code> as a
+ * <code>long</code>.
+ * @return the numeric value represented by this object after conversion to
+ * type <code>long</code>.
*/
public long longValue ()
{
@@ -125,8 +134,10 @@
}
/**
- * Returns the value of this <code>UnsignedByte</code> as a <code>int</code>.
- * @return the numeric value represented by this object after conversion to type <code>int</code>.
+ * Returns the value of this <code>UnsignedByte</code> as a
+ * <code>int</code>.
+ * @return the numeric value represented by this object after conversion to
+ * type <code>int</code>.
*/
public int intValue ()
{
@@ -135,7 +146,8 @@
/**
* Returns the value of this <code>UnsignedByte</code> as a <code>byte</code>.
- * @return the numeric value represented by this object after conversion to type <code>byte</code>.
+ * @return the numeric value represented by this object after conversion to
+ * type <code>byte</code>.
*/
public byte byteValue ()
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ido...@us...> - 2008-01-12 12:58:23
|
Revision: 226
http://pocketgames.svn.sourceforge.net/pocketgames/?rev=226&view=rev
Author: idominguez
Date: 2008-01-12 04:58:27 -0800 (Sat, 12 Jan 2008)
Log Message:
-----------
Javadoc comments and two minor changes
Modified Paths:
--------------
libraries/unsigned/src/org/pocketgames/unsigned/UnsignedByte.java
Modified: libraries/unsigned/src/org/pocketgames/unsigned/UnsignedByte.java
===================================================================
--- libraries/unsigned/src/org/pocketgames/unsigned/UnsignedByte.java 2008-01-12 12:58:03 UTC (rev 225)
+++ libraries/unsigned/src/org/pocketgames/unsigned/UnsignedByte.java 2008-01-12 12:58:27 UTC (rev 226)
@@ -20,17 +20,43 @@
package org.pocketgames.unsigned;
/**
+ * This class represents an unsigned byte. It has methods to
+ * convert it to different values that can be used with Java's arithmetic
+ * operators.
+ *
* @author Ivan Perez-Dominguez
*/
public class UnsignedByte
extends Number
implements Comparable<UnsignedByte>
{
+ /**
+ * A constant holding the maximum value an <code>unsigned byte</code> can have, 2^8.
+ */
+ public static int MAX_VALUE = 256;
+
+ /**
+ * A constant holding the minimum value an <code>unsigned byte</code> can have, 0.
+ */
public static int MIN_VALUE = 0;
- public static int MAX_VALUE = 256;
+
+ /**
+ * The number of bits used to represent an <code>UnsignedByte</code> value
+ * in two's complement binary form.
+ */
public static int SIZE = Short.SIZE;
+
+ /**
+ * The value stored in this UnsignedByte.
+ */
private final short val;
+ /**
+ * Creates an unsigned byte from a <code>byte</code>.
+ * Note that negative values are treated as positive values (ie., if <code>b</code> is negative,
+ * then the real value stored is <code>UnsignedByte.MAX_VALUE + b</code>).
+ * @param b the value to be stored, in signed format.
+ */
public UnsignedByte (byte b)
{
if (b >= 0)
@@ -43,47 +69,89 @@
}
}
+ /**
+ * Creates an unsigned byte from a <code>short</code>.
+ * @param s the value to be stored, in signed format.
+ * @throws IllegalArgumentException if <code>s</code> is out of range.
+ */
public UnsignedByte (short s)
+ throws IllegalArgumentException
{
- if (s < 0)
+ if (s < MIN_VALUE || s >= MAX_VALUE)
throw new IllegalArgumentException();
else
this.val = s;
}
- public UnsignedByte (int i) throws IllegalArgumentException
+ /**
+ * Creates an unsigned byte from an <code>int</code>.
+ * @param i the value to be stored, in signed format.
+ * @throws IllegalArgumentException if <code>i</code> is out of range.
+ */
+ public UnsignedByte (int i)
+ throws IllegalArgumentException
{
- if (i < 0 || i >= 256)
+ if (i < MIN_VALUE || i >= MAX_VALUE)
throw new IllegalArgumentException();
else
this.val = (short)i;
}
+ /**
+ * Returns the value of this <code>UnsignedByte</code> as a <code>double</code>.
+ * @return the numeric value represented by this object after conversion to type <code>double</code>.
+ */
public double doubleValue ()
{
return this.val;
}
+ /**
+ * Returns the value of this <code>UnsignedByte</code> as a <code>float</code>.
+ * @return the numeric value represented by this object after conversion to type <code>float</code>.
+ */
public float floatValue ()
{
return this.val;
}
+ /**
+ * Returns the value of this <code>UnsignedByte</code> as a <code>long</code>.
+ * @return the numeric value represented by this object after conversion to type <code>long</code>.
+ */
public long longValue ()
{
return this.val;
}
+ /**
+ * Returns the value of this <code>UnsignedByte</code> as a <code>int</code>.
+ * @return the numeric value represented by this object after conversion to type <code>int</code>.
+ */
public int intValue ()
{
return this.val;
}
+ /**
+ * Returns the value of this <code>UnsignedByte</code> as a <code>byte</code>.
+ * @return the numeric value represented by this object after conversion to type <code>byte</code>.
+ */
public byte byteValue ()
{
return (byte)this.val;
}
+ /**
+ * Compares two <code>UnsignedByte</code> objects numerically.
+ * @param i the <code>UnsignedByte</code> to be compared.
+ * @return the value 0 if this <code>UnsignedByte</code> is equal to the
+ * argument <code>UnsignedByte</code>; a value less than 0 if this
+ * <code>UnsignedByte</code> is numerically less than the argument
+ * <code>UnsignedByte</code>; and a value greater than 0 if this
+ * <code>UnsignedByte</code> is numerically greater than the argument
+ * <code>UnsignedByte</code> (unsigned comparison).
+ */
public int compareTo (UnsignedByte i)
{
if (this.val < i.val)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ido...@us...> - 2008-01-12 12:58:03
|
Revision: 225
http://pocketgames.svn.sourceforge.net/pocketgames/?rev=225&view=rev
Author: idominguez
Date: 2008-01-12 04:58:03 -0800 (Sat, 12 Jan 2008)
Log Message:
-----------
Moving to version 0.2
Modified Paths:
--------------
libraries/unsigned/VERSION
Modified: libraries/unsigned/VERSION
===================================================================
--- libraries/unsigned/VERSION 2008-01-12 03:53:10 UTC (rev 224)
+++ libraries/unsigned/VERSION 2008-01-12 12:58:03 UTC (rev 225)
@@ -1 +1 @@
-0.1
\ No newline at end of file
+0.2
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ido...@us...> - 2008-01-12 03:53:04
|
Revision: 224
http://pocketgames.svn.sourceforge.net/pocketgames/?rev=224&view=rev
Author: idominguez
Date: 2008-01-11 19:53:10 -0800 (Fri, 11 Jan 2008)
Log Message:
-----------
Style change
Modified Paths:
--------------
libraries/cab/src/org/pocketgames/cab/parser/CabParser.java
Modified: libraries/cab/src/org/pocketgames/cab/parser/CabParser.java
===================================================================
--- libraries/cab/src/org/pocketgames/cab/parser/CabParser.java 2008-01-12 03:52:49 UTC (rev 223)
+++ libraries/cab/src/org/pocketgames/cab/parser/CabParser.java 2008-01-12 03:53:10 UTC (rev 224)
@@ -30,7 +30,7 @@
int cbCFHeader; /* (optional) size of per-cabinet reserved area */
short cbCFFolder; /* (optional) size of per-folder reserved area */
short cbCFData; /* (optional) size of per-datablock reserved area */
- short abReserve[]; /* (optional) per-cabinet reserved area */
+ short[] abReserve; /* (optional) per-cabinet reserved area */
short szCabinetPrev[]; /* (optional) name of previous cabinet file */
short szDiskPrev[]; /* (optional) name of previous disk */
short szCabinetNext[]; /* (optional) name of next cabinet file */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ido...@us...> - 2008-01-12 03:52:50
|
Revision: 223
http://pocketgames.svn.sourceforge.net/pocketgames/?rev=223&view=rev
Author: idominguez
Date: 2008-01-11 19:52:49 -0800 (Fri, 11 Jan 2008)
Log Message:
-----------
PrintBINARY filled in
Modified Paths:
--------------
libraries/cab/src/org/pocketgames/cab/installdata/backend/PrinterValue.java
Modified: libraries/cab/src/org/pocketgames/cab/installdata/backend/PrinterValue.java
===================================================================
--- libraries/cab/src/org/pocketgames/cab/installdata/backend/PrinterValue.java 2008-01-12 03:52:25 UTC (rev 222)
+++ libraries/cab/src/org/pocketgames/cab/installdata/backend/PrinterValue.java 2008-01-12 03:52:49 UTC (rev 223)
@@ -27,8 +27,7 @@
public static byte[] printBINARY (BINARY b)
{
- byte[] ret = new byte[0];
- return ret;
+ return b.getList();
}
public static byte[] printMULTI_SZ (MULTI_SZ m)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ido...@us...> - 2008-01-12 03:52:21
|
Revision: 222
http://pocketgames.svn.sourceforge.net/pocketgames/?rev=222&view=rev
Author: idominguez
Date: 2008-01-11 19:52:25 -0800 (Fri, 11 Jan 2008)
Log Message:
-----------
PrintDWORD filled in
Modified Paths:
--------------
libraries/cab/src/org/pocketgames/cab/installdata/backend/PrinterValue.java
Modified: libraries/cab/src/org/pocketgames/cab/installdata/backend/PrinterValue.java
===================================================================
--- libraries/cab/src/org/pocketgames/cab/installdata/backend/PrinterValue.java 2008-01-12 03:51:57 UTC (rev 221)
+++ libraries/cab/src/org/pocketgames/cab/installdata/backend/PrinterValue.java 2008-01-12 03:52:25 UTC (rev 222)
@@ -48,7 +48,6 @@
public static byte[] printDWORD (DWORD d)
{
- byte[] ret = new byte[0];
- return ret;
+ return toWord32 (d.getVal());
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ido...@us...> - 2008-01-12 03:51:52
|
Revision: 221
http://pocketgames.svn.sourceforge.net/pocketgames/?rev=221&view=rev
Author: idominguez
Date: 2008-01-11 19:51:57 -0800 (Fri, 11 Jan 2008)
Log Message:
-----------
One unnecessary line per kind of value removed
Modified Paths:
--------------
libraries/cab/src/org/pocketgames/cab/installdata/frontend/ParserREGKEY.java
Modified: libraries/cab/src/org/pocketgames/cab/installdata/frontend/ParserREGKEY.java
===================================================================
--- libraries/cab/src/org/pocketgames/cab/installdata/frontend/ParserREGKEY.java 2008-01-12 03:51:29 UTC (rev 220)
+++ libraries/cab/src/org/pocketgames/cab/installdata/frontend/ParserREGKEY.java 2008-01-12 03:51:57 UTC (rev 221)
@@ -34,15 +34,13 @@
if (bit0 && bit16)
{
int v = fromWord (nextWord32 (content, os+12+posNull));
- DWORD d = new DWORD (v);
- val = d;
+ val = new DWORD (v);
}
else if (!bit0 && !bit16)
{
byte[] rest = new byte[len - posNull];
System.arraycopy (content, os+12+posNull+1, rest, 0, len-posNull-1);
- SZ sz = new SZ(new String (rest));
- val = sz;
+ val = new SZ(new String (rest));
}
else if (!bit0 && bit16)
{
@@ -74,15 +72,13 @@
}
}
}
- MULTI_SZ sz = new MULTI_SZ(l);
- val = sz;
+ val = new MULTI_SZ(l);
}
else // if (bit0 && !bit16)
{
byte[] rest = new byte[len - posNull];
System.arraycopy (content, os+12+posNull+1, rest, 0, len-posNull-1);
- BINARY binary = new BINARY(rest);
- val = binary;
+ val = new BINARY(rest);
}
return new Pair<Integer,REGKEY>
(os + 12 + len,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ido...@us...> - 2008-01-12 03:51:24
|
Revision: 220
http://pocketgames.svn.sourceforge.net/pocketgames/?rev=220&view=rev
Author: idominguez
Date: 2008-01-11 19:51:29 -0800 (Fri, 11 Jan 2008)
Log Message:
-----------
internal value in DWORD made private -> call to main constructor of DWORD changed
Modified Paths:
--------------
libraries/cab/src/org/pocketgames/cab/installdata/frontend/ParserREGKEY.java
Modified: libraries/cab/src/org/pocketgames/cab/installdata/frontend/ParserREGKEY.java
===================================================================
--- libraries/cab/src/org/pocketgames/cab/installdata/frontend/ParserREGKEY.java 2008-01-12 03:51:04 UTC (rev 219)
+++ libraries/cab/src/org/pocketgames/cab/installdata/frontend/ParserREGKEY.java 2008-01-12 03:51:29 UTC (rev 220)
@@ -34,8 +34,7 @@
if (bit0 && bit16)
{
int v = fromWord (nextWord32 (content, os+12+posNull));
- DWORD d = new DWORD ();
- d.v = v;
+ DWORD d = new DWORD (v);
val = d;
}
else if (!bit0 && !bit16)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ido...@us...> - 2008-01-12 03:50:59
|
Revision: 219
http://pocketgames.svn.sourceforge.net/pocketgames/?rev=219&view=rev
Author: idominguez
Date: 2008-01-11 19:51:04 -0800 (Fri, 11 Jan 2008)
Log Message:
-----------
internal value in DWORD made private
Modified Paths:
--------------
libraries/cab/src/org/pocketgames/cab/installdata/data/DWORD.java
Modified: libraries/cab/src/org/pocketgames/cab/installdata/data/DWORD.java
===================================================================
--- libraries/cab/src/org/pocketgames/cab/installdata/data/DWORD.java 2008-01-12 03:50:37 UTC (rev 218)
+++ libraries/cab/src/org/pocketgames/cab/installdata/data/DWORD.java 2008-01-12 03:51:04 UTC (rev 219)
@@ -1,7 +1,18 @@
package org.pocketgames.cab.installdata.data;
-public class DWORD extends Value
+public class DWORD extends Value
{
- public int v;
+ private int v;
+
+ public DWORD (int val)
+ {
+ v = val;
+ }
+
+ public int getVal ()
+ {
+ return this.v;
+ }
+
public void accept (Visitor v) {}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ido...@us...> - 2008-01-12 03:50:31
|
Revision: 218
http://pocketgames.svn.sourceforge.net/pocketgames/?rev=218&view=rev
Author: idominguez
Date: 2008-01-11 19:50:37 -0800 (Fri, 11 Jan 2008)
Log Message:
-----------
PrintMULTI_SZ uses fromString instead of reimplementing it from scratch
Modified Paths:
--------------
libraries/cab/src/org/pocketgames/cab/installdata/backend/PrinterValue.java
Modified: libraries/cab/src/org/pocketgames/cab/installdata/backend/PrinterValue.java
===================================================================
--- libraries/cab/src/org/pocketgames/cab/installdata/backend/PrinterValue.java 2008-01-12 03:50:05 UTC (rev 217)
+++ libraries/cab/src/org/pocketgames/cab/installdata/backend/PrinterValue.java 2008-01-12 03:50:37 UTC (rev 218)
@@ -39,11 +39,8 @@
int i = 0;
for (String s : sl)
{
- byte[] st = s.getBytes();
- len += st.length + 1;
- list[i] = new byte[st.length + 1];
- System.arraycopy (st, 0, list[i], 0, st.length);
- list[i][st.length] = 0;
+ list[i] = fromString(s);
+ len += list[i].length;
i++;
}
return flatten (list, len);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ido...@us...> - 2008-01-12 03:50:00
|
Revision: 217
http://pocketgames.svn.sourceforge.net/pocketgames/?rev=217&view=rev
Author: idominguez
Date: 2008-01-11 19:50:05 -0800 (Fri, 11 Jan 2008)
Log Message:
-----------
PrintSZ uses fromString instead of reimplementing it from scratch
Modified Paths:
--------------
libraries/cab/src/org/pocketgames/cab/installdata/backend/PrinterValue.java
Modified: libraries/cab/src/org/pocketgames/cab/installdata/backend/PrinterValue.java
===================================================================
--- libraries/cab/src/org/pocketgames/cab/installdata/backend/PrinterValue.java 2008-01-12 03:49:36 UTC (rev 216)
+++ libraries/cab/src/org/pocketgames/cab/installdata/backend/PrinterValue.java 2008-01-12 03:50:05 UTC (rev 217)
@@ -22,11 +22,7 @@
public static byte[] printSZ (SZ s)
{
- byte[] st = s.getString().getBytes();
- byte[] ret = new byte[st.length + 1];
- System.arraycopy (st, 0, ret, 0, st.length);
- ret[st.length] = 0;
- return ret;
+ return fromString (s.getString());
}
public static byte[] printBINARY (BINARY b)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ido...@us...> - 2008-01-12 03:49:31
|
Revision: 216
http://pocketgames.svn.sourceforge.net/pocketgames/?rev=216&view=rev
Author: idominguez
Date: 2008-01-11 19:49:36 -0800 (Fri, 11 Jan 2008)
Log Message:
-----------
New imports added, printMULTI_SZ method filled in
Modified Paths:
--------------
libraries/cab/src/org/pocketgames/cab/installdata/backend/PrinterValue.java
Modified: libraries/cab/src/org/pocketgames/cab/installdata/backend/PrinterValue.java
===================================================================
--- libraries/cab/src/org/pocketgames/cab/installdata/backend/PrinterValue.java 2008-01-12 03:49:11 UTC (rev 215)
+++ libraries/cab/src/org/pocketgames/cab/installdata/backend/PrinterValue.java 2008-01-12 03:49:36 UTC (rev 216)
@@ -2,6 +2,9 @@
import org.pocketgames.cab.installdata.data.*;
import static org.pocketgames.cab.installdata.Word.toWord16;
import static org.pocketgames.cab.installdata.Word.toWord32;
+import static org.pocketgames.cab.installdata.backend.CabInstallDataPrinter.fromString;
+import static org.pocketgames.cab.installdata.backend.CabInstallDataPrinter.flatten;
+import java.util.Vector;
public class PrinterValue
{
@@ -34,8 +37,20 @@
public static byte[] printMULTI_SZ (MULTI_SZ m)
{
- byte[] ret = new byte[0];
- return ret;
+ int len = 0;
+ Vector<String> sl = m.getStringList();
+ byte[][] list = new byte[sl.size()][];
+ int i = 0;
+ for (String s : sl)
+ {
+ byte[] st = s.getBytes();
+ len += st.length + 1;
+ list[i] = new byte[st.length + 1];
+ System.arraycopy (st, 0, list[i], 0, st.length);
+ list[i][st.length] = 0;
+ i++;
+ }
+ return flatten (list, len);
}
public static byte[] printDWORD (DWORD d)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ido...@us...> - 2008-01-12 03:49:05
|
Revision: 215
http://pocketgames.svn.sourceforge.net/pocketgames/?rev=215&view=rev
Author: idominguez
Date: 2008-01-11 19:49:11 -0800 (Fri, 11 Jan 2008)
Log Message:
-----------
flatten and fromString made public
Modified Paths:
--------------
libraries/cab/src/org/pocketgames/cab/installdata/backend/CabInstallDataPrinter.java
Modified: libraries/cab/src/org/pocketgames/cab/installdata/backend/CabInstallDataPrinter.java
===================================================================
--- libraries/cab/src/org/pocketgames/cab/installdata/backend/CabInstallDataPrinter.java 2008-01-12 03:48:44 UTC (rev 214)
+++ libraries/cab/src/org/pocketgames/cab/installdata/backend/CabInstallDataPrinter.java 2008-01-12 03:49:11 UTC (rev 215)
@@ -245,7 +245,7 @@
return flatten (files, len);
}
- private byte[] flatten (byte[][] list, int length)
+ public static byte[] flatten (byte[][] list, int length)
{
byte[] ret = new byte[length];
int os = 0;
@@ -258,7 +258,7 @@
}
- private byte[] fromString (String s)
+ public static byte[] fromString (String s)
{
byte[] m = s.getBytes();
byte[] r = new byte[m.length+1];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ido...@us...> - 2008-01-12 03:49:00
|
Revision: 211
http://pocketgames.svn.sourceforge.net/pocketgames/?rev=211&view=rev
Author: idominguez
Date: 2008-01-11 19:47:30 -0800 (Fri, 11 Jan 2008)
Log Message:
-----------
PrinterREGKEY will print the value when calculated
Modified Paths:
--------------
libraries/cab/src/org/pocketgames/cab/installdata/backend/PrinterREGKEY.java
Modified: libraries/cab/src/org/pocketgames/cab/installdata/backend/PrinterREGKEY.java
===================================================================
--- libraries/cab/src/org/pocketgames/cab/installdata/backend/PrinterREGKEY.java 2008-01-12 03:47:06 UTC (rev 210)
+++ libraries/cab/src/org/pocketgames/cab/installdata/backend/PrinterREGKEY.java 2008-01-12 03:47:30 UTC (rev 211)
@@ -7,7 +7,8 @@
{
public static byte[] print (REGKEY r)
{
- int len = 10 + r.getString().length() + 1;
+ byte[] val = PrinterValue.print (r.getValue());
+ int len = 10 + r.getString().length() + 1 + val.length;
byte[] ret = new byte[len];
System.arraycopy (toWord16 (r.getId()), 0, ret, 0, 2);
System.arraycopy (toWord16 (r.getHiveId()), 0, ret, 2, 2);
@@ -16,8 +17,7 @@
byte[] st = r.getString().getBytes();
System.arraycopy (st, 0, ret, 10, st.length);
ret[10 + st.length] = 0;
- // Value
- // ret[len-1] = 0;
+ System.arraycopy (val, 0, ret, 10+st.length+1, val.length);
return ret;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ido...@us...> - 2008-01-12 03:48:42
|
Revision: 214
http://pocketgames.svn.sourceforge.net/pocketgames/?rev=214&view=rev
Author: idominguez
Date: 2008-01-11 19:48:44 -0800 (Fri, 11 Jan 2008)
Log Message:
-----------
SZ print operation filled in
Modified Paths:
--------------
libraries/cab/src/org/pocketgames/cab/installdata/backend/PrinterValue.java
Modified: libraries/cab/src/org/pocketgames/cab/installdata/backend/PrinterValue.java
===================================================================
--- libraries/cab/src/org/pocketgames/cab/installdata/backend/PrinterValue.java 2008-01-12 03:48:18 UTC (rev 213)
+++ libraries/cab/src/org/pocketgames/cab/installdata/backend/PrinterValue.java 2008-01-12 03:48:44 UTC (rev 214)
@@ -19,7 +19,10 @@
public static byte[] printSZ (SZ s)
{
- byte[] ret = new byte[0];
+ byte[] st = s.getString().getBytes();
+ byte[] ret = new byte[st.length + 1];
+ System.arraycopy (st, 0, ret, 0, st.length);
+ ret[st.length] = 0;
return ret;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ido...@us...> - 2008-01-12 03:48:12
|
Revision: 213
http://pocketgames.svn.sourceforge.net/pocketgames/?rev=213&view=rev
Author: idominguez
Date: 2008-01-11 19:48:18 -0800 (Fri, 11 Jan 2008)
Log Message:
-----------
Indentation changes
Modified Paths:
--------------
libraries/cab/src/org/pocketgames/cab/installdata/data/SZ.java
Modified: libraries/cab/src/org/pocketgames/cab/installdata/data/SZ.java
===================================================================
--- libraries/cab/src/org/pocketgames/cab/installdata/data/SZ.java 2008-01-12 03:47:56 UTC (rev 212)
+++ libraries/cab/src/org/pocketgames/cab/installdata/data/SZ.java 2008-01-12 03:48:18 UTC (rev 213)
@@ -13,5 +13,7 @@
{
return this.s;
}
- public void accept (Visitor v) {}
+ public void accept (Visitor v)
+ {
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ido...@us...> - 2008-01-12 03:47:51
|
Revision: 212
http://pocketgames.svn.sourceforge.net/pocketgames/?rev=212&view=rev
Author: idominguez
Date: 2008-01-11 19:47:56 -0800 (Fri, 11 Jan 2008)
Log Message:
-----------
Indentation changes
Modified Paths:
--------------
libraries/cab/src/org/pocketgames/cab/installdata/backend/PrinterValue.java
Modified: libraries/cab/src/org/pocketgames/cab/installdata/backend/PrinterValue.java
===================================================================
--- libraries/cab/src/org/pocketgames/cab/installdata/backend/PrinterValue.java 2008-01-12 03:47:30 UTC (rev 211)
+++ libraries/cab/src/org/pocketgames/cab/installdata/backend/PrinterValue.java 2008-01-12 03:47:56 UTC (rev 212)
@@ -8,32 +8,36 @@
public static byte[] print (Value r)
{
if (r instanceof SZ)
- return printSZ ((SZ) r);
+ return printSZ ((SZ) r);
else if (r instanceof BINARY)
- return printBINARY ((BINARY) r);
+ return printBINARY ((BINARY) r);
else if (r instanceof MULTI_SZ)
- return printMULTI_SZ ((MULTI_SZ) r);
+ return printMULTI_SZ ((MULTI_SZ) r);
else
- return printDWORD ((DWORD) r);
+ return printDWORD ((DWORD) r);
}
- public static byte[] printSZ (SZ s) {
- byte[] ret = new byte[0];
- return ret;
+ public static byte[] printSZ (SZ s)
+ {
+ byte[] ret = new byte[0];
+ return ret;
}
- public static byte[] printBINARY (BINARY b) {
- byte[] ret = new byte[0];
- return ret;
+ public static byte[] printBINARY (BINARY b)
+ {
+ byte[] ret = new byte[0];
+ return ret;
}
- public static byte[] printMULTI_SZ (MULTI_SZ m) {
- byte[] ret = new byte[0];
- return ret;
+ public static byte[] printMULTI_SZ (MULTI_SZ m)
+ {
+ byte[] ret = new byte[0];
+ return ret;
}
- public static byte[] printDWORD (DWORD d) {
- byte[] ret = new byte[0];
- return ret;
+ public static byte[] printDWORD (DWORD d)
+ {
+ byte[] ret = new byte[0];
+ return ret;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ido...@us...> - 2008-01-12 03:47:48
|
Revision: 208
http://pocketgames.svn.sourceforge.net/pocketgames/?rev=208&view=rev
Author: idominguez
Date: 2008-01-11 19:46:18 -0800 (Fri, 11 Jan 2008)
Log Message:
-----------
Operations in the main CabHeaderPrinter calling PrinterREGKEY
Modified Paths:
--------------
libraries/cab/src/org/pocketgames/cab/installdata/backend/CabInstallDataPrinter.java
Modified: libraries/cab/src/org/pocketgames/cab/installdata/backend/CabInstallDataPrinter.java
===================================================================
--- libraries/cab/src/org/pocketgames/cab/installdata/backend/CabInstallDataPrinter.java 2008-01-12 03:45:55 UTC (rev 207)
+++ libraries/cab/src/org/pocketgames/cab/installdata/backend/CabInstallDataPrinter.java 2008-01-12 03:46:18 UTC (rev 208)
@@ -17,6 +17,7 @@
import org.pocketgames.cab.installdata.data.FILE;
import org.pocketgames.cab.installdata.data.LINK;
import org.pocketgames.cab.installdata.data.REGHIVE;
+import org.pocketgames.cab.installdata.data.REGKEY;
public class CabInstallDataPrinter
{
@@ -35,6 +36,7 @@
int numberOfFiles = this.head.files.size();
byte[] reghives = this.getRegHivesBytes();
int numberOfRegHives = this.head.reghives.size();
+ byte[] regkeys = this.getRegKeysBytes();
int numberOfRegKeys = this.head.regkeys.size();
byte[] links = this.getLinksBytes();
int numberOfLinks = this.head.links.size();
@@ -42,8 +44,8 @@
int offsetDirs = offsetStrings + strings.length;
int offsetFiles = offsetDirs + dirs.length;
int offsetRegHives = offsetFiles + files.length;
- int offsetRegKeys = offsetRegHives;
- int offsetLinks = offsetRegKeys; // + keys.length;
+ int offsetRegKeys = offsetRegHives + reghives.length;
+ int offsetLinks = offsetRegKeys + regkeys.length;
int offsetAppName = offsetLinks + links.length;
byte[] appname = this.getAppName();
int offsetProvider = offsetAppName + appname.length;
@@ -183,6 +185,21 @@
return flatten (hives, len);
}
+ private byte[] getRegKeysBytes()
+ {
+ int len = 0;
+ int i = 0;
+ // Transforms all the strings into bytes and calculates the length
+ byte[][] keys = new byte[this.head.regkeys.size()][];
+ for (REGKEY r : this.head.regkeys)
+ {
+ keys[i] = PrinterREGKEY.print (r);
+ len += keys[i++].length;
+ }
+ // Flattens the strings array, converting it into byte[]
+ return flatten (keys, len);
+ }
+
private byte[] getDirsBytes()
{
int len = 0;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ido...@us...> - 2008-01-12 03:47:47
|
Revision: 207
http://pocketgames.svn.sourceforge.net/pocketgames/?rev=207&view=rev
Author: idominguez
Date: 2008-01-11 19:45:55 -0800 (Fri, 11 Jan 2008)
Log Message:
-----------
Empty printer
Added Paths:
-----------
libraries/cab/src/org/pocketgames/cab/installdata/backend/PrinterREGKEY.java
Added: libraries/cab/src/org/pocketgames/cab/installdata/backend/PrinterREGKEY.java
===================================================================
--- libraries/cab/src/org/pocketgames/cab/installdata/backend/PrinterREGKEY.java (rev 0)
+++ libraries/cab/src/org/pocketgames/cab/installdata/backend/PrinterREGKEY.java 2008-01-12 03:45:55 UTC (rev 207)
@@ -0,0 +1,23 @@
+package org.pocketgames.cab.installdata.backend;
+import org.pocketgames.cab.installdata.data.*;
+import static org.pocketgames.cab.installdata.Word.toWord16;
+import static org.pocketgames.cab.installdata.Word.toWord32;
+
+public class PrinterREGKEY
+{
+ public static byte[] print (REGKEY r)
+ {
+ // int len = 8 + r.getName().length() + 2;
+ // byte[] ret = new byte[len];
+ byte[] ret = new byte[0];
+ // System.arraycopy (toWord16 (r.getId()), 0, ret, 0, 2);
+ // System.arraycopy (toWord16 (r.getRoot()), 0, ret, 2, 2);
+ // System.arraycopy (toWord16 (r.getIgnore()), 0, ret, 4, 2);
+ // System.arraycopy (toWord16 (r.getName().length() + 2), 0, ret, 6, 2);
+ // byte[] st = r.getName().getBytes();
+ // System.arraycopy (st, 0, ret, 8, r.getName().length());
+ // ret[len-2] = 0;
+ // ret[len-1] = 0;
+ return ret;
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ido...@us...> - 2008-01-12 03:47:04
|
Revision: 210
http://pocketgames.svn.sourceforge.net/pocketgames/?rev=210&view=rev
Author: idominguez
Date: 2008-01-11 19:47:06 -0800 (Fri, 11 Jan 2008)
Log Message:
-----------
Empty functions to print Values
Added Paths:
-----------
libraries/cab/src/org/pocketgames/cab/installdata/backend/PrinterValue.java
Added: libraries/cab/src/org/pocketgames/cab/installdata/backend/PrinterValue.java
===================================================================
--- libraries/cab/src/org/pocketgames/cab/installdata/backend/PrinterValue.java (rev 0)
+++ libraries/cab/src/org/pocketgames/cab/installdata/backend/PrinterValue.java 2008-01-12 03:47:06 UTC (rev 210)
@@ -0,0 +1,39 @@
+package org.pocketgames.cab.installdata.backend;
+import org.pocketgames.cab.installdata.data.*;
+import static org.pocketgames.cab.installdata.Word.toWord16;
+import static org.pocketgames.cab.installdata.Word.toWord32;
+
+public class PrinterValue
+{
+ public static byte[] print (Value r)
+ {
+ if (r instanceof SZ)
+ return printSZ ((SZ) r);
+ else if (r instanceof BINARY)
+ return printBINARY ((BINARY) r);
+ else if (r instanceof MULTI_SZ)
+ return printMULTI_SZ ((MULTI_SZ) r);
+ else
+ return printDWORD ((DWORD) r);
+ }
+
+ public static byte[] printSZ (SZ s) {
+ byte[] ret = new byte[0];
+ return ret;
+ }
+
+ public static byte[] printBINARY (BINARY b) {
+ byte[] ret = new byte[0];
+ return ret;
+ }
+
+ public static byte[] printMULTI_SZ (MULTI_SZ m) {
+ byte[] ret = new byte[0];
+ return ret;
+ }
+
+ public static byte[] printDWORD (DWORD d) {
+ byte[] ret = new byte[0];
+ return ret;
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ido...@us...> - 2008-01-12 03:46:34
|
Revision: 209
http://pocketgames.svn.sourceforge.net/pocketgames/?rev=209&view=rev
Author: idominguez
Date: 2008-01-11 19:46:40 -0800 (Fri, 11 Jan 2008)
Log Message:
-----------
PrinterREGKEY filled (Value is not printed yet)
Modified Paths:
--------------
libraries/cab/src/org/pocketgames/cab/installdata/backend/PrinterREGKEY.java
Modified: libraries/cab/src/org/pocketgames/cab/installdata/backend/PrinterREGKEY.java
===================================================================
--- libraries/cab/src/org/pocketgames/cab/installdata/backend/PrinterREGKEY.java 2008-01-12 03:46:18 UTC (rev 208)
+++ libraries/cab/src/org/pocketgames/cab/installdata/backend/PrinterREGKEY.java 2008-01-12 03:46:40 UTC (rev 209)
@@ -7,16 +7,16 @@
{
public static byte[] print (REGKEY r)
{
- // int len = 8 + r.getName().length() + 2;
- // byte[] ret = new byte[len];
- byte[] ret = new byte[0];
- // System.arraycopy (toWord16 (r.getId()), 0, ret, 0, 2);
- // System.arraycopy (toWord16 (r.getRoot()), 0, ret, 2, 2);
- // System.arraycopy (toWord16 (r.getIgnore()), 0, ret, 4, 2);
- // System.arraycopy (toWord16 (r.getName().length() + 2), 0, ret, 6, 2);
- // byte[] st = r.getName().getBytes();
- // System.arraycopy (st, 0, ret, 8, r.getName().length());
- // ret[len-2] = 0;
+ int len = 10 + r.getString().length() + 1;
+ byte[] ret = new byte[len];
+ System.arraycopy (toWord16 (r.getId()), 0, ret, 0, 2);
+ System.arraycopy (toWord16 (r.getHiveId()), 0, ret, 2, 2);
+ System.arraycopy (toWord16 (r.getIgnore()), 0, ret, 4, 2);
+ System.arraycopy (r.getTypeBytes(), 0, ret, 6, 4);
+ byte[] st = r.getString().getBytes();
+ System.arraycopy (st, 0, ret, 10, st.length);
+ ret[10 + st.length] = 0;
+ // Value
// ret[len-1] = 0;
return ret;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ido...@us...> - 2008-01-12 03:46:27
|
Revision: 206
http://pocketgames.svn.sourceforge.net/pocketgames/?rev=206&view=rev
Author: idominguez
Date: 2008-01-11 19:45:29 -0800 (Fri, 11 Jan 2008)
Log Message:
-----------
Number of regkeys properly calculated
Modified Paths:
--------------
libraries/cab/src/org/pocketgames/cab/installdata/backend/CabInstallDataPrinter.java
Modified: libraries/cab/src/org/pocketgames/cab/installdata/backend/CabInstallDataPrinter.java
===================================================================
--- libraries/cab/src/org/pocketgames/cab/installdata/backend/CabInstallDataPrinter.java 2008-01-10 20:19:08 UTC (rev 205)
+++ libraries/cab/src/org/pocketgames/cab/installdata/backend/CabInstallDataPrinter.java 2008-01-12 03:45:29 UTC (rev 206)
@@ -35,7 +35,7 @@
int numberOfFiles = this.head.files.size();
byte[] reghives = this.getRegHivesBytes();
int numberOfRegHives = this.head.reghives.size();
- int numberOfRegKeys = 0; //this.head.regkeys.size();
+ int numberOfRegKeys = this.head.regkeys.size();
byte[] links = this.getLinksBytes();
int numberOfLinks = this.head.links.size();
int offsetStrings = 100;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|